This repository was archived by the owner on Nov 29, 2023. It is now read-only.
Releases: l1mey112/stas
Releases · l1mey112/stas
0.2.0 Stable
Release Changelog Complete Post - stas 0.2.0
Changelog
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!
- Native FreeBSD support.
- FreeBSD is now a cross compilation target specified using the
-osswitch. - Compile time conditional compilation using the
comptimekeyword. -os freebsddeclaresTARGET_FREEBSDand-os linuxdeclaresTARGET_LINUX?defkeyword is used to check if a constant variable is declared.- All POSIX OS specific system calls and definitions are declared seamlessly using conditional compilation.
- Basic C FFI interface using the
cexternkeyword. C FFI is limited to freestanding libraries. -cswitch to allow creation of object code only, for use with linking to C programs.- Inline assembly.
syscall0tosyscall6and_breakpointkeywords have been removed from stas, now implemented with inline assembly.- All command line argument switches have been standardised to use only one dash. For example,
-dump-tokand-trace-calls. -unsafecompiler switch, currently only strips assertions.- Pure functions using the
constqualifier before a function declaration. Const functions can be used inside constant expressions and be evaluated at compile time. - Add
-comptime-depthswitch for limiting recursion when evaluating compile time constant functions, default is 12. - Better inclusion/module system.
- Files included with the
include 'file.stas'will be searched for in the current directory of the current stas file. - Files included with the
include <file.stas>form will be searched for in the stas library folder, next to the stas compiler executable, located inlib/. ./stas symlinksub command. Creates a symbolic link to the stas executable in/usr/local/binto allow it to be invoked from anywhere.- Files may only be included once. Similar to
#pragma once. - Wyrand PRNG is used for
rand. Ahashlibrary is included to store Wyrand hash functions. - OS indepentent way to create localhost POSIX TCP sockets in the standard library.
- Support for syscall
errnovalues and handling using theerrno?function. - Stack based allocation buffer now uses a static buffer.
- Add functions inside the
term.staslibrary for colouring text. - Implementation many string manipulation functions inside the standard library.
- Many OS independent functions for interfacing with child processes, files, file paths, file descriptors and more have been implemented.
execute_child?get_executable_pathfind_abs_path_of_executable?andnormalise_pathare among the many OS independent functions implemented.- Updated old APIs in the standard library to use the
fn optional?semantics. - Outdated examples have been updated to use OS independent APIs.
- Many examples and tests cases have been added to the stas repository. Try some!
- Assembly files generated by the stas backend will reside in
/tmp/stasas to not clog up your working directory. - Bugfix: the linker is properly called when generating object files.
- Bugfix:
noreturnbased parser fixes. - Plus many undocumented bugfixes trailing along with commits.
0.1.3
Release Changelog Complete Post - stas 0.1.3
Changelog
- Complete parser rewrite and cleanup. This allows for many improvements.
- Constant variables can now be declared inside functions. They follow the same scoping rules as normal variables.
- Variable declarations can now have a constant expression to denote it's size in memory.
- Static assertions at the top level.
- New
sizeofkeyword for use with automatic and buffer variables. It also can be used inside constant expressions. - Improved error message for duplicate indentifiers.
- Constant folding is back in code generation. Was present in the V stas compiler, missing till now.
- The
noevalfunction attribute to disable the constant folding behavior. - The layout in memory of
autovariables has been reversed to be in line with what would be assumed. - String length is excluded from the
push_strinstruction, with it being pushed separately. - NASM bootstrap files have been included in the
bootstrap/folder. --trace-callscompiler switch. The compiled executable will have function calls traced at runtime.- Inline functions can now use the
retkeyword. - Test runner written in V. The accompanying file,
make_bootstrap.sh, calls test runner. continueandbreakkeywords both raise unreachable code errors.- Bugfix: fix allocated registers leaking when performing operations with automatic variables.
0.1.2: Go try stas out!
Release Changelog Complete Post - stas 0.1.2
Changelog
- New
envpkeyword for accessing environment variables. Agetenvfunction is provided. - Now portable to all Linux distributions due to proper PATH enviroment variable being parsed and read.
- Attempts to merge duplicate string literals. Similar to
-fmerge-constantsin GCC. - Rich error system showing and underlining the exact token inside the file that caused the error.
- The linker is now called when generating object files.
- Short form function declarations for functions that accept and return zero values.
- Function attributes.
noreturn,inlineandnoinlineare supported. - Simple allocation buffer in the standard library.
- Overflow checks for signed and unsigned integers.
- Bugfix: multiple fixes for unreachable scope propagation in the parser.
- Bugfix: scanner fixes for multi line character and string literals.
- Bugfix: stack shuffling operations now return correct backtraces in a parser error.
- Bugfix: fix early return scopes that caused errors with complex blocks.
- Bugfix: add error for unhandled scope that a complex block requires.
- Bugfix: if and else cases with an early return now are checked correctly in the parser.
0.1.1
Release Changelog Complete Post - stas 0.1.1
Changelog
- Visual Studio Code support for stas with the
stas-vscodeextension. 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! - Support for syntax highlighting in the Hugo static site generator, although you may need to wait for a new release from them (build it from source for the impatient).
- New
addrkeyword. Used to get addresses of variables declared with theautokeyword. - Single character literals denoted with backticks. `A`, `\n`, `0`
- Unreachable code declared after the use of the
retkeyword is now checked for and is a compiler error. - Use the
-rswitch to execute the file after compilation, arguments after this switch will ignored and passed to the program. - Scanner and token improvements, to make way for a rich error reporting system in a later release.
- Stack backtraces showing exactly what value was pushed onto the stack and where on a compiler error.
- Pretty printing of string literals in generated assembly.
- NASM backend, generates object files and annotated assembly with exported labels with the
-gswitch. - Many improvements to codegen, generated code takes up a smaller footprint.
--dump-tokand--dump-irswitches for dumping the compiler's inner data structures.- Tail recursion optimisation.
- Code generation when inlining function bodies has been improved greatly.
-vor--verboseenables verbose mode. Compiler passes will be timed and lots of information will be dumped.- Negative numbers (about time). Signed comparision has been possible with
<s,>s,<=s,>=s. - Bugfix: stack checks on branches with early returns with the
retkeyword are no longer implemented with a nasty hack. - Bugfix: consecutive inline functions with branches no longer have their labels conflict.
- Bugfix: now waits for the backend to finish and handles it's exit code.
- Bugfix: now passes a proper
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.
0.1.0: stas can compile itself!
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.