5 ms·
I've always been curious about F#. Is it true that the F# compiler can be super slow especially on larger codebases? I always wonder: why use F# when you can u
by sidkshatriya 6y ago
I've always been curious about F#. Is it true that the F# compiler can be super slow especially on larger codebases?
I always wonder: why use F# when you can use OCaml? OCaml has pretty decent third party libraries...
(Yes multicore support in F# would be a good reason but apart from that)
- dunefox 6y ago> why use F# when you can use OCaml? I have looked at both without any prior experience in them and OCAML tooling is horrible. Also, with no support for unicode in Ocaml, F# is just much better in this regard - even if it lacks modules, functors, etc.
- sidkshatriya 6y ago> OCAML tooling is horrible This is the old view. In 2020 OCaml tooling, if I may be brave to say so, is excellent. Check out the triumvirate of dune (build), opam (external dependencies) and ocaml-lsp (IDE smarts). P.S. ocaml-lsp uses merlin in the backend (ignore that if you are not familiar with merlin).
- StreamBright 6y agoI just spent 2 hours on this excellent tooling to try to upgrade a package with opam, I finally gave up after read all the Github issues and Stackoverflow, etc.
- dunefox 6y agoI spent two evenings (3 years ago, admittedly) to get the tooling setup so that I could install libraries. I got nowhere and gave up. I'm quite interested in the language but everything else seems to be a dumpsterfire.
- dunefox 6y agoI just tried it again, everything (m4, dune, opam, ocaml-lsp) installed just fine; then I created a simple hello world project (Quick start guide: https://dune.readthedocs.io/en/latest/quick-start.html https://dune.readthedocs.io/en/latest/quick-start.html) and I could compile and run it. Oh, how things appear to have changed.
- dtbx 6y agoYou can use camomile library to handle unicode strings, count code points, perform locale aware lowercase / uppercase, etc For utf8 regexes, you can use Pcre in ocaml, which is faster than camomile regexes.
- fredrikholm 6y agoIn my experience it isn't much worse than equivalent C# solutions, perhaps a fraction slower. Having .NET CORE as a foundation means that whatever improvement the platform gets, F# gets. This means that not only gets to interop with all the NET frameworks and such (good or bad), but also enjoy the massive performance improvements that's been going into CORE lately (compared to old NET).
- bonthron 6y agoIf you're already doing C#, then it's easy to start using F#. You probably are using VS Studio/Code, you already know the standard .NET libraries. etc.. F# is a little weird because there are accommodations to ensure it will interop with C#. But it is fun.
- the_only_law 6y agoCan someone describe to me what is good about OCaml? Unfortunately I think I've only eve heard complaints about it, many being mentioned here (multicore support, bad tooling, things like utf support you'd expect to be built in, Windows pains, etc.). I've also read a number of admittedly older peices criticizing it's type system among other things. When or why should someone consider using OCaml versus a lisp, modern mainstream languahes or even a purely functional language like Haskell?
- guenthert 6y agoSafer, more expressive than C, easier, saner than C++?
- StreamBright 6y ago> Is it true that the F# compiler can be super slow especially on larger codebases? Define slow. I never had an issues with the compilation speed of F#. > why use F# when you can use OCaml? Even though both of them are in the same family they could not be further away from each other. OCaml has many standard libraries more you can read here: https://discuss.ocaml.org/t/what-is-the-preferable-solution-for-the-role-of-standard-library/1092 https://discuss.ocaml.org/t/what-is-the-preferable-solution-... F# has (almost) everything that is available in the CLR, which means tons of high quality libraries, ready to be used in production. Another advantage is AWS support. Since C# is a tier one language in the cloud F# is also a tier one language. I am not sure where OCaml falls into in this space. Other than these I am not sure why, but these are pretty big ones for us. I love OCaml and trying to use it whenever I can, which is not that much unfortunately.
- sk2020 6y agoYou use F# because your use case requires .NET. You can’t write AutoDesk plugins in OCAML, or at least I’ve never heard of that happening. Sometimes you don’t actually have meaningful alternative programming languages for certain uses.