3 ms·
I loved Forth and Chuck Moore's 10x philosophy. I went from Forth to Ruby, from a notorious write-only language to a language that's a joy to read & write. I
by fouc 8y ago
I loved Forth and Chuck Moore's 10x philosophy.
I went from Forth to Ruby, from a notorious write-only language to a language that's a joy to read & write.
I occasionally wonder about the possibility of a forth/ruby hybrid, stack-based interpreter/compiler with the readability of ruby.
Ruby's OO is based on message passing. A message-passing OO is something that could potentially be implemented elegantly in Forth.
- protomyth 8y agoLook at MOPS (well, I guess iMOPS or PowerMops these days). It was a Forth inspired object oriented language http://powermops.org/ http://powermops.org/
- sifoobar 8y agoSnigl [0] leans more towards multiple dispatch and Lisp than OO and Ruby, but I figured it might me interesting anyway if you've been thinking along those lines. [0] https://gitlab.com/sifoo/snigl https://gitlab.com/sifoo/snigl
- pmarreck 8y agoThis sounds really interesting (disclaimer: I love both these languages), but isn’t a main advantage of Forth that it compiles to something that is really f*ing fast, and wouldn’t that hybrid potentially give that up?
- sifoobar 8y agoThe reason it's fast is brutal simplicity. But it's a spectrum, with dogmatic Forth close to one end; the more you can keep things simple, the more raw speed you get for free. The approach I'm using in Snigl [0] is to start with Forth and add more elaborate features as optional/gradual layers. As long as you don't use variables and closures you get to enjoy more raw speed etc. [0] https://gitlab.com/sifoo/snigl https://gitlab.com/sifoo/snigl
- mikekchar 8y agoThere were lots of OO Forth implementations back in the day. I used one to make a star field animation system for a planetarium when I was in University. The main thing I would say, though, is that OO tends to encourage you to put things on the heap. This goes away from one of the nicest aspects of Forth where you are encouraged to play on the stack. I went from Forth to C++ and quickly embraced RAII, partially thanks to my experience with Forth. I've often thought we're missing an abstraction here -- something that helps you with cohesion like OO does, but which doesn't force you away from the really efficient and elegant approach of something like Forth.