Загрузка видео...

Не удалось загрузить видео

На главную

📢Introducing ArkRegex📢 a drop in replacement for new RegExp() with types ⬇️

733,454 просмотров • 11 месяцев назад •via X (Twitter)

Комментарии: 45

Фото профиля ArkType
ArkType11 месяцев назад

arkregex is a standalone, type-only package that adds types to RegExp. if you prefer... 🔎 clarity over opacity 🔒 safety over crashing using it should be the easiest win of your life. announcement:

Фото профиля colinhacks
colinhacks11 месяцев назад

david if you keep going down this path I won't be able to help you

Фото профиля phong
phong11 месяцев назад

we devs were so preoccupied with whether we could, that we didn't stop to think if we should this is amazing though

Фото профиля ArkType
ArkType11 месяцев назад

we thought about it and concluded that if you haven't already installed arkregex your project is garbage

Фото профиля Rhys
Rhys11 месяцев назад

This is insane

Фото профиля Maurice Kleine
Maurice Kleine11 месяцев назад

there's Doom in Typescript, and juuuuuust below that is ArkRegex

Фото профиля kenneth
kenneth11 месяцев назад

typesafe eval() wen?

Фото профиля Salman Shaikh
Salman Shaikh11 месяцев назад

how is this even possible in typescript?

Фото профиля ArkType
ArkType11 месяцев назад

unironically same strategy used to run DOOM (but highly optimized)

Фото профиля Salman Shaikh
Salman Shaikh11 месяцев назад

wait! you can run DOOM in ts?

Фото профиля Salman Shaikh
Salman Shaikh11 месяцев назад

cool!

Фото профиля Aman
Aman11 месяцев назад

Plz stop kidding 🙏

Фото профиля Ray
Ray11 месяцев назад

🔮 and thank you!

Фото профиля ArkType
ArkType11 месяцев назад

readable regex for the masses✊

Фото профиля Maximilian
Maximilian11 месяцев назад

can I safely use this and not have my lsp blow up?

Фото профиля ArkType
ArkType11 месяцев назад

Generally, yes. A lot of effort went into optimizing the parser including dozens of type-level benchmarks. Of course eventually you'll hit the limits of TypeScript eventually with enough unions but it's pretty easy to just not use it for those extreme cases.

Фото профиля ArkType
ArkType11 месяцев назад

There's a fallback for declaring the type or you can just use `new RegExp()` for those cases.

Фото профиля Maximilian
Maximilian11 месяцев назад

just for reference how many instantiations would a regular type be or a zod object - and at what number does the lsp start falling apart? I understand that these numbers are probably sensible for you (and I understand lower = better) but it’s like a currency I never used very grateful if you feel like you have the energy to explain but totally understandable if not Library is pure magic no matter what but lsp performance has burnt me completely

Фото профиля ArkType
ArkType11 месяцев назад

Most of these cases are less expensive than a simple zod schema. 1-10k instantiations is pretty standard for that sort of thing.

Фото профиля ArkType
ArkType11 месяцев назад

You just have to be careful if your expression is combinatorial, but there's a ceiling on what TS will do before complaining anyways. A good heuristic would be to look at the number of branches in the union of the result type. If you see >10k, you may want to declare the type

Фото профиля Sameer
Sameer11 месяцев назад

how?? how?? you're making things typesafe, which I never even thought of could be possible?

Фото профиля Matt Popovich
Matt Popovich11 месяцев назад

holy shit this is amazing

Фото профиля Steve Ruiz
Steve Ruiz11 месяцев назад

jesus

Фото профиля Arian
Arian11 месяцев назад

This is black magic. Crazy work.

Фото профиля Shounak Ghosh
Shounak Ghosh11 месяцев назад

typesafe regex is craazy (⁠・⁠o⁠・⁠;⁠)

Фото профиля dev
dev11 месяцев назад

this is insane, what's next on the horizon ?

Фото профиля ArkType
ArkType11 месяцев назад

type-level AGI

Фото профиля ArkType
ArkType11 месяцев назад

(actually though [email protected] which will integrate this syntax natively)

Фото профиля Seb
Seb11 месяцев назад

I'm about to switch from a python stack to a Typescript one. I can't wait to use this!

Фото профиля ArkType
ArkType11 месяцев назад

love it, proving my point here👍

Фото профиля vinay
vinay11 месяцев назад

insanee

Фото профиля tanpreet 🌂
tanpreet 🌂11 месяцев назад

woah 😮

Фото профиля Jasper 張 🟠
Jasper 張 🟠11 месяцев назад

This is so good and useful

Фото профиля Hamza Mateen
Hamza Mateen11 месяцев назад

rust port?

Фото профиля Wahyu
Wahyu11 месяцев назад

holy shit, i feel like TypeScript template literal types need to file a restraining order against you

Фото профиля Odii
Odii11 месяцев назад

cracked shit.

Фото профиля Pooria Faramarzian
Pooria Faramarzian11 месяцев назад

@amosavian

Фото профиля Georges Haidar
Georges Haidar11 месяцев назад

Oh my days… @ssalbdivad you crazy scientist.

Фото профиля Beardo Schmidt 🦗
Beardo Schmidt 🦗11 месяцев назад

Whoa. Didn’t expect this to come standalone!! Sold

Фото профиля harsh
harsh11 месяцев назад

Really cool stuff.

Фото профиля boidu
boidu11 месяцев назад

Nah this is crazy wth..

Фото профиля Liam Monaghan
Liam Monaghan11 месяцев назад

actual wizardry

Фото профиля Nikoemme
Nikoemme11 месяцев назад

god this is a banger ! congrats

Фото профиля Savvas Papageorgiadis
Savvas Papageorgiadis11 месяцев назад

HUH?

Фото профиля Yash Kandalkar
Yash Kandalkar11 месяцев назад

Amazing!

Похожие видео