A powerful, strongly-typed, functional programming language.




A minimal, performant, strongly-typed, and functional programming language focused on being practical and pragmatic, yet powerful enough to create readable, performant and concise code for any problem. While SuperForth has as much to do with Forth as Javascript has with Java, it shares the same minimalist, performance oriented approach and philosophy.

Important Links

  • MSYS2 instead of Cygwin

    MSYS2 instead of Cygwin

    Cygwin's GCC creates dependency on cygwin-1.dll. MSYS2 with MINGW64 doesn't.

    To compile on MSYS2 MINGW64, on Makefile of cish remove -ldl and on Makefile of Capote add -mconsole

    Everything compiled fine, but cish is unable to compile any examples.

    The error message:

    $ cish -c -s fib.cish -o fib
    in fib.cish: row 1, col 26
    Syntax error(cannot open file).

    The guide on release page said copy stdlib directory into either cish or Capote working directory. But I found this directory are already there on both directories. I overwrote it with my downloaded stdlib anyway. Doesn't work. The last resort, I copied stdlib directory into examples directory where fib.cish is placed. Still doesn't work!

    I'm out of ideas.

    opened by ghost 12
  • New Changes in Upcast branch don't execute list.txt correctly

    New Changes in Upcast branch don't execute list.txt correctly

    Not sure how serious the issue is at the moment, I am still investigating. It looks pretty serious, but I don't think it has anything to do with the memory saftey additons made in #31, but rather the changes made in #30.

    The program segfaults because of an invalid array at IP 177.

    opened by TheRealMichaelWang 6
  • Potential Garbage Collection issue with Generics

    Potential Garbage Collection issue with Generics

    While garbage-collection can ultimately be deferred in the code-gen of a procedure that requires generic-type-parameters, it cannot be done for records/structs that have generic-type-parameters.

    The proposed solution would be to analyze inputted type arguments, which are ultimately all non-generic, and configure garbage collection trace settings based off of them.

    opened by TheRealMichaelWang 4
  • SuperForth Crashes - Attempts to create a type signature for generic for top-level code

    SuperForth Crashes - Attempts to create a type signature for generic for top-level code

    SuperForth crashes when trying to generate a type-signature while compiling top-level code(code that isn't encapsulated in a procedure).

    The following code was used: hashmap.txt:

    abstract record hash_bucket<K, V>
    final record empty_bucket<K, V> extends hash_bucket<K, V>
    final record full_bucket<K, V> extends hash_bucket<K, V> {
    	mustinit K key;
    	mustinit V value;
    final record hash_map<K, V> {
    	mustinit array<hash_bucket<K, V>> buckets = [new empty_bucket<K, V>, new empty_bucket<K, V>, new empty_bucket<K, V>, new empty_bucket<K, V>, new empty_bucket<K, V>,
    						new empty_bucket<K, V>, new empty_bucket<K, V>, new empty_bucket<K, V>, new empty_bucket<K, V>, new empty_bucket<K, V>];
    	mustinit proc<int, K> hasher;
    global readonly auto hash_map_emplace = proc<K, V>(hash_map<K, V> map, K key, V value) return nothing {
    	readonly auto rehash = proc<K, V>(hash_map<K, V> map, int new_size) return auto {
    		array<hash_bucket<K, V>> old_buckets = map.buckets;		
    		map.buckets = new hash_bucket<K, V>[new_size];
    		int i = 0;
    		while(i < new_size) {
    			map.buckets[i] = new empty_bucket<K, V>;
    			i = i + 1;
    		return old_buckets;
    	int bucket = map.hasher(key) % #map.buckets;
    	while(bucket < #map.buckets) { $find the first empty bucket after computed hash_location
    		if(map.buckets[bucket] is empty_bucket<any, any>) {
    			map.buckets[bucket] = new full_bucket<K, V> {
    				key = key;
    				value = value;
    		bucket = bucket + 1;
    	$no availible bukets were found if this code is reached
    	auto reinsert_buckets = rehash<K, V>(map, bucket + 5);
    	bucket = 0;
    	while(bucket < #reinsert_buckets) {
    		thisproc<K, V>(map, key, value);
    		bucket = bucket + 1;
    	thisproc<K, V>(map, key, value);


    include "hashmap.txt";
    include "io.sf";
    auto mymap = new hash_map<int, array<char>> {
    	hasher = proc(int i) return int {
    		return i;
    hash_map_emplace<int, array<char>>(mymap, 5, "Michael");
    hash_map_emplace<int, array<char>>(mymap, 2, "Michael");
    hash_map_emplace<int, array<char>>(mymap, 7, "Tim");

    It can be reproduced by running: superforth -cr -s test.txt.

    opened by TheRealMichaelWang 3
  • Segfault after to many heap allocations

    Segfault after to many heap allocations

    Given the following code:

    include "io.txt";
    include "string.txt";
    record cell {
    	int team_no;
    	bool is_empty = true;
    record board {
    	int rows;
    	int cols;
    	int win_cells;
    	array<array<cell>> cells;
    global array<char> team_symbols = ['X', 'O', '*', '@', '&'];
    global array<char> num_symbols = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
    global readonly auto init_board = proc(int rows, int cols, int win_cells) return board {
    	if(cols > #num_symbols or rows > #num_symbols or
    	   cols <= 0 or rows <= 0){
    		println("Error: Invalid row/col");
    	else if((win_cells > cols and win_cells > rows) or win_cells <= 0) {
    		println("Error: Invalid cells to win");
    	else {
    		board new_board = new board {
    			rows = rows;
    			cols = cols;
    			win_cells = win_cells;
    		new_board.cells = new array<cell>[rows];
    		int r = 0;
    		while(r < rows) {
    			new_board.cells[r] = new cell[cols];
    			int c = 0;
    			while(c < cols) {
    				new_board.cells[r][c] = new cell;
    				c = c + 1;
    			r = r + 1;
    	  return new_board;
    global readonly auto print_board = proc(board b) return nothing {
    	int c = 0;
    	put_char(' ');
    	while(c < b.cols) {
    		c = c + 1;
    	int r = 0;
    	while(r < b.rows) {
    		c = 0;
    		while(c < b.cols) {
    			if(b.cells[r][c].is_empty) {
    				put_char(' ');
    			else {
    			c = c + 1;
    		r = r + 1;
    int n = stoi(prompt("Board size?>"));
    global board game_board = init_board(n, n, n);

    SuperForth would simply segfault, however only when the inputted "board size" is 11 or more.

    opened by TheRealMichaelWang 3
  • Improve VM performance by reducing instruction size

    Improve VM performance by reducing instruction size

    Per this reddit thread that discussed various different methodologies of significantly speeding up SuperFetch's virtual machine - reducing the instruction size by encoding offset flags as part of the instructions opcode seemed to be the most feasible and performant because it reduces the overall size of the instruction by 3 bytes(assuming there aren't more than 256 opcode types - I'll explain that later) herby reducing cache misses, and it'll reduce the processing time per instruction by bypassing the need for runtime computation of registers and their offsets.

    A potential issue would be that there may be more than 256 (the max amount of enum types that can still fit in a byte), opcode types, there may be certain performance issues. However, instructions sizes will still have been signifgantly decreased and runtime offsetting bypassed.

    opened by TheRealMichaelWang 3
  • Add FFI with dynamic linking capabilities

    Add FFI with dynamic linking capabilities

    The next major goal would be to add an dynamically linking capabilities for c libraries to SuperForth's foreign function interface. This would enable SuperForth to utilize many existing c libraries, and open up new possibilities for significantly more complex SuperForth programs to be created.

    opened by TheRealMichaelWang 3
  • Gives a unexpected token error but gives no location of the error.

    Gives a unexpected token error but gives no location of the error.

    I made a hello world program and after changing import to include, it gave me a invalid token error but no location of the error. Here is my code: include "io.txt"; print("Hello, World!")

    opened by Xanderplayz16 2
  • Type Safety Issue with Down-casting Type Arguments for Reference-Types

    Type Safety Issue with Down-casting Type Arguments for Reference-Types

    I hadn't considered the possibility until now that one couldn't downcast safely because of mutability. See this SO thread for details.

    One potential fix I am considering is to allow down-casting for arrays, and type-check each assignment during runtime. See the upcasting branch, which will add run-time type information for runtime-typechecking and runtime-typecasting, for more information. Array assignment will leverage this new feature for safety.

    However that still leaves out regular types. I think the only soloution at this point would be to disallow implicit down-casting for record type arguments during compile time, like Java.

    opened by TheRealMichaelWang 2
  • More Compile Time Analysis

    More Compile Time Analysis

    More compile time analysis, in essence a third pass - right after the ast has finished parsing and right before the ast is fed into the compiler, would be a good idea because it gives more room to do certain types of static analysis that requires everything to be defined and all linking issues resolved before moving on to potentially platform dependent compilation.

    There is already a small amount of processing done in this phase - linking struct/record declarations, references, and creations is finalized at the end of ast parsing.

    opened by TheRealMichaelWang 2
  • Dynamic Casting doesn't account for type arguments

    Dynamic Casting doesn't account for type arguments

    Often times inherited records do some stuff with type arguments/extra stuff. There needs to be some transformation in regards to inheritance and the type tree.

    opened by TheRealMichaelWang 1
  • Add non-first-class object-messaging capabilities

    Add non-first-class object-messaging capabilities

    While it would be somewhat difficult to create object message receivers that fully support the capabilities of a first-class function, a good first step would be to implement simple object messaging capabilities that don't need first class support - for example operator overloads and constructors, which can be overloaded with different parameters and return types, are good candidates to support.

    opened by TheRealMichaelWang 1
  • 1.1.1(Jul 1, 2022)


    This project has been renamed to Cish. Development wise, several minor bug fixes have been made. In addition, a some debugging capabilities have been added to both Cish, and it's compiler Capote.

    • Tracebacks; This is the most major technical addition. Instead of poring of bytecode dumps, one can simply follow a very Python-like traceback. Screenshot (157)
    • The standard library has been reorganized and rewritten in a manner that's more ergonomic with the newest of Cish's features (ie sum types, various bits of syntactic sugar).
    • Examples have been updated as well, in a manner similar to which the standard library was updated.

    Full Changelog: https://github.com/TheRealMichaelWang/cish/compare/1.1...1.1.1

    Code Examples

    For some code examples, look in the examples folder. For even more examples, I'd recommend checking out the standard library.

    • You must download the standard library for the examples to work!
    • Place the examples folder in Capote or Cish's working directory.

    Try it out!

    • If you are using windows, you can download any of the binaries below. capote is the compiler, and cish is the interpreter.
      • Linux users have to build from source, and it's recommended you do so regardless - you can squeeze more performance out of cish if you do so.
        • To build from source, clone this repo and run the makefile, or clone Capote's repo and run the makefile.
    • Download stdlib.zip, unzip it and place the stdlib folder in either Capote or Cish's working directory.
    Source code(tar.gz)
    Source code(zip)
    capote-x64-cygwingcc.exe(297.24 KB)
    cish-x64-cygwingcc.exe(348.03 KB)
    stdlib.zip(17.65 KB)
  • 1.1(Jun 20, 2022)

    Many important bug fixes were made in this release. In addition, many amenities have been added to SuperForth:

    New Features:

    • Added Runtime Type Information
      • Supports Type-Safe downcasting (parent to child type).
      • Supports Runtime "Type Checking" (ie fallible<T> is error<any>)
      • Enables sum-types, and "enums".
    • Call stack trace backs are displayed upon a runtime error.
    • Implicit return nothing's.
    • Syntactic Sugar for procedures and code blocks
      • The fast return (=>) keyword, (ie proc(int a, int b) => a - b).
      • Code blocks with one statement don't need encapsulating brackets (ie while(true) continue;).
      • For loops (in sum, glorified while loops after abstraction).
    • Rewrote and reorganized the standard library
      • Added some common data structures (list, linked list, and hashmap).
      • Added the fallible<T> sum type for error handling and basic tuple types (pair<A, B>, triple<A, B, C>)
      • Added some basic sorting algorithms(bubble and quicksort)
    • A Compiler (emits C from cish IL)
      • Can emit Vex/PROS compatible C-code as well

    Bug Fixes:

    • Fixed many type checking bugs.
      • A runtime downcasting substitution issue (#39).
      • Record instantization issue with type arguments (#35).
      • Fixed many runtime type signature atomization issues.
      • Fixed garbage collector issues with the reset stack (#27, #21).

    Full Changelog: https://github.com/TheRealMichaelWang/superforth/compare/1.0...1.1

    What the following files are:

    | File | Description | Target Architecture | Build Date | | --- | --- | --- | --- | | superforth.exe | A cygwin gcc build of the interpreter for windows | x64 | 6/19 | | superforth-msvc-x64 | A MSVC build of the interpreter | x64 | 6/19 | | superforth-msvc-x86 | A MSVC build of the interpreter | x86 | 6/19 | | capote.exe | A cygwin gcc build of the compiler for windows | x64 | 6/19 | | stdlib.zip | A zip of the stdlib. Works with both compiler and interpeter. | N/A | N/A | | stdheader.c | A file required for the compiler. | N/A | N/A |

    Source code(tar.gz)
    Source code(zip)
    capote.exe(284.79 KB)
    stdheader.c(25.94 KB)
    stdlib.zip(5.94 KB)
    superforth-msvc-x64.exe(55.50 KB)
    superforth-msvc-x86.exe(49.00 KB)
    superforth.exe(315.98 KB)
  • 1.0(Apr 14, 2022)

    SuperForth has now reached an initial operating capacity of sorts. It now supports most, if not all the features originally planned are all implemented. It is reasonable to expect the syntax will not change signifgantly after this release. The introduced features include, but are not limited to:

    • Parametric polymorphism for both records, and functions.
      • Support for type requirements/interfaces
    • Clean and easy to use Structured programming
      • Support default values that are evaluated lazily upon every instantiation.
      • Support inheritance, and passing type parameters and other types downstream as type arguments to a parent record/struct.
    • Improved reliability
      • Enhanced escape analysis improves memory-safety, applies optimizations.
        • The overall amount of garbage-collection related bugs have been reduced signifgantly, to zero.
      • Fixed many bugs. See issue #11 to #21: these include relatively mundane bugs such as parsing errors with the AST parser to far more subtle and complex ones involving generics, garbage-collection, memory-safety, type-safety, or all at the same time.
    • Improved Performance
      • From barley faster than python to faster than Scheme, using this benchmark.
    Source code(tar.gz)
    Source code(zip)
    superforth-cygwingccx64.exe(289.61 KB)
    superforth-msvcx64.exe(106.00 KB)
    superforth-msvcx86.exe(98.50 KB)
Michael Wang
Michael Wang
A modern dynamically typed programming language that gets compiled to bytecode and is run in a virtual machine called SVM (Strawbry Virtual Machine).

Strawbry A bytecode programming language. Here is what I want Strawbry to look like: var a = 1 var b = 2 var c = a + b print(c) func sqrt(x) { re

PlebusSupremus1234 6 Jan 5, 2022
General purpose and statically typed programming language

Synthium Synthium is designed to be a systems programming language. It takes inspiration from existing systems programming languages, but also from so

Synthium Programming Language 12 Oct 16, 2021
Programming Language T#. Compiled language. In development.


Ibuki Yoshida 1 Feb 1, 2022
T# Programming Language. Interpreted language. In development. I will make this compilable later.


T# 91 Jun 24, 2022
A Simple yet Powerful and Ultrafast File Minifier

Minifier A Simple yet Powerful and Ultrafast File Minifier. Minifier will Minify your Code within Milliseconds. Usage minifier [Input File] [Output Fi

Nimsara Chamindu 2 Oct 5, 2021
Programming-Basics - This Repository Contains source codes of various programming languages. Please Contribute to make this Useful.

Programming-Basics About ❓ Want To Start your Open-Source Journey Without Facing Difficulties?,If Yes, Then You Are at The Right Place! ?? Don't Know

Mr. Ånand 67 Dec 8, 2022
Competitive Programming Language MM

MM Language MM Languageは、競技プログラミングのために開発中のプログラミング言語です。 どんなことが可能なのかは、examplesおよびexamples_outputsを参照ください。 まだ開発中の言語であるため、諸々不備があり、コンパイルエラーの行数表示さえまともに出せない状

null 21 Aug 22, 2022
the kyanite programming language

Kyanite Kyanite is a small passion-project programming language intended to be light-weight and simple to use. You can read more on the language itsel

Kyanite 5 Aug 19, 2021
λQ: A Simple Quantum Programming Language based on QWIRE.

λQ λQ: A Simple Language based on QWIRE which can be compiled to QASM. The name λQ means lambda calculus with quantum circuits. This is a term project

Wenhao Tang 5 Jul 11, 2021
A comprehensive catalog of modern and classic books on C++ programming language

A comprehensive catalog of modern and classic books on C++ programming language

Yurii Cherkasov 384 Dec 28, 2022
A minimal, toy programming language implemented in C++ and STL.

od Programming Language Mod (or ModLang) is a minimal, toy programming language implemented in C++ and STL (Standard Template Library) with no other e

Pranav Shridhar 27 Dec 4, 2022
The Scallion Programming Language

--------------------------------- The Scallion Programming Language --------------------------------- Version ------- Here's no version to download,

Scallion 3 Oct 17, 2021
My journey through learning C following the "The ANSI C programming language" book

The ANSI C programming language: Some of the exercises This is a repo containing my attempts at some of the exercices present in the "The ANSI C progr

Radhi SGHAIER 22 Nov 4, 2022
Stack based programming language

stacky WIP stack-based compiled concatenative programming language. Currently it's somewhere between B and C programming languages in universe where B

Robert Bendun 3 Sep 19, 2022
Teach the C programming language using a collection of super beginner friendly tutorials and challenges.

TeachMeCLikeIm5 You are welcome to contribute to this repo. See the CONTRIBUTING.md for more info ?? About this repo ?? A collection of super beginner

inspirezonetech 11 Nov 4, 2022
Roadmap for learning the C++ programming language for beginners and experienced devs.

Roadmap for learning the C++ programming language for beginners and experienced devs. // Дорожная карта по изучению языка программирования C++ для начинающих и практикующих.

Evgeny 1.8k Jan 1, 2023
A Simple Toy Programming Language

Tovie Lang Small toy programming language. Docs : https://github.com/Jaysmito101/tovie/wiki Examples : 1. Hello World proc_0 "Hello" 32 "World!"

Jaysmito Mukherjee 23 Dec 20, 2022
An embeddable programming language just for fun

hm3 A vapourware minimalist statically typed 'glue language' that can be embedded in C/C++/Rust projects. The implementation aims to capture the essen

null 9 Nov 22, 2021
A high level programming language which compiles to C.

What is Stilts? The goal of this project is to create a language that's nice to work with, looks and feels like Java, but maps to low level C code wit

apaz 26 Jan 7, 2023