Hacker News new | ask | show | jobs
by alexisread 376 days ago
That's a nice take. Implicitly though, that implies treating words not as functions but as coupled routines, possibly because forth is untyped.

If anything goes wrong during development you need that model of the stack in your head to debug- I think that's the main differentiator, and if you had a typed forth with local variables, it would enable greater readability ie. I can scan the individual words/ functions without needing that stack model.

Just my POV, not sure if that resonates?

1 comments

Forths can have local variables, both ANS Forth and gforth have them and if your forth does not have it you can make your own or possibly just include gforth's if your forth is compatible. Keeping track of the stack becomes second nature and all but the simplest implementations have great tracing and debugging if you get lost.

Forths can also have types but it is slightly different, gforth has a float stack with its own commands and you can implement others and any other feature you want.

Once you get used to working global and without type it gets surpringly easy, it is more difficult for me to work with type and scope than without and when I use something like C I am constantly fighting it and feel like erything is needlessly complicated.