Live data from Hacker News

Proposal: JavaScript Structs

github.com

141–150 of 371 posts

Re: Proposal: JavaScript Structs

#141

I am not sure how to really refine this thought I have had, but I have this fear that every language eventually gets so bloated and complicated that it has a huge barrier to entry. The 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 c…

Javascript is not simple AT ALL. It has 3 ways to declare functions, multiple variations on arrow functions syntax, a weird prototyping inheritance system, objects you can create out of "new" on functions, object literals that can act an pseudo-classes, classes, decorators, for-i loop + maps + filter + for-in loop (with hasOwn) + forEach, async / await + promises and an invisible but always-on event loop, objects pro…

Even if you think Javascript is already complicated, that isn't a reason to make it more complex.

Re: Proposal: JavaScript Structs

#142

Earlier quoted context omitted.

It's on the list of languages that used to be simple, I think.

Yes, but when "the good parts" came out, half of this list was already true. There is a reason we ignore a good chunk of the language to be productive with it.

>There is a reason we ignore a good chunk of the language to be productive with it.

The same can be said for most languages, even assembly language, and especially so for C++.

Re: Proposal: JavaScript Structs

#143

Earlier quoted context omitted.

This is why always say the true beginner programming language is C. Stupid easy to learn, have some loops, have some conditions, make some memory allocations. You will learn about the fundamentals of computing as well, which you might as well ignore (unknowingly) if you start with something like JavaScript (where is this data living in my computer?).

From that perspective, something like Pascal or Modula-2 is much better - you get all the same stuff but no footguns.

Actually yeah, I'd say even something like zig would work but that's pushing it a little bit in terms of feature complexity.

Re: Proposal: JavaScript Structs

#144
post #29

Earlier quoted context omitted.

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

Let me know when WASM has a dev workflow that gets a change to your browser 1/10th as fast as Vite + TypeScript + React.

The web is undefeated in iteration time for sure. There are some native workflows that approach it with hot code reloading, but I'm not aware of anyone doing that for wasm yet.

Re: Proposal: JavaScript Structs

#145

I am not sure how to really refine this thought I have had, but I have this fear that every language eventually gets so bloated and complicated that it has a huge barrier to entry. The 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 c…

> 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! TypeScript today can be written the same way that TypeScript was when it first started to become popular. Yes there are additions all the time, but most of them are, as you observe, irr…

As a very experienced TS developer myself - this is absolutely correct, the best reply in this thread, and I hope the OP reads it.

Re: Proposal: JavaScript Structs

#146
post #17

Earlier quoted context omitted.

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

WasmGC is just garbage collection? Not browser APIs

My understanding is that GC integration was the major blocker for better wasm/browser API integration. Now that it is here I bet better integration is not far behind, although I haven't personally investigated the current proposals.

Re: Proposal: JavaScript Structs

#147

I am not sure how to really refine this thought I have had, but I have this fear that every language eventually gets so bloated and complicated that it has a huge barrier to entry. The 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 c…

Javascript is not simple AT ALL. It has 3 ways to declare functions, multiple variations on arrow functions syntax, a weird prototyping inheritance system, objects you can create out of "new" on functions, object literals that can act an pseudo-classes, classes, decorators, for-i loop + maps + filter + for-in loop (with hasOwn) + forEach, async / await + promises and an invisible but always-on event loop, objects pro…

3 ways to declare functions? I am probably blanking but I can only think of:

``` function foo () {} const foo = () => {} ```

Re: Proposal: JavaScript Structs

#148

Earlier quoted context omitted.

Javascript is not simple AT ALL. It has 3 ways to declare functions, multiple variations on arrow functions syntax, a weird prototyping inheritance system, objects you can create out of "new" on functions, object literals that can act an pseudo-classes, classes, decorators, for-i loop + maps + filter + for-in loop (with hasOwn) + forEach, async / await + promises and an invisible but always-on event loop, objects pro…

3 ways to declare functions? I am probably blanking but I can only think of: ``` function foo () {} const foo = () => {} ```

Not sure if it counts but there is `new Function("return x;")`

Re: Proposal: JavaScript Structs

#149

I am not sure how to really refine this thought I have had, but I have this fear that every language eventually gets so bloated and complicated that it has a huge barrier to entry. The 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 c…

I'm an absolute beginner when it comes to programming, and I chose C# as my first language to learn.

I've been learning steadily for 8 or so months now and at no point have I felt the language was unapproachable due to excessive features.

Looking back on what each new version added, I don't think any of the additions were damaging to the simplicity of C#.

I do likely have a biased perspective though, as I use newer C# features every day.

Re: Proposal: JavaScript Structs

#150

Earlier quoted context omitted.

Javascript is not simple AT ALL. It has 3 ways to declare functions, multiple variations on arrow functions syntax, a weird prototyping inheritance system, objects you can create out of "new" on functions, object literals that can act an pseudo-classes, classes, decorators, for-i loop + maps + filter + for-in loop (with hasOwn) + forEach, async / await + promises and an invisible but always-on event loop, objects pro…

3 ways to declare functions? I am probably blanking but I can only think of: ``` function foo () {} const foo = () => {} ```

`const foo = function() {}`
Post reply on HN