diff options
Diffstat (limited to 'search.xml')
| -rw-r--r-- | search.xml | 137 |
1 files changed, 97 insertions, 40 deletions
@@ -554,9 +554,66 @@ </tags> </entry> <entry> - <title></title> - <url>/2024/07/23/OCaml-News-2024-5/</url> - <content><![CDATA[]]></content> + <title>OCaml News 2024-3</title> + <url>/2024/06/27/OCaml-News-2024-5/</url> + <content><![CDATA[<h2 id="语言的发展"><a href="#语言的发展" class="headerlink" title="语言的发展"></a>语言的发展</h2><ul> +<li><a href="https://link.zhihu.com/?target=https://github.com/ocaml/ocaml/pull/13097">Immutable arrays #13097: This PR proposes to add immutable arrays to OCaml.</a></li> +<li><a href="https://link.zhihu.com/?target=https://github.com/ocaml/ocaml/pull/13199">Support running native debuggers in ocamltest #13199</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://github.com/ocaml/ocaml/pull/13152">The Pattern-Matching Bug: fix totality information by gasche · Pull Request #13152 · ocaml/ocaml</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://github.com/ocaml/ocaml/pull/11974%23discussion_r1621832545">Add loongarch architecture support #11974</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://github.com/ocaml/ocaml/pull/13101">Add Stdlib.todo #13101</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://tarides.com/blog/2024-06-26-enhancing-the-ocaml-org-community-page-boosting-ux-and-ui-based-on-user-research/">Enhancing the OCaml.org Community Page: Boosting UX and UI Based on User Research.</a></li> +<li><a href="https://link.zhihu.com/?target=https://tarides.com/blog/2024-05-22-launching-the-first-class-windows-project/">Launching the First-Class Windows Project</a>.</li> +</ul> +<h2 id="新消息"><a href="#新消息" class="headerlink" title="新消息"></a>新消息</h2><ul> +<li><p><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/ann-project-wide-occurrences-in-merlin-and-lsp/14847">[ANN] Project wide occurrences in Merlin and LSP</a>.</p> +</li> +<li><p><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/ann-opam-2-2-0-rc1-release/14842">[ANN] opam 2.2.0 rc1 release</a>.</p> +</li> +<li><p><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/ann-first-release-of-baby/14840">[ANN] First release of baby</a>.</p> +</li> +<li><p><a href="https://link.zhihu.com/?target=https://github.com/fpottier/baby">baby</a> is an OCaml library that offers several implementations of balanced binary search trees.</p> +</li> +<li><p><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/ann-preview-of-stripe-client-and-mock-server-dkstdrestapis/14841">[ANN] Preview of Stripe client and mock server - DkStdRestApis</a>.</p> +</li> +<li><p><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/ann-caisar-release-2-0-a-platform-for-characterizing-ai-safety-and-robustness/14831">[ANN] CAISAR release 2.0, a platform for characterizing AI safety and robustness</a>.</p> +</li> +<li><p><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/ann-forester-4-1/14800">[ANN] Forester 4.1</a>.</p> +</li> +<li><p><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/ann-dream-html-pure-html-3-5-2/14808">[ANN] dream-html & pure-html 3.5.2</a></p> +</li> +</ul> +<h2 id="有价值的文章"><a href="#有价值的文章" class="headerlink" title="有价值的文章"></a>有价值的文章</h2><ul> +<li><a href="https://link.zhihu.com/?target=https://tarides.com/blog/2024-06-19-keeping-up-with-the-compiler-how-we-help-maintain-the-ocaml-language/">Keeping Up With the Compiler: How we Help Maintain the OCaml Language</a></li> +<li><a href="https://link.zhihu.com/?target=https://github.com/ocaml/ocaml/pull/10995">Explain mapping between OCaml memory model and C.</a></li> +<li><a href="https://link.zhihu.com/?target=https://xavierleroy.org/CdF/2023-2024/index.html">Control structures – Xavier Leroy</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://dev.to/chshersh/8-months-of-ocaml-after-8-years-of-haskell-in-production-h96">8 months of OCaml after 8 years of Haskell in production</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://hypirion.com/musings/getting-ocaml-through-the-eye-of-a-needle">Getting OCaml Through the Eye of a Needle</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://tarides.com/blog/2024-06-05-secure-from-the-ground-up-introducing-the-fides-project-combining-risc-v-and-mirageos/">Secure From the Ground Up: Introducing the FIDES Project Combining RISC-V and MirageOS.</a></li> +<li><a href="https://link.zhihu.com/?target=https://tarides.com/blog/2024-05-29-effective-ml-through-merlin-s-destruct-command/">Effective ML Through Merlin’s Destruct Command.</a></li> +<li><a href="https://link.zhihu.com/?target=https://blog.osau.re/articles/reproducible.html">Dinosaure’s website - Reproducibility!</a></li> +<li><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/experiments-in-jitting/14853">Experiments in JITting</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/how-to-write-an-efficient-cp-r-clone-with-eio/14848">How to write an efficient ‘cp -R’ clone with Eio?</a></li> +<li><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/generating-infix-extension-nodes-with-ppxlib/14833">Generating infix extension nodes with Ppxlib</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/this-made-my-day-float-to-string-and-string-of-float-without-loss-of-precision/14825">This made my day (float to string and string of float without loss of precision)</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/help-with-cryptic-dependency-cycle-compile-errors-using-dune-build/14864">Help with cryptic dependency cycle compile errors using <code>dune build</code></a>.</li> +<li><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/why-does-relaxed-value-restriction-treat-function-types-differently/14802">Why does relaxed value restriction treat function types differently?</a></li> +<li><a href="https://link.zhihu.com/?target=https://discuss.ocaml.org/t/binding-existentials-in-a-non-uniform-gadt/14809">Binding existentials in a non-uniform GADT</a>.</li> +</ul> +<h2 id="有趣的项目"><a href="#有趣的项目" class="headerlink" title="有趣的项目"></a>有趣的项目</h2><ul> +<li><a href="https://link.zhihu.com/?target=https://ocaml.org/p/ocaml-index/latest">ocaml-index 1.0 (latest) · OCaml Package: A tool that indexes value usages from cmt files</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://ocaml.org/p/fileutils/latest">fileutils 0.6.4 (latest) · OCaml Package: API to manipulate files (POSIX like) and filenames.</a></li> +<li><a href="https://link.zhihu.com/?target=https://ocaml.org/p/pure-html/latest">pure-html 3.5.2 (latest) · OCaml Package</a></li> +<li><a href="https://link.zhihu.com/?target=https://github.com/fpottier/baby">GitHub - fpottier/baby: A balanced binary search tree library for OCaml</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://github.com/akabe/ocaml-jupyter">GitHub - akabe/ocaml-jupyter: An OCaml kernel for Jupyter (IPython) notebook</a>.</li> +<li><a href="https://link.zhihu.com/?target=https://github.com/robur-coop/orb">Github - robur-coop/orb: check opam package reproductibility.</a></li> +<li><a href="https://link.zhihu.com/?target=https://github.com/ocaml-multicore/dscheck%23motivation">Github - ocaml-multicore/dscheck: Experimental model checker for testing concurrent algorithms.</a></li> +</ul> +]]></content> + <tags> + <tag>Technique</tag> + <tag>OCaml</tag> + </tags> </entry> <entry> <title>Radiographic Absence of the Left Humeral Head</title> @@ -580,6 +637,34 @@ </tags> </entry> <entry> + <title>Rescript @genType import 问题</title> + <url>/2024/05/20/Rescript-genType-import-%E9%97%AE%E9%A2%98/</url> + <content><![CDATA[<p>Rescript 11 之后,<code>@genType</code> 被合并进编译器,无需任何依赖就能使用,当在 Rescript 中 <code>@genType</code> 了使用某些 Rescript built-in 的基本类型时,可能会生成有问题的 <code>import</code> 相关代码,例如:</p> +<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">@genType</span><br><span class="line">module LoginResponse = {</span><br><span class="line"> let status = response => {</span><br><span class="line"> response</span><br><span class="line"> ->Js.Json.decodeObject</span><br><span class="line"> ->Option.flatMap(response => {</span><br><span class="line"> response->Js_dict.get("status")</span><br><span class="line"> })</span><br><span class="line"> }</span><br><span class="line">}</span><br></pre></td></tr></table></figure> + +<p><code>status</code> 函数具有 <code>Js.Json.t => option<Js.Json.t></code> 类型,那么在生成的 TypeScript 文件中,会出现这样的 import:</p> +<figure class="highlight typescript"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> <span class="keyword">type</span> { <span class="title class_">Json</span>_t <span class="keyword">as</span> <span class="title class_">Js</span>_Json_t } <span class="keyword">from</span> <span class="string">"./Js.gen.tsx"</span></span><br></pre></td></tr></table></figure> + +<p>而 <code>Js.gen.tsx</code> 这个文件是不存在的,解决方案是使用 <code>@genType</code> 的 <code>shim</code>:</p> +<ul> +<li><p>在 <code>rescript.json</code> 中的 <code>gentypeconfig</code> 中添加 <code>shim</code> 配置:</p> +<figure class="highlight json"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line"><span class="attr">"gentypeconfig"</span><span class="punctuation">:</span> <span class="punctuation">{</span></span><br><span class="line">...</span><br><span class="line"> <span class="attr">"shims"</span><span class="punctuation">:</span> <span class="punctuation">{</span></span><br><span class="line"> <span class="attr">"Js"</span><span class="punctuation">:</span> <span class="string">"Js"</span></span><br><span class="line"> <span class="punctuation">}</span><span class="punctuation">,</span></span><br><span class="line">...</span><br><span class="line"><span class="punctuation">}</span></span><br><span class="line">...</span><br></pre></td></tr></table></figure> +</li> +<li><p>然后新建 <code>Js.shim.ts</code>:</p> +<figure class="highlight typescript"><table><tr><td class="code"><pre><span class="line"><span class="keyword">export</span> <span class="keyword">type</span> <span class="title class_">Json</span>_t = <span class="built_in">unknown</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">type</span> t = <span class="built_in">unknown</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">type</span> <span class="title class_">Exn</span>_t = <span class="title class_">Error</span>;</span><br></pre></td></tr></table></figure> +</li> +<li><p>删除原来由 <code>@genType</code> 生成的 TypeScript 文件并重新生成</p> +</li> +</ul> +<p>现在生成的 TypeScript 文件将会从 <code>Js.shim.ts</code> import 类型:</p> +<figure class="highlight typescript"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> <span class="keyword">type</span> {<span class="title class_">Json</span>_t <span class="keyword">as</span> <span class="title class_">Js</span>_Json_t} <span class="keyword">from</span> <span class="string">'../../src/model/Js.shim.ts'</span>;</span><br></pre></td></tr></table></figure> +]]></content> + <tags> + <tag>Technique</tag> + <tag>Rescript</tag> + </tags> + </entry> + <entry> <title>Rescript and React Native</title> <url>/2024/01/22/Rescript-React-Native/</url> <content><![CDATA[<p>Rescript 对 React Native 的支持还算可以,但如今的 RN 已经是 Expo 的 RN 了,所以仍然有些落后,在这个 template 中,我测试了 rescript + rescript-react-native + expo + nativewind 的组合,可以跑起来:</p> @@ -611,34 +696,6 @@ </tags> </entry> <entry> - <title>Rescript @genType import 问题</title> - <url>/2024/05/20/Rescript-genType-import-%E9%97%AE%E9%A2%98/</url> - <content><![CDATA[<p>Rescript 11 之后,<code>@genType</code> 被合并进编译器,无需任何依赖就能使用,当在 Rescript 中 <code>@genType</code> 了使用某些 Rescript built-in 的基本类型时,可能会生成有问题的 <code>import</code> 相关代码,例如:</p> -<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">@genType</span><br><span class="line">module LoginResponse = {</span><br><span class="line"> let status = response => {</span><br><span class="line"> response</span><br><span class="line"> ->Js.Json.decodeObject</span><br><span class="line"> ->Option.flatMap(response => {</span><br><span class="line"> response->Js_dict.get("status")</span><br><span class="line"> })</span><br><span class="line"> }</span><br><span class="line">}</span><br></pre></td></tr></table></figure> - -<p><code>status</code> 函数具有 <code>Js.Json.t => option<Js.Json.t></code> 类型,那么在生成的 TypeScript 文件中,会出现这样的 import:</p> -<figure class="highlight typescript"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> <span class="keyword">type</span> { <span class="title class_">Json</span>_t <span class="keyword">as</span> <span class="title class_">Js</span>_Json_t } <span class="keyword">from</span> <span class="string">"./Js.gen.tsx"</span></span><br></pre></td></tr></table></figure> - -<p>而 <code>Js.gen.tsx</code> 这个文件是不存在的,解决方案是使用 <code>@genType</code> 的 <code>shim</code>:</p> -<ul> -<li><p>在 <code>rescript.json</code> 中的 <code>gentypeconfig</code> 中添加 <code>shim</code> 配置:</p> -<figure class="highlight json"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line"><span class="attr">"gentypeconfig"</span><span class="punctuation">:</span> <span class="punctuation">{</span></span><br><span class="line">...</span><br><span class="line"> <span class="attr">"shims"</span><span class="punctuation">:</span> <span class="punctuation">{</span></span><br><span class="line"> <span class="attr">"Js"</span><span class="punctuation">:</span> <span class="string">"Js"</span></span><br><span class="line"> <span class="punctuation">}</span><span class="punctuation">,</span></span><br><span class="line">...</span><br><span class="line"><span class="punctuation">}</span></span><br><span class="line">...</span><br></pre></td></tr></table></figure> -</li> -<li><p>然后新建 <code>Js.shim.ts</code>:</p> -<figure class="highlight typescript"><table><tr><td class="code"><pre><span class="line"><span class="keyword">export</span> <span class="keyword">type</span> <span class="title class_">Json</span>_t = <span class="built_in">unknown</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">type</span> t = <span class="built_in">unknown</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">type</span> <span class="title class_">Exn</span>_t = <span class="title class_">Error</span>;</span><br></pre></td></tr></table></figure> -</li> -<li><p>删除原来由 <code>@genType</code> 生成的 TypeScript 文件并重新生成</p> -</li> -</ul> -<p>现在生成的 TypeScript 文件将会从 <code>Js.shim.ts</code> import 类型:</p> -<figure class="highlight typescript"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> <span class="keyword">type</span> {<span class="title class_">Json</span>_t <span class="keyword">as</span> <span class="title class_">Js</span>_Json_t} <span class="keyword">from</span> <span class="string">'../../src/model/Js.shim.ts'</span>;</span><br></pre></td></tr></table></figure> -]]></content> - <tags> - <tag>Technique</tag> - <tag>Rescript</tag> - </tags> - </entry> - <entry> <title>Rust NewType 模式</title> <url>/2023/05/03/Rust-NewType-%E6%A8%A1%E5%BC%8F/</url> <content><![CDATA[<p>New Type模式是一种软件设计模式,用于在已有类型的基础上创建一个新的类型。在Rust中,这通常是通过<strong>定义一个结构体,其中只包含一个单一成员。这个结构体(New Type)对外提供了一个新的、独立的类型,用于对原始类型增加额外的语义或限制。</strong></p> @@ -1321,6 +1378,15 @@ </categories> </entry> <entry> + <title>二零二三年二月二日</title> + <url>/2023/02/02/%E4%BA%8C%E9%9B%B6%E4%BA%8C%E4%B8%89%E5%B9%B4%E4%BA%8C%E6%9C%88%E4%BA%8C%E6%97%A5/</url> + <content><![CDATA[<p>我不知道这些黑乎乎的东西从哪来的,它们填满了这黄铜色的硬币每一处,像机油,像泥泞,它们随着这五角钱硬币一起从我手上换走了一袋糖果,那是一个蓬头垢面,满身泥灰的小孩,他起身看着这个给他糖果的叔叔,我蹲下看着我拥有糖果的童年。<br><br>这事很恐怖,意味着我在这个地方又多了一丝牵挂,多了一个不离开的理由。</p> +]]></content> + <categories> + <category>gallery</category> + </categories> + </entry> + <entry> <title>二零二三年八月二十一日</title> <url>/2023/08/21/%E4%BA%8C%E9%9B%B6%E4%BA%8C%E4%B8%89%E5%B9%B4%E5%85%AB%E6%9C%88%E4%BA%8C%E5%8D%81%E4%B8%80%E6%97%A5/</url> <content><![CDATA[<p>他看了一眼远处的尸体,指挥着镰刀将远处的杂草割干净,到处都是鲜花,春天来了,漫山遍野。</p> @@ -1339,15 +1405,6 @@ </categories> </entry> <entry> - <title>二零二三年二月二日</title> - <url>/2023/02/02/%E4%BA%8C%E9%9B%B6%E4%BA%8C%E4%B8%89%E5%B9%B4%E4%BA%8C%E6%9C%88%E4%BA%8C%E6%97%A5/</url> - <content><![CDATA[<p>我不知道这些黑乎乎的东西从哪来的,它们填满了这黄铜色的硬币每一处,像机油,像泥泞,它们随着这五角钱硬币一起从我手上换走了一袋糖果,那是一个蓬头垢面,满身泥灰的小孩,他起身看着这个给他糖果的叔叔,我蹲下看着我拥有糖果的童年。<br><br>这事很恐怖,意味着我在这个地方又多了一丝牵挂,多了一个不离开的理由。</p> -]]></content> - <categories> - <category>gallery</category> - </categories> - </entry> - <entry> <title>二零二三年八月二十七日</title> <url>/2023/08/27/%E4%BA%8C%E9%9B%B6%E4%BA%8C%E4%B8%89%E5%B9%B4%E5%85%AB%E6%9C%88%E4%BA%8C%E5%8D%81%E4%B8%83%E6%97%A5/</url> <content><