The New OCaml Website
ocaml.org
ocaml.org
Just wanted to also link the announcement post here: https://discuss.ocaml.org/t/v3-ocaml-org-we-are-live/9747.
This new website comes with lots of improvements over the previous version, and in particular, the team has been working hard on the following:
- Central OCaml package documentation, which contains the documentation of every version of every OCaml packages. (https://ocaml.org/packages)
- OCaml job board, which lists job opportunities from the community. (https://ocaml.org/opportunities)
- OCaml success stories which explore how major OCaml industrial users solved real-world challenges using OCaml. (https://ocaml.org/industrial-users)
- An interactive OCaml playground to try OCaml code directly in the browser. (https://ocaml.org/play)
- A syndicated blog, which links to blog articles from the community and offers original blog posts. (https://ocaml.org/blog)
I'm thrilled that the website is live after more than a year of development! We hope that this will help new comers to have a smoother experience when trying OCaml (in particular with OCaml 5 coming soon), so don't hesitate to share feedback on how we can improve it further!
I really want to like OCaml but the usability story is so far behind Rust. The language is stunning but the ecosystem needs a lot of work.
I've been using ocaml-lsp-server with nvim-lspconfig and it's been great, I'm wondering what issues you've had? From my perspective the ecosystem is evolving pretty quickly!
[1] https://github.com/ocaml/ocaml-lsp/
[2] https://marketplace.visualstudio.com/items?itemName=ocamllab...
Nothing serious, just playing around, but lost ~interest when they start abandoning...
When you say "something similar", what are you thinking about? Simply this rather professional presentation, or something social, or something technical? Or the fact of a renaissance? Is this sort of revamp a cause or a symptom of a renaissance?
For Common Lisp it's always seemed to me that SBCL (disclaimer: never used it, only read about it) is the "modern" option in the sense that it's well maintained, portable and fast, but it has the most amazingly old-school web presence.
Another great example is Poly/ML (https://polyml.org/) - one of the best implementations of Ocaml's close relative SML, but it's very much lacking a Bootstrap theme and "trusted by" testimonials and it has a splendid naive-art parrot. I like all that about it, but you wouldn't look at the page and think "I'll choose that for my new green-field project with venture capital money".
I would love to see a renaissance of Prolog as well.
case in point, go to cliki for osx and they advise downloading emacs, setting up slime and downloading sbcl. but there's a lot of information missing. Also no mention of arguably the easiest (in practice) way of setting up common lisp ie: spacemacs.
just runnign and maintaining common lisp codebases is a hodgepodge of arcane knowledge collected accross disseperate smaller websites that look like they were designed in th e90's. no wonder all the noobs think javascript is the end all be all of languages.
My daily driver is elixir. I have mix and with one command I can start a whole project with a complete build system. I was able to setup a full elixir environment and get a hello world in about 5 minutes just reading the main elixir website. If I needed a package, I could just go to hex.pm, search for a library and add a line to my mix file to automatically pull the dependency and build it. ie: I gae bills to pay and the ecosystem is setup so I can get work done.
common lisp suffers from extreme fragmentation that presents significant friction for doing any kind of work. Its only saving grace is that the language itself is so powerful, it makes the impossible possible. where other languages fail in a fractcal of complexity, common lisp can be used to produce a working solution.
I'm well out of my FP fanboy phase now but ocaml feels great for my favorite parts of that without being judgmental when I'm not in the mood.
Very true! I've used mutations and imperative OCaml quite a few times. Sometimes it was for performance reasons (I've been working on a web server library), and other times when loops either made the implementation a little easier to read, and/or helped avoid some allocations. I am glad that the language is pragmatic enough that I can still use mutation or imperative code where it makes sense, while still being able to present a nice clean api on top.
I sneak it in at my jobs when I can justify it but it seems like there are very very few jobs that use it primarily.
> it but it seems like there are very very few jobs that use it primarily.
I completely agree. I never tried looking for an OCaml job mostly because there weren't enough options at-least in the US (I'm based in USA), and I am picky about who I work for and wasn't interested in exploring job opportunities at companies working on cryptocurrencies. I just got lucky that I stumbled upon two different companies that used OCaml. The first time around I applied for the job because of OCaml, the second time around it was because I liked the company and OCaml was an added bonus on top.
The language I work in is not even one of my top priorities when looking for work, but still it would be cool. I'm lucky enough to have enough freedom to work in it from time to time, which is good enough for me.
Thanks for the response!
Same! I've made the mistake of overlooking certain things just because I wanted to get some real world OCaml experience in the past, and I will not make the same mistake again.
At my current job I mostly use OCaml and Python, with some Typescript for whenever I need to touch a frontend application. As much as I like using OCaml, I'm more thrilled about working on a team where I enjoy working with everyone, and having a work environment that provides flexibility about picking the best tool for a job. Most of my OCaml hacking still takes place on my free time, and on my personal open-source explorations :-)
> Thanks for the response!
You are welcome! Sorry if my responses weren't too useful with respect to using OCaml at work.
It's a nice change of pace from the Ethereum ecosystem.
Like, what's java's niche? I'd say it doesn't really have one anymore, it's just a generalist language. Ocaml is also a generalist language, but it has much better language paradigms, is safer, more concise, has more features with less baggage, etc. It's just good all around.
As a functional programming advocate, I'd point to safety, readability, and development velocity as features, but those are all around good and desirable, not really a niche.
I wish more companies were using languages like ocaml/f#/clojure vs c++/python/java when there is no specific reason to use the former.
Like java, python, c# 'slants' towards web services and maaybe CRUD apps, C++ 'slants' towards games and graphicly complex apps.
It's pretty comfortable for organizing and refactoring because of the nice module and type system. And once you grok Dune (the build system) you can get going pretty quick. Builds are very fast compared to most of the languages I use at work. And if you're not doing anything egregious the optimizing compiler (Flambda) can usually be within ~2x of C for most things. When it's not dropping down to C is very easy because the FFI system is very straight forward, and has built in support in Dune.
It is lacking a bit in libraries and when you need to drop down to imperative features you may find it a bit rough. For example not having a return keyword can make it annoying to port over libraries.
Overall I like it because I think the pros outweigh the cons, but I've also been using it for a decade so I'm probably getting set in my ways now. I'd say it's worth trying at least to understand Sum types (and maybe GADTs), and use a language with first class modules, it can change your approach to problems once you see some extra tools.
It's great to know that Microsoft, Docker, and Facebook use OCaml. Buy do they use it seriously? The industrial users (https://ocaml.org/industrial-users) page links directly the company websites. Only two logos from the home page have case studies. Don't just tell me that Microsoft uses OCaml, tell me how!
Perhaps more notably, they are still actively working on Rescript (formerly ReasonML), which is an Ocaml dialect with JS as the primary compilation target (think Clojurescript but Ocaml). They also maintain a flavor of React specific for Rescript. I don't know how much they dogfood it, but it seems like they're at least somewhat betting on an ML future.
Disclaimer: Not a FB/Meta employee
This will change when OCaml 5 is released, though it is likely that will require test driving and fixes in both ocaml itself and the ecosystem.
Multicore OCaml was merged in PR #10831, and 5.0 was originally targeted to be cut in March or April 2022, but it seems there are still blockers: https://github.com/ocaml/ocaml/milestone/40
Latest monthly update: https://discuss.ocaml.org/t/multicore-ocaml-march-2022
Github for the multicore project: https://github.com/ocaml-multicore/ocaml-multicore
I don't necessarily agree with this especially for examples. But in practice I haven't found the fp communities I'm familiar with (clojure and ocaml) to be too bad about using confusingly terse names. Php and go are by far the worst there, again at least from my experience.
> Here's how to do square and factorial.
Show, don't tell.
I've toyed a bit with both and F# seems a bit more ergonomic: pipes, computation expressions, a more concise syntax, etc. I do like how fast the OCaml compiler is though.
For me it would be because OCaml is supported by Ubuntu as a package. In contrast, for installing F# you need to add an external repository and mess with GPG keys etc. which seems odd. Perhaps I'm wrong but what it tells me is that F# is not yet fully embraced by the open source/Linux community.
Checkout the docs* to install in Ubuntu.
F# was open source before any major MSFT project was. In fact it just recently got officially folded into the .net project/repos.
https://docs.microsoft.com/en-us/dotnet/core/install/linux-u...
OCaml's type and module system is generally more sophisticated than F#'s - F# doesn't have GADTs, all the functor-y goodness of OCaml's module system, or even OCaml's weird-but-brilliant structurally typed object system. The new algebraic effects that OCaml's getting imminently are pretty killer, too. F#, of course, has several awesome features that OCaml lacks.
It also has modules that take other modules as arguments and produce new modules - these are called functors. They're a really useful way of organising code, with F# you'd use .NET objects for similar issues. Nothing against objects - I'm not one of those - but the ocaml design just feels a lot cleaner.