Rich Hickey wrote:

[Hope you'll forgive me making this an excuse for a competitive
comparison ...]

> [Clojure] shares the Java type system. For instance Clojure strings are Java
> strings (that can't be true of any standard Lisp where strings are
> mutable).

Kawa has both constant strings (java.lang.String) and
mutable strings (gnu.lists.FString).  Both implement
java.lang.CharSequence.  If you specify that a variable
is a <string> (Kawa has optional type declarations),
it uses the type java.lang.CharSequence.

This gives us the best of both worlds: Java *and* Scheme
interoperability.

>  Clojure collections implement java.util.Collection.

Kawa lists, vectors, mutable strings, etc all implement java.util.List.

> Clojure uses Java's calling conventions and call stack.

Kawa by default does the same.  Kawa has an option to use a calling
convention that supports full tailcalls (and has some other advantages).
Of course a procedure compiled with one calling convention can
automatically an procedure compiled with the other calling convention,
or an unknown procedure compiled with an unknown calling convention.

> Clojure compiles to JVM bytecode and has excellent performance. It
> supports optional type hints and simple inference that allow it to
> avoid reflection. Clojure supports standard Java debug information.

Kawa has done all of this for a decade ...

> Clojure's math library works directly with Java's boxed Number types,
> including BigInteger and BigDecimal, adding only a Ratio type of its
> own.

Kawa does use its own bignum implementation gnu.math.IntNum - partly
because it precedes java.lang.BigInteger!  I continue using IntNum
partly because it is more efficient that BigInteger - it especially
wins when most integers are "small" as is almost always the case.
Another reason for gnu.math.* is that actually implements the
Scheme numeric tower - but extended to support quantities.
For example, Kawa has length (3cm) and time (2.5s) literals,
which are useful for GUIs etc.

Of course Kawa can also convert to and from the standard
subclasses of java.lang.Number and (mostly) supports "mixed-mode"
arithmetic between the standard number and java.math classes
and the gnu.math.* classes (which extend java.lang.Number).

> Clojure has a clean and intuitive Java call interface:
> 
> user=> (def s "foobar")
> #'user/s
> 
> user=> (s.replace "o" "e")
> "feebar"

$ kawa
#|kawa:1|# (define s "foobar")
#|kawa:2|# (s:replace "o" "e")
feebar

> The net result is much more of an integrated feel than one language
> bridging to another.
> 
> You can find out more at:
> 
> http://clojure.org

http://www.gnu.org/software/kawa/
-- 
        --Per Bothner
[EMAIL PROTECTED]   http://per.bothner.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to