A programming language written for fun!

Overview

The Noja language

  1. Introduction
  2. Objective
  3. Show me the code!
  4. Implementation overview
  5. Supported platforms
  6. Development state
  7. Build
  8. Usage

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 CPython.

Noja is a very high level and dynamic language. It operates in the same range of abstraction as languages like Ruby, Python and Javascript.

Objective

This project aims at being an interpreter design reference, therefore it optimizes for code quality and readability. That's not to mean that it won't be feature-complete. The end goal is to have a language you can do arbitrarily complex things in.

Show me the code!

Here's an example of a noja program that orders the items in list using a bubble sort

L = [3, 2, 1];

do {
    swapped = false;

    i = 0;
    while i < count(L)-1 and not swapped: {

        if L[i+1] < L[i]: {
        
            swapped = true;
            tmp = L[i+1];
            L[i+1] = L[i];
            L[i] = tmp;
        }
        
        i = i + 1;
    }
} while swapped;

print(L, '\n'); # Outputs [1, 2, 3]

Implementation Overview

The architecture is pretty much the same as CPython. The source code is executed by compilig it to bytecode. The bytecode is much more high level than what the CPU understands, it's more like a serialized version of the AST. For example, some bytecode instructions refer to variables by names, which means the compiler does very little static analisys. Memory is managed by a garbage collector that moves and compacts allocations.

(More detailed explanations are provided alongside the code.)

Supported platforms

I wrote it on a linux machine, but there should be very few places where a linux host is assumed. It should be very easy to port.

Development state

The interpreter is fully functional, but lots of built-in functions that one would expect still need to be implemented. Unfortunately, I feel like, at the moment, this requires much more work than what it's worth. At this time the priority is writing documentation and tests so that more people can try it, give feedback and move forward without breaking the world.

Build

To build it, just run:

$ ./build.sh

it will create a build folder where the interpreter's executable will be generated.

You may need to give executable permissions to the script. You can do so with by running:

$ chmod +x build.sh

Usage

You can run files by doing:

location/of/noja run <filename>

or you can run strings by doing:

location/of/noja run inline <string>
You might also like...
funky fun fuzzer

FunkyFunFuzzer / fffz FunkyFunFuzzer / fffz is an attempt at a file fuzzer prioritising usability while striving for real-world performance. It is a m

A basic example of IoT for fun
A basic example of IoT for fun

esp32 simple led IoT A basic example of IoT for fun about Im using platformio for upload this project so u should be used that if you want to use this

A mini x86-64 assembler for fun

A mini x86-64 assembler for fun

A fast and fun layout manager for FLTK
A fast and fun layout manager for FLTK

Fl_Flow A fast and fun layout manager for FLTK Fl_Flow is a layout manager for FLTK which works in a largely different manner to existing systems you

Just a password tool that I make for fun and the sake of my fascination

Note I made this in 1 day and I only have 1 years of experience, feel free to critique my spaghetti of a code. And if 15 chars of password isn't enoug

MasterPlan is a project management software / visual idea board software. It attempts to be easy to use, lightweight, and fun.
MasterPlan is a project management software / visual idea board software. It attempts to be easy to use, lightweight, and fun.

MasterPlan is a customizeable graphical project management software for independent users or small teams. If you need to share plans across a whole co

A fun Snowfall/Rainfall Project with Interactions

snowfall Snowfall Project Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is yo

nn - a toy operating system, designed for fun

nn is a toy operating system, designed for fun (and from a position of general naïveté). i'm not sure how far it'll go, but one thing's for sure: it'll probably implement nearly nothing.

A Coding some basic rpg systems in C++ for practice and fun

demo_rpg A Coding some basic rpg systems in C++ for practice and fun. YT Playlist Designs Ideas Some quick theoretical lists that we will iterate on.

Owner
Francesco Cozzuto
Just an italian programmer. Trying to build the best software I can.
Francesco Cozzuto
Having some fun with the C++ programming language.

Having some fun with the C++ programming language. Coding Environment Text editor. Visual Studio Code for Windows Compiler. MingW GCC 6.3.0 Coding sty

Rohan Bari 4 Jan 1, 2023
PLP Project Programming Language | Programming for projects and computer science and research on computer and programming.

PLPv2b PLP Project Programming Language Programming Language for projects and computer science and research on computer and programming. What is PLP L

PLP Language 5 Aug 20, 2022
StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that of JavaScript's and TypeScript's

StarkScript StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that

EnderCommunity 5 May 10, 2022
A mini assembler for x86_64, written for fun and learning.

minias A mini assembler for x86_64, written for fun and learning. Goals: A simple, tiny, fast implementation (in that order). Assemble the output of c

null 193 Dec 9, 2022
frost is a programming language with a focus on low-friction systems programming.

❄️ frost frost programming language About frost is a programming language with a focus on low-friction systems programming.

null 4 Nov 12, 2021
The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

Wren is a small, fast, class-based concurrent scripting language Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a fami

Wren 6.1k Dec 30, 2022
Pandex is a light but FAST programming language written in C . Pandex goal is that be hard & it's good for eductional goals

The Pandex programming language version 1.0.0.3 Pandex versions release type The Pandex version has four numbers. the first number holds 1 ( or 0 in s

null 8 May 23, 2022
Tobsterlang is a simple imperative programming language, written in C++ with LLVM.

tobsterlang Tobsterlang is a simple imperative programming language, written in C++ with LLVM. One of its distinct features is the fact it uses XML in

TOBSTERA 8 Nov 11, 2021
The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.

The Synthesis ToolKit in C++ (STK) By Perry R. Cook and Gary P. Scavone, 1995--2021. This distribution of the Synthesis ToolKit in C++ (STK) contains

null 832 Jan 2, 2023