Skip to content
/ hail Public

An experimental systems-level programming language.

Notifications You must be signed in to change notification settings

hail-lang/hail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hail

An experimental systems-level programming language to replace C.

please note: Hail is very unfinished and probably doesn't work.

about hail

Hail is inspired by C, C++, Go, Jai, Odin, Rust, Zig and a few others. It is not memory managed at all (unlike Rust and Go). While Hail aims to have the same capabilities as C, it doesn't allow any implicit conversions.

For example, in C:

int main() {
    int my_variable = 42;
    free(my_variable); // implicitly converts `int` -> `void*`
}

In Hail, the equivalent code must contain an explicit conversion using the as keyword:

publ fun main() -> int32 {
    val my_variable = 42;
    free(my_variable as *mut uint8);
}

By default, Hail warns about possible unsafe code, but doesn't disallow it. These warnings can be disabled with #[..] attributes, similar to Rust.

For example:

publ fun main() -> int32 {
    println("Hello, world!");
    // no return
    // warning: function never returns a value
}

This can make writing code faster, for example, the int32 type implements the Default trait provided by Hail (it returns 0). If a function expects a return value but nothing is returned (like above), and the type the function returns implements Default, then the function will return the default value for that type.

The previous example implicitly returns int32::default(). Implicit returns for types that do not implement Default will likely cause undefined behavior.

About

An experimental systems-level programming language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages