Top all-time · #5782
Notes on Computing
Personal blog · jobjo.github.ioprogramming
Notes on Computing is a personal blog at jobjo.github.io about programming. Since 2018, 14 different Hacker News readers have linked it 18 times, most often “OCaml has some new shiny syntax”. The last post was in 2020, but the archive is still widely read.
Too few sampled comments (12) to say how often HN recommends it.?
Why HN links it
HN readers link this post to explain OCaml's newer let-binding syntax, which supports monadic and applicative operators and is compared with F# computation expressions. Most comments cite it as a reference.
Summarised by Claude from a sample of 12 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
A website with blog posts, and pages.
Most-linked posts?
- OCaml has some new shiny syntax4 people · 7 mentions · first linked 2019-04-25
- /2019/04/24/ocaml-has-some-new-shiny-syntax.html4 people · 4 mentions · first linked 2019-06-14
- //2019/04/24/ocaml-has-some-new-shiny-syntax.html2 people · 2 mentions · first linked 2019-05-22
What Hacker News says?
OCaml has monadic let syntax[1] which is similar to F#'s computation expressions. I am not sure why it is not yet supported in Reasonml/Bucklescript. [1] http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s...
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “Full-Bleed Layout Using CSS Grid”Submitted Applicative Parsing as a story · 93 points
HN discussionIt's interesting to compare some of those things, though. * OCaml has now landed monadic and applicative binding syntax ( http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s... ), which I think makes it a superset of F# computation expressions. * Regarding Span<'T> (or my preference 'T Span :-), I believe F# and OCaml have developed different optimizations and constraints. For example, in OCaml allocation i…
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “Write your own Excel in F# (2018)”Submitted Lenses in OCaml using modular implicits as a story · 3 points
HN discussion> list comprehension Are you referring to F#'s computation expressions? If so, OCaml has a similar-in-power let-syntax now: http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s... > Ocaml and F# can (for the most part) easily be transpiled into one another, Actually they can't. They are quite different languages in practice.
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “OCaml 4.10”Submitted The mice moving challenge (2017) as a story · 2 points
HN discussion>Also, I find monad-based asynchronous programming to be quite tedious. Have you tried using OCaml's monadic let expressions? It was introduced on verion 4.08 and they share similarity with F# computation expressions. * https://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-... * https://caml.inria.fr/pub/docs/manual-ocaml/bindingops.html
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “Draft of OCaml Scientific Computing book”Submitted OCaml has some new shiny syntax as a story · 2 points
HN discussion* GADTs: generalized algebraic data types. As the name suggests, GADTs broaden the set of type-level constraints that one can encode using ADTs. A canonical example involves using GADTs to strongly type an AST and evaluator function s.t. attempting to construct or operate on an invalid AST, e.g., one that represents addition between a boolean and an integer, is a compile-time error [1]. Another great tutorial on GAD…
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “Functional Programming in OCaml”Submitted OCaml has some new shiny syntax as a story · 2 points
HN discussionOcaml is getting something similar to ‘do’ syntax very soon (but for applicatives too!): http://jobjo.github.io//2019/04/24/ocaml-has-some-new-shiny-...
Comment linking //2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “A whirlwind tour of object-oriented code in F# (2012)”Submitted OCaml Lenses via Modules (2017) as a story · 1 points
HN discussionOCaml has the equivalent of computation expressions since 2018: http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s... It definitely has async: https://github.com/ocsigen/lwt It doesn't have units of measure but due to strong abstraction properties of modules we can fairly easily roll abstract types. It doesn't have type providers but it does have plugins for type-directed derivation of JSON codecs, equalit…
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “The Early History of F# [pdf]”There's a new section of the manual covering them, here: http://caml.inria.fr/pub/docs/manual-ocaml/manual046.html A blog post with a more extensive set of examples: http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s...
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “OCaml 4.08”There is a dry technical description at http://caml.inria.fr/pub/docs/manual-ocaml-4.08/manual046.ht... . And a more illustrative description at https://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-... .
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “OCaml 4.08”Check out OCaml's 'let-binding' syntax: http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s... It's a general-purpose programmable syntax similar to do-notation that supports monadic, applicative, and other operations.
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “Monads, or Programmable Semicolons (2014)”Yes and no: OCaml supports exceptions, uses them extensively in the standard library, and most guides encourage people to use them for exceptional cases (i.e. where an error is not an expected use case and the caller probably will just propagate the error rather than try to "handle" it... which I would assert is true for almost all error conditions: you should essentially never "handle" errors or "catch" exceptions)…
Comment linking /2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “Avoid exception throwing in performance-sensitive code”OCaml has a similar thing but purely on syntactic level — http://jobjo.github.io//2019/04/24/ocaml-has-some-new-shiny-...
Comment linking //2019/04/24/ocaml-has-some-new-shiny-syntax.html
on “Show HN: ScrapScript – The Sharable Programming Language”