Warning
These source codes have some known bugs that are left unfixed.
The latest Jule compiler is quite advanced and more stable than this compiler.
This compiler is the first Jule compiler developed to develop Jule's bootstrapping compiler.
It no longer gets updates and is not maintained.
Here is the latest Jule compiler
This repository is the main source tree of Jule.
It contains the reference compiler, API and standard library.
Website | Manual | Contributing | Community
Join Julenours to support Jule, explore and interact with the community.
Our main community platforms:
Warning
JuleC is still under pre development. Therefore, design changes and the like may occur in the language.
Some commits may not be fully honored due to some compiler/API errors.
Please report it with the Jule Issue Tracker if you come across something like this.
Our motivation is to develop a safe and fast programming language that focuses on systems programming. However, instead of ignoring C and C++ programming languages, which are widely used in systems programming, it is aimed to provide good interoperability support for these languages. Jule cares about security and tries to maintain the balance of performance. It guarantees memory safety and is committed to not contain undefined behavior (except Unsafe Jule), it has a reference compiler with obsessions that encourage developers to build safe software. It offers fully integrated Jule-C++ development with API and interoperability.
Showcase: quicksort.jule
fn quicksort(mut s: []int) {
if s.len <= 1 {
ret
}
let (mut i, last) = -1, s[s.len-1]
for j in s {
let mut x = &s[j]
if (unsafe{ *x <= last }) {
i++
let mut y = &s[i]
unsafe { *x, *y = *y, *x }
}
}
quicksort(s[:i])
quicksort(s[i+1:])
}
fn main() {
let mut my_slice = [1, 9, -2, 25, -24, 4623, 0, -1, 0xFD2]
outln(my_slice)
quicksort(my_slice)
outln(my_slice)
}
Jule is developed within the framework of certain design principles. These principles often follow the motivation for the emergence of Jule. Our aim is to present a design and implementation that meets these principles in the most balanced way.
- Simplicity and maintainability
- Fast and scalable development
- Performance-critical software
- Memory safety
- Immutability by default
- Efficiency and performance
- High C++ interoperability
Variables are immutable by default, and each variable is encouraged to be initialized at declaration. Safe Jule performs bounds checking and nil (aka null) checking. It is committed to have no undefined behavior. Unsafe behaviors are encouraged to be done deliberately with unsafe scopes. Please read the Unsafe Jule part of manual for more information about of Unsafe Jule.
Jule is designed to be interoperable with C++. A C++ header file dependency can be added to the Jule code and its functions can be linked. It's pretty easy to write C++ code that is compatible with the Jule code compiled by the compiler. JuleC keeps all the C++ code it uses for Jule in its api directory. This API makes it possible and easy to write C++ code that can be fully integrated into Jule.Note
Jule also has different memory management methods.
For example, thestd::memory::c
standard library provides C-like memory management.
File: sum.hpp
using namespace jule;
Int sum(const Slice<Int> slice) {
Int total{ 0 };
for (const Int x: slice)
total += x;
return total;
}
File: main.jule
use cpp "sum.hpp"
cpp fn sum([]int): int
fn main() {
let numbers = [1, 2, 3, 4, 5, 6, 7, 8]
let total = cpp.sum(numbers)
outln(total)
}
The above example demonstrates the interoperability of Jule with a C++ function that returns the total of all values of an integer slice.
The C++ header file is written entirely using the Jule API.
The Int
, and Slice
types used are part of the API.
The Int
data type is equally sensitive to the system architecture as in Jule.
The Jule source code declares to use sum.hpp
first, and binds the C++ function into Jule accordingly.
Then, a call is made from Jule and the result of the function is written to the command line.
A release is not expected until JuleC itself is developed with the Jule. The syntax and language design of the Jule programming language has emerged and is not expected to undergo major changes. When the reference compiler is rewritten with Jule, it is thought that AST, Lexer and some packages will be included in the standard library. This will be a change that will cause the official compiler's project structure to be rebuilt. The reference compiler will probably use the standard library a lot. This will also allow developers to quickly develop tools for the language by leveraging Jule's standard library.
Also several packages that are part of JuleC have already been added to the standard library. Some of these packages are std::jule::lex, std::jule::build and std::jule::constant. Since these packages are part of JuleC and are intended to be used for bootsrapping purposes, they are updated simultaneously with JuleC.
There is an idea to include a package manager in JuleC as well, although it doesn't have one yet. Jule's modern understanding of language and convenience suggests that there should be a package manager that comes with the compiler. This package manager will provide management of non-standard library packages developed and published by the community. Jule's standard library only gets updates with compiler releases.
The language and standard library will continue to evolve and change in the future but JuleC will guarantee stability since its first stable release. Some packages of the standard library (std::math, std::conv, std::unicode::utf8 or etc.) are almost complete and are not expected to undergo major changes.
All documentations about Jule and JuleC is on the website as manual.
See Jule Manual
To contribute to the website, manual or something else, please use the website repository.
If you are getting a compiler error even though you are using the officially supported compiler and standard, please let us know with the Jule Issue Tracker. If you are trying to use a standard or a compiler that is not officially supported, you can still contact us to find out about the problem. But keep in mind that since it's out of the official support, it's likely that the maintainers won't make the effort to fix it.
See compiling part of manual for supported compilers and C++ standards.
Jule supports multiple platforms. It supports development on i386, amd64 and arm64 architectures on Windows, Linux and macOS (Darwin) platforms. JuleC undertakes the effort, that the code and standard library it produces will be compatible with all these platforms. All supported platforms by JuleC are documented in the platform support part of manual.Note
Please read the install from source part of manual for compiling from source code.
When you enter the directory where the source code is located, you can find some compilation scripts for compiling of JuleC.
These scripts are written to run from the src directory:
build
: scripts used for compile.brun
: scripts used for compile and execute if compiling is successful.
JuleC aims to have a single main build file.
JuleC is in development with the Go programming language.
In src
directory.
go build -o julec.exe -v cmd\julec\main.go
go build -o julec -v cmd/julec/main.go
go build -o julec -v cmd/julec/main.go
Run the above command in your terminal, in the src
directory of Jule project.
Thanks in advance for your contribution to Jule!
Every contribution, big or small, to Jule is greatly appreciated.
The Jule project uses issues only for bug reports and proposals.
To contribute, please read the contribution guidelines.
For discussions and asking questions, please use discussions.
Regarding security, please refer to the security policy.
The JuleC and standard library is distributed under the terms of the BSD 3-Clause license.
See License Details