Que linguagens de programação vamos usar daqui a 15 anos? Como será o futuro da programação? Nesta palestra, faço uma reflexão sobre a evolução da programação, avaliando as tendências atuais. Minha ideia é que o futuro já está presente hoje. Das 25 linguagens mais populares hoje em dia, apenas 1 não existia em 2001. A maior chance é que as linguagens do futuro já existam hoje. Sendo assim, quais são essas linguagens? Que características elas tem em comum? Em quais devemos investir?
11. Type
Memory safety
Concurrency
Generics
Exception handling
Memory model
Compilation model
system static, nominal, linear, algebraic, locally inferred
no null or dangling pointers, no buffer overflows
lightweight tasks with message passing, no shared memory
type parameterization with type classes
unrecoverable unwinding with task isolation
optional task-local GC, safe pointer types with region analysis
ahead-of-time, C/C++ compatible
12. Owning Pointers (~)
fn f() {
let x: ~int = ~1024; // allocate space and initialize an int
// on the heap
println(fmt!("%d", *x));
} // <-- the memory that x pointed at is automatically freed here
let x = ~5;
let z = x; // no new memory allocated, x can no longer be used
13. fn foo() {
let x: @int = @1024; // allocate space and initialize an int
// on the heap
bar(x); // pass it to `bar`
println(fmt!("%d", *x)); // print it on the screen
} // <-- the memory can be freed here
fn bar(x: @int) {
let y: @int = x; // make a new smart pointer to `x`
} // <-- despite `y` going out of scope,the memory is *not* freed here
Managed Pointers (@)
14. fn dogshow() {
let dogs: [~Dog * 3] = [
~Dog { name: ~"Spot" },
~Dog { name: ~"Fido" },
~Dog { name: ~”Snoopy" },
];
let winner: &Dog = dogs[1];// note use of `&` to form a reference
for dogs.each |dog| {
println(fmt!("Say hello to %s", dog.name));
}
println(fmt!("And the winner is: %s!", winner.name));
} // <-- all dogs destroyed here
Borrowed Pointers (&)
15. Freezing
let mut x = 5;
{
let y = &x; // x is now frozen, it cannot be modified
}
// x is now unfrozen again
28. Vs
"Though my tip though for the long term
replacement of javac is Scala. I'm very impressed
with it! I can honestly say if someone had shown me
the Programming in Scala book by by Martin
Odersky, Lex Spoon & Bill Venners back in 2003 I'd
probably have never created Groovy.”
(James Strachan)