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
I was trying to read the implementation of the metalang99 but steam started going out of my ears.
The problem is 100% or receiving end - I lack understanding of C macros and also functional principles you've applied.
I really enjoyed your last blog post "Fueled Evaluation for Decidable Type Checking" for its clarity of thought.
It would be really great to have a similar article that explains metalang99 for smallbrain grug [1].
In particular these questions are interesting:
What knowledge of C preporcessor is required even to start understanding Metalang99?
How does it really work?
What is CPS and why was it a solution? Were there any alternatives to a chosen mechanism?
How does CPS solve macro recursion limitation?
How to read metalang99 internals? How to teach it to someone else?
Can I write some other useful abstraction with it? How to approach such a task?
The knowledge is only good if we can re-transmit and reproduce it. Metalang99 probably goes above the head of the average developer.
Thanks for your suggestion! I was thinking about a blog post a while ago, but never really began writing it. I was thinking that an "average developer" should not really know how Metalang99 works under the hood -- for the same reason as they shouldn't know the internals of Clang, GCC, or Boost libraries.
Metalang99 is designed in such a way that it hides its bowels as much as possible (i.e., I tried to avoid abstraction leaking), so I don't think that studying Metalang99's sources is necessary for its successful usage.
On the other hand, you might be interested in actually digging into the implementation. This can be for various reasons, including contributing to Metalang99 or just pure curiosity. In this case, I invite you to begin learning how the recursion engine works -- I left a number of comments covering particular implementation aspects. You'll also find a link to CPS here, which is used as an internal representation of some functional compilers.
Overall, I was relying on already established techniques of preprocessor metaprogramming. They were applied in Boost/Preprocessor, Boost/VMD, and similar libraries a long time ago.
That being said, I think that a blog post is not absolutely necessary, but I'm also not against it. Perhaps one day I will write it, although it's not on my priority list.
I like studying implementations of tools. Especially smaller and less popular ones.
Otherwise I feel like this is an ancient magic artifact made by powerful wizards of the bygone era - it works, but nobody knows how, and nobody knows how to make more of those :D
Hey @hirrolot,
I was trying to read the implementation of the metalang99 but steam started going out of my ears.
The problem is 100% or receiving end - I lack understanding of C macros and also functional principles you've applied.
I really enjoyed your last blog post "Fueled Evaluation for Decidable Type Checking" for its clarity of thought.
It would be really great to have a similar article that explains metalang99 for smallbrain grug [1].
In particular these questions are interesting:
The knowledge is only good if we can re-transmit and reproduce it. Metalang99 probably goes above the head of the average developer.
Thanks a lot!
[1] https://grugbrain.dev/
The text was updated successfully, but these errors were encountered: