JS devs - do everything but write in another language challenge level: Impossible.
Proposal: JavaScript Structs
11–20 of 371 posts
Re: Proposal: JavaScript Structs
#12Huh, I thought that most work that used to use workers switched to Webassembly. Talking about JS proposals, I'm looking forward to this one: https://github.com/tc39/proposal-record-tuple Records and tuples can make a lot of logic much more easier to read, and way less fragile. Not sure how they would play together with the shared structs though.
Re: Proposal: JavaScript Structs
#13The general idea of types with a fixed layout seems great, but I'm a lot more dubious about the idea of unsafe blocks. The web is supposed to be a sandbox where we run untrusted code and with pretty good certainty expect that it can't crash the computer. Allowing untrusted code to specify "hey let me do stuff that can cause data races if not done correctly" is just asking for trouble, and also exploits. If shared str…
Re: Proposal: JavaScript Structs
#14JS devs - do everything but write in another language challenge level: Impossible.
Call me when browsers support another language. What are we going to use? CSS?
Re: Proposal: JavaScript Structs
#15JS devs - do everything but write in another language challenge level: Impossible.
Call me when browsers support another language. What are we going to use? CSS?
"but wasm has to call JavaScript to use browser APIs" WasmGC is shipped in Chrome and Firefox and enabled by default in WebKit nightly
Re: Proposal: JavaScript Structs
#16JS devs - do everything but write in another language challenge level: Impossible.
Re: Proposal: JavaScript Structs
#17Earlier quoted context omitted.
Call me when browsers support another language. What are we going to use? CSS?
wasm "but wasm has to call JavaScript to use browser APIs" WasmGC is shipped in Chrome and Firefox and enabled by default in WebKit nightly
Re: Proposal: JavaScript Structs
#18The ones that stand out the most to me are C# and Typescript.
Microsoft has a large team dedicated towards improving these languages constantly and instead of exclusively focusing on making them easier to use or more performant, they are constantly adding features. After all, it is their job. They are incentivized to keep making it more complex.
The first time I ever used C# was probably version 5? Maybe? We're on version 12 now and there's so much stuff in there that sometimes modern C# code from experts looks unreadable to me.
One of the reasons I have so much fun working in node/Javascript these days is because it is simple and not much has changed in express/node/etc for a long time. If I need an iterable that I can simply move through, I just do `let items = [];`. It is so easy and hasn't changed for so many years. I worry that we eventually come out with a dozen ways to do an array and modern code becomes much more challenging to read.
When Typescript first came out, it was great. Types in Javascript are something we've always wanted. Now, Typescript is on version 5.6 and there is so much stuff you can do with it that it's overwhelming. And nobody uses most of it!
This is probably just old man ranting, but I think there's something there. The old version I used to debate about was C vs C++. Now look at modern C++, it's crazy powerful but so jam packed that many people have just gone back to C.