7 ms·
I feel like OCaml is a language that has a lot of potential, but is hampered by somewhat gnarly syntax, a toolchain that feels utterly antique (for example, las
by atombender 8y ago
I feel like OCaml is a language that has a lot of potential, but is hampered by somewhat gnarly syntax, a toolchain that feels utterly antique (for example, last time I worked with it, the REPL had no Readline support and had to be run with rlwrap), and lack of a good killer app.
In some ways, OCaml's problem mirror that of Erlang. The gnarly syntax is largely being addressed by Reason (much like Elixir does for Erlang), but I don't see it catching on as much as I'd like, and it still has some warts, I think.
As for killer apps, distributed data processing is something that OCaml could be great at, given that it marries Erlang's functional style with a rich type system, and there was a minor wave of libraries (for concurrent, distributed actor programming) way back in the 2010 or so, but those libraries are now dead and nothing really happened. Meanwhile, Scala largely leads that story (Akka is very popular, and Scala also seems to be the language of choice for Spark, Beam, etc.) and Haskell now has Cloud Haskell, which is modeled on Erlang. Also, we kind of need multicore for this.
(Distributed data is an area where I hope the Java/Scala world gets competition soon. A lot of people, I suspect, would like this, so there's an opportunity to rapidly gain mindshare. I don't see much happening there. Pony is promising (e.g. Wallaroo), and some people have had success with Go (Pachyderm). I don't know Pony, but without genetics, Go is a pretty awkward fit for data pipelines; witness the number of hoops jumped, and resulting limitations, in the Apache Beam SDK for Go. Spark et al rely on distributing bytecode to worker nodes, something you just can't do in Go. Not sure about OCaml.)
- platz 8y agoIt's a bit of a stretch to say cloud Haskell is modeled on erlang
- anuragsoni 8y agoI'd say if you ever get the time again, give OCaml another look. The toolchain experience has been improving at a rapid pace! I started to explore OCaml again earlier this year and the day to day tooling around it has felt at par or better than my experience with other languages. Between Opam [1], Dune[2] and utop[3] the "new comer experience" has been really good so far. The editor integration with vim/emacs has been top notch, and visual studio code has turned into a really nice option as well for people who don't like vim/emacs. I'm sure there is still room for improvement, but i'd say its atleast heading in the right direction! [1] https://github.com/ocaml/opam https://github.com/ocaml/opam [2] https://github.com/ocaml/dune https://github.com/ocaml/dune [3] https://github.com/diml/utop https://github.com/diml/utop [4] https://github.com/ocaml-ppx/ocamlformat https://github.com/ocaml-ppx/ocamlformat
- pjmlp 8y agoWhen I learned Caml Light, OCaml was starting as project, still called Objective Caml. I don't remeber anyone on those assignments ever complaining about syntax.
- zem 8y agocompiler writing could well be ocaml's killer app; the problem is that it's a very niche application in terms of the number of people who do it. i was hoping facebook's pfff [https://github.com/facebook/pfff/wiki/Main https://github.com/facebook/pfff/wiki/Main] would extend that to language analysis tooling in general but it never seemed to catch on.
- srean 8y agoI don't program in OCaML or any ML for that matter, but what's so gnarly about the syntax ?
- tom_mellior 8y agoOne common critique is that in the toplevel (REPL) you must terminate your inputs by ;; and sometimes you will see code that puts ;; between function definitions too. Also, nesting pattern matches is a bit ugly: match x with | Foo y -> match y with | Yes -> ok () | No -> not_ok () | Bar z -> whatever() does not work, it must be: match x with | Foo y -> begin match y with | Yes -> ok () | No -> not_ok () end | Bar z -> whatever() which is not a big deal but surprisingly easy to forget. Some people would also really like to write let x = foo let y = bar x + y but it has to be let x = foo in let y = bar in x + y and those many "in"s accumulate. A bunch of these things look a lot cleaner in Haskell. Although it does it by being indentation-sensitive, which other people love hating.
- jhwoodyatt 8y agoNobody really cares about programming language syntax as long as the grammar is reasonably sane and the semantics are clear. Which is the case with OCaml. The other criticisms are the ones worth attending.
- int_19h 8y agoWell, enough people cared about the syntax to make Reason...