background preloader

Concatenative

Facebook Twitter

Forth

Wiki. Stack. Slavapestov. Xy. Online Cat Interpreter. <h4>In order to use the Cat interpreter JavaScript has to be enabled on your browser</h4> Welcome to the JavaScript implementation of the Cat programming language by Christopher Diggins, with contributions from Takashi Yamamiya, and the excellent open-source JavaScript vector graphics library from Walter Zorn.

Online Cat Interpreter

This interpreter only supports a very small subset of the Cat language. Drawing code is known to not work properly on Opera version 5 or 6. Cat is a postfix language, this means that arithmetic operations are written so that operators follow their operands. For example, where you might normally write: (1 + 2) * 3, in Cat you would write: 1 2 + 3 *.

You can also define new instructions in Cat using the following format: define add_one { 1 + } define times_two { 2 * } define square { dup * } define swapd { [swap] dip } define bury { swap swapd } define circle { "green" set_color 100 100 50 50 fill_ellipse } The best way to learn Cat is to experiment, so have fun! JKat - A Concatenative Language on the Java Virtual Machine. Logo by Ville Oikarinen Introduction JKat is a dynamically typed, stack-based (concatenative) language similar to Forth and its relatives.

JKat - A Concatenative Language on the Java Virtual Machine

It's implemented as an interpreter on top of the JVM, and aims at easy embeddability and simplicity like Lua, providing powerful tools for creating domain spesific languages when Java becomes insufficiently expressive. Why concatenative? Concatenative languages are interesting from many perspectives: They're almost completely syntax free. Obtaining and using JKat Latest JKat distribution can be found from here. To run jkat interpreter, you must set environment variable JKAT_HOME and PATH to point to the extracted distribution. Without any command line arguments, the interpreter starts in interactive mode. License JKat will be distributed under a BSD license Basics Everything in JKat works by either For example: interactive> 1 2 + print 3 New words can be defined by using the ':' word: interactive> : mysquare ( n -- n^2 ) dup * ; interactive> 5 mysquare print 25.

My first encounter with concatenative programming! Blithe has heavy influences from both Forth and Lisp.

My first encounter with concatenative programming!

It has postfix notation. While functional languages are based on the application of functions to arguments, concatenative languages are based on the composition of functions. There are no formal function parameters. Instead all functions take a stack as argument and produce a stack as result.