Flux is a compiled, statically typed, general purpose language with the power of C++ and readability of Python.
Offering first-class data manipulation features like packing arrays to types like integers, floats, or structs, or structs to integers, or structs to arrays. Nearly all combinations you could think of for packing, unpacking, and restructuring.
Endianness is built into the type system, and performs automatic conversion on assignments. Example: Say we have A as BE, and B as LE, and B = 0xFAF0, when we do A = B the value of A = 0xF0FA.
Pack two floats into a u64:
def ff_pack(float hi, float lo) -> u64 { float[2] parts = [hi, lo]; return (u64)parts; };
def ff_hi(u64 dd) -> float { float[2] parts = (float[2])dd; return parts[0]; };
def ff_lo(u64 dd) -> float { float[2] parts = (float[2])dd; return parts[1]; };
def ff_add(u64 a, u64 b) -> u64 { float ahi, alo, bhi, blo, s, e; ahi = ff_hi(a); alo = ff_lo(a); bhi = ff_hi(b); blo = ff_lo(b); s = ahi + bhi; e = bhi - (s - ahi); return ff_pack(s, (alo + blo) + e); };
def ff_sub(u64 a, u64 b) -> u64 { float ahi, alo, bhi, blo, s, e; ahi = ff_hi(a); alo = ff_lo(a); bhi = ff_hi(b); blo = ff_lo(b); s = ahi - bhi; e = (0.0 - bhi) - (s - ahi); return ff_pack(s, (alo - blo) + e); };
Simple templates allow generic programming without SFINAE. Opt-in ownership syntax without a borrow checker. Universal FFI with the ability to target compiled library functions. Custom operators, OOP with object traits to enforce behavior, so much it sounds too good to be true, but it's real.
I built Flux in about 8 months while homeless. I hope it becomes of use to some of you.