#PL #recommended #project 外国有人准备制作一个类 C 和 Haskell 并准备支持类似现在一些新语言的特性(包括语法上的),手动管理内存的编译性语言叫 Jai
它还支持反射和函数泛型、不错的新特性等
It looks like this:
counter: int =
name: string =
average: float =
counter :=
counter: int; // w/o initialize like C int counter;
sum :: (x: float, y: float, z: float) -> float {
return x + y + z;
}
print(
Vector2 :: struct {
x: float;
y: float;
}
a: [
print_int_array :: (a: [] int) -> fooSt
for i :
print("%\n", it);
print("%\n", it_index);
}
#run generate_linear_srgb(); // 支持编译时运行宏 #run invokes the compile time execution
sum :: (a: $T, b: T) -> T {
return a + b;
}
#bake sum(a,
print_any :: (a: Any) {
if a.type.type == Type_Info_Tag.FLOAT
else if // ....
}
node :: struct {
owned_a : !* node =
owned_b : !* node =
}
example: node = new node;
delete example;
#inline fn
#no_inline fn_b
它还支持反射和函数泛型、不错的新特性等
It looks like this:
counter: int =
0
;name: string =
"Jon"
;average: float =
0.5
* (x+y);counter :=
0
; // int countercounter: int; // w/o initialize like C int counter;
sum :: (x: float, y: float, z: float) -> float {
return x + y + z;
}
print(
"Sum: %\n"
, sum(1
, 2
, 3
));Vector2 :: struct {
x: float;
y: float;
}
a: [
50
] int;print_int_array :: (a: [] int) -> fooSt
for i :
0
..n-1
{print("%\n", it);
print("%\n", it_index);
}
#run generate_linear_srgb(); // 支持编译时运行宏 #run invokes the compile time execution
sum :: (a: $T, b: T) -> T {
return a + b;
}
#bake sum(a,
1
) // a += 1print_any :: (a: Any) {
if a.type.type == Type_Info_Tag.FLOAT
else if // ....
}
node :: struct {
owned_a : !* node =
null
;owned_b : !* node =
null
;}
example: node = new node;
delete example;
#inline fn
#no_inline fn_b
GitHub
JaiPrimer/JaiPrimer.md at master · BSVino/JaiPrimer
A description of Jonathan Blow's programming language, Jai - BSVino/JaiPrimer