There was talk of an LLVM backend a while back, but I believe LLVM was
deemed too low-level to be useful.  That was, in fact, why I signed the
contributor agreement.  So, I'd love to see some movement on a C back-end.

Gambit Scheme has a special form that emits C (or C++) code.  It's very
useful.  I can't remember which Lisp it was, but there was definitely a
lisp which had an emit-C as it's *only* special form.  It might have been
one of the embedded schemes.

Last time I looked, I also saw ClojureC:  It looked useful, but hasn't been
touched in 3 years.
https://github.com/schani/clojurec

And here's a clojure-to-scheme compiler that used Gambit to target native:
https://github.com/takeoutweight/clojure-scheme
(In fact, this might be what I was thinking about with the special form
above.)

IMHO, native is useful for embedded systems and command-line programs
(where JVM start-up time can make a comand simply unusable).


On Mon, Apr 25, 2016 at 3:47 PM, JvJ <kfjwhee...@gmail.com> wrote:

>
>
> I've been wondering lately about getting Clojure to compile to native
> code, and so I've been doing some looking around.
>
> There are a few projects that are on the right track, such as TinyClojure
> <https://github.com/WillDetlor/TinyClojure> and Ferret
> <http://nakkaya.com/2011/06/29/ferret-an-experimental-clojure-compiler/>,
> but they are incomplete and don't seem to be under active development any
> more.
>
> I'm wondering about the requirements, how much work it would take, and
> whether or not it would be worth it.  My current thinking is of a
> Clojure->C/C++ compiler.
>
> So far, I have a few topics for discussion that I'm unclear about that
> might be necessary for this kind of project:
>
>    - Can the Immutable Persistent Data Structures be implemented with a
>    reference-counting scheme rather than a garbage collector?  This may
>    improve performance.
>    - In a similar vein, can the allocation strategy be controlled for
>    these structures in such a way as to optimize cache locality?
>    - Can we take advantage of tail-call optimization in existing C++
>    compilers?
>    - It wouldn't have to depend on an existing runtime environment like
>    JVM or JavaScript.
>       - Could this reduce reliance on reflection and increase performance?
>       - Could a new, clojure-optimized runtime be created that improves
>       performance?
>    - Could certain anonymous functions be optimized or inlined in a way
>    that improves performance over JVM/JS implementations?
>    - Is there a way to compile C++ code at runtime?  This would be
>    essential for the REPL and for Macros.
>
>
> Let me know if anyone has any thoughts on the matter.
>
> Thanks
>
> --
> 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
> ---
> 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 clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to