summaryrefslogtreecommitdiff
path: root/2023/05
diff options
context:
space:
mode:
authormuqiuhan <[email protected]>2023-06-22 10:56:22 +0000
committermuqiuhan <[email protected]>2023-06-22 10:56:22 +0000
commit6f776f55fea31dd12e5af18af519ac7d02dd7f4e (patch)
treec72c4cb1c01777dd906172ce1f41d085ede5038e /2023/05
parente6158eb85d917cea33aef29a0d51f6ca19718790 (diff)
downloadblog-6f776f55fea31dd12e5af18af519ac7d02dd7f4e.tar.gz
deploy: 5065a383b04f53c3f276768fe2cad5da7f821452
Diffstat (limited to '2023/05')
-rw-r--r--2023/05/06/OCaml_News_20230506/index.html264
-rw-r--r--2023/05/09/OCaml_News_20230509/index.html284
-rw-r--r--2023/05/15/OCaml_News_20230515/index.html263
-rw-r--r--2023/05/21/OCaml_News_20230521/index.html320
-rw-r--r--2023/05/31/OCaml_News_20230531/index.html279
5 files changed, 0 insertions, 1410 deletions
diff --git a/2023/05/06/OCaml_News_20230506/index.html b/2023/05/06/OCaml_News_20230506/index.html
deleted file mode 100644
index eafd35fe..00000000
--- a/2023/05/06/OCaml_News_20230506/index.html
+++ /dev/null
@@ -1,264 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8">
-<meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-<meta http-equiv="X-UA-Compatible" content="ie=edge">
-
- <meta name="author" content="含暮秋">
-
-
- <meta name="subtitle" content="暮秋小屋">
-
-
- <meta name="description" content="不卑不亢的码农, 朴素的民谣诗人">
-
-
- <meta name="keywords" content="韩暮秋,MuqiuHan">
-
-
-
-
-<title>OCaml News 2023/5/6 | 暮秋小屋</title>
-
-
-
-
-
-<style>
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Roboto+Mono&display=swap');
-</style>
-
-
-
- <!-- stylesheets list from _config.yml -->
-
- <link rel="stylesheet" href="/css/style.css">
-
-
-
-
-
- <!-- scripts list from _config.yml -->
-
- <script src="/js/frame.js"></script>
-
-
-
-
-
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
-
-
-
-
-
-
-
- <!-- hexo injector head_end start -->
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
-
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
-<!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head>
- <body>
- <div class="mask-border">
- </div>
-
- <div class="wrapper">
-
- <div class="header">
- <div class="flex-container">
- <div class="header-inner">
- <div class="site-brand-container">
- <a href="/">
-
- 暮秋小屋
-
- </a>
- </div>
- <div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
- Menu
- </div>
- <nav class="site-nav">
- <ul class="menu-list">
-
-
- <li class="menu-item">
- <a href="/">主页</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/tags/Technique/">技术</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/Projects">项目</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/categories/gallery/">日记本</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/about">关于</a>
- </li>
-
-
-
- </ul>
- </nav>
- </div>
- </div>
-</div>
-
-
- <div class="main">
- <div class="flex-container">
- <article id="post">
-
-
- <div class="post-head">
- <div class="post-info">
- <div class="tag-list">
-
-
- <span class="post-tag">
- <a href="/tags/OCaml/">
- OCaml
- </a>
- </span>
-
- <span class="post-tag">
- <a href="/tags/Technique/">
- Technique
- </a>
- </span>
-
-
- </div>
- <div class="post-title">
-
-
- OCaml News 2023/5/6
-
-
- </div>
- <span class="post-date">
- May 6, 2023
- </span>
- </div>
- <div class="post-img">
-
- <div class="h-line-primary"></div>
-
- </div>
-</div>
- <div class="post-content">
- <h1 id="二〇二三年四月二十九日-二〇二三年五月六日"><a href="#二〇二三年四月二十九日-二〇二三年五月六日" class="headerlink" title="二〇二三年四月二十九日 - 二〇二三年五月六日"></a>二〇二三年四月二十九日 - 二〇二三年五月六日</h1><h2 id="Dune正在探索集成包管理,提供统一的开发体验"><a href="#Dune正在探索集成包管理,提供统一的开发体验" class="headerlink" title="Dune正在探索集成包管理,提供统一的开发体验"></a>Dune正在探索集成包管理,提供统一的开发体验</h2><p>dune, opam, opam-monorepo团队在几个月前联合起来,共同解决这个来自之前社区报告中的重要痛点。</p>
-<p>在dune的github上有对于这项工作的详细解释:<a target="_blank" rel="noopener" href="https://github.com/ocaml/dune/issues/7680">https://github.com/ocaml/dune/issues/7680</a></p>
-<p><a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/explorations-on-package-management-in-dune/12101">https://discuss.ocaml.org/t/explorations-on-package-management-in-dune/12101</a></p>
-<p><a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/explorations-on-package-management-in-dune/12101">论坛原帖:https://discuss.ocaml.org/t/explorations-on-package-management-in-dune/12101</a></p>
-<h2 id="OCaml-x2F-C-FFI对象的生命周期问题"><a href="#OCaml-x2F-C-FFI对象的生命周期问题" class="headerlink" title="OCaml&#x2F;C FFI对象的生命周期问题"></a>OCaml&#x2F;C FFI对象的生命周期问题</h2><p>OCaml manual中有一节名为<a target="_blank" rel="noopener" href="https://v2.ocaml.org/manual/intfc.html#s%3Ac-gc-harmony"><br>5 Living in harmony with the garbage collector</a>,其中介绍了六个规则,帮助编写C FFI。</p>
-<p>对于如下C代码:</p>
-<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">value <span class="title function_">pair</span><span class="params">(value a, value b)</span> &#123;</span><br><span class="line"> CAMLparam2(a, b); <span class="comment">/*required*/</span></span><br><span class="line"> CAMLlocal1(r); <span class="comment">/*required*/</span></span><br><span class="line"> r = caml_alloc(<span class="number">2</span>,<span class="number">0</span>);</span><br><span class="line"> Store_field(r,<span class="number">0</span>,a);</span><br><span class="line"> Store_field(r,<span class="number">1</span>,b);</span><br><span class="line"> CAMLreturn(r); <span class="comment">/*required*/</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
-
-<p>这里的<code>CAMLlocal1(r)</code>并不是必须的,如果a和b是立即值,那么其他注释有<code>require</code>的代码。也不是必须的,对于这六个规则应该持保留态度,它们并不是必须严格遵守的,只是为了更安全。</p>
-<p><a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ocaml-c-ffi-object-lifetimes/12099">论坛原帖:https://discuss.ocaml.org/t/ocaml-c-ffi-object-lifetimes/12099</a></p>
-<h2 id="使用Elm-Style编写函数式Web应用"><a href="#使用Elm-Style编写函数式Web应用" class="headerlink" title="使用Elm Style编写函数式Web应用"></a>使用Elm Style编写函数式Web应用</h2><p>Fmlib 是一个函数式库,其中包含以下组件:</p>
-<ul>
-<li>Fmlib_std: 标准的数据结构(B树等)</li>
-<li>Fmlib_pretty: Pretty Printing</li>
-<li>Fmlib_parse: Parsing</li>
-<li>Fmlib_browser: Web应用程序</li>
-<li>Fmlib_js: 与浏览器&#x2F;Nodejs交互</li>
-</ul>
-<p>github仓库:<a target="_blank" rel="noopener" href="https://github.com/hbr/fmlib">https://github.com/hbr/fmlib</a></p>
-<p>一些简单的示例:<a target="_blank" rel="noopener" href="https://hbr.github.io/fmlib/webapp/index.html">https://hbr.github.io/fmlib/webapp/index.html</a></p>
-<p><a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ann-functional-web-applications-running-in-the-browser/11984">论坛原帖:https://discuss.ocaml.org/t/ann-functional-web-applications-running-in-the-browser/11984</a></p>
-<h2 id="使用OCaml编写NeoVIM插件"><a href="#使用OCaml编写NeoVIM插件" class="headerlink" title="使用OCaml编写NeoVIM插件"></a>使用OCaml编写NeoVIM插件</h2><p>VCaml是一个用于在 OCaml 中编写 Neovim 插件的库。</p>
-<p>github仓库: <a target="_blank" rel="noopener" href="https://github.com/janestreet/vcaml">https://github.com/janestreet/vcaml</a></p>
-<p>论坛上相关的讨论: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/repo-for-nvim-plugins-in-ocaml-neovim-vcaml/12049">https://discuss.ocaml.org/t/repo-for-nvim-plugins-in-ocaml-neovim-vcaml/12049</a></p>
-<h2 id="Format和PPrint在实践中的对比"><a href="#Format和PPrint在实践中的对比" class="headerlink" title="Format和PPrint在实践中的对比"></a>Format和PPrint在实践中的对比</h2><p><a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/format-vs-pprint-in-practice/12087">论坛原帖: https://discuss.ocaml.org/t/format-vs-pprint-in-practice/12087</a></p>
-<h2 id="BLAS-x2F-LAPACK的OCaml-Binding"><a href="#BLAS-x2F-LAPACK的OCaml-Binding" class="headerlink" title="BLAS&#x2F;LAPACK的OCaml Binding"></a>BLAS&#x2F;LAPACK的OCaml Binding</h2><p>这个 OCaml 库绑定了两个广泛使用的数学 FORTRAN 库:</p>
-<ul>
-<li>BLAS : <a href="www.netlib.org/blas/">www.netlib.org/blas/</a></li>
-<li>LAPAK : <a href="www.netlib.org/lapack/">www.netlib.org/lapack/</a></li>
-</ul>
-<p>Github仓库:<a target="_blank" rel="noopener" href="https://github.com/mmottl/lacaml">https://github.com/mmottl/lacaml</a></p>
-<h2 id="基于Effects的实验性WebServer"><a href="#基于Effects的实验性WebServer" class="headerlink" title="基于Effects的实验性WebServer"></a>基于Effects的实验性WebServer</h2><p>Github仓库: <a target="_blank" rel="noopener" href="https://github.com/avsm/eeww">https://github.com/avsm/eeww</a></p>
-<h2 id="纯(?)函数式SSH库"><a href="#纯(?)函数式SSH库" class="headerlink" title="纯(?)函数式SSH库"></a>纯(?)函数式SSH库</h2><p>awa-ssh是一个使用ISC协议开源的OCaml SSH库<br>Github仓库:<a target="_blank" rel="noopener" href="https://github.com/mirage/awa-ssh">https://github.com/mirage/awa-ssh</a></p>
-
-</div>
-
-<script>
- window.onload = detectors();
-</script>
- <div class="post-footer">
- <div class="h-line-primary"></div>
- <nav class="post-nav">
- <div class="prev-item">
-
- <div class="icon arrow-left"></div>
- <div class="post-link">
- <a href="/2023/05/09/OCaml_News_20230509/">Prev</a>
- </div>
-
- </div>
- <div class="next-item">
-
- <div class="icon arrow-right"></div>
- <div class="post-link">
- <a href="/2023/04/29/OCaml_News_20230429/">Next</a>
- </div>
-
- </div>
- </nav>
-</div>
-
-
- <div class="post-comment">
-
-
-
-
-
-
-
-</div>
-
-
-</article>
- </div>
- </div>
-
- <div class="footer">
- <div class="flex-container">
- <div class="footer-text">
-
-
- |
-
-
- 希望路过的人可以添点柴火让这里暖和点
-
- </div>
- </div>
-</div>
-
- </div>
-
-
-
-
- </body>
-</html>
diff --git a/2023/05/09/OCaml_News_20230509/index.html b/2023/05/09/OCaml_News_20230509/index.html
deleted file mode 100644
index ec61d448..00000000
--- a/2023/05/09/OCaml_News_20230509/index.html
+++ /dev/null
@@ -1,284 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8">
-<meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-<meta http-equiv="X-UA-Compatible" content="ie=edge">
-
- <meta name="author" content="含暮秋">
-
-
- <meta name="subtitle" content="暮秋小屋">
-
-
- <meta name="description" content="不卑不亢的码农, 朴素的民谣诗人">
-
-
- <meta name="keywords" content="韩暮秋,MuqiuHan">
-
-
-
-
-<title>OCaml News 2023/5/9 | 暮秋小屋</title>
-
-
-
-
-
-<style>
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Roboto+Mono&display=swap');
-</style>
-
-
-
- <!-- stylesheets list from _config.yml -->
-
- <link rel="stylesheet" href="/css/style.css">
-
-
-
-
-
- <!-- scripts list from _config.yml -->
-
- <script src="/js/frame.js"></script>
-
-
-
-
-
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
-
-
-
-
-
-
-
- <!-- hexo injector head_end start -->
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
-
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
-<!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head>
- <body>
- <div class="mask-border">
- </div>
-
- <div class="wrapper">
-
- <div class="header">
- <div class="flex-container">
- <div class="header-inner">
- <div class="site-brand-container">
- <a href="/">
-
- 暮秋小屋
-
- </a>
- </div>
- <div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
- Menu
- </div>
- <nav class="site-nav">
- <ul class="menu-list">
-
-
- <li class="menu-item">
- <a href="/">主页</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/tags/Technique/">技术</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/Projects">项目</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/categories/gallery/">日记本</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/about">关于</a>
- </li>
-
-
-
- </ul>
- </nav>
- </div>
- </div>
-</div>
-
-
- <div class="main">
- <div class="flex-container">
- <article id="post">
-
-
- <div class="post-head">
- <div class="post-info">
- <div class="tag-list">
-
-
- <span class="post-tag">
- <a href="/tags/OCaml/">
- OCaml
- </a>
- </span>
-
- <span class="post-tag">
- <a href="/tags/Technique/">
- Technique
- </a>
- </span>
-
-
- </div>
- <div class="post-title">
-
-
- OCaml News 2023/5/9
-
-
- </div>
- <span class="post-date">
- May 9, 2023
- </span>
- </div>
- <div class="post-img">
-
- <div class="h-line-primary"></div>
-
- </div>
-</div>
- <div class="post-content">
- <h1 id="二〇二三年五月六日-二〇二三年五月九日"><a href="#二〇二三年五月六日-二〇二三年五月九日" class="headerlink" title="二〇二三年五月六日 - 二〇二三年五月九日"></a>二〇二三年五月六日 - 二〇二三年五月九日</h1><h2 id="在Eio中不使用Unix和Sys模块实现所有I-x2F-O和文件系统操作?"><a href="#在Eio中不使用Unix和Sys模块实现所有I-x2F-O和文件系统操作?" class="headerlink" title="在Eio中不使用Unix和Sys模块实现所有I&#x2F;O和文件系统操作?"></a>在Eio中不使用Unix和Sys模块实现所有I&#x2F;O和文件系统操作?</h2><blockquote>
-<p>EIO: <a target="_blank" rel="noopener" href="https://github.com/ocaml-multicore/eio">Effects-based direct-style IO for multicore OCaml</a></p>
-</blockquote>
-<p>例如<code>Sys.is_directory</code>, <code>Sys.file_exists</code>,<code>Sys.is_regular_file</code>这些函数在Eio中并没有相关的实现, 因为Eio目前还缺少很多文件操作的实现: <a target="_blank" rel="noopener" href="https://github.com/ocaml-multicore/eio/issues/510">Add missing file operations #510</a>。</p>
-<p>但退一步,如果需要,可以用 <code>Eio_unix.run_in_systhread</code>来运行Unix的相关操作从而不阻塞Eio线程。</p>
-<p>关于执行外部命令, 例如<code>Sys.command</code>或<code>Unix.create_process</code>函数, 在Eio中可以通过<code>Eio.Process</code>模块实现,例如:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># <span class="type">Eio_main</span>.run @@ <span class="keyword">fun</span> env -&gt;</span><br><span class="line"> <span class="keyword">let</span> proc_mgr = <span class="type">Eio</span>.<span class="type">Stdenv</span>.process_mgr env <span class="keyword">in</span></span><br><span class="line"> <span class="type">Eio</span>.<span class="type">Process</span>.run proc_mgr [<span class="string">&quot;echo&quot;</span>; <span class="string">&quot;hello&quot;</span>];;</span><br><span class="line">hello</span><br><span class="line">- : <span class="built_in">unit</span> = <span class="literal">()</span></span><br></pre></td></tr></table></figure>
-
-<p>相关文档: <a target="_blank" rel="noopener" href="https://github.com/ocaml-multicore/eio#running-processes">https://github.com/ocaml-multicore/eio#running-processes</a></p>
-<p>论坛原帖:<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/what-are-equivalent-to-some-sys-functions-in-eio-and-other-eio-questions/12126">https://discuss.ocaml.org/t/what-are-equivalent-to-some-sys-functions-in-eio-and-other-eio-questions/12126</a></p>
-<h2 id="为一个现有的Dune项目生成最小的mli文件"><a href="#为一个现有的Dune项目生成最小的mli文件" class="headerlink" title="为一个现有的Dune项目生成最小的mli文件"></a>为一个现有的Dune项目生成最小的mli文件</h2><blockquote>
-<p>Reanalyze: <a target="_blank" rel="noopener" href="https://github.com/rescript-association/reanalyze">Experimental analyses for ReScript and OCaml: globally dead values&#x2F;types, exception analysis, and termination analysis.</a></p>
-</blockquote>
-<p>reanalyze可以分析项目中的dead code, 它并不能直接实现这个需求, 但可能可以利用这些信息对实施相关分析提供一个良好的起点。</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/how-to-create-the-minimal-mli-files-using-dune/12115">https://discuss.ocaml.org/t/how-to-create-the-minimal-mli-files-using-dune/12115</a></p>
-<h2 id="自动派生枚举转换函数"><a href="#自动派生枚举转换函数" class="headerlink" title="自动派生枚举转换函数"></a>自动派生枚举转换函数</h2><p>主要想实现的是自动生成如下代码中的 <code>_foo</code> 和 <code>_bar</code> 函数。 也就是将具有无参数constructors的variant视为enum,并为每个constructor映射一个整数值:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">type</span> my_enum = <span class="type">A</span> | <span class="type">B</span> | <span class="type">C</span> | <span class="type">D</span> | <span class="type">E</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> _foo (x : my_enum) : <span class="built_in">int</span> =</span><br><span class="line"> <span class="keyword">match</span> x <span class="keyword">with</span></span><br><span class="line"> | <span class="type">A</span> -&gt; <span class="number">0</span></span><br><span class="line"> | <span class="type">B</span> -&gt; <span class="number">1</span></span><br><span class="line"> | <span class="type">C</span> -&gt; <span class="number">2</span></span><br><span class="line"> | <span class="type">D</span> -&gt; <span class="number">3</span></span><br><span class="line"> | <span class="type">E</span> -&gt; <span class="number">4</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> _bar (n : <span class="built_in">int</span>) : my_enum =</span><br><span class="line"> <span class="keyword">match</span> n <span class="keyword">with</span></span><br><span class="line"> | <span class="number">0</span> -&gt; <span class="type">A</span></span><br><span class="line"> | <span class="number">1</span> -&gt; <span class="type">B</span></span><br><span class="line"> | <span class="number">2</span> -&gt; <span class="type">C</span></span><br><span class="line"> | <span class="number">3</span> -&gt; <span class="type">D</span></span><br><span class="line"> | <span class="number">4</span> -&gt; <span class="type">E</span></span><br><span class="line"> | _ -&gt; failwith <span class="string">&quot;not handled&quot;</span></span><br></pre></td></tr></table></figure>
-
-<p><code>ppx_deriving</code>有enum deriver, 可以实现,例如</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"># <span class="keyword">type</span> insn = <span class="type">Const</span> | <span class="type">Push</span> | <span class="type">Pop</span> | <span class="type">Add</span> [@@deriving enum];;</span><br><span class="line"><span class="keyword">type</span> insn = <span class="type">Const</span> | <span class="type">Push</span> | <span class="type">Pop</span> | <span class="type">Add</span></span><br><span class="line"><span class="keyword">val</span> insn_to_enum : insn -&gt; <span class="built_in">int</span> = &lt;<span class="keyword">fun</span>&gt;</span><br><span class="line"><span class="keyword">val</span> insn_of_enum : <span class="built_in">int</span> -&gt; insn option = &lt;<span class="keyword">fun</span>&gt;</span><br><span class="line"><span class="keyword">val</span> min_insn : <span class="built_in">int</span> = <span class="number">0</span></span><br><span class="line"><span class="keyword">val</span> max_insn : <span class="built_in">int</span> = <span class="number">3</span></span><br><span class="line"># insn_to_enum <span class="type">Pop</span>;;</span><br><span class="line">- : <span class="built_in">int</span> = <span class="number">2</span></span><br><span class="line"># insn_of_enum <span class="number">3</span>;;</span><br><span class="line">- : insn option = <span class="type">Some</span> <span class="type">Add</span></span><br></pre></td></tr></table></figure>
-
-<p>相关文档: <a target="_blank" rel="noopener" href="https://github.com/ocaml-ppx/ppx_deriving#plugin-enum">https://github.com/ocaml-ppx/ppx_deriving#plugin-enum</a></p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/auto-derive-enum-conversions/12119">https://discuss.ocaml.org/t/auto-derive-enum-conversions/12119</a></p>
-<h2 id="在Linux上编译OCaml程序,-在FreeBSD上跑"><a href="#在Linux上编译OCaml程序,-在FreeBSD上跑" class="headerlink" title="在Linux上编译OCaml程序, 在FreeBSD上跑"></a>在Linux上编译OCaml程序, 在FreeBSD上跑</h2><blockquote>
-<p>以Linux和FreeBSD都在x86-64架构上运行为例</p>
-</blockquote>
-<p>如果程序是纯OCaml(没有C bindings之类的),那么只要目标系统中有OCaml解释器(ocamlrun), ocamlc生成的字节码就可以运行, 如果不是的话…</p>
-<p>从Linux x86-64到FreeBSD x86-64从表面上看似乎没有太大的困难。 如果知道怎么配置Linux到FreeBSD的交叉编译器(最好使用clang和FreeBSD sysroot),并且愿意维护交叉编译器,<br>可以联系<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/u/jbeckford">jbeckford</a>,他愿意合作将其添加到<code>dkml-base-compiler.4.14.x</code>中。</p>
-<p>相关阅读: <a target="_blank" rel="noopener" href="https://docs.freebsd.org/en/books/handbook/linuxemu/">Linux的二进制兼容性</a></p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/how-to-compile-ocaml-program-on-linux-for-running-on-freebsd/12110">https://discuss.ocaml.org/t/how-to-compile-ocaml-program-on-linux-for-running-on-freebsd/12110</a></p>
-<h2 id="OCaml的速度竞赛"><a href="#OCaml的速度竞赛" class="headerlink" title="OCaml的速度竞赛"></a>OCaml的速度竞赛</h2><blockquote>
-<p>speed-comparison: <a target="_blank" rel="noopener" href="https://github.com/niklas-heer/speed-comparison">A repo which compares the speed of different programming languages</a></p>
-</blockquote>
-<p>这里用OCaml实现了莱布尼茨算法用于计算圆周率:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">(* ocamlopt -O2 -o leibniz leibniz.ml &amp;&amp; strip leibniz *)</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> <span class="keyword">rec</span> calc sum curr upto =</span><br><span class="line"> <span class="keyword">if</span> curr &gt;= upto <span class="keyword">then</span> sum</span><br><span class="line"> <span class="keyword">else</span> calc (sum +. <span class="number">1.</span> /. float_of_int curr) (curr + <span class="number">4</span>) upto</span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> calc rounds =</span><br><span class="line"> <span class="keyword">let</span> double = rounds * <span class="number">2</span> <span class="keyword">in</span></span><br><span class="line"> calc <span class="number">0.</span> (<span class="number">1</span> - double) (double + <span class="number">1</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> <span class="literal">()</span> =</span><br><span class="line"> <span class="keyword">let</span> rounds_txt = open_in_bin <span class="string">&quot;rounds.txt&quot;</span> <span class="keyword">in</span></span><br><span class="line"> <span class="keyword">let</span> rounds = int_of_string (input_line rounds_txt) <span class="keyword">in</span></span><br><span class="line"> close_in rounds_txt;</span><br><span class="line"></span><br><span class="line"> <span class="keyword">let</span> pi = <span class="number">4.</span> *. calc rounds <span class="keyword">in</span></span><br><span class="line"> <span class="type">Printf</span>.printf <span class="string">&quot;%.16f\n&quot;</span> pi</span><br></pre></td></tr></table></figure>
-
-<p>但性能:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ time ./leibniz</span><br><span class="line"><span class="number">3.1415926435899633</span></span><br><span class="line">./leibniz <span class="number">0.38</span>s user <span class="number">0.00</span>s system <span class="number">99</span>% cpu <span class="number">0.388</span> total</span><br></pre></td></tr></table></figure>
-
-<p>比Go版本:</p>
-<figure class="highlight golang"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">time ./leibniz_go</span><br><span class="line"><span class="number">3.141592663589326</span></span><br><span class="line">./leibniz_go <span class="number">0.13</span>s user <span class="number">0.01</span>s system <span class="number">95</span>% cpu <span class="number">0.142</span> total</span><br></pre></td></tr></table></figure>
-
-<p>慢了很多, 这是因为从生成的<a target="_blank" rel="noopener" href="https://godbolt.org/z/xWrTxa3ov">汇编代码</a>来看, OCaml编译器无法在递归调用中unbox浮点数用于返回值。而命令式版本:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> calc rounds =</span><br><span class="line"> <span class="keyword">let</span> sum = <span class="built_in">ref</span> <span class="number">0.</span> <span class="keyword">in</span></span><br><span class="line"> <span class="keyword">let</span> curr = <span class="built_in">ref</span> (<span class="number">1</span> - rounds * <span class="number">2</span>) <span class="keyword">in</span></span><br><span class="line"> <span class="keyword">for</span> _ = <span class="number">0</span> <span class="keyword">to</span> rounds - <span class="number">1</span> <span class="keyword">do</span></span><br><span class="line"> sum := !sum +. <span class="number">1.</span> /. float_of_int !curr;</span><br><span class="line"> curr := !curr + <span class="number">4</span>;</span><br><span class="line"> <span class="keyword">done</span>;</span><br><span class="line"> !sum</span><br><span class="line"></span><br><span class="line"><span class="keyword">let</span> <span class="literal">()</span> =</span><br><span class="line"> <span class="keyword">let</span> rounds_txt = open_in_bin <span class="string">&quot;rounds.txt&quot;</span> <span class="keyword">in</span></span><br><span class="line"> <span class="keyword">let</span> rounds = int_of_string (input_line rounds_txt) <span class="keyword">in</span></span><br><span class="line"> close_in rounds_txt;</span><br><span class="line"></span><br><span class="line"> <span class="keyword">let</span> pi = <span class="number">4.</span> *. calc rounds <span class="keyword">in</span></span><br><span class="line"> <span class="type">Printf</span>.printf <span class="string">&quot;%.16f\n&quot;</span> pi</span><br></pre></td></tr></table></figure>
-<p>的性能将会好得多(<a target="_blank" rel="noopener" href="https://godbolt.org/z/sW46nh1GK">对应的汇编</a>)</p>
-<p>所以为了使数字运算的OCaml代码运行得更快,应该避免递归调用(这会抑制unbox浮点值)。</p>
-<p>论坛原帖:<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ocaml-speed-comparison-calculating-pi-with-leibniz-optimize/12112">https://discuss.ocaml.org/t/ocaml-speed-comparison-calculating-pi-with-leibniz-optimize/12112</a></p>
-<hr>
-<h2 id="一些库"><a href="#一些库" class="headerlink" title="一些库"></a>一些库</h2><ul>
-<li>OCaml PPX deriver for reflection : <a target="_blank" rel="noopener" href="https://github.com/thierry-martinez/refl">https://github.com/thierry-martinez/refl</a></li>
-<li>LexiFi runtime types : <a target="_blank" rel="noopener" href="https://github.com/LexiFi/lrt">https://github.com/LexiFi/lrt</a></li>
-<li>Auto generation of idiomatic bindings between Reason and JavaScript: either vanilla or typed with TypeScript&#x2F;FlowType : <a target="_blank" rel="noopener" href="https://github.com/rescript-association/genType">https://github.com/rescript-association/genType</a></li>
-</ul>
-
-</div>
-
-<script>
- window.onload = detectors();
-</script>
- <div class="post-footer">
- <div class="h-line-primary"></div>
- <nav class="post-nav">
- <div class="prev-item">
-
- <div class="icon arrow-left"></div>
- <div class="post-link">
- <a href="/2023/05/15/OCaml_News_20230515/">Prev</a>
- </div>
-
- </div>
- <div class="next-item">
-
- <div class="icon arrow-right"></div>
- <div class="post-link">
- <a href="/2023/05/06/OCaml_News_20230506/">Next</a>
- </div>
-
- </div>
- </nav>
-</div>
-
-
- <div class="post-comment">
-
-
-
-
-
-
-
-</div>
-
-
-</article>
- </div>
- </div>
-
- <div class="footer">
- <div class="flex-container">
- <div class="footer-text">
-
-
- |
-
-
- 希望路过的人可以添点柴火让这里暖和点
-
- </div>
- </div>
-</div>
-
- </div>
-
-
-
-
- </body>
-</html>
diff --git a/2023/05/15/OCaml_News_20230515/index.html b/2023/05/15/OCaml_News_20230515/index.html
deleted file mode 100644
index dd363e54..00000000
--- a/2023/05/15/OCaml_News_20230515/index.html
+++ /dev/null
@@ -1,263 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8">
-<meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-<meta http-equiv="X-UA-Compatible" content="ie=edge">
-
- <meta name="author" content="含暮秋">
-
-
- <meta name="subtitle" content="暮秋小屋">
-
-
- <meta name="description" content="不卑不亢的码农, 朴素的民谣诗人">
-
-
- <meta name="keywords" content="韩暮秋,MuqiuHan">
-
-
-
-
-<title>OCaml News 2023/5/15 | 暮秋小屋</title>
-
-
-
-
-
-<style>
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Roboto+Mono&display=swap');
-</style>
-
-
-
- <!-- stylesheets list from _config.yml -->
-
- <link rel="stylesheet" href="/css/style.css">
-
-
-
-
-
- <!-- scripts list from _config.yml -->
-
- <script src="/js/frame.js"></script>
-
-
-
-
-
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
-
-
-
-
-
-
-
- <!-- hexo injector head_end start -->
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
-
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
-<!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head>
- <body>
- <div class="mask-border">
- </div>
-
- <div class="wrapper">
-
- <div class="header">
- <div class="flex-container">
- <div class="header-inner">
- <div class="site-brand-container">
- <a href="/">
-
- 暮秋小屋
-
- </a>
- </div>
- <div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
- Menu
- </div>
- <nav class="site-nav">
- <ul class="menu-list">
-
-
- <li class="menu-item">
- <a href="/">主页</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/tags/Technique/">技术</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/Projects">项目</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/categories/gallery/">日记本</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/about">关于</a>
- </li>
-
-
-
- </ul>
- </nav>
- </div>
- </div>
-</div>
-
-
- <div class="main">
- <div class="flex-container">
- <article id="post">
-
-
- <div class="post-head">
- <div class="post-info">
- <div class="tag-list">
-
-
- <span class="post-tag">
- <a href="/tags/OCaml/">
- OCaml
- </a>
- </span>
-
- <span class="post-tag">
- <a href="/tags/Technique/">
- Technique
- </a>
- </span>
-
-
- </div>
- <div class="post-title">
-
-
- OCaml News 2023/5/15
-
-
- </div>
- <span class="post-date">
- May 15, 2023
- </span>
- </div>
- <div class="post-img">
-
- <div class="h-line-primary"></div>
-
- </div>
-</div>
- <div class="post-content">
- <h1 id="二〇二三年五月九日-二〇二三年五月十五日"><a href="#二〇二三年五月九日-二〇二三年五月十五日" class="headerlink" title="二〇二三年五月九日 - 二〇二三年五月十五日"></a>二〇二三年五月九日 - 二〇二三年五月十五日</h1><h2 id="关于OCaml最新的并行特性相关文档"><a href="#关于OCaml最新的并行特性相关文档" class="headerlink" title="关于OCaml最新的并行特性相关文档"></a>关于OCaml最新的并行特性相关文档</h2><ol>
-<li>Eio的README有很多例子: <a target="_blank" rel="noopener" href="https://github.com/ocaml-multicore/eio">https://github.com/ocaml-multicore/eio</a></li>
-<li>ocaml-multicore组织官方的教程仓库: <a target="_blank" rel="noopener" href="https://github.com/ocaml-multicore/parallel-programming-in-multicore-ocaml">https://github.com/ocaml-multicore/parallel-programming-in-multicore-ocaml</a></li>
-<li>OCaml的Manual: <a target="_blank" rel="noopener" href="https://v2.ocaml.org/releases/5.0/htmlman/parallelism.html">https://v2.ocaml.org/releases/5.0/htmlman/parallelism.html</a></li>
-</ol>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/new-concurrency-features/12158">https://discuss.ocaml.org/t/new-concurrency-features/12158</a></p>
-<h2 id="使用OCaml通过串口与STM32通信"><a href="#使用OCaml通过串口与STM32通信" class="headerlink" title="使用OCaml通过串口与STM32通信"></a>使用OCaml通过串口与STM32通信</h2><p>在Linux&#x2F;Unix上可以:</p>
-<ul>
-<li>适用于linux&#x2F;unix的oserial: <a target="_blank" rel="noopener" href="https://github.com/m-laniakea/oserial">https://github.com/m-laniakea/oserial</a></li>
-<li>直接打开 <code>/dev/XXX</code> 文件用Unix模块相关的API与其交互, 一个例子: <a target="_blank" rel="noopener" href="https://gist.github.com/dbuenzli/035bc5c8598069360dd7301f55e7774a">https://gist.github.com/dbuenzli/035bc5c8598069360dd7301f55e7774a</a></li>
-</ul>
-<p>Windows目前没有解决方案。</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/is-there-any-library-of-ocaml-to-use-serial-port-of-pc/3658">https://discuss.ocaml.org/t/is-there-any-library-of-ocaml-to-use-serial-port-of-pc/3658</a></p>
-<h2 id="使用OCaml构建IOS-APP"><a href="#使用OCaml构建IOS-APP" class="headerlink" title="使用OCaml构建IOS APP"></a>使用OCaml构建IOS APP</h2><ul>
-<li>通过Js_of_ocaml编译为JavaScript并使用像CapacitorJS(甚至是旧的Cordova)这样的框架或许是一条路子。</li>
-<li><a target="_blank" rel="noopener" href="http://psellos.com/aboutus.html">Psellos</a>是一个注重现代函数式语言(OCaml, F#, Haskell)的组织,它们维护了一个将OCaml编译到IOS的交叉编译器: <a target="_blank" rel="noopener" href="http://psellos.com/ocaml/compile-to-iphone.html">http://psellos.com/ocaml/compile-to-iphone.html</a></li>
-<li>ocaml-cocoa的demo: <a target="_blank" rel="noopener" href="https://github.com/dboris/ocaml-cocoa/blob/master/examples/count_clicks.ml">https://github.com/dboris/ocaml-cocoa/blob/master/examples/count_clicks.ml</a></li>
-</ul>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/building-ios-apps-with-ocaml/12153">https://discuss.ocaml.org/t/building-ios-apps-with-ocaml/12153</a></p>
-<h2 id="Ahref现在使用Melange构建"><a href="#Ahref现在使用Melange构建" class="headerlink" title="Ahref现在使用Melange构建"></a>Ahref现在使用Melange构建</h2><p><a href="">Melange</a>是结合使用 OCaml 和 Reason 生成 JavaScript 的工具组合。<br><a target="_blank" rel="noopener" href="https://ahrefs.com/">Ahrefs</a>是一个SEO软件套装,包含外链建设、关键字研究、竞争对手分析,排名跟踪和站点审核等工具。Ahrefs内部的大多数功能都是为营销专业人员设计的。</p>
-<p>自去年 9 月以来,Melange、Dune 和 Ahrefs 开发团队一直致力于加强 Dune 和 Melange 之间的集成。作为一家在后端使用大量 OCaml 的公司,Ahrefs看到了Melange可以将其前端技术栈与OCaml更紧密结合(通过使用Melange与UI相关的JavaScript生态系统集成)。因此,该公司决定投资并积极参与以实现这种整合。</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ahrefs-is-now-built-with-melange/12107">https://discuss.ocaml.org/t/ahrefs-is-now-built-with-melange/12107</a></p>
-<h2 id="Ahref正在招聘OCaml开发人员"><a href="#Ahref正在招聘OCaml开发人员" class="headerlink" title="Ahref正在招聘OCaml开发人员"></a>Ahref正在招聘OCaml开发人员</h2><p>一如既往,Ahrefs正在寻找OCaml开发人员,他们总部位于新加坡,团队遍布各地,所以也支持远程,详见:<br><a target="_blank" rel="noopener" href="https://ahrefs.com/jobs/ocaml-developer">https://ahrefs.com/jobs/ocaml-developer</a></p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ahrefs-is-hiring/12136">https://discuss.ocaml.org/t/ahrefs-is-hiring/12136</a></p>
-<h2 id="string-literals-inside-comments-5745"><a href="#string-literals-inside-comments-5745" class="headerlink" title="string literals inside comments #5745"></a>string literals inside comments #5745</h2><p>草,OCaml的parser不会忽略注释中的引号:</p>
-<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">$ echo &#x27;(* &quot;test *)&#x27; | ocaml </span><br><span class="line">OCaml version 5.0.0</span><br><span class="line">Enter #help;; for help.</span><br><span class="line"></span><br><span class="line"># (* &quot;test *)tive `utop_prompt_fancy_light&#x27;.</span><br><span class="line"># * </span><br><span class="line">Error: This comment contains an unterminated string literal</span><br><span class="line">Line 1, characters 3-4: String literal begins here</span><br><span class="line"># </span><br></pre></td></tr></table></figure>
-
-<p>而经过讨论认为修复这个问题是向后不兼容的,所以修复这个词法分析器错误的风险似乎大于好处,就给close了。</p>
-<p>相关issue: <a target="_blank" rel="noopener" href="https://github.com/ocaml/ocaml/issues/5745">https://github.com/ocaml/ocaml/issues/5745</a></p>
-<p>有趣的是F#也继承了这个问题:</p>
-<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">$ echo &#x27;(* &quot;test *)&#x27; | dotnet fsi</span><br><span class="line"></span><br><span class="line">Microsoft (R) F# Interactive version 12.5.0.0 for F# 7.0</span><br><span class="line">Copyright (c) Microsoft Corporation. All Rights Reserved.</span><br><span class="line"></span><br><span class="line">For help type #help;;</span><br><span class="line"></span><br><span class="line">&gt; </span><br><span class="line"> (* &quot;test *)</span><br><span class="line"> ^^</span><br><span class="line"></span><br><span class="line">/home/muqiu-han/stdin(1,1): error FS0517: End of file in string embedded in comment begun at or before here</span><br></pre></td></tr></table></figure>
-
-
-</div>
-
-<script>
- window.onload = detectors();
-</script>
- <div class="post-footer">
- <div class="h-line-primary"></div>
- <nav class="post-nav">
- <div class="prev-item">
-
- <div class="icon arrow-left"></div>
- <div class="post-link">
- <a href="/2023/05/21/OCaml_News_20230521/">Prev</a>
- </div>
-
- </div>
- <div class="next-item">
-
- <div class="icon arrow-right"></div>
- <div class="post-link">
- <a href="/2023/05/09/OCaml_News_20230509/">Next</a>
- </div>
-
- </div>
- </nav>
-</div>
-
-
- <div class="post-comment">
-
-
-
-
-
-
-
-</div>
-
-
-</article>
- </div>
- </div>
-
- <div class="footer">
- <div class="flex-container">
- <div class="footer-text">
-
-
- |
-
-
- 希望路过的人可以添点柴火让这里暖和点
-
- </div>
- </div>
-</div>
-
- </div>
-
-
-
-
- </body>
-</html>
diff --git a/2023/05/21/OCaml_News_20230521/index.html b/2023/05/21/OCaml_News_20230521/index.html
deleted file mode 100644
index 263db05f..00000000
--- a/2023/05/21/OCaml_News_20230521/index.html
+++ /dev/null
@@ -1,320 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8">
-<meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-<meta http-equiv="X-UA-Compatible" content="ie=edge">
-
- <meta name="author" content="含暮秋">
-
-
- <meta name="subtitle" content="暮秋小屋">
-
-
- <meta name="description" content="不卑不亢的码农, 朴素的民谣诗人">
-
-
- <meta name="keywords" content="韩暮秋,MuqiuHan">
-
-
-
-
-<title>OCaml News 2023/5/21 | 暮秋小屋</title>
-
-
-
-
-
-<style>
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Roboto+Mono&display=swap');
-</style>
-
-
-
- <!-- stylesheets list from _config.yml -->
-
- <link rel="stylesheet" href="/css/style.css">
-
-
-
-
-
- <!-- scripts list from _config.yml -->
-
- <script src="/js/frame.js"></script>
-
-
-
-
-
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
-
-
-
-
-
-
-
- <!-- hexo injector head_end start -->
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
-
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
-<!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head>
- <body>
- <div class="mask-border">
- </div>
-
- <div class="wrapper">
-
- <div class="header">
- <div class="flex-container">
- <div class="header-inner">
- <div class="site-brand-container">
- <a href="/">
-
- 暮秋小屋
-
- </a>
- </div>
- <div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
- Menu
- </div>
- <nav class="site-nav">
- <ul class="menu-list">
-
-
- <li class="menu-item">
- <a href="/">主页</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/tags/Technique/">技术</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/Projects">项目</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/categories/gallery/">日记本</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/about">关于</a>
- </li>
-
-
-
- </ul>
- </nav>
- </div>
- </div>
-</div>
-
-
- <div class="main">
- <div class="flex-container">
- <article id="post">
-
-
- <div class="post-head">
- <div class="post-info">
- <div class="tag-list">
-
-
- <span class="post-tag">
- <a href="/tags/OCaml/">
- OCaml
- </a>
- </span>
-
- <span class="post-tag">
- <a href="/tags/Technique/">
- Technique
- </a>
- </span>
-
-
- </div>
- <div class="post-title">
-
-
- OCaml News 2023/5/21
-
-
- </div>
- <span class="post-date">
- May 21, 2023
- </span>
- </div>
- <div class="post-img">
-
- <div class="h-line-primary"></div>
-
- </div>
-</div>
- <div class="post-content">
- <h1 id="二〇二三年五月十五日-二〇二三年五月二十一日"><a href="#二〇二三年五月十五日-二〇二三年五月二十一日" class="headerlink" title="二〇二三年五月十五日 - 二〇二三年五月二十一日"></a>二〇二三年五月十五日 - 二〇二三年五月二十一日</h1><h2 id="Fmlib-browser-0-5-4"><a href="#Fmlib-browser-0-5-4" class="headerlink" title="Fmlib_browser 0.5.4"></a>Fmlib_browser 0.5.4</h2><p>之前介绍过的<a target="_blank" rel="noopener" href="https://github.com/hbr/fmlib">Fmlib: Ocaml函数式Monadic库</a>更新了其中的 <a target="_blank" rel="noopener" href="https://hbr.github.io/fmlib/odoc/fmlib_browser/">Fmlib_browser</a>模块, Fmlib_browser可以帮助用Elm-Style开发纯函数式风格的Web App。</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ann-release-0-5-4-of-fmlib-browser/12184">https://discuss.ocaml.org/t/ann-release-0-5-4-of-fmlib-browser/12184</a></p>
-<h2 id="测试一下OCaml的FFI"><a href="#测试一下OCaml的FFI" class="headerlink" title="测试一下OCaml的FFI"></a>测试一下OCaml的FFI</h2><p>以 《<a target="_blank" rel="noopener" href="https://lemire.me/blog/2023/05/19/the-absurd-cost-of-finalizers-in-go/">The absurd cost of finalizers in Go</a>》 这篇文章作为动机,测试一下OCaml FFI方面的性能比Go好多少或差多少:</p>
-<table>
-<thead>
-<tr>
-<th>test</th>
-<th>ocaml 5.0</th>
-<th>go 1.19.9</th>
-</tr>
-</thead>
-<tbody><tr>
-<td>native add</td>
-<td>0.3 ns</td>
-<td>0.3 ns</td>
-</tr>
-<tr>
-<td>foreign add</td>
-<td>1.5 ns</td>
-<td>60.4 ns</td>
-</tr>
-<tr>
-<td>c allocate &amp; free</td>
-<td>4.0 ns</td>
-<td>71.6 ns</td>
-</tr>
-<tr>
-<td>allocate &amp; free</td>
-<td>17.2 ns</td>
-<td>133.3 ns</td>
-</tr>
-<tr>
-<td>alloc auto</td>
-<td>125.6 ns</td>
-<td>1180 ns</td>
-</tr>
-<tr>
-<td>alloc dummy</td>
-<td>131.0 ns</td>
-<td>1197 ns</td>
-</tr>
-<tr>
-<td>alloc custom</td>
-<td>109.4 ns</td>
-<td>-</td>
-</tr>
-</tbody></table>
-<p>但这不一定是一个准确的测试,例如应该使用<code>Sys.time</code>还是<code>Unix.gettimeofday</code>来计算时间还有待商榷, 更详细的请看论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/critique-my-use-of-ffi/12193">https://discuss.ocaml.org/t/critique-my-use-of-ffi/12193</a></p>
-<h2 id="OCaml在改善开发人员体验方面取得的进展"><a href="#OCaml在改善开发人员体验方面取得的进展" class="headerlink" title="OCaml在改善开发人员体验方面取得的进展"></a>OCaml在改善开发人员体验方面取得的进展</h2><p><a target="_blank" rel="noopener" href="https://ocaml.org/docs/platform">OCaml Platform</a>是提高OCaml工作效率的工具集。 他们在OCaml平台上所做的所有工作都有一个目标: <em>改善 OCaml开发人员的体验</em>。</p>
-<p>以下是目前正在研究并改善的一些工作流程:</p>
-<ol>
-<li><p>构建包:构建工作流的直接目标是消除与使用两种不同的工具进行包管理和构建系统相关的差异。例如OCaml开发者通常需要使用opam下载包再用dune作为构建系统构建包,为此,他们计划将opam直接集成到dune中,使其成为构建OCaml项目所需的单一工具,就像cargo一样。 这项工作也可以改进其他工作流程,例如处理多个项目,交叉编译等。</p>
-<blockquote>
-<p>计划在此: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/explorations-on-package-management-in-dune/12101">https://discuss.ocaml.org/t/explorations-on-package-management-in-dune/12101</a></p>
-</blockquote>
-</li>
-<li><p>编译为JavaScript: 不断改善将OCaml编译为JavaScript的工具。 改善dune与Js_of_ocaml的集成,他们也一直在致力于Dune和<a target="_blank" rel="noopener" href="https://github.com/melange-re/melange">Melange</a>的集成, Melange fork自<a target="_blank" rel="noopener" href="https://github.com/rescript-lang/rescript-compiler">ReScript</a>编译器,专注于与OCaml生态系统集成。</p>
-</li>
-<li><p>文档生成: OCaml包的文档是 OCaml2020至2022调查中的一个主要痛点。 他们正在努力改善OCaml开发人员创建高质量的文档的体验。 例如通过添加新功能、改进导航和扩展odoc标记语法以支持丰富的内容(例如表格、图像和图形)来使odoc生成的文档手册更加高质量。 初次之外还将把OCaml的编辑器支持引入Web和第三方平台,例如OCaml Playground 和 GitHub Codespaces。</p>
-</li>
-<li><p>代码格式化: 提高准确性, 增强向后兼容性, 更加深入地集成dune和ocamlformat</p>
-</li>
-</ol>
-<p>与此同时,OCaml Platform也一直在寻找新的维护者和贡献者, 具体的可以看论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ocaml-platform-newsletter-april-2023/12187">https://discuss.ocaml.org/t/ocaml-platform-newsletter-april-2023/12187</a></p>
-<h2 id="在odoc中内嵌HTML"><a href="#在odoc中内嵌HTML" class="headerlink" title="在odoc中内嵌HTML"></a>在odoc中内嵌HTML</h2><p>通过 <code>&#123;%html: <p>foo</p> %&#125;</code> 来实现, <a target="_blank" rel="noopener" href="https://github.com/ocaml/odoc/blob/72ac2cfdf34ecc0ed574f9e4dd692f5d9b3da412/test/generators/cases/markup.mli#L142C1-L152">例如</a>:</p>
-<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;1 Raw HTML&#125;</span><br><span class="line"></span><br><span class="line">Raw HTML can be &#123;%html:&lt;input type=&quot;text&quot; placeholder=&quot;inserted&quot;&gt;%&#125; as</span><br><span class="line">inline elements into sentences.</span><br><span class="line"></span><br><span class="line">&#123;%html:</span><br><span class="line">&lt;blockquote&gt;</span><br><span class="line"> If the raw HTML is the only thing in a paragraph, it is treated as a block</span><br><span class="line"> element, and won&#x27;t be wrapped in paragraph tags by the HTML generator.</span><br><span class="line">&lt;/blockquote&gt;</span><br><span class="line">%&#125;</span><br></pre></td></tr></table></figure>
-
-
-<p>论坛原帖:<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/is-it-possible-to-include-inline-html-in-ocaml-documentation-odoc/12177">https://discuss.ocaml.org/t/is-it-possible-to-include-inline-html-in-ocaml-documentation-odoc/12177</a></p>
-<h2 id="开源的OCaml静态博客生成工具"><a href="#开源的OCaml静态博客生成工具" class="headerlink" title="开源的OCaml静态博客生成工具"></a>开源的OCaml静态博客生成工具</h2><ul>
-<li><a target="_blank" rel="noopener" href="https://github.com/xhtmlboi/yocaml">YOCaml: A static site generator, mostly written in OCaml</a></li>
-<li><a target="_blank" rel="noopener" href="https://github.com/roddyyaga/finch">Finch: Simple and fast site generator </a></li>
-</ul>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/open-source-tool-to-make-a-static-blog-in-ocaml/11967">https://discuss.ocaml.org/t/open-source-tool-to-make-a-static-blog-in-ocaml/11967</a></p>
-<h2 id="一些GADT的实践用法"><a href="#一些GADT的实践用法" class="headerlink" title="一些GADT的实践用法"></a>一些GADT的实践用法</h2><p><a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/open-source-projects-using-gadts/9640">这个帖子</a> 列出了一些使用了GADT的开源项目,除此之外,还有一篇 <a target="_blank" rel="noopener" href="https://gopiandcode.uk/logs/log-ways-of-sql-in-ocaml.html">《Petrol:使用 GADT 在 OCaml 中嵌入类型安全的 SQL API》</a>。</p>
-<p>函数式语言实现中的LR parser generator生成的代码是无类型的、不必要的低效代码,使用GADT,可以生成类型良好(不会意外崩溃或失败)且高效的解析器, 这篇论文讲了细节: <a target="_blank" rel="noopener" href="http://cambium.inria.fr/~fpottier/publis/fpottier-regis-gianas-typed-lr.pdf">Towards efficient, typed LR parsers</a></p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/a-bestiary-of-gadt-examples/12143">https://discuss.ocaml.org/t/a-bestiary-of-gadt-examples/12143</a></p>
-<h2 id="对-OCaml-org-的改进"><a href="#对-OCaml-org-的改进" class="headerlink" title="对 OCaml.org 的改进"></a>对 OCaml.org 的改进</h2><p>本月,OCaml发布了从3月开始准备的一项改善 OCaml.org 的Learn板块的<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/you-started-to-learn-ocaml-less-than-12-months-ago-please-help-us-with-our-user-survey-on-the-ocaml-org-learning-area/11945">调查结果</a>。该调查在各种平台上进行了推广,包括官方OCaml讨论平台,Discord,LinkedIn,Twitter等,并得到了积极的相应,从五月份开始,官方会根据调查结果改善Learn板块。</p>
-<p>除了的Learn板块的改进之外,官方还对文档进行了一些较小的改进,具体表现在ocaml官网的仓库中许多未完成的包含对学习区域现有文档页面更新的pr, 这些pr将在五月份合并大部分。</p>
-<p>除此之外还有大量细节的更改可以查看论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ocaml-org-newsletter-april-2023/12173">https://discuss.ocaml.org/t/ocaml-org-newsletter-april-2023/12173</a></p>
-<h2 id="生态"><a href="#生态" class="headerlink" title="生态"></a>生态</h2><ul>
-<li><a target="_blank" rel="noopener" href="https://github.com/dinosaure/cri">cri: IRC protocol in OCaml</a></li>
-<li><a target="_blank" rel="noopener" href="https://github.com/dinosaure/bob">bob: A peer-to-peer file-transfer tool in OCaml</a></li>
-<li><a target="_blank" rel="noopener" href="https://github.com/dinosaure/art">art: Adaptive Radix Tree in OCaml</a></li>
-<li><a target="_blank" rel="noopener" href="https://github.com/dbuenzli/uucd">uucd: Unicode character database decoder for OCaml</a></li>
-<li><a target="_blank" rel="noopener" href="https://github.com/lukstafi/ocannl">OCANNL: OCaml Compiles Algorithms for Neural Networks Learning</a></li>
-<li><a target="_blank" rel="noopener" href="https://github.com/Octachron/codept">codept: Contextual Ocaml DEPendencies Tool: alternative ocaml dependency analyzer</a></li>
-<li><a target="_blank" rel="noopener" href="https://github.com/Armael/pp_loc">pp_loc: Pretty-printing for error source locations</a></li>
-</ul>
-
-</div>
-
-<script>
- window.onload = detectors();
-</script>
- <div class="post-footer">
- <div class="h-line-primary"></div>
- <nav class="post-nav">
- <div class="prev-item">
-
- <div class="icon arrow-left"></div>
- <div class="post-link">
- <a href="/2023/05/31/OCaml_News_20230531/">Prev</a>
- </div>
-
- </div>
- <div class="next-item">
-
- <div class="icon arrow-right"></div>
- <div class="post-link">
- <a href="/2023/05/15/OCaml_News_20230515/">Next</a>
- </div>
-
- </div>
- </nav>
-</div>
-
-
- <div class="post-comment">
-
-
-
-
-
-
-
-</div>
-
-
-</article>
- </div>
- </div>
-
- <div class="footer">
- <div class="flex-container">
- <div class="footer-text">
-
-
- |
-
-
- 希望路过的人可以添点柴火让这里暖和点
-
- </div>
- </div>
-</div>
-
- </div>
-
-
-
-
- </body>
-</html>
diff --git a/2023/05/31/OCaml_News_20230531/index.html b/2023/05/31/OCaml_News_20230531/index.html
deleted file mode 100644
index d2299d1b..00000000
--- a/2023/05/31/OCaml_News_20230531/index.html
+++ /dev/null
@@ -1,279 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8">
-<meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
-<meta http-equiv="X-UA-Compatible" content="ie=edge">
-
- <meta name="author" content="含暮秋">
-
-
- <meta name="subtitle" content="暮秋小屋">
-
-
- <meta name="description" content="不卑不亢的码农, 朴素的民谣诗人">
-
-
- <meta name="keywords" content="韩暮秋,MuqiuHan">
-
-
-
-
-<title>OCaml News 2023/5/31 | 暮秋小屋</title>
-
-
-
-
-
-<style>
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Roboto+Mono&display=swap');
-</style>
-
-
-
- <!-- stylesheets list from _config.yml -->
-
- <link rel="stylesheet" href="/css/style.css">
-
-
-
-
-
- <!-- scripts list from _config.yml -->
-
- <script src="/js/frame.js"></script>
-
-
-
-
-
- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
-
-
-
-
-
-
-
- <!-- hexo injector head_end start -->
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
-
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
-<!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head>
- <body>
- <div class="mask-border">
- </div>
-
- <div class="wrapper">
-
- <div class="header">
- <div class="flex-container">
- <div class="header-inner">
- <div class="site-brand-container">
- <a href="/">
-
- 暮秋小屋
-
- </a>
- </div>
- <div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
- Menu
- </div>
- <nav class="site-nav">
- <ul class="menu-list">
-
-
- <li class="menu-item">
- <a href="/">主页</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/tags/Technique/">技术</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/Projects">项目</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/categories/gallery/">日记本</a>
- </li>
-
-
-
- <li class="menu-item">
- <a href="/about">关于</a>
- </li>
-
-
-
- </ul>
- </nav>
- </div>
- </div>
-</div>
-
-
- <div class="main">
- <div class="flex-container">
- <article id="post">
-
-
- <div class="post-head">
- <div class="post-info">
- <div class="tag-list">
-
-
- <span class="post-tag">
- <a href="/tags/OCaml/">
- OCaml
- </a>
- </span>
-
- <span class="post-tag">
- <a href="/tags/Technique/">
- Technique
- </a>
- </span>
-
-
- </div>
- <div class="post-title">
-
-
- OCaml News 2023/5/31
-
-
- </div>
- <span class="post-date">
- May 31, 2023
- </span>
- </div>
- <div class="post-img">
-
- <div class="h-line-primary"></div>
-
- </div>
-</div>
- <div class="post-content">
- <h1 id="二〇二三年五月二十一-二〇二三年五月三十一日"><a href="#二〇二三年五月二十一-二〇二三年五月三十一日" class="headerlink" title="二〇二三年五月二十一 - 二〇二三年五月三十一日"></a>二〇二三年五月二十一 - 二〇二三年五月三十一日</h1><h2 id="为什么OCaml中总是约定俗成的写-type-t"><a href="#为什么OCaml中总是约定俗成的写-type-t" class="headerlink" title="为什么OCaml中总是约定俗成的写 type t = ... ?"></a>为什么OCaml中总是约定俗成的写 <code>type t = ...</code> ?</h2><p>在OCaml中我们经常会看到:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">module</span> <span class="type">Foo</span> = <span class="keyword">struct</span></span><br><span class="line"> <span class="keyword">type</span> t = ...</span><br><span class="line"> ...</span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>
-<p>这种写法已经存在于29年前的 <a target="_blank" rel="noopener" href="https://github.com/camllight/camllight/blob/master/sources/src/lib/hashtbl.mli#L5">Caml Light sources</a> 中, SML里面也能看到这种写法。 按照惯例,当一个模块定义了一个唯一的核心抽象数据类型时,就写成<code>type t = ...</code>。</p>
-<p>为什么要这么写也有比较多原因,具体可以看论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/why-is-ocaml-convention-to-use-type-t/12256">https://discuss.ocaml.org/t/why-is-ocaml-convention-to-use-type-t/12256</a></p>
-<p>但可以知道的是,有了这个约定之后Functor的使用会更加方便。 例如标准库的<code>Set</code>模块,大家都可以直接:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">Set</span>.<span class="type">Make</span>(<span class="type">Foo</span>)</span><br></pre></td></tr></table></figure>
-
-<p>而不是多写一些无用的代码:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">Set</span>.<span class="type">Make</span>(<span class="keyword">struct</span></span><br><span class="line"> <span class="keyword">include</span> <span class="type">Foobar</span></span><br><span class="line"> <span class="keyword">type</span> t = foobar</span><br><span class="line"> <span class="keyword">let</span> compare = compare_foobar </span><br><span class="line"><span class="keyword">end</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure>
-
-<h2 id="如何更高效的使用OCaml"><a href="#如何更高效的使用OCaml" class="headerlink" title="如何更高效的使用OCaml"></a>如何更高效的使用OCaml</h2><p>在这个帖子中,针对在OCaml中使用新的库由于因为文档很少并且需要阅读源码导致非常耗时的问题展开了讨论:</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/how-do-you-stay-productive-in-ocaml/8221">https://discuss.ocaml.org/t/how-do-you-stay-productive-in-ocaml/8221</a></p>
-<h2 id="求值顺序"><a href="#求值顺序" class="headerlink" title="求值顺序"></a>求值顺序</h2><p>在OCaml中,想这样的代码:</p>
-<figure class="highlight ocaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">foo(f x, f y, f z)</span><br></pre></td></tr></table></figure>
-<p>会先对 <code>f z</code> 求值而不是 <code>f x</code>,OCaml官方并没有定义求值顺序,实现上是从右到左的,如果想从左到右只能一个个let。</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/evaluation-order/12258">https://discuss.ocaml.org/t/evaluation-order/12258</a></p>
-<h2 id="OCaml-Platform路线图"><a href="#OCaml-Platform路线图" class="headerlink" title="OCaml Platform路线图"></a>OCaml Platform路线图</h2><p>在2020年的OCaml Platform会议中,avsm和OCaml Platform团队提出了针对开发工具(例如编辑器)的改进,使开发效率提升,这三年以来OCaml的开发工具和开发人员体验发生了很大变化,OCaml Platform的工作也取得了重大进展。</p>
-<blockquote>
-<p>2020年OCaml Platform会议视频: <a target="_blank" rel="noopener" href="https://watch.ocaml.org/w/2KbfRNv2oLtkKXkbd5u9F1">https://watch.ocaml.org/w/2KbfRNv2oLtkKXkbd5u9F1</a></p>
-</blockquote>
-<p>对于未来,OCaml Platform打算研究新的OCaml工作流原型。并认为应该反思过去三年所做的一切并制定未来三年的路线图。</p>
-<p>所以在过去的几个月里,OCaml Platform一直致力于收集尽可能多的社区反馈,并组织了几个会议,会见了使用OCaml的来自各个行业的开发者,并从他们口中了解相关的需求和痛点。在会议中还共同思考了理想的 OCaml 开发人员体验应该是什么。</p>
-<p>OCaml Platform希望由社区驱动自身,所以公布了路线图,并开始收集反馈并对其进行更新迭代:</p>
-<blockquote>
-<p>OCaml Platfrom路线图: <a target="_blank" rel="noopener" href="https://github.com/tarides/ocaml-platform-roadmap">https://github.com/tarides/ocaml-platform-roadmap</a></p>
-</blockquote>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/a-roadmap-for-the-ocaml-platform-seeking-your-feedback/12238">https://discuss.ocaml.org/t/a-roadmap-for-the-ocaml-platform-seeking-your-feedback/12238</a></p>
-<h2 id="OCaml的Debug体验"><a href="#OCaml的Debug体验" class="headerlink" title="OCaml的Debug体验"></a>OCaml的Debug体验</h2><p>VS Code唯一的debug支持是 <a target="_blank" rel="noopener" href="https://github.com/hackwaly/ocamlearlybird/">hackwaly&#x2F;ocamlearlybird</a> , 但遗憾的是它已经不积极维护了(根据 README 判断它只支持 4.11 和 4.12)。</p>
-<p>所以在出现更好的替代方案之前…</p>
-<blockquote>
-<p>The most effective debugging tool is still careful thought, coupled with judiciously placed print statements!!!</p>
-</blockquote>
-<p>不过除此之外还是有很多Debug相关的库和方案的,比如上一期的 <a target="_blank" rel="noopener" href="https://github.com/lukstafi/ppx_minidebug">ppx_minidebug</a> 和 <a target="_blank" rel="noopener" href="https://github.com/dariusf/ppx_debug">ppx_debug</a> 或者是 <a target="_blank" rel="noopener" href="https://github.com/dariusf/ppx_interact">ppx_interact</a>。</p>
-<p>具体的可以看论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/enhancing-ocaml-debugging-experience-in-visual-studio-code/12236">https://discuss.ocaml.org/t/enhancing-ocaml-debugging-experience-in-visual-studio-code/12236</a></p>
-<h2 id="类似-MIT-Scratch-x2F-Berkeley-Snap-x2F-Google-Blockly-之类的OCaml实现?"><a href="#类似-MIT-Scratch-x2F-Berkeley-Snap-x2F-Google-Blockly-之类的OCaml实现?" class="headerlink" title="类似 MIT Scratch&#x2F;Berkeley Snap&#x2F;Google Blockly 之类的OCaml实现?"></a>类似 MIT Scratch&#x2F;Berkeley Snap&#x2F;Google Blockly 之类的OCaml实现?</h2><p><a target="_blank" rel="noopener" href="https://github.com/google/blockly">Blockly</a>是一个基于网络的可视化编程编辑器。</p>
-<p>OCaml中也有类似的 <a target="_blank" rel="noopener" href="https://hazel.org/">Hazle</a></p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/exists-scratch-snap-blockly-for-ocaml-js/12234">https://discuss.ocaml.org/t/exists-scratch-snap-blockly-for-ocaml-js/12234</a></p>
-<h2 id="Tiny-httpd-v0-13"><a href="#Tiny-httpd-v0-13" class="headerlink" title="Tiny_httpd v0.13"></a>Tiny_httpd v0.13</h2><p><a target="_blank" rel="noopener" href="https://github.com/c-cube/tiny_httpd">Tiny_httpd</a> 是一个极简的 HTTP 1.1 服务器库,它依赖线程(或线程池)而不是异步&#x2F;协作多任务处理。可能有点异端。</p>
-<h2 id="Parany-v14-0-0"><a href="#Parany-v14-0-0" class="headerlink" title="Parany v14.0.0"></a>Parany v14.0.0</h2><p><a target="_blank" rel="noopener" href="https://github.com/UnixJunkie/parany">Parany</a>可以用于并行化任何类型的计算,在这个版本中作者将运行时切换回了<code>fork+marshal</code></p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/new-major-release-of-parany-v14-0-0/12208">https://discuss.ocaml.org/t/new-major-release-of-parany-v14-0-0/12208</a></p>
-<h2 id="Merlin-v4-9"><a href="#Merlin-v4-9" class="headerlink" title="Merlin v4.9"></a>Merlin v4.9</h2><p><a target="_blank" rel="noopener" href="https://github.com/ocaml/merlin">Merlin</a> 是为OCaml提供现代IDE功能的编辑器后端服务,这个新版本带来了许多改进和错误修复。而且发现并修复了一个重要的内存消耗问题.</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/ann-new-release-merlin-4-9/12277">https://discuss.ocaml.org/t/ann-new-release-merlin-4-9/12277</a></p>
-<h2 id="OCaml-Learn板块更新"><a href="#OCaml-Learn板块更新" class="headerlink" title="OCaml Learn板块更新"></a>OCaml Learn板块更新</h2><p>社区成员为官网的<a target="_blank" rel="noopener" href="https://staging.ocaml.org/docs">Learn板块</a>贡献了以章有关<a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/creating-a-tutorial-on-sequences/12091">Sequence</a>的教程。</p>
-<p>论坛原帖: <a target="_blank" rel="noopener" href="https://discuss.ocaml.org/t/creating-a-tutorial-on-sequences/12091">https://discuss.ocaml.org/t/creating-a-tutorial-on-sequences/12091</a></p>
-<h2 id="生态"><a href="#生态" class="headerlink" title="生态"></a>生态</h2><ul>
-<li><a target="_blank" rel="noopener" href="https://github.com/janestreet/streamable">streamable</a>: A collection of types suitable for incremental serialization. </li>
-<li><a target="_blank" rel="noopener" href="https://github.com/janestreet/incr_dom">incr_dom</a>: A library for building dynamic webapps, using Js_of_ocaml.</li>
-</ul>
-
-</div>
-
-<script>
- window.onload = detectors();
-</script>
- <div class="post-footer">
- <div class="h-line-primary"></div>
- <nav class="post-nav">
- <div class="prev-item">
-
- <div class="icon arrow-left"></div>
- <div class="post-link">
- <a href="/2023/06/10/%E4%BA%8C%E9%9B%B6%E4%BA%8C%E4%B8%89%E5%B9%B4%E5%85%AD%E6%9C%88%E5%8D%81%E6%97%A5/">Prev</a>
- </div>
-
- </div>
- <div class="next-item">
-
- <div class="icon arrow-right"></div>
- <div class="post-link">
- <a href="/2023/05/21/OCaml_News_20230521/">Next</a>
- </div>
-
- </div>
- </nav>
-</div>
-
-
- <div class="post-comment">
-
-
-
-
-
-
-
-</div>
-
-
-</article>
- </div>
- </div>
-
- <div class="footer">
- <div class="flex-container">
- <div class="footer-text">
-
-
- |
-
-
- 希望路过的人可以添点柴火让这里暖和点
-
- </div>
- </div>
-</div>
-
- </div>
-
-
-
-
- </body>
-</html>