Most active commenters
  • wiseowise(6)
  • peutetre(5)
  • FridgeSeal(3)
  • tylerchilds(3)

←back to thread

160 points todsacerdoti | 25 comments | | HN request time: 0.001s | source | bottom
Show context
anyfoo ◴[] No.41898802[source]
> I’ve written a lot of JavaScript. I like JavaScript. And more importantly, I’ve built up a set of skills in understanding, optimizing, and debugging JavaScript that I’m reluctant to give up on.

It's not that hard to do the same for a less terrible language. Choose something markedly different, i.e. a low level language like rust, and you will learn a lot in the process. More so because now you can see and understand the programming world from two different vantage points. Plus, it never hurts to understand what's going on on a lower level, without an interpreter and eco-system abstracting things away so much. This can then feed back into your skills and understanding of JS.

replies(4): >>41898815 #>>41898881 #>>41898940 #>>41899798 #
1. FridgeSeal ◴[] No.41898815[source]
I swear some JS devs will go out of their way to avoid learning anything else, whilst simultaneously and breathlessly espousing that we rewrite everything else in JS.
replies(5): >>41898850 #>>41898856 #>>41898880 #>>41899015 #>>41902114 #
2. oneweekwonder ◴[] No.41898850[source]
> Any application that can be written in JavaScript, will eventually be written in JavaScript. - Jeff Atwood (2007)
replies(1): >>41904798 #
3. tylerchilds ◴[] No.41898856[source]
i swear some non js devs will go to extreme lengths to demonstrate solutions that will never run on another machine instead of writing js
replies(1): >>41898873 #
4. anyfoo ◴[] No.41898873[source]
Why would they never run on another machine? It's not that hard to write portable code, and done very often. Nowadays for example, you rarely ever think about whether you're on arm or x86.

If you write non-portal code, there might be an important reason (like writing OS components, which you won't do in JS).

replies(1): >>41899172 #
5. TacticalCoder ◴[] No.41898880[source]
> I swear some JS devs will go out of their way to avoid learning anything else, whilst simultaneously and breathlessly espousing that we rewrite everything else in JS.

The JStockholm syndrome.

6. mardifoufs ◴[] No.41899015[source]
It's usually the opposite. And the post is specifically about making JavaScript tools, why would you not expect them to be written in JS? I guess not making tools for say, c# devs in c# would also be bad?
replies(3): >>41899253 #>>41899672 #>>41900862 #
7. tylerchilds ◴[] No.41899172{3}[source]
almost every time code doesn’t run on my machine, the root cause is a political disagreement with a c-compiler author three layers below my actual problem.

javascript doesn’t have a compiler is my main point.

replies(1): >>41899272 #
8. FridgeSeal ◴[] No.41899253[source]
Presumably because, apart from Python (see Ruff, uv, etc) most languages aren’t running into such major issues with their own “self hosted” tooling that it’s worthwhile to rewrite several of them in a completely different language.
replies(2): >>41899347 #>>41911824 #
9. FridgeSeal ◴[] No.41899272{4}[source]
Bit rich to complain about that when all the major browsers have just as significant differences, and that’s before we bring node into the equation, let alone talking about a good 30% of websites I visit with any quantity of JS in them are either perpetually broken in some way, or so jank as to be effectively broken.
replies(2): >>41900318 #>>41911772 #
10. mardifoufs ◴[] No.41899347{3}[source]
Yes I agree! And JavaScript also isn't really at that point yet. Python is really in a class of its own here... sadly enough.

Though I don't see an issue with tools for JS built without JS. It's just that I don't think that it's a bad thing for a JavaScript dev to want the ecosystem around JavaScript to be written in JS. JS is orders of magnitudes faster than python in any case.

11. rbower ◴[] No.41899672[source]
> It's usually the opposite. And the post is specifically about making JavaScript tools, why would you not expect them to be written in JS?

Take a look at rollup, vite, etc. These tools are essentially replacing webpack, which is written in JS. Modern Rollup (^4) uses SWC (Rust-based bundler), and vite is currently using a mix of esbuild (Go) and Rollup. I think they're switching to SWC in v6 though.

The point here is that for certain operations JS is not nearly as fast as lower-level languages like the aforementioned. Bundling is one of those performance-critical areas where every second counts.

That said, as a TypeScript developer I agree with the sentiment that JS tools should be written in JS, but this isn't a hard and fast rule. Sometimes performance matters more. I think the reasonable approach is to prefer JS – or TS, same difference – for writing JS tools. If that doesn't work, reach for something with more performance like Rust, Go, or C++. So far I've only had to do the latter for 2 use cases, one of which is hardware profiling.

12. tylerchilds ◴[] No.41900318{5}[source]
totally agreed about all of the above and i take credit for none of that code

i write plaintext at uris, progressively enhance that to hypertext using a port with a deno service, a runtime that unifies browser js with non browser js.

that hypertext can optionally load javascript and at no point was a compiler required aside from the versioned browser i can ask my customers to inspect or a version of deno we get on freebsd using pkg install.

node is not javascript would be my biggest point if i had to conclude why i responded.

microsoft failed at killing the web with internet explorer and only switched to google’s engine after securing node’s package manager overtly through github and covertly through typescript.

microsoft is not javascript is my final point after circling back to my original point of microsoft is also one of the aforementioned reasoned c-compilers are politically fought over instead of things that just work.

13. atmavatar ◴[] No.41900862[source]
It's funny you mention C# since VS Code is a perfect example of JS devs rewriting existing tools in JS.
14. jbreckmckye ◴[] No.41902114[source]
OP is a Servo contributor
15. peutetre ◴[] No.41904798[source]
The game is changing with WebAssembly though. Large JavaScript applications are replacing JavaScript bits with wasm:

https://web.dev/case-studies/google-sheets-wasmgc

Any application that is written in JavaScript will have more and more of it replaced with WebAssembly.

replies(1): >>41911787 #
16. wiseowise ◴[] No.41911772{5}[source]
I encounter far more issues compiling C code than JS issues in the web, just saying.
17. wiseowise ◴[] No.41911787{3}[source]
> Any application that is written in JavaScript will have more and more of it replaced with WebAssembly.

Which is not a lot when it comes to web. Sure some algo heavy stuff like Figma will benefit from it, but GUI around it is still written in what?

replies(1): >>41911883 #
18. wiseowise ◴[] No.41911824{3}[source]
God what I’d do if someone wrote build system in Rust for JVM and freed us from Maven and Gradle.
19. peutetre ◴[] No.41911883{4}[source]
Just do the whole thing in WebAssembly. Minimal dependencies and pixel perfect in all browsers. The distinction is applications versus documents.

Works for Dart with Flutter:

https://flutter.dev/

https://www.youtube.com/watch?v=Nkjc9r0WDNo

https://www.youtube.com/watch?v=qx42r29HhcM

https://wonderous.app/web/

Works for C# with Avalonia UI:

https://avaloniaui.net/

https://www.youtube.com/watch?v=6mwQDPlbF5Y

https://solitaire.xaml.live/

And so on.

replies(1): >>41912059 #
20. wiseowise ◴[] No.41912059{5}[source]
Amazing, just awesome. Long standing applause.

Let’s regress to level of native apps without benefits of said native apps. No standardization, no performance, no unified integration. Let’s get rid of browser plugins that allow us to fight invasive ads and malicious JS scripts, let’s dump decades of expertise and optimizations, let’s undo all advancements of web just to be able to write same old <div> in C#. Nothing better than a single blob of <canvas>.

It’s ironic that some of people in this thread convict JS devs of using only JS and then you use those “frameworks” as an example of a good thing when they don’t even have a separation of presentation (like HTML and JS) that would allow other languages tap into it.

And all of this is with much worse performance and stability.*

* - for now

replies(1): >>41912316 #
21. peutetre ◴[] No.41912316{6}[source]
> No standardization, no performance, no unified integration.

WebAssembly has all of these things. WebAssembly already there, lurking your browser. That's why it will succeed.

It's interesting how threatened you are by WebAssembly. But change is normal. Embrace the change.

replies(1): >>41912390 #
22. wiseowise ◴[] No.41912390{7}[source]
> WebAssembly has all of these things.

Is that why Flutter demo you’ve linked takes 7 seconds to load on Firefox on iPhone 14 Pro and then barely works skipping frames?

I can’t even select text on the page, since it’s just a big canvas, lmao.

> WebAssembly has all of these things. WebAssembly already there, lurking your browser. That's why it will succeed.

You mean how every of those frameworks that you’ve listed have to reimplement a11y every team, since WASM is pure logic? How all of them have to reimplement OS shortcuts and OS integrations? Is that what you call “unified integration”?

> It's interesting how threatened you are by WebAssembly. But change is normal. Embrace the change.

Why did I even bother replying to you, sigh.

replies(1): >>41912484 #
23. peutetre ◴[] No.41912484{8}[source]
Ah, so what you want is Uno. It uses WebAssembly and the DOM: https://platform.uno/

> Why did I even bother replying to you, sigh.

I think it's because you're overwrought. Don't fear WebAssembly.

replies(1): >>41912572 #
24. wiseowise ◴[] No.41912572{9}[source]
That’s actually good. If only it didn’t use XAML, but I guess you have to appeal to C# devs.

> I think it's because you're overwrought. Don't fear WebAssembly.

Not sure what’s you deal with these comments, as I’m not even a JS dev by trade, but okay.

replies(1): >>41912599 #
25. peutetre ◴[] No.41912599{10}[source]
I can only judge you by your actions. You have a lot of anxiety.