Skip to content

Update homepage for OCaml 5 Beta release#598

Merged
tmattio merged 11 commits intomainfrom
ocaml5-banner
Oct 13, 2022
Merged

Update homepage for OCaml 5 Beta release#598
tmattio merged 11 commits intomainfrom
ocaml5-banner

Conversation

@tmattio
Copy link
Copy Markdown
Collaborator

@tmattio tmattio commented Oct 8, 2022

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.

image

Closes #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:

  • Should we put the banner only on the homepage?
  • Should we make the cross button functional (this would require adding a cookie) or be removed
  • Is a banner the best way to promote the release? We could also update the hero to add a CTA with the same link

@kayceesrk
Copy link
Copy Markdown
Contributor

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 d - 1. Would showing the example with domainslib be too long? If so, what about a simple eio example?

@avsm
Copy link
Copy Markdown
Member

avsm commented Oct 9, 2022

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

opam switch create 5-latest --packages ocaml.5.0.0

in order to avoid hardcoding the ~release as that also gets rapidly out of date.

@Octachron
Copy link
Copy Markdown
Member

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.

@Octachron
Copy link
Copy Markdown
Member

Also the first beta will be labelled beta1: the alpha0 was supposed to be an exception and it leads to all kind of ordinal troubles: is beta0 the first beta release? the zeroth? What about beta1, would that be the first or second beta release?

@tmattio
Copy link
Copy Markdown
Collaborator Author

tmattio commented Oct 11, 2022

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 domainslib to be run. Users who visit the site, copy the code and try it on a project or a REPL would get an error. And if they are new users, they will probably not know what to do with the cryptic Unbound module Domainslib error. That's not a great first-time experience.

@Octachron
Copy link
Copy Markdown
Member

I think it is probably better to add an instruction for installing domainslib in the OCaml 5 beta guide (and mention the possible error in such guide).

@tmattio
Copy link
Copy Markdown
Collaborator Author

tmattio commented Oct 11, 2022

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?

@Octachron
Copy link
Copy Markdown
Member

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.

@dra27
Copy link
Copy Markdown
Member

dra27 commented Oct 11, 2022

The playground presumably can have domainslib?

@tmattio
Copy link
Copy Markdown
Collaborator Author

tmattio commented Oct 11, 2022

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.

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.

@tmattio
Copy link
Copy Markdown
Collaborator Author

tmattio commented Oct 11, 2022

The playground presumably can have domainslib?

Wouldn't that depend on effects? (which the playground won't support since it's compiled with Jsoo)

@Octachron
Copy link
Copy Markdown
Member

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 square function nor the factorial function would benefit from using Domain for instance.

@dra27
Copy link
Copy Markdown
Member

dra27 commented Oct 11, 2022

The playground presumably can have domainslib?

Wouldn't that depend on effects? (which the playground won't support since it's compiled with Jsoo)

Oops - I completely forgot about Domainslib's scheduler using effects 🤦

@kayceesrk
Copy link
Copy Markdown
Contributor

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.

@tmattio
Copy link
Copy Markdown
Collaborator Author

tmattio commented Oct 13, 2022

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.

@tmattio tmattio merged commit 0a3a5c3 into main Oct 13, 2022
@tmattio tmattio deleted the ocaml5-banner branch October 13, 2022 06:32
@cuihtlauac cuihtlauac mentioned this pull request Oct 20, 2022
sabine pushed a commit that referenced this pull request Oct 21, 2022
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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Information about OCaml 5

6 participants