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

> Compiler slow (not scalable for FB/Google scale)

I don't have any dog in this fight(I write Java/Native mostly) however I'd don't quite follow what you mean by FB/Google scale. I would consider VSCode a pretty complex piece of software and my understand is it written in TS.

Have any concrete numbers you can share that makes it not meet your bar?



The relevent point IMO is the part about "10% perf improvement is a nice feature, a 10x one is invaluable".

Essentially you have the svn branches vs git branch scenario here: svn branches were fast enough and people worked around the perf issues just fine with various strategies, bit git branches come in and change how branches are used altogether.

So sure, you can just break down the project in a lot of libs or sub projects (that's what we do here: our app is broken down in hundreds of smaller ones so we never build the whole thing), but what if you didn't have to?

Extreme case, in a magical land of fairies and unicorns: what if it was possible to git clone 100 million lines of code instantly, load them up in your editor (all of it) instantly, do all refactors/searches on the entire code instantly, live (without caches), and at every single keystroke rebuild everything, every time, with zero latency. How would that change your workflow and some architectural decisions?

This is not a real question, but just something to think about, when we're talking about a compiler that could be 10x (or more) faster.


Looks like VS Code is about 332 thousand lines of code. Facebook and Google's codebases are measured in the tens of millions of lines of code.


Yes, but how often is it that you have to compile all of the TypeScript at one of those companies all at once? In practice, your build system should be able to shard compilation of all of the TS at something of that scale over many, many machines.


Alltogether? Maybe. But for a single library or webapp it will be hardly that much. I doubt that Facebook JS frontend code is much more than VS Code.

I personally have only worked on up to medium sized projects (maybe 40000 LoC) in Typescript. I found compile times not to be a problem there, and I even though they were really on the good side of the spectrum. Didn't noticed any difference compared to similar sized C# or Java projects. All of those 3 have pretty neglible compile times compared against FB and Googles other main programming language: C++.


A 10 million line javascript file must take a heck of a long time to load in the browser :).


Google seems to be testing this theory with their adwords management web app :p


Modern JavaScript is developed in separate modules (i.e. files).


Developed, yes, but in general, your build system bundles it all up into one javascript file which is sent to the browser. Even if you don't bundle the javascript, all the code has to be sent to the browser anyways, just over multiple HTTP requests instead of one.


Except for small or basic apps, your build system is not suppose to build to only one file. It's suppose to build to a main file and separated module files. The module loader will pull in modules only when needed.


Right, but there can be many bundles for complex sites like Facebook. They can have a bundle for Messenger.com since it's a SPA, another for the FB home page, others for object pages, search pages, etc. etc....




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

Search: