A fast, byte-code interpreted language

Minima

Minima is a small, portable, and fast programming language written in C.

The Syntax

Minima's syntax is optimized for a fast byte-code translation at the expense of program verbosity. However, it's easy to parse and compile. You can read Minima's documentation here.

Countdown

set i to 10
while dec i {
	extern printl(i)
}

Fizz Buzz

set i to 0
while inc i <= 99 {
	if i % 15 == 0 {
		extern print("fizzbuzz")
	}
	elif i % 5 == 0{
		extern print("fizz")
	}
	elif i % 3 == 0{
		extern print("buzz")
	}
	else {
		extern print(i)
	}
	extern printl
}

Fibonacci

proc fib(n) {
	if n <= 1 {
		return n
	}
	return goproc fib(n - 1) + goproc fib(n - 2)
}
extern print(goproc fib(25))

Factorial

proc fact(n) {
	if n {
		return n * goproc fact(n - 1)
	}
	return 1
}
extern print(goproc fact(50))
Comments
  • Decriment null crashes release

    Decriment null crashes release

    While this works on the debugger, and the release build while it's being debugged, decrementing null would cause Minima to crash. The source of the bug is still being traced.

  • Constant Stack Misalign

    Constant Stack Misalign

    A constant stack misalign occured when running fibonacci:

    proc fib(n) {
    	if n <= 1 {
    		return n
    	}
    	return goproc fib(n - 1) + goproc fib(n - 2)
    }
    extern print(goproc fib(25))
    

    Ultimately the constant stack overruns it's allocated buffer because somewhere along the line while the evaluation counter is being decremented the constant counter is not being decremented. This is a serious bug because it implies one of the following:

    • A value got corrupted because of a bug in the garbage collector
    • A constant value is getting garbage collected and is treated as a garbage collector registered value
    • The whole evaluation system has a fundamental flaw that prevents it from working properly.
  • Future & ideas

    Future & ideas

    Interesting language (I kind of like the "messy" conceptual goal :wink:). I have many questions. I'll ask them incrementally on the go.

    1. any plans for concurrency (ideally one leveraging multiple CPU cores)?
    2. what are the basic types (i.e. platform independent) everything (especially composites/objects/...) builds upon? (I'd like to identify the extent to which metaprogramming is possible in this language)
    3. any general performance benchmark measurements? (ideally the state-of-the-art https://github.com/kostya/benchmarks/ )
    4. any FFI support which wouldn't need any manual work (no wrapping, no type definitions, nothing - just try to call it and either it succeeds or it sigsegv/dumps_core/etc.)
  • Memory Overflow Crash

    Memory Overflow Crash

    When the garbage collection bunds are surpassed and although they no longer they override anything complications regarding tac ability arise when the registration and allocation process is abruptly halted.

  • Location nodes for error-causing code not removed

    Location nodes for error-causing code not removed

    The nodes inserted by a compiler that ultimately result in a syntax, or runtime error are still kept. While it would be a simple matter, removing the error-nodes from a sorted, finalized batch would be problematic.

  • Inheritance

    Inheritance

    Added inheritance to Minima - it's officially an object-oriented language now. Heres a quick example to demonstrate the syntax:

    record person {
        name
        age
        proc init(name, age) {
               set this.name to name
               set this.age to age
        }
    }
    record student extends person {
        gpa
        school
        proc init(name, age, gpa, school) {
                goproc init as this.base(name, age)
                set this.gpa to gpa
                set this.school to school
        }
    }
    set michael to new student("Michael", 15, 4, "North Hollywood")
    
  • Garbage Collector not Tracing Previous Frame.

    Garbage Collector not Tracing Previous Frame.

    Because the garbage collector didn't reset the flags of the previous frames values, tracing would fail on certain values that are already marked as to-collect.

Related tags
A fast stabilizer circuit simulator

Stim Stim is a fast simulator for non-adaptive quantum stabilizer circuits. Stim is based on the stabilizer tableau representation introduced in Scott

Aug 9, 2022
Aug 7, 2022
A compiler for the Bon programming language.

bonc A compiler for the Bon programming language. About Note: This project is extremely WIP, like no executables being produced WIP Bon is a work in p

Mar 14, 2022
Base64 Encoding implementation in C Programming Language

cb64 Base64 Encoding implementation in C Programming Language Spec: https://datatracker.ietf.org/doc/html/rfc4648#page-5 Header only So just copy cb64

Dec 14, 2021
Protocol Buffers with small code size

Nanopb - Protocol Buffers for Embedded Systems Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is especially suitable for us

Aug 12, 2022
Google Protocol Buffers tools (C code generator).

About Google Protocol Buffers tools in Python 3.6+. C source code generator. Rust source code generator ( ?? ?? ?? under construction ?? ?? ?? ). prot

May 16, 2022
Macesuted's Code

Macesuted's Code 这里存放了自 2021-5-1 以来我在学习 OI 过程中于各大 OJ 所做题目的 AC 代码。 仅供个人学习参考使用,请不要直接复制这些代码以 AC 对应题目,转载请注明出处。 我的 个人博客 中包含部分题目的题解。 我在这些 OJ 上的帐号: AtCoder:

Jun 9, 2022
Morse code decoding library
Morse code decoding library

ggmorse Morse code decoding library ggmorse2.mp4 ggmorse0.mp4 ggmorse1.mp4 Try it out You can easily test the library using the free GGMorse applicati

Jul 17, 2022
T# Programming Language. Interpreted language. In development. I will make this compilable later.

The T# Programming Language WARNING! THIS LANGUAGE IS A WORK IN PROGRESS! ANYTHING CAN CHANGE AT ANY MOMENT WITHOUT ANY NOTICE! Install Install $ make

Jun 24, 2022
A simple emulator for the CHIP-8 interpreted programming language.
A simple emulator for the CHIP-8 interpreted programming language.

CHIP-8 Emulator A simple emulator for the CHIP-8 interpreted programming language written in C (SDL for graphics). About This is a really basic emulat

Jul 17, 2022
🎩 An interpreted general-purpose scripting language 🔨

Dunamis Version 0.0.0.2 - Alpha Version 1.1 An interpreted general-purpose programming language Contents Syntax Functions Variables Objects Enums Incl

Dec 21, 2021
Uwulang - functional, interpreted, weakly typed programming language written in C

uwulang UWU (Ultimate pWogwamming langUage) is a functional, interpreted, weakly typed programming language written in C. fibo :bool:if(:int:smaller(

May 15, 2022
A basic, dynamically-typed interpreted language
A basic, dynamically-typed interpreted language

Dot-K Programming Language Description Dot-K is a basic dynamically typed interpreted language written in C. To read more about the implementation, pl

Jun 2, 2022
Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C
Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C

rpmalloc - General Purpose Memory Allocator This library provides a public domain cross platform lock free thread caching 16-byte aligned memory alloc

Aug 12, 2022
Manual map shellcode (aka byte array) injector

ShellJector This little tool can download DLL from the internet and inject it as shellcode (aka byte array) into process with manual map injection. Th

Aug 6, 2022
Compile-time String to Byte Array

STB Compile-time String to Byte Array. Why? You may ask, why'd you want to do this? Well, this is a common issue in the cheat development scene, where

May 7, 2022
An extremely basic Python script to split word-based data into high and low byte files.

An extremely basic Python script to split word-based data into high and low byte files. This is for use in programming 16 bit computer ROMs.

Dec 26, 2021
Rpmalloc - Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C
Rpmalloc - Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C

rpmalloc - General Purpose Memory Allocator This library provides a public domain cross platform lock free thread caching 16-byte aligned memory alloc

Aug 8, 2022
Tiny project to convert a .ase to a RGBA Byte array

Tiny project to convert a .ase to a RGBA Byte array

Apr 6, 2021