News for hackers. Stuff that matters.
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?
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')
Re:V Programming Language by tombert on Friday March 15, 2019 @06:16PM (#19404827)
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.

Re:V Programming Language by hexane360 on Sunday March 17, 2019 @10:44AM (#19414261)
How can this be true if "V's memory management is similar to Rust but much easier to use"?
Re:V Programming Language by megous on Friday March 15, 2019 @08:13PM (#19405513)
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

Re:V Programming Language by tombert on Friday March 15, 2019 @08:43PM (#19405650)
Sorry, that's kind of what I meant, though I realize I made a mistake in how I said it.