Lolang is a simple, fun to use, register based programming language.
Its name derives itself from the expression "lol", as well as a short term for low-level-language. In Lolang, every command should refer to a common english slang word, what ensures, that programming in Lolang is always modern and a lot of fun.
Memory is abstracted as a continuous space of registers (in fancy words, a register number is a virtual address for a memory location).
Lolang is held simple, so that new programmers (noobs) will find it easy to write their first programs. Therefore a single reference to the operational register is maintained.
Command | Description
--- | ---
trololol... | Increases operational register by number of 'ol's minus 1 (initializes with 0)
lololol... | Decreases operational register by number of 'ol's minus 1
rofl | If operational register is equal to 0, go to the command after the next
copter, otherwise continue
copter | Go to most previous
moolah | Increase operational register reference by one
yolo | Decrease operational register reference by one
dope | Set operational register reference to the value of the operational register
bra<number> | Set operational register reference to the specified number
fuuu... | Copy the value of the operational register to the register with the index of the number of 'u's minus 1 and set the operational register reference to that
swag | Output the value of the operational register as a character to
burr | Read one character from
stdin and save it to the operational register
<whitespace> | Sequence operator: execute the command before if one exists, and then execute the command after
A few more things
- Lolang source files should have the file extension .lol
- Because Lolang is such a simplistic language, comments should not be necessary and are therefore not included (though they might be included in future releases)
This package provides an implementation of Lolang: lolc. lolc is a compiler for Lolang, written in Swift, which compiles to LLVM IR and therefore acts as a frontend to LLVM.
lolc <source> [options] where options are:
option | description
--- | ---
-o <path> | specify destination file
-l | output LLVM IR
-a | output assembly file
-b | output object file
-O<char> | optimization level [
-l -a -b are greedy in this order, meaning if
-l is specified, the other two are ignored and if
-a is specified,
-b is ignored
- lolc uses a custom memory management with multi-level page tables.
- pages are allocated when accessed
- a page holds 2048 bytes, or 256 registers
- a register is 64 bit and a register index 40 bit wide
- a page table has the size of a page
The following libraries are required:
- LLVM >= 5
- Standard C library (for Linux: glibc)
The following programs are required and should be accessible via
lolc is written in Swift. So to build it it is necessary to have Swift 4 installed.
- clone this repository
ldare in your
PATH. They can normally be found in the
bindirectory of your LLVM installation directory.
- Create a pkg-config file for your LLVM installation. A utility is provided for this in the
utilsdirectory. You can use it as follows from the project root:
sudo swift utils/make-pkgconfig.swift
- Build with
swift build -c release
- Fetch the executable at the specified location, normally at
.build/release/lolcand place it where you want.
Thanks a lot to the authors of the above projects.
This project is released under the MIT license
Help us keep the lights on
0.1.2-alpha - Jan 7, 2018
This release introduces some minor, but relevant patches, most importantly:
- A program ending with a whitespace now compiles correctly
- A compiled executable now returns 0 after successful execution
0.1.1-alpha - Jan 4, 2018
This release introduces Linux compatibility. Linux compatibility was envisioned since the beginning of this project. However the first release only included a roughly tested version for MacOS. This release solves issues for Linux and was tested roughly on Arch Linux. Testing on different Linux distributions still remains to be done.
0.1.0-alpha - Oct 27, 2017
A first alpha release in initial development. Rough tests on Mac OS 10.12 were performed. No testing on Linux is done yet. Therefore only a Mach-O executable is included in this release