Conversation
|
The code in the screenshot is different from the linked one. The screenshot code uses domains directly whereas the linked code uses domains lib. It is also the case that the code spawns more than 8 domains? Both the recursive calls get passed with |
|
I don't think we should direct users to a beta release in the up-and-coming instructions. A separate callout would be better. Incidentally, I tend to use in order to avoid hardcoding the |
|
I would propose to have an Domainslib parallel loop as example rather than yet another Fibonacci's function with a double exponential slowdown. A parallel for (a vector addition maybe) seems to me both more recognizable and less subject to caveat. |
|
Also the first beta will be labelled |
|
I'm not entirely sure about using Domainslib in the code snippet. On the one hand, I understand that we want to recommend users to use it instead of using the Domain API directly. So the code would be closer to what users would to see "in the wild". On the other hand, the code snippet would then require installing |
|
I think it is probably better to add an instruction for installing |
|
Do you mean that it would be acceptable to use Domainslib in the code snippet if we added instructions on how to install the opam package in the OCaml 5 beta announcement? |
|
Yes, taking in account that installing the beta is not something that I expect new users to do without following some installation instructions, I think it would be fine to have some pointer for installing domainslib in those instructions. |
|
The playground presumably can have |
True, although I could imagine someone landing on the homepage, going to Get Started and installing OCaml 4.14, then trying to run the snippet. Reading the announcement, installing OCaml 5 beta and trying to run the snippet is one path the user could take, but there are many more they could take which would ultimately lead to a confusing error if we use something else than the standard library in the code snippet. Saying that I realize I'm arguing against the code I put in the PR: users would get an error because of the Domain module if they try to run the code after following the Get Started guide (which installs OCaml 4.14). I guess if we really want to show code that uses Eio/Domainslib I could try and change the code snippet to tell users they need to follow a certain guide to be able to run the code, but I have a preference for a code snippet they would be able to run no matter the environment. |
Wouldn't that depend on effects? (which the playground won't support since it's compiled with Jsoo) |
|
I think that there is some unavoidable tension here between having a showcase snippet that works anywhere and a representative snippet that looks like some code that might be used in OCaml 5. But maybe this is a sign that we don't want to switch the focus of the welcome code snippet? Looking at the current snippet, neither the |
Oops - I completely forgot about Domainslib's scheduler using effects 🤦 |
|
Looks like there are several good reasons not to include domainslib. If the playground is compiled with jsoo then even plain domain won't work, would it? JavaScript doesn't have parallelism. |
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
0661369 to
58a2599
Compare
|
I removed the parts that needed more discussion and only kept the banner for now, which links to the announcement post. I'm happy to revisit the code snippet in a second time. |
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
| <div class="pr-16 sm:px-16 sm:text-center"> | ||
| <p class="font-medium text-white"> | ||
| <span class="md:hidden">OCaml 5.0 is in beta!</span> | ||
| <span class="hidden md:inline">OCaml 5.0 is beta! OCaml 5.0 is the next major release of OCaml, which comes with support for shared-memory parallelism through domains and direct-style concurrency through algebraic effects!</span> |
There was a problem hiding this comment.
| <span class="hidden md:inline">OCaml 5.0 is beta! OCaml 5.0 is the next major release of OCaml, which comes with support for shared-memory parallelism through domains and direct-style concurrency through algebraic effects!</span> | |
| <span class="hidden md:inline">OCaml 5.0 is in beta! It is the next major release of OCaml, which comes with support for shared-memory parallelism through domains and direct-style concurrency through algebraic effects!</span> |
In preparation for the upcoming release of OCaml 5 Beta, this adds a banner to announce the release and redirect to the Up and Running page.
5.0.0~beta0Closes #590
cc @kayceesrk @avsm @Octachron
Note that the Up and Running guide is maybe not the best place to redirect users with instructions to try OCaml 5, since it contains other documentation like how to download and init opam. As an alternative, we could (1) create an announcement post that contains setup instructions, or (2) upload the release (manual and changelog with setup instructions) when the beta is out and overwrite it when the stable release is out. @dra27 and I thought the latter could be a good option.
Other open questions: