You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because this project already includes c2v and go2v projects, so I think it will be very easy to Integrate this function. Many languages have the function of integrating other languages. Similar to go, you can integrate C code into the Go source code,example:
main.v
module main
__c_code{
#include <stdio.h>
int main1(){
printf("Hello world from c");
}
}
__go_code{
package main
import "fmt"
func main2(){
fmt.Println("Hello world from go")
}
}
fn main(){
main1()
main2()
println("hello world")
}
Use Case
be more convenient for using c and go source code libraries
Proposed Solution
No response
Other Information
No response
Acknowledgements
I may be able to implement this feature request
This feature might incur a breaking change
Version used
0.4.3
Environment details (OS name and version, etc.)
V full version: V 0.4.3 cd337e2
OS: windows, Microsoft Windows Server 2022 Datacenter v20348 64-bit
Processor: 16 cpus, 64bit, little endian,
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered:
Wouldn't that require to have Golang's tooling? I think it would make it probably co-dependent on Golang, which means, what version of Golang do you want exactly? Would you define that as @latest? What if you don't want the latest. What if you want to download modules, now you have to have a vendor dir as well?
Honestly it seems like a great feature in a Utopian Vlang, but in real life from my perspective it probably would come with many uncertainties, unneeded dependencies for many, Vlang's resources would start getting invested into integrating it with Golang.
I mean, C is pretty much established and without much tooling involved and the tooling is usually pre-installed in every system. But Golang?
Also, what if you want headers, like use other libraries, how would that be managed. Seems that even C comes with its own challenges as well.
Even in Golang, an already established for more than a decade language, the way you use C inside it is like this
package main
/*#include "mycfile.h"*/import"C"funcmain() {
C.mycfunction()
}
* Which is already supported in Vlang .
It's not like you write C inside Golang. You write C files which you just depend on in your Golang code.
Writing C inside Vlang or even worse for the matter of complexity, Golang, seems like an unnecessary added complexity to maintenance to me I don't know.
Describe the feature
Because this project already includes c2v and go2v projects, so I think it will be very easy to Integrate this function. Many languages have the function of integrating other languages. Similar to go, you can integrate C code into the Go source code,example:
main.v
module main
__c_code{
#include <stdio.h>
int main1(){
printf("Hello world from c");
}
}
__go_code{
package main
import "fmt"
func main2(){
fmt.Println("Hello world from go")
}
}
fn main(){
main1()
main2()
println("hello world")
}
Use Case
be more convenient for using c and go source code libraries
Proposed Solution
No response
Other Information
No response
Acknowledgements
Version used
0.4.3
Environment details (OS name and version, etc.)
V full version: V 0.4.3 cd337e2
OS: windows, Microsoft Windows Server 2022 Datacenter v20348 64-bit
Processor: 16 cpus, 64bit, little endian,
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: