Live data from Hacker News

TypeScript is surprisingly ok for compilers

matklad.github.io

241–245 of 245 posts

Re: TypeScript is surprisingly ok for compilers

#241

TypeScript is an incredible language in general. The fact that Functions are Objects that can have properties/methods is supremely undervalued. Are there other languages that do this so nicely? It's the perfect blend of OO and functional. Programming is mostly about gradually figuring out the right design I find. JS/TS let's me evolve things naturally without big rewrites. function foo() {} function bar() {} function…

TypeScript is really nice but you're really describing a JavaScript feature to be honest. Here's some other languages that support objects as functions (although not necessarily functions as objects): https://en.wikipedia.org/wiki/Function_object

I suspect many ts programmer dont even know it compiles into js. Potentially dont even know what js is. Such is the state of modern web dev.

Re: TypeScript is surprisingly ok for compilers

#242

Earlier quoted context omitted.

Curious. What made you switch to Bun?

I know this is probably blasphemy at this point, but I actually wasn't enjoying package management in Deno (or lack thereof). I've been an avid user of the NPM ecosystem for a long time (10+ years), it's entrenched deep in me and I don't mind it haha! In particular with Deno, it was trying to remember all the dependency URLs, and not wanting to duplicate them - every time I wanted to read a file and I had to lookup t…

Wow, nice summary. Exactly what I feel about Deno although Deno has standard tooling for formatting/linting to make the story a bit better.

Re: TypeScript is surprisingly ok for compilers

#243

Earlier quoted context omitted.

Curious. What made you switch to Bun?

I know this is probably blasphemy at this point, but I actually wasn't enjoying package management in Deno (or lack thereof). I've been an avid user of the NPM ecosystem for a long time (10+ years), it's entrenched deep in me and I don't mind it haha! In particular with Deno, it was trying to remember all the dependency URLs, and not wanting to duplicate them - every time I wanted to read a file and I had to lookup t…

Interesting, I'll really have to dig deeper into Bun. I know I've been having a hard time switching to anything else because I rely heavily on a typescript compiler transformer and that hasn't wanted to transfer to well to other things (like from Webpack to esbuild for example).

Re: TypeScript is surprisingly ok for compilers

#244

TypeScript is an incredible language in general. The fact that Functions are Objects that can have properties/methods is supremely undervalued. Are there other languages that do this so nicely? It's the perfect blend of OO and functional. Programming is mostly about gradually figuring out the right design I find. JS/TS let's me evolve things naturally without big rewrites. function foo() {} function bar() {} function…

the flexibility you describe seems to be coming from lisp (schema) that javascript was designed on top of initially

Re: TypeScript is surprisingly ok for compilers

#245
post #38
post #6

Earlier quoted context omitted.

I would think C# is easier for this due to having proper (and very convenient) pattern matching.

C# doesn't have anything resembling proper pattern matching. C#s pattern matching is akin to a marginally improved switch or if/else-if chain. C#s pattern matches aren't exhaustive, and the compiler doesn't properly check them at all.[0] There are no proper sum types in C#, so 80% of the point isn't even there. enum Season { Spring, Summer, Autumn, Winter } ... int PatternMatch(Season season) => season switch { Seaso…

These things are not about pattern matching but about other language features.
Post reply on HN