News for hackers. Stuff that matters.
Re:Introduction to Functional Programming in OCaml by BeetleB on Thursday August 23, 2018 @11:10AM (#17827886)
Sorry to hijack the thread:

I recently was trying to decide which language to pick up next: Lisp, OCaml, F# or Haskell (I know a bit of Lisp and Haskell already, as well as some Standard ML).

It came down to two: OCaml and F#. The former has poor support in Windows (work machine), and the latter has less poor support in Linux (home machine). So I decided I'll probably go with F#. I've been told the syntax is quite similar, so how difficult is it to translate an F# program to OCaml. Are all the patterns the same that one can do a more or less 1:1 translation while still being canonical?

Re:Introduction to Functional Programming in OCaml by nestorD on Thursday August 23, 2018 @11:43AM (#17828181)
Going from Ocaml to F# is trivial, most of the time it is only a matter of adjusting the indentation and getting the correct name from the std. Going from F# to Ocaml tend to be harder since F# has a number of functionalities that are often used and do not exist in Ocaml (such as parallelism, sequences, active pattern, list comprehension, type providers, etc and a much bigger std). As a user of F# on linux, the experience is good (better than Ocaml on linux) and getting better every year (some library are still windows only but it is changing).
Re:Introduction to Functional Programming in OCaml by ernst_klim on Friday August 24, 2018 @07:21AM (#17834218)
>Going from F# to Ocaml tend to be harder since F# has a number of functionalities that are often used and do not exist in Ocaml (such as parallelism, sequences, active pattern, list comprehension, type providers, etc and a much bigger std)

The opposite is also true, F# does not have ppx, OCaml's object system, GADTs, polymorphic variants, functors, first class modules, extendable variants.

Re:Introduction to Functional Programming in OCaml by BeetleB on Thursday August 23, 2018 @02:07PM (#17829388)
Better than OCaml on Linux or Ocaml on Windows? If it's better than OCaml on Linux, that would be impressive.
Re:Introduction to Functional Programming in OCaml by waluigi on Thursday August 23, 2018 @12:32PM (#17828598)
F#'s object model is very different from OCaml's. F# is basically the same as C# when it comes to objects, but OCaml has some sense of structural subtyping that F# lacks. On top of that, OCaml has a very powerful module system, whereas F# has a pretty standard one.

On the other hand, F# has computation expressions (essentially extensible syntax sugar for certain kinds of operations), as well some nice extensions to the pattern match system.

That's not to say one is exactly better than the other, they just focus on doing different things.

Re:Introduction to Functional Programming in OCaml by phillipcarter on Thursday August 23, 2018 @12:13PM (#17828456)
Have you tried F# on .NET Core? There are plenty of people using it exclusively on Linux (both to develop and as a deployment target).