4 ms·
It replaced Python for everything longer than a couple hundred of lines long for me. Fast language, fast compile times, clean(-ish) syntax, strong typing syste
by cccbbbaaa 3y ago
It replaced Python for everything longer than a couple hundred of lines long for me. Fast language, fast compile times, clean(-ish) syntax, strong typing system, good ecosystem, and now multicore support? Yes please!
I must be more nuanced, though: existing libraries in opam are generally very, very good (I really like cmdliner), but many things may be missing. There is no alternative to Django, for instance. No serious IDE, except emacs. The standard library was so lacking that there is at least an alternative. The situation improved, but there's still missing stuff compared to Python.
- amelius 3y agoDo you make GUIs in OCaml, and which libraries do or would you use? And how about scientific computing (SciPy), deep learning (PyTorch etc.), or computational geometry (Shapely etc.)?
- yw3410 3y agoGUIs are a PITA like in most languages. I think most people use something which binds to gtk (such as lablgtk) or Qt. For scientific computing there is Owl, but I haven't used it personally.
- xvilka 3y agoLablgtk[1][2] for GUI, Owl[3][4] for scientific computing. [1] https://garrigue.github.io/lablgtk/ https://garrigue.github.io/lablgtk/ [2] https://github.com/garrigue/lablgtk https://github.com/garrigue/lablgtk [3] https://ocaml.xyz/ https://ocaml.xyz/ [4] https://github.com/owlbarn/owl https://github.com/owlbarn/owl
- mattpallissard 3y ago> There is no alternative to Django, for instance. https://aantron.github.io/dream/ https://aantron.github.io/dream/, which is new and used by ocaml.org as well as OP > No serious IDE, except emacs and vim, and visual studio, and whatever else supports the LSP protocol via https://github.com/ocaml/ocaml-lsp https://github.com/ocaml/ocaml-lsp > The standard library was so lacking that there is at least an alternative. While janestreet does have an publish their own stdlib, I personally try to stick to the stdlib whenever possible. Not to knock janestreet. I'm glad they're around and have contributed a bunch. But overall I agree with you. It's been my favorite language to write in for years now. You can't just reach for off-the-shelf libraries for every little thing. Although the ones that do exist tend to be written halfway decently.
- winrid 3y agoDream is not a Django alternative. Django's powers come from probably one of (the best?) best ORMs in the industry, along with generated database schema migrations, and generated admin panels, to name a few. There's also the Django Rest Framework which makes putting together REST apis generated from your models super easy.
- mst 3y agoQuite possibly the best for everything up to moderately complex. You'd want to enter sqlalchemy (python), DBIx::Class (perl) and arguably Sequel (ruby) into the competition for 'best' though (I'm sticking to dynamic languages here) - exposed power and ability to drop to SQL for only parts of a query vary substantially between options.
- winrid 3y agoOn a related note I've been keeping an eye out for a really good ORM in a typed language that is good with relationships without tons of boilerplate, I guess it's hard to do. Hibernate has way too many annotations for my liking, and I'm not into the code generation of JOOQ. I bet you could build it in Nim pretty easily with its compile time stuff. Diesel might get there in a few years... :) I know people are gonna judge the whole ORM thing, but writing raw SQL is nice for performance but not for getting something out quickly, or prototyping, when you have lots of relationships.
- still_grokking 3y agoI've heard good things about OCaml in general. But "no serious IDE, except emacs" is a non-starter imho, if it's true. They should really invest in this. Otherwise the language won't attract any professional developers in the large.
- mdaniel 3y ago> No serious IDE, except emacs. https://plugins.jetbrains.com/plugin/9440-reasonml https://plugins.jetbrains.com/plugin/9440-reasonml (72k downloads) https://plugins.jetbrains.com/plugin/18531-ocaml https://plugins.jetbrains.com/plugin/18531-ocaml (2k downloads) I'm not in the ocaml ecosystem enough to evaluate their quality, but anything on top of IJ is for sure a serious IDE