DCMP
Data modules and func modules compose into entities with explicit behavior boundaries.
entity Bird:
data: Wings;
func: Fly;
Bird(Wings);
Flint is a statically typed, compiled language designed around transparency. Write expressive, high-level code while understanding exactly what happens at runtime. Automatic memory management through DIMA, powerful composable entities, callables and persistent locals, and interoperability with C libraries make Flint practical for real-world projects.
Flint stands out by combining high-level ergonomics with runtime transparency. Here's what makes it different:
Unlike many high-level languages, you can always understand what your code is doing. High-level syntax maps directly to predictable, inspectable behavior you can reason about.
Flint's unique DCMP paradigm combines the best of OOP and ECS. Build complex systems through composition of data and behavior, with compile-time dispatch and clear semantics.
The Flint Interop Protocol (FIP) lets you use advanced C libraries like raylib without writing bindings. Use what you need from the C ecosystem effortlessly.
DIMA (Deterministic Incremental Memory Architecture) provides automatic, garbage collection-free memory management that you can understand and predict.
Compile to optimized native code. Flint is designed to produce fast, predictable executables that perform well in real-world applications.
The Wiki provides a complete learning journey from beginner to expert. It is always up to date with every feature and rule explained, as Flint aims to be finite.
DCMP is Flint's core innovation: a new programming paradigm that elegantly combines data composition with behavior. It is based on the core idea of separating data from behaviour, and then recombining them in a declarative manner. DCMP requires a different mindset than OOP, you might need to adjust your thinking to use it effectively.
use Core.print
// Define data
data Wings:
u32 size;
u32 flight_time;
Wings(size, flight_time);
// Define behavior
func Fly requires(Wings w):
def fly():
print($"Flying for {w.flight_time} seconds\n");
// Compose into entity
entity Bird:
data: Wings;
func: Fly;
Bird(Wings);
// Use entities like objects
def main():
bird := Bird(Wings(10, 20));
bird.fly();
The FIP (Flint Interop Protocol) is a protocol-based communication library aiming to unify interop between languages. The Flint compiler communicates with specialized Interop Modules over that protocol, to enable native interop with other (compiled) languages. The C interop module is the only one working so far, but more will follow.
// Include auto-generated FIP module aliased as 'rl'
use Fip.raylib as rl
// Const data is comptime-substituted
const data Col:
u8x4 bg = u8x4(245, 245, 245, 255);
u8x4 fg = u8x4(45, 45, 45, 255);
def main():
rl.InitWindow(1280, 720, "Raylib Example");
while not rl.WindowShouldClose():
rl.BeginDrawing();
rl.ClearBackground(Col.bg);
rl.DrawText("Hello from Raylib!", 100, 200, 60, Col.fg);
rl.EndDrawing();
rl.CloseWindow();
In Flint, every function can be referenced as a callable and passed around as a value. By referencing functions as callables, its persistent local state is preserved across invocations. Through this, callables enable powerful patterns like counters, rate limiters, state machines, accumulators, and more. This all is possible thanks to Flints unique runtime which, again, aims to be as lean and transparent as possible.
use Core.print
use Core.time
def execute_function():
print("Executed\n");
def execute_maybe(fn<> function) -> bool:
persistent TimeStamp last = now();
TimeStamp current = now();
Duration elapsed = duration(last, current);
if as_unit(elapsed, TimeUnit.S) < 1.0:
return false;
function();
last = current;
return true;
def main():
fn<> task = ::execute_function;
fn<fn<> -> bool throttled = ::execute_maybe;
i32 c = 0;
while c < 4:
if throttled(task):
c++;
Ready to explore Flint? Start with the comprehensive Wiki that teaches you everything from basics to advanced features.
Follow the structured learning guides from beginner to expert. Learn the language fundamentals, core concepts, and advanced features.
Install Flint and start compiling programs. The compiler is written in C++ and is ready for real-world use in late beta.
Connect with other Flint developers on Discord. Share ideas, ask questions, and contribute to shaping the future of the language.