Triops
Triops is designed to, as a language, define as few things as possible about the operations it performs. All it aims to do for a programmer is:
- Keep track of types, variables and constants
- Keep track of instructions and procedures
- Move values between variables and procedures
What this means, is that Triops is a sort of assembly macro language, or assembly generator language.
This starts at the typesystem, which is only based on size and alignment (and not any 'hardware types'), and ends at inline assembly.
Triops does not provide any runtime operators or procedures from the compiler, aside from procedure calling and assignment.
For anyone who wants to not first define all arithmetic operators etc, the provided core library will seamlessly provide all such standard commodities.
Rest assured, triops will still be able to do:
int a = 7;
int b = 3;
int c = a + b;
Given the correct imports (or user definitions).
Here's a quick example of what it looks like to use Triops as an assembly language:
type int is 4 bytes #intform;
type char is 1 bytes #stringform;
enum int syscalls {write = 1, exit = 60};
enum int stdout = 1;
char[] msg = "Heyaa ^.^\n";
## this program says hello using linux syscalls
entry asm {
mov #reg rax, syscalls.write;
mov #reg rdi, stdout;
mov #reg rsi, msg[0];
mov #reg rdx, msg[1];
syscall;
mov #reg rax, syscalls.exit;
mov #reg rdi, 0; ## success
syscall;
}
That was an (adapted) excerpt from the 'Triops as (x64) Assembler' document on Triops' GitHub.
Current project state
This project is in relatively active development. Aside from trying to figure out what some of the underlying datastructures should be, not all of the actual language design has been finalized yet. The original plan was to make operator overloading a big part of the language, but I'm yet sure what would be a good way to go about it. Before that, I want to get it to the state where I can start using it as an assembler standin, because I do really like what I have so far.