Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I am vaguely familiar with ALGOL but have never used it before. Do I need to put down OCaml and learn ALGOL first in order for my syntax complaints to be well-justified?

Your syntax complaints will never be well-justified. It’s just a syntax family you are unfamiliar with, not an actual downside. You can either put up with it or change language. The syntax is however in no way inferior to C style syntax because that’s what you are used to.

> I am doing this now, as I stated in the article. Compare against Rust's strictness, where bad ideas like not annotating function signatures are not allowed.

There is no point in forcing you. The language doesn’t need to be strict. You can do whatever you want with your type annotation. It works just fine when you do annotate but no one is putting a gun to your head to do so if you just need a quick script. Best of both worlds.

> You have to put enum types in separate modules otherwise they will step on each other.

You do but it’s entirely normal and expected to define a new module inside your file in Ocaml and "let open" or assigning module is a common construct. It’s expected that you will not dump everything directly in scope.

> The part that I don't understand is why OCaml wants to be like C with these tools in the first place. These tools exist in C because C doesn't have match statements, but OCaml does. What gives?

They exist because generating parsers and lexers are nice and no one wants to learn a new language when they already know yacc and lex.

> ppx_show is an external library. Imagine having such a cucked stdlib that you have to call to an external library to print

No need to be vulgar. Ocaml has a lean standard library. That’s how the language is. You want macro and derivations you import them. They exist. Everybody uses them. The comment is a bit rich coming from someone who likes Rust.





> Your syntax complaints will never be well-justified. It’s just a syntax family you are unfamiliar with, not an actual downside. You can either put up with it or change language. The syntax is however in no way inferior to C style syntax because that’s what you are used to.

I think match statements should have an explicit `end` terminator or something so that you can nest them naturally. I think errors from accidental partial function application could be clearer. I think those two are pretty objective.

In terms of my subjective opinion the punctuation of C-style makes code hierarchy more clear, but at the cost of making it read less fluidly. I also think that `let...in` is weird and that Rust straddles a nice middle ground here by not having it but still having everything be an expression.

I like strict languages, and I like Rust for its strictness and robustness. I don’t like its standard library though, I wish it was more batteries included.


> I think match statements should have an explicit `end` terminator or something so that you can nest them naturally.

It’s unneeded.

You can explicitly delimit any expression in Ocaml by using begin … end or parentheses. It works for everything including match statements which are expressions. So you are already free to use an explicit end statement if you are so inclined.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: