5 ms·
As a functional developer who doesn't care for TypeScript in any way, it's frustrating to see Deno has it "built-in". As a node developer writing pure none-com
by turblety 6y ago
As a functional developer who doesn't care for TypeScript in any way, it's frustrating to see Deno has it "built-in".
As a node developer writing pure none-compiled JavaScript, my run time is extremely fast from changing code to seeing its results. It takes milliseconds for me to run brand new code in my terminal.
If I make an index.ts file simply adding two numbers together (with no TypeScript), there is a 1 to 2 second delay while it "compiles" my "TypeScript". (Again I don't write TypeScript so I don't need this feature). I should note, subsequent runs will be faster, but as I'm developing I don't want delays between my runs.
Since it's not even native TypeScript, it's just embedded the tsc which builds and caches the compiled code, why not let TypeScript developers add their bundling pipeline in the same way as they've always done.
Anyway, I'm very interested in the fact it's built in Rust and seems to be faster than node after compilation in many aspects. Congratulations to the Deno guys and thanks for all the effort.
[edit] Correcting myself. I was wrong. As @jon889 informed me, you can actually run a `.js` file and it will skip compilation. Again I remain that the TypeScript compiler should not have been included, but the fact I don't have to use it completely mitigates my main concern.
- mrkurt 6y ago> As a node developer writing pure none-compiled JavaScript, my run time is extremely fast from changing code to seeing its results. It takes milliseconds for me to run brand new code in my terminal. Deno runs JavaScript faster than node: echo "console.log(1 + 2)" > not-ts.js time deno run not-ts.js 3 0.01s user 0.01s system 89% cpu 0.025 total time node not-ts.js 3 0.03s user 0.08s system 53% cpu 0.203 total > Since it's not even native TypeScript, it's just embedded the tsc which builds and caches the compiled code, why not let TypeScript developers add their bundling pipeline in the same way as they've always done. You can!
- turblety 6y ago> Deno runs JavaScript faster than node Yup, and that's really cool and exciting. My issue isn't with runtime timing. That's not what costs me money. Developer time is what costs money, and every change having to "recompile" my already raw JavaScript costs way more than saving 0.02s at runtime.
- jon889 6y agoCan't you just pass it a .js file and it will skip the TypeScript compiling completely?
- turblety 6y agoHaha, yup. Thats much better. Thanks!
- mrkurt 6y agoHaha that's what I was trying to demonstrate!
- NoInkling 6y agoThat's not gonna help if you're using any part of the standard library though (or presumably most 3rd-party modules), since it's written in TS, right?
- chrischen 6y agoI'd assume you can just use regular node modules in that case?
- silverwind 6y agoI assume their TS parts will be pre-compiled, at they should be.
- ricardobeat 6y agoSince typescript has no runtime, it doesn't really need to be compiled, you just strip away all the type annotations. There are tools like SWC[1] that can process TS in milliseconds if you want to skip the type checking. [1] https://swc-project.github.io/ https://swc-project.github.io/
- jfkebwjsbx 6y agoDon't ever think of trying a compiled language like C++ or Rust, then :)
- turblety 6y agoI won't :P But in seriousness, Go compiles like lightening for me. But yeah, I think everyone has their own needs when they choose their tools. I choose Node for its speed at development and runtime.
- christophilus 6y agoDunno why you’re downvoted. I’m in the same camp. Compilation speed is an important factor in choosing a language.
- triyambakam 6y agoI'm a functional enthusiast and I find it much more enjoyable in TS. There is a lot of cool and interesting functional theory that only relates to types. Having a good type system tht TS provides has also saved me so much time debugging. It's invaluable
- rhlsthrm 6y agoAny tips for how to work more functional programming into my TS code? I'm trying to learn more functional techniques.
- triyambakam 6y agoI have found it good to learn about FP in general and then practice applying that to TS.
- torb-xyz 6y agoIt's the inclusion of TypeScript by default that allows it to have a much nicer developer experience compared to Node/NPM. And as others have noted: there's no downsides for those who wish to simply use straight JavaScript.