Re: Bootstrapping Clojure-in-Clojure

2012-05-20 Thread Chris Gray
Sorry to come in a bit late on this conversation; I've been moving recently. On Mon, May 14, 2012 at 5:35 AM, Timothy Baldridge wrote: > Platforms that do not have the ability to eval (gambit, JS, etc.) they > could simply stick with writing Java macros. For the rest of the > platforms (CLR, JVM,

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
>the point of the analysis step is to generate a richer (more verbose) >set of information about the code, there is a lot of information you >would like to have when compiling (for example, for some platforms it >would be nice to know at the start of a function what locals exist in >the that functi

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread David Nolen
On Tue, May 15, 2012 at 4:03 PM, Timothy Baldridge wrote: > > Why can't it port to Python? You have can have an instance with a method > > toString right? > > The python version of that code (at least in clojure-py) would be this: > > (defn as-str [x] (py/str x)) > That would be defined core.cljs

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 12:51 PM, Timothy Baldridge wrote: >>  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 p

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
> Why can't it port to Python? You have can have an instance with a method > toString right? The python version of that code (at least in clojure-py) would be this: (defn as-str [x] (py/str x)) So my point is that some platforms may define toString, other define str and still others (CLR) define

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread David Nolen
On Tue, May 15, 2012 at 3:51 PM, Timothy Baldridge wrote: > (defn as-str [x] (.toString x)) > > That can't port to Python, or really any other VM besides JS. So if > we're looking at translating the analyzer itself we have to develop > some sort of base set of libraries that every thing else can b

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
>  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

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 11:25 AM, Timothy Baldridge 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 t

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
> 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

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 8:05 AM, Timothy Baldridge wrote: > There seems to be a few steps involved in this from, what I'm seeing. > > From what I'm seeing of the source, there's two files I'll be dealing with > > closure.clj -- defines functions for looking up info about libraries, > functions, et

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Timothy Baldridge
There seems to be a few steps involved in this from, what I'm seeing. >From what I'm seeing of the source, there's two files I'll be dealing with closure.clj -- defines functions for looking up info about libraries, functions, etc. compiler.clj -- actually defines the compiler To start with, I'm

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread Kevin Downey
http://www.lambdassociates.org/blog/klambda.htm suggests a possible bootstrapping mechanism, some kind of reduced set of clojure functionality "ur-clojure" that is designed to be easy to write and interpreter for, and a compiler backend that generates ur-clojure, after compiling the compiler+platfo

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread David Nolen
On Mon, May 14, 2012 at 2:32 PM, Armando Blancas wrote: > Much of the more recent code in Clojure is very cross platform. Stuff >> like reducers can simply be copied over, fixed up a bit, and it runs. >> >> I wonder how is the fork/join part carrier over for reducers. > Sounds straightforward for

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread Armando Blancas
> > Much of the more recent code in Clojure is very cross platform. Stuff > like reducers can simply be copied over, fixed up a bit, and it runs. > > I wonder how is the fork/join part carrier over for reducers. -- You received this message because you are subscribed to the Google Groups "Cl

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread David Nolen
Sounds reasonable. Is there some specific direction you are suggesting? David On Mon, May 14, 2012 at 8:35 AM, Timothy Baldridge wrote: > Over the weekend there was some talk in IRC about why clojure-py > didn't use Clojurescript as the basis for its compiler. The reasons I > had, basically boil

Bootstrapping Clojure-in-Clojure

2012-05-14 Thread Timothy Baldridge
Over the weekend there was some talk in IRC about why clojure-py didn't use Clojurescript as the basis for its compiler. The reasons I had, basically boiled down to this: Clojurescript is written in Clojure-JVM and as such requires that the JVM be installed, and also requires that all macros be Clo