iovxw

Ark —— Go 和 Rust 的结合体

只是没人用

编译器是用go和Rust写的,github在这里:https://github.com/ark-lang/ark

官网:http://ark-lang.org/

说是系统级编程语言,可以和C无缝交互

至于为什么说是go和rust的结合体

看下面的例子就知道了(https://github.com/ark-lang/ark-docs/blob/master/IDEAS.md

struct Bar {
    name: str;
}

struct Baz {
    name: str;
}

trait Foo {
    func fooBar();
}

impl Foo for Bar {
    func fooBar() {
        println("foobar method in foo for bar %s!", name);
    }
}

impl Foo for Baz {
    func fooBar() {
        println("foobar method in foo for baz %s!", name);
    }
}


// attributes look cool
// basically generics, we need to use
// them in this case instead of saying `value: Foo` as
// a param, because a trait does not have a constant
// size that is known at compile time, so the generic
// will basically compile down to [in this case] two
// functions one for Bar, and one for Baz, then it
// will know the size of the given value.
// this might be weird to understand but its 1am and im
// ill and tired. jah bless xx
func [T: Foo] callFooBar(value: T) {

}

func main() {
    // monomorphisation????
    baz: Baz = {
        name: "baz",
    };

    bar: Bar = {
        name: "bar",
    }

    callFooBar(baz);
    callFooBar(bar);
}