Gisa

From Esolang
Jump to navigation Jump to search
Gisa
Paradigm(s) imperative
Designed by Palaiologos
Appeared in 2019
Memory system register,cell,stack
Computational class Turing-complete
Reference implementation Gisa
Influenced by asm2bf
File extension(s) .gisa

Gisa is a (now unmaintained) programming language compiling to asm2bf. Albeit the last revision in 2019 and being unmaintained, the generated code still runs, due to asm2bf being fully backwards compatible. There is no manual or documentation, the compiler is written in C and it's the only reference to Gisa. The compiler output isn't optimized.

Examples

This program will display ASCII(33) - probably exclamation mark.

(
	(outb [0])
	(= 0 (+ 1 [0]))
	(= 0 (* 2 [0]))
	(= 0 (* {2 2 +} (+ 2 2)))
)

function test:

(
	(exit)
	(outb ((6) square invoke))

	({defun square (
		* dup
	)} exports)

	((
		@"end"
	) exit defmacro)
	
	({
		@"pop r2"
		@"psh r2"
		@"psh r2"
	} dup defmacro)
)

display 0123456789:

{
	(= 0 48)
	{loop {
		(outb [0])
		(= 0 (+ [0] 1))
	} (
		neq [0] (+ 48 10)
	) while}
}

macro and inline asm demonstration, prints ASCII(64).

{
	({
	    @"pop r5"
		@"psh r5"
		@"psh r5"
	} dup defmacro)
	
	((
		* dup
	) square defmacro)
	
	(outb (square 2))
}

See also