← Back to context

Comment by titzer

3 years ago

The wonderful thing is that the hardware performance is there if you just dare to toss the stack. One of my long-standing projects is to build a bare metal (at least as far as userspace is considered) programming language called Virgil. It can generate really tiny binaries and doesn't rely on hardly any other software (not even C!). As LLVM and V8 and even Go get piggier and piggier, it feels more magical every day.

Is LLVM piggy?

It may be big, but at the end of the day it will produce some fast binaries if fed the right thing.

  • Build it from source and estimate the number of CPU instructions that required.

    • Name software that does nearly as good of a job for significantly faster. I think there is a huge difference between software is slow but best and class and a calculator that takes 5s to open.

from your page

    The most significant feature of Virgil that is not in other mainstream languages is the concept of initialization time. To avoid the need for a large runtime system that dynamically manages heap memory and performs garbage collection, Virgil does not allow applications to allocate memory from the heap at runtime. Instead, the Virgil compiler allows the application to run initialization routines at compilation time, while the program is being compiled. These initialization routines allow the program to pre-allocate and initialize all data structures that it will need at runtime

Is that basically Swift's ARC?

  • You pulled that from the UCLA site, which is the microcontroller version from 15 years ago. That version actually burned the entire heap into the binary and did not allow dynamic allocation. In that case, no GC, write barriers, allocation, etc was necessary.

    Today's Virgil (on GitHub) does allow dynamic allocation, but you can still initialize an arbitrarily large heap at compile time. It's not really related to ARC.

    • Oh ok thanks, sorry I just google the name trying to answer my GC related question. Maybe I missed it when skimming the github page, couldn't see a mention of memory management.

Isn't LLVM being a piggy good? As in only pay a hefty computational time price once upfront to stuff as many optimizations as you can in your binary, and make it fast forever after.

  • It takes 21 minutes to build on a 32 core machine because it's so enormous. It's a that thing translates text into binary. I love compilers; I could go into a long, drawn-out technical explanation of what it does, but really, it's a monster of insane complexity than no one can grok anymore.