128 points · by mseri · 7y ago · 88 comments
The 4.08.0 release also adds the Fun, Option, and Result modules to the standard library.
A blog post with a more extensive set of examples: http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s...
And I have a similar feeling of sadness that Racket (or one of the other Scheme variants) isn't used more.
I've wondered whether one of the barriers is still that students' only exposure to these is usually using it in school for some contrived homework assignments, and dismissing the tools for "real work" before they've tried applying them. (And at least some schools are emphasizing having students ready for internship/interview with popular languages now, so innovative languages can get even less attention.)
Personally, F# is nice and all, but the lack of higher kinded types rubs me the wrong way.
https://www.reuters.com/article/us-walmart-jet-com/jetcom-fa...
VB.NET, C# and even C++/CLI get all the nice .NET toys, while F# gets to play in some of them.
It was even left out of the WinUI 3 roadmap.
From my small amount of exposure, I can say that I love Ocaml's expressiveness and flexibility.
https://github.com/anmonteiro/ocaml-h2 - HTTP2 stack
https://github.com/inhabitedtype/httpaf - HTTP stack
For micro-frameworks there are a few options available like
https://github.com/rgrinberg/opium
https://github.com/ostera/httpkit
There are some scattered pieces in the ecosystem for routing, sessions etc but i agree that compared to Python, JS, etc the ecosystem might not look as cohesive or expansive for web applications. So there should definitely be room to have new solutions in this space
Too bad I’m not smart enough to get hired there. The interviews are impossible.
Quality of life improvements in the standard library are maybe the biggest deal for me (since I don't use any stdlib replacement like Batteries or Base). Stuff like the Int, Bool, Option, etc. modules, or filter_map... It's mind boggling how they've only been added now (but good thing they were).
Rust is the first PL i’ve heard in a long time that tries to actually do something in that area since erlang ( that opted for strict message passing and let it crash philosophy, but gave you the tool to deal with that approach).
Is it because it’s too « down to earth » for PL purist, or is it simply because they don’t have the mathematical or logical tools to deal with the problem ?
Multicore is slowly incoming as well, bits are landing in mainline.
Also, maybe not very original but Go seems to have put concurrency up front as one of its selling points
Wp has a list at https://en.m.wikipedia.org/wiki/List_of_concurrent_and_paral...
Futhark is one of the more interesting recent parallel languages IMO since GPU languages were in such a lull for a while. Too bad everyone is stuck with emitting opencl or going vendor specific though.
Concurrency is enormously important in a world where instruction speed has saturated. Many problems are highly data-coupled, so you can't just separate these problems into loose tasks that you connect with a slow message pipe.
Of course, if you're just writing a web server or a chat server, then you might be lucky and you can get away with it. But please don't assume this holds for everybody.
A few months ago someone on HN mentioned that error messages would be greatly improved in this release, which would make learning OCaml much easier.
Does anyone have more details on this?
* The printing of error message has been improved to display the code source responsible of the error outside of the REPL.
* Some probable beginner errors (like discarding a non-applied function with `ignore`) now raises a warning.
* Type name captures should not happen anymore in error messages: no more `val x: int` is not included in `val x: int` where `int` refers silentiously to different types.
* A handful of typing errors has been fixed to speak to users and not the compiler developers (no more "unexpected existentials" for instance).
* Some compiler internal change to make it much easier to use the typing context when explaining a type error. This is not used much yet, but I hope to improve the scope related type errors in the next versions.
[1] https://github.com/ocaml/merlin.git
EDIT: I'd also like to point out OCamlformat (https://github.com/ocaml-ppx/ocamlformat). It works really well in my experience and makes it really easy to perform automatic code formatting, and can be used in CI to check that changed conform to the formatting style a project prefers.
https://github.com/damiendoligez/ocaml.org/blob/add-release-...