Re: [q-lang-users] q in Q
Brought to you by:
agraef
From: John C. <co...@cc...> - 2006-06-16 20:23:29
|
Albert Graef scripsit: > Yes, we already discussed this here a while ago... Translating Q's > bytecode would be the most straightforward approach. JIT compilation > looks nice, but I'm also considering compilation to C or maybe Ksi (the > latter approach would be tied to gcc, however). This is still a while > away, though (I first want to resolve all the remaining portability > issues and finish the Q companion book). Sure. There's a neat trick for fairly portable JIT compilation: you wrap a block of code using labels, and then use memcpy to copy everything from one label to the next into a buffer area. Do that for each bytecode and you've built up your compiled code in the buffer. That way you have no dependency on assembly language. See http://lemick.sourceforge.net/papers/JIT_design.pdf for a brief paper. -- Possession is said to be nine points of the law, John Cowan but that's not saying how many points the law might have. co...@cc... --Thomas A. Cowan (law professor and my father) |