How can I use V as a scripting language? I managed to use TinyCC as a scripting language but V seems to make more sense.
I'm also interesting in C++ interop...
This language looks pretty great. Simple, fast, nicer and lean syntax.
I'm still curious why I often see "name string" intead of "string name". I guess it's easier to parse? pythonic indent would make this language perfect.
V produces .c files, which are then compiled to .o files, like C.
Interfacing v code into a C++ app, is like interfacing with any other C library, with the addition, that you may have to write the C headers yourself (or you can cut/paste them from the produced C file).
If you want to call a C++ function from V, you have to export it from the C++ side, like you would do for a C app:
extern "C" {
int your_function(int x)
}
... and then call it from the V side like any other C function.
(https://vlang.io/docs#calling_c)
I'm also interesting in C++ interop...
This language looks pretty great. Simple, fast, nicer and lean syntax.
I'm still curious why I often see "name string" intead of "string name". I guess it's easier to parse? pythonic indent would make this language perfect.