FORTH, the ultimately dynamic programming language!

Do you insist on having Exceptions in a language? In Forth, you add that in Forth itself.

Do you like classes and objects? In Forth, you add that in Forth itself.

Control structures like IF, SWITCH, FOR, REPEAT? In Forth, you add those in Forth itself.

Want a type system? Runtime disassembler? You know the drill.

All available in the smallest footprint imaginable, and without C. Mecrisp Stellaris for STM32 is <20kB.
youtube.com/watch?v=dvTI3KmcZ7

@bonifartius

Forth has some serious drawbacks too. Basically it exposes you for being your biggest enemy of yourself.

Local variables are not part of the standard (but can be added ;-) ), so a lot of stack juggling.

Parenthesis are comments, as is backslash until end of line.

In this code, I have marked the stack between steps to keep track of where everything is. Once this is rock solid, those will be removed.

@useless_idiot

@niclas
i think i'd keep those comments to help future me :D

i just love to play with different languages, they all gave me new ways to think about how to solve problems. sometimes i then apply those ideas in other languages and it's unorthodox but very nice - at least for my brain :P.

i read a bit about colorforth a while ago which seemed interesting and totally crazy at the same time :)

erlang too is on my todo list, only thing i used it for was configuring ejabberd. the BEAM is stack based as well iirc.

@useless_idiot

@bonifartius

I don't get colorForth at all.

There is a book called "Thinking Forth" which is a "mind altering book" as it changes many people's way how to look at problems, and is relevant across languages. Recommended. Available as PDF at thinking-forth.sourceforge.net and I think hard copy is available on Amazon.

Erlang; Pretty cool too, but I struggled with it, and never got going. Elixir is "same thing", but with easier syntax. But Beam VM won't fit in my MCUs.

@useless_idiot

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.