Christopher Horobin (@c_horobin) profile picture
Joined November 2012
Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)Photo by Christopher Horobin (@c_horobin)
Never thought I would see the day this type checks in less than a second 馃く
Always bet on TypeScript! Just ran a perf check on the Go implementation in a massive @tan_stack Router project. Even without JSX (not supported yet), it鈥檚 already 3.3脳 faster than TS 5.8. Promising results! 馃殌
7
1,549
Never thought I would be described in this way. Genius I'd reserve for him. I just like types.
He鈥檚 a genius. I may have designed a lot of the initial architecture, but he鈥檚 the one making things crazy fast and bulletproof. I am now the student of my own library.
2
1
65
8,116
Type level code is just another language to learn. If you're uncomfortable looking at it, you probably don't know it that well
1
24
2,599
Inference still happens, even during generation. You still wait for it.
1
1
1,611
It's like stale vs fresh
1,395
Intersections over Extract for narrowing unions?
1
2
3,436
If you want a compiler to be fast. You can't assume the compiler optimises everything that you do.
3
1,328
I still think those repulsed by advanced TS just haven't done it enough. It's a small and quirky functional language. The great thing is there aren't any side effects you have to worry about
1
1
7
1,979
Has anyone actually used a compiler which is actually much faster than TS?
2
1
749
My point is I see a number of people saying TS is slow. I don't personally think it is compared to other compilers. I'd agree there are too many footguns though
2
630
I've used many languages in my career. I can only think of C maybe. C++ is definitely not fast to compile
1
565
If a package solves a difficult problem then I use it. I don't pull in packages because it reduces boilerplate of simple code most understand
4
544
Here goes a simple example. Firstly transforming a tuple type to a union while concatenating two properties together separated by `/`. While its simple, there is a number of ways to do it
Iterating and creating a union = use a distributive conditional Iterating and creating an object/array = use a mapped type Use recursion if you can't use any of the above
1
2
954
I'm going to start with how I would do it. A distributive conditional feels natural to unions. A truthy conditional check is easy on the compiler and is an easy way to trigger distribution
1
2
108
Another way is using a mapped type to create a tuple and index it to get a union. It performs basically the same as a distributive conditional with a truthy check but to me feels more natural for transforming to tuples/objects rather than unions.
1
402
Over encouraging abstraction, design patterns, oop and fp for learning developers was definitely a mistake. I don't ever remember being encouraged to write simple code
2
303
Iterating and creating a union = use a distributive conditional Iterating and creating an object/array = use a mapped type Use recursion if you can't use any of the above
I like distributive conditional types when I need to iterate over a union to create a new union. Otherwise mapped types are better for iterating and creating objects or arrays
1
1
5
1,570
Easy to compile types is not the same as easy to infer types?
1
299
My thought process here is. TS can cache types but regarding inference it needs to look into a type. Is caching even relevant here if inference is the bottleneck?
247
If only we channelled as much effort into writing efficient types as we do trying to make the fastest bundler
1
2
274