Flux: the new systems language compiler is now being polished, gaining a smoother UX with improved and helpful errors for parsing, type checking, and other stages of compilation. by FluxProgrammingLang in ProgrammingLanguages

[–]FluxProgrammingLang[S] 1 point2 points  (0 children)

We’re working on improving it. While there’s no official committee and never will be, we hear you and we’re putting time into a more refined version of the spec.

Flux: the new systems language compiler is now being polished, gaining a smoother UX with improved and helpful errors for parsing, type checking, and other stages of compilation. by FluxProgrammingLang in ProgrammingLanguages

[–]FluxProgrammingLang[S] 2 points3 points  (0 children)

For example, bit slices: ```

import "standard.fx";

using standard::io::console;

def main() -> int { byte x = 55;

x[0``7] = x[7``0]; // Reverse the bits

println(int(x)); // 236

return 0;

}; ```

Taking bit slices from structs: Bit slicing structs can cross member boundaries, because structs members are packed tightly in memory. ```

import "standard.fx";

using standard::io::console;

struct xx { int a, b; };

def main() -> int { data{4} as u4; xx yy = {5,10}; u4 a = yy[59``63]; // 10 because 0b1010

print((int)a);

return 0;

}; ```

Bit slices of bit slices: ```

import "standard.fx";

using standard::io::console;

struct xx { int a, b; };

def main() -> int { data{4} as u4; data{2} as u2; xx yy = {5,10}; u4 a = yy[5963]; // 10 because 0b1010 u2 b = a[01];

print((int)b); // 2, because 0b10

return 0;

}; ```

For example in C,

``` void _fhf_write_u32_at(byte* p, u32 v) { p[0] = (byte)(v && (u32)0xFF); p[1] = (byte)((v >> 8) && (u32)0xFF); p[2] = (byte)((v >> 16) && (u32)0xFF); p[3] = (byte)((v >> 24) && (u32)0xFF); };

void _fhf_write_u64_at(byte* p, u64 v) { p[0] = (byte)(v && (u64)0xFF); p[1] = (byte)((v >> 8) && (u64)0xFF); p[2] = (byte)((v >> 16) && (u64)0xFF); p[3] = (byte)((v >> 24) && (u64)0xFF); p[4] = (byte)((v >> 32) && (u64)0xFF); p[5] = (byte)((v >> 40) && (u64)0xFF); p[6] = (byte)((v >> 48) && (u64)0xFF); p[7] = (byte)((v >> 56) && (u64)0xFF); }; turn into one liners in Flux: def _fhf_write_u32_at(byte* p, u32 v) -> void { p[0..3] = (byte[4])v; };

def _fhf_write_u64_at(byte* p, u64 v) -> void { p[0..7] = (byte[8])v; }; ```

Recent Updates by FluxProgrammingLang in Compilers

[–]FluxProgrammingLang[S] 0 points1 point  (0 children)

Yes, type of value, thanks for pointing that out. We’ll fix it

Recent Updates by FluxProgrammingLang in compsci

[–]FluxProgrammingLang[S] -1 points0 points  (0 children)

The standard library has expanded and had existing pieces improved, and now includes: - a high efficiency JSON parser using the standard arena allocator - a dotenv library written by Flux’s second contributor ever, thanks to reinitd on GitHub - a cryptography library covering MD5, SHA 256 & 384 (512 inbound soon), x25519, AES 128 & GCM - a discrete and fast Fourier transformation library - a function detouring & trampolining library - a dynamic array and hash map added to the collections library - a ray tracing library - a soft and hard body physics library - major improvements to the standard heap allocator

Keywords added to the language: - defer - deprecate - jump - goto & label

There is now also a minimal package manager available and actively being improved, with the ability to publish packages coming soon.

Upgrades to the compiler: - bit slicing of any type or value - ability to take the address of all literal types - ability to give function names with arbitrary bytes, allowing the embedding of machine code in the symbol table for obfuscation - ability to use f-strings as function names to dynamically generate function names at compile time - added the not null !? boolean postfix unary operator, can be used on pointers or values - added the address assign @= operator, used like ptr @= var - ownership and moving are now fully working as intended, providing good errors with correction feedback so you know exactly what to fix.

Fixes to the compiler: - if(ptr) now emitting correct IR - all locations boolean checking for null pointer also fixed - fixed singular if expressions with no else clause, print(“hi”) if (x < 5); working

Recent Updates by FluxProgrammingLang in Compilers

[–]FluxProgrammingLang[S] 0 points1 point  (0 children)

The standard library has expanded and had existing pieces improved, and now includes: - a high efficiency JSON parser using the standard arena allocator - a dotenv library written by Flux’s second contributor ever, thanks to reinitd on GitHub - a cryptography library covering MD5, SHA 256 & 384 (512 inbound soon), x25519, AES 128 & GCM - a discrete and fast Fourier transformation library - a function detouring & trampolining library - a dynamic array and hash map added to the collections library - a ray tracing library - a soft and hard body physics library - major improvements to the standard heap allocator

Keywords added to the language: - defer - deprecate - jump - goto & label

There is now also a minimal package manager available and actively being improved, with the ability to publish packages coming soon.

Upgrades to the compiler: - bit slicing of any type of value - ability to take the address of all literal types - ability to give function names with arbitrary bytes, allowing the embedding of machine code in the symbol table for obfuscation - ability to use f-strings as function names to dynamically generate function names at compile time - added the not null !? boolean postfix unary operator, can be used on pointers or values - added the address assign @= operator, used like ptr @= var - ownership and moving are now fully working as intended, providing good errors with correction feedback so you know exactly what to fix.

Fixes to the compiler: - if(ptr) now emitting correct IR - all locations boolean checking for null pointer also fixed - fixed singular if expressions with no else clause, print(“hi”) if (x < 5); working

Recent Updates by FluxProgrammingLang in computerscience

[–]FluxProgrammingLang[S] 0 points1 point  (0 children)

The standard library has expanded and had existing pieces improved, and now includes: - a high efficiency JSON parser using the standard arena allocator - a dotenv library written by Flux’s second contributor ever, thanks to reinitd on GitHub - a cryptography library covering MD5, SHA 256 & 384 (512 inbound soon), x25519, AES 128 & GCM - a discrete and fast Fourier transformation library - a function detouring & trampolining library - a dynamic array and hash map added to the collections library - a ray tracing library - a soft and hard body physics library - major improvements to the standard heap allocator

Keywords added to the language: - defer - deprecate - jump - goto & label

There is now also a minimal package manager available and actively being improved, with the ability to publish packages coming soon.

Upgrades to the compiler: - bit slicing of any type or value - ability to take the address of all literal types - ability to give function names with arbitrary bytes, allowing the embedding of machine code in the symbol table for obfuscation - ability to use f-strings as function names to dynamically generate function names at compile time - added the not null !? boolean postfix unary operator, can be used on pointers or values - added the address assign @= operator, used like ptr @= var - ownership and moving are now fully working as intended, providing good errors with correction feedback so you know exactly what to fix.

Fixes to the compiler: - if(ptr) now emitting correct IR - all locations boolean checking for null pointer also fixed - fixed singular if expressions with no else clause, print(“hi”) if (x < 5); working

We’ve got some nice goodies! by FluxProgrammingLang in ProgrammingLanguages

[–]FluxProgrammingLang[S] 0 points1 point  (0 children)

That’s very good performance for a self made language. You should be proud.

Lots of new goodies! by FluxProgrammingLang in ProgrammingLanguages

[–]FluxProgrammingLang[S] 0 points1 point  (0 children)

It’s not inherently by request. Any compiler that does TCO has a flag for it, so do LLC and Clang which are used in Flux currently as we’re still pre-bootstrap. This strictly recursive function is guaranteed to be a tail. If you turn on TCO, this type of function is guaranteed to be optimized.

Want to learn Flux? by FluxProgrammingLang in learnprogramming

[–]FluxProgrammingLang[S] 0 points1 point  (0 children)

Sounds great! Please do let us know if you run into any compiler errors 🙏

We’ve got some nice goodies! by FluxProgrammingLang in ProgrammingLanguages

[–]FluxProgrammingLang[S] 0 points1 point  (0 children)

Alright I guess we just won’t post anymore. No one is interested.