Hacker News new | ask | show | jobs
by stepvhen 2492 days ago
> maybe even playing with colors to indicate if verbs form a train or other composition. I understand that is a quite different problem from just substituting @: with o̲.

With regards to how different of a problem that would be, J's syntax is context-sensitive. If you were to accurately identify trains and forks, you could not use regex, and would probably end up implementing a subset of the J parser.

2 comments

J has a first-class citizen self tokenizer in the standard lib as a dedicated state machine ( ;: ) https://www.jsoftware.com/help/dictionary/d332.htm

For an example of a very incomplete and largely suboptimal parser that uses the above: https://github.com/Rscho314/J-compiler/blob/master/ast.ijs

Charles Moore did that with Color Forth and even though only he was using it, I remember several comments on how that is unfair to the color blind or visually impaired which is an interesting point.
ColorForth has a color-blind mode, but I do not remember the details.

The main idea is to change visual representation instead of using delimiters. Different fonts or text sizes sizes or cursive/inverse/underline are also valid ways of displaying different "colors".

Yes I remember that reply which came from him, but forgot to mention. It is an interesting idea.