Dias do futuro presente da programação

Post on 12-Aug-2015

513 views 2 download

Transcript of Dias do futuro presente da programação

Dias do Futuro Presente da Programação

Luiz Borba http://borba.blog.br

Sobre as Linguagens

Das 25 linguagens mais populares hoje,apenas uma não existia em 2001

Linguagens dominantes no futuro serão OO & Funcionais

Java 8

C#

Swift

C

PHP

Python

Ruby

Javascript

Dart

Scala

Go

Clojure

Rust

Groovy

Erlang

Elixir

Coffeescript

C++

Objective-C

Haskell

F#

Julia

porque já são!

Vão ser muitas…

Agosto de 2001

Java, C, C++, HTML e BASIC - 79,1%

Fevereiro de 2015

As 25 primeiras: 79,02 %

Algumas vão ser substituidas…

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

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

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 (@)

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 (&)

Freezing

let mut x = 5;{ let y = &x; // x is now frozen, it cannot be modified}// x is now unfrozen again

Escalável e Distribuido “de fábrica"

A Confusão do Javascript

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)

Estático Dinâmico

def fib(n: int) -> None: a, b = 0, 1 while a < n: print(a) a, b = b, a+b

def connect(r -> Stream, c -> Client) -> Fiber

<?hhclass MyClass { const int MyConst = 0; private string $x = ''; public function increment(int $x): int { $y = $x + 1; return $y; }}

/* @flow */function foo(x: string, y: number): string { return x.length * y;}foo('Hello', 42);

mas há convergência…

É o legado do

• Gem & Bundle

• Rails Command Line

• RVM

• Migrations

• SASS, YAML

• Scaffold

• Active Record

NoSQL?

Novembro 2013

Fevereiro 2015

O Fim das Ditaduras Arquiteturais

Flux MVC

Arquitetura em Camadas

CQRS

Lambda

Kappa

MicroServices

Epílogo

• Estamos vivendo um momento acentuado de divergência

• Tecnologias estabelecidas no mainstream estão sendo desafiadas

MicroServices

Flux & React

Lambda

AngularJS

Spark

A Nova "Enterprise"

Dias do Futuro Presente da Programação

Luiz Borba http://borba.blog.br

Obrigado!