Readit News logoReadit News
18nleung commented on Show HN: Zero-codegen, no-compile TypeScript type inference from Protobufs   github.com/nathanhleung/p... · Posted by u/18nleung
mubou · 5 months ago
The fact that the source is so small is wild. I would have expected a huge convoluted parsing library implemented in types.

On the other hand, the fact that this is even possible is more wild. Instead of replacing JS with a proper statically-typed language, we're spending all this effort turning a preprocessor's type system into a turing-complete metalanguage. Pretty soon we'll be able to compile TypeScript entirely using types.

18nleung · 5 months ago
I would have written a shorter source, but I did not have the time.
18nleung commented on Show HN: Zero-codegen, no-compile TypeScript type inference from Protobufs   github.com/nathanhleung/p... · Posted by u/18nleung
jillyboel · 5 months ago
Cool, but I assume not great for performance?

Probably better to just stick with codegen

18nleung · 5 months ago
You're right that IDE/dev-time performance might be slower than using generated types since this relies on "dynamic" TypeScript inference rather than static codegen'd types.

That said, depending on how your codegen works and how you're using protos at runtime, this approach might actually be faster at runtime. Types are stripped at compile-time and there’s no generated class or constructor logic — in the compiled output, you're left with plain JS objects which potentially avoids the serialization or class overhead that some proto codegen tools introduce.

(FWIW, type inference in VSCode seemed reasonably fast with the toy examples I was playing with)

18nleung commented on How to bike across the country   brooks.team/posts/how-to-... · Posted by u/benjbrooks
1024core · 5 months ago
Author was in the middle of prepping for the NYC marathon, so they were in decent shape physically.

My fat ass would have given up before I even reached the Bay Bridge.

That reminds me: the author did not mention how they crossed the Bay Bridge. There is no cycling path from SF to EB AFAICT.

18nleung · 5 months ago
I biked with the author from SF to Sacramento — we went up to Marin over GGB, then over the Richmond–San Rafael bridge to the EB

u/18nleung

KarmaCake day442July 6, 2015
About
natecation.com

my public key: https://keybase.io/nathanleung; my proof: https://keybase.io/nathanleung/sigs/21RQELlB81U9ezo98QC5Ypm7DXkaUdVo--fOyCR9Gws

View Original