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

> 2. Implementation Language doesn’t matter

> I’m controversially writing our autorouter in Javascript. This is the first thing people call out, but it’s not as unreasonable as you might expect. Consider that when optimizing an algorithm, you’re basically looking at improving two things:

> Lowering the number of iterations required (make the algorithm smart) Increasing the speed of each iteration

It may be true in this domain, I wouldn’t know, but applied to software engineering in general IMO it would be a massively incorrect assumption to say choice of language doesn’t affect speed and needed number of iterations.



I think there's a fair argument to be made that when you're chasing Big O algorithmic improvements, then the effective constant terms incurred by "faster or slower language execution" are premature optimisation. The difference between Rust or hardcoded assembler compared to Javascript or VisualBasic are pretty irrelevant if you're still trying to get your exponent or polynomial terms under control.


The argument falls apart when the premise that you're chasing big O does.

Poor cache/memory/disk accesses can result in constant regressions so vast that a 'worse' algorithm actually fares better. Also, we tend to falsely settle on referring to 'O' rather than omega, theta, and average, even when we don't care about worse-case or contrived workloads. See quicksort and mergesort.

For a similar concept in another domain, see also the external memory model:

https://en.algorithmica.org/hpc/external-memory/model/


Yep. Also, js is easy to iterate on - it's more lenient than rust or say c#. Especially if you are exploring thinks, that's a huge boon. Obviously, for the same algorithm, compiled languages will be slower. Does it matter? Maybe. But time to find this algorithm is also critical - and if js helps here, it's a good choice.


But what about afterwards? You move to a more performant language or just accept that you're now invested in JS?


One or the other, probably — Facebook were sufficiently invested in PHP that they released a whole new VM for the language. In Python, one would relatively commonly extract the performance-critical sections into C (or, nowadays, Rust) and you could do the same with Node too. Or the JIT might be fast enough that it's not worthwhile.


I think Javascript might doom the autorouter to small scale designs or very long processing times, but I have never used tscircuit so maybe I'm wrong.


Believe in the cache! There's a reason most websites can be written in javascript now and not have major issues, the I/O bottleneck is more important than the raw computation. As long as the algorithm is cacheable (and this means each stage maintains partial/spatial caches!) the implementation language shouldn't be very important.

There are specific NP Hard problems that aren't spatially cacheable and we may need WASM for, but these problems tend to be nearly impossible for humans as well, so PCB designers will opt to just add some space on the board or add additional layers.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: