On Wed, 13 Feb 2013, chrisichris wrote:
> Thanks for the fix works great now.
> And of course I am happy to test it. Especially if the fixes come so fast
> and yeti improves.
>
> Regarding binary comapitbility: It is obviously necessary in an evolving
> language (and I welcome all your changes). However I have seen binary
> incompatibility in scala and this was realy annoying, when there are already
> apis in use. Wouldn't it be better to switch to a "run from source model"
> like scripting languages ie clojure?
The new binary class interface should be stable. The problem was with
optimization of module-structure fields access. Now there is simple static
method generated for each field, if the module type is structure, and it
shouldn't break unless field is removed, or the field type changed
fundamentally. In these cases source compatibility would probably be also
broken. You can list those methods for example with the javap tool to see
how it's done:
$ javap -classpath yeti.jar -public yeti.xml
Compiled from "xml.yeti"
public class yeti.xml extends java.lang.Object{
public static synchronized java.lang.Object eval();
public static yeti.lang.Fun xmlParse();
public static yeti.lang.Fun xmlElement();
public static yeti.lang.Fun xmlByPath();
public static yeti.lang.Fun xmlWrite();
public static void init();
}
Only non-obvious thing here is when you have field named 'eval' - these
are given $ as suffix. How the module internally optimises the field
access is hidden from the JVM level public interface (currently most of
them return public static _ field belonging to the class implementing the
corresponding function).
> I mean that (potential) yeti apis are not compiled to jars, but rather
> the source .yeti files are jared up and yeti compiles them on the fly.
> Source seems to be more compatible and if not at least I as a user can
> fix it myself, get better errormsgs etc. And only optionally compile it
> to java-classes in the filesystem. I know I have asked this question
> before, but I have seen this binary incompatibility in scala and I realy
> did not like it.
Dynamic compilation comes with some performance penalty on loading and
memory use, and is not possible everywhere. This doesn't mean that loading
that kind of source jars shouldn't be possible in future, but having
binary compatibility as much as possible is also useful. The issue with
maven plugin highlighted the problem with previous implementation for me,
and I wanted to fix it before 1.0, so it had to be broken in 0.9.7+.