3 ms·
I first started using ocaml (f# actually and then re-wrote it in ocaml) for writing a simple interpreter to generate java code from mysql schema tables to deal
by haxeny1 11y ago
I first started using ocaml (f# actually and then re-wrote it in ocaml) for writing a simple interpreter to generate java code from mysql schema tables to deal with hibernate boiler plates etc. The code was much succinct than a comparable parser written in say antlr. That was my first introduction to typesafety helping me move forward. Specially, when coming back to the code, the compiler will scream at you for either not handling all the patterns that matched or adding new ones that didnt exist yet and needed to be changed.
I went away from OCAML towards Haskell because a coworker convinced me to switch: also haskell seems to have a better support for multicore architectures. Of course, my applications are more web/networking apps, crud, websites etc. So i could have gone either way. The one difference i find when programming with Haskell as opposed to ocaml is that in ocaml, my instinct would be to write a little interpreter(or a quasi quoter). In Haskell, I still think that template haskell is a necessary evil, therefore, do it only when I really know what I am doing.
I found this link to be quite helpful: http://pleac.sourceforge.net/pleac_ocaml/ http://pleac.sourceforge.net/pleac_ocaml/
- agumonkey 11y agoReading the pleac pages, it's amazing how javascript is getting close and closer to ml. It's all going back to its roots since js was quite {scheme} so it's not that surprising but still a joy to see. Module.foo (fun (x,y) -> ...) ...
- rubiquity 11y agoJavaScript and ML couldn't be further apart.
- agumonkey 11y agoThere still far away from each other but js is getting closer. Emphasis on functions, proper scoping, patterns for bindings, IIRC TCO is in ES6, even if it's a small step is already a huge one. It's still not a typed calculus, but types will be mainstream soon. my 2 cts bet.