(Actually) Benchmarking TypeScript
Вставка
- Опубліковано 21 гру 2023
- ArkType's been up to some cool stuff for awhile, but attest takes it to a whole new level.
Announcement tweet: / 1722640689136095643
Github repo: github.com/arktypeio/arktype/...
Check out my Twitch, Twitter, Discord more at t3.gg
S/O Ph4se0n3 for the awesome edit 🙏 - Наука та технологія
Nah I ain't writing tests for my types lol
lol
its taking things too far
"This isn't for everybody, I don't expect most developers even watching this to benefit from these tools."
Theo mentioned this is expected
Amen
This is ridiculous
ohh the js world, we writing test for types now
As a TypeScript type-level dev, I very often write complex types and even tests for those types, but one thing I was missing all this time was performance tests. I'm so excited for this! I really hope in the near future they also release tools, or at least guidelines, to help you improve the performance, and not just test and monitor it.
This is great for library authors and those of us that need complex type logic!
one of those, "maybe I should reconsider my life choices" moments, when you are writing tests for your linter's fake types.
(in all seriousness, I can see how some library devs might benefit from it)
I mean u are not wrong
lol never thought about this but it’s true. Large projects get so unbearably slow
I don't intend to use it but it's cool it exists, and I get why some people would want to use it.
For anyone Curious. Arktype is also compatible with JS and JSDoc if that is how you're doing your typing. It also supports both CommonJS and Ecma Modules out of the box so you can incorporate it into your old code-bases as well. Truly remarkable work
We have TypeScript to check types, so I think we need PerformanceScript to check performance!
TYPEBOX
So Theo hates unit tests but loves tests for types? 😂
I'm pretty sure he is for unit testing when it comes to libraries
Sorry, potentially naive question here, but if a developer has to go to _this much_ trouble to work with the type system don't we have to ask if choosing something built with types from the ground up, like Rust, wouldn't be a better career choice?
i used to think typescript lsp are slow. then i code rust
I never had problems with rust-analyzer tbh. Probably using neovim instead of a bloated ide also helps a lot
I'm using neovim too, the project that I'm on have lots of macro. rust analyzer usually takes more than one gigs and it frequently crash
Rust/Rust Analyzer only really becomes slow when you use a bunch of proc macros, because it has to build your code to expand the code in order to understand the types.
Typescript: I can fix him.
I do not know how to *correctly* write test for anything beyond a simple pure function using vitest or jest! You want we to write test for TYPES? :) Really, a video what should be tested and what shouldn't will be a good one! How to use this tool, ArkType? Theo, want to show us how you do this, e.g. with your UploadThing tRPC routes?
The way I have an M1 Max and the I still have to restart the TS language server every day
Fix TS-config
test for you types? from the guy on the never test train? Aint no way
FYI for people in the comments, this came out in November, the video is just coming out a bit late
This is one of reasons why I don't love typescript, we build shizo stuff to "fix" shizo stuff and it produces even more shizo stuff
If I have to write tests to ensure that he language itself is working, then Ive lost the plot
Exactly, having to write tests for the types itself means the types is unreliable which defeats the point of the types!
@@mikopiko You don't, it's a tool for lib devs to check speed. TS's type system isn't sound, but sound enough for what people are using it for.
1:22 It's not "at test" its "attest", pronounced "UH test", which means to affirm to be correct, true, or genuine.
Let's not forget Typescript is a Microsoft product. So it's going to be slow from the get-go
Why don't you just use a typed language if you want types from the get go? Problem solved. JS has no types, Typescript doesn't change that, it's a formatting tool.
You are factually incorrect. Typescript does add types and has a static type checker.
What are you even talking about? TS does static type checking, hence it's a typed language. The fact that it emits JS without this type information at runtime is a sep. issue. However, most typed languages do type erasure. No difference to e.g. using js_of_ocaml (besides having a sound type system :)).
Yo! My ts server dies all the time!!!!!
Is it just me, or has this channel become QVC for developer tools?