nadako
Re:Ask HN: What metaprogrammable language do you/would like to use?
on Tuesday April 23, 2019 @06:14AM (#19727097)
> Haxe does not typecheck macros.
That is a weird statement. Haxe expression macros by definition return untyped AST to be processed further normally by the typer, just like hand-written code. And it will be type-checked. And then there's an AST node existing exactly for type-checking (or, rather, type unification) that you can generate to insert custom checks: https://haxe.org/manual/expression-type-check.html
Re:Ask HN: What metaprogrammable language do you/would like to use?
on Tuesday April 23, 2019 @06:08AM (#19727060)
Oh, and regarding "how compact are your programs", well every time I see boilerplate code or reflection usage that cannot be refactored into something nice without sacrificing clarity and/or performance, I use meta-programming to generate it instead.
Usual suspect here is any kind of "support" code, like serialization, RPC, dependency injection and such.
Re:Ask HN: What metaprogrammable language do you/would like to use?
on Tuesday April 23, 2019 @06:05AM (#19727043)
Haxe has pretty good metaprogramming capabilities. It has expression macros (compile-time evaluated calls that return expressions to be inserted at call place) as well as type-building macros (build fields and/or define whole new types). Both have access to compiler and system API and information about the context (e.g. expected type).