4 ms·
OCaml is the coolest language I’ve ever used. It’s the backbone of Harvard’s Intro to CS II, where they explain programming language paradigms with a heavy emph
by arcturus17 8y ago
OCaml is the coolest language I’ve ever used. It’s the backbone of Harvard’s Intro to CS II, where they explain programming language paradigms with a heavy emphasis on the functional. OCaml’s expressiveness really shines through - I remember fondly how small yet powerful the language feels.
Unfortunately, I don’t know what to build with it... I’m the kind of person that builds projects for professional advancement, which curtails my creativity. I’ve thought of making a simple web server. Or maybe learning ReasonML. Any suggestions welcome.
- loup-vaillant 8y agoOCaml really shines when your problem is data in, data out, and the transformation is non-trivial. So, maybe try compiling or generating stuff. I have two examples of my own: USSM¹, a simple static web site generator, and Monokex, a secure handshake generator like the Noise explorer (except much smaller, much simpler, and very incomplete). [1]: http://loup-vaillant.fr/projects/ussm/ http://loup-vaillant.fr/projects/ussm/ [2]: https://github.com/LoupVaillant/Monokex https://github.com/LoupVaillant/Monokex
- vram22 8y ago>OCaml really shines when your problem is data in, data out, and the transformation is non-trivial. So do you think it would be a good choice for creating a make-like tool, in which you want to support doing transitive / hierarchical makes, like target A depends on B, and B on C, so if C is newer than A, the tool should build B from C and then A from B, and other such variations? Working on such an idea, currently in Python, and have an interest in and am reading about OCaml, hence asking. I think the work may involve a topological sort.
- loup-vaillant 8y agoYes, that's the kind of thing I'd reach Ocaml for.
- vram22 8y agoGreat, thanks.
- yawaramin 8y agoYou should check out at least a couple of things: - The Dune build system for OCaml, also written in OCaml, does exactly what you are describing: https://dune.build/ https://dune.build/ - Jane Street's Incremental library lets you build auto-updating computations which change whenever their inputs change: https://github.com/janestreet/incremental https://github.com/janestreet/incremental Honourable mention: Thomas Leonard's really interesting series where he describes rewriting his dependency management tool, 0install, from Python to OCaml http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-retrospective/ http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-ret...
- vram22 8y agoThanks for those links, will check them out. Took a quick look at Dune. Interesting that the simple examples I saw seem to use a Lisp-like syntax. The Jane Street Incremental library idea sounds cool. I had thought of something very roughly like it, but for memory data, recently, in connection with that tool I'm working on. Had come across Leonard's series of moving 0install from Python to OCaml earlier. Need to revisit it.
- yawaramin 8y agoYeah Dune uses s-expressions as its config format. It was born out of work done by Jane Street, and they like using s-exprs there.