I've been reading up on Fan a bit (http://www.fandev.org/). Looks
very interesting, has some features the Java world is sorely missing
and few talk about:
1) scripting - you can write Fan scripts in stead of the java way
which is to write everything twice - as a batch file and a unix shell
script. Or write heinous XML files (Ant/Maven)
2) interactive shell - all the dynamic languages have this (groovy,
ruby, python). Hugely useful. Most java-ists don't "get" it because
they are stuck in "compile, deploy, test" land and haven't ever seen
this technique. It's a huge time saver in my experience using Ruby's
IRB and Groovysh.
3) dynamic methods via the -> operator. Fan doesn't give up static
typing, but it still has the power of dynamic methods via the ->
operator. This makes things like Active Record (http://
en.wikipedia.org/wiki/Active_record_pattern) and XML Builder (http://
groovy.codehaus.org/GroovyMarkup) possible.
Seems like the best of both worlds to me
4) simple literal array/list and hash syntax, much like Groovy/Ruby
a = [0, 1, 2] // List literal
[1:"one", 2:"two"] // Map literal
5) sane string handling (no escape char BS, multi-line strings, String
interpolation ("x is $x, in hex $x.toHex, and x+8 is ${x+8}") much
like Groovy
6) no primitives
7) Mixins
And the stuff that people talk about all the time:
8) ability to make a class immutable
9) Closures (what language doesn't have closures these days? oh,
wait)
10) runs on JVM (of course)
11) properties
12) easy APIs (e.g. no streams for File, very powerful closure based
collections like Groovy/Ruby), nice calendar API
13) message based concurrency
14) operator overloading
What doesn't it have that it should have?
* Reg ex literals (so you can write a switch /regexp/
* ||= null check operator if (a||= 5) if a == null then a = 5)
* multiple return values from a method (or tuples)
* default values in method signatures
* execute command line commands ( I don't think they have it)
* unless / if suffix syntax like ruby
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" 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/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---