Re:Ask HN: Blind programmers, what can I do to make my code ...
by beefhash on Sunday November 18, 2018 @06:48AM
(#18479925)
To be fair, C is kind of like that, too. You could move the declarations of static functions to the top, but then you'd still have declarations that prevent you from getting to the real meat.
Re:Ask HN: Blind programmers, what can I do to make my code ...
by akavel on Sunday November 18, 2018 @10:50AM
(#18480881)
That and poor/nonexistent syntax for macros are about my only 2 serious gripes I have with OCaml. The third was missing multithreading, but IIIC this seems to kinda be workable now with lwt IIUC?
An alternative would be separate the details from the grammar, but then I would expose those implementation details in an interface, while in fact the rest of the program is only interested in one function that parses everything.
Or, you could write from bottom to top. It's OCaml, so you know the big picture cannot be at the top. Now a case could be made for a language that reads toplevel statements from bottom to top…