Transformers are way cooler than generators

4 views
Skip to first unread message

Bill Cox

unread,
Apr 25, 2023, 10:18:03 PM4/25/23
to Rune language discussion
Per discussion with Aiden and Andrew, we changed the name of Rune's generators to transformers.  I like the new name a lot.  It more accurately describes what they can do.

A transformer is Rune code, such as you can find in builtin/doublylinked.rn.  In the bootstrap compiler, they will be compiled and will have access to the full High Leven IR (HIR).  Transformers have the ability to transform Rune code in any way they like.  Typically, they prepend or append code to classes to implement relation methods and enhance auto-generated destructors.  However, they could instead rename every function in your program Mary<n> where n is an integer to make the identifiers unique.

An example of what transformers can do is auto-generating functions to serialize/deserialize your data structures efficiently to binary files.  They are way cooler than code generators :)

Bill

Andrew Wilson

unread,
Apr 26, 2023, 11:02:57 AM4/26/23
to Bill Cox, Rune language discussion
So we have an equivalent of X-macros. Nice.


--
You received this message because you are subscribed to the Google Groups "Rune language discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rune-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rune-discuss/CAH9QtQFsdUfjmeOvwh%2B6hUR6JEsJHU4g4%2Bny2GSPcCrFdafsYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Andrew Wilson
Software Engineer, Android TV Eng Prod
Reply all
Reply to author
Forward
0 new messages