10 ms·
OCaml 4.08
- threwawasy1228 7y agoIt doesn't get said very much but the ML ecosystem is full, complete, and very much production quality. It is a shame that there are not many projects or companies that make use of all that it has to offer.
- neilv 7y agoAgreed, OCaml has looked good for a long time. And I have a similar feeling of sadness that Racket (or one of the other Scheme variants) isn't used more. I've wondered whether one of the barriers is still that students' only exposure to these is usually using it in school for some contrived homework assignments, and dismissing the tools for "real work" before they've tried applying them. (And at least some schools are emphasizing having students ready for internship/interview with popular languages now, so innovative languages can get even less attention.)
- scriptkiddy 7y agoI really want to use Ocaml for web application back-ends, but last time I checked the ecosystem around that in Ocaml is less than extensive compared to languages like Python, JS, java, etc. It really is a shame. I need to set aside some time to really dive deep into Ocaml and make a simple micro framework or something. From my small amount of exposure, I can say that I love Ocaml's expressiveness and flexibility.
- sambal 7y agoDid you check out F#? I’ve never personally used it, but I know it takes advantage of the .NET ecosystem (and with .NET Core, is no longer tied solely to windows).
- anuragsoni 7y agoThere is some good work going on for the lower level pieces: https://github.com/anmonteiro/ocaml-h2 https://github.com/anmonteiro/ocaml-h2 - HTTP2 stack https://github.com/inhabitedtype/httpaf https://github.com/inhabitedtype/httpaf - HTTP stack For micro-frameworks there are a few options available like https://github.com/rgrinberg/opium https://github.com/rgrinberg/opium https://github.com/ostera/httpkit https://github.com/ostera/httpkit There are some scattered pieces in the ecosystem for routing, sessions etc but i agree that compared to Python, JS, etc the ecosystem might not look as cohesive or expansive for web applications. So there should definitely be room to have new solutions in this space
- Barrin92 7y agoI'm always surprised that F# didn't take off. It's a great language and in addition to the strenghts of ML you have the .net ecosystem and Microsoft behind it.
- mruts 7y agoThere’s some hedge funds using F#. C# has historically been popular in certain parts of finance any many of those shops are now exclusively using F# for new code. Personally, F# is nice and all, but the lack of higher kinded types rubs me the wrong way.
- jetti 7y agoIt took awhile before it seemed that Microsoft was truly behind it. I tried looking into it when version 2.0 was released and it was a pain in the ass trying to get it to work with Visual Studio 2010 Express. I was not a professional programmer at that time so I didn't have access to Visual Studio Pro. That experience turned me off to the language and I never really went back to look at it.
- pjmlp 7y agoMicrosoft isn't that much behind it. VB.NET, C# and even C++/CLI get all the nice .NET toys, while F# gets to play in some of them. It was even left out of the WinUI 3 roadmap.
- np_tedious 7y agoJet uses F# almost exclusively https://github.com/jet https://github.com/jet https://link.medium.com/spjuV2aAwX https://link.medium.com/spjuV2aAwX
- pjmlp 7y agoJet might not exist for much longer. https://www.reuters.com/article/us-walmart-jet-com/jetcom-falls-by-wayside-as-walmart-focuses-on-its-website-online-grocery-idUSKCN1TD2PS https://www.reuters.com/article/us-walmart-jet-com/jetcom-fa...
- iLemming 7y ago
- mruts 7y agoIt is unfortunate. Though, on the other hand, Jane Street is even leveraging OCaml for their FPGA’s. It’s an exclusively OCaml shop. Too bad I’m not smart enough to get hired there. The interviews are impossible.
- generichuman 7y agoHonest question, how is it that hard? What do they ask?
- new4thaccount 7y agoIIRC, they go over some of the background of it on their website.
- yurish 7y agoHow is Windows support nowadays?
- VoiceOfWisdom 7y agoI have not been using OCaml, but I have been using Reason / Bucklescript on Windows extensively. Other than some expectation that GNU tools like cp are available on the path, everything has worked beautifully.
- accnumnplus1 7y agoOne little thing which would improve the ecosystem is public ci support... as simply as with other languages. Yes, eg travis or circle can do OCaml but with considerably more effort than other languages where for personal projects I often have a one liner.
- TheAsprngHacker 7y agoThis release adds "binding operators," which make functors, applicatives, and monads more convenient to use. The "binding operators" are like OCaml's version of Haskell's do-notation, but IMO even better. In Haskell's do-notation, each binding in the form of `pat <- expr; next` desugars to monadic bind, with an extension to use applicatives instead where possible, but with OCaml's binding operators, there are three separate operators for functors, applicatives, and monads. The 4.08.0 release also adds the Fun, Option, and Result modules to the standard library.
- ilyagr 7y agoAre there any references for what these look like?
- mjn 7y agoThere's a new section of the manual covering them, here: http://caml.inria.fr/pub/docs/manual-ocaml/manual046.html http://caml.inria.fr/pub/docs/manual-ocaml/manual046.html A blog post with a more extensive set of examples: http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-syntax.html http://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-s...
- ilyagr 7y agoPerfect, thanks!
- KirinDave 7y agoWhat's better? Is the idea that there are 3 separate operators better, or did the reason why not come through in the post?
- TheAsprngHacker 7y agoI meant that there being three separate operators makes OCaml's design better than Haskell's. (Of course, this is just my personal opinion.)
- asplake 7y agoGetting a 404 here: You can find more details at https://ocaml.org/releases/4.08.0.html https://ocaml.org/releases/4.08.0.html
- ddebernardy 7y agoThat's a 404 for me as well. This works: https://github.com/damiendoligez/ocaml.org/blob/add-release-4.08.0/site/releases/4.08.0.md https://github.com/damiendoligez/ocaml.org/blob/add-release-...
- asplake 7y agoThanks
- melling 7y ago“Many error messages were improved.” A few months ago someone on HN mentioned that error messages would be greatly improved in this release, which would make learning OCaml much easier. Does anyone have more details on this?
- bitbckt 7y agoLook for "### Compiler user-interface and warnings" in the announcement for references to the work.
- octachron 7y agoThere were a handful of concomitant improvements: * The printing of error message has been improved to display the code source responsible of the error outside of the REPL. * Some probable beginner errors (like discarding a non-applied function with `ignore`) now raises a warning. * Type name captures should not happen anymore in error messages: no more `val x: int` is not included in `val x: int` where `int` refers silentiously to different types. * A handful of typing errors has been fixed to speak to users and not the compiler developers (no more "unexpected existentials" for instance). * Some compiler internal change to make it much easier to use the typing context when explaining a type error. This is not used much yet, but I hope to improve the scope related type errors in the next versions.
- andrepd 7y agoI'm not entirely convinced that the let operators were a good idea. What's wrong with the ppx rewriter notation (let%bind = ...)? That's, after all, what it's for: provide custom extensions to the language syntax. Quality of life improvements in the standard library are maybe the biggest deal for me (since I don't use any stdlib replacement like Batteries or Base). Stuff like the Int, Bool, Option, etc. modules, or filter_map... It's mind boggling how they've only been added now (but good thing they were).
- mlevental 7y agoanyone know a good ide for ocaml? something with tab complete and jump to definition?
- mruts 7y agoEmacs?
- anuragsoni 7y agoWhile not a traditional IDE, Merlin [1] combined with vim/emacs/vscode is really good (autocompletion, jump to definition, type lookup and more). Merlin also gained support for language server protocol recently so that could be an option for any editor/IDE that has a language server client. [1] https://github.com/ocaml/merlin.git https://github.com/ocaml/merlin.git EDIT: I'd also like to point out OCamlformat (https://github.com/ocaml-ppx/ocamlformat https://github.com/ocaml-ppx/ocamlformat). It works really well in my experience and makes it really easy to perform automatic code formatting, and can be used in CI to check that changed conform to the formatting style a project prefers.
- xfer 7y agoMerlin is very good. Wish something like this was available for haskell.
- shadowfox 7y agoBesides emacs (mentioned in another comment), VSCode with a language plugin/server like [1] works reasonably well for OCaml. [1] https://github.com/reasonml-editor/vscode-reasonml https://github.com/reasonml-editor/vscode-reasonml
- Barrin92 7y agoThe VS Code extension is really pleasant and pretty much requires no setup other than installing merlin with opam.
- andrepd 7y agoMerlin for vim/emacs/sublime/others
- amelius 7y agoThis is great, but I'm still waiting for multicore support, and a mature GUI library.
- lifty 7y agoOCaml would have seen so much more adoption if it had a solid multicore story. It really is a shame, because it's a nice language.
- rwmj 7y agoUse multiple processes, and then your code works across multiple machines too (and better across NUMA machines). Threads are simply a bad idea.
- dna_polymerase 7y agoShared memory is still an issue though. To my knowledge there is no convenient way to share memory between processes in OCaml. That said, you are right, threads are horrible.
- lifty 7y agoCorrectly implemented concurrency/parallelism primitives are not a bad idea. I am thinking along the lines of Clojure/Erlang/Go. They make life more enjoyable.
- newen 7y agoWhat is it called when you live in an environment where X is not available and so you convince yourself that X is a bad idea?
- rwmj 7y agoI used shared memory concurrency all the time, you're simply wrong.
- pjmlp 7y agoModern security exploits and application crashes due to state corruption have proven that while threads were an enticing idea, they aren't something that we should keep around if we care about security and application stability. This applies to all programming languages, not only OCaml, hence why everyone is moving away into other concurrency models anyway.
- jpittis 7y agoDoes anyone have any links to examples or docs for how the “binding operators” work?
- octachron 7y agoThere is a dry technical description at http://caml.inria.fr/pub/docs/manual-ocaml-4.08/manual046.html http://caml.inria.fr/pub/docs/manual-ocaml-4.08/manual046.ht... . And a more illustrative description at https://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-syntax.html https://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-... .
- bitmadness 7y agoIf they had Unicode support and multicore support in the language I'd be a lot more interested.. hopefully in five or ten years we'll get there.
- willtim 7y agoI'm a Haskeller, but it's great to see OCaml improving significantly with every release. It's a win for typed functional programming in general.