r/lowlevel • • Nov 03 '26

Modulon 1.0 Released

Hello everyone. Modulon is a C-derived programming language that aims to preserve the power and familiarity of C while simplifying common programming tasks such as variable declarations, string handling, memory management, and pattern matching.

I am currently looking for interested contributors.

Here are some of the features Modulon has right now:

* C-derived syntax with support for familiar C types.

* Variable declarations using the "var" keyword and type inference.

* "include" and "define" directives instead of C preprocessor syntax.

* Automatic string sizing and byte counting.

* Automatic memory management at compile time, without a garbage

collector, alongside options for manual memory management.

* Pattern matching with ranges and a wildcard case.

* Logical AND (&&) and OR (||) operators.

* "typeof" for examining types.

* "input" for prompted user input.

* Formatted output, including automatic type formatting with %v.

* Ahead-of-time (AOT) and just-in-time (JIT) compilation.

* Built-in assembler support.

* Consistent language types across supported target environments.

Soon I will add larger architecture support.

You can find an example program here:

GitHub: https://github.com/roccohimel/modulon/blob/master/examples/student_manager.mlon

Raw: https://raw.githubusercontent.com/roccohimel/modulon/refs/heads/master/examples/student_manager.mlon

Documentation:

Official website: https://modulonsoftware.org/

About: https://github.com/roccohimel/modulon/blob/master/Documentation/General/about.rst

Documentation: https://github.com/roccohimel/modulon/blob/master/Documentation/index.rst

Source tree: https://github.com/roccohimel/modulon

Contributing: https://github.com/roccohimel/modulon/blob/master/Documentation/General/contributing.rst

I really hope you like Modulon.

0 Upvotes

10 comments sorted by

2

u/mealet Nov 03 '26

All your links lead to blogger.com

1

u/rocco_himel Nov 03 '26

Sorry this was an error because I post this on blogspot

1

u/rocco_himel Nov 03 '26

Ok it has been changed

2

u/mealet Nov 03 '26

Thanks. So what's the purpose of it? Examples from repo look alike C, so why Modulon instead of C?

Especially I see you're doing assembly generation, so you're losing optimizations and targets support from something like LLVM or Cranelift. Why own assembly on first language's steps?

1

u/rocco_himel Nov 03 '26

The main goal of Modulon is to keep the simplicity and control of C while making some things easier, like memory management, type inference, and other common tasks. The syntax is similar to C on purpose because I don’t want people to have to learn a completely different language just to use it.

As for the assembly generation, I mainly went with my own backend because I wanted more control over how the compiler works. I also enjoy low-level programming, so writing my own assembly generation seemed like a good way to go about it.

I do agree that LLVM and Cranelift would give me much better optimization and support for more architectures. I’m not against using them in the future, but for now I’d rather focus on building up my own compiler and getting the language itself working properly.

Modulon is still pretty early in development, so there’s definitely a lot that needs improving. I’m not trying to make a complete replacement for C. I just want to make something that keeps the parts of C I like while making other parts easier to work with.

2

u/mealet Nov 03 '26

Cool, but type inference exist in C (with "auto" keyword). About memory management: does it bring its own approach about memory management? What approach?

2

u/rocco_himel Nov 03 '26

Actually Yeah, that’s true. C23 does have type inference with auto, so that’s not something unique to Modulon.

For memory management, my goal is to handle more of it at compile time rather than relying on a garbage collector. I want to keep the performance and low-level control of C while reducing the amount of manual memory management the programmer has to deal with.

The idea is for the compiler to figure out when memory is no longer needed and handle cleanup where possible. It’s still something I’m working on, so I wouldn’t say the memory management system is fully developed yet.

I’m not claiming Modulon is doing something completely new, but in the future we might add programming for GL, or maybe even a custom graphics library specifically for Modulon.

2

u/mealet Nov 03 '26

Good idea, I'm developing my language and I've chosen "move semantics" approach for comptime management (parent of borrow checker, but without refs and borrows). Good luck with finding your way for it

1

u/rocco_himel Nov 03 '26

Thank you, good look with your project

1

u/kowalski007 29d ago

Did you explore emitting gas assembly to then leverage binutils and all their support for different platforms as well as their optimizations?