We finally got our website http://fandev.org/ up and running for Fan - a new JVM language. It isn't a dynamic language per se, but has some interesting design decisions:
We are targeting both the JVM and CLR, so we actually deploy code in an intermediate bytecode, which can be translated into Java bytecode or IL at load time. The two VMs are definitely very close, but a couple big differences: the CLR doesn't provide any stack manipulation opcodes like swap or dup_x1. The CLR has a more complicated and restricted set of rules for generating try/catch/ finally blocks. Fan is statically typed, but provides two "call" operators. If you use "." then the call is a normal method dispatch just like Java. But you can also use "->" to skip compiler type checking and do a dynamic dispatch. Dynamic dispatches are just syntax sugar for calling trap(Str name, Obj[] args) which by default uses reflection. But you can override that method to trap any call. We ditched primitives - our only real big trade-off in terms of performance. But oh it is so nice and clean. We ditched user defined generics. We do use a special generic syntax for a couple special cases List, Map, and Func. For example Str[] in Fan really means List<Str>. We use mixins instead of interfaces. Under the covers they get compiled to Java bytecode as an interface, bunch of static methods, and routing methods for implementing classes. Fields have built-in accessors methods which are auto-generated or you can define yourself. Constructors are named methods. Functions are built-in via the system class Func. You can use reflection to get any Method as a Func. Closures are built-in which are basically an expression which evaluates to a Func. We defined closures before the buzz about adding them to Java - we actually chose a syntax based on Ruby. You can define const classes which are guaranteed immutable by the compiler. There is no shared state between threads. You can define static fields, but they must be immutable. Threads have built-in message passing. Or you can share data between threads using a REST-like API to map Uris to Objs. The serialization format is designed to be human read/written. In fact it is a true subset of the language itself, so you can use serialized objects as an expression. The runtime maintains a "type database" which indexes annotations (Fan calls them facets). This lets you query installed types based on different kinds of meta-data. Hope some you find it interesting! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
