Hacker News new | ask | show | jobs
by dep_b 2785 days ago
> is not whitespace-sensitive, how can you see the size of whitespaces when you're blind?

Can't indentation be handled by the IDE as having a meaning like "root class declaration", "function declaration", "nested block 1", "nested block 2"? Indentation has meaning and meaning can be converted. Even Xcode seems to be context aware as I can choose where certain code block shortcuts can or can't be executed. "This is a function", "This is a class", "This is a function in a class", "This is the root level", "This is a block one deep inside a function inside a class".

1 comments

If you are willing to restrict a programmer to only look at accessible renderings of the AST, then there is probably nothing to consider, but a programmer's job is also handling what happens when a program does not parse.
This. Very few language designers understand the usefulness of being able to parse the code while it is incomplete/being typed out.

You end up with “hacks” to color your code vs a real parser to compile the code.

My compiler is error-recovering for this reason: you can still get correct syntax-highlighting data even if there are lexical errors, type information even if there are type errors, and so on.