I have seen code_native and code_typed and code_llvm.
These seem to only provide an unstructured text. Though the text itself appears structured and could be parsed to create a structure, this is tedious.
Should the internals not have this information available in a structured manner?
code_lowered gives structured information, but not at assembly level.
May I please present what I am actually trying to achieve, and perhaps someone can point to an idea:
I would like to translate julia code into another computer language, one that is very basic and operates on a stack, with registers, like an assembly machine.
I am hoping that I can write a translation from the julia assembly code to this language and that this would be easiest way to get correct translations.
I assume by unstructured you mean that it’s presented as text. This is simply because there’s nothing julia specific about them so there is nothing in julia to represent them. They are simply being handled by other library.
There are of course binary representation for both but not necessary structured representation. For LLVM code, there are ways to get pointer to the LLVM functions/modules (I believe you can just look at the implementation of code_llvm). For assembly code, there’s no builtin structured and just binary code.
Tools for working with Julia’s untyped SSA IR already exist. You might want to check out IRTools.jl or Cassette.jl. Their documentation should help get you started.