this post was submitted on 07 Jul 2026
20 points (100.0% liked)

Programming

27627 readers
218 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS
 

Self-host your compiler, you cowards!

Several times this year, I've read about new systems programming languages, usually created with robotic help. That's great! New languages expand how we think about programming. I've noticed their compilers are almost always written in Rust.

Rust is a fine systems programming language in its own right, but a systems programming language, the kind of language meant for writing things like compilers, ought to be used for its own compiler before it's used for any other serious work.

I'm kidding about the cowards part of course. I'm sure all language designers are brave and kind, even if some look like serial killers.

@programming

@programming@programming.dev

#programming #languagedesign #rust #compilers

you are viewing a single comment's thread
view the rest of the comments
[–] ryokimball@infosec.pub 13 points 2 days ago (1 children)

Bootstrapping.

Similarly, you should be able to build the OS on the OS, which is why Android is still not a viable operating system compute-wise.

[–] Quetzalcutlass@lemmy.world 6 points 2 days ago (2 children)

Google recommends at least 64 gigabytes of RAM for building modern versions of Android (though apparently you can get away with 16 gigs with heavy use of memory compression). Has any Android device ever even come close to having that amount?

[–] MonkderVierte@lemmy.zip 2 points 1 day ago (1 children)

Min. memory requirements for a compiler? How tf?

[–] Quetzalcutlass@lemmy.world 2 points 1 day ago (1 children)

There's a breakdown in the link in my previous comment:

Why does AOSP build consume so much memory

From my experience, building a custom ROM based on AOSP indeed requires about 30-40GB of memory. It may be more for ROMs with more requirements, such as LineageOS-based ROMs.

Just lower the number of jobs!

Well, this doesn’t work. Why? The Android build process occurs in multiple stages:

  • Build dependency analysis: The build system (Soong) analyzes de build dependencies by parsing the .bp blueprint files. A dependency graph is generated to determine the build order, with relationships between thousands of modules. As far as I know, the number of jobs doesn’t matter: everything is loaded in memory, and that uses about 30 GB of memory or more with Android 14 (this includes RAM and swap). This step uses a huge fixed amount of memory, regardless of the number of jobs.

  • Compilation and Linking: these steps can be run in parallel, so the number of jobs will determine how much memory will be needed. From my experience, with 8 jobs, less than 30 GB are used.

  • Image generation: It is quite RAM-hungry, but I remember it consumes less than 10 GB on my build setup.

[–] MonkderVierte@lemmy.zip 2 points 1 day ago (1 children)

Ok, but how is a dependency tree 30 GB heavy?

[–] Quetzalcutlass@lemmy.world 3 points 1 day ago* (last edited 1 day ago)

Apparently there are thousands of code modules and Soong keeps literally everything in memory while calculating dependencies? Which makes me wonder what the hell the blueprint files actually do if it's still so absurdly heavy.

Considering how the requirements went from four gigs to over thirty over the years, it wouldn't shock me if RAM use grows exponentially with the number of modules and they just put up with it because the Google devs use cloud machines with practically infinite resources for building and therefore don't have any impetus to fix it.

[–] ryokimball@infosec.pub 3 points 2 days ago

I've seen some with 24, more commonly 12 or 16 though. Plus I've been several versions of Android running on PC