Re:Starting Forth - After yesterday's Prolog post, another a...
by spc476 on Tuesday December 07, 2010 @03:39PM
(#1980504)
For a real mind blowing experience, you should also read _Thinking Forth_ (http://thinking-forth.sourceforge.net/) also by the same author. It was one of two books that radically changed how I write programs (the other one being _Writing Solid Code_).
Re:Starting Forth - After yesterday's Prolog post, another a...
by hvs on Tuesday December 07, 2010 @04:34PM
(#1980721)
Forth is among the languages that every developer should learn, even if they never use it in a production environment. It will definitely make you think a little differently. It's as if lisp and assembly language had a child.
On another note, it is REALLY easy to write completely incomprehensible spaghetti code in Forth. You really have to be disciplined or you'll end up with a lot of "write-once" code.
Re:Starting Forth - After yesterday's Prolog post, another a...
by _b8r0 on Tuesday December 07, 2010 @02:20PM
(#1980199)
I thought after yesterday's Prolog post went down quite well I'd try introducing those of HN who haven't experienced it to Forth, a stack-based language that I loved as a child for it's extensibility (given at the time my alternative was BASIC or Z80 ASM I hope you'd understand). Older Mac users might not know this but your Open Boot firmware contains a fairly reasonable Forth interpreter built in.
Anyway, I hope you enjoy Forth as much as I did.
EDIT: Brain fart, wrote stackless when I meant to write stack based, sorry.
Re:Starting Forth - After yesterday's Prolog post, another a...
by mtm on Tuesday December 07, 2010 @02:53PM
(#1980336)
I love Forth but it's anything but 'stackless'. In fact, it's probably one of the most stack intensive languages to ever exist (and one of the funnest, especially when used for embedded systems work).
'Starting Forth' is indeed a treasure, I think I'll dig out my old copy and add it to the stack, heh.
Re:Starting Forth - After yesterday's Prolog post, another a...
by mtm on Tuesday December 07, 2010 @04:12PM
(#1980628)
No sweat.
I remember using Apple Forth (from Cap'n Software) in 1982 in Independent Study in high school. I made a cloud chamber simulator with it for the Physics department. (Side note: my public high school had an awesome science department: a radiation class complete with scintillation counters, a cobalt source in a lead pig, etc. PDP-11 and Apple IIs, small radio telescope on the roof. Riverview High School, Sarasota, FL; no idea what it's like these days.)
Re:Starting Forth - After yesterday's Prolog post, another a...
by _b8r0 on Tuesday December 07, 2010 @07:16PM
(#1981247)
Wow, I spent two years looking after a PDP 11/23 running RTS/E. Interesting times... In that I've never met anyone less than 20 years older that understands what I've done (and to be fair most of those older than that have an aamazing understanding compared to me), I found it amazing that between the PDP and AS/400 box at work that they were bought by people that retired a long time ago and still ran, not that the data coming out was accurate. I think the rest of my employer's place was like that, and perhaps that was part of the problem.
Re:Starting Forth - After yesterday's Prolog post, another a...
by colomon on Tuesday December 07, 2010 @05:05PM
(#1980829)
I wrote a SID music sequencing program in Forth on my C64, it was a tremendously fun programming environment. (I think there may have been a bit of assembler involved as well, as it was very easy to call from Forth.)
Re:Starting Forth - After yesterday's Prolog post, another a...
by maximilianburke on Tuesday December 07, 2010 @05:29PM
(#1980928)
Jones Forth is awesome because it isn't just a great way to learn Forth but also a great way to learn assembly programming. A couple years ago I did a rather crude, hurried, and unoptimized port of Jones Forth to the Cell processor's vector units. Initially I intended it to be an April Fool's gag for my group at work but I came away with a much better knowledge of the underlying architecture.
Re:Starting Forth - After yesterday's Prolog post, another a...
by pdelgallego on Tuesday December 07, 2010 @04:56PM
(#1980797)
Just for those that are interested in lear how to implement a forth compiler or even just a compiler, this [1] is a step by step tutorial on how forth is implemented. The tutorial is a extremely well commented code file that you can run.
What blew my mind was that - apart from a tiny kernel - Forth was written in Forth. It bootstrapped itself from basic principles. It's kind of the Principia Mathematica of programming languages...
Re:Starting Forth - After yesterday's Prolog post, another a...
by VladRussian on Tuesday December 07, 2010 @08:26PM
(#1981452)
>Forth makes MUCH more sense in an embedded context, IMHO.
Forth is just unbeatable in an embedded context. Minimal porting of a few basic words and you're up and running with fully functional environment you can adjust on-the-fly.
On another note, it is REALLY easy to write completely incomprehensible spaghetti code in Forth. You really have to be disciplined or you'll end up with a lot of "write-once" code.
Anyway, I hope you enjoy Forth as much as I did.
EDIT: Brain fart, wrote stackless when I meant to write stack based, sorry.
'Starting Forth' is indeed a treasure, I think I'll dig out my old copy and add it to the stack, heh.
ISTR it was a FIG-Forth implementation, but I haven't used it in over 20 years (wow, that feels old) so I might be wrong.
I remember using Apple Forth (from Cap'n Software) in 1982 in Independent Study in high school. I made a cloud chamber simulator with it for the Physics department. (Side note: my public high school had an awesome science department: a radiation class complete with scintillation counters, a cobalt source in a lead pig, etc. PDP-11 and Apple IIs, small radio telescope on the roof. Riverview High School, Sarasota, FL; no idea what it's like these days.)
You should be able to load this into VICE (http://www.viceteam.org/) and start hacking away. Hope this helps.
A great language, though I only tried to write a text adventure in it!
Some crazy stuff that you could do with Forth. The author shows how you can inject a forth VM in shellcode and build exploits on top of that.
http://factorcode.org/
The current documentation is top notch though and you can learn a lot if you look through the factor blogs (or read a forth book)
Link to factor blogs: http://planet.factorcode.org/
https://github.com/fogus/rforth
[1] http://www.annexia.org/_file/jonesforth.s.txt
Link for those of us not following HN 24/7?
What blew my mind was that - apart from a tiny kernel - Forth was written in Forth. It bootstrapped itself from basic principles. It's kind of the Principia Mathematica of programming languages...
http://en.wikipedia.org/wiki/Open_Firmware
Forth makes MUCH more sense in an embedded context, IMHO.
Forth is just unbeatable in an embedded context. Minimal porting of a few basic words and you're up and running with fully functional environment you can adjust on-the-fly.