You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
David Pearce edited this page May 11, 2017
·
6 revisions
This is a general discussion page about adding meta-programming support to Whiley. For example, C++ provides support for meta-programming via templates, whilst Rust provides support via macros. Whiley has a proposal now for extending the language with templates (see https://github.com/Whiley/WhileyCompiler/issues/540). Some pointers:
In real world programming scenarios one often ends up writing scripts that turn data-files into code. Often one also have to update multiple locations with the same data, manually.
It would be very useful to have a feature where the programmer could specify a "lazy" transform from XML/JSON/tab-separated-file to Whiley.
The goal is to make the data available in Whiley-code through some query mechanism, a transform into constants or some other "injection" method.
I have found some situations where this is useful. For example, in creating a Z80 emulator it's useful to include the boot ROM as a compile-time constant from a file.