4 ms·
F# has added some new features on top of OCaml like: - Lightweight syntax - Active Patterns to extend pattern matching - Type Providers to make it easy to inter
by davidgl 9y ago
F# has added some new features on top of OCaml like:
- Lightweight syntax
- Active Patterns to extend pattern matching
- Type Providers to make it easy to interact with json/sql in a type safe way
It's a joy to work in
https://stackoverflow.com/questions/179492/f-changes-to-ocaml#2485277 https://stackoverflow.com/questions/179492/f-changes-to-ocam...
- nv-vn 9y agoF#'s features don't feel that useful after working in OCaml though. I've tried it for various projects, but OCaml is honestly just as good in all those situations. I wonder if there's some specific type of project where F#'s features will really shine.
- mercurial 9y agoI can imagine the .NET interop is a big deal, especially if you need to do anything on Windows. Also, parallelism can be occasionally useful.
- nv-vn 9y agoYeah, I get that those are useful, but things like type providers or units of measure feel pretty useless to me and I'm not really sure if they're supposed to make me want to switch to F# or not. They certainly don't fill the place of OCaml's module system or object system or GADTs, PPXes, polymorphic variants, etc. To me OCaml's abstractions feel much more polished/as if they were all invented to fill some existing hole in the language and work together (rather than some random "cherry on top" feature that doesn't fix anything for me and is rarely useful).
- pjmlp 9y agoWell, a big decision point is what one uses as main development platform. Sadly OCaml support on Windows is not great, to put it nicely.
- mercurial 9y agoOn the other hand, it may be possible to use F# on Linux with .NET Core now.
- mixedCase 9y agoTooling is definitely far from mature. It's treated as a second class language in .NET, and on top Linux is treated a second class OS. I just tried to start a project with F# and ended up abandoning, and am looking into Rust right now. I considered OCaml but its lack of multicore support and the ecosystem situation made me drop it.
- pjmlp 9y agoYou are kind of right. My point was that even as second class citizen on .NET, F# has more tooling and available libraries than OCaml ever will on Windows. For a long time OPAM did not support Windows, and right now cygwin or Linux subsystem still seem to be better ways than straight Win32 application support. OCaml is quite nice on *NIX systems, on other kind of OSes not so much.
- afrisch 9y agoOf course it feels less native than with F#, but we have created and used CSML (https://github.com/LexiFi/csml https://github.com/LexiFi/csml) specifically to allow our OCaml code base to interact with .NET.