4 ms·
I haven’t used them yet for full sized apps, but they are both fantastic for scripting and small CLIs. Between the ease of running scripts, nice standard librar
by dcre 3y ago
I haven’t used them yet for full sized apps, but they are both fantastic for scripting and small CLIs. Between the ease of running scripts, nice standard libraries, npm ecosystem, and excellent type system, I now feel TypeScript is a better scripting language than Python or Ruby.
- triyambakam 3y agoI used to think so too, but that was because I had never really used Python. I still think Ruby is a mess, but it's so amazing how easy it is to manipulate data in Python, and so much faster. I recently wrote a Node/Bun/Deno app that parses a 5k line text file into JSON. The JavaScript on any runtime takes 30-45 seconds. The Python implementation is sub 1 second. I would not have been able to finish the tool so quickly if I were stuck relying on JS. I still love Typescript but I'm not as blind about it now.
- Jarred 3y agoWhat does the code do? 30-45 seconds to parse a 5k line text file into JSON sounds like something is going very wrong
- dcre 3y agoThat runtime doesn't make any sense. This script creates a 1,000,000 line CSV string and then parses it into JSON in 700ms with Bun, and this is doing both things the slow way, creating the string with a giant array map and join, and parsing with a giant split('\n') on newline and map. https://gist.github.com/david-crespo/8fea68cb38ea89edceb161d6b479bccd https://gist.github.com/david-crespo/8fea68cb38ea89edceb161d...