|Forth is bliss
||[Mar. 22nd, 2008|10:03 am]
I'm programming in Forth on an exotic island and life is just fine.
I've done two weeks of serious hacking now: the first to bring up
Forth on the Keil MCB2100 board and the second to write drivers
and make some extensions to Forth. Serious fun!
Forth is amazing. There's hardly any compiler or runtime system and
yet it has all the sophistication of Lisp. This feels like discovering
Gödel, Escher, Bach faithfully expressed in a few dozen cave
The best part about embedded programming is starting from scratch
without using a single line of code that we didn't write outselves.
Right now we don't have memory protection, dynamic memory allocation,
concurrency, garbage collection, etc. So we're going to rediscover
first-hand at what point it's worth developing these fancy features.
Truly we're retreading some giant steps :-)
Here's some Forth I wrote that may be clever or stupid, I'm not sure
\ Running time profiling: t( ... )t
r> tick ( r t1 )
>r >r ( r: t1 r )
tick r> r> ( t2 r t1 )
swap >r ( t2 t1 )
- ( tdelta )
. ." ms" cr
Ah the rapture of learning a new programming language :-)