forked from ocaml/ocaml.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[scrape.yml] New OCaml Planet blog posts and videos from watch.ocaml.org
- Loading branch information
1 parent
8b3e85d
commit cf98a1b
Showing
67 changed files
with
4,931 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 01 Oct 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.10.01.html | ||
date: 2024-10-01T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#1">Dune Developer Preview Updates</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#2">Uuidm 0.9.9</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#3">first release of ppx_deriving_jsonschema</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#4">Bogue, the OCaml GUI</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#5">New release of Merlin</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#6">Releases of mirage-crypto 1.0.0, tls 1.0.0, x509 1.0.0, asn1-combinators 0.3.0, let's encrypt 1.0.0, awa 0.4.0, kdf 1.0.0, paf 0.7.0, git 3.17.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#7">ICFP 2023 OCaml Presentations on YouTube</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#8">Dune dev meeting</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.01.html#9">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 05 Nov 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.11.05.html | ||
date: 2024-11-05T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.11.05.html#1">GPTar 1.0.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.05.html#2">opam 2.3.0~rc1</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.05.html#3">Call for Contributions: BOB 2025 (Berlin, March 14 - Deadline Nov 15)</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.05.html#4">First beta release for OCaml 5.3.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.05.html#5">dune 3.16</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.05.html#6">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 08 Oct 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.10.08.html | ||
date: 2024-10-08T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#1">Releases of fpath-sexplib0, fpath-base, loc, file-rewriter, sexps-rewriter and provider</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#2">Build a project without Stdlib</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#3">obatcher: Framework for building efficient concurrent services</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#4">DBLP query program and library</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#5">cudajit: Bindings to the ~cuda~ and ~nvrtc~ libraries</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#6">YOCaml, a framework for static site generator</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#7">oepub 0.1.0 : A library to parse epub files</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#8">ppx_deriving_router — type safe routing for Dream and Melange</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#9">Mica, a PPX that automates differential testing for OCaml modules</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#10">Simplified Android cross-compiler with DkML</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.08.html#11">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 10 Sep 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.09.10.html | ||
date: 2024-09-10T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#1">Oxidizing OCaml — an update</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#2">Toy Autograd Engine in OCaml with Apple Accelerate Backend</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#3">New release of cppo, with multi-line macros and higher-order macros</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#4">OCamlPro's contributions to the 2024 ICFP in Milan</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#5">Flambda2 Ep. 3: Speculative Inlining, by OCamlPro</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#6">Frustrating Interactions with the OCaml Ecosystem while developing a Synthesizer Library</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#7">Cmdlang - Yet Another CLI Library (well, not really)</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#8">zarr v0.1.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#9">Brr 0.0.7</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#10">Ocsigen Server 6.0.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#11">dream-html and pure-html</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#12">Advanced Code Navigation coming to OCaml-LSP</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.10.html#13">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 12 Nov 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.11.12.html | ||
date: 2024-11-12T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.11.12.html#1">Picos — Interoperable effects based concurrency</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.12.html#2">findlib-1.9.7</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.12.html#3">First release candidate for OCaml 5.2.1</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.12.html#4">mirage-swapfs</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.12.html#5">Dune dev meeting</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.11.12.html#6">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 15 Oct 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.10.15.html | ||
date: 2024-10-15T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#1">grep_cmt: structural search of OCaml code</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#2">Mutaml 0.1</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#3">ocaml-activitypub</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#4">Ortac/QCheck-STM 0.4.0 Dynamic formal verification beyond one system under test</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#5">Openbsd 1.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#6">Compsort - reorder files in archives for improved compression</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#7">Dune dev meeting</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.15.html#8">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 17 Sep 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.09.17.html | ||
date: 2024-09-17T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#1">Ptime 1.2.0 – Mtime 2.1.0 – Qrc 0.2.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#2">Unicode 16.0.0 update for Uucd, Uucp, Uunf and Uuseg</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#3">Outreachy Demo Presentation</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#4">Live Stream to follow OCaml Workshop, ML Workshop, and other talks at ICFP</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#5">DkML 2.1.2 and opam 2.2.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#6">store v0.1.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#7">Tsdl 1.1.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#8">OCaml-css 0.2.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#9">OCaml-stk 0.2.0 and Chamo 4.1.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#10">DkCoder 2.1.3</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.17.html#11">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 22 Oct 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.10.22.html | ||
date: 2024-10-22T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#1">opam 2.3.0~beta1</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#2">Dune dev meeting</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#3">Wildcard expansion on Windows</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#4">OCamlformat and GitHub actions</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#5">New vs. Old OCaml Academic Users Page Survey</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#6">New vs. Old OCaml Industrial Users Page</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#7">Eliom 11 and Ocsigen Start 7</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.22.html#8">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 24 Sep 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.09.24.html | ||
date: 2024-09-24T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#1">ocaml-trace 0.8</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#2">qcheck-lin and qcheck-stm 0.2</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#3">3rd editor tooling dev-meeting: 26th of September 🧙</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#4">First release of hachis</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#5">OCaml Platform Newsletter: June-August 2024</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#6">First alpha release of OCaml 5.3.0</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#7">Ascend - Dungeon RPG for your terminal</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#8">first release of ppx_deriving_jsonschema</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#9">opam 2.3.0~alpha1</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.09.24.html#10">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: OCaml Weekly News, 29 Oct 2024 | ||
description: | ||
url: https://alan.petitepomme.net/cwn/2024.10.29.html | ||
date: 2024-10-29T12:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Caml Weekly News | ||
source: | ||
--- | ||
|
||
<ol><li><a href="https://alan.petitepomme.net/cwn/2024.10.29.html#1">HOL Light released to OPAM</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.29.html#2">Could we add a tiny OCaml interpreter to Numworks graphical calculators?</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.29.html#3">opam 2.3.0~beta2</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.29.html#4">Editors dev-meeting #4, Thu. 31th: Search by type à la Sherlodoc 🕵️</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.29.html#5">Dune dev meeting</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.29.html#6">Shell Completions in Dune Developer Preview</a></li><li><a href="https://alan.petitepomme.net/cwn/2024.10.29.html#7">Other OCaml News</a></li></ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: Happy eyeballs?! | ||
description: | ||
url: https://blog.osau.re/articles/happy_eyeballs.html | ||
date: 2024-09-27T00:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Romain Calascibetta | ||
source: | ||
--- | ||
|
||
When connect() hides a lot of details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
title: Introducing tree-sitter-dune | ||
description: | ||
url: http://blog.emillon.org/posts/2024-07-26-introducing-tree-sitter-dune.html | ||
date: 2024-07-26T00:00:00-00:00 | ||
preview_image: | ||
authors: | ||
- Etienne Millon | ||
source: | ||
--- | ||
|
||
<p>I made a <a href="https://tree-sitter.github.io/tree-sitter/">tree-sitter</a> plugin for | ||
<code>dune</code> files. It is available <a href="https://github.com/emillon/tree-sitter-dune">on | ||
GitHub</a>.</p> | ||
<p>Tree-sitter is a parsing system that can be used in text editors. | ||
<a href="https://dune.build/">Dune</a> is a build system for OCaml projects. | ||
Its configuration language lives in <code>dune</code> files which use a s-expression | ||
syntax.</p> | ||
<p>This makes highlighting challenging: the lexing part of the language is very | ||
simple (atoms, strings, parentheses), but it is not enough to make a good | ||
highlighter.</p> | ||
<p>In the following example, <code>with-stdout-to</code> and <code>echo</code> are “actions” that we | ||
could highlight in a special way, but these names can also appear in places | ||
where they are not interpreted as actions, and doing so would be confusing (for | ||
example, we could write to a file named <code>echo</code> instead of <code>foo.txt</code>.</p> | ||
<div class="sourceCode"><pre class="sourceCode scheme"><code class="sourceCode scheme"><span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb1-1" aria-hidden="true" tabindex="-1"></a>(rule</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb1-2" aria-hidden="true" tabindex="-1"></a> (action</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb1-3" aria-hidden="true" tabindex="-1"></a> (with-stdout-to</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb1-4" aria-hidden="true" tabindex="-1"></a> foo.txt</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb1-5" aria-hidden="true" tabindex="-1"></a> (echo <span class="st">"testing"</span>))))</span></code></pre></div> | ||
<p>Tree-sitter solves this, because it creates an actual parser that goes beyond | ||
lexing.</p> | ||
<p>In this example, I created grammar rules that parse the contents of <code>(action ...)</code> as an action, recognizing the various constructs of this DSL.</p> | ||
<p>The output of the parser is this syntax tree with location information (for | ||
some reason, line numbers start at 0 which is normal and unusual at the same | ||
time).</p> | ||
<pre><code>(source_file [0, 0] - [5, 0] | ||
(stanza [0, 0] - [4, 22] | ||
(stanza_name [0, 1] - [0, 5]) | ||
(field_name [1, 2] - [1, 8]) | ||
(action [2, 2] - [4, 20] | ||
(action_name [2, 3] - [2, 17]) | ||
(file_name_target [3, 3] - [3, 10] | ||
(file_name [3, 3] - [3, 10])) | ||
(action [4, 3] - [4, 19] | ||
(action_name [4, 4] - [4, 8]) | ||
(quoted_string [4, 9] - [4, 18])))))</code></pre> | ||
<p>The various strings are annotated with their type: we have stanza names | ||
(<code>rule</code>), field names (<code>action</code>), action names (<code>with-stdout-to</code>, <code>echo</code>), file | ||
names (<code>foo.txt</code>), and plain strings (<code>"testing"</code>).</p> | ||
<p>By itself, that is not useful, but it’s possible to write <em>queries</em> to make | ||
this syntax tree do interesting stuff.</p> | ||
<p>The first one is highlighting: we can set styles for various “patterns” (in | ||
practice, I only used node names) by defining queries:</p> | ||
<div class="sourceCode"><pre class="sourceCode scheme"><code class="sourceCode scheme"><span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb3-1" aria-hidden="true" tabindex="-1"></a>(stanza_name) @function</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb3-2" aria-hidden="true" tabindex="-1"></a>(field_name) @property</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb3-3" aria-hidden="true" tabindex="-1"></a>(quoted_string) @string</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb3-4" aria-hidden="true" tabindex="-1"></a>(multiline_string) @string</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb3-5" aria-hidden="true" tabindex="-1"></a>(action_name) @keyword</span></code></pre></div> | ||
<p>The parts with <code>@</code> map to “highlight groups” used in text editors.</p> | ||
<p>Another type of query is called “injections”. It is used to link different | ||
types of grammars together. For example, <code>dune</code> files can start with a special | ||
comment that indicates that the rest of the file is an OCaml program. In that | ||
case, the parser emits a single <code>ocaml_syntax</code> node and the following injection | ||
indicates that this file should be parsed using an OCaml parser:</p> | ||
<div class="sourceCode"><pre class="sourceCode scheme"><code class="sourceCode scheme"><span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb4-1" aria-hidden="true" tabindex="-1"></a>((ocaml_syntax) @injection.content</span> | ||
<span><a href="http://blog.emillon.org/feeds/ocaml.xml#cb4-2" aria-hidden="true" tabindex="-1"></a> (#<span class="kw">set!</span> injection.language <span class="st">"ocaml"</span>))</span></code></pre></div> | ||
<p>Another use case for this is <code>system</code> actions: these strings in <code>dune</code> files | ||
could be interpreted using a shell parser.</p> | ||
<p>In the other direction, it is possible to inject <code>dune</code> files into another | ||
document. For example, a markdown parser can use injections to highlight code | ||
blocks.</p> | ||
<p>I’m happy to have explored this technology. The toolchain seemed complex at | ||
first: there’s a compiler which seems to be a mix of node and rust, which | ||
generates C, which is compiled into a dynamically loaded library; but this is | ||
actually pretty well integrated in nix and neovim to the details are made | ||
invisible.</p> | ||
<p>The testing mechanism is similar to the cram tests we use in Dune, but I was a | ||
bit confused with the colors at first: when the output of a test changes, Dune | ||
considers that the new output is a <code>+</code> in the diff, and highlights it in green; | ||
while tree-sitter considers that the “expected output” is green.</p> | ||
<p>There are many ways to improve this prototype: either by adding queries (it’s | ||
possible to define text objects, folding expressions, etc), or by improving | ||
coverage for <code>dune</code> files (in most cases, the parser uses a s-expression | ||
fallback). I’m also curious to see if it’s possible to use this parser to | ||
provide a completion source. Since the strings are tagged with their type (are | ||
we expecting a library name, a module name, etc), I think we could use that to | ||
provide context-specific completions, but that’s probably difficult to do.</p> | ||
<p>Thanks <a href="https://x.com/teej_dv">teej</a> for the initial idea and the useful | ||
resources.</p> |
Oops, something went wrong.