.profile/README.md

3.4 KiB

Hello ! Welcome to my gitea instance :)

I have a real obsession for programming language design and development. I did a lot of prototypes, most of them help me to improve, to learn and to test ideas I had.

Here you will find short descriptions of some languages I am not too ashamed to show. Some of them look like BASIC, and others like LISP. All of them was made with love, and dropped with the hope to make something better.

Enjoy.


wuz is a programming language made in C with flex and bison. Its syntax looks like good old BASIC but having a more functional approach.

# a simple factorial
fun f (n as int) as int
	if n == 0
		return 1
	end

	return n * f(n - 1)
end

assert 120 == f 5
# a high order function
fun h (n as int, m as fun<int:int>) as int
	return (m (m n))
end

grino adopt a more functional lisp like syntax. Keywords are as short as possible: the function $ is used to declare variables and the function -> returns a lambda.

;; declare lambda
($ a (-> (x) (* x 2)))
(assert= 14 (a 7))

;; recursive factorial on lambda
(assert= 720 ((-> (x)
            (if (eq? x 0)
                1
                (* x (self (- x 1))))) 6))

Grino supports closures, allowing the definition of statefull functions.

;; Let's count !
($ (i init)
  ($ counter (- init 1))
  (-> ()
    (set! counter (+ counter 1))
    counter))

($ j (i 0))

(assert= 0 (j))
(assert= 1 (j))
(assert= 2 (j))
(assert= 3 (j))
(assert= 4 (j))

gux is a statically and strongly typed language with a more modern syntax.

# variable declaration
var x : int = 4;
var y := 3.2;

# factorial function
fac := fun (n: int) -> int {
  if n == 0 { return 1; }
  return n * this(n - 1);
};

# function overloading
fun first(n: int) -> int {
  return 27;
}

fun first(n: float) -> int {
  return 79;
}

assert first(4) == 27;
assert first(7.3) == 79;

muzgen is a programming language for sound design tasks. It allows to manipulate and combinate oscillators in order to craft interesting sounds.

# play a sine at 440Hz.
[sine 440]

# combine by adding two signals
[add [sine 220] [sine 220]]

# using one sine to control another
[sine [mul 440 [sine 1]]]

roza is pretty much a clone of wuz with a syntax slightly different.

# functions are first class citizens
let a = fun (x as int, y as int) -> int
    return x + y
end

# function calls using curly brackets
assert 12 == {a 9 3}
assert 6 == {a {a 1 2} 3}

fakir has pratically the same syntax and semantic than grino. Fakir adds module importation features using the function @.

($ a (@ './mod2'))

(assert= 42 a::var)
(assert= 6 (a::fun 3))

snake is a language agnostic build system.

x y z -> (*.py) {
    $IN
}
$Y = (x.c y.c z.d w t.h)
d -> a {
    $Y[c.=.h]
}

duck2d is a little game framework scheme (a dialect of LISP) tool. It uses C++, OpenGL for rendering the game and guile for the scheme interface. It features an Entity Component System (ECS) to manage game entities.