While I'm not as familiar with the CLR and its bytecode syntax, from what I
can tell from the README, mage and insn seem to have similar goals and
ideas.
I'll attempt to summarize the differences that I could find, if the mage
author *nasser* is available I would appreciate his or her input.
Mage provides fns for yielding the Clojure data that it consumes. At one
point in development I also did this. Something like the following.
(insn/visit :members [(insn/field [:public] "foo" :int)
(insn/method :init [:int :void]
[[:iload 1]
#_...])])
I ultimately decided against this approach. I felt that using raw Clojure
data provided more clarity, which is of course subjective. You can easily
implement these and more application-specific versions yourself if you
desire. I use the library for a couple of unreleased projects and I have
fns named emit-box, emit-proxy-method, etc.
Mage will automatically flatten nested bytecode sequences. This is not
necessary in my opinion since you can just use unquote-splicing within an
op sequence.
Mage has the concept of named local variables. I don't know if this is a
CLR concept, I assume this is a convenience feature to avoid having to
refer to method locals by number. If so, I could easily implement this as
it seems to be the same concept as Insn's autogenerated labels.
Finally, mage seems to require always writing out an assembly .dll to disk
on each emit. Not a big deal, but Insn allows more control in this regard
as your generated classes may exist entirely in memory.
Anyway, I hope this helped. Again I am only passingly familiar with mage
and I have not read the source code. I would also be nice if the mage
author would provide some tests. :)
On Friday, August 18, 2017 at 10:44:54 PM UTC-7, Colin Fleming wrote:
>
> This looks very interesting. How would you compare this to Mage for the
> CLR? Are they essentially equivalent?
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.