News for hackers. Stuff that matters.
Re:Can Rust Beat JavaScript in 2023? by muglug on Friday April 21, 2023 @08:49AM (#35652926)
Every so often a language comes out that allows frontend developers to put something other than "JavaScript developer" on their CV.

First CoffeeScript, then Flow and TypeScript, then ReasonML, and now Rust with WASM & web macros.

Of these only TypeScript has been successful, partly because it's backed by Microsoft, but mostly because the code you end up writing is very close to JavaScript.

This is not a dig at Rust (which I love) but God help any developer inheriting a frontend codebase with random bits of Rust in 2024.

Re:Can Rust Beat JavaScript in 2023? by VWWHFSfQ on Friday April 21, 2023 @08:54AM (#35652987)
My company did an initial evaluation of Rust web development just to see what the options were. Put out some feelers to our web developers to see if they had any opinions about it. It was almost universally negative. Not because the ecosystem or technology is immature, but because our JavaScript/Typescript devs simply could not grok Rust at all. It was too different, or too difficult, or whatever. So we didn't really pursue it any further. At some point though we'll probably just have to hire Rust engineers instead of trying to convert JS devs.
Re:Can Rust Beat JavaScript in 2023? by oaiey on Friday April 21, 2023 @09:14AM (#35653234)
Rust on wasm is the same story as .net on wasm (aka blazor): it is nice if you have a single language developer workforce. But once you maintain a portal team, the benefit is gone.

IMHO, the more interesting niche is desktop/mobile apps using html as a toolkit. Because here you can combine raw computing/resource access with being more cross platform.

Re:Can Rust Beat JavaScript in 2023? by bayesian_horse on Friday April 21, 2023 @08:57AM (#35653032)
Rust engineers coming from a different niche than frontend development will just LOVE web development.
Re:Can Rust Beat JavaScript in 2023? by voidfunc on Friday April 21, 2023 @09:01AM (#35653072)
Maybe the web ecosystem will finally get some sane tooling... or not because those devs will probably be driven to madness.
Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @09:17AM (#35653273)
Funnily enough, web ecosystem has tooling most languages can't even dream of.

- Instant hot reload of application

- Inspect app/page structure in runtime

- Runtime debugging

- Monitor all network requests

- Tools to monitor time spent in functions, painting, redrawing...

- Runtime changes instantly applied

...

Re:Can Rust Beat JavaScript in 2023? by Ygg2 on Friday April 21, 2023 @09:49AM (#35653706)
At expense of browsers complexity rivaling operating systems.

And now there is essentially one browser who can afford such complexity. Until Google discontinues it.

Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @10:12AM (#35654045)
> at expense of browsers complexity rivaling operating systems.

That's a feature, not a bug, as open source browsers have loosened the importance of the operating system (freed us from the MS monopoly) and enabled an multi trillion dollar web app industry to flourish.

If Google ever discontinued Chrome support it would be picked up by the community in a flash. That's the beauty of open source.

Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @10:14AM (#35654068)
> If Google ever discontinued Chrome support it would be picked up by the community in a flash.

Of course it wouldn't. The number of people capable of managing and developing a full-blown browser is minuscule. Even Microsoft gave up and went with Chrome in the end.

Case in point: how many people picked up Servo? Hell, even Firefox?

Re:Can Rust Beat JavaScript in 2023? by marcosdumay on Friday April 21, 2023 @10:58AM (#35654755)
To be fair, the number would increase a lot if Google stopped making the web hostile for other software.
Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @11:16AM (#35655036)
What?
Re:Can Rust Beat JavaScript in 2023? by Ygg2 on Friday April 21, 2023 @11:29AM (#35655224)
Google had long list of oopsies where Google services stopped working because of user agent rejecting non-Chrome browsers.
Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @11:51AM (#35655610)
What does it have to do with the number of people forking and developing their own browser? Agent string sibstitution/emulation has been a thing since time immemorial.
Re:Can Rust Beat JavaScript in 2023? by Ygg2 on Friday April 21, 2023 @12:28PM (#35656162)
You make your own browsers and issue correct UA (User Agent) only for GMail to stop working. But works fine when issuing Chrome UA. I guess Google is staffed by Howler monkeys, or malicious.

Source: https://archive.is/tgIH9

Re:Can Rust Beat JavaScript in 2023? by marcosdumay on Friday April 21, 2023 @01:27PM (#35657141)
Pushing for whatever feature they fashion, pushing against stuff that they didn't create, doing things differently for no reason, making sure their software works badly on competitor platforms...

What Google is doing isn't much different from the MS from the 90's, except that they didn't stop improving their browser. At least yet.

Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @11:24AM (#35655144)
Microsoft contributes to Chrome core now, as a result. So does Node.js, Brave, and a litany of other organizations that depend on Chrome/v8.
Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @12:51PM (#35656532)
Yes, they do. And your point? That they are "a community that will pick up Chrome dveelopment in a flash"? That's not how it works.

Browser development is prohibitively expensive. Even Microsoft, a trillion-dollar company, gave up on developing their browser. What makes you think that some magical community will just pick up the development of Chrome?

Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @03:49PM (#35659063)
> And your point? That they are "a community that will pick up Chrome dveelopment in a flash"? That's not how it works.

Yes it really is how it works. You see, Chromium is used by numerous teams and products already. Developers from these projects already contribute support and patches to Chromium on the regular. That's exactly how open source development works.

> Browser development is prohibitively expensive. Even Microsoft, a trillion-dollar company, gave up on developing their browser. What makes you think that some magical community will just pick up the development of Chrome?

Microsoft (especially Ballmer era MS) sucks at a number of things. That internet explorer was a bloated piece of trash beyond all repair is hardly an indication that browser development is beyond the capabilities of an open source community. It wasn't that it was "too expensive" for Microsoft to maintain IE. It's just that IE could not possibly compete with Chromium, because they were saddled with too much technical debt from years of bad decisions.

Entire operating systems and databases are maintained by open source foundations. Have you ever heard of Linux? MS cannot compete with Linux at the server game. They waved the white flag on that battle a long time ago as well.

Besides, when you fork a project, you don't have to instantly rebuild everything from scratch. A foundation would kick things off by prioritizing bug patches, security fixes, etc. The RFC process for deciding new web features is already handled by a consortium: https://www.w3.org/

Re:Can Rust Beat JavaScript in 2023? by bayesian_horse on Saturday April 22, 2023 @11:31AM (#35667560)
Browsers are now so essential, that there is little incentive for Google to drop out and very much incentive for everyone else to continue or increase their involvement.

With Firefox there is even a viable alternative that isn't controlled by Google in any form. I'd agree on many projects that would be the case. For Chrome, no.

Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @12:00PM (#35655763)
Servo never had significant market share of any kind, but it has recently been picked back up by a foundation. Firefox has been outcompeted by Chrome and Mozilla has made a number of strategic blunders over the years. But by and large people stopped using Firefox because Chrome/Chromium was better on most metrics users care about. Even developers tend to use Chrome/Chromium because of the superior native debugging tools.

But last I checked Firefox is still very much maintained by Mozilla.

Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @12:49PM (#35656504)
The original statement was "If Google ever discontinued Chrome support it would be picked up by the community in a flash."

Why doesn't community pick other browsers in a flash?

Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @03:35PM (#35658887)
What other open source browsers have been left without maintainence? Ones with no market share? As mentioned, Servo was never really finished and yet it has recently been scooped up by the Servo Foundation. Mozilla still very much maintains Firefox.

We have plenty of examples of open source databases, operating systems, libraries and languages leaving the major companies they were created at and being scooped up by a foundation or consortium to maintain.

WebOS is a great example. Created by Palm as a mobile OS before they sold it to HP, who open sourced it. Now the primary contributor is LG, who uses it in smart tvs.

But there's plenty of other examples in the open source world. Chromium is far too important, and there's already thousands of eyeballs on that code base. There would be a Chromium Foundation established very quickly if Google abandoned.

Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @03:54PM (#35659110)
> We have plenty of examples of open source databases, operating systems, libraries and languages leaving the major companies they were created at and being scooped up by a foundation or consortium to maintain.

We have just as many left to die. We just don't know or don't talk about them anymore.

> WebOS is a great example. Created by Palm as a mobile OS before they sold it to HP, who open sourced it. Now the primary contributor is LG, who uses it in smart tvs.

Ah. So the mythical "community" that will scoop in and continue developing is a compani with a 60-billion yearly revenue. Got it.

> Chromium is far too important, and there's already thousands of eyeballs on that code base.

Eyeballs rarely, if ever, translate into understanding the codebase, or being able to do anything about it.

> There would be a Chromium Foundation established very quickly if Google abandoned.

Can I interest you in Apache Foundation where great amazing projects no longer supported by their original company go to slowly slide into oblivion?

Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @04:01PM (#35659215)
> We have just as many left to die. We just don't know or don't talk about them anymore.

Yes, irrelevant products that no one uses eventually die. At present, Chromium is not one of those, and is installed on billions of devices and used every single day on mobile and on desktop. Entire businesses and derivative ecosystems have been built on top of Chromium (Edge, Brave, Node.js and all of its dependencies, Electron, etc.). If there's an economic incentive to keep an open source product going, it will keep going. Anyway, here's the repo if you're interested in contributing: https://github.com/chromium/chromium

Re:Can Rust Beat JavaScript in 2023? by Ygg2 on Friday April 21, 2023 @10:50AM (#35654617)
> If Google ever discontinued Chrome support it would be picked up by the community in a flash.

Browsers cost a bunch to develop. Just CI for Servo was 10k per year.

While there are some admirable efforts (Ladybird), browsers complexity means your only specification is Chrome source code.

Re:Can Rust Beat JavaScript in 2023? by bzzzt on Friday April 21, 2023 @09:55AM (#35653798)
All that stuff that could be done with a Java (or probably .net or php) server side webapp stack two decades ago...
Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @10:04AM (#35653936)
Instant hot reloading without even recompiling/refreshing the page? Sorry, try again.

Flame charts in Visual Studio 2003? Sorry, try again.

Re:Can Rust Beat JavaScript in 2023? by worksonmine on Friday April 21, 2023 @11:25AM (#35655172)
Javascript hot reloading requires a "recompile", you just don't notice it. Import a plain js file without any node tooling and see what you get for free.
Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @12:53PM (#35656572)
> Import a plain js file without any node tooling and see what you get for free.

I get F5 to refresh the page when source code changes. All the other tooling remains the same: https://developer.chrome.com/docs/devtools/

I mean, Chrome even has an animations debugger

Re:Can Rust Beat JavaScript in 2023? by worksonmine on Friday April 21, 2023 @01:16PM (#35656977)
> I get F5 to refresh the page when source code changes.

Really? That's surprising but so overkill. How does it know what files to poll and which not to, I assume file:// and localhost but more specific? Does it do it for a webpack/vite app which has its own hot reloading setup?

Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @03:34PM (#35658876)
What do you mean?

F5 refreshes the browser page. This has been the way to develop pages since the first browsers.

And the original question was "Import a plain js file without any node tooling and see what you get for free." You don't get hot reloading but you get all I wrote in my original comment and much more for free.

Re:Can Rust Beat JavaScript in 2023? by worksonmine on Friday April 21, 2023 @04:16PM (#35659458)
Yes, I know I was just surprised it even checks for changes without being prompted, but I guess that's where all the resources go. The point I was trying to make was a response to your claim that hot reloading magically happens without "compiling", it doesn't (I know I know, it's transpiling in js).

It usually goes something like this: some tool watches the file system for changes > trigger build > another tool in the chain injects changes into session > picked up by client to reflect changes, if done well without resetting state.

These are many tools in a toolchain working well together. This DOES exist in other languages, incremental builds exists. You can save and restore a binary at a certain state, and it's less hassle than it is in js.

One thing the systems development world has that I haven't seen in browser tools is radare/ghidra to follow code paths but it probably exists as a browser extension. The web is just reinventing and repackaging tools that have existed for decades.

> you get all I wrote in my original comment and much more for free

Yes, but `apt install gdb` is just as "free" as `apt install chrome` no? Everything you mentioned exists in systems development, you just haven't used it.

Re:Can Rust Beat JavaScript in 2023? by chrisco255 on Friday April 21, 2023 @04:11PM (#35659363)
It's not a "recompile". JS doesn't get compiled, it may get transpiled or minified. Node.js is only used for sending data over a local websocket from the file system to the browser. You can totally also achieve this effect on a local offline webpage that wasn't even being served if you added an input on the page (ie the React docs: https://react.dev/learn).
Re:Can Rust Beat JavaScript in 2023? by worksonmine on Friday April 21, 2023 @04:32PM (#35659664)
Yes. But the difference in this context is nitpicking. The browser needs to know what file was changed, and what to do with those changes right? And preserve state. That doesn't magically happen it's the tooling that supports it.

I could probably set up a simple environment to watch for changes, run make, reload the binary at $current_state in gdb with a one-liner. But it doesn't really fit the work flow, and GDB already gets all changes after I run make.

Re:Can Rust Beat JavaScript in 2023? by kaba0 on Friday April 21, 2023 @04:06PM (#35659282)
Most backend frameworks can just route new requests to the updated code - so a refresh is all you need (though there are tools that simply make that refresh automatic, which is pretty much how js frameworks work as well. Intellij can also make the whole recompile-replace code function happen on window defocus, so by the time you switch to your browser, it is already refreshed. And nowadays the compile of something like Java can well be faster than whatever that npm monstrosity does)
Re:Can Rust Beat JavaScript in 2023? by camdenreslink on Friday April 21, 2023 @10:03AM (#35653921)
Many languages have all of that tooling and more. For example C# and Java.

I think Rust has all of that except the hot reload and runtime changes.

Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @10:10AM (#35654025)
> Many languages have all of that tooling and more. For example C# and Java.

Instant hot reloading? Runtime introspection into apps, and into strucutre of the apps, direct view into what the app sends over the network etc.? Open up development tools in your favorite browser, you'll be surprised :)

Re:Can Rust Beat JavaScript in 2023? by blackoil on Friday April 21, 2023 @12:07PM (#35655884)
Don't know of current state but Blazor should check most of them.
Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @12:48PM (#35656485)
Because Balzor piggy-backs the existing web tools ;)
Re:Can Rust Beat JavaScript in 2023? by kaba0 on Friday April 21, 2023 @04:01PM (#35659213)
Well, java in debug mode can hot swap class methods, for what it worth.

But the web is definitely the most used “GUI framework” ever, so there is no competition with that on tooling ground, even if there is nothing inherently that would block it, as a dom inspection is pretty easy to implement - just print out the tree of ui nodes.

Re:Can Rust Beat JavaScript in 2023? by LandR on Friday April 21, 2023 @10:42AM (#35654500)
Pretty much any lisp.
Re:Can Rust Beat JavaScript in 2023? by worksonmine on Friday April 21, 2023 @11:23AM (#35655133)
Except for the hot reloading (which you mention twice btw) the tooling for the popular languages has everything in the list, and most can be achieved with GDB and Wireshark alone, in any language that GDB supports.

Don't get me wrong the web pays my bills and I like it but there's no point exaggerating.

Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @11:50AM (#35655583)
> Except for the hot reloading (which you mention twice btw) the tooling for the popular languages has everything in the list, and most can be achieved with GDB and Wireshark alone, in any language that GDB supports.

"Can be achieved" with some additional tools. I doubt you can easily expect the structure of the app, how it repaints, see all the relevant network requests, and also introspect and query the running app, emulate various hardware, inspect and debug animations etc. in most languages.

Yes, there are collections of tools that may give you all that in aggregate, but frankly, it's not close to an "out-of-the-box" experience.

> there's no point exaggerating.

It's not really exaggeration.

Re:Can Rust Beat JavaScript in 2023? by worksonmine on Friday April 21, 2023 @12:57PM (#35656652)
Have you used GDB? And network requests is what Wireshark was created for.

Browser developer tools don't "emulate hardware" they change the viewport and throttle network, there's a huge difference. It seems you don't have much experience in the tools you're comparing against. In GDB you would connect to a running application on actual hardware or in a VM, if that's what you're testing. Screen sizes and network can be done locally.

As far as all-in-one solutions go that's a new goal post, your first comment mentioned "tooling", and hot reloading is not a part of the browser so it's still an "aggregate" as you like to call it.

For me it's the unixy way of doing things and just the way I like it. Do one thing and do it well.

Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @03:48PM (#35659035)
> Have you used GDB?

I've used debuggers in general (IDEA, Resharper, Visual Studio), and even dabbled with disassemblers like IDA in my youth.

> Browser developer tools don't "emulate hardware" they change the viewport and throttle network, there's a huge difference.

So, out-of-thebox int their primary tool frontend developers get: viewport simulation, cpu throttling, network throttling, sensor simulation (geolocation and orientation).

And can emulate performance with different number of processor cores. Not bad https://developer.chrome.com/docs/devtools/performance/refer...

> As far as all-in-one solutions go that's a new goal post, your first comment mentioned "tooling", and hot reloading is not a part of the browser

Wat. The original comment claimed this: "Maybe the web ecosystem will finally get some sane tooling". So yes, hot loading is a part of tooling. I've yet to see anything outside the web manage hot reloading with any degree of confidence and speed.

You don't like the hot loading, and let's focus on non-moved non-goal non-posts. I hope you noticed the ellipsis at the end of my list?

What's that immediately available tool for GDB and Wireshark whatever that:

- can let me examine and change the UI of the app on the fly? Including handful tools like layout overlays, layers etc.

- examine and debug animations?

- analyze paint/re-paint performance?

- view and debug delayed background actions?

- record and replay user flows?

...

^ Note the ellipsis again.

The build tools for Web are undoubtedly atrocious. However, there are very few, if any, tools that come even close to the versatility and ease of use of the tools that exist for the web ecosystem.

Re:Can Rust Beat JavaScript in 2023? by worksonmine on Friday April 21, 2023 @05:31PM (#35660497)
> So, out-of-thebox int their primary tool frontend developers get: viewport simulation, cpu throttling, network throttling, sensor simulation (geolocation and orientation).

The linux kernel has KVM, doesn't get more out of the box than that. Do what you want with it. Emulate ARM? Sure why not.

> The original comment claimed this: "Maybe the web ecosystem will finally get some sane tooling".

Not my comment, I'm addressing your claim of "tooling most languages can't even dream of". The ellipsis doesn't really matter I'm not here to guess what you're meaning.

- can let me examine and change the UI of the app on the fly? Including handful tools like layout overlays, layers etc.

Most debuggers including GDB can print and set state.

> - examine and debug animations?

> - analyze paint/re-paint performance?

I don't do GUI development but you'll have to use a tool specific to the environment you're working with (just like how the DOM is a specific environment). What tool do you use to debug webview? Not your main browser. Systems development is the same.

> - view and debug delayed background actions?

You can get the time spent on anything down to individual assembly instructions if you wish.

> - record and replay user flows?

rr (which is GDB compliant hence integrates well with termdebug in vim).

I don't disagree that there are many tools for web dev. But they're not always better or easier to use. The built-in nodejs debugger is shit compared to GDB for example. My point is that everything you can do in browsers that aren't browser specific exists for other languages as well. Many times very specialized with better features that the devtools version.

Again, I love web development, but I also live in the terminal and love those tools even more. I wish they existed for the web.

Re:Can Rust Beat JavaScript in 2023? by co_dh on Friday April 21, 2023 @12:15PM (#35655975)
Any language with repl can have it . Python for example
Re:Can Rust Beat JavaScript in 2023? by Uehreka on Friday April 21, 2023 @09:35AM (#35653510)
You make a good point, I’ve been saying for years that hot reload is too fast. Rust compile times really give you time to meditate and reflect.
Re:Can Rust Beat JavaScript in 2023? by rk06 on Friday April 21, 2023 @09:43AM (#35653611)
What sane tooling are you talking about? FE projects takes minutes to build while backend projects can take hours.
Re:Can Rust Beat JavaScript in 2023? by jvanderbot on Friday April 21, 2023 @09:04AM (#35653105)
Yeah, the closest I'd come is writing a server less endpoint in Rust or Cpp.
Re:Can Rust Beat JavaScript in 2023? by candiddevmike on Friday April 21, 2023 @09:08AM (#35653141)
What compelling reason do you have for wanting another team to use Rust instead of JS?
Re:Can Rust Beat JavaScript in 2023? by VWWHFSfQ on Friday April 21, 2023 @09:20AM (#35653318)
It was just an exploration to see if there was anything we were missing out on.
Re:Can Rust Beat JavaScript in 2023? by candiddevmike on Friday April 21, 2023 @09:22AM (#35653349)
That:

> It was just an exploration to see if there was anything we were missing out on.

Doesn't square with this:

> At some point though we'll probably just have to hire Rust engineers instead of trying to convert JS devs.

Reads like rust exceptionalism.

Re:Can Rust Beat JavaScript in 2023? by VWWHFSfQ on Friday April 21, 2023 @09:27AM (#35653414)
If we find that at some point we're missing out on something great with Rust/WASM then we'll hire Rust engineers and not just assume that our javascript developers can do it. That was the point.
Re:Can Rust Beat JavaScript in 2023? by govolckurself on Friday April 21, 2023 @09:15AM (#35653241)
It sounds like it's the developers who are immature. "I don't want to do this because it's hard!" doesn't bode well, because there's always something in software that's hard. None of this was ever easy.

Seriously, children cry when something is difficult. We should hold ostensibly-professional software developers to higher standards.

Re:Can Rust Beat JavaScript in 2023? by CapsAdmin on Friday April 21, 2023 @09:47AM (#35653676)
Most web devs are familiar with javascript and typescript and are currently easily able to create products and solve problems for companies. They are much easier to find and hire compared to rust developers.

So why should a company hinder its own productivity by trying to find rust developers because rust is technically safer in some ways? Or risk ruining the culture of its currently functional developers by forcing them to use rust?

Re:Can Rust Beat JavaScript in 2023? by jerf on Friday April 21, 2023 @09:21AM (#35653332)
"Rust with WASM & web macros."

It's not really that; it's really just WASM. There's going to be a flood of this sort of thing from all sorts of languages, even multiple per language. It's early days yet and the ground is still being felt out, but eventually the Javascript qua Javascript foundation in the browser is going to be breached and a day will come when it is a minority language (still many years from now), for exactly the same reason that never in the whole history of computing has one general purpose programming language "won". Per https://www.destroyallsoftware.com/talks/the-birth-and-death... , Javascript is going to "win", but it's going to be Javascript in its incarnation as WASM, not the Javascript we know today.

"random bits of Rust in 2024."

And that's "the ground being felt out", not a fundamental problem. I expect to see WASM frameworks develop that are shipped out to the world as WASM and bind to any language. Decent odds they'll be developed in Rust for several reasons (performance not least of all), but you won't need to know that to use it in your Python WASM front-end app or some new WASM-primary language that is nothing more than a gleam in its creator's eye right now. If you don't want the chaos, hey, great. Even people who live on the cutting edge can't be cutting edge in every dimension. By all means sit back and watch from a distance. But these problems will certainly be fixed.

Re:Can Rust Beat JavaScript in 2023? by muglug on Friday April 21, 2023 @10:12AM (#35654048)
The enemy of this entire thesis is the layers of additional complexity required by such “innovation”. Each layer has its own API and update mechanisms, all of which slow down developer productivity (especially when inheriting a project you did not build).

In some cases that complexity is worth it — Figma, for example, squeezes a lot of value from WASM. I myself have used WASM to create a browser-based testing environment for a Rust-based static analysis tool I’ve built, so my colleagues can quickly repro issues. But for most web development, it’s not worth it.

Re:Can Rust Beat JavaScript in 2023? by jerf on Friday April 21, 2023 @02:18PM (#35657857)
In the long term, I expect WASM to start blowing away layers of the browser, precisely because of this problem. It may be another 20 years, but it's going to happen.

To put it another way, no, you're not wrong, and yes, the resistance to large-scale changes to the web stack is huge, arguably the largest resistance of all time. Nevertheless, the amount of metaphorical amperage flowing through is even larger and is large enough that it is already "short circuiting" and blasting a new circuit through. It's going to take a while, and the backwards compatibility will be with us for a while, but we're already seeing flashes of websites where you don't need to know the old CSS and HTML and such because they're actually WebGL and WASM. As more capabilities are exposed to WASM and they become more efficient, more and more stuff will be moved into it.

That will cause its own explosion problem, but it'll be handled. It's not like every website is going to write its own bespoke text renderer every single time. And in the end there are some technologies that will fade out and become legacy, then irrelevant. I may yet outlive the HTML/CSS/JS stack.

Re:Can Rust Beat JavaScript in 2023? by mrighele on Friday April 21, 2023 @05:58PM (#35660795)
but once you blow away the layers you are left with a virtual machine with a number of low level APIs. Most people won't want to use them.

Yes, I can see the advantage of rewriting those layers in terms of the lower level APIs, for example if the DOM API were to implemented in WASM, you could keep it out of the browser, and download only when/where needed (with a number of caveats, of course)...

The main issue is that even if you do that, I don't expect an API designed with JS in mind to be a good fit for Rust, and vice versa. The risk is that you end up programming not against the "Web Platform", but "WebJS platform", "WebRust Platform" etc."

Re:Can Rust Beat JavaScript in 2023? by myth_drannon on Friday April 21, 2023 @09:07AM (#35653126)
You forgot ClojureScript, ScalaJS, Elm. All were moderately successful in their own niche (Clojure or Scala dev shops).
Re:Can Rust Beat JavaScript in 2023? by fulafel on Friday April 21, 2023 @09:21AM (#35653337)
This should be present tense, at least in the ClojureScript case.

Recent cool developments on that side include Electric Clojure - generating transparently state passing front and backend code from a single DSL: https://github.com/hyperfiddle/electric

Re:Can Rust Beat JavaScript in 2023? by erichocean on Friday April 21, 2023 @01:52PM (#35657511)
Electric Clojure is insane, having a ton of fun playing with it.
Re:Can Rust Beat JavaScript in 2023? by francisofascii on Friday April 21, 2023 @08:54AM (#35652991)
I would have said only TypeScript has been successful, despite it being backed by Microsoft. ;) (I like MS, but just know many who don't.)
Re:Can Rust Beat JavaScript in 2023? by illiarian on Friday April 21, 2023 @09:19AM (#35653299)
Microsoft is the only company that developed multiple successful languages. They know how to create languages for everything.

No one is even close.

Re:Can Rust Beat JavaScript in 2023? by tough on Friday April 21, 2023 @09:36AM (#35653525)
Microsoft has this exceptional engineer on payroll

Anders Hejlsberg, lead architect of C# and creator of Delphi and Turbo Pascal, has worked on the development of TypeScript.

Re:Can Rust Beat JavaScript in 2023? by shrimp_emoji on Friday April 21, 2023 @09:21AM (#35653336)
I guess MSVC is the worst compiler out of spite that they didn't create C or C++.
Re:Can Rust Beat JavaScript in 2023? by MuffinFlavored on Friday April 21, 2023 @09:11AM (#35653189)
> This is not a dig at Rust (which I love) but God help any developer inheriting a frontend codebase with random bits of Rust in 2024.

Why? Rust has a bunch of features built in to promote "good code", no?

Re:Can Rust Beat JavaScript in 2023? by augusto-moura on Friday April 21, 2023 @09:16AM (#35653252)
The problem is not "bad code", but experience from teams and community. Browsing HN might make we think that Rust is everywhere and everyone knows it, but most of the frontend developers in the world are not prepared to inherit a project in such a foreign language.

My theory is that, you probably can see when a language its being picked by some community by looking into courses available, either free or on paid platforms

Re:Can Rust Beat JavaScript in 2023? by oaiey on Friday April 21, 2023 @09:16AM (#35653256)
Rust is a unmanaged language. 99% of use cases do not need it and 99% of devs are unable to handle it's.
Re:Can Rust Beat JavaScript in 2023? by MuffinFlavored on Friday April 21, 2023 @10:11AM (#35654037)
> Rust is a unmanaged language.

Not quite sure what you mean. I've written some pretty cool stuff in Rust and never had to do any free() / drop()?

Re:Can Rust Beat JavaScript in 2023? by kaba0 on Friday April 21, 2023 @04:17PM (#35659468)
Most modern C++ code bases also completely lack explicit frees/deletes, but not many would argue that C++ is a managed language.

Though a more objective distinction is hard to give on what is a managed language, I found the garbage collection handbooks’ quote on the topic the most illuminating (linking to my older comment): https://news.ycombinator.com/item?id=35332600

In Rust and in C++ memory layout is part of your public APIs and has to be refactored when it changes. This is not the case with managed languages.

Re:Can Rust Beat JavaScript in 2023? by nosianu on Friday April 21, 2023 @09:46AM (#35653653)
> then Flow and TypeScript

Neither one is a different language. Both merely add type annotations to an otherwise pristine ECMAScript code base.

Typescript has some very few and minor and no longer needed things, like enums or namespaces, that need to be transpiled and are not part of ECMAScript. But again, those are minor and you no longer need them (since ES 2015 one can use modules instead of namespaces, and marked "as const" object literals instead of enums).

I know some people want to argue definitions, "different language" etc., but it's really just a completely optional tooling layer that you can just strip. It's also evaluated purely during development time, for type checks, the actual code that gets executed remains the ECMAScript part.

Whenever there are changes in a new Typescript version it's either purely within the type system, or they add type support for new ECMAScript features, those proposals that reached stage 3.

You could just imagine the type annotations in a different layer than the actual code, like in Photoshop. A layer used only by the IDE and code checking tools.

Microsoft added greatly to the confusion by putting the type checker, like eslint usable standalone or continuously queried through the IDE, and the type annotation files (.d.ts) generation and the completely optional .js file transformation AND .js file transpilation - backwards compatible JS code for earlier runtimes - into one tool. But all of those are different things. If your traget is "esnext" or you don't use JS features that your target runtime does not yet support transpilation is just removal of type annotations (except, enums, namespaces, which are no longer necessary and only exist for historical pre ES2015 reasons).

Re:Can Rust Beat JavaScript in 2023? by muglug on Friday April 21, 2023 @10:01AM (#35653889)
> Neither one is a different language. Both merely add type annotations to an otherwise pristine ECMAScript code base.

This isn’t really a matter of debate — Microsoft describes TypeScript as a programming language distinct from JavaScript on its homepage.

It’s a programming language with a trivial transpiration step to another language, but a separate language all the same.

Re:Can Rust Beat JavaScript in 2023? by nosianu on Sunday April 23, 2023 @04:01AM (#35674304)
You completely ignored everything I wrote and merely responded with an assertion, ignoring all evidence. What a terrible way to have a discussion. Would you kindly not ignore the facts?

Oh and here is what it ACTUALLY says on the Typescript page (https://www.typescriptlang.org/):

> TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.

None of that contradicts anything I wrote.

Re:Can Rust Beat JavaScript in 2023? by zadler on Friday April 21, 2023 @09:49AM (#35653718)
As a recovered Haskell enthusiast, a can say that typescript is downright luxurious to work with for web development in a way that I think is hard to compete with in rust, because of how it types objects (like composable / decomposable sets), and the generic language to work with types really complements JavaScript instead of forcing you to do things differently.