18 unstable releases (4 breaking)
Uses new Rust 2024
| new 0.8.1 | May 2, 2026 |
|---|---|
| 0.8.0 | Apr 3, 2026 |
| 0.7.3 | Jan 18, 2026 |
| 0.6.4 | Dec 23, 2025 |
| 0.4.0 | Jan 9, 2025 |
#104 in Programming languages
6MB
92K
SLoC
Contains (static library, 1MB) tinycc/prebuilt/windows-x64/msvc/tcc.lib, (static library, 635KB) tinycc/prebuilt/linux-x64/libtcc.a, (static library, 435KB) tinycc/prebuilt/windows-x64/gnu/libtcc.a, (static library, 48KB) tinycc/prebuilt/linux-x64/libtcc1.a, (static library, 57KB) libtcc1.a, (static library, 57KB) libtcc1.a and 2 more.
Atlas77
An experimental statically typed systems programming language designed to be a goofy cousin to C++.
Explore the docs »
Playground
·
Report Bug
·
Request Feature
About The Project
Atlas77 is an experimental statically typed wannabe systems language designed around a small core and everything else be userland. It compiles to C code, which is then compiled to machine code either using an external C compiler of your own (GCC/Clang/MSVC/...) or by using the embedded TinyCC compiler.
Note
A cranelift/LLVM backend is planned for the future, but for now, I'll keep focusing on the C backend as it is easier for me.
The 2 core philosophies are simple:
- Keep the core language tiny, make everything else userland.
- Safety opt-in: you pay for what you use.
Note
If you find the code to be messy, it's because it kinda is. I am sort of "speedrunning" the bootstrapping of the language, so the Rust implementation is not really the main focus right now.
Getting Started
Prerequisites
- Rust Compiler
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Or directly from their website: Rust
Installation
- Install it from Cargo
cargo install atlas_77
Note
I recommend you to build it yourself, as the version on Cargo is not up to date at all. The cargo version is lacking behind regarding bug fixes.
- Use it as a CLI
atlas_77 --help - Enjoy!
Usage
Hello World
import "std/io"
fun main() {
println("Hello, World!");
}
Fibonacci Example
import "std/io";
fun fib(n: int64) -> int64 {
if n <= 1 {
return n;
}
return fib(n - 1) + fib(n - 2);
}
fun main() {
let n: int64 = 10;
print(fib(n));
}
For more examples, see the examples folder
Features
Roadmap
v0.1 & v0.2
There never was any official v0.1 or v0.2 releases, they were just internal milestones.
v0.3 "Foundation"
Deprecated, if you want to know more about the v0.3.x, check the releases page.
v0.4 "Keystone"
Deprecated, if you want to know more about the v0.4, check the releases page.
Warning
This version no longer compiles for some reason, so the source code is still accessible, but you can't build it.
v0.5 "Phoenix"
The v0.5 was a complete rewrite of Atlas77, but because of some major design issues in syntax, semantic, memory management, compiler and everything it didn't get any more updates after the v0.5.2 (which is still accessible).
Deprecated, if you want to know more about the v0.5.x, check the releases page.
v0.6.x "Bastion"
The v0.6.x series was a redesign of Atlas77 using everything that worked in the v0.5, but making it better and more consistent. It introduced a lot of new features and improvements, including, but not limited to:
- Generics for functions and structs (not for struct methods yet)
- Multi file projects that works similarly to this semantically (yes it's bad, but it will be fixed in later versions):
#ifndef MYMODULE_ATLAS77 #define MYMODULE_ATLAS77 #endif
- Unions to allow for more flexible data structures
- Enums, only the C-like enums are supported for now
- Static access to struct methods (no static fields yet)
- References with
&and dereferencing with*
NB: They are kinda broken in this version, it's fixed in v0.7.x
- Improved standard library with more modules and functions
- Many bug fixes and performance improvements
- Introducing of
std::copyableconstraints for generics to allow only copyable types
It's only there for the groundwork of move/copy semantics in v0.7.x
Deprecated, if you want to know more about the v0.6.x, check the releases page.
v0.7.x "Covenant"
This version will focus on correctness, fix
- Introduction of move/copy semantics to enable safer code and automatic scope cleanup
- Rework of the
_copyconstructor semantics - Expansion and stabilization of parts of the standard library
- Introduction of
memcpy<T>(&T) -> Tfor explicit shallow copies - Addition of a HIR pretty printer to inspect the output of the compiler after the last HIR pass.
v0.8.x "Reforge"
This version was another rewrite, though partial in this case. It introduced and removed some features, and stabilized the language design by a lot. Here are the key features and changes:
- References: they have been fully removed from the language, as they were badly designed and hard to implement correctly as the rest of the language wasn't stabled nor mature enough to support them.
- Pointers: well, they have replaced references and are just C pointers. The compiler will only forbid returning pointers to local variables, but other than that, they are just C pointers, and you can do whatever you want with them.
- Constructors: They have also been removed in favour of factory method (e.g.:
new(),default(),with_capacity(), etc...). - C codegen: The language will now fully compile down to C code, an embedded C compiler (TinyCC) is available for convenience, but you can also use your own C compiler (GCC/Clang/MSVC/...) to compile the generated C code. The
#[c_name("foo")]attributes has been added to the compiler to let you have extern function/struct/union names properly generated in the C output despite being in a namespace or having been renamed in atlas77 for convenience or clarity.
NB: TinyCC isn't stable yet on all platforms, so for now, I recommend you to use your own C compiler, but in the future, I'll try to make it work on all platforms.
- Build configuration: A little
atlas.tomlconfiguration file has been added. It lets you tell the compiler which object files to link against, which header to find and build against. A small, somewhat workingpackagecommand has also been added to let you generate a.atlasfile from a C header so you can quickly setup a wrapper. It also isolates the header and mangle the names with a custom namespace (It also generates aatlas77-your_header.h&atlas77-your_header.cto properly separate them). e.g.: for raylib, every C function/types will start withraylib_and they will be generated into theraylibnamespace in atlas77. - Ownership: The ownership design has been reworked to be simpler and make more sense in the idea of "tiny core, everything else userland". The language uses RAII as its base, and copy/move are explicit. All types are considered to be
std::trivially_copyableby default, meaning they will get bitwise copied upon assignment or when passed to a function. Types with a custom destructor are not consideredstd::trivially_copyable, meaning they can't be passed to another variable/function/struct by value, unless youtake(),.copy()ormove()them.
NB: There are still issues with auto clean up of scopes in some edge cases, but for the most part, it works as intended.
- Stack allocation: Objects or arrays can now be allocated on the stack instead of just being heap allocated. It's done as you would in C:
let x = MyStruct { ... };orlet arr = [1, 2, 3];. The language will automatically call the destructor of the object/array when it goes out of scope, so you don't have to worry about memory leaks in this case. - Intrinsics: There are now a few set of intrinsics available for you to be able to "ask" something to the compiler. e.g.:
sizeof<T>(),alignof<T>(),move(T). A lot more to come. - Reflections: This expands on the intrinsics to add
type_of<T>()andtype_id<T>(). It's relatively crude and most probably innefficient as of writing this, but at least it exists. A smallcore::type_infotype has been added so you can manipulate and checks a bit the information of a type.
Stability and Refinement
As the language is still in alpha (not 1.0 yet), I won't make "alpha"/"beta" build, it doesn't really make sense.
The beta phase (before v1.0.0) will focus on stabilizing the language. All features will be finalized, tested extensively, and optimized for real-world use. This phase will serve as a release candidate.
See the open issues for a full list of proposed features (and known issues).
Philosophy
I am making this language for myself, to learn more about programming languages, compilers, VMs and all that stuff.
I'll try to make it easy to use, but still a bit "cringey". I hope I can at least hit one of the long-term goals.
Long-Term Goals
- Bootstrapping the compiler in Atlas77 itself
- Building a minimal ECS in pure Atlas77
- Building a simple game engine with raylib bindings
- Providing a package manager written in Atlas77
- LSP support for editors
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Top contributors:
Made with contrib.rocks.
Special thanks
Here is a list of repositories that helped me a lot while making Atlas77:
I either used them as inspiration, reference or learning material.
License
Distributed under the MIT License. See LICENSE-MIT.md for more information.
Contact
Your Name - @Gipson62_ - J.H.Gipson62@gmail.com
Project Link: https://github.com/atlas77-lang/Atlas77
Dependencies
~7–12MB
~221K SLoC