Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Given it is known how slow Python at starting up, I am puzzled why Mozilla continue to use it in build scripts. Perl is just as portable but starts up like 10 times faster.



I wrote the linked post and maintain the Firefox build system. The reason is that in 2018 (and for the past 10 years honestly) and it is far easier to find people who know Python than Perl. Python is essentially the lingua franca in Firefox land for systems-level tasks that don't warrant a compiled language. As I said in the post, Rust will likely infringe on Python over time due to performance, lower defect rate, long-term maintenance advantages, etc.


>As I said in the post, Rust will likely infringe on Python over time due to performance, lower defect rate, long-term maintenance advantages, etc.

Indeed. As hg is moving to use more and more Rust:

https://www.mercurial-scm.org/wiki/OxidationPlan


indygreg knows because he is the author of that wiki page. :)

https://www.mercurial-scm.org/wiki/OxidationPlan?action=info


I didn't realize that so thanks for pointing it out. But sometimes I also comment for third parties reading along to pick up some info as well.


Can't wait for a static, dependency-free hg, but sadly they aren't going to rewrite it entirely in Rust, just the speed sensitive parts. I don't care if it's written in Rust, D, Go or even C. When we picked fossil over hg and git, the Python dependency made us shy away from hg, although the CLI and the overall experience was better than git. Now we also fossil as a deployment tool; it can be a statically compiled drop anywhere binary.


I would say that there are no immidiate plans. But as libraries get portet to rust it might just make sense to start writing more features in mostly rust.

Basically I have some hope that eventaully rust will take over, however writing the core components is a critical first step and selling it for the immediate benifits is much easier then selling a complete rewrite.


> Rust will likely infringe on Python over time due to performance, lower defect rate, long-term maintenance advantages

No love for Haskell[0]? It does look like the best system scripting language out there right now... I have just never tried it to be sure :(

0: http://www.haskellforall.com/2015/01/use-haskell-for-shell-s...


I imagine there are two aspects to this, they probably started in python and have a lot of it already, and it's probably easier to gen new folks involved which I think is one of their goals.


I've built firefox from source. Python start up time is not really a problem, it's so long to build anything anyway.


I imagine a lot of the pain is for incremental builds where the build system overheads can matter a lot more.


Compile time is absolutely dominated by c++ (and now rust) compilation and linking. I doubt build system language choice will ever bubble up to relevance, so why optimize for it?


Perl is “just as portable” in the same way that a motorcycle can just as easily drive under a steamroller... it’s not gonna be pretty and there’s no easy way out if you do it.


I write Perl scripts for Windows and Linux, and I don't find portability to be especially onerous. Of course there are platform differences to keep in mind, but is that any different from any other cross-platform scripting language?


Build scripts, especially for a C++ app like Firefox, are a place where "slow startup times" are totally irrelevant.


Did you read the link we're discussing? It's in large part about why the slow startup times for Firefox's build scripts are a problem.

> Changing gears, my day job is maintaining Firefox's build system. We use Python heavily in the build system. And again, Python startup overhead is problematic. I don't have numbers offhand, but we invoke likely a few hundred Python processes as part of building Firefox. It should be several thousand. But, we've had to "hack" parts of the build system to "batch" certain build actions in single process invocations in order to avoid Python startup overhead. This undermines the ability of some build tools to formulate a reasonable understanding of the DAG and it causes a bit of pain for build system developers and makes it difficult to achieve "no-op" and fast incremental builds because we're always invoking certain Python processes because we've had to move DAG awareness out of the build backend and into Python. At some point, we'll likely replace Python code with Rust so the build system is more "pure" and easier to maintain and reason about.


>Did you read the link we're discussing? It's in large part about why the slow startup times for Firefox's build scripts are a problem.

The link we're discussing is about Python runs for the Mercurial test suite. The Firefox build is mentioned in passing. It's not what the post is discussing (and doesn't get into numbers there).


You claim that it is “totally irrelevant”. A Firefox maintainer, even in passing, claims otherwise.


Maybe not totally irrelevant, but it's in most cases not a factor compared to build times.

For tests, yes.

I can't fathom what Mozilla does for thousands of Python invocations during build. Maybe it's test runs as well?


It doesn't get into the numbers, but it expressly gets into the problems.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: