Will JavaScript type annotations kill TypeScript?
The creators of Svelte and Turbo 8 both dropped TS recently saying that "it's not worth it".
Yes: If JavaScript gets type annotations then there's no reason for TypeScript to exist.
No: TypeScript remains the best language for structuring large enterprise applications.
TBD: The existing user base and its corpensource owner means that TypeScript isn’t likely to reach EOL without a putting up a fight.
I hope they both die. I mean, if you really need strong types in the browser then you could leverage WASM and use a real programming language.
I don’t know and I don’t care.
Software Development

Svelte Core Team Mulls Rust Compiler to Further Speed Web Apps

The Svelte Framework may improve web app performance even more thanks to a possible Rust compiler.
Dec 30th, 2021 9:56am by
Featued image for: Svelte Core Team Mulls Rust Compiler to Further Speed Web Apps

The next major version of Svelte, the increasingly popular web application framework, may get a boost from the Rust programming language, according to its creator Rich Harris.

Among the possible changes for the eventual release of Svelte 4.0 is a new compiler, written in Rust, Harris said, in a video interview produced by web developer tool provider Vercel, where Harris is currently employed.

“A lot of JavaScript tooling is written in Rust at the moment, and maybe it would make sense if the Svelte compiler was written in Rust,” Harris said. He stopped short of a full commitment to making the switch to Rust in this next release, though did indicate it was a promising approach the core development team was exploring.

Currently, Svelte works by compiling the web application code (built from HTML, CSS and JavaScript) into highly optimized JavaScript. It differs from popular JavaScript  frameworks such as React.JS and Vue that render complex web pages at runtime in the browser. It eliminates this burdensome step by moving the bulk of the rendering work off the browser, by compiling the app ahead of time.

Despite Svelte’s potential performance improvements, Harris has heard grumbling about the very large code sizes that result with very large web applications. Svelte compiles code for big web applications, for instance, tends to be more voluminous than the component code for a similar app in rendered in React, a third party had found.

A Rust-based approach to code compilation would potentially “not just eliminate that problem, it could actually mean that the compiled code is smaller than the input code, which I think would be fairly unique,” Harris said. The resulting code would still be in JavaScript.

Although somewhat difficult to learn, the Rust language is being rapidly adopted by system designers, not only for its speedy performance but also for its security controls. To this end, Harris noted that moving to Rust “potentially opens the door to error boundaries.”

Catching up with React

The core team is researching a number of other potential enhancements as well, including the incorporation of “partial hydration approaches.”

Harris also wants to continue exploring Svelte’s support of rendering motion. “This is something that Svelte has always prioritized,” Harris boasted. Svelte has declarative transitions to ease an element’s addition or removal from the browser’s Document Object Model (DOM). “We won’t yank the element out of the DOM immediately. We can play a transition on it so that you get graceful slide-in, slide-out, fly-in, fly-out behavior,” he said.

Despite these advanced features, Harris has been jealously eyeing React’s Framer Motion library for producing animated layouts. “I think that if a framework treated that stuff as its domain, then you could do some really nice UI design with very minimal effort,” he said.

The current version of Svelte (v3) was released in April 2019, and new releases come along every year and a half or so. The release date for Svelte 4.0 has not been publicly set yet.

Watch the whole interview here:

Group Created with Sketch.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.