News for hackers. Stuff that matters.
Re:A Fresh Look at Rust by zem on Tuesday September 30, 2014 @11:00PM (#8392608)
you might also like ocaml as a higher-level language with a lot of the same features.
Re:A Fresh Look at Rust by mercurial on Wednesday October 01, 2014 @02:21AM (#8393094)
Yes. Rust borrows quite a few things from the ML family of languages (and things unique to Haskell like "deriving"). OCaml has the advantage of offering very good performance while not having to deal with the borrow checker, but it doesn't have the momentum behind Rust (the community is quite small, and the number of libraries isn't that large). That said, it is a very nice language to work with, and offers a number of features absent from Rust, such as a great module system, structural typing, first-class laziness...
Re:A Fresh Look at Rust by stock_toaster on Wednesday October 01, 2014 @03:53AM (#8393276)

  > OCaml has the advantage of offering very good performance
  > while not having to deal with the borrow checker
My understanding was that OCaml had no support for parallelism -- so a single core is all you get. Is that not the case?
Re:A Fresh Look at Rust by masklinn on Wednesday October 01, 2014 @04:40AM (#8393384)
OCaml does have concurrency and parallelism support, but it has a GIL so their effectiveness is somewhat limited unless you go multiprocess.

I believe there are serious efforts towards removing the GIL these days.

Re:A Fresh Look at Rust by pjmlp on Wednesday October 01, 2014 @04:40AM (#8393383)
No. It does support parallelism and concurrency.

The biggest issue is that the runtime still has a global lock, but it is in the process of being removed.

Re:A Fresh Look at Rust by mercurial on Wednesday October 01, 2014 @04:38AM (#8393378)
That's true, though through Lwt (and Core.Async) it has good support for concurrency. However, the work on the parallel runtime seems to progressing at a steady pace, so parallelism is coming.
Re:A Fresh Look at Rust by stock_toaster on Wednesday October 01, 2014 @04:41AM (#8393386)
Ah. Thanks for the info!
Re:A Fresh Look at Rust by pjmlp on Wednesday October 01, 2014 @04:37AM (#8393374)
> but it doesn't have the momentum behind Rust (the community is quite small, and the number of libraries isn't that large)

How come, given the amount of use it gets in the industry and academia versus Rust that still hasn't reached 1.0?

Re:A Fresh Look at Rust by mercurial on Wednesday October 01, 2014 @05:36AM (#8393519)
That's a good question. I think F# and Haskell have stolen a fair amount of OCaml's thunder. Meanwhile, Rust caters to everybody who is tired of C/C++ (putting D in the same position as OCaml, I guess?), while having nice enough constructs that people coming from high-level languages get interested in it. By contrast, OCaml doesn't have the "shiny new" feeling of Rust (also suffers from other issues, such as its standard library/libraries, and the tooling, and the "mlis are documentation" attitude that is fairly prevalent in the community). I'd say with more polish and a lot of marketing, it could easily gain more market share (even though some things have gotten much better since opam).

Sometimes, working in OCaml feels like flying a starship equipped with XVIIIth century cannons. The awesomeness of many of its features is in stark contrast to the gaping holes of its ecosystem (no good INI parsing library in 2014? no usable pure OCaml regexp library?).

Re:A Fresh Look at Rust by swah on Wednesday October 01, 2014 @08:00AM (#8393853)
Does OCaml still doesn't compile 1.0 + 2.0 or has that changed?

Small stuff like this really bother some people and they fly off to Pythonland never to be seen again.

Re:A Fresh Look at Rust by pjmlp on Wednesday October 01, 2014 @08:51AM (#8394011)
I guess it depends on the nature of the work being done.

Personally I never used Python for anything other than glorified shell scripts and Websphere installations (after Jacl got replaced by Jython).

For everything else I prefer languages with type inference and availability of native compilers (AOT/JIT) in their toolchains.

How good is PyPy for production code nowadays?

Re:A Fresh Look at Rust by DasIch on Wednesday October 01, 2014 @11:22AM (#8395144)
> How good is PyPy for production code nowadays?

Unless you are using CPython extensions, PyPy is usable as a drop-in replacement that's significantly faster in almost all cases. In order to notice any significant speed gain, the JIT needs a chance to "warm up" though, so on short running applications or on web applications for the first couple of requests PyPy can be slower than CPython.

Re:A Fresh Look at Rust by mercurial on Wednesday October 01, 2014 @08:43AM (#8393987)
> Does OCaml still doesn't compile 1.0 + 2.0 or has that changed?

I'm not quite sure what you mean? In any case, the compilation speed isn't really an issue (especially since we're talking about Rust, which last time I used it wasn't exactly fast).

Re:A Fresh Look at Rust by bam365 on Wednesday October 01, 2014 @09:36AM (#8394189)
He's probably referring to the fact that you have to use different arithmetic operators for int and float in OCaml, so it would have to be 1.0 +. 2.0
Re:A Fresh Look at Rust by mercurial on Wednesday October 01, 2014 @10:00AM (#8394315)
Ah, that makes sense. It's still the case, but I guess it may be going away once implicits are released.
Re:A Fresh Look at Rust by edorrington on Wednesday October 01, 2014 @09:47AM (#8394237)
I think he's talking about the fact that OCaml has separate operators for floating point (i.e. in his example, you'd use 1.0 +. 2.0).
Re:A Fresh Look at Rust by swah on Wednesday October 01, 2014 @06:24PM (#8398190)
Yep, that's <float><int><float> and doesn't typecheck since you missed it too, my point is made :)
Re:A Fresh Look at Rust by mercurial on Thursday October 02, 2014 @12:51AM (#8399473)
Yeah. Honestly it's a quirk, but I prefer quirks going this way than the other way (like universal compare). That said, all languages have warts. And that's the best kind of warts, the one that is explicit and happens at compile-time.
Re:A Fresh Look at Rust by swah on Thursday October 02, 2014 @07:22AM (#8400258)
Good point. And to be honest, OCaml was the first language I used to have insanely fast compile times - and a REPL!
Re:A Fresh Look at Rust by scardine on Wednesday October 01, 2014 @02:03PM (#8396469)
I think most ML implementations still have poor support for unicode, and this is a killer feature for me.