I think it is impossible~
@xland 爲何?
这不需要,因为这语言定位就不是这些
Yes, it would be very nice to support as many languages as possible.
Right now C => V works very well. C++ => V is at an early stage, but I think that supporting the entire standard is doable.
Translating dynamic languages or languages with powerful runtimes (like Go) is a lot harder, but it's definitely not impossible.
Python => V would be extremely cool.
I don't think that's a good idea. For example, haxe compiles all kinds of languages, but its performance is poor.
V should follow the golang route and make up for the deficiency of golang.
Haven't heard about Haxe, but looks like it translates to different languages.
Here we are talking about the opposite: translating other languages to V.
This will not make V slower.
C++ => V is at an early stage, but I think it's supporting the entire standard is doable.
C++ is very complex, with implicit user type conversions, function overloading, template function overloading, destructors, exceptions, two kinds of references etc. I'm finding it hard to imagine C++ code using these features being automatically ported to V in a readable format. Even for C, how would V handle global variables?
Globals are allowed in translated code. Along with some other features.
The resulting code is not very nice, but definitely readable. This will improve as the translator matures.
Globals are allowed in translated code. Along with some other features.
allowing globals in translated code only is a pretty big inconsistency (at least to me.)
this begs a few questions:
v know if a specific source file is translated?i personally think this feature should be removed in favor of either:
Updates:
.ts file must be compiled into a javascript file in order to run.--enable-globals flag
Most helpful comment
Haven't heard about Haxe, but looks like it translates to different languages.
Here we are talking about the opposite: translating other languages to V.
This will not make V slower.