8 ms·
OCaml Resources (2006)
- melling 11y agoI can't find the time to learn a language for fun. I need to find a way to incorporate it into my daily routine. There just aren't enough hours in the day to play. Anyway, I've got a couple side projects, one of which is website in Go. How's OCaml for web development? I also saw oCaml for iOS but it didn't seem to be up to date: http://psellos.com/ocaml/compile-to-iphone.html http://psellos.com/ocaml/compile-to-iphone.html
- programLyrique 11y agoThere are ocsigen (http://ocsigen.org/ http://ocsigen.org/) and opium (http://rgrinberg.com/blog/2014/04/04/introducing-opium/ http://rgrinberg.com/blog/2014/04/04/introducing-opium/), OWebl (http://meetowebl.com/ http://meetowebl.com/), xbreed (https://github.com/mk270/xbreed https://github.com/mk270/xbreed) and maybe others... See also: https://news.ycombinator.com/item?id=2235204 https://news.ycombinator.com/item?id=2235204
- melling 11y agoYeah, I'm sure there are lots of small projects. Are any widely used that have matured? I don't want to play with someone's part time project.
- programLyrique 11y agoocsigen is used in production (by Facebook for an internal project, for instance). There is a more complete list on the website.
- rgrinberg 11y agoOpium isn't mature but it's mostly a friendly wrapper for an http layer that is fairly mature. Have a look at: https://github.com/mirage/ocaml-cohttp https://github.com/mirage/ocaml-cohttp You can of course also use cohttp directly but it's a little raw.
- jallmann 11y ago> I also saw oCaml for iOS but it didn't seem to be up to date There is work underway to improve cross-compilation support [1][2]. Once that lands in a release, there shouldn't be any reason to maintain forks of the compiler for iOS, Android, etc. [1] http://caml.inria.fr/mantis/view.php?id=6266 http://caml.inria.fr/mantis/view.php?id=6266 [2] https://github.com/ocaml/ocaml/pull/182 https://github.com/ocaml/ocaml/pull/182
- locokoko 11y agoI recently looked at OCaml and quite liked it, but I was wondering if there is any SLIME/Geiser (these are the lisp and scheme IDEs for emacs) equivalent for it? I know there is tuareg-mode, but as far as I can tell it is not nearly as convenient as SLIME. Any ideas?
- ufo 11y agoI don't know what you are looking for when you compare things to SLIME but I was quite satisfied with the setup they suggest in realworldocaml: https://github.com/realworldocaml/book/wiki/Installation-Instructions https://github.com/realworldocaml/book/wiki/Installation-Ins... * OPAM for package management * Utop for a REPL * merlin for autocomplete and type queries * ocp-indent for aotomatic indentation
- unhammer 11y agohttps://github.com/OCamlPro/opam-user-setup https://github.com/OCamlPro/opam-user-setup tries to make the setup even easier
- sgrove 11y agoI struggled to get an interactive environment for OCaml that was similar to SLIME/Cider. I recorded a video showing what I had pieced together to get a kind of repl-like env [0] and posted it to twitter, hoping people would tell me how silly that was and there was already an existing system. Turns out it's not a very high priority, the OCaml community seems to work in a different way, but I've never been able to work in person with someone to see how they do it. That say, the type helps from Tuareg/merlin and a few other things really started to become very handy, and I miss them in ClojureScript now. [0] "Early OCaml workflow pains" - https://www.youtube.com/watch?v=rDFocxR6Mpw https://www.youtube.com/watch?v=rDFocxR6Mpw
- pron 11y agoThere's a very good (and multithreaded!) implementation of OCaml for the JVM: http://www.ocamljava.org/ http://www.ocamljava.org/
- 616c 11y agoWell, if you are the quasar/pulsar guy I think you are, I will take you up on your praise then. And because of my guess, what do you think of the performance?
- pron 11y agoI am, and thanks :) I haven't got to the point of doing any benchmarks, but according to the author, it is slower than plain OCaml. I've only written a couple of toy programs (a Swing GUI in OCaml!) I am, however, very impressed by the implementation. The author wrote an OCaml library that emits Java bytecode, and then modified the OCaml compiler to emit bytecode. He then ran the compiler on itself, and got an OCaml implementation on the JVM written completely in OCaml (plus some runtime classes in Java). The author, who used to work at INRIA told me he's now working on a startup using OCaml-Java.
- 616c 11y agoI also think it is interesting, once I put 2+2 together, you pointed out the OCaml Java runtime from Xavier is not open source ... yet. It will be, but it is binary only at this point.[1] I want to make a joke about the F/L/OSS spirit of this guy, but the whole QPL thing has been repeated a la Shen in circles where I read and seems to have left a sour taste in the mouth of some, like this guy.[2] Still, I am in place to judge OCaml devs or the community around them, as they seem increasingly awesome. I am a novice, but a CS undergrad in my hood specifically said check out OCaml when we discussed functional langs because of the Jane Street videos. And before that, my only expsoure to what OCaml was, let alone is or even coding it, was the eMule software package. Anyway, good to see you on the field. If you are paying attention to this, I certainly will! [1] https://github.com/xclerc/ocamljava/issues/22 https://github.com/xclerc/ocamljava/issues/22 [2] http://programmers.stackexchange.com/a/62704 http://programmers.stackexchange.com/a/62704
- tejinderss 11y agoHow does Ocaml compare with F#? Now that .net is open source and supports multi platforms, is it fair to compare these 2 languages?
- mercurial 11y agoOCaml has no corporate support and a limited standard library. It does not benefit from the larger MS ecosystem. It does not have multicore support (not until the end of the year if all goes well). On the other hand, it is really fast, it has some great features (functors, mostly) not found in F#, a really good package management story, and some great libraries (eg, lwt). It can also boast of having one of the most developed unikernels out there (mirage) and can generate sane Javascript via js_of_ocaml. That said, it's definitely an even harder sell than F# in the corporate space.
- jarcane 11y agoI was as recently as today quite curious to find that there was an implementation of Ocaml 2.00 for RISC OS, but alas, it seems to have been lost to the internet.
- fithisux 11y agoMy only skeptikism with OCaml is that OPAM (latest packages) does not work on windows and does not cooperate with msys2 (lates libraries) or another port solution like winbuilds. I have to install msys2 and keep compiling by hand. Even if a source solution that kept updating even if I had to compile regularly, would be preferable. This is my only hesitation.
- avsm 11y agoThe wg-windows@lists.ocaml.org working group has just started this week to sort this out properly. Now that OPAM itself is fairly mature on Linux/BSD/MacOSX, we can tackle this properly. Please do feel free to join the group and give your 2 cents about the direction that this should take: http://lists.ocaml.org/listinfo/wg-windows http://lists.ocaml.org/listinfo/wg-windows
- lesterpig 11y agoI'm studying this language right now at a french school, with INRIA researcher. And, well... I'm not really satisfied with it. OCaml produces a small amount of code, but is really slow and hard to understand. Sometimes, it looks like obfuscated code! Documentation and libraries are not polished, and I would recommend Haskell instead of OCaml. Good for research and some algorithms, bad for applications. And... God... "This page was last updated on 17 June 2006."
- superboum 11y agoSame feeling, and why are they ignoring EVERY programming convention ? One more thing I really hate is there are many way to the same basic thing, ie. declaring a new function or doing a pattern matching. Finally, standard libraries are not well named (List.split will not do what you think) nor easy to use (List.last ? Nope !).
- FraaJad 11y agoThere are two things here: 1. "unfamiliar" syntax. Well... It is unfamiliar if your first exposure to programming stopped at Java. Guess what .. pattern matching is quite an old convention in programming languages old (Prolog, Erlang, ML, Haskell)... and new (Rust, Swift).. 2. Standard libraries are a crap shoot... cruft accumulates in standard libraries just like any piece of software but harder to clean up owing to demands of backward compatibility. Just go and look at Python standard library. Even on a superficial level, the stdlib is a mix of CamelCase and under_score .. which can be irritating. OCaml is not unique in this regard.
- implicit 11y agoThis is very consistently my biggest problem with OCaml: it just doesn't follow conventions set in other ecosystems. I predict this is the sole reason it could never be "the next Java." It's worth noting, however, that I've had very, very few problems with the semantic properties of the language. I think the slog is worth it for that reason.
- rbehrends 11y ago
- more_original 11y agoThis page is from 2006! I guess the official homepage http://ocaml.org http://ocaml.org would be better for up-to-date information.
- jaegerpicker 11y agoOCaml is a hard sell for me. I want to really like it but everytime I start to play with it, I drift back to F#, .net core, service stack, and all the other open source projects are really hard to compete with. The Syntax is similar to OCaml (really really close IMO) and other then it's ties to Microsoft it's seems to be all upside with F#. Is there a compelling lib or advantage of OCaml over f#?
- CHY872 11y agoOCaml has cool stuff like MirageOS, as one compelling lib (still a research project). It's a library that constructs unikernels. You write your application, build it, and out comes a VM that you can run. I feel that many of the advantages of switching to OCaml are minimised when you are already using an ML! Soon, there should be a compelling performance case for using OCaml. There are rumours that in the next release, there'll be an MLton type whole program optimisation setup, which should reduce the cost of abstraction to zero.
- amirmc 11y agoMirageOS is more than just a research project. It's deployed in the wild by folks who weren't active researchers. I'd certainly call it an open-source project in its own right. e.g. http://amirchaudhry.com/unikernels-for-everyone/ http://amirchaudhry.com/unikernels-for-everyone/
- tel 11y agoFunctors tend to be the big thing that's missing, right? F# just had to drop the feature because of compatibility with .Net packages, as I understand, but it severely cripples the module system. MLs are such that the value-level stuff and the module-level stuff are more or less independent. So you can go a long way just liking the value-level stuff without really caring about the status of the module-level stuff. But it's also a pretty big motivator for the design of ML. F# is at least weirdly missing out here.
- cwyers 11y agoCan you provide an example of how functors make Ocaml code different from F# code in practice?
- zak_mc_kracken 11y agoThis is just a list of resources to learn OCaml, there is nothing about convincing skeptical people here. Also, this page is almost ten years old. Not sure how this kind of post ever makes it to the front page.
- m0skit0 11y ago404 on some links
- implicit 11y agoOCaml/js_of_ocaml is presently my favourite AltJS stack. OCaml syntax is super idiosyncratic and doesn't resemble anything, but, once you retrain your eyes, the underlying semantics are terrific. js_of_ocaml imposes very minimal code overhead (6k-ish). Sourcemaps work great, and OCaml values are mapped into JS in a very straightforward way. You can read them in a JS debugger. Ocsigen's lwt library is also the best "callback hell" solution I've found.
- lindig 11y agoCould you recommend a project to look at? I'm familiar with OCaml but found Ocsigen as a whole impenetrable and would be interested in something more library than framework.
- implicit 11y agoI don't, unfortunately, nor do I have any source code I can share. :( The only advice I can offer is that the documentation actually is correct and pretty complete, but there's nevertheless something about its organization that makes it difficult to find what you're after. In particular, start by reading this page carefully: http://ocsigen.org/js_of_ocaml/2.5/manual/library http://ocsigen.org/js_of_ocaml/2.5/manual/library It explains everything at a high level.
- mercurial 11y agoYou have opium [1], which is considerably lighter and more traditional (no Eliom stuff). 1: https://github.com/rgrinberg/opium https://github.com/rgrinberg/opium
- rgrinberg 11y agoI think the GP wanted something with js_of_ocaml. Nevertheless, as the author of Opium, I am grateful for your recommendation :)
- eatonphil 11y agoJust reposting from below, but if you want lightweight, take a look at OWebl[0]. It is by far the smallest with no Core dependencies. The API is familiar if you write Python or Ruby. Documentation is continually published and it remains one of the most up to date alternatives to Ocsigen. [0] http://meetowebl.com http://meetowebl.com
- eatonphil 11y agoI started writing OCaml in college after hearing a talk by Jane Street [0], one of the most outspoken corporate supporters of OCaml. After getting past the steep learning curve (about a weekend of pedal-to-the-metal debugging), I really got a feel for how beautiful OCaml semantics really are. If you're looking for a solid and familiar OCaml stack, check out OWebl [0]. Always looking for helping hands or other support. [0] - https://www.janestreet.com/ https://www.janestreet.com/ [1] - http://meetowebl.com http://meetowebl.com
- deleted 11y ago[deleted]
- pjmlp 11y agoCaml Light was my introduction to the FP world back in the day. Very nice experience.
- ricccardo 11y agoI've been developing in Haskell for a while and I recently had to learn OCaml to help TA for a course in my university. I couldn't shake the feel that I was learning "Haskell Light". No pure/impure code (I/O, mutable references, exceptions), no monad syntax sugar, less syntax sugar for pattern matching, much smaller base library, plus surely other differences that my current level of expertise of Haskell is hiding. Perhaps the simpler semantics make it easier to translate to js (I know haskell->js transpilers are very complex and I'm sure lazy evaluation has a lot to do with it), but in terms of language features, what am I missing in Haskell that makes you more productive/helps you write clearer code in OCaml?
- ploxiln 11y agoIf OCaml is "Haskell Light" the way C is "C++ Light" that sounds great to me.
- danieldk 11y agoI have never used either language in teaching. But maybe you have more experience as a TA: do you think OCaml is easier for students because of strict evaluation?
- ricccardo 11y agoI haven't used Haskell in teaching either. It probably is. My professor does not like lazy evaluation at all (note how i did not insert it in my "haskell light" list of features), he said he played with it at the time this stuff was being researched but he never saw the benefit to offset the complication in semantics. Our students were mostly having trouble with OCaml being a functional language than anything else. Some of them independently discovered mutable references and for loops and probably wondered why we hid from them such useful constructs! Pattern matching was also something that only the best students took serious advantage of.
- amirmc 11y agoFor anyone interested in finding out where OCaml is taught, there's a page at http://ocaml.org/learn/teaching-ocaml.html http://ocaml.org/learn/teaching-ocaml.html
- dlandis 11y agoI did a couple small projects in OCaml and I loved the syntax and style of programming, but I think there would pretty much always be a better language choice for a serious project, regardless of what type of program you are writing. Also, the standard library leaves a lot to be desired and parts of the ecosystem (e.g. docs, and OPAM) are pretty rough. The standard library has a lot of gaps so you end up implementing a lot of low-level functions that will seem tedious and inefficient if you are coming from a more mainstream language with a rich ecosystem. Using the Jane Street's Core library helps a little bit but still leaves a lot of gaps. It's still a fun language though, but I don't think there would be a compelling reason to choose it nowadays for a new project.
- mwcampbell 11y ago> there would pretty much always be a better language choice for a serious project The Mirage library OS is a pretty serious project. Facebook also uses OCaml for Flow and the Hack type checker. And of course, Jane Street Capital uses OCaml. But I'm guessing what you mean is that OCaml is a very non-mainstream language, so it will be rejected for most corporate projects just because it's so foreign.
- dlandis 11y ago> But I'm guessing what you mean is that OCaml is a very non-mainstream language, so it will be rejected for most corporate projects just because it's so foreign. Rather than snidely guessing what I meant, why not just read the rest of my comment or ask for clarification like an adult? Also, I'm not denying there are a few odd projects here and there that use it successfully -- as well as Jane Street, of course, who are almost synonymous with OCaml. But like I said, although it is a very nice (and educational) language, I just don't feel like it is "best of breed" in any particular area. Not sure what that has to do "corporate projects", etc.
- mwcampbell 11y ago> Rather than snidely guessing what I meant, why not just read the rest of my comment or ask for clarification like an adult? You're right; I'm sorry.