Hacker News new | past | comments | ask | show | jobs | submit login

I have a project that uses it, Meh. when people use Camlp4, it's a pain to read, the stuff is had to follow when it's a wall of text because of the level of indirection, Lwt makes everything hard.

When I was 20, I thought Ocaml was the best thing in the world, because I was writing it. Now, after years without using it, I have to maintain other people's code, my opinion changed.




I use ocaml daily for work - our core product is written in it. We actively avoid anything that deviates from the base language for reasons of clarity. No camlp4, no lwt, no fanciness other than some of the batteries libraries that improve on the std library. It does occasionally mean we type in more than we would if, say, we used extensions to give us Haskell-like do notation for monadic code, but at the end of the day we err on the side of being very conservative.


That's pretty much how we wrote the virt tools[1], basically we rely on the OCaml compiler, findlib, and not much else.

[1] https://github.com/libguestfs/libguestfs


Wow.

I had not seen your project before and this looks exactly like the right hammer for a problem I needed to hit a week or so go.


Just wanted to point out that Camlp4 has been deprecated for a long time and replaced by the extension points mechanism.


Isn't PPX supposed to replace Camlp4?


I think so. See https://discuss.ocaml.org/t/is-camlp4-being-deprecated-in-fa...

I recently came back to OCaml (and js_of_ocaml) after being away for a few years. In the time I was gone, js_of_ocaml moved from camlp4 to ppx.

(edited to fix link)


It doesn't change the issue that when people have changed the grammar, you have to find their documentation to read their code, if the library is not used you have to read the parse tree transformation code, etc.


I see, your problem is the new grammar. I have never used OCaml with these features so I wasn't aware of this. Good to know.


The answer is not to use camlp4 or ppx, then, or at least limit it to a very very conservative level.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: