3 ms·
There is no singular "gold standard". vlang is really fast, recompiling itself entirely within a couple of seconds. And Go's compiler is pretty fast for what
by burnt-resistor 1y ago
There is no singular "gold standard".
vlang is really fast, recompiling itself entirely within a couple of seconds.
And Go's compiler is pretty fast for what it does too.
No one platform has a unique monopoly on build efficiency.
And also there are build caching tools and techniques that obviate the need for recompliation altogether.
- von_lohengramm 1y ago> vlang is really fast, recompiling itself entirely within a couple of seconds. Does V still just output C and use TCC under the hood?
- shakna 1y agoYes. [0] https://github.com/vlang/v/blob/master/Makefile#L18 https://github.com/vlang/v/blob/master/Makefile#L18
- giancarlostoro 1y agoSo in theory, I can make Nim do the same?
- cb321 1y agoI use tcc with Nim all the time and it yields almost interpreted REPL-like code-iteration speed (like 100-500ms per compile-link - almost ENTER-see-results). As a warning, you need to be sure --lineDir=off in your nim.cfg or config.nims (to side-step the infinite loop mentioned in https://github.com/nim-lang/Nim/pull/23488 https://github.com/nim-lang/Nim/pull/23488). You may also need to --tlsEmulation=on if you do threads and you may want to --passL=-lm. tcc itself is quite fast. Faster for me than a Perl5 interpreter start-up for me (with both on trivial files). E.g., on an i7-1370P: tim "tcc -run /t/true.c" "/bin/perl</n" 58.7 +- 1.3 μs (AlreadySubtracted)Overhead 437 +- 14 μs tcc -run /t/true.c 589 +- 10 μs /bin/perl</n { EDIT: /n -> /dev/null and true.c is just "int main(int ac,char*av){return 0;}". }
- summarity 1y agoAh nice, I’ve been meaning to try TCC with Nim.
- stephc_int13 1y agoWe are talking about compilation speed, not the harness that you could use around it. I never tried vlang but I would say this is pretty niche, while C is a standard. AFAIK tcc is unbeaten, and if we want to be serious about compilation speed comparison, I’d say tcc is a good baseline.
- xnickb 1y agoBuild caching is nice until you have to disable it because it broke something somewhere. At which point it becomes very hard to turn it back on. In other words, one needs to have absolute trust in such tools to be able to rely on them.
- gertop 1y agoI've never had an issue with ccache and I've been using it forever. Are you using it over a networked filesystem or something like that for it to become confused about what needs recompiling?
- Kranar 1y agoVlang uses tcc though...
- pkphilip 1y agoV Lang is under appreciated. If you want to really see its simplicity and expressiveness, one look at its ORM will be enough. It is a thing of beauty: https://modules.vlang.io/orm.html https://modules.vlang.io/orm.html
- codr7 1y agoThere they go, making the same stupid mistakes as most other ORMs out there; by 1:1-mapping structs to tables as well as inventing their own SQL-dialect.
- pkphilip 1y agoThat is a valid point. There is no point in arriving at your own dialect of SQL to void using the standardised SQL.
- codr7 1y agoA better path is to use the actual features of the programming language to provide a query interface; which can offer similar features in a type safe, well integrated fashion.