3 ms·
Does forth qualify for the same category as smalltalk and lisp?
by 10ren 17y ago
Does forth qualify for the same category as smalltalk and lisp?
- abecedarius 17y agoLike Lisp, it's a programmable programming language. Like Smalltalk, the original Forth was a self-contained programming environment with full source that you can hack on the fly. (This particular Forth system isn't the best example of that.) Unlike either, it's lower-level; except for things like embedded systems you're unlikely to prefer it to get stuff done. It's most notable for being super-simple to implement on bare metal.
- jacquesm 17y agoForth is an easy-to-bootstrap language that defines several primitive words. You use the primitives to define other words in order to achieve your desired effects. It is a stack-based language. Forth programs tend to be extremely small, typical usage is in embedded control applications, though there have been much larger programs written in Forth. Forth was invented by Chuck Moore, he is still active: http://www.colorforth.com/ http://www.colorforth.com/ It definitely is a language that is worth learning, if only because it will subtly change your point-of-view. If you're really interested you might want to read this book: http://www.forthfreak.net/thinking-forth.pdf http://www.forthfreak.net/thinking-forth.pdf
- celoyd 17y agoForth and lisp are very closely related — conceptually, not historically. If you wrote a lisp where evaluation went left-to-right instead of right-to-left and where the operators took fixed numbers of arguments (so you could drop the parentheses), you would have an unconventional but recognizable dialect of forth. http://en.wikipedia.org/wiki/SECD_machine http://en.wikipedia.org/wiki/SECD_machine is an interesting example of something between lisp, forth, and traditional assembly.
- eru 17y agoForth is like the complete opposite of Lisp. But after you reverse so much, you arrive at something similar. Syntax is of course the most obvious `backward' thing. Conceptually Lisp moves you away from the machine and closer to math, Forth stays way closer. Forth does not (normally) include a garbage collector. Naming variables is discouraged. Forth is almost untyped, Lisp is strongly-dynamically typed.
- kabdib 17y agoForth has incredibly primitive memory management. Of course, you can add your own, but out of the box you don't have any GC. Heck, you don't even have reference types; it's like the hoary days of BCPL where "everything is an int" until use use ints as pointers. PostScript is a very cleaned-up forth, for example. Bootstrapping a forth-like system on your own is a great exercise; it'll teach you a lot about writing minimal systems. The _Threaded Interpretive Languages_ book is a good read, too. My personal belief (after seeing many forth-based projects fail) is that it's a terrible language for scaling to real systems and even medium-size teams, but it's got some great ideas. The trouble comes when you do stuff like trying to treat that toy driver ("hey, i just wrote a disk driver in eight lines of forth!") as something that is ready for production. Also, a sea of invented operators like "^!" does not help, though arguably this is more developer discipline than a fault of the language. [[[pats forth on the head. nice language, now go play]]]