Any demos written in FORTH?
category: general [glöplog]
Just what the topic says... I'm looking for demos written in the FORTH language.
WHAAAAAAAAAAAAAAAAAAAAAT?
[http://www.engin.umd.umich.edu/CIS/course.des/cis400/forth/hworld.html]ahhhhhhhhhh[/url]
FORTH is a language that is about midway between assembler and C. I would think that it would make a good environment for 4K, 16K and 64K demos. If you do it right, FORTH can have a -very- small footprint for the basic environment (<1K for a small dictionary is very doable).
legalize, why go for an exotic language when you can do it in plain c? (i.e. it's possible to make small code with c and visual studio).
I think it's simply for the fun of it. FORTH is mainly used in astronomy and personal use. If no-one has ever done it before he could be the first...I would personally prefer assembly language. It's easier to understand than FORTH. :-)
FORTH seems to be rather confusing yeah. For example, it uses postfix notation which is rather disturbing.
5 50 + = 55 for example.. argh.. A bit like assembly though.
5 50 + = 55 for example.. argh.. A bit like assembly though.
and operations seem to be stack based as well.. try to figure out what this piece of code does
Code:
FLOOR5 DUP 5 < IF DROP 5 ELSE 1 - THEN ;
There was a guy in Poland who was writing games for 8bit atari in forth.
FORTH is used in astronomy? Oh crud, I bet Dr. Evil is going to expect us to know it...
Not only in astronomy. Microcontrollers also. But really, you'll find more demos written in brainfuck than in fo(u)rth or fortran, Lisp, Prolog and Visual Basic. ;)
FORTH was created for microcontroller type environments where resources like RAM and ROM space were extremely limited. Personally I like developing code in an interactive environment and FORTH is interactive, even in extremely tiny computing spaces. This would seem to be a win for a 4K demo, where you'd usually write it in assembly, but would lose out on being able to interactively develop the code.
maybe i'd code in Common Lisp if the 40M runtime was allowed ;)
(same nice feature of being able to interactively compile code)
(same nice feature of being able to interactively compile code)
knos: I know people who prototype in Common LISP (motto: it's -all- in there!) and then take the debugged algorithms and port to another language.
I was just considering doing that.. just got to hook up CMUCL to my main loop