Hacker News new | ask | show | jobs
by rkangel 2470 days ago
Have you looked at ReasonML/OCaml? It certainly compiles well for web (bucklescript) and desktop. I haven't tried it for mobile but I would be surprised if it didn't work well.

The ReasonML native tooling (i.e. non-web) is evolving, but it's fundamentally sugar on top of a long solid history of OCaml.

1 comments

I'd love to have ML expressiveness. The only thing i'm a bit worried about is the I/O abstraction level.

I'm not really looking for a GUI abstraction layer, but i'd like to be able to write to a file, or perform a network request, in a platform-independant way. I'm afraid this requires a little bit more than just a javascript transpiler target.

Reasonml is just an alternative syntax for ocaml so you can definitely use it for IO.

It's bucklescript that is an alternative backend for the ocaml compiler which allows you to output js, but you don't need to use it

That's where my understanding of compiler / Operating system / standard library falls a bit short.

I suppose the full ocaml standard library isn't available when you compile your code to native iOS or native Android, is it ?

I mean, iOS and and Android are probably not POSX compliant. File system and networking access have very specific constraints, that are way different than your regular server. At least that my feeling whenever i code in iOS. Your application needs to whitelist URLs in a plist, you need to work with foreground / background states (eg timer are paused when in background). I can't imagine that the standard ocaml library doesn't need adaptation to run in those environment.

Am i wrong ?