Re:V Programming Language
by tombert on Friday March 15, 2019 @05:03PM
(#19404272)
This compiles to C, which (I think) means it should be able to FFI to it fairly easily?
[ Parent
| on HN ]
Re:V Programming Language
by amedvednikov on Friday March 15, 2019 @05:55PM
(#19404680)
Yes, calling C functions is as simple as C.puts('hello world')
Ah, cool, so effectively the standard library is huge :).
Question though; I'm assuming that if you're touching C, there's no extra protection added by V, right? The C will be just as unsafe as it was before, or do you add some kind of exception handling thing around it?
Re:V Programming Language
by amedvednikov on Saturday March 16, 2019 @01:49AM
(#19406541)
No extra protection right now. You have to handle error codes.
Strings are simple: 'hello'.cstr()
So are arrays: [1,2,3].carray()
But if you work with pointers, you have to be careful. Maybe I'll implement an unsafe block.
How can this be true if "V's memory management is similar to Rust but much easier to use"?
Where did you get an idea that the language has exceptions?
Looks like they just have a way to return errors if you use question mark at the end of function declaration. See "Option types" here https://vlang.io/docs