Settings

Theme

Tiny stack-based language implementation (61 sloc, Python)

github.com

2 points by richard_shelton 4 years ago · 4 comments

Reader

WalterGR 4 years ago

The only examples are in the source.

  [ dup * ] is square
  [ dup 2 < [ drop 1 ] [ dup 1 - fact * ] ifelse ] is fact
  4 square .
  5 fact .
  • richard_sheltonOP 4 years ago

    If you are familiar with Forth, Postscript, or Joy you should have no problems with programming in Fortik :)

    Still, the idea of Fortik is to encourage students to learn how simple interpreters work and to extend the language.

    • WalterGR 4 years ago

      Is the first assignment to reverse-engineer the language spec from the interpreter?

      • richard_sheltonOP 4 years ago

        Basically, yes, so I tried to make a simple implementation as possible. And I'm taking into account that students are already familiar with postfix notation and stack data structure. Of course, I use additional sources (like the popular Crafting Interpreters book) in the teaching process.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection