News for hackers. Stuff that matters.
Re:Modern Javascript: Everything you missed over the last 10... by osmarks on Saturday May 15, 2021 @01:43PM (#27167280)
Why is the transpilation step an issue? You can set it up to happen whenever the file is changed with most things.
Re:Modern Javascript: Everything you missed over the last 10... by cesarb on Saturday May 15, 2021 @03:45PM (#27168311)
Because it's no longer the same language. You're not programming in JavaScript, you're programming in TypeScript, which happens to be compiled to something JavaScript engines accept. All the praise towards TypeScript does not necessarily apply to JavaScript. It would be like praising Assembly while you're actually programming in C.
Re:Modern Javascript: Everything you missed over the last 10... by goodoldneon on Saturday May 15, 2021 @06:52PM (#27169704)
AFAIK, the only difference between TS and JS is types. TS doesn't give you anything that's functionally different than JS -- only types that are stripped during compilation. You can't perform any logic on types at all (e.g. you can't have conditional logic based on interfaces).

Comparing assembly/C to JS/TS doesn't make sense.

Re:Modern Javascript: Everything you missed over the last 10... by CRConrad on Sunday May 16, 2021 @05:15PM (#27177064)
Yeah, and the only difference between C and machine code is that C hasn't been compiled yet. The comparison makes perfect sense.
Re:Modern Javascript: Everything you missed over the last 10... by goodoldneon on Sunday May 16, 2021 @06:40PM (#27177750)
Writing TypeScript is like writing JavaScript but with type annotations. Writing C is not like writing assembly with type annotations.
Re:Modern Javascript: Everything you missed over the last 10... by CRConrad on Monday May 17, 2021 @01:31AM (#27180335)
> Writing TypeScript is like writing JavaScript but...

...but different.

> Writing C is not like writing assembly...

...it's different.

Re:Modern Javascript: Everything you missed over the last 10... by Cyberdog on Saturday May 15, 2021 @03:48PM (#27168342)
With most things, yes, if the implementation for that feature supports your operating system, and it doesn't take long enough to be noticeable, and there's no weird caching issues at any given level, then yes, it's transparent in that case.

Or you could just write the JS directly and be done with it.