titzer / virgil

A fast and lightweight native programming language
1.22k stars 42 forks source link

Looks great! #51

Closed eboatwright closed 2 years ago

eboatwright commented 2 years ago

Very RUST-y :) (My favorite programming language)

titzer commented 2 years ago

Thanks! Feel free to post comments or suggestions. I'll leave this issue open for a while if you want to post here.

Other people have inquired about Rust integration. I added a project description here.

eboatwright commented 2 years ago

Awesome!

eboatwright commented 2 years ago

Is there a way to get input from the console?

eboatwright commented 2 years ago

Also, what about adding two strings together?

titzer commented 2 years ago

You can indeed read input from stdin, and from files. There is a component System that has an implementation on every platform (even the interpreter). E.g. here is the implementation on x86-linux: https://github.com/titzer/virgil/blob/master/rt/x86-linux/System.v3

You can do basic read/writing of file descriptors through those calls.

As for strings, they are just arrays of characters; they don't have any special methods. But there is Arrays.concat that will create a new array by copying two arrays. https://github.com/titzer/virgil/blob/master/lib/util/Arrays.v3#L66

eboatwright commented 2 years ago

Ok great! Virgil is shaping up to be a great programming language! :smile: