News for hackers. Stuff that matters.
Re:OCaml Compiler Hacking: how to add a primitive by lmm on Thursday August 06, 2015 @04:22PM (#10019158)
It's a good language but I really struggle to see why you'd choose it over Haskell. You may not need the fancier types yet, but in Haskell they'll be there for when you do, whereas in OCaml you reach the infuriating position where you know exactly what you want to do but you can't quite express it in this language without repeating yourself several times over. I guess if you've never used higher-kinded types maybe you don't miss them?

/Scala myself, but that's a slightly different niche.

Re:OCaml Compiler Hacking: how to add a primitive by ufo on Thursday August 06, 2015 @09:18PM (#10020456)
Things I like for Ocaml over Haskell:

* Predictable performance; No need to worry about space leaks. * The module system is pretty nice. * Named/optional function parameters. * Being able to write filthy imperative code without needing to use monads for everything. :)

Re:OCaml Compiler Hacking: how to add a primitive by nickpsecurity on Thursday August 06, 2015 @05:23PM (#10019549)
There's at least one financial firm that chose Haskell and presented good results from it. Galois works miracles with Haskell left and right. So, there's a slow build-up of momentum in that direction. I'm hesitant to use it due to the learning curve. I have a feeling I could probably get productive in Ocaml faster than in Haskell. I figure I would learn them in that order.

Not sure if that's true as I use neither and only did minimal functional programming in LISP. I mostly do an imperative style along lines of Cleanroom methodology. I'd like to hear veterans' opinions as to whether Ocaml's learning curve would be easier on imperative programmers than Haskell.

Re:OCaml Compiler Hacking: how to add a primitive by thoughtpolice on Thursday August 06, 2015 @07:48PM (#10020210)
You'll probably be fine either way, IMO - OCaml has a lot going for it, it's fast and incredibly quick to compile, and has a pretty straightforward execution model. Haskell is not quite the same (different evaluation strategy, different ways of organizing your programs), so there's a bit of associated overhead there, and for a beginner it can appear daunting.

The most important part of these languages is really how they try to enhance your abilities to write modular programs. You might be surprised to find out languages from the 1970s and 1980s have better abstractions (e.g. functors/modules) than some designed today. :)

But fundamentally I think some of it will come down to personal choice and aesthetics at some level; e.g. I really like Haskell's syntax (principled, block structured with no semicolons) and I really like laziness in general, because it makes it really easy to 'float out' and refactor code. OCaml has a much better module system, a very fast compiler, and is very well designed and thought out IMO. None of those are dealbreakers - it's just a matter of picking your poison.

Re:OCaml Compiler Hacking: how to add a primitive by nickpsecurity on Friday August 07, 2015 @12:22AM (#10020926)
Appreciate the insight. This one line though...

"You might be surprised to find out languages from the 1970s and 1980s have better abstractions (e.g. functors/modules) than some designed today. :)"

...is uniquely appropriate as I've been amazed by and posted so much old work on forums that there's little that surprise me. Far as abstractions, I think Ten15 (below) was most interesting I found given its potential as an integrator. Burroughs Architecture, IBM System/38, Wirth's layered design of Lilith, Genera LISP's developer flow... the best attributes of these still haven't been matched imho by modern work. Still worth remembering and factoring into one's next project if possible.

http://www.mca-ltd.com/martin/Ten15/introduction.html

Re:OCaml Compiler Hacking: how to add a primitive by lpw25 on Thursday August 06, 2015 @04:45PM (#10019331)
Functors => higher-kinded types
Re:OCaml Compiler Hacking: how to add a primitive by vegabook on Thursday August 06, 2015 @04:59PM (#10019412)
yeah but I'm dead scared of the stories I've heard about indeterminate execution time in certain cases. For my real-time production use case this would be a deal breaker. Am I misguided?
Re:OCaml Compiler Hacking: how to add a primitive by lmm on Saturday August 08, 2015 @07:01PM (#10028909)
It's a risk - but then it's a risk in OCaml too. How real-time are we talking? I've seen Haskell used in videoconferencing and it performed very well.