News for hackers. Stuff that matters.
Re:Toward a TypeScript for C++" by fryktelig on Saturday November 04, 2023 @10:24AM (#38141259)
Yeah once they implement the proposal to add types we will
Re:Toward a TypeScript for C++" by mgaunard on Saturday November 04, 2023 @10:42AM (#38141429)
The whole point of JavaScript is that it's dynamically-typed. If you want static typing just use C++ or any other established programming language.
Re:Toward a TypeScript for C++" by marcosdumay on Saturday November 04, 2023 @10:52AM (#38141550)
> it's dynamically-typed

Yet, most of the code people write has statically defined types.

Anyway, the whole point of JavaScript is that it runs on the browser. Outside of that, it has no strong points. Even though most of them are not weak enough to immediately abandon the language, its type system is one of the weakest.

Re:Toward a TypeScript for C++" by leptons on Saturday November 04, 2023 @12:48PM (#38142729)
Javascript's dynamic typing is fine if you aren't a really shitty programmer.
Re:Toward a TypeScript for C++" by bigfudge on Saturday November 04, 2023 @10:52AM (#38141540)
I’m not sure how people are supposed to do that in the browser. This feels like an excessively dismissive comment.
Re:Toward a TypeScript for C++" by mgaunard on Saturday November 04, 2023 @12:07PM (#38142322)
Have you not heard of WebAssembly?
Re:Toward a TypeScript for C++" by kangalioo on Sunday November 05, 2023 @04:17AM (#38149534)
WebAssembly is not without tradeoffs either. I'm not an expert, but it's often heavier due to bundling the native language's stdlib; it's annoying to interop with the browser environment because that's still JavaScript-tailored; it's also just hard to write code that can be compiled into WASM (e.g. in Rust, it needs to be `#[no_std]`)
Re:Toward a TypeScript for C++" by mgaunard on Sunday November 05, 2023 @08:38AM (#38151014)
If you're doing real work, you don't interact with the browser.

If you're just glueing things together between APIs, then JavaScript is fine, and static typing would just get in the way.