top | item 40990462

(no title)

jesus-was-here | 1 year ago

Out of curiosity, how long is your experience with TypeScript? I feel like I have to ask.

>TypeScript does not modify this code when it compiles to JavaScript

TypeScript does not modify any code which is valid JavaScript. Your idea of adding some sort of "debug build" to TypeScript would never be performed by `tsc`, but perhaps by bundlers, etc.

You might want to look up libraries like zod, or even better, Effect: https://effect.website/

discuss

order

danvk|1 year ago

Extensive. Try reading the full post, you'll see that those points are all mentioned.

CodeAndCuffs|1 year ago

Ive used fp-ts, mainly for Either, Option, and Pipe. I tried out Effect for a new project, and have loved it. The initial hurdle was a little intimidating but I was productive with it within 2 days, and it's paid dividends. It's discord community was surprisingly great, and helped me turn an okay module into an amazing one.

Effect is huge, and does seemingly everything, but it probably does the specific thing you want to do now, with the ability to extend to the other stuff as you need/want

likeclockwork|1 year ago

Typescript's refusal to participate in codegen is one of the things I don't like about it.

It makes Typescript a descriptive, rather than expressive, language with weak semantics.