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

Did you actually test that code? Never mind the tiny buffer size or possible hallucinations, but just from looking at the "parser", it does seem to do nothing more than copy the expected tokens in the same order it reads them on input, ignoring any parentheses.

This CAN'T possibly work, not even for the example input. Maybe if it reversed the string, but unless I've forgotten completely how to read Forth it doesn't do even that.

And for some reason this kind of garbage is apparently the future of programming, and people seem compelled to post it everywhere...



This was kinda joke. I have done it in real life, but that was in 1976. And the mechanism was totally different, more Lisp-like, but could not make Grok to do it, so I suggested simple pre-parser.


What I really wanted was a "pascal-type" tokenizer and second stack for commands. "(" means push next and ")" means pop and execute. In this kind of system (if (< a 1) (setq a (+ a 2))) is totally valid without much overhead and about 187% more readable than Forth.

  And yes I know it is not Lisp, perse.


Also Lisp isn't just about a prefix syntax, it's the whole eval/apply and lists.




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

Search: