Skip to content

Wisdurm/Runtime

Repository files navigation

The Runtime programming language

Catch2 - Tests

The Runtime programming language

Runtime is a questionably-evaluated, classless yet purely-object-oriented, interpreted programming language.
This language was made for fun and practice, and is not intended to be used for practical purposes.

The Present

The current implementation of the interpreter is VERY inefficient. I am well aware of this, however I'm not particularly smart, and the amount of time this project has already taken also makes me not want to dive too deep in to optimization at the moment.
I definitely will keep this project in mind, and there's a chance I'll work on major improvements in the future, but for the time being, there are problems with this that I am well aware exist, but which I don't intend on fixing right now.

The Future

The standard library will almost definitely be expanded over time, to support basic stuff like io. I also want to comment to code more thouroughly to make it easier to understand. Even though this language is just a funny exersize, I still want this to be technically capable of complex things, even if no one might necessarily want to bother with such.

Building

Dependencies

Dependencies are Catch2, Tessil's ordered maps and GNU readline, the former two of which which are both vcpkg packages.
GNU readline must for the time being be installed as a shared library, for example from your distribution's package manager.
That is, for Debian 13 you would do:
sudo apt install libreadline-dev

Instructions for building

You can choose not to build tests by setting RUNTIME_BUILD_TESTS to false.

First make sure Git and Ninja are installed.
sudo apt install git ninja-build
Then install and setup vcpkg.
Vcpkg install
Cd into this repository and run:
cmake --preset=ninja-vcpkg
And finally:
cmake --build build

Examples

The Collatz Conjecture written in Runtime

#!/usr/bin/Runtime

Object(n Input())
Print(n)
While( LargerThan(n 1)
	If( Equal( Mod(n 2) 0)
		Assign(n 0 Divide(n 2) )
		# Else
		Assign(n 0 Add( Multiply(3 n) 1) )
	)
	Print(n)
)

Documentation

Documentation is available at the official Runtime site.

About

The Runtime programming language

Resources

License

Stars

Watchers

Forks