This is a bit of an aside, but you could implement this whole TS feature with 
Nim macros. Rather than writing a DSL for plotting, you could write a macro 
that takes a schema and produces types and a DSL using a pretty similar format 
to TS. It might be a decent amount of work, and I'm not sure if you could match 
TS 100%, but you could get pretty close.

This one of the things I like best about Nim. I don't need the core team to 
anticipate my needs, or even care about my use-case. If it's important to me, I 
can do it myself, and do so in a way that feels integrated into the language 
(nice error reporting, etc.). Writing Nim macros isn't exactly trivial, but 
it's certainly easier than adding new language features.

Yehuda Katz [wrote about 
this](https://yehudakatz.com/2009/07/11/python-decorators-in-ruby/) from a Ruby 
vs Python standpoint ages ago, explaining why Rails showed on on Ruby rather 
than Python. Nim metaprogramming is harder than Ruby metaprogramming, but also 
much more powerful, and with fewer opportunities to shoot yourself in the foot. 
It's a very useful tool.

Reply via email to