107 points · by Tomte · 5y ago · 28 comments
chim
The secret syllable of royalty.If you get past the quirks of the syntax, it's a really nice language, deserving more popularity in the industry (it's already popular in CS circles).
Maybe when multicore sees the light of day, there might be some interesting possibilities. It is really hard to not say "why not just use go/node/racket/haskell/fsharp/rust/zig/etc. when you are on a timeline and you aren't Jane Street...
Parsers/interpreters/compilers/static analyzers. It's solidly established here. The Web Assembly reference implementation is written in OCaml for example.
> "why not just use go/node/racket/haskell/fsharp/rust/zig/etc"
I think Python, Java, C# or even PHP will come up before F#, Rust, Zig, Racket and Haskell. As for the answer, you can just use the same language pretty much everywhere. I think OCaml is probably the most versatile language of the lot. You can program in any way you want, target pretty much anything you want. How important is it, to be able to use the same language everywhere? I honestly don't know.
> when you are on a timeline and you aren't Jane Street...
I'm not sure what you mean exactly with "on a timeline", I guess it's a reference to the lack of libraries/documentation? If that's the case, I don't know how much it matters once you're experienced with the language. I'm not saying libraries don't matter at all, that would be silly. You don't want to do JSON parsing or a HTTP server yourself. But for small stuff, you can just write a bit more code that you would usually do. It's going to be way smaller than a full library, and it's going to be easier to use since you don't have to learn a new library. This is however just me thinking about it, I don't have any hard data on this, and would love to know if some exists.
- OCaml has all of them, hands down. It is even getting reasonable parallel processing support as of recently.
- Haskell has beautiful implementations of 1, 2, and 4, but definitely not 3, which often leads to hilarious memory leaks.
- Rust has 1, 2, and 3, but 4, while possible, is not really ergonomic, and compile times are the longest.
- Typescript (with Ramda for kicks) has 3 and 4, and almost 3, but still not really 1.
- Java has 2, 3, and 4, but sadly not 1, and programming with immutable values is possible but the stdlib often resists it.
And it can be used functionally and statically compiled on even the smallest devices like the raspberry pi zero.
That combination appeared unique to me.
Edit + Spoiler: and they sport friendly discussions on https://discuss.ocaml.org/u/mro
There is `rmarkdown::site` (see [0]), but I had to mess with the internals to get it to do what I wanted.
You can bring your own convertors and pass any options to them. I'm not saying it's a perfect SSG for everyone, but at least uncommon input format support isn't an intractable problem for it.
[1] https://github.com/dmbaturin/soupault-website/blob/master/so...
I've never looked at R markdown before. Thanks for sending me down the rabbit hole with Bookdown. It might solve one of the questions I'm currently thinking about.
[0]: https://jamstack.org/generators/ [1]: https://bookdown.org/ [2]: https://bookdown.org/yihui/blogdown
ocamlbook.org may be the most illustrative one: it exploits soupault's ability to pipe HTML element content through an external program to automatically type-check code examples in <code> tags with the compiler and also syntax-highlight them with an external tool. The approach would translate to any language without a need for language-specific tools.
The main repository also has directories called 'sample-site' and 'examples': https://github.com/dmbaturin/soupault