ebb icon indicating copy to clipboard operation
ebb copied to clipboard

Disassembly Reflection Feature

Open gilbo opened this issue 9 years ago • 2 comments

pipe this through from Terra, including working out something for GPUs etc.

gilbo avatar Jun 07 '15 17:06 gilbo

I'm quite interested in having this feature and will happily look at implementing it myself if you'd be able to point me to where to start :)

Goobley avatar Oct 07 '16 11:10 Goobley

Sure.

I may need to revise any changes cause the API is a little unstable at that point, but it should be do-able. Here is a high level sketch:

Relevant files: functions.t and ufversions.t (uf = user function) these are both in include/ebb/src which is where most of the compiler lives.

Conceptually you have 3 levels of hierarchy, which are specialized down:

  1. function object (this is what is bound to the function name at the user level. You would add a "disassemble" member function at this level.)
  2. type version table (for each argument specialization of a function, you get one of these. Your disassemble function will need to supply arguments as if it were a for each call to get to this layer)
  3. ufversion (each of these is a further possible specialization of the type version table)

All of this is built using some Lua conventions around object prototypes, and making use of higher order memoization functions. If any of that seems confusing, just let me know.

This should all work out fine for CPU code, but doing the obvious thing for GPU will likely just dump a meaningless launcher program. So that will take a bit more thought about how to cache and display the use of multiple Terra functions to implement an ebb function.

On Oct 7, 2016, at 4:37 AM, Goobley [email protected] wrote:

I'm quite interested in having this feature and will happily look at implementing it myself if you'd be able to point me to where to start :)

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

gilbo avatar Oct 07 '16 17:10 gilbo