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

Forth doesn't need an abstraction for operating on threaded code; forth programmers routinely write their own words for control structures with an awareness of the internal structure of dictionary entries. You're operating on code-as-data, it's just an entirely different mechanism for doing so.

It's entirely possible to work with dynamically allocated memory in a Forth that runs on top of some other operating system, like GForth. When you're on metal, you can build whatever kind of allocator you want. The primitives "create"/"allot" are just that- primitives.

Here's a trivial example of building a cons-pair heap in Forth: https://gist.github.com/JohnEarnest/4522067



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

Search: