Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What if we could change programming languages?
Search
Kolja Dummann
February 02, 2014
Programming
0
2.4k
What if we could change programming languages?
Slides form my talk about haw we used language extensions to build mbeddr at FOSDEM2014
Kolja Dummann
February 02, 2014
Tweet
Share
More Decks by Kolja Dummann
See All by Kolja Dummann
Fsharp
coolya
0
890
Android insights
coolya
0
120
IoT with extensible C - Democamp
coolya
0
95
Internet of thing with extensible C
coolya
0
130
mbeddr & MPS overview
coolya
0
130
mbeddr on aruino
coolya
0
280
Other Decks in Programming
See All in Programming
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
140
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
6
1.7k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.4k
イベント駆動で成長して委員会
happymana
1
350
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
350
romajip: 日本の住所CSVデータを活用した英語住所変換ライブラリを作った話
sangunkang
0
1.2k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
380
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
C++でシェーダを書く
fadis
6
4.2k
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1.2k
Click-free releases & the making of a CLI app
oheyadam
2
120
Featured
See All Featured
Writing Fast Ruby
sferik
627
61k
How GitHub (no longer) Works
holman
310
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
The Pragmatic Product Professional
lauravandoore
31
6.3k
How STYLIGHT went responsive
nonsquared
95
5.2k
A Tale of Four Properties
chriscoyier
156
23k
Building an army of robots
kneath
302
43k
Unsuck your backbone
ammeep
668
57k
What's in a price? How to price your products and services
michaelherold
243
12k
Docker and Python
trallard
40
3.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Code Reviewing Like a Champion
maltzj
520
39k
Transcript
What if we could change programming languages?
Kolja Dummann itemis AG ! @dumdidum http://logv.ws
Rocket Science? Image: mentalwanderings / CC-by-sa
Rocket Science! Image: mentalwanderings / CC-by-sa
Build your own rocket software Image: Wikipedia Commons
Image: Wikipedia Commons
Image: Wikipedia Commons sensor
Image: Wikipedia Commons sensor self destruction
Image: Wikipedia Commons sensor self destruction autopilot
Image: Wikipedia Commons sensor self destruction autopilot sensors
Image: Wikipedia Commons sensor self destruction autopilot pumps sensors
Image: Wikipedia Commons sensor self destruction vanes autopilot pumps sensors
Image: Wikipedia Commons Physical Units int16 distance = …; int16
time = …; int16 speed = time / distance; sensor self destruction vanes autopilot pumps sensor
Image: Wikipedia Commons Physical Units int16 distance = …; int16
time = …; int16 speed = time / distance; sensor self destruction vanes autopilot pumps sensor
Image: Wikipedia Commons Physical Units int16/m/ distance = …; int16/s/
time = …; int16/mps/ speed = distance / time; sensor self destruction vanes autopilot pumps sensor
Image: Wikipedia Commons sensor self destruction vanes autopilot pumps sensor
Statemachines statemachine selfdestruction initial = starting { in event update(int8 speed, int8 hight) <no binding> state starting { on update [speed > 10 && hight > 0] -> flying } state flying { do { record_flightdata(); } on update [speed > 100 && hight < 42] -> kill } state kill { entry { blow_rocket(); } } }
Image: Wikipedia Commons Components cs interface FlightRecorder { Trackpoint* process(Trackpoint*
p) pre(0) p != null pre(1) p->id != 0 pre(2) p->time != 0 s post(3) result->id != 0 } sensor self destruction vanes autopilot pumps sensor
Image: Wikipedia Commons Components II component AutoPilot extends nothing {
requires FlightRecorder flightRecorder provides CourseProvider cp int16 cp_getCourse() <= op cp.getCourse { return 0; } } sensor self destruction vanes autopilot pumps sensor
Image: Wikipedia Commons Undefined Behavior sensor self destruction vanes autopilot
pumps sensor
Image: Wikipedia Commons Undefined Behavior i *= 2 + 2
+ i--; sensor self destruction vanes autopilot pumps sensor You write:
Image: Wikipedia Commons Undefined Behavior i *= 2 + 2
+ i--; sensor self destruction vanes autopilot pumps sensor (i *= 2 + 2 + i)——; You write: GCC reads:
Image: Wikipedia Commons Testing testcase main { assert-equals(0) 10 ==
add(5, 5); assert-less(1) 20 < add(5, 10); assert(2) 30 == add(20, 10); } sensor self destruction vanes autopilot pumps sensor
Image: Wikipedia Commons Verification sensor self destruction vanes autopilot pumps
sensor
How?
Projectional Editor
int i = 42 + 23;
int i = 42 + 23;
LocalVarDecl Name = i int i = 42 + 23;
LocalVarDecl Name = i IntType Type int i = 42
+ 23;
LocalVarDecl Name = i IntType Type Plus Init int i
= 42 + 23;
LocalVarDecl Name = i IntType Type Plus Init NumberLiteral Name
= 42 Left int i = 42 + 23;
LocalVarDecl Name = i IntType Type Plus Init NumberLiteral Name
= 42 Left NumberLiteral Value = 23 Right int i = 42 + 23;
Abstract Syntax Tree Concrete Syntax
Abstract Syntax Tree Concrete Syntax
Abstract Syntax Tree Concrete Syntax
Abstract Syntax Tree Concrete Syntax
Abstract Syntax Tree Concrete Syntax
Abstract Syntax Tree Concrete Syntax
Abstract Syntax Tree Concrete Syntax
Abstract Syntax Tree Concrete Syntax
http://mbeddr.com
A Open Source Collection of integrated languages for embedded software
engineering
None
Core Plain C
Core Plain C Ext Components Statemachines Units
Core Plain C Ext Components Statemachines Units CC Requirements Documentation
Core Plain C Ext Components Statemachines Units CC Requirements Documentation
Debugger
Core Plain C Ext Components Statemachines Units CC Requirements Documentation
Analyses Debugger
Code Generator Text (C) Compiler
Build on JetBrains MPS Open Source Language Workbench Apache 2.0
http://jetbrains.com/mps
Questions?