> My only other observation is that Clojure is untyped and AFAIK
> compiles directly to the JVM. So it should be possible to compile
> KLambda to JVM I would think.
Sorry if I wasn't clear. As I mentioned "I can use java.lang.Object
for all parameters and always return java.lang.Object". That's what
clojure is doing. That's what clojure does for clojure code (even
unrelated to kl/shen) since it is not statically typed.
My concern was that I had an assumption that this would lead to slower
code. However, after my previous post, I ran a benchmark and
discovered for a naive little method, the performance was the same
(within noise) for calling a method with String vs. Object. My
understanding is this is because the JIT these days is very
intelligent and it probably compiled a specialized case that ignored
the casting and such. That's one reason microbenchmarks can be
difficult to interpret :)
That's fine for now, but we are going to run into situations where the
performance difference is going to be very real, especially when
primitives get involved and large numeric processing and such things.
So for those things... maybe that's where we'll have to put in some
extensions in shen to deal with it.
But at this point, I'll proceed with untyped.
> KL is indeed untyped because the Shen source generates largely s-exprs
> which comprise heterogeneous list and vectors of all kinds. This type
> is so general that there is little provision for it in typed
> programming languages because it is too loose to be useful..
That said, working with Haskell has me thinking about typing
everything being interesting. I don't think there's any reason that
you can't type things like that--it might be a rather complex type,
though. I interpret your statement as, perhaps you could type it, but
would there be any benefit to that effort?
What's the point of typing macros? Since we generally run meta-compile
(macro expansion) at the same time as compile (same user action),
we're going to get the type errors at exactly the same time regardless
of whether the macros are typed.