A stack based compiled systems programming language.
This is the first stable release of stas. FreeBSD and Linux are supported in their entirety. The new include system, conditional compilation, and symlink sub command allow stas to be used outside of the supporting repository directory.
The language and compiler have become stable and user friendly, and the development of stas will slow down from this point onward.
Thank you for sticking around!
-os
switch.comptime
keyword.-os freebsd
declares TARGET_FREEBSD
and -os linux
declares TARGET_LINUX
?def
keyword is used to check if a constant variable is declared.cextern
keyword. C FFI is limited to freestanding libraries.-c
switch to allow creation of object code only, for use with linking to C programs.syscall0
to syscall6
and _breakpoint
keywords have been removed from stas, now implemented with inline assembly.-dump-tok
and -trace-calls
.-unsafe
compiler switch, currently only strips assertions.const
qualifier before a function declaration. Const functions can be used inside constant expressions and be evaluated at compile time.-comptime-depth
switch for limiting recursion when evaluating compile time constant functions, default is 12.include 'file.stas'
will be searched for in the current directory of the current stas file.include <file.stas>
form will be searched for in the stas library folder, next to the stas compiler executable, located in lib/
../stas symlink
sub command. Creates a symbolic link to the stas executable in /usr/local/bin
to allow it to be invoked from anywhere.#pragma once
.rand
. A hash
library is included to store Wyrand hash functions.errno
values and handling using the errno?
function.term.stas
library for colouring text.execute_child?
get_executable_path
find_abs_path_of_executable?
and normalise_path
are among the many OS independent functions implemented.fn optional?
semantics./tmp/stas
as to not clog up your working directory.noreturn
based parser fixes.sizeof
keyword for use with automatic and buffer variables. It also can be used inside constant expressions.noeval
function attribute to disable the constant folding behavior.auto
variables has been reversed to be in line with what would be assumed.push_str
instruction, with it being pushed separately.bootstrap/
folder.--trace-calls
compiler switch. The compiled executable will have function calls traced at runtime.ret
keyword.make_bootstrap.sh
, calls test runner.continue
and break
keywords both raise unreachable code errors.envp
keyword for accessing environment variables. A getenv
function is provided.-fmerge-constants
in GCC.noreturn
, inline
and noinline
are supported.stas-vscode
extension. The extension is published at the open-vsx registry, download a copy there. If you are using vscodium, search for it in your extensions tab!addr
keyword. Used to get addresses of variables declared with the auto
keyword.ret
keyword is now checked for and is a compiler error.-r
switch to execute the file after compilation, arguments after this switch will ignored and passed to the program.-g
switch.--dump-tok
and --dump-ir
switches for dumping the compiler's inner data structures.-v
or --verbose
enables verbose mode. Compiler passes will be timed and lots of information will be dumped.<s
, >s
, <=s
, >=s
.ret
keyword are no longer implemented with a nasty hack.argv[0]
to child processes.Note: It is not recommended that you build stas and experiment with it in this state. Executable paths are hard coded, this will be cleaned up in the 0.1.2
release.
As such, there is no need for the V compiler anymore. It is tucked away in a-different-branch.
Thanks for observing me on this journey.