11 ms·
So you're learning OCaml
- plinkplonk 11y agoI love OCaml the language, but the tooling, especially wrt building (ocamlbuild, Oasis etc) , is horrendous. That said, the situation is much better now, than say 5 years ago.
- unhammer 11y agoSome of the tooling is really great, e.g. opam Just Works, utop feels very comfortable and merlin is amazing[1]. The lack of a standard build system is annoying yeah; I tried for a while to make do with just ocamlbuild and a Makefile, but eventually gave in and learnt Oasis, and it does the job just fine for my purposes, just feels a bit messy (compared to something like cabal, which at first sight hides a lot of the intermediate steps). [1] http://the-lambda-church.github.io/merlin/destruct.ogv http://the-lambda-church.github.io/merlin/destruct.ogv http://the-lambda-church.github.io/merlin/merlin-vim.ogv http://the-lambda-church.github.io/merlin/merlin-vim.ogv
- e_d_g_a_r 11y agoAgreed. FWIW I basically use the same _oasis file over and over again, it literally takes only 5 minutes to set up a project's needed boilerplate, _oasis, .merlin and opam directory.
- laumars 11y agoIs there any good guides on how to do this? Or are your oasis template files shared online?
- e_d_g_a_r 11y agoI just amended the blog post with a cradle to grave example of creating _oasis, .merlin and opam directory for any OCaml project.
- plinkplonk 11y agoVery useful. Thank You! I basically gave up on OCaml for anything but toy projects, but I may re consider that decision if this works for me.
- Drup 11y agohttp://ocaml.org/learn/tutorials/setting_up_with_oasis.html http://ocaml.org/learn/tutorials/setting_up_with_oasis.html
- iopq 11y agoYes, I'm learning an OCaml dialect. It's called Rust, it's really interesting, you should take a look at it.
- placeybordeaux 11y agoIs there a good reason to say that Rust is an OCaml dialect?
- sampo 11y ago> Is there a good reason to say that Rust is an OCaml dialect? There is, maybe, grounds to say that all languages with S-expressions, first class functions and garbage collection are just a type of lisp. But I would not say that all languages with strong static typing, some form of type inference, algebraic data types, patterns matching and functional programming features, are a dialect or OCaml, or ML.
- dkarapetyan 11y agoNo more than saying Erlang is a lisp dialect.
- fermigier 11y agoOr Python (http://norvig.com/python-lisp.html http://norvig.com/python-lisp.html).
- jk4930 11y agoI'd describe it more as uglyfied Haskell, but anyway: http://science.raphael.poss.name/rust-for-functional-programmers.html http://science.raphael.poss.name/rust-for-functional-program...
- bsummer4 11y agoIt really doesn't have that much in common with Haskell either. It's designed by people who are not oblivious about PL stuff, but it's still pretty thoroughly in the C/C++ world in terms of both syntax and semantics. It's not a bad thing, but Rust has very little in common with Haskell/Ocaml; aside from stealing a couple of good ideas.
- cheepin 11y agoIf you are interested mainly in the functional language aspect of OCaml and use Windows, F# is very close to OCaml in syntax/semantics, but has really good support within Visual Studio (a really good debugger for example). Once you want to use some of the more advanced features (Modules and Functors come to mind), you can switch back to OCaml relatively easily since they are so similar.
- stevenmays 11y agoAny good books or resources for learning F#?
- cflyingdutchman 11y agohttp://fsharpforfunandprofit.com/ http://fsharpforfunandprofit.com/
- sremani 11y agoI second that along, with fsharp.org and tryfsharp.org.
- jskonhovd 11y agoI like Real World Functional Programming by Tomas Petricek if you are already doing C# development.
- BoysenberryPi 11y agoI'm in this course I've been interested in the ML family of languages ever since learning SML which is without a doubt my favorite language ever.
- lemming 11y agoI really wish there were an implementation of SML that got some traction. It's a lovely language, but has very few libraries for actually getting anything done.
- virtualwhys 11y agoMaybe Rossberg's 1ML will become a reality. Barring that, "Successor" ML is cleaning up some deficiencies in the original standard, and ML implementations are starting to integrate the changes. But yeah, a strict ML with the pristine syntax of SML; the modular implicits coming to OCaml; the innovative ideas in 1ML -- now that would be a great language. Sigh, back to Scala...
- eatonphil 11y agoI do not think it is too late for SML necessarily. MLton (the full-program-optimizing compiler) is very competitive with the (one) OCaml implementation. As someone who did a lot to market certain OCaml libraries, I have seen similar interest in some of the "modern" SML libraries I have played around with. Not a ton of work has gone into both of these, but you may be interested to look at two projects MonoML[0] and SSMLS[1]. These are some /very/ minimal projects I've worked on in SML in the past few months to gauge how well SML might work as a modern, web-friendly, higher-level language. The results are certainly not completely disappointing. Edit: Oh also! HamletML[2] (yes, written by the 1ML guy) is a very interesting ML implementation that would probably be a great way for work on modern language features. Not that I know what I'm talking about, but it could also provide the framework for an even more powerful backend/optimizing compiler. [0] https://github.com/eatonphil/monoml https://github.com/eatonphil/monoml [1] https://github.com/eatonphil/ssmls https://github.com/eatonphil/ssmls [2] https://www.mpi-sws.org/~rossberg/hamlet/ https://www.mpi-sws.org/~rossberg/hamlet/
- gaius 11y agoSwift has lots of ML heritage, tho' not as much as F# obv
- teh64 11y agoDoes anyone know any good GUI OCaml IDE for Mac (something like RStudio)? Because the plugins for Eclipse and Intellij aren't very good and ocaml-top doesn't seem to work.
- ane 11y agoNone exist. So far the best solution is to use Emacs with [2] * merlin-mode, for autocompletion * ocp-indent, for external code formating... think running gofmt on every enter press (surprisingly, it's fast enough unless your file is 2k lines long) * tuareg-mode (everything else, REPL etc.) * flycheck-ocaml for syntax checking The "real" IDE plugins aren't even close and that's saying a lot since the hodge-podge of addons I just listed isn't The default Emacs user experience is awful so if you're a Vim user, just install the "evil" package and enable it inside Emacs by doing M-x evil-mode, then you have Vim inside Emacs. Or use Vim, but the experience isn't as complete w.r.t. tooling[3]. There's always Spacemacs as well[1]. [1] https://github.com/syl20bnr/spacemacs https://github.com/syl20bnr/spacemacs [2] https://github.com/the-lambda-church/merlin/wiki/emacs-from-scratch https://github.com/the-lambda-church/merlin/wiki/emacs-from-... [3] https://github.com/the-lambda-church/merlin/wiki/vim-from-scratch https://github.com/the-lambda-church/merlin/wiki/vim-from-sc...
- teh64 11y agoThanks for the links! I am currently using Sublime Text with the merlin plugin, which is pretty good. But I guess I should learn emacs to use OCaml.
- fermigier 11y agoAdditional resources: https://github.com/rizo/awesome-ocaml https://github.com/rizo/awesome-ocaml (via: https://twitter.com/ocamlmooc https://twitter.com/ocamlmooc ).
- agumonkey 11y agoWhile digging for history I read these slides from David Turner (miranda and other, pre-haskell) http://www-fp.cs.st-andrews.ac.uk/tifp/TFP2012/TFP_2012/Turner.pdf http://www-fp.cs.st-andrews.ac.uk/tifp/TFP2012/TFP_2012/Turn... It's not directly related to OCaml, but it retrace the roots of the ML family too, so I thought it could be of interest.
- cmrdporcupine 11y agoI like OCaml very much, though I haven't written code in it in the last 10 years, when I taught myself the language a long time ago I very much enjoyed it. I preferred SML/NJ, but that never got any velocity. It'd be nice to have a job working in OCaml.
- cwyers 11y agoAn OCaml MOOC just started yesterday, I think there's still time for people to get in: https://www.france-universite-numerique-mooc.fr/courses/parisdiderot/56002/session01/about https://www.france-universite-numerique-mooc.fr/courses/pari... Session 0 is just a lot of introductory stuff (history of OCaml, etc.), so it shouldn't be difficult to catch up.
- ufo 11y agoIs there a way to watch the classes and other course material without registering?
- FraaJad 11y agoThe registration is free, unless you are weary of sharing your email with a university (which are pretty good at guarding their students' privacy.. though you should definitely check their policies before signing up)...
- cwyers 11y agoAn OCaml MOOC just started yesterday, I think there's still time for people to get in: https://www.france-universite-numerique-mooc.fr/courses/parisdiderot/56002/session01/about https://www.france-universite-numerique-mooc.fr/courses/pari... Session 0 is just a lot of introductory stuff (history of OCaml, etc.), so it shouldn't be difficult to catch up.
- deleted 11y ago[deleted]