19 ms·
OCaml is 25
- adenozine 6y agoBiggest thing impeding Ocaml for the average developer is the situation with the Stdlib, and multicore. It's not exactly a struggle to get Base or Core working, but it's way less streamlined than it really ought to be. I see things like F# picking up some popularity and it strikes me as a bit of a tragedy on Ocaml's part. .NET is pretty bad to work with, imo. I know C# people will hate that, and indeed if I was meaning C# then they'd be right to feel that way. The fact is, there are few FP languages with a deep platform (like JVM, .NET, js/browser) already, and even fewer pleasant enough to work with on a daily basis. I've been blessed to use Ocaml for some of my statistics work, and I'm watching very close the OWL project (ocaml.xyz), and hopefully it will come together nicely. Still, I see the quickstart process of F#, Scala, Clojure, Elixir, even Haskell, and it's just much less headache than Ocaml for the first 10-15 minutes. Ultimately, I don't know. I use Python a LOT, and I REALLY enjoy it. A lot of what people don't like about Python just doesn't get in my way that much. Really the only thing that I could see myself yearning for in the language is pattern-matching (which we're getting soon) and some form of piping with better lambda support. I really miss |>, <| in the way I build my tools, but in the end I get along just fine. I'm glad that SO many languages have taken inspiration from Ocaml, and I'm sure that as time goes on, many more still will draw water from the plentiful well of its beautiful type inference, compiler architecture, domain modeling capabilities without annotations, et al. Finally, I think it remiss to sorta colloquialize projects by a sum of their most recent decisions. It's not difficult to look around and go "Man, ReScript is sort of a shit-show, ReasonML doesn't really offer anything except different syntax at this point, and there's typescript anyhow, which has a vastly superior dev experience in just about every modern code editor." But that doesn't do justice to how incredibly epic it is that a project is still alive and competitive at a deep, academic level, across continents, for 25 years. I could munge around my emails and find projects starting near me that are using things like Coq (now called something else, I think), it's very much still alive for important technical work even throughout the Numpy-pocalypse. Anyhow, this comment is a mess. Congratulations Ocaml team. Keep on truckin'. <3
- baby 6y agoAs a newcomer it’s a fantastic language but the tooling and the ecosystem story is really lacking. I really think the language needs more hype in order to get more people to do things for it. The versioning story of dependencies is almost inexistant, the interaction between the package manager (opam) and buil tool (dune) is filled with issues, there are no conventions in the way you set up a project (you can put your files in any folder), stdlib vs base? Poor documentation, poor compiler errors, poor managements for patches (opam pin) and different versions of the compiler (opam switch creates a local repo in all your projects), etc. Coincidentally I’ve been writing up an OCamlbyexample page that hopefully I can post here at some point to motivate people to learn the language:)
- rwmj 6y agoI'm an actual OCaml programmer, almost daily, and I don't understand this objection. We use autotools and make as the build tool (but you could use ninja/meson, cmake or whatever), and don't bother with opam/dune. We properly package over 100 OCaml packages in Fedora. For anything else not covered by a package we mostly call into C libraries, which is very easy to do from OCaml. I guess it depends on exactly what you're trying to do, but we've developed a large amount of complex software in OCaml this way.
- nicoburns 6y agoThe C-ecosystem build tools you refer to are pretty far behind those of pretty much every other langauge. And most developers don't want to wait for their OS to package it to start using the new version of a library (not to mention this style of packaging isn't typically available on windows/macos).
- yawaramin 6y agoIn case you don't know, OCaml Platform recommended tooling is on par with or better than that of many other languages. Check out https://news.ycombinator.com/item?id=27099050 https://news.ycombinator.com/item?id=27099050
- legobmw99 6y agoThe history of programming languages is one of my personal interest fields, and I find it fascinating how, 25 years on, many of the most popular languages are still slowly encorporating core features of functional languages like OCaml: records, enumerated (sum or variant) types, pattern matching and destructuring, true tail calls, type inference. To be clear, I’m in favor of these changes, and I don’t denigrate any existing language for not having them, I just still marvel seeing HN headlines like “Python to get match statement”, “Record Types in Java”, “Tail Call support in Rust” and appreciate all the more the things OCaml (and before it, ML) have gotten right for so long.
- solmag 6y agoApplies to ML family of programming languages in general.
- bosswipe 6y agoBut the question is why didn't any of the functional languages with these desirable features ever reach mainstream popularity.
- jtwebman 6y agobecause they didn't have millions of dollars for marketing budgets or the one thing they did that could make startups make millions off their work.
- goatinaboat 6y agobecause they didn't have millions of dollars for marketing budgets or the one thing they did that could make startups make millions off their work. If the French government had realised what they had in OCaml and made it the standard programming language in all of France they would be a software powerhouse by now.
- phtrivier 6y agoBack when I was a student (circa 2000), caml was one of the "official" language to teach computer science in the first few years leading to engineering school ; and in my case, it also happened to be the first language taught to everyone in my eng school. So I guess the acamedic world was trying it's best. I remember joking with a TA that no one would ever write a line a caml professionally ; I can't wait to be writing reason or caramel at a gig :) Happy birthday !
- lukego 6y agoCongratulations! I remember trying it out 22 years ago and in retrospect I did not appreciate what a young language it must have been :)
- haxiomic 6y agoCan anyone recommend a good primer to learn OCaml? (ideally aimed at so someone familiar with traditions C-style languages) The material I’ve found has been quite dense where I’m just looking to learn enough to be dangerous
- zbaylin 6y agoAs an initial primer I would recommend Cornell’s Functional Programming class that teaches OCaml: https://www.cs.cornell.edu/courses/cs3110/2019sp/textbook/intro/ocaml.html https://www.cs.cornell.edu/courses/cs3110/2019sp/textbook/in... After that, I would recommend the new (beta) version of Real World OCaml — it gets a lot more in depth about more advanced language features: https://dev.realworldocaml.org/toc.html https://dev.realworldocaml.org/toc.html
- haxiomic 6y agoThank you :)
- dhconnelly 6y agoThe Cornell textbook is great. I worked through most of it last year and learned a ton.
- johnisgood 6y agoAs I have commented before: There is also https://www.cs.cornell.edu/courses/cs3110/2019fa/textbook/ https://www.cs.cornell.edu/courses/cs3110/2019fa/textbook/. Yours is 2019 Spring, this is 2019 Fall. This version covers many more topics. Might be useful for some. :) Just to add more: - https://caml.inria.fr/pub/docs/u3-ocaml/ocaml.pdf https://caml.inria.fr/pub/docs/u3-ocaml/ocaml.pdf (Using, Understanding, and Unraveling The OCaml Language by Didier Rémy) - https://ocaml.github.io/ocamlunix/ocamlunix.pdf https://ocaml.github.io/ocamlunix/ocamlunix.pdf (Unix System Programming in OCaml by Xavier Leroy and Didier Rémy) - https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12-refman.pdf https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12-refm... - https://ocaml.org/learn/tutorials https://ocaml.org/learn/tutorials You might also find interesting stuff here: https://blog.janestreet.com/ https://blog.janestreet.com/. There are videos, too: https://blog.janestreet.com/why-ocaml/ https://blog.janestreet.com/why-ocaml/
- xiaolingxiao 6y agoI recall being exposed to OCaml in an intro to programming language class in college. Learning recursion was pretty mind blowing but ironically, it puts everyone in the class on the same footing: many who have programmed in OOP were just as baffled as those who have never programmed. Looking back, it was a good gateway into discrete math in general.
- amai 6y agoSo young and already so unknown.
- ocaml_rant 6y ago<rant> After working professionally with OCaml for a few years, it's kind of a shame that the language is 25y old and hasn't become popular. The documentation of libraries is awful, there's the Async/Lwt split, small ecosystem, the IDE support is flaky (breaks every now and then when you upgrade, doesn't work properly in VS Code). My diagnosis (specially after talking to people in the Rust community) is that there's a weak sense of community and weak leadership. The response to conflict is "screw this, I'll do it my own way", instead of making decisions as a community. It's kind of the wild west, people going in different directions doing what they want. There's no alignment in focus or effort to really drive things forward. We are moving away from OCaml. If you are considering it for medium or large production systems, I urge to stay away from it </rant>