Hacker News new | ask | show | jobs
by sn41 1986 days ago
Forth is not just another language for the sake of it. I am currently learning Forth from Leo Brodie's excellent books "Starting Forth" and "Thinking Forth". It actually changes the way you think. Just as Lisp does - almost a feeling of "a new planet swims into his ken".

The main feature of the Forth style is to write lots of 1 to 2 line functions, in such a way that at the high-level, you have essentially a domain-specific language that looks like exactly what you want a program to look like - for example, "RINSE WASH CYCLE SPIN STOP" for a washing machine program, and "RINSE WASH RINSE WASH CYCLE SPIN STOP" for an extra clean option.

People claim that once you learn Forth, you start programming Forth-style in other languages like C, Python etc. I can already see the appeal.

2 comments

Lisp and Erlang also do this.

My C sometimes looks like Lispy Erlangish weirdness, and my Java often looks like my C. Certain languages just have certain ways of worming their way into your brain and improving the way you think, much to the dismay of everyone who can't think that way yet because the idiom isn't native to that language (yet).

I love that effect. My JS changed a lot once I grokked LISP, and I finally understood why there was a Haskell course on my degree track.

One of the most rewarding training experiences was giving my old Haskell textbook to a junior team member and watching his (at the time .NET, w/LINQ) code change over the course of a few weekends.

Yep. My regular programming has changed after learning lisp/erlang/haskell.

For example I am writing functions with no (or less) mutation and keeping them pure. Makes for easy testing.

We have Ruby programmers who has never used map/fold etc.

> People claim that once you learn Forth, you start programming Forth-style in other languages like C, Python etc.

Sounds very much like my experience with LISPs. Probably just need to dive in and try it. Thanks for the detailed response.