Repository navigation
Core 0.3.0
Changelog
- Migrated the whole build system from the old
CMake+shellbased build system to aZigbased build system. The whole Flint compiler now is able to be compiled from within Windows as well, making Windows now a "proper" target of the whole compiler, as a lot of windows-specific bugs were fixed too and everything now works on Windows as well as it does on Linux. Windows passes all the builtin regression tests with no failures. This means that Windows will be a first-class target from now onwards and it should always work exactly the same as the Linux version of theflintccompiler. - Added support for type aliasing (commit):
use Core.print
type SomeTuple data<i32, f32, u64>
def add(mut SomeTuple st):
st.($0, $1, $2) += (4, 2.2, 7);
def main():
SomeTuple st = (-10, 2.3, 2);
add(st);
print($"st.($0, $1, $2) = ({st.$0}, {st.$1}, {st.$2})\n");use Core.print
def main():
i32 num = 0;
do:
print($"num = {num}\n");
num++;
while num < 5;- Added support for annotations and implemented the first annotation,
#test_should_fail(commit):
use Core.print
use Core.assert
#test_should_fail
test "should fail":
assert(false);
def main():
print("Compile with --test to create a test binary!\n");- Added the
timeCore module (commit, merge) to provide:- functions:
now,duration,as_unit,sleepandfrom - enum types:
TimeUnit - data types:
TimeStamp,Duration
- functions:
- Added the
#test_performanceannotation to profile how long a test takes to run utilizing the new time module (commit) - Added the
get_cwd(commit) andget_path(commit) functions to thesystemCore module - Added internal mappings of error types and values to strings to enable casting of errors to strings. Greatly improved the output when an error bubbles up to the main function as well (commit)
use Core.print
use Core.assert
#test_should_fail
test "should fail":
assert(false);
def main():
print("Compile with --test to create a test binary!\n");ErrFn:
- type_id: 1912322386
- value_id: 0
- message: Special Assertion in 'myfn' function failed
error is ErrFn.AssertionFailed: "Special Assertion in 'myfn' function failed"
The given error bubbled up to the main function:
└─ ErrFn.AssertionFailed: "Special Assertion in 'myfn' function failed"
- Added support for using ranges as iterables in enhanced for loops (commit):
use Core.print
def main():
u64 start = 5;
u64 end = 10;
for (i, elem) in start..end:
print($"{i}: {elem}\n");- Added array accessing support for arrays of tuples and multi-types (commit)
- Added ability to access arrays of enums (commit)
- Added support for stacked array assignments (
arr[5][3] = 'B';) (commit, commit and commit) - Added support for stacked array accesses (
val = arr[5][3];) (commit) - Added support for splatting (commit):
use Core.print
def main():
i32x3 vec3 = (10, 20, 30);
print($"vec3 = {vec3}\n");
vec3 = vec3 * 2;
vec3 *= i32(2);
print($"vec3 = {vec3}\n");- Added syntax highlighting of Flint to GitHub via the
.gitattributesfile, Flint code is now displayed as TypeScript code on GitHub (commit) - Added regression tests for the examples in the
examplesdirectory (commit and commit) - Added short-circuit ability to the
andandorboolean binary operators (commit) - Added the
test_compilesandtest_compiles_infunctions to theutils.fttest runner file to only compile theexampletests but not run them, since they are interactive applications (commit) - Added detection of the
$"{expr}"string interpolation case, this is considered an error since you should usestr(val)instead
Fixed this very same problem in thefshexample (commit and commit) - Added the
str? flagsparameter to thetest_compiles_infunction to optionally take more arguments to makepong-2.0compile, since the linker flags (-lraylib) were missing before. Theexample_tests.fttests now fully work (commit) - Added printing of compilation performance for all example projects and compilation + runtime performance for all AOC tests (commit)
- Added
SetConsoleOutputCPcall to enable UTF-8 formatting on Windows for built Flint programs (commit) - Added building of the Flint Language Server to the
build.zigbuild system (commit) - Added
testflag to thebuild.zigbuild system (commit) - Added the
ErrExprInterpolationOnlyOneExprerror type for when an interpolation only contains a single expression and nothing else like$"{expr}", it informs the user to usestr(expr)instead (commit) - Updated all wiki tests with the new
#test_should_failannotation to make all tests which should fail succeed (commit) - Updated all wiki Tests for the new error printing system (commit)
- Changed the
--runflag to shut up in release builds (commit) - Changed the
teststarget optional to build, it was slowing down development iteration speed since it was always built (commit) - Changed the IR names of all Core module's functions to start with
<hash>.instead of__flint_, now all functions starting with__flint_are "true" internal functions which can never be called by the user on his own (for example the typecast functions or arithmetic functions) (commit) - Moved the
get_type_id_from_strfunction fromTypetoHashto make every generated ID not only dependent from the type's name but also from which file it comes. This makes the whole ID system much more reliable, which is needed for the next features (commit) - Upgraded LLVM from
19.1.7to21.1.8(commit) - Refactored the
generate_debug_printfunction to be way more useful for actual debug runtime printing of built Flint programs (commit) - Completely overhauled the
system_commandCore module function to work on Windows (commit) - Updated the
generate_get_arr_slice_functionfunction to correctly mimic the new function from the prototypes (commit) - Updated all the wiki utils test functions to use the new
get_pathfunction to normalize paths before executing the compiler inside the paths, the import tests should now work on Windows (commit) - Completely overhauled the
build.zigbuild file, it now builds a MUCH smaller LLVM installation and it is MUCH faster doing so (commit) - Removed all files of the old build system to move the transition to the
Zigbased build system forward (commit) - Removed the no longer needed scripts and tests directories, they were mostly unmaintained anyways (commit)
- Changed the signature of the
generate_string_additionfunction to return a potentialnulloptsince it can fail (commit) - Fixed memory leaks of variants holding strings (commit and commit)
- Fixed enum to string casting parsing and codegen (commit)
- Fixed bug where arrays of tuples were not properly detected as function parameter types (commit)
- Fixed bug where assigning values to an array that holds elements which are > 8 bytes would fail entirely (commit)
- Fixed bug where returning an array of tuples together with other return values was parsed incorrectly (commit)
- Fixed incorrect formatting of the builtin test-runner, it now properly prints
1 test failedinstead of1 tests failedwhen only one test failed (commit) - Fixed mistake in the
test_file_ok_infunction in theutils.ftfile which did not execute the built main inside the target cwd but only compiled it inside the target path (commit) - Fixed optional strings (
str?) being broken (commit) - Fixed arguments of function calls not being auto-cast to match, for example if the argument is a string literal or string value for a function expecting an optional string (commit)
- Fixed the problem of optional function parameters where values of the base type of the argument was passed in, all those arguments need temporary allocations since all optionals are passed by pointer to functions (commit)
- Fixed bug where the last performance test also printed the vertical bar. If it's the last test it should not print it (commit)
- Fixed the Windows build (commit)
- Fixed bugs where the
anyerrortype was not castable to a string and the error fields were not accessible on it either (commit) - Fixed mistake of hashes being absolute-path based instead of relative-path based meaning they would differ on different systems or when the project is in a different location, but the only thing changing a hash of a file should be the actual "location" the file is at (in the given project) (commit)
- Fixed the
fetch_crtpowershell script being broken (commit) - Fixed bug of
time_initfunction being internally linked instead of external (commit) - Fixed the
Zigbuild system to work on Windows (commit) - Fixed
popenandpclosesymbols not being available on Windows (commit) - Fixed mistake that printing the help via the
--helpor-hflags would exit with an exit code of1instead of0(commit) - Fixed mistake where branch preddictions were
100:0(infinite) in theenvcore module generation code (commit) - Fixed bug where the same relative path resulted in a different hash on Windows (commit)
- Fixed the
set_envfunction on Windows through a wrapper function for thesetenvfunction (commit) - Fixed incorrect static initialization order caused by LTO (commit
- Fixed incorrect
COMMIT_HASHmacro inbuild.zigcausing a malformedmetadata.jsonfile (commit) - Fixed FLS builds of the
build.zigfile (commit) - Fixed bug in the
generate_read_lines_functionwhere the return type of the function wasret.strinstead ofret.str[], causing an assertion in llvm to fire when verifying the module (commit) - Fixed bug in the
generate_enum_value_stringsfunction which led to the same enum names being generated more than once, leading to linking errors (commit) - Fixed crash in the
generate_typesfunction of thetimeCore module whenever thetimeCore module is imported (commit) - Fixed bug where the test runner would always print an empty line at the top (commit)
Full Changelog: v0.2.5-core...v0.3.0-core