News for hackers. Stuff that matters.
Re:OCaml for the Masses (2011) by raphinou on Monday November 26, 2018 @07:01AM (#18532691)
I'm currently looking for the language and framework to use for a project, and I'd like to go with a functional language.

I really, really want to do my next project in Ocaml, but... I find the ecosystem seriously lacking. You find Ocaml libs for a lot of needs, but a lot of those a unmaintained and have their last commit a couple of years ago. I'm afraid that choosing Ocaml would mean spending quite some time on libraries I need, and less on the app I want to develop.

There's F# and the SAFE stack, but I don't feel home there. A lot of docs/libs still are (or have quirks due to having been) Windows specific, and joining the most popular f# community communication channels requires you to join the F# Software Foundation....

Then there's Scala, with functional programming and access to Java's ecosystem. But I prefer the ML style of Ocaml and F#.

Re:OCaml for the Masses (2011) by yodsanklai on Monday November 26, 2018 @07:20AM (#18532781)
Another issue with OCaml is that the community is small (although helpful). If you have very specific questions (esp. on more recent development), it may be hard to find help on Stack Overflow for instance.

Besides, the language has became quite complex: Monad-based concurrency and error handling, functors, objects, GADT, PPX... it's cool from a language point of view, but as a developer it can get overwhelming. You don't have to used all of this in your project, but still you may have to deal with existing code that is quite complex.

Re:OCaml for the Masses (2011) by progman on Monday November 26, 2018 @12:05PM (#18534780)
The people at https://discuss.ocaml.org/ are quite helpful.

> it's cool from a language point of view, but as a developer it can get overwhelming

If you consider OCaml's features overwhelming why don't you consider a much simpler language (Typescript etc.)?

I am learning OCaml myself right now, and I only use the features which I currently need. If I need more I will learn OCaml's suitable features then. Btw. I like OCaml, after having tested Haskell for a while. OCaml feels like a really practical usable "Haskell light". The compilation speed is outstanding (like LuaJiT).

Re:OCaml for the Masses (2011) by mamcx on Monday November 26, 2018 @09:07AM (#18533408)
I'm doing F# from 2 years ago ONLY on OSX. Use .NET core & xamarin currently. So far I can do a fairly complex project with dozen of external libraries, for iOS/Android/WebAPI with PostgreSQL, Sqlite. Deploy with docker on Ubuntu.

Today I say F# is good enough on *nix.

Also doing a little of Rust but the productivity with F# is far higher (you need to ramp up on Rust for a while!)

Re:OCaml for the Masses (2011) by christophilus on Monday November 26, 2018 @11:39AM (#18534558)
Last I checked, F# on Mac still requires mono for development, its repl is super janky, and its tooling is all over the map. Have things improved in those areas in the last year or so?
Re:OCaml for the Masses (2011) by mamcx on Monday November 26, 2018 @12:34PM (#18535095)
Mono is required, but all my libs are on .NET Core now, so is only as part of the deal. I use Visual Studio Mac.

The repl is not great, even on windows. F# is not the kind of language for a great repl experience, imho. I rarely use the repl anyway (the only one I use regulary is the python one)

Re:OCaml for the Masses (2011) by int_19h on Monday November 26, 2018 @05:23PM (#18537396)
Conversely, Windows does not look like a well-supported platform for OCaml (in fact, it looks worse now than it was a few years ago). There's no official Win32 package or installer; the website just directs you at third party ones. And you have a choice of an experimental OPAM build that requires Cygwin (and needs a forked repo to install packages from, that upstream package authors don't necessarily maintain), or OCPWin that is stuck at v4.01.

It's not an arrangement that inspires confidence - it feels like the community in general really doesn't care about Windows, and it's a few people trying to keep it afloat there - but if they step back, it won't keep.

Re:OCaml for the Masses (2011) by nestorD on Monday November 26, 2018 @07:25AM (#18532799)
My ML of choice is F#, I came from OCaml because I wanted better tools, librairies and an improved syntax.

The only place where I suffer from windows only librairies is UI and graphics in general (I don't do web developement so I cannot comment on that) otherwise developement on linux feels good (first via mono and now dotnet core).

Without the heaviness of dotnet (and, in particular, its project files), it would be perfect.

Re:OCaml for the Masses (2011) by baby on Monday November 26, 2018 @08:09PM (#18538429)
F# seems kind of not-friendly to the macOS environment. Looking at https://fsharp.org/use/mac/ it looks like you have to install a ton of things to get started. What about F*?

Now if I can get away from Ocaml's weird syntax, I think this is still a good deal.

Re:OCaml for the Masses (2011) by nestorD on Tuesday November 27, 2018 @01:55AM (#18540112)
I don't have a mac but it looks like incomplete documentation. Since Vs Code and dotnet core both works on Mac, you should be able to follow the linux instructions from these videos without changes : https://youtu.be/-uqbk0v7qxo?list=PLlzAi3ycg2x0TScJb7czq7-4L...

F* is intented for proofs, probably not what you want if you are looking for a general programming language.

Re:OCaml for the Masses (2011) by raphinou on Monday November 26, 2018 @07:31AM (#18532837)
As you have experience in both, are there Ocaml things you really miss in F#? How long are you developing in F# (and which type of apps if I may ask)?
Re:OCaml for the Masses (2011) by remify on Monday November 26, 2018 @07:40AM (#18532885)
FYI F# started as an OCaml implementation to .NET. It quickly evolved as an independent languages as it was easier to do, but a good part of it is straight up OCaml.
Re:OCaml for the Masses (2011) by nestorD on Monday November 26, 2018 @08:11AM (#18533046)
I have been using F# for data science, developing algorithms (where ML truly shines) and most of my scripting needs for 3 years now (it is not my main language as, these days, I need to instrument some C++).

As remify said F# came from Ocaml : it lacks modules, GADT and other thing but you can easily translate most Ocaml to F#. For me the syntax was a net win.

The thing I miss is the Graphics module of Ocaml's std. I used to build quick visualizations with it and I have not found a good F# equivalent that would run flawlessly on Linux (the relevant section of mono's std was very buggy the last time I tried using it).

Re:OCaml for the Masses (2011) by hardlianotion on Monday November 26, 2018 @03:07PM (#18536342)
But now there is no need to rely on Mono, right? Now that Microsoft has released dot net for other OS.
Re:OCaml for the Masses (2011) by nestorD on Monday November 26, 2018 @04:19PM (#18536895)
When the first version of dotnet core went out, parts of it such as system.drawing were just empty shells. Nowadays dotnet core is all you need (happily F# seems to be developed first and foremost by the community and not by Microsoft).
Re:OCaml for the Masses (2011) by gabipurcaru on Monday November 26, 2018 @07:07AM (#18532721)
> You find Ocaml libs for a lot of needs, but a lot of those a unmaintained and have their last commit a couple of years ago.

Not sure what issues you ran into, but this isn't necessarily a bad thing. I had a similar experience with Elixir, where some libraries had been last touched two years ago, but did the job with no issues whatsoever.

Re:OCaml for the Masses (2011) by donatj on Monday November 26, 2018 @07:30AM (#18532832)
This is something I see and feel often. If something is untouched, that doesn’t mean it’s broken or for that matter unmaintained. It can simply mean it was simply done correctly from the get go. Think of code as a formula, how many formulas are there that haven’t been touched in hundreds of years, due to the fact that they are correct.

The desire for libraries that are constantly in flux stems from the “move fast and break things” mentality, mixed with the continuous flow of breakage in mutable languages. If you move slow and do things well, you can often build some reliable with a fraction of the effort.

Re:OCaml for the Masses (2011) by thrower123 on Monday November 26, 2018 @07:42AM (#18532899)
I would agree. I'm happier using a stable, rarely changing library than something that is in constant flux and changing every week. Really, that kind of breakneck pace signals to me that people are just throwing stuff at the wall to see what sticks, and reduces my confidence in the quality of the product...
Re:OCaml for the Masses (2011) by raphinou on Monday November 26, 2018 @07:19AM (#18532772)
Well, one example is oauth in ocaml. I find this https://github.com/jaked/ooauth but it has an open issue from 2013 titled "Fix compilation on recent ocamlnet, gcc".

I have the feeling I encounter a lot of these situations when I look at libraries I would need for a project. It's rather uncommon I see a very active project in Ocaml (even if there are some indeed).

Re:OCaml for the Masses (2011) by Barrin92 on Monday November 26, 2018 @07:12PM (#18538041)
Give clojure a shot. It's mature, expressive and you have access to the JVM.