Hacker News new | ask | show | jobs
by gsastry 4154 days ago
I wish a language with advanced types like Haskell or OCaml would have the same tooling and ease of distribution around it that Go does. I haven't built anything in Haskell/ML in a while, so if anyone has any updates on this please chime in.
5 comments

OCaml is usually statically compiled with ocamlopt, so distribution is pretty easy. As long as build/deploy platforms match, then you're good to go. Shared libraries only come into the picture for unusual cases, eg FFI.

OCaml tooling has also gotten a lot better over the past few years, mainly because of OPAM. The library count has exploded, and the language still gets regular point-releases with improvements designed to aid tooling, such as extension points.

The last serious project I tried to do with OCaml (maybe 4 months ago) was impeded by a ton of dependency problems (this library in OPAM says it depends on this other library, but it doesn't compile because the latter has changed; this dependency won't build in OCaml version .X but another one won't build in .X-1) and ecosystem sparseness (two partially-complete, years-old libraries to do the same thing, etc.). I was eventually stopped in my tracks by an impressively opaque camlp4 error.

(My favorite example is when in #ocaml I asked what testing tools people used; the most positive answer was along the lines of "there's OUnit, but I don't know anything about it".)

There seems to be three awkwardly coexisting OCaml communities: the old academic crowd, the Jane Street people, and a crowd of clueless newbies like myself. It's a really great language, but the ecosystem is going through some growing pains right now.

You may wish to explore Rust - http://www.rust-lang.org/. I can't speak to tooling but it has advanced typing and ease of distribution seems similar to Go.

Edit: mea culpa for my attempt at tongue-in-cheek humor, "I think that's called Rust - http://www.rust-lang.org/"

Rust's type system is definitely more robust than Go's, however it's also a different language and different philosophy. Go was created to be easy to read and easy to write, which is mirrored in the language (e.g. no generics). Rust is more complex, which might be a factor when deciding between Go and Rust. Plus it does not have the same adoption in the industry as Go.
No argument here. OP specifically mentioned advanced typing, tooling, and distribution. Rust covers at least two out of the three (can't speak to tooling) so I thought OP might like to explore it a bit.
>I wish a language with advanced types like Haskell or OCaml would have the same tooling and ease of distribution around it that Go does.

I love the philosophy behind Go and enjoy coding in the language, and the tooling is a major part what makes development in Go such a breeze. Go seems to be consistently praised for its tooling and I suspect the developers of other languages are paying attention.

Having said that, I do wish Go 1.4 retained the Vim plugin that was bundled with the earlier distributions. I've had nothing but trouble setting up vim-go and its myriad of dependencies on Windows. The process was so easy before.

OCaml does have opam (package manager), ocp-indent (a code formatting backend), merlin (a code formatting front-end for Emacs, Vim and Acme), a REPL, a byte code compiler, a native code compiler, a debugger that supports stepping backwards, can integrate with gprof, has ocamllex for building scanners, merlin for building LR(1) parsers, etc. And OCaml's been gaining speed in the past years, so there's a lot of nice things to see there.
Yea, I really like GADT too much to give it up. With Swift/Haxe/Rust/Haskell/F# all having them.

You may find this interesting, someone implemented a parsec-like library in Go [1]. I haven't wrapped my head around it completely, but it looks like it's all dynamic [2].

[1] https://godoc.org/github.com/prataprc/goparsec [2] https://github.com/prataprc/goparsec/blob/master/json/json.g...

Are you sure GADTs are possible in Swift and F#? I haven't seen what syntax supports that in those languages. Do you just mean Discriminated Unions (i.e. ADTs). There is a difference between GADT and ADT.
You can use this (https://halcyon.sh) for Haskell. Still not the same though.