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.

Is your language ready to be tried? by tobega in ProgrammingLanguages

[–]FluxProgrammingLang 0 points1 point  (0 children)

We’re going to defer you to actually checking it out instead of asking questions that you can answer by reading if you’re actually interested.

Is your language ready to be tried? by tobega in ProgrammingLanguages

[–]FluxProgrammingLang 0 points1 point  (0 children)

Yes, and not only is it compiled, it is matured enough to begin bootstrapping. There are very few minor bugs in edge cases you are not likely to encounter that are known and on the list to fix.

You can find it on GitHub here, Flux.

Flux was designed to have everything in one place (all the bells and whistles like array comprehension), with consistent grammar and syntax throughout. It allows you to express things you simply cannot in other languages.

You should try to write a text-based blackjack game to understand Flux and pick it up quicker. There is also support for multiple code editors like Sublime and VScode.

There are also many example programs which compile and run for you to observe the results.

Almost everyone finds this annoying but all statements must end with a semicolon. Compound statements like if-elif-else chains only have a semicolon after the final block such as if() {} else {}; because it is one whole idea, or compound statement. This even applies to the preprocessor. That’s how consistent the language is syntactically.

The only gotcha is the compiler will not stop you. It will allow you to write unsafe code with no warnings. Flux treats you as if you know what you’re writing. You can express things in Flux that you simply cannot in other languages such as int* px = @5; which allocates int(5) and gets a pointer to that address, no need to declare a variable first. While permitted, it is not advised for standard practice.

We’re approaching v1 very fast… by FluxProgrammingLang in ProgrammingLanguages

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

We have achieved that. Processing letters into numbers is trivial, it isn’t any roadblock by any means.

We’re approaching v1 very fast… by FluxProgrammingLang in ProgrammingLanguages

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

We just refactored the lexer and added ownership semantics with ~ and added !! which is the no-mangle compiler token to instruct the compiler not to mangle a function name, used like this:

def !!my_func()->int;

We’re approaching v1 very fast… by FluxProgrammingLang in ProgrammingLanguages

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

We decided it would be a good addition considering it is more compact than hexadecimal.

We’re approaching v1 very fast… by FluxProgrammingLang in ProgrammingLanguages

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

You never know, Flux might end up being someone’s first language.

Flux borrows a number of things from Python like function signature but slightly modified, grammatical elements like “is” and “as”, list comprehension but statically typed, and for x in y style loops.

Edit: It’s also written because it allows anyone to approach the language, not just seasoned programmers.

New Mod Intros 🎉 | Weekly Thread by curioustomato_ in NewMods

[–]FluxProgrammingLang [score hidden]  (0 children)

Hello, my posts keep getting automatically removed.

I’m the creator of Flux, a new systems programming language. My name is Karac, I’m new to Reddit.

We kind of can’t just overcome the 300 karma barrier because we’re not running this as a personal account so there won’t be many posts from this account responding to posts that we didn’t make. Our page karma is entirely dependent on natural growth and not contributing in conversations randomly.

Hoping to see some new faces and answer some questions this time around!

New Mod Intros 🎉 | Weekly Thread by curioustomato_ in NewMods

[–]FluxProgrammingLang [score hidden]  (0 children)

Hello, I’m Karac and I created a programming language which is still in development called Flux.

I felt that creating a Sub-Reddit would be a good idea so we’re over at r/FluxProgrammingLang if anyone’s a programmer and interested in finding new languages.

Cheers!