[ art / civ / cult / cyb / diy / drg / feels / layer / lit / λ / q / r / sci / sec / tech / w / zzz ] archive provided by lainchan.jp

lainchan archive - /λ/ - 546



File: 1492696954248.png (5.26 KB, 300x282, logocaml-oreilly.gif)

No.546

FSharp versus OCaml?

Which do you prefer?

Mostly interested in the different feelings people have about writing the two, without mentioning their runtimes as much.

  No.548

F# is a subset of Ocaml. The reason F# was made is because their is no port of Ocaml to windows. I prefer SML to both.

  No.565

>>548 Why do you prefer SML?

Ocaml/F# are two completely different beasts nowadays, it's not fair to dismiss the differences between the two.

For instance, F# has indentation rules, "generics", no macros/functors and every time you write a library it's implied that you're supporting C# clients.

I definitely prefer writing OCaml. To me, when I write F# it feels foreign and uncomfortable (and the repl is like kicking dead whales down the beach) and I always wind up writing classes.

  No.588

OCaml + Core.

  No.595

File: 1492900380799.png (74.16 KB, 200x183, ocaml_is_what_your_mom_said_last_night1.jpg)

>>565
>Why do you prefer SML?
Not him, but I found this.
http://adam.chlipala.net/mlcomp/

  No.596

>>565
The the same guy too, but SML has proofs. It's the most academically studied ever (for formal proof), I think:
http://www.cs.cmu.edu/~dklee/tslf/

  No.605

>>565
>Why do you prefer SML?
(I am the guy to who youre referring)
Honestly there is not a huge difference that I have noticed between SML and Ocaml, but one thing that really bugged me right away was how Ocaml has separate math operators for floats:
3.7 +. 2.0
I know that may seem like a minor thing but in my opinion it really clutters up an otherwise very clean looking syntax considering how often simple math operators are used. The other thing that was immediately noticeable to me was how functions were defined. I'm not really proficient at either SML or Ocaml so I was hesitent to respond as I am really not knowledgable enough to give a good opinion on the difference between these dialects.

>>596
>but SML has proofs. It's the most academically studied ever (for formal proof)
The whole purpose for the ML language being invented was to do automated theorem proving. There was no standard language definition when ML was first invented so a bunch of dialects sprang up, Caml being just one of them. Afterward the SML language standard was made which became just another dialect rather than the standard which all dialects follow. So SML took ideas from all the existing dialects including Caml.

  No.611

>>605
I actually like that there are different operations for floats.

  No.613

>>611
I like it in that you dont have to declare explicit numeric types in function definitions like you do in SML, but still its very ugly syntax, they could have gone with keyword operators like:
2.3 plus 3.4

  No.699

>>605 Have you ever tried F#? The math functions can be overloaded afaik, do you ever use SML for the proofing?

  No.701

>>699
>Have you ever tried F#?
I dont use windows. And I am aware that F# can be used crossplatform on Mono but I dont believe that the Mono ecosystem is ever going to take off unless it gets more support from MS

The math functions can be overloaded afaik, do you ever use SML for the proofing?
The type checker in both SML and Ocaml are massively polymorphic and will check through inference that the type signature is exhaustive, that is, will make sure every possible input type is known at compile time. The price of overloading math operators in SML is that it cant be inferred at compile time so has to be explicitly declared.

And no I dont use SML for logic proving although I am currently learning mathematical logic. I would like to learn how logical proofs can be used in machine learning at some point but I probably am not smart enough to ever get to that level.

  No.710

>>699
>Have you ever tried F#?
I dont use windows. And I am aware that F# can be used crossplatform on Mono but I dont believe that the Mono ecosystem is ever going to take off unless it gets more support from MS

>The math functions can be overloaded afaik, do you ever use SML for the proofing?

The type checker in both SML and Ocaml are massively polymorphic and will check through inference that the type signature is exhaustive, that is, will make sure every possible input type is known at compile time. The price of overloading math operators in SML is that it cant be inferred at compile time so has to be explicitly declared.

And no I dont use SML for logic proving although I am currently learning mathematical logic. I would like to learn how logical proofs can be used in machine learning at some point but I probably am not smart enough to ever get to that level.