Open hughsimpson opened 3 years ago
Glancing over the code base a few things jump out at me:
subset Foo of Bar { } is export
, but it ends up slowing down potential optimizations. Two ways you could speed up this style of aliasing would be constant Foo = Bar
(but now type error messages will complain about Bar, rather than Foo, doesn't seem like that'd be too much of a hassle for you), and class Foo is Bar { }
. The constant route is probably a teensy bit faster depending on exactly how MRO happens, but the latter will give you flexibility if you later need to provide deeper introspection on the elements or do more substantial checks on creation. my constant %when =
a => { … },
b => { … };
with %when{$given} { .() }
else { #`[default] }
Yeah the current mixins are an obvious candidate for performance improvements. I don't think the givens are even showing up yet, performance-wise, TBQH. I haven't had the time to revise this really, it was just a little test for some code-generation work that I decided to pretty-up enough to be technically usable, I don't use Raku in my day-to-day and don't know the language awfully well
Really we shouldn't have any problems decoding and re-encoding the FHIR definitions in like a second, but it takes ages.