Skip to content

Sundown/Solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a915f6d · Feb 15, 2025
Feb 15, 2025
Dec 26, 2024
Apr 29, 2024
Dec 30, 2024
Feb 15, 2025
Feb 15, 2025
May 23, 2024
Feb 15, 2025
Oct 22, 2024
Dec 16, 2021
Dec 30, 2024
Dec 30, 2024
Jan 30, 2024
Jan 30, 2024
Feb 15, 2025
Feb 15, 2025

Repository files navigation

Solution

An array-oriented language with a modular backend

A compiled array-oriented language running on LLVM with a modular backend to support development for multiple platforms. This compiler supports optional implicit typing so it remains safe while not getting in your way.

This project relies heavily on:

  • llir/llvm which provides LLVM generation for Go
  • participle which is used to define the parser
  • clang for the heavy lifting as linker and assembler

Demo

The following demonstrates Solution's implicit typing system, Demo is automatically typed as Int×Int and takes the minimum of the two arguments to the power of the maximum using a dyadic train.

The second function calculates the average of a numeric vector using a similar 3-arity dyadic train, however the leftmost side of this train is a function-operator combination, +/ (add-reduce) which is equivalent to a sum.

@Package dev;

Main Int  Void {
	8 Demo 2;
	dev::Avg 1 3 99;
}

Demo  Void {
	Println α (⌊*⌈) ω;
}

Avg  Void {
	Println (+/÷≢) ω;
}

Usage

go run solution.go test

go build solution.go

./solution input.sol -emit purellvm

clang libsol.c -S -emit-llvm -O0 -o libsol.ll

clang input.ll libsol.ll -Og -o bin

./bin

GPL2

About

Compiled Array Programming Language

Resources

License

Stars

Watchers

Forks

Languages