Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm interested in learning a stack-oriented programming language (such as Forth), which one would you recommend? The qualities I want are:

  • You should be able to develop non-trivial software in it, but it mustn't be a great language for that as:
  • I want to learn the language so I can try out a new paradigm (that is, not because I (think) that I will have great use of it). The reason I want to learn another paradigm is that I want to broaden my views on different approaches (learn to think in new ways, different from OOP, functional and structured). The language should let me do that (learn to think differently).
  • The language should have available and good resources to learn from. The resources should also approach stack-oriented programming in a way that you understand the paradigm (after all, I do this for the paradigm).
share|improve this question
5  
Whitespace!!!!! – Michael K Mar 3 '11 at 16:03
Befunge!!!!!!!! – Thomas Eding Nov 11 '12 at 2:35

closed as not constructive by gnat, MichaelT, Bart van Ingen Schenau, GlenH7, Kilian Foth 2 days ago

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

7 Answers

up vote 10 down vote accepted

You answered your own question. FORTH is an outstanding language. Not only is it stack-oriented but also it'll also teach you a great deal about meta-programming. FORTH is also notable in that it can be self-hosting with a very small kernel of natively-implemented routines.

Additionally, one of the greatest programming books ever written, Thinking Forth, is nominally oriented towards that language, but its lessons apply to programming practice in all langauges and in all paradigms.

share|improve this answer
+1: Since the question mentioned forth, why not start with forth? – S.Lott Mar 3 '11 at 16:30

I'm (reliably) told that Factor is a very interesting language to learn.

share|improve this answer
Factor has a lot going for it. It's actively developed, comes with an interesting development environment, is well documented, and has a huge up-to-date library that offers concurrency abstractions, database bindings, and even a web server and web dev. framework. – Corbin March Mar 3 '11 at 17:17

I would recommend:

  1. Lisp
  2. PostScript

I struck out Lisp since it's not purely stack based. I guess that shows what my CS degree is really worth. However, it still wouldn't be a bad example of a language that could teach stack-oriented programming since it does rely heavily on stacks for all of its operations.

Thanks to those commenters who brought this to my attention.

share|improve this answer
3  
Why would you reccommend Lisp? – Michael K Mar 3 '11 at 16:09
3  
Is LISP stack-oriented? – Anto Mar 3 '11 at 16:10
1  
@SK-logic - that's what I'm reading. I'm about to make an edit. It looks like "pure" lisp in the original form would be the closest, but even though lisp is heavily reliant on the stack, it can't be called stack-based because it provides distinctly non-stack features. – Joel Etherton Mar 3 '11 at 16:24
1  
@Anto - I read that one, but it didn't really say anything about it definitively either way. I programmed in Lisp in college, so I know it is heavily reliant on stacks (confirmed by the wikipedia article), but since it's not mentioned on the stack-oriented languages article (en.wikipedia.org/wiki/Stack-oriented_programming_language), and I really think it would be if it qualified, I will accept that as proof positive. I have already issued an edit. Thanks :) – Joel Etherton Mar 3 '11 at 16:29
1  
+1 for Postscript. – mouviciel Mar 3 '11 at 16:42
show 3 more comments

You might also consider concatenative languages like Forth, Joy, PostScript, Cat, and Factor.

share|improve this answer

Why don't you start with FORTH.

It's the classic stack language and there's good documentation.

Its non-trivial having been used to control telescopes and boot loaders and all sorts of things...

Yet its simple enough to start messing with that you will probably find yourself being tempted to write your own compiler for it - which will take you on a whole new journey!

share|improve this answer

Forth! If you want an example of a serious Forth-based application, look no further than OpenBoot. Every RISC-based Sun workstation and server has shipped with OpenBoot. One can have a blast playing with an OpenBoot-based Sun machine without ever booting Solaris.

Also, Forth was used to develop the old FedEx hand scanners. Forth is still widely used in resource-constrained environments.

share|improve this answer

Don't forget:

  • Onyx - stack-oriented scripting
  • Enchilada - Robbert van Dalen is one of those geniuses that doesn't realize he's a genius. That makes other people question if he's a genius. Make no mistake, he's a genius.
  • Staapl - A Racket extension. I love Scheme so this was extra appealing.
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.