Replies: 6 comments 11 replies
|
The native backend directly generates executables, no linking is done. The plan is for the native backend to become the default backend (once it is fully working), with C as an optional backend. TCC will no longer be distributed with V. At first, there will likely be very little optimization done in the native backend... it needs to work, first, so if you want fully optimized code you'll still want to use the C backend. However, by default, the native backend will likely always produce less code, which may be enough of a boost that you only need the C backend for truly performance critical code. Once everything is working as it should, people can invest time in optimization for the native backend. |
|
Well, it can't hurt, but the native backend is still in very early stages, so you may run into a lot of problems. |
|
@JalonSolov The proposed move to native-by-default is concerning because the the benefits of using C as a language backend are huge — IMO it's the best design decision the V languages designers made. It's the reason V and C types map one-to-one and that C interoperability is so seamless and it sets V apart from other languages. What exactly is the rationale for adding another way to do the same thing? The only one I've seen seems to be compiler performance, but the default V-with-TCC performance is stellar and the lack performance doesn't seem to rank high on the concerns of users. Will code that wraps C code and libraries still work out of the box? One thing's for certain: going native will divert a lot of valuable developer time and energy, create confusion, and Balkanise V code bases into C and native code. |
|
@JalonSolov I'm reassured, and you're right about embedded systems — get that right and you'll be well along the path to world domination :-) I'm sure it'll all pan out if V's progress to date is anything to go by. |
|
I'm also very concerned about it being considered to ditch TCC (at least keep that one around). The ability for V to compile to C, as well as strong interop with C, is very important. Don't get me wrong, totally want a native backend too, but not at the expense of dropping the C backend and V's modified TCC. |
|
We need to make improving the native backend a Google Summer of Code project. |
Uh oh!
There was an error while loading. Please reload this page.
I was just wondering what's the general plan with "native". When outputting C, we can use "TCC" to get crazy fast compilation times and "GCC"/"Clang" to get great runtime performance. So what's the idea of having "native"? What purpose it curves? Do you plan to make it something in between or do you plan make the performance of "GCC"/"Clang" but make it as fast as possible (which make sense as they'll be no intermediate code and assembly).
If compile times is important, I would also suggest a mode (compiler switch) where the compiler will parse every file and create the executable at once rather than creating objects files and then link them.
This will be great for production builds when the end users want to compile software from source and don't want to keep the object files.
If you ask me, native is the way to go! Thanks for your work regardless!
All reactions