3 ms·
> More controversially, I think that modules are a worse solution in practice than typeclasses / traits. If by controversial, you mean wrong we are in agreemen
by WastingMyTime89 4y ago
> More controversially, I think that modules are a worse solution in practice than typeclasses / traits.
If by controversial, you mean wrong we are in agreement. Modules are both conceptually simpler and easier to use in practice. They also produce far better error messages.
I personally find Ocaml tooling far better than Haskell. The debugger is a lot nicer. The compiler is considerably faster, doesn’t rely as much on extension and generally gives better error messages. VSCode integration does everything I want and is easy to install.
For what it’s worth you are the first person I meet complaining about syntax error. What people complain about are type checking errors which are indeed hard to understand sometimes. Syntax errors are caught well by the parser which tells you exactly where they are. I don’t really understand what you are complaining about.
- xavxav 4y agoI'll try to find an example of the syntax error I was mentioning, but I regularly trip up the parser with dumb mistakes which cause it to give completely useless errors. > Syntax errors are caught well by the parser which tells you exactly where they are. They aren't necessarily caused where the actual error is, just wherever the parser gets stuck, and the error it produces is usually not reflective of the human thought process that went in, but rather the automata's state.
- yawaramin 4y agoWould be interesting to see such an error, but also what's interesting to me is that you are regularly making 'dumb' syntax mistakes, which suggests to me that you're still in the learning process and that you'll internalize the syntax more fully and stop making those mistakes some time in the future.
- xavxav 4y agoNot really, it's more that I regularly make typos in all forms of writing (even handwritten). It's not usually misspellings but rather whole lexemes that go missing or are swapped. fwiw, I TA a course taught (partially) in OCaml and work regularly with a large OCaml project as part of my thesis. Parser generator errors are just a personal pet peeve of mine, I grew up with (mega)parsec (Haskell), where decent errors are out-of-the-box and great ones are easy.
- belmont_sup 4y agoPartially agree here with the syntax error thread in that it’s mildly annoying to lose intellisense when you’re declaring a new variable before the “in” keyword is in place. But that’s about the only time I commonly see syntax errors.