A fast, byte-code interpreted language

Related tags

Serialization minima
Overview

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.

    opened by TheRealMichaelWang 3
  • 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.
    opened by TheRealMichaelWang 2
  • 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.)
    opened by dumblob 2
  • 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.

    opened by TheRealMichaelWang 1
  • 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.

    opened by TheRealMichaelWang 0
  • 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")
    
    opened by TheRealMichaelWang 0
  • 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.

    opened by TheRealMichaelWang 0
Releases(0.2.2)
  • 0.2.2(Jul 30, 2021)

    While the syntax hasn't changed significantly, or for that matter at all in this release (should it ever?), several major changes and upgrades have been made to Minima's virtual machine and compiler, mostly regarding performance.

    Those changes include, but are not limited to the following:

    • Added a grey-stack area for constants that doesn't rely on dynamic allocations. Because of the fundamental nature of a stack's behavior, certain allocations for constants, not references, can utilize a contiguous block of memory.
    • Branch jumps, referred to as a skip within the opcode enum, are have their destinations pre-computed during compilation. Minima's previously, and still does utilize a stack-based branching system chiefly because it's easy to compile and doesn't impose any significant performance limitations.
    • Added tail call optimizations for top-level procedures. Labels are ultimately still utilized, but Minima's compiler may forgo including a new scope/gc clean opcode.
    • Removed windows dependent code, and added a makefile for compiling with gcc on windows.

    Also, it should be noted that a ton of other bugs were patched and fixed - pretty much every issue between #9 and #18 were fixed. And as always, if you notice any bugs or if you're so inclined to propose a feature - feel free to go and make a new issue.

    Follow this installation guide if you require detailed installation instruction or if you're not running 64-bit windows.

    Source code(tar.gz)
    Source code(zip)
    minima.exe(70.50 KB)
    setup.exe(1.57 MB)
  • 0.2.1(Jul 11, 2021)

  • 0.1.1(Jun 15, 2021)

    Minima, version 0.1.1

    The biggest additions in this update revolve around records (Minima's equivalent of C structs, although they support much much more). You can read more about records here. Other major changes include major bug fixes, most notably several involving the garbage collector.

    Aside from updates to the Minima interpreter, a small somewhat functional standard library has been added - though, at present, it's still in its's testing phase. To utilize the standard library, which includes a linked list for dynamically sized collections, unzip stl.zip and place it's contents in the same directory as minima.exe. Use the include keyword (ie include "list.min") to include the library.

    Source code(tar.gz)
    Source code(zip)
    minima.exe(49.50 KB)
    stl.zip(1.76 KB)
Owner
null
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

quantumlib 129 Sep 23, 2022
Microsoft 2.5k Sep 30, 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

null 5 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

Telkom DEV 1 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

null 3.2k Oct 1, 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

Erik Moqvist 49 Sep 9, 2022
Macesuted's Code

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

Macesuted 21 Jun 9, 2022
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

Georgi Gerganov 96 Sep 30, 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

T# 91 Jun 24, 2022
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

Leonardo Folgoni 35 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

Tech Penguin 4 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(

Elias Fleckenstein 4 May 15, 2022
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

Kareem Dabbour 4 Sep 11, 2022
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

Mattias Jansson 1.6k Sep 23, 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

Александр Вольф 19 Aug 31, 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

cristei 8 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.

null 1 Dec 26, 2021
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

Mattias Jansson 1.6k Oct 2, 2022
Tiny project to convert a .ase to a RGBA Byte array

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

Stephen Ma 3 Apr 6, 2021