News for hackers. Stuff that matters.
Re:So you're learning OCaml by iopq on Tuesday October 20, 2015 @01:52AM (#10417647)
Yes, I'm learning an OCaml dialect. It's called Rust, it's really interesting, you should take a look at it.
Re:So you're learning OCaml by yokohummer7 on Tuesday October 20, 2015 @04:36AM (#10418078)
I feel embarrassed while reading your comment as a Rust proponent... Promoting Rust is great at times, but this particular article doesn't really have anything related to Rust. It is true that Rust was much influenced by OCaml, but the influence is not to a degree of calling it a "dialect". I'd say F# is much more likely a dialect of OCaml.
Re:So you're learning OCaml by placeybordeaux on Tuesday October 20, 2015 @02:11AM (#10417688)
Is there a good reason to say that Rust is an OCaml dialect?
Re:So you're learning OCaml by jk4930 on Tuesday October 20, 2015 @02:19AM (#10417712)
I'd describe it more as uglyfied Haskell, but anyway: http://science.raphael.poss.name/rust-for-functional-program...
Re:So you're learning OCaml by bsummer4 on Tuesday October 20, 2015 @01:24PM (#10420488)
It really doesn't have that much in common with Haskell either. It's designed by people who are not oblivious about PL stuff, but it's still pretty thoroughly in the C/C++ world in terms of both syntax and semantics.

It's not a bad thing, but Rust has very little in common with Haskell/Ocaml; aside from stealing a couple of good ideas.

Re:So you're learning OCaml by FreeFull on Tuesday October 20, 2015 @06:50PM (#10422391)
I would say Rust's type system has a lot more in common with Haskell/Ocaml than with C++, at least, although it's not quite as flexible as what Haskell offers (a lack of HKT is painful sometimes).
Re:So you're learning OCaml by bsummer4 on Thursday October 22, 2015 @04:59AM (#10431148)
I think the similarities are mostly superficial. I mean it has (local) type inference, ADTs, and traits (which are sooooorta like type classes). But, as a Haskell programmer, the Rust type system feels very foreign.

No typeclasses (and associated goodness), GADTs, HKTs, Monadic IO, first class functions, generic deriving, higher rank types, existential type, etc. These are bread-and-butter features in day-to-day Haskell work. Rust's type system isn't powerful enough to build the vast majority of the tools that Haskell programmers use every day.

I don't mean this as a criticism; The Rust design seems solid. But different priorities lead to different trade-offs, and the end result is a very different type system.

Re:So you're learning OCaml by dbaupp on Thursday October 22, 2015 @11:39AM (#10432820)
Traits do a lot of what one can do with typeclasses (they're mostly just different names for the same thing), what differences are you thinking of?

Also, traits objects are existential types, and closures & functions are as first class as they are in Haskell (main difference is a bit more verbosity).

Re:So you're learning OCaml by dkarapetyan on Tuesday October 20, 2015 @02:16AM (#10417696)
No more than saying Erlang is a lisp dialect.
Re:So you're learning OCaml by fermigier on Tuesday October 20, 2015 @02:39AM (#10417759)
Re:So you're learning OCaml by sampo on Tuesday October 20, 2015 @03:40AM (#10417911)
> Is there a good reason to say that Rust is an OCaml dialect?

There is, maybe, grounds to say that all languages with S-expressions, first class functions and garbage collection are just a type of lisp.

But I would not say that all languages with strong static typing, some form of type inference, algebraic data types, patterns matching and functional programming features, are a dialect or OCaml, or ML.

Re:So you're learning OCaml by iopq on Wednesday October 21, 2015 @12:29PM (#10426541)
It has algebraic data types, type inference, closures, pattern matching.

Haskell has these too, but it has more stuff like more emphasis on immutability and purity unlike Rust and OCaml.

Also, the first Rust compiler was written in OCaml.

Re:So you're learning OCaml by zem on Tuesday October 20, 2015 @04:35AM (#10418075)
waiting for the "rust is an acceptable ml" blogposts!
Re:So you're learning OCaml by issaria on Tuesday October 20, 2015 @06:27AM (#10418368)
Ah, I'm currently learn some ruby/java/c/haskell/go/erlang/javascript, should I learn the Rust dialect instead?
Re:So you're learning OCaml by technomancy on Tuesday October 20, 2015 @02:26AM (#10417733)
Have fun spoon feeding those type annotations!