OCamlEditor
ocamleditor.forge.ocamlcore.org
ocamleditor.forge.ocamlcore.org
https://github.com/libguestfs/libguestfs/tree/master/v2v
https://github.com/libguestfs/libguestfs/tree/master/builder
https://github.com/libguestfs/libguestfs/tree/master/customi...
https://github.com/libguestfs/libguestfs/tree/master/resize
https://github.com/libguestfs/libguestfs/tree/master/sparsif...
https://github.com/libguestfs/libguestfs/tree/master/sysprep
One great no-nonsense feature of OCaml is that you can just link programs directly to C code, include a tiny C wrapper, and call straight into C with virtually no overhead (literally no overhead for functions that don't need to allocate on the OCaml heap).
Nothing at all against OCaml, but it puzzles me where these HN micro-fads come from. There have inexplicably been a surge in OCaml posts on the front page over the past week.
Which is perfectly fine, except that I haven't gotten around yet to learning Rust (i.e. last month's fad). I'm still busy digging into Go (i.e. the fad from six months ago), having grown bored with Scala (i.e. ancient history, at least a year or two).
It is always exciting to see the fad spotlight shine on a mature language, since reaching production-ready status is usually the point at which languages stop being cool. However, the Haskell surge also rolls back around every few months, and they seem to think that OCaml isn't "pure" enough. So what to do?
Are these short-lived bubbles the result of coordinated HN ranking manipulation, or do brief convergences of interest just spontaneously bubble up by coincidence?
[/meta]
In mine, Ocaml is definitely not a fad and any development is very exciting and definitely deserves the front page of Hacker News.
Also, in my country, a sizeable percentage of engineers has gone through a least the basics of Ocaml.
France?
The FCT-UNL was very strong in functional and logical programming back in the 90's, when the informatics degree started as an offspring from electronics.
We had Caml Light (OCaml predecessor) was used in quite a few classes, the other being SWI Prolog. Logical Programming was also part of electronic degree.
Since a few of the teachers are still at the university I would expect that they have eventually moved from Caml Light to OCaml, if they keep teaching the same classes.
I am from Aveiro, studied at the FCT-UNL back in the early 90's and nowadays live in Germany.
Actually the ML language I tend to use is F#, due to tooling and me spending most of my time on Windows.
The recent $1m contribution to the FreeBSD foundation had me looking into FreeBSD again, when I found a nice presentation of Jordan Hubbard, which topped at #1. Probably my contribution lead somebody else to post a Ask HN about comparing FreeBSD to Linux.
I think this is how it often works - a popular submission raises interest, newly-interested people find more bits and submit them. At some point (as happened with Go), something gets so much momentum that it often tops Hackernews for a long period.
Regarding OCaml, is surely not a "new fad" on HN, there're posts about it and Unikernel[1] and MirageOS every now and then.
I was introduced to OCaml at my University, but switched later to Haskell and it seemed simpler too me. Furthermore Haskell's ecosystem seems to be more major (or maybe just more vocal?).
Haskell's ecosystem is certainly bigger than OCaml's, though both are fairly niche.
I have some RSS feeds that I follow on topics that are interesting to me, which includes the ocaml.org RSS feed and the ocaml subreddit.
When I see something interesting that I think might be interesting to other HN readers I use the HN bookmarklet which either submits it (if it wasn't submitted yet), or upvotes it and takes me to the comments.
I don't know how many other people there are who follow those RSS feeds and post in a similar way, but it might explain the correlation between submissions and upvotes. In fact one of my (non-OCaml related) RSS-based submissions triggered the ring vote detector although there was no ring voting from my side: https://news.ycombinator.com/item?id=8535171
Indeed I noticed more OCaml related topic on the HN frontpage in the past year or so, so that makes me think these kinds of topics and the associated discussions are welcome, or that at least there are a number of people interested in these topics. Either the number of HN users interested in OCaml has grown lately, or they were always there and some of the recent popular OCaml topics on the frontpage has encouraged more people to post more OCaml related topics.
Facebook just released a static type checker for javascript last week that happens to be written in OCaml. This release announcement was pretty well received here on HN[1]. After reading the commentary here and looking at Flow I've found myself reading more about OCaml. It wouldn't surprise me that others did the same and decided to share interesting articles they found.
I imagine the bubbles of popularity you mention are regularly kicked off by a similar event. When an article or piece of new software gets popular it follows that related material would also see a surge in activity.
Maybe the language is finally hitting critical mass? Maybe lots of people are hitting the same shaped problems at this stage in the evolution of our cloud platforms? Maybe it's just dumb luck?
For your specific things: Rust is probably not mature enough yet but worth keeping an eye on. Go makes me cry. Scala does a lot of the same things OCaml does as well or better, at least if you "stick to the good parts" (there's a ton of extraneous crap in Scala); if you're in an environment where the JVM is acceptable then TBH you won't gain ever so much from having both in your toolbox.
Haskell is the tough one. My take is that purity is a very heavy burden, and even the most advanced language in the world can only go so far to alleviating that. But the power it grants you can be huge - or can not. If you find purity worthwhile, go with Haskell. But if you just want the functional power boost and don't want to immediately expend most of it on carefully tracking your effects, OCaml is a perfectly good choice; at the least, it's an incremental improvement in the Haskelly direction, without having to wear the hair shirt right away. I'd say much the same for Scala.
I believe a major problem with OCaml's adoption always was that a large chunk of the community and documentation is in French.
My (somewhat rambling) 2cents, since I started working on improving this via OCaml Labs.
- Poor tooling: OCaml (and ML) is taught at a number of institutions so undergrads do have experience of it, yet few places seem to use it in production. The stories I heard of how they had to manage their systems would have put me off from ever wanting to learn it. OPAM, and the new tooling around it has changed all that.
- Fragmented community (outside academia): Of those who've used OCaml, there are those who love the language but they may end up feeling a bit isolated as they're unaware of others who can help/support them. They either soldier on alone or move on to something else. This shouldn't be surprising if you believe the 1/9/90 rule -- 1% make/do stuff, 9% use/participate and 90% just consume. I'm suggesting that the quiet 90% aren't really aware of each-other's existence and don't progress into the 9%. The work around refreshing ocaml.org, CUFP, more blogging etc is helping this.
- Missing 'killer app(s)': Using a language for it's own sake isn't very compelling. There need to be tools or products that people (devs) find impressive or cool that have been written using OCaml, where it was clearly the right tool for the job. This drives interest in the language with a purpose and encourages people to make/contribute things. I believe Mirage OS, Hack and recently Flow have helped this (as well as the effort of those projects to actively disseminate their work - see above comment).
With the above in mind, I had a couple of thoughts in the early days of OCaml Labs (I'm sure these weren't original).
Thought 1: Improve on all the above and existing users who've quietly appreciated the language will feel more confident in revealing themselves to support a growing ecosystem.
Thought 2: If thought 1 is true then some of those, who've come out to support the ecosystem can feel more confident in advocating for it and draw in new users. Combined with the above, this sets up a virtuous cycle.
As a result, I'd expect to see more stories on HN, Reddit, Twitter elsewhere that refer to OCaml, either as a language or because of tools built with it. In other words, this shouldn't be a fad but merely revealing another option to solve certain kinds of problems.
Your work is showing the results and its really inspiring.
To list just the main problems:
- f*-up licence (open-source, but modifications can only be distributed as source-code patches)
- non-concurrent runtime (because the original developers don't care about it)
- ambiguous syntax which masks bugs
- inconsistent and incomplete standard library (there are replacements, but they too suck)
- shitty REPL (at least on Windows)
Well, that's about it. It's really fast, safe, expressive, as functional as it gets ([EDIT] also: compiled). Definitely one of the better-designed languages, and a great starting point for many other languages (F#, Swift, Rust).
Lately, there has been a lot interesting development that eased development in OCaml (basic overloading, this IDE), and more seems to be coming (concurrent GC/runtime).
- ambiguous syntax: care to give a few examples?
- inconsistent & incomplete standard library: the library that comes with the compiler is basically the library of the compiler. Opam probably has everything you need.
- shitty REPL. use utop or use emacs. Anyway, I do think people on windows are better of using F#. But that's another discussion.
if a > 0 then
print_endline "a > 0" ;
match a with
| 0 -> print_endline "impossible"
| 2 ->
match b with
| 0 -> print_endline "2, 0"
| _ -> print_endline "2, not 0"
| 3 -> print_endline "3, something"
| _ -> print_endline "something, something"
;
print_endline "done"
You can see the rest of the discussion here: https://news.ycombinator.com/item?id=8497740OPAM saves lives, that's true, but one still wishes there was a nice library of standard data structures; I use Batteries, which inherit the inconsistency of the standard library (for the sake of compatibility), the other real alternative is Core, which is undocumented.
I didn't look at the license very closely, but there are a few forks of the language out there (check out github), which aren't distributed as patches.
Generally, for each fad, there's some actual news related to the fad, and a bunch of hangers-on.
Go and Rust are new languages, so anything they do is news. OCaml get into the news every now and again (Flow and related).
This is basic human nature that we observe everywhere, everyday. News, movies, TV, books, start-ups, etc.
You won't get this effect with, say, a new PG essay, because everything loosely related to PG has already been posted to HN the minute it has been published. So their are no low hanging fruits coming in batch as soon as you shed light on the subject.
What "coincidence"? It's just because one person posts and article and 30,000 others see it, and some of them explore around (the linked website and related sites) and find other articles on the same topic to post.
And some fans of the topic also come back/first-time to HN attracted by the noise about the first post or some subsequent post, and they post too.
Obviously it's extremely powerful in many different domains. But one particular area I am interested in is mobile app development. Google search shows OCaml indeed has libs/tools for writing and compiling apps. I am curious about what's the current status and experience in using OCaml in Android/iOS development.
As for the compiler I think it can already cross-compile to Android.
That's great to know. Also, if taking the js/html5 route, maybe Js_of_ocaml can help to ease the pain? I've heard nothing but good things about it.
F# is a superset of OCaml (well maybe not very strictly speaking but practically for all intents and purposes). Xamarin is gaining a lot of traction as a platform for writing native apps that deploy to Android and iOS.
Personally I have very good experiences with both the language and the platform, I would recommend you check it out.
The runtime situation is arguably also a matter of preference, Ocaml compiles down to fairly efficient machine code and has a well tuned garbage collector, whereas F# at least initially had to rely on a garbage collector that was tuned for a different use case.
The bridges connecting OCaml to iOS UI components are incomplete, so you might have to do a bit of work to support certain components, but the work would be reusable. Not difficult if you follow the example apps, but maybe tedious. I think the effort is worth it for what OCaml gives you.
What OS/distribution are you using? Also what compiler version, apparently it requires OCaml = 4.01: https://github.com/ocaml/opam-repository/pull/537#issuecomme...
FROM ubuntu:trusty
RUN apt-get -y update && apt-get -y install opam aspcud && opam init -y
RUN apt-get install -y m4 libexpat1-dev libgtk2.0-dev
RUN opam install -y ocamleditorCurrently the only active developer (according to logs) is the original creator of the project, while the project has potential to be maintained by the community.
Add to it a native graphics support for OS X, a decent documentation and suddenly you have a dream IDE.