Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5785ecc
fix: update launch configuration for test execution and add README fo…
Ze7111 Jul 27, 2025
42a10f4
task: update subproject commit reference lib-helix
Ze7111 Jul 27, 2025
d30ea49
progress: working on the vial build system
Ze7111 Jul 29, 2025
10cb969
refactor: update generics syntax and enhance error handling in expres…
Ze7111 Aug 10, 2025
ef7d9a0
feat: enhance compilation flags for library builds and update identif…
Ze7111 Aug 10, 2025
702c58a
feat: add Library flag to Compiler enum in tooling
Ze7111 Aug 10, 2025
ee5b4a5
Add build system with Helix integration and runtime support
Ze7111 Aug 20, 2025
5a9dfca
feat: add ThreadPool implementation and architecture detection functions
Ze7111 Aug 20, 2025
fea87eb
feat: add Linkage enum, Logger class, and Target struct with methods
Ze7111 Aug 20, 2025
f9905e0
feat: add executable path retrieval and command execution functions f…
Ze7111 Aug 20, 2025
8ba35d3
refactor: rename 'Has' to 'Impl' in InstOfExpr and update related tok…
Ze7111 Aug 20, 2025
c49f03c
feat: update RequiresDecl syntax and add 'where' keyword support in p…
Ze7111 Aug 20, 2025
965f760
refactor: update interface syntax to use 'impl' instead of 'has' for …
Ze7111 Aug 20, 2025
446341d
refactor: update to new standard
Ze7111 Aug 20, 2025
fd0f983
refactor: update operator syntax to new standard
Ze7111 Aug 22, 2025
d3d9a85
Refactor operator and function declaration handling in CX-IR
Ze7111 Aug 22, 2025
8758391
refactor: remove OpDecl references and update function declaration ha…
Ze7111 Aug 22, 2025
e341fc1
refactor: update operator syntax and generic handling in EBNF and imp…
Ze7111 Aug 22, 2025
56c672d
refactor: add Helix backtrace
Ze7111 Aug 26, 2025
75e228c
refactor: enhance mangling and demangling functions, improve code rea…
Ze7111 Aug 31, 2025
53f1c32
refactor: add bound field to TypeBound and improve TypeBoundList cons…
Ze7111 Sep 1, 2025
7bd7bd4
refactor: enhance declaration parsing with bounds handling and add tr…
Ze7111 Sep 1, 2025
0a3008f
refactor: update error message for panic function and remove unused i…
Ze7111 Sep 1, 2025
994a46b
refactor: update test.hlx to meet the new standard
Ze7111 Sep 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"name": "Launch",
"target": "helix",
"args": [
"/Volumes/Development/Projects/Helix/helix-lang/tests/main.hlx",
"--emit-ast"
"tests/test.hlx"
],
"cwd": "${cwd}/helix-lang/",
"cwd": "${cwd}",
"stopAtEntry": true
}
]
Expand Down
4 changes: 2 additions & 2 deletions assets/code/arc/async-example.hlx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ async fn fetch_data() -> string {
}

fn main() {
let future: Future = spawn fetch_data(); // start a os-manged child process
let data = await future;
var future: Future = spawn fetch_data(); // start a os-manged child process
var data = await future;

for i in data:
print(f"{i=}", end=", ");
Expand Down
4 changes: 2 additions & 2 deletions assets/code/arc/control-flow-example.hlx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let x: int = 10;
var x: int = 10;

if x > 5 {
print("x is greater than 5");
Expand All @@ -12,6 +12,6 @@ unless x < 5 { // unless is the same as if not
print("x is 5 or less");
}

for let i: int = 0; i < 10; i += 1{
for var i: int = 0; i < 10; i += 1{
print(i);
}
8 changes: 4 additions & 4 deletions assets/code/arc/ffi-example.hlx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ ffi "python" import sympy as sp;
ffi "c++" import "circle.hh";

fn main() {
let eq1: sp::Eq = sp::Eq(x + y, 10)
let eq2: sp::Eq = sp::Eq(x - y, 4)
let solutions = sp.solve((eq1, eq2), (x, y)); // type inferd by the compiler
var eq1: sp::Eq = sp::Eq(x + y, 10)
var eq2: sp::Eq = sp::Eq(x - y, 4)
var solutions = sp.solve((eq1, eq2), (x, y)); // type inferd by the compiler

print(solutions);

let circle = circle::Circle{10, 20};
var circle = circle::Circle{10, 20};

print(circle->to_string());
}
8 changes: 4 additions & 4 deletions assets/code/arc/showcase.hlx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Point {
let x: int;
let y: int;
var x: int;
var y: int;

eval fn Point(self, x: int, y: int) {
self.x = x;
Expand All @@ -18,14 +18,14 @@ class Point {
}

fn main() {
let p = Point(0, 0);
var p = Point(0, 0);

for i in 1..4 {
p.move(i, i);
p.display();
}

let value: u32 = p.x as u32;
var value: u32 = p.x as u32;

match value {
0 -> print("The point is at the origin"),
Expand Down
10 changes: 5 additions & 5 deletions assets/code/arc/type-bounds-example.hlx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface Drawable {
}

class Circle derives Drawable {
let radius: float;
var radius: float;

fn Circle(self, radius: float) {
self.radius = radius;
Expand All @@ -20,7 +20,7 @@ class Circle derives Drawable {
}

class Square derives Drawable {
let side: float;
var side: float;

fn Square(self, side: float) {
self.side = side;
Expand All @@ -35,15 +35,15 @@ class Square derives Drawable {
}
}

fn draw_all(...objects: T)
requires <T> if T is Drawable {
fn <T> draw_all(...objects: T)
requires T impl Drawable {
for obj in objects {
obj.draw();
}
}

fn main() {
let shapes = (Circle(1.0), Square(1.0), Circle(2.0)); // type of tuple
var shapes = (Circle(1.0), Square(1.0), Circle(2.0)); // type of tuple

draw_all(shapes...);
}
13 changes: 6 additions & 7 deletions assets/code/language/types.hlx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ fn main() -> i32 {
delete int_holder
}

// Helix has type inference, so theres no need to specify the type of value. But any modifiers
// Helix impl type inference, so theres no need to specify the type of value. But any modifiers
// like pointers, questionable, etc. must be specified. (enforced for readability and safety)
var *value? = int_holder.get(1)

if !(value?) { // if value is null or panicked
value = Heap::construct<int>(21) // Equivalent to new int(21) in C++
}

// Helix has support for named parameters/default values
// Helix impl support for named parameters/default values
var *invalid_value? = int_holder.get(index=100) // Attempt to fetch an out-of-bounds value

if invalid_value?:
Expand All @@ -40,14 +40,14 @@ fn main() -> i32 {
// Structs in Helix are data containers with no methods.
// They can include: operator overloads, nested structs, destructors, enums, and fields.
// All fields are public by default.
struct Data {
struct <T> Data {
// Regular pointers: non-nullable, no arithmetic, and auto-dereferenced (like references in other languages).
var value: *T?
}

// Classes in Helix support methods, fields, and constructors.
// Fields are private by default, while methods and constructors are public by default.
class Holder requires <T> {
class <T> Holder {
// Unsafe pointers: nullable, allow pointer arithmetic, and require manual dereferencing.
var num_values: usize
var many_values: unsafe *Data
Expand All @@ -67,7 +67,7 @@ class Holder requires <T> {
}
}

op delete fn (self) {
fn op delete (self) {
for i in 0..self.num_values {
if self.many_values[i].value? {
Heap::drop(self.many_values[i].value)
Expand All @@ -77,8 +77,7 @@ class Holder requires <T> {
Heap::drop(self.many_values)
}

fn get(self, index: usize) -> *T?
requires <T> {
fn <T> get(self, index: usize) -> *T? {
if index < self.num_values {
return self.many_values[index].value
} else {
Expand Down
47 changes: 47 additions & 0 deletions build.hlx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
Everything in the api:
fn set_target(name: string)
fn end_target(name: string? = null)
fn set_builddir(path: string)
fn set_project(name: string)
fn set_version(version: string)
fn set_description(description: string)
fn add_links(links: vec::<string>)
fn add_link(link: string)
fn add_include(include: string)
fn add_includes(includes: vec::<string>)
fn add_source(source: string)
fn set_linkage(linkage: Linkage)
fn after_build(callback: fn (*Target) -> void)
fn before_build(callback: fn (*Target) -> void)
fn set_cxxflags(flags: vec::<string>)
fn add_define(name: string, value: string)

*/
import vial::rt::api::*;

fn build() -> i32 {

set_target("vial_runtime");
add_source("vial/rt/api.hlx");
add_source("vial/rt/logger.hlx");
add_source("vial/rt/fs.hlx");

add_include("vial/");
set_cxxflags(["-std=c++20", "-Wall", "-Wextra", "-Werror"]);
add_define("USING_MSVC", "true");
add_define("USING_CLANG", "true");
end_target();

set_target("vial_build");
add_source("vial/vial.hlx");
add_include("vial/");

set_cxxflags(["-std=c++20", "-Wall", "-Wextra", "-Werror"]);

add_define("USING_MSVC", "true" );
add_define("USING_CLANG", "true" );
end_target();

return 0;
}
10 changes: 5 additions & 5 deletions lang/arc/.hlx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


class Point {
pub let x: f32
pub let y: f32
pub var x: f32
pub var y: f32
}


Expand All @@ -15,7 +15,7 @@ class Shape {

class Circle derives Shape {
pub fn area() -> f32 { return 3.14 * radius * radius }
pub let radius: f32
pub var radius: f32
}

class Base {
Expand Down Expand Up @@ -53,12 +53,12 @@ fn make_noise(a: Box<Animal>) {
print(a.speak()) // Uses v-table lookup
}

fn make_noise(a: T) requires <T> if T has Animal {
fn <T> make_noise(a: T) requires T impl Animal {
print(a.speak()) // No v-table lookup, method is inlined
}

class SecureData {
priv let key: str
priv var key: str

pub fn get_key() -> str { return key }
}
Loading
Loading