hudson-newey / 2Lang

A formal very low level systems grammer with compositable macros

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2 Lang

The worlds most efficient systems programming language

Reserved Symbols & Words

// this is a comment and will be ignored

#macroKey value

Is a macro. At compile time, it will replace all instances of #key with the value.

You can also define interpolated functions in this manner as all arguments will be accessible via the $ symbol

e.g.

#printNewLine PRINT "$1\n"

@/path/fileName.2

Will import a file to be used

By using currying, you are able to create functions which take two arguments.

Standard Library (@lib/std.2) Symbols & Words

PRINT "message"

The print keyword is used to print out text to the screen (planned; not currently functional)


;

The semi-column is an execute command. It will execute all commands in the CPU registers.

Conventions

As there is currently no syntax highlighting, we write in all capital letters (similar to SQL)

Examples

Hello World program

@lib/std.2
PRINT "Hello World!"

Cheat Hello World program

@lib/helloWorld.2
HELLO_WORLD

Localized macro example

#MY_MACRO 11011001
MY_MACRO

will produce

11011001

Macro with parameter example

#USE_PARAMETER 0000 $
USE_PARAMETER 1111

should replace $ with 1111

Compiler

Preserve the intermediary binary output

$ cargo r <filePath> -p
>

Take in an intermediary binary (.bin file)

$ cargo r <filePath> -b
>

Run in debug mode (log file reads, etc...)

$ cargo r <filePath> -d
>

About

A formal very low level systems grammer with compositable macros


Languages

Language:Rust 99.6%Language:Shell 0.4%