Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int,...
Transcript of Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int,...
![Page 2: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/2.jpg)
A single language to rule them all
An ecosystem of languages
![Page 3: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/3.jpg)
An ecosystem of languagesThe Pendulum Swings
![Page 4: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/4.jpg)
An ecosystem of languagesThe need for Concurreny
![Page 5: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/5.jpg)
An ecosystem of languagesThe need for Productivity
![Page 6: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/6.jpg)
An ecosystem of languagesSeparation Platform - Language
![Page 7: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/7.jpg)
An ecosystem of languagesBuilding Languages is easier.
![Page 8: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/8.jpg)
Interesting GPLFeatures
![Page 9: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/9.jpg)
Type InferenceLet thecompiler figureout types.
![Page 10: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/10.jpg)
Map<String, MyType> m = new HashMap<String, MyType>();
Classic Java
![Page 11: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/11.jpg)
Map<String, MyType> m = new HashMap<String, MyType>();
var m = new HashMap[String, MyType]();Scala
Classic Java
![Page 12: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/12.jpg)
Map<String, MyType> m = new HashMap<String, MyType>();
var m = new HashMap[String, MyType]();
Address[] addresses = …
var res = from a in addressesselect new { name = a.name(),
tel = a.telNo()};
foreach (var r in res) {Console.WriteLine("Name: {0}, Num: {1}",
r.name, r.tel);}
Classic Java
Scala
C# + LINQ
![Page 13: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/13.jpg)
FunctionsFocus on verbsinstead ofnouns (objects)
![Page 14: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/14.jpg)
[1,2,3,4,5,6].each { |element| puts (element * 2) }
Ruby
x: Int => x + 1Scala
def apply(f: Int => Int, v: Int) => f(v)Scala
![Page 15: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/15.jpg)
Pattern MatchingEasilydeconstructdata structures
![Page 16: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/16.jpg)
> type Expr = | Op of string * Expr * Expr| Var of string | Const of int;;
> let rec eval x = match x with| Op(op, l, r) ->
let (lv, rv) = (eval l, eval r) if (op = "+") then lv + rvelif (op = "-") then lv - rvelse failwith "Unknonw operator!"
| Var(var) -> getFromSymbolTable var| Const(n) -> n;;
F#
![Page 17: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/17.jpg)
Transactional MemoryDeclarativeShared MemoryConcurrency
![Page 18: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/18.jpg)
Similar to GC:> Rely on clever compiler and RT system> Solution might not always be optimal> … but good enough in 99% of cases> and much less (error prone) work.
atomic do// the stuff here is executed as if// there was only this thread
end
Fortress
![Page 19: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/19.jpg)
Declarative++Avoid saying thingsyou don‘t want to say
![Page 20: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/20.jpg)
for ( int i=0; i < data.length; i++ ) {// do a computation with data[i]
}
Java < 5
foreach ( DataStructure ds in data ) {// do something with ds
}
Java >= 5
![Page 21: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/21.jpg)
for ( int i=0; i < data.length; i++ ) {// do a computation with data[i]
}
Java < 5
foreach ( DataStructure ds in data ) {// do something with ds
}
Java >= 5
for I <- 1:m, j <- 1:n doa[i,j] := b[i] c[j]
end
for i <- seq(1:m) dofor j <- seq(1:n) doprint a[i,j]
endend
Fortress
Fortress
![Page 22: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/22.jpg)
Message PassingShared Memory is BAD (Joe Armstrong)
![Page 23: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/23.jpg)
pid = spawn(fun() -> doSomething() end)Pid ! Message
Erlang
![Page 24: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/24.jpg)
pid = spawn(fun() -> doSomething() end)Pid ! Message
Erlang
loop receive{add, Id, Name, FirstName} ->
ActionsToAddInformation;{remove,Id} -> ActionsToRemoveItAgain;...after Time -> TimeOutActions
end
Erlang
![Page 25: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/25.jpg)
Domain SpecificLanguages
![Page 26: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/26.jpg)
DefinitionWhat is a DSL?
![Page 27: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/27.jpg)
effective++
specialized, limited
used by expertstogether with other
specialized tools
tailor made
![Page 28: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/28.jpg)
execute?
![Page 29: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/29.jpg)
map
![Page 30: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/30.jpg)
DSL Program
GPL Program
(aka Model)
map
automated!
![Page 31: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/31.jpg)
Example DSLsStuff that I haveworked in in the past.
![Page 32: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/32.jpg)
tests
refines
![Page 33: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/33.jpg)
![Page 34: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/34.jpg)
![Page 35: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/35.jpg)
DSLs and GPLsHow can DSLs effectively worktogether with GPLs?
![Page 36: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/36.jpg)
DSLs and GPLs
C
LEGO Robot Control
General Purpose
Domain Specific
![Page 37: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/37.jpg)
DSLs and GPLs
C
LEGO Robot Control
Components
State Machines
Sensor Access
General Purpose
Domain Specific
![Page 38: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/38.jpg)
LWESLanguage Workbenches
for
http://mbeddr.com
Embedded Systems
Incremental Extension of C with DSLsfor Embedded Systems, integratedwith Formal Methods and supportfor PLE and Requirements Tracing.
![Page 39: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/39.jpg)
mbeddr.com
![Page 40: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/40.jpg)
![Page 41: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/41.jpg)
![Page 42: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/42.jpg)
![Page 43: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/43.jpg)
![Page 44: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/44.jpg)
![Page 45: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/45.jpg)
Core Extensible C implementation will beOpen Sourced in November 2011!
http://mbeddr.com
![Page 46: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/46.jpg)
ToolsWhich tools canyou use to buildyour own DSLs?
![Page 47: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/47.jpg)
![Page 48: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/48.jpg)
Current Version 2.0:improved performanceXbase: expressions for reuseXtend2: „Better Java“, with support
for Xpand-like templates
Eclipse-based, Eclipse ProjectVery flexible, very popular!
Open Source (EPL)
![Page 49: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/49.jpg)
Open Source (Apache 2.0)Projectional EditorVery good at lang. CompositionCurrent Version 2.0:
Improved performanceUnified generate/compile/buildDebug MPS in MPSTables in the editor(Diagrams planned for 2.1)
![Page 50: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/50.jpg)
Commercial Tool.Projectional EditorVery flexible notationsVersion 1.8 is current
![Page 51: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/51.jpg)
Way More:SpoofaxRascaloomegaThe Whole Platform
see alsohttp://languageworkbenches.net
![Page 52: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/52.jpg)
(Commercial Break)
![Page 53: Trends in Programming Languages · Building Languages is easier. ... Scala def apply(f: Int => Int, v: Int) => f(v) Scala. Pattern Matching Easily deconstruct data structures > type](https://reader033.fdocuments.in/reader033/viewer/2022050315/5f77ce0f383b644612556744/html5/thumbnails/53.jpg)
web email skypetwitter
xinglinkedin
http://www.xing.com/profile/Markus_Voelterhttp://www.linkedin.com/pub/0/377/a31
.coordinates
THE END.