4 ms·
The author lists Ocaml as "non-IDE-friendly." This is not my experience. Ocaml is one of the most IDE friendly languages I have in my toolkit right now -- not j
by gmfawcett 6y ago
The author lists Ocaml as "non-IDE-friendly." This is not my experience. Ocaml is one of the most IDE friendly languages I have in my toolkit right now -- not just functional languages, but all of them. Ocaml + Emacs + Merlin is stable, accurate, very fast (responsive), and easy to set up and configure.
Plus, named and named-optional parameters are supported in the language, and can be used to good effect for disambiguating function parameters of similar type (the split, join problem).
- hashbig 6y agoCompare that to JavaScript where you can literally just install vscode and node and you’re up and running. Not to mention that you could pop open a console in any browser and execute code. I love OCaml as a language but we have to admit that the developer experience just sucks. For something to be simple, a 10 year old kid needs to be able to figure it out. That’s how languages get adopted.
- carlmr 6y ago>Compare that to JavaScript where you can literally just install vscode and node and you’re up and running. Not to mention that you could pop open a console in any browser and execute code. That's only because VSCode was developed in JavaScript, and JavaScript is used in Browsers anyway. This has nothing to do with Intellisense friendliness.
- hashbig 6y agoNo, golang is just as easy to install and work with on vscode. Just install Go and the official Go plugin and you have an IDE experience complete with debugging, formatting, and intelligent autocomplete. It has nothing to do with vscode being written in JS.
- andrepd 6y agoWhat an odd comment. >Compare that to JavaScript where you can literally just install vscode and node and you’re up and running As opposed to OCaml where you... install opam and merlin and you're up and running? >Not to mention that you could pop open a console in any browser and execute code. As opposed to OCaml where you can pop open utop and execute code. >For something to be simple, a 10 year old kid needs to be able to figure it out. How many 10 year old kids are there working as professional programmers? Come on...
- hashbig 6y ago> How many 10 year old kids are there working as professional programmers? Many of them in 10 years time, and they will be using concepts they learned when they were 10. And FP enthusiasts would complain why no one uses their favourite language. My point is, if we want to get more people to use FP we have to make it more accessible. Everything from building better tooling, tutorials, environments. Good languages alone don’t matter. You can’t tell me that it’s just as easy to get started with JavaScript or Python today as it’s to start with OCaml. That’s just delusional.
- gmfawcett 6y agoIt would be nice if 10 year olds can be exposed to functional programming. But it's hardly a necessary prerequisite. There are plenty of technologies that people adopt later in life and which are hugely successful (SQL/RDBMS is a great example). If you want to expose 10-year olds to functional programming, Logo [1] is a great place to start, and has been for decades. That's where I picked it up (I didn't know it at the time, but looking backwards it's now clear). [1] https://en.wikipedia.org/wiki/Logo_%28programming_language%29 https://en.wikipedia.org/wiki/Logo_%28programming_language%2...
- smabie 6y agoI actually think it's easier. dune and opam are so much nicer than python/pip/conda or whatever. Have you used OCaml? Because you can set up a complete environment with IDE support in like 5 minutes flat. It's actually one of the easiest environments to set up of any language. dune, merlin, opam, and utop provide everything you would possibly need.
- gmfawcett 6y agoReally? I've had much, much worse developer experiences with other languages. With opam and dune wrapping the default toolchain, honestly it's a pleasure to work with these days. (I feel obliged to give an example of what I think is a bad developer experience, and I would point at Haskell. There are far too many toolchain variations to choose from, all of which seem to be in active use -- cabal, cabal-v2, stack, cabal-v2+nix, stack+nix; ghcid, ghcide, etc. etc. Once your choices are made and your stack is configured, you'll be okay, except for the inordinately long build times. But in my experience, it can be a real nuisance to come back to a half-finished Haskell project -- say, on a new machine -- unless you've made a singular, personal commitment to a specific technology stack. Leave yourself copious notes, Makefiles, and shell.nixes to remember how to get the thing running! But this is a personal sob-story and a digression.) My main argument -- which I think is being lost here -- is that Ocaml isn't IDE unfriendly, and especially not so unfriendly that an entirely new language is needed just so that FP and IDEs can happily coexist. (Well, except for Windows. Ocaml + Windows is more unpleasant than it needs to be.)
- shallowthought 6y ago> My main argument -- which I think is being lost here -- is that Ocaml isn't IDE unfriendly, and especially not so unfriendly that an entirely new language is needed just so that FP and IDEs can happily coexist. Right, and I guess my counterargument would be that, yes it is, and you don't need to resort to logic to see it - just do a little googling about its poor adoption.
- carlmr 6y agoAlso F# has amazing IDE support with Ionide in VSCode.
- dmitriid 6y agoAny language is non-IDE-friendly compared to what you have out of the box for languages such as Java, C# and even Python in IntelliJ's IDEs. Most languages at most have autocomplete and definitions look up (and even those are often very brittle). That is a far cry from what an IDE should be able to provide. Granted, recently I only tried OCaml via Reason, but I remember that some of the errors the compiler produces are not IDE-friendly either (something like "Type A provided but elsewhere wanted B" with no indication where :) ). But that's mostly due to the age of the language (most "old" languages are very user-hostile and have very terse/cryptic error messages).
- gmfawcett 6y agoI agree that IntelliJ is excellent for Java, and assume it is for C# (though I haven't used it for that). It's my go-to tool for Java development. In my experience, it's good for Python that doesn't have type annotations -- it's remarkably smart really, considering the challenges of autocomplete for dynamic languages -- but not truly great. Better than nothing, certainly! I can't speak to Ocaml in IDEs other than Emacs, but in my experience, error messages are quite location-precise, down to the specific word(s) on the line causing the error; and the messages are readable with a little practice. They are not as good as, say, Rust's error messages, but you get used to them fairly quickly! But that's more a condemnation of the compiler, not of the IDE. There are a few esoteric error types in Ocaml ("Expected a value of type 'a, but you gave a value of type 'a" -- OK, that's a head-scratcher) but those are very infrequent in typical code.
- octachron 6y agoDo you have a recent example of an error of the form "Expected a value of type 'a, but you gave a value of type 'a"? I have hoped to have eliminated all of them in 4.08.
- gmfawcett 6y agoThat is great news, and I am probably remembering errors from the olden times. :) Thanks for your work!