Hacker News new | ask | show | jobs
by lucacasonato 846 days ago
You could also just use `String.prototype.padStart()` [1], and you get a nice optimized C++ implementation :D

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

3 comments

While it's not quite C++, here is Chromium's implementation: https://source.chromium.org/chromium/chromium/src/+/main:v8/...
It's Torque, which is essentially C++

https://v8.dev/_img/docs/torque/build-process.svg

While funny, worth remembering that .padStart didn't exist when left-pad was first published :)
Pass, not a Rust implementation /s
Is it even AI scale if not performed on the GPU?
No, you're right. The White House says no more C/C++ it's your civic duty.