545
you are viewing a single comment's thread
view the rest of the comments
[-] Nerd02@lemmy.basedcount.com 34 points 1 year ago

I think there's a positive coming from this competition, though. Apparently this infighting has re-lit the want for type annotations to be embedded in vanilla JS (ECMAScript proposal). I feel like this would be the ideal scenario: things working right out of the box without needing a compile step or additional tooling.

You can get as close as it gets to this experience by using alternative runtimes such as Deno or Bun, which have native TS support (meaning you can just execute a .ts file without having to transpile it), but of course as soon as you have to write code for a browser you are back in the middle ages.

[-] TheCee@programming.dev 4 points 1 year ago

That's not a positive, though.

Depending on how it pans out, it's either not useful enough. Who the hell doesn't use namespaces or enums. Or - as

These constructs are not in the scope of this proposal, but could be added by separate TC39 proposals.

implies - a door opener to outsource TypeScripts problem unto other peoples and not to investing into improving WebAssembly. That's just MS being lazy and making their problems other peoples problems.

I feel like this would be the ideal scenario: things working right out of the box without needing a compile step or additional tooling.

It's just annotations. No proposed semantics of a type system which your browser could check on its own.

[-] rockstarpirate@lemmy.world 2 points 1 year ago

Yeah it’s interesting because JS is interpreted, not compiled. The proposal allows for type annotations in the syntax but no actual interpreter consequences. On the one hand that makes sense because otherwise you’re in the territory of runtime type-checking which would be a huge performance hit and would sort of defeat the purpose of static types anyway. But that means you still have to rely on your IDE or a linter for this to be useful.

load more comments (4 replies)
load more comments (5 replies)
this post was submitted on 08 Sep 2023
545 points (94.2% liked)

Programmer Humor

19190 readers
1211 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS