On Tue, May 15, 2012 at 11:25 AM, Timothy Baldridge <tbaldri...@gmail.com> wrote: >> Logically the interface between the analyzer and the emitter is data >> (maps, etc) which can be serialized as json or some platform specific >> representation. Then all you need to do is write an emitter on your >> platform of choice that can emit code for the data. >> >> So for Python: >> 1. run the analyzer on itself to get the data describing it >> 2. serialize that data in some format Python can read >> 3. write an emitter in Python >> 4. feed the analyzer data to the emitter >> 5. hook the emitted analyzer code up to the emitter >> >> so the whole thing pivots around the data emitted from the analyzer > > One question. Let's say that we are analyzing "(require 'foo.bar)". > How does the analyzer know if foo.bar exists? Are you suggesting that > we leave that to the emitter? > > I like this idea...I'm going to think about it a bit more... > > Timothy
It sort of depends in some sense "(require 'foo.bar)" is just calling the function require with a symbol as an argument. I can certainly imagine cases where the analyzer might want reflection on types etc of the given platform, but I think that is really an optimization, trading off compile/analyzer time reflection for runtime reflection. That platform reflective information would be provided by something like clojure.reflect, and could either run via querying a running instance of the platform, or via just a static data file of the information. But that info is, I think, mostly required to make generated code fast, but it should be possible to generate slower reflective code "generically" for the initial bootstrap without it. > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en