Re:Lyra: Fast, in-memory, typo-tolerant, full-text search en...
by jahewson on Monday August 01, 2022 @12:45AM
(#32302174)
Well, the types only exist at compile time, so they're fast at least!
[ Parent
| on HN ]
Re:Lyra: Fast, in-memory, typo-tolerant, full-text search en...
by micheleriva on Monday August 01, 2022 @03:31AM
(#32303139)
Disclaimer: Lyra author here!
The biggest problem I have with TypeScript is to know WHAT .ts files will be compiled into. I.e., if you're using enums or decorators, there's no plain support for them in JS so you'll end up having some kind of "polyfills", which are not so optimized.
Once you analyze your compiled JS, you can write TS knowing what you're gonna get, which is the trick to make it optimized.
My two cents :)
Re:Lyra: Fast, in-memory, typo-tolerant, full-text search en...
by nicoburns on Monday August 01, 2022 @04:26AM
(#32303406)
The trick there is to not use enums or decorators! In all seriousness, I believe it’s common for typescript codebases to eschew these features, precisely because it’s hard to reason about the generated code (and preferable to avoid features that aren’t on an ECMAScript standards track.