16 Matching Annotations
  1. Dec 2022
  2. Nov 2022
    1. This project file is needed in the root directory of every source tree that you want to compile with Dune. In general, you’ll have a dune file in every subdirectory of the source tree but only one dune-project file at the root.

      dune 文件用来制定每个 sub-directory 如何编译;而dune-project 文件用来指定整个项目的编译配置

    1. let increment x = x + 1

      Ocaml 中函数定义的语法和变量定义的语法基本一致,这让 “函数也是一种数据” 变得更加显然。

    1. There are five essential components to learning a language: syntax, semantics, idioms, libraries, and tools.


    1. Parametric polymorphism: Functions and data structures can be parameterized over types. This is crucial for being able to re-use code.


    1. A switch is a named installation of OCaml with a particular compiler version and set of packages.

      switch 是一个 ocaml 的虚拟环境,类似于 python 中的 virtual-env

    2. Here’s what we’re going to install: A Unix development environment OPAM, the OCaml Package Manager An OPAM switch with the OCaml compiler and some packages The Visual Studio Code editor, with OCaml support

      OCaml 开发环境创建

  3. Nov 2019
    1. The language for writing React. Reason's creator also created ReactJS, whose first prototypes were written in SML, a distant cousin of OCaml. We've transcribed ReactML into ReactJS for wide adoption. A few years later, we're now iterating on the future of ReactJS through ReasonReact.
    2. Many backing languages would satisfy the previous section's points; the points below, however, have been deal-breakers in our considerations.
    3. The ability to render to native code. OCaml's native (assembly) startup time is in single digit milliseconds. We have big plans to use Reason on native one day; meanwhile, we're focusing on adoption through great JavaScript compatibility.
  4. Oct 2018