top | item 30847589

(no title)

hiphipjorge | 3 years ago

We've been starting to use Sorbet at Figma and honestly it's been pretty cool! Sorbet is definitely not as good at TypeScript (yet?). It's more verbose, doesn't support things like recursive types and records (shapes are experimental), and it doesn't inspire the same confidence TS does but it's definitely worth it to add it to your codebase if it's big enough!

Also, it's fast! I'm in total agreement with the point made in the article. That makes a huge difference in developer UX.

discuss

order

jez|3 years ago

I have some concrete ideas for how to fix shape types to make them not incremental. Just a matter of finding the time to push the prototype over the line, and do a migration on Stripe's codebase to fix or silence the ensuing errors. It's one of the most requested features for sure, and I think once we implement it Sorbet will feel much better to use, especially in smaller projects and scripts where you don't want to have to define `T::Struct` for one-off data structures.

hiphipjorge|3 years ago

Wow that would be awesome! Shapes/Records are definitely the #1 thing I'm missing from moving over from TypeScript.

I started thinking about this a bit and I came up with the conclusion that the single biggest difference between structs and shapes is really iterating over keys. I spent some time trying to create structs by which you could iterate over all the keys and all the solutions seemed clunky or inelegant.

jez|3 years ago

typo past the edit deadline: "not experimental" instead of "not incremental" (I've got incrementality on the mind these days it seems)

weaksauce|3 years ago

huh... didn't expect figma to be using any ruby. what do you all use it for there? I'm mainly a ruby programmer lately but I used figma for my last project design and it was really lovely to use so good work!

flyingswift|3 years ago

Most of the backend is written with Ruby