Old toy languages

plt codegolf

!! Note: This blog post is rather old and may be based on outdated information.

This is a list of programming languages I’ve made in the last few years.

flow (November 2014)

An insanely simple language that contained recursive expression parsing and an echo builtin. As my first language, it was a small toy project, but something that really got my feet off the ground. It was implemented in Python.

in "Enter a number:" @i
echo "I'm adding three to your number!"
@a = 3 + @i
echo @a
echo "I'm multiplying it by two!"
@a = 2 * @a
echo @a
echo "I'm subtracting it by four!"
@a = 0 + @a - 4
echo @a
echo "I'm dividing it by two!"
@a = 0 + @a / 2
echo @a
echo "I'm subtracting the original number!"
@a = 0 + @a - @i
echo "The Answer is always one!"
echo @a

Voop (December 2014)

“a Volatile Object Orientated Programming Language”, whatever that means. It looks like I only started the parser. It was implemented in Java.

fql (February 2015)

“Flexible Query Language (A replacement to the boring SQL)”. Pretty terrible “translator” that replaced simple words. (Somehow these are getting worse.) It was implemented in Java.

select all from table where column equals 1
/* translates to */
SELECT * FROM table WHERE column = 1;

cod (April 2015)

Deadfish interpreter with extensions. It was my first project in C, and my first dive into esoteric languages (where I stayed for a while). Here are the commands in the language:

Deadfish Commands:

  • i - Increment value by 1
  • d - Decrement value by 1
  • s - Square value
  • o - Output ASCII value

cod Commands:

  • b - Binary Two’s Complement the value
  • q - Square root the value
  • r - Right shift value
  • l - Left shift value
  • & - Turn value into the value’s pointer
  • n - Print number
  • e - Erase the value
  • 4 - Decrement the value to zero, while printing each ASCII value along the way
  • 5 - Do the same as 4, except reset the value to it’s original number afterwards
  • 6 - Do the same as 4, except go upwards to the square of the value

fvm (May 2015)

The Flower Virtual Machine is a register based bytecode VM that was originally implemented in C and was translated to D in October of 2015. Here’s an excerpt from the instruction set:

0x0loadiloadi <#>Loads byte into register
0x1loadsloads Loads string into register
0x2loadfloadf Loads string as float into register
0xaprintcprintc Prints register as character
0xbprintnprintn Prints register as number
0xcinputinput Load string from stdin into register
0xdcallcall Call routine
0xeroutinestartroutinestart Start routine named str
0xfroutineendroutineendEnds routine

owk (June 2015)

An esoteric language that compiled to fvm bytecode (okay this is actually pretty cool). It contained some basic language concepts like variables and functions, and included some… weird… syntax. It was implemented in Java.

1='H';2='e';3='l';4='l';5='o';6=' '
#Adds the values of registers a & f and stores it in register e
e < a+f
#Multiplies the values of registers 2 & d and stores it in register f
f< 2*d
#Mods the values of registers 8 & 6 and stores it in register 1
1 < 8 % 6
#Transfers the value of register e into register f
f < e
#Negative c
f < -c
#NOT c
e < !c
#Two's complement c
d < ~c

lamb (June 2015)

Very similar to owk, but it only provided functions. (It looks like it was made on the same day!) It compiles to JavaScript and had implementaions in Java and JavaScript.

hello:“Hello World”

refract (July 2015)

“2D, stack-based, esoteric language based off ><>, GolfScript, Portal, and a bunch of other languages”. It contains a full wiki too! It was implemented in Java.

“multiple stacks”




“block hello world”

{"hello world"r}h {o}phv

I have many other toy languages, but these are the more interesting ones. Now we can view some better languages I made.

Good(ish) languages

o (July 2015 - November 2016)

My first big language. The only esoteric language good enough to put on a resume. The original interpreter was written in Java and it was rewritten in obfuscated C in October of 2015 with massive help from Ryan Gonzalez. A Web IDE is available online and was written in Python & CoffeeScript. It was designed for CodeGolf, and it was great at it (until other languages came out that completely abused encoding tables).

“hello world”

"Hello, World! 





“Count from 1 to n in Negabinary and Negaquaternary” (I don’t even..)

j){n.2_bo4_bo' o}d

lang-kotlin-antlr-compiler (August 2016 - June 2017)

I completely gave up on naming things, but this is one of the best compilers I’ve made. Written in Kotlin using ANTLR to generate the parser, the language targeted the LLVM. It supports global variables, functions, classes, methods, “automatic memory management”, type inference, FFI, modules, etc. It can be considered the “first version” of my language.

import std.io

@extern rand() : Int32 0

let initialAccountId = 7 + 11

class Account
    var id : Int32

    setId(i : Int32)
        id = i,

incrementId(a : Account, amount : Int32)
    a.id = a.id + amount

main ()
    let account = new Account(),
    let i = account.setId(initialAccountId),
    incrementId(account, rand()),
genComplexExpressionsInWhileLoop (a, z, y, x, w : Int32)
    var i = 0,
    var sum = 0,
    while i < a
        var v = 42 + x,
        let u = 45 * 7 - 16 + 11 + v * 67 + 124 - (w * 4) / 5,
        v = v * 2 - z,
        var t = 1,
        if z < 10
            t = v * z + 24 - 15 + y
            t = v - 7 + 8 + 8 - z
        let l = 74 * 3 - v + z * x - w,
        i = 5 + u * z * v + t * 2 * l
    let r = sum * i,
import std.io

fac (n)
    var r = 0,
    if n <=1
        r = 1
        r = n * fac(n - 1)

inc (a)
    a + 1

main ()
    var i = 1,
    while (i < 11)
        i = inc(i)

This language quickly became too difficult to maintain because of poor design decisions of the internal structure made early on (no IR for example; doing AST resolution and generating LLVM IR in one pass is quite complex).

f2 (November 2016 - April 2017)

This time using an IR pass and a better AST, I created a language that had a focus on memory management, and how it can be handled better. It contains a Heap to Stack allocation algorithm which is actually pretty nice (imo). This is also going towards what my language will be.

struct X {
  a : Int32

struct Y {
  x : X

f :: X -> Int32
f x = x.a.

g :: Int32 -> X
g a = X{a}.

h :: Int32 -> Int32
h a = let x = X{a},

i :: Int32 -> Y
i a = Y{X{a}}.

j :: Int32 -> Int32
j a = let x = X{a},
      let y = Y{x},
      let w = y.x,
struct X {
  a : Int32

box :: Int32 -> X
box a = X{a}. -- memory is allocated here

f :: Int32 -> Int32
f i = let x = box(i),
      let a = firstThing(x),
      let b = secondThing(x),
      let c = thirdThing(x), -- memory is freed after this call
      a + b + c.

I quickly ran into problems with name resolution and modules, which I believe to have solved with my last blog post and in f3.

You may notice that all of these repositories are just pieces of languages. lang-kotlin-antlr-compiler was my first attempt at generating LLVM IR for an OOP language with Type Inference, f2 contains the language IR, and f3 contains the name resolution code. I’ll eventually merge everything into one language, but it’s good to have to algorithms and such written down and tested.

Whelp, this has been a rundown of my previous languages. Hopefully next time I come back with something worthwhile!