Live data from Hacker News

Figma’s Journey to TypeScript

figma.com

11–20 of 257 posts

Re: Figma’s Journey to TypeScript

#12
post #6

Earlier quoted context omitted.

Often because the "standard" thing was not always the standard. Like, all those people that chose Flow now have something "non-standard."

Coffeescript used to be "standard" in Ruby on Rails community. (insert canned laughter)

Why the laughter? CoffeeScript was great. TypeScript is even greater. All IMHO and YMMV, of course.

Re: Figma’s Journey to TypeScript

#14
post #10

Surprising to hear Figma had a custom language for JS. Even more surprising that it was faster than TS. And then they migrate off it onto slower TS! Seems to happen a lot though. Company makes custom stuff early on, gets big, then migrates to something "standard".

Why? Because Evan Wallace is gone. That’s my wild guess.

One of the first points in the article was that wasm became widespread enough that they could migrate them performance critical parts to C++ and the rest to typescript. The necessity for skew simply wasn't there anymore

Re: Figma’s Journey to TypeScript

#15

For people like me who know little about Figma, what motivates their use of WebAssembly?

You probably know that Figma is a UX design software. This means it’s basically a graphics program: you draw shapes, you scroll and zoom around. It does that extremely well. It’s unbelievably snappy even on a very large canvas with many complex UI screens. Very few desktop applications run nearly as well these days. I’m convinced that this kind of optimization is an important part of their success.

Re: Figma’s Journey to TypeScript

#16
post #15

For people like me who know little about Figma, what motivates their use of WebAssembly?

You probably know that Figma is a UX design software. This means it’s basically a graphics program: you draw shapes, you scroll and zoom around. It does that extremely well. It’s unbelievably snappy even on a very large canvas with many complex UI screens. Very few desktop applications run nearly as well these days. I’m convinced that this kind of optimization is an important part of their success.

I'm curious about how it all hangs together, WebAssembly and Typescript.

The very first mention of WebAssembly in the article:

"Some years after WebAssembly obtained widespread mobile support, we replaced many core components of our Skew engine"

Re: Figma’s Journey to TypeScript

#17
post #5

Skew wasn't just a little bit faster than TypeScript. According to Evan Wallace (former Figma CTO), it was 1.5x to 2x faster due to better optimizations enabled by stricter type system.

I really wish browsers had continued to develop a "use strong" mode for JS. It sounded like there were significant challenges, but curbing some dynamism in order for more predictable optimisation sounds like a great tradeoffs for production-quality apps.

Take that to the extreme and you get WASM, or it's predecessor asm.js

It's also what JITers like V8 internally do, you'll get major performance hits if you do weird dynamic things.

Re: Figma’s Journey to TypeScript

#18
post #5

Skew wasn't just a little bit faster than TypeScript. According to Evan Wallace (former Figma CTO), it was 1.5x to 2x faster due to better optimizations enabled by stricter type system.

> According to Evan Wallace (former Figma CTO), it was 1.5x to 2x faster due to better optimizations enabled by stricter type system.

It's probably not as simple as that. If hotpaths are optimized, the 2x advantage is quite likely to vanish.

But then one could say - well, you're forced to write optimized JS in several places and that impacts readability. Sure, but the trade off was to use an entirely new compile-to-js language with less tooling support and mindshare. It seems now that it wasn't worth it. The blog post sort of sugarcoats this contentious previous technical choice.

Re: Figma’s Journey to TypeScript

#19
post #10

Surprising to hear Figma had a custom language for JS. Even more surprising that it was faster than TS. And then they migrate off it onto slower TS! Seems to happen a lot though. Company makes custom stuff early on, gets big, then migrates to something "standard".

Why? Because Evan Wallace is gone. That’s my wild guess.

It does smell like someone's pet project. I'm wondering what the folk at Microsoft had not figured out, that they indeed had at Figma. Typescript is open source, so why wasn't this optimisation just made as a contribution to Typescript at the time?

Also, was Typescript really as claimed in its "infancy" at the time mentioned in the article? They didn't mention a particular year.

Re: Figma’s Journey to TypeScript

#20
post #12
post #6

Earlier quoted context omitted.

Coffeescript used to be "standard" in Ruby on Rails community. (insert canned laughter)

Why the laughter? CoffeeScript was great. TypeScript is even greater. All IMHO and YMMV, of course.

Some companies built a lot in CoffeeScript. Maintaining that won't be fun.
Post reply on HN