Skip to content

Commit

Permalink
[create-pull-request] automated change (#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 22, 2023
1 parent 6611ef5 commit cc1ac8d
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 0 deletions.
14 changes: 14 additions & 0 deletions data/planet/ahrefs/building-react-server-components-in-ocaml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Building React Server Components in OCaml
description: 'Enhancing User Experience and Developer Productivity: implementing React
Server Components in OCaml at Ahrefs'
url: https://tech.ahrefs.com/building-react-server-components-in-ocaml-81c276713f19?source=rss----303662d88bae--ocaml
date: 2023-11-02T18:29:55-00:00
preview_image: https://miro.medium.com/v2/resize:fit:697/1*YsvzQSnttCQcxFPnA-DtfA.png
featured:
authors:
- Ahrefs
source:
---

<figure><img src="https://cdn-images-1.medium.com/max/697/1*YsvzQSnttCQcxFPnA-DtfA.png" alt=""/></figure><p>One of the main goals for our frontend team this year has been to make <a href="https://melange.re/">Melange</a> production-ready and integrate it further into the OCaml ecosystem. We have previously <a href="https://tech.ahrefs.com/ahrefs-is-now-built-with-melange-b14f5ec56df4">shared</a> how Melange integrates with <a href="https://dune.readthedocs.io/en/stable/melange.html">Dune</a> and <a href="https://github.com/ahrefs/opam-check-npm-deps">opam</a>, and how we are using it to drive our frontend&nbsp;needs.</p><p>Removing friction between Melange and OCaml has allowed us to explore projects that one couldn&rsquo;t even contemplate before. As an example, we embarked on an experiment <a href="https://discuss.ocaml.org/t/ann-rendering-react-in-ocaml/12133">to render React components to string using OCaml</a> on our servers. The objective was to enhance the user experience when loading Ahrefs product pages in web browsers without introducing the complexity of managing two implementations for each component. You can find a detailed explanation in David Sancho&rsquo;s <a href="https://sancho.dev/blog/server-side-rendering-react-in-ocaml">blog&nbsp;post</a>.</p><p>This exploration was successful, and we are already using the results in some production apps, such as <a href="https://wordcount.com/">wordcount.com</a>. We now have solid evidence that using OCaml to render React components server-side Blazingly Fast&trade;&#65039; is indeed attainable.</p><p>So our next step will be to double down on this effort. We want it&nbsp;all:</p><ul><li>Provide Ahrefs frontend developers with a first-class experience, enabling them to seamlessly use ReasonReact components on the&nbsp;server.</li><li>Improve Ahrefs user experience with faster loading and refreshing.</li></ul><p>Most of the applications on the <a href="https://app.ahrefs.com/">Ahrefs product site</a> are a series of dashboards that allow users to visualize web and SEO data in informative ways, and navigate through to gain more insights. Because we render a lot of data-intensive components, we believe that <a href="https://servercomponents.dev/">React Server Components</a>, <a href="https://react.dev/reference/react/Suspense">Suspense</a> and <a href="https://react.dev/blog/2021/12/17/react-conf-2021-recap#streaming-server-rendering-with-suspense">Streaming</a> are a great fit for our use&nbsp;case.</p><p>So our plan is to add full support for React Server Components in OCaml. Andrey Popp (who is part of the Ahrefs backend team, but has a frontend heart &#10084;&#65039;) <a href="https://github.com/andreypopp/react_of_ocaml">has already shown</a> this is possible, and now we want to make it work inside our frontend&nbsp;stack.</p><p>This plan will require some changes in the underlying toolchain we are using (Dune, Melange and ReasonReact):</p><ul><li>Update ReasonReact to be compatible with React 18 (this is already <a href="https://github.com/reasonml/reason-react/pull/756">done</a>, but we will be publishing a version to the <a href="https://ocaml.org/packages">opam repository</a> soon).</li><li>Provide a representation of promises that is uniform across the Melange and OCaml compilers.</li><li>Use the above primitives to unlock async/lazy components in <a href="https://reasonml.github.io/reason-react/">ReasonReact</a>.</li><li>Provide a way to work with JSON values on both platforms. We are currently using <a href="https://github.com/ahrefs/atd">atd</a> for cross-boundary (de)serialization, so we might be able to build some abstraction on top of&nbsp;it.</li><li>More generally, we need to figure out an effective strategy for repurposing existing client-side components and APIs for server-side rendering with OCaml. This will involve various techniques, such as: adapting Melange libraries so they can be used with OCaml, use Dune <a href="https://dune.readthedocs.io/en/stable/variants.html#virtual-library">virtual libraries</a>, or employing <a href="https://ocaml.org/docs/metaprogramming">PPXs</a> to do conditional compilation. Our goal is to thoroughly understand these techniques, experiment, iterate and document them, and share them with the public either through contributions to the upstream tools like Dune or Melange, or through new open source libraries.</li><li>Explore the advantages of <a href="https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974">OCaml multicore</a> in the context of distributing the rendering tasks of components across the server&rsquo;s available CPUs. We believe this is an ideal use case for&nbsp;it.</li><li>Similarly to what we did while integrating Melange within Dune, we will use the Ahrefs codebase to double check our assumptions, make sure we are providing the best developer experience, and improve the quality of our code&nbsp;&#128517;.</li></ul><p>React Server Components will be our main focus, but we also plan to continue improving the tools and documentation that we have shared along the&nbsp;way:</p><ul><li>We are currently working on a project-oriented book called &ldquo;Melange for React developers&rdquo;, which we plan to publish (at least partially) before the end of the&nbsp;year.</li><li>Polish the Melange playground: we recently added <a href="https://github.com/melange-re/melange-re.github.io/pull/122">&ldquo;type on hover&rdquo; capabilities</a>, we will be adding support for melange.dom library, show warnings and alerts, and improve the display of runtime errors in the&nbsp;console.</li><li>Keep on releasing more Melange libraries and bindings to the <a href="https://opam.ocaml.org/packages/">opam repository</a>.</li></ul><p>We&rsquo;re truly thrilled with the progress we&rsquo;ve achieved so far, together with Melange author and maintainer <a href="https://twitter.com/_anmonteiro">Antonio Monteiro</a>, and Dune maintainer <a href="https://twitter.com/rgrinb">Rudi Grinberg</a>. Without their invaluable guidance and contributions, we couldn&rsquo;t have reached this milestone. We are now developing upon a stable foundation that we will leverage to build our frontend apps in the coming&nbsp;years.</p><p>We owe the initiation of this new chapter to the exceptional groundwork laid by our colleague <a href="https://twitter.com/davesnx/">David Sancho</a>. His relentless efforts have been the driving force behind the integration of React with OCaml. Additionally, <a href="https://twitter.com/andreypopp">Andrey Popp</a> provided the crucial proof that it was indeed possible to use Server Components in&nbsp;OCaml.</p><p>Looking forward, we plan on maintaining the parts of Dune and Melange that we use every day, whilst improving them with additional functionality needed to make React Server Components in OCaml a reality. It is our continued commitment to provide top-tier experiences for both Ahrefs developers and users. The journey continues, we don&rsquo;t know where it leads yet, but we will surely be sharing our progress with&nbsp;you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&amp;referrerSource=full_rss&amp;postId=81c276713f19" width="1" height="1" alt=""/><hr/><p><a href="https://tech.ahrefs.com/building-react-server-components-in-ocaml-81c276713f19">Building React Server Components in OCaml</a> was originally published in <a href="https://tech.ahrefs.com">Ahrefs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>
13 changes: 13 additions & 0 deletions data/planet/cwn/ocaml-weekly-news-07-nov-2023.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: OCaml Weekly News, 07 Nov 2023
description:
url: https://alan.petitepomme.net/cwn/2023.11.07.html
date: 2023-11-07T12:00:00-00:00
preview_image:
featured:
authors:
- Caml Weekly News
source:
---

<ol><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#1">A second article about Miou</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#2">atddiff: report incompatibilities after modifying a typed interface</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#3">OCaml implementation of webbench</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#4">Using Docusaurus to document an OCaml project</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#5">Release of ocaml-sf/learn-ocaml:0.16.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#6">Discord.ml: Eio-based Discord library with voice support</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#7">Release of Fmlib 0.5.7</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#8">Survey on the new &quot;Getting Started&quot; Documentation on OCaml.org</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.07.html#9">Other OCaml News</a></li></ol>
13 changes: 13 additions & 0 deletions data/planet/cwn/ocaml-weekly-news-14-nov-2023.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: OCaml Weekly News, 14 Nov 2023
description:
url: https://alan.petitepomme.net/cwn/2023.11.14.html
date: 2023-11-14T12:00:00-00:00
preview_image:
featured:
authors:
- Caml Weekly News
source:
---

<ol><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#1">Release of Topiary 0.3.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#2">First release of OCaml bindings to the Polars dataframe library</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#3">How-To: Buck 2 and OCaml - Build system</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#4">Release of Moonpool 0.5</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#5">Zipc 0.1.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#6">New Tutorials on Basics of OCaml</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#7">cll 0.2.0 - mutable circular/cyclic doubly linked lists</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.14.html#8">Global dead code elimination in js_of_ocaml</a></li></ol>
13 changes: 13 additions & 0 deletions data/planet/cwn/ocaml-weekly-news-21-nov-2023.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: OCaml Weekly News, 21 Nov 2023
description:
url: https://alan.petitepomme.net/cwn/2023.11.21.html
date: 2023-11-21T12:00:00-00:00
preview_image:
featured:
authors:
- Caml Weekly News
source:
---

<ol><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#1">opam 2.2.0~alpha3</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#2">ocaml and povray</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#3">the beginning of a platformer</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#4">ocaml shmups</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#5">Docfd: TUI fuzzy document finder 1.9.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#6">Tezt 4.0.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#7">OCaml 5.1.1 : incoming breaking change in the ~Marshal~ module</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#8">The OCaml Platform Roadmap is Adopted</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#9">Ppxlib dev meetings</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#10">MirageVPN (an OpenVPN&trade; implementation) is resurrected</a></li><li><a href="https://alan.petitepomme.net/cwn/2023.11.21.html#11">Other OCaml News</a></li></ol>
13 changes: 13 additions & 0 deletions data/planet/frama-c/metacsl-for-frama-c-27x-cobalt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: MetAcsl for Frama-C 27.x Cobalt
description:
url: '%20https://frama-c.com/fc-plugins/metacsl.html%20'
date: 2023-11-07T00:00:00-00:00
preview_image:
featured:
authors:
- Frama-C
source:
---


20 changes: 20 additions & 0 deletions data/planet/tarides/how-to-install-ocaml-5-a-video-tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: 'How to Install OCaml 5: A Video Tutorial'
description: "Have you had difficulty installing OCaml for your projects? We have
created a video tutorial showing you how to use Opam to install OCaml on\u2026"
url: https://tarides.com/blog/2023-11-21-how-to-install-ocaml-5-a-video-tutorial
date: 2023-11-21T00:00:00-00:00
preview_image: https://tarides.com/static/6cebb5e1e17cc396d24242afb53aba36/764f4/zoomdogs.jpg
featured:
authors:
- Tarides
source:
---

<p>Have you had difficulty installing OCaml for your projects? We have created a <a href="https://youtu.be/sy4EQirNMUI">video tutorial</a> showing you how to use Opam to install OCaml on Linux and macOS.</p>
<p>All you need to complete the tutorial is a computer running either Linux or macOS, and an internet connection. By the end of the tutorial you will have OCaml 5 installed on your machine, and can start your journey with OCaml. For ideas of what to do next, check out <a href="https://ocaml.org/docs/tour-of-ocaml">the tutorials on OCaml.org</a>.</p>
<p><a href="http://www.youtube.com/watch?v=sy4EQirNMUI" title="How to Install OCaml on Linux and macOS"><img src="http://img.youtube.com/vi/sy4EQirNMUI/0.jpg" alt="OCaml Tutorial &ndash; Downloading and Installing OCaml on Linux and macOS"/></a></p>
<p>Our goal is to promote and encourage wider adoption of OCaml, and to that end we support the <a href="https://ocaml.org/docs/platform">OCaml Platform</a>. The Platform gives users an overview of the active tools available in OCaml, streamlining their experience in setting up an OCaml toolsuite. The video uses the recommended toolchain outlined in the OCaml Platform.</p>
<p>As a part of encouraging the adoption of OCaml, we are committed to simplifying the process of learning the language. We recognise that everyone learns differently. Some people prefer to read tutorials and do exercises, and others use videos to understand concepts visually. Since most of us combine different ways of learning to fit our needs, it&rsquo;s important for us to provide a visual alternative to the <a href="https://ocaml.org/install">installation instructions</a>.</p>
<p>There are several great content creators making videos about OCaml, including streamers that let you follow along as they are hacking. We are excited to see the community growing in this way, and welcome this contribution to the OCaml ecosystem. If you would like to engage more with the OCaml community check out <a href="https://discuss.ocaml.org/">OCaml Discuss</a>.</p>
<p>Depending on whether users find this kind of content helpful, we will continue to create more tutorials. So let us know what we can improve and if there are topics you would like us to cover next! You can comment directly on the video, or chat with us on <a href="https://twitter.com/tarides_">X</a> (formerly known as Twitter) or <a href="https://www.linkedin.com/company/tarides">LinkedIN</a>.</p>
Loading

0 comments on commit cc1ac8d

Please sign in to comment.