News for hackers. Stuff that matters.
Re:Macro-ts: TypeScript compiler with typesafe syntactic mac... by ivxvm on Tuesday May 30, 2023 @05:24AM (#36122809)
> Javascript is dynamic enough there is absolutely no need for Macros.

TypeScript macroses would be very useful for the same things codegenerators are useful: for example generating api client from swagger schema. Ofc you can do some trickery with metaprogramming, for example build and eval strings on fly and the result could be a dynamically generated function, but the point is: we want the process and the result to be typesafe and efficient, which is what is missing with hacky dynamic metaprogramming approaches.

Re:Macro-ts: TypeScript compiler with typesafe syntactic mac... by throw_m239339 on Tuesday May 30, 2023 @08:01AM (#36123775)
A swagger schema looks like YAML with a finite set of types. I don't see why you'd need to use eval in that case when from one hand you already have the schema in a javascript object and the other hand a simple builder pattern would build your API directly from that schema. Absolutely no need for macros.
Re:Macro-ts: TypeScript compiler with typesafe syntactic mac... by eropple on Tuesday May 30, 2023 @09:39AM (#36124763)
Generally speaking, because it would be very nice to have types without having to do offline code generation.