OCaml 4.08
inbox.ocaml.org
inbox.ocaml.org
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.
Tensorflow is interesting in this respect. Leveraging a lot of parallelism and using a parallel pl under the good, while presenting itself as a dev friendly Python lib on the surface.
Python has a huge amount of introductory learning material that assumes it is your first language, while most FP languages (Ex: Clojure, Haskell, F#, Scala, OCaml) really struggle in this area. I really like FP, but there is a bit of a steep plateau when learning. If you look at some of the questions people ask in the Python stack exchange, you get the impression that millions are learning it as the defacto first language (I was one of those nearly a decade ago). I try to find similar paths to FP and everything from the tooling to lack of thorough introductory material keeps killing it for me.
Another issue is that from a pedagogy perspective all the "building blocks" in FP are different to what many people already know. If you're used to the imperative/OO paradigm you can move between languages by just learning the syntax to (lists, dictionaries, while and for loops, branching, array access, file IO, and classes). When learning FP you have to learn similar, but different concepts (pattern matching, monads, currying, discriminated unions...etc).
The beginner books that do exist (ex: learn you a Haskell) are nice, but I've talked to many (myself included) that when they finish say "I still have no clue how to program in Haskell". To give another example, I spent two weeks reading a Python book on building text games and when I was finished I was like "OMG I can do stuff". That book covered how all the main data structures could be used with short and fun programs. It also included reading text files, string operations, pickling data, classes, modules..use of the included IDLE IDE. It was great.
I don't know how long ago have you tried Clojure, but it is a lot easier to start with than Haskell or Scala. There are now more than a dozen of books available (for the beginner and for the advanced levels). Clojure is much better than Python - it has extremely nice, consistent standard library; It has "true" REPL - with it you can evaluate almost any chunk of your code with no preliminary ritual, even much praised Jupyter doesn't feel as nice; Clojure not statically typed but it has Spec, which is totally awesome - the way how you can derive property based tests is almost mind-blowing; Clojure's stability is almost legendary; It makes concurrency simple; It makes dealing with dependencies less painful; It can seamlessly run on both: front-end and back-end, having live-updates in your browser and REPL connected to it feels like magic. Honestly, transforming data using Clojure is a pure joy.
I might try again later. I have "Clojure for the Brave and True", Carin Meiyer's book, and one of Fogus' books.
I really want to learn Clojure, but just need to sit down and put the time in. It's also discouraging to see people comment about some of these languages (Clojure and F#) as being on life support.
I can't say anything about F#, but Clojure is doing quite alright. It gathers more conferences and meetups around the world (more than Haskell, OCaml, F#, Elm or Elixir). Has more podcasts (defn, the REPl, Clojurescript podcast, Apropos, Cognicast), there are other podcasts created and run by people actively using Clojure, where they talk not only about Clojure. Clojurians Slack and clojureverse.org are very active. New libraries and books coming out regularly. My company recently was hiring and I shout out on Twitter and I got DM request from all over the world: Chile, Mexico, Brazil, Japan, India, Bangladesh, Jordan, Poland, Latvia, Ukraine, Russia, UK, Germany, US and other countries, people want to write Clojure full-time. So, yeah. I don't know where you read that Clojure is dying or whatever. It is not as big as Python or Javascript, but it's slowly, steadily growing.
This applies to all programming languages, not only OCaml, hence why everyone is moving away into other concurrency models anyway.
If matrices are small, 1 core would be more efficient. If matrices are big, GPU would be more efficient.
Plus I already answered your questions, not moving goal posts here.
For example, a SIMD implementation will outperform a multithreaded implementation on a CPU without support for hardware threads.
My nonsense answer just happens to be what HPC is moving into, and when HPC wants to scale it uses MPI coupled GPUs, not plain old threads.
Multi-core systems and tools that can use them are valuable and very much reality right now.
As much as I often appreciate your no-nonsense perspective on things and you posting it, things like this don't really do you a favor.
EDIT: tweaked last line to be a bit less snippy
Every application should strive for proper quality, just like in other industries.
If you insist on networked solutions: database servers.
Also: "multicore + purely functional style" is just as clean as "multiprocess + purely functional style", but ... the latter is less efficient because of communication overhead.
And if that is irrelevant to you, there is still the application stability and memory consistency to ensure data is being handled in a memory consistent state.
Fortran is a good example on how to do scientific computing without low level threads.
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-...