2021-11-06 14:30:09 +01:00
2021-10-31 04:17:57 +00:00
2021-11-06 14:30:09 +01:00
2021-11-06 14:07:20 +01:00
2021-11-06 14:00:41 +01:00
2021-10-31 04:17:57 +00:00
2021-11-01 03:20:07 +00:00
2021-11-06 14:30:09 +01:00
2021-10-31 04:17:57 +00:00

The Noja language

Introduction

This language was written as a personal study of how interpreters and compilers work. For this reason, the language is very basic. One of the main inspirations was the CPython's source code since it's extremely readable and has a very simple and clean architecture.

Implementation overview

The interpreter works by compiling the provided source to a bytecode format and executing it. The bytecode is very high level since it does things like:

  • explicitly referring to variables by name.

  • treating values as atomic things: from the perspective of the bytecode, a list and an integer occupy the same space on the stack, which is 1.

  • referring to instructions by their index.

All values (objects) are allocated on a garbage-collected heap. For this reason all variables are simply references to these objects. The garbage collection algorithm is a copy-and-compact one. It behaves as a bump-pointer allocator until there is space left, and when space runs out, it creates a new heap, copies all of the alive object into it, calls the destructors of the dead objects and frees the old one.

S
Description
A programming language written for fun!
Readme GPL-3.0
6.4 MiB
Languages
C 98.2%
Makefile 1%
Python 0.7%
Shell 0.1%