Repository navigation
Core 0.2.4
Changelog
- Updated Windows installer to:
- Automatically download and install the
flsalongside theflintccompiler - No longer provide
flintc.cmdandfls.cmdwrappers, since theflsdoes not work with VSCode when it's a wrapper - Made the
flintc.exeandfls.exehard links to the correct version instead - Now they both can be executed by just typing
flintcorflsinto any terminal - They now also work in any CommandPrompt in addition to the PowerShell
- LSP setup now does not require any additional work other than using the windows installer of Flint + installing the VSCode extension for syntax highlighting
- Automatically download and install the
- Completely refactored the literal system (more information)
- Changed integer and floating point literals to be arbitrary precision at compile-time
- Added the new
intandfloattypes for the compile-time arbitrary precision integer and floating point literals - Added proper size-checking for the literals when using them in a typed context, e.g. doing
var + 300whenvaris of typeu8will now result in a compile-time error - Implemented the
16-Byte RuleforSystemVABI compliancy. When usingFIPto call into external C code structures larger than 16 bytes now can be passed toextern defined functions and be returned from them too - Added pointer types to Flint:
T*, they can ONLY be used inexterncontexts, e.g. when defining extern functions or when calling them - Added the reference-of operator
&to be able to reference variables of typeTto get an result of typeT*. Because of the above mentioned rule that pointers are only allowed in extern context, using the&operator outside of calling extern functions will lead to a compilation error
use Core.print
extern def inc_x(mut i32* x);
def main():
i32 x = 10;
inc_x(&x);
print($"x = {x}\n");void inc_x(int *x) {
(*x)++;
}will print x = 11 to the console.
- Added new
Analyzerclass and in-between step (after parsing, before code-gen) to ensure no pointer-related operations are used outside of their allowed cases - Added tuple support to FIP, you now can define extern functions with tuple parameters (and return groups from extern functions)
use Core.print
extern def do_something(data<i32, i32, f32, bool> d) -> (i32, i32, f32, bool);
def main():
d := (10, 10, 3.2, false);
print($"d.($0, $1, $2, $3) = ({d.$0}, {d.$1}, {d.$2}, {d.$3})\n");
d = do_something(d);
print($"d.($0, $1, $2, $3) = ({d.$0}, {d.$1}, {d.$2}, {d.$3})\n");#include <stdbool.h>
typedef struct {
int x, y;
float speed;
bool is_something;
} MyData;
MyData do_something(const MyData md) {
MyData result = {0};
result.x = md.x + 2;
result.y = md.y + 5;
result.speed = md.speed / 2;
result.is_something = true;
return result;
}prints
d.($0, $1, $2, $3) = (10, 10, 3.2, false)
d.($0, $1, $2, $3) = (12, 15, 1.6, true)
because tuples are just structs in the view of FIP
- Completely overhauled the polymorphic variation system, for more information see here
- Fixed the
fshexample project, it was unable to compile prior - Fixed bug where multiplying two unsigned integer values would lead to a division by zero error if the left hand side was 0
- Fixed bug where the
&symbol was recognized as aBIT_ORinstead ofBIT_ANDtoken
Full Changelog: v0.2.3-core...v0.2.4-core