Virgil: a statically-typed language balancing functional and OO features
lambda-the-ultimate.org
lambda-the-ultimate.org
Scala
val x:Int = 10 // Immutable
var x:Int = 10 // Mutable
def x:Int = 10 // function
Virgil def x:Int = 10 // Immutable + function
var x:Int = 10 // Mutable
I think I prefer Virgils method, it feels much purer to me, in keeping with functions as first class members, but I'm not sure how it would handle mutable datastructures.This difference is stark when you look at what it's doing, but allows for some interesting uses when combined with lazy vals. We use it pretty extensively in our configuration loader (using twitter-eval) that allows us to do per-value overrides of configuration files by using lazy vals assigned to defs and then using the defs in the application (of all the performance bottlenecks we have, the possibly optimized out function call generated for the defs is negligible). The end result is that you can derive values from configuration settings prior to the configuration finishing being loaded. This means we don't have to care what order the configuration files are loaded in (they're separated by what they're configuring, with many shared between applications).
I'm shocked that people still don't understand what language design is. It's mostly not about inventing new features, but putting them together in new and interesting ways. Hence the "design."
The next programming language to become popular is going to provide some substantial gain in either productivity or performance. It'd be nice to see an argument for or against Virgil on that front.