SlideShare a Scribd company logo
1 
Reactive Programming with Algebra 
André van Delft 
Anatoliy Kmetyuk 
Amsterdam.Scala meetup 2 December 2014 
Java/Scala Lab, Odessa 6 December 2014 
Scala Exchange, London 9 December 2014
Overview 
• Introduction 
– Programming is Still Hard 
– Some History 
– Algebra of Communicating Processes 
• SubScript 
– Example application 
– Debugger demo 
• Dataflow 
– Twitter Client 
– SubScript Actors 
• Conclusion 
2
Programming is Still Hard 
3 
Mainstream programming languages: imperative 
• good in batch processing 
• not good in parsing, concurrency, event handling 
• Callback Hell 
Neglected idioms 
• Non-imperative choice: BNF, YACC 
• Data flow: Unix pipes 
Math!
Algebra can be easy and fun 
4 
Area Objects Operations Rules 
Numbers 0, 1, ..., x, y, ... + ・ - / x+y = y+x 
Logic F, T, x, y, ... ∨ ∧ ¬x∨y = y∨x 
Processes 0, 1, a, b,..., x, y, ... + ・ & | && || / x+y = y+x
Some History 
5 
1955 Stephen Kleene ~~> regular expressions, * 
Noam Chomsky ~~> language grammars 
1960 John Backus & Peter Naur ~~> BNF 
Tony Brooker ~~> Compiler Compiler 
1971 Hans Bekič ~~> Algebra of Processes 
1973 Stephen Johnson ~~> YACC 
1974 Nico Habermann & Roy Campbell ~~> Path Expressions 
1978 Tony Hoare ~~> Communicating Sequential Processes (CSP) 
1980 Robin Milner ~~> Calculus of Communicating Systems (CCS) 
1982 Jan Bergstra & Jan Willem Klop ~~> Algebra of Communicating Processes (ACP) 
1989 Robin Milner ~~> Pi-Calculus 
Henk Goeman ~~> Self-applicative Processes
Algebra of Communicating Processes - 1 
6 
Bergstra & Klop, Amsterdam, 1982 - ... 
ACP ~ Boolean Algebra 
+ choice 
· sequence 
0 deadlock 
1 empty process 
atomic actions a,b,… 
parallelism 
communication 
disruption, interruption 
time, space, probabilities 
money 
...
Algebra of Communicating Processes - 2 
7 
Less known than CSP, CCS 
Specification & Verification 
• Communication Protocols 
• Production Plants 
• Railways 
• Coins and Coffee Machines 
• Money and Economy 
Strengths 
• Familiar syntax 
• Precise semantics 
• Reasoning by term rewriting 
• Events as actions
Algebra of Communicating Processes - 3 
8 
x+y = y+x 
(x+y)+z = x+(y+z) 
x+x = x 
(x+y)·z = x·z+y·z 
(x·y)·z = x·(y·z) 
0+x = x 
0·x = 0 
1·x = x 
x·1 = x 
34 
(x+1)·y = x·y + 1·y 
= x·y + y
9 
Algebra of Communicating Processes - 4 
x║y = x╙y + y╙x + x|y 
(x+y)╙z = ... 
a·x╙y = ... 
1╙x = ... 
0╙x = ... 
(x+y)|z = ... 
... = ...
ACP Language Extensions 
• 1980: Jan van den Bos - Input Tool Model [Pascal, Modula-2] 
• 1988-2011: AvD - Scriptic [Pascal, Modula-2, C, C++, Java] 
• 1994: Jan Bergstra & Paul Klint - Toolbus 
• 2011-...: AvD - SubScript [Scala, JavaScript (?)] 
Application Areas: 
• GUI Controllers 
• Text Parsers 
• Discrete Event Simulation 
• Reactive, Actors, Dataflow 
10
GUI application - 1 
• Input Field 
• Search Button 
• Searching for… 
• Results 
11
GUI application - 2 
val searchButton = new Button("Go”) { 
reactions.+= { 
case ButtonClicked(b) => 
enabled = false 
outputTA.text = "Starting search...” 
new Thread(new Runnable { 
def run() { 
Thread.sleep(3000) 
SwingUtilities.invokeLater(new Runnable{ 
def run() {outputTA.text="Search ready” 
enabled = true 
}}) 
}}).start 
} 
} 
12
GUI application - 3 
live = clicked(searchButton) 
searchButton 
@gui: {outputTA.text="Starting search.."} 
{* Thread.sleep(3000) *} 
@gui: {outputTA.text="Search ready"} 
... 
• Sequence operator: white space and 
; 
• gui: 
code executor for 
• SwingUtilities.InvokeLater+InvokeAndWait 
• {* ... *}: 
by executor for 
new Thread 
13
GUI application - 4 
live = searchSequence... 
searchSequence = searchCommand 
showSearchingText 
searchInDatabase 
showSearchResults 
searchCommand = searchButton 
showSearchingText = @gui: {outputTA.text = "…"} 
showSearchResults = @gui: {outputTA.text = "…"} 
searchInDatabase = {* Thread.sleep(3000) *} 
14
GUI application - 5 
• Search: button or Enter key 
• Cancel: button or Escape key 
• Exit: button or ; ; “Are you sure?”… 
• Search only allowed when input field not empty 
• Progress indication 
15
GUI application - 6 
|| exit 
live = searchSequence... 
searchCommand = searchButton + Key.Enter 
cancelCommand = cancelButton + Key.Escape 
exitCommand = exitButton + windowClosing 
exit = exitCommand @gui: while(!areYouSure) 
cancelSearch = cancelCommand @gui: showCanceledText 
searchSequence = searchGuard searchCommand; 
showSearchingText 
searchInDatabase 
showSearchResults / cancelSearch 
searchGuard = if(!searchTF.text.isEmpty) . anyEvent(searchTF) ... 
searchInDatabase = {*Thread.sleep(3000)*} || progressMonitor 
progressMonitor = {*Thread.sleep( 250)*} 
@gui:{searchTF.text+=here.pass} ... 
16
SubScript Features 
"Scripts" – process refinements as class members 
script a = b; {c} 
• Much like methods: override, implicit, named args, varargs, ... 
• Invoked from Scala: _execute(a, aScriptExecutor) 
Default executor: _execute(a) 
• Body: process expression 
Operators: + ; & | && || / ... 
Operands: script call, code fragment, if, while, ... 
• Output parameters: ?, ... 
• Shared scripts: 
script send,receive = {} 17
Implementation - 1 
• Branch of Scalac: 1300 lines (scanner + parser + typer) 
18 
script Main = ({Hello} + ε); {World} 
import subscript.DSL._ 
def Main = _script('Main) { 
_seq(_alt(_normal{here=>Hello}, _empty), 
_normal{here=>World} ) 
} 
• Virtual Machine: 2000 lines 
– static script trees 
– dynamic Call Graph 
• Swing event handling scripts: 260 lines 
• Graphical Debugger: 550 lines (10 in SubScript)
Debugger - 1 
19
Debugger - 2 
live = stepping || exit 
stepping = {* awaitMessageBeingHandled(true) *} 
if shouldStep then ( 
@gui: {! updateDisplay !} 
stepCommand || if autoCheckBox.selected then sleepStepTimeout 
) 
{ messageBeingHandled(false) } 
... 
exit = exitCommand 
var isSure = false 
@gui: { isSure = confirmExit } 
while (!isSure) 
exitCommand = exitButton + windowClosing 
20 
built using SubScript
One-time Dataflow - 1 
exit = exitCommand 
var isSure = false 
@gui: { isSure = confirmExit } 
while (!isSure) 
exit = exitCommand @gui:confirmExit ~~> while(!_) 
21 
• Script result type script confirmExit:Boolean = ... 
• Result values $success 
confirmExit^ 
confirmExit^$1 
• Script Lambda’s b:Boolean => [while(!b)] while(!_) 
• x~~>y definition do_flowTo([x^],[y^]) 
do_flowTo[T,U](s:script[T],t:T=>script[U]): U = s^$1 then t($1)^
Example: Twitter Search Client - 1 
22
23 
trait Controller { 
val view: View 
def start(): Unit 
val twitter = Twitter() 
val tweetsCount = 10 
val keyTypeDelay = 500 // to prevent exceeding Twitter API calls limit 
def clearView = view.main(Array()) 
def searchTweets = twitter.search(view.searchField.text, tweetsCount) 
def updateTweetsView(ts:Seq[Tweet]) = view.setTweets(ts) 
} 
class SubScriptController(val view: View) extends Controller { 
def start() = _execute(_live()) 
script.. 
live = clearView; mainSequence/.. 
mainSequence = anyEvent(view.searchField) 
{* Thread sleep keyTypeDelay *} 
{*searchTweets*} ~~> @gui:updateTweetsView 
} 
Example: Twitter Search Client - 2
Example: Twitter Search Client - 3 
24 
trait Controller { 
val view: View 
... 
} 
live = clearView; mainSequence/.. 
mainSequence = anyEvent(view.searchField) 
class PureController(val view: View) extends Controller with Reactor { 
def start() = {initialize; bindInputCallback} 
def bindInputCallback = { 
listenTo(view.searchField.keys) 
val fWait = InterruptableFuture {Thread sleep keyTypeDelay} 
val fSearch = InterruptableFuture {searchTweets} 
reactions += {case _ => fWait .execute() 
.flatMap {case _ => fSearch.execute()} 
.onSuccess{case tweets => Swing.onEDT{view.setTweets(tweets)}} 
} } } 
{* Thread sleep keyTypeDelay *} 
{* searchTweets *} ~~> @gui:updateTweetsView 
Work in progress: 
live = clearView; mainSequence... 
searchTweets = {* script.$success = 
twitter.search(view.searchField.text,tweetsCount) *} 
mainSequence = anyEvent(view.searchField) 
// {* Thread sleep keyTypeDelay *} 
searchTweets 
~~> ts:Any ==> 
@gui:updateTweetsView(ts.asInstanceOf[Seq[Tweet]]))
25 
SubScript Actors: Ping Pong 
class Ping(another: ActorRef) extends Actor { 
override def receive: PartialFunction[Any,Unit] = {case _ =>} 
another ! "Hello" 
another ! "Hello" 
another ! "Terminal" 
} 
class Pong extends SubScriptActor { 
script .. 
class Pong extends SubScriptActor { 
implicit script str2rec(s:String) = << s >> 
script .. 
live = <<"Hello">> ... || <<"Terminal">> ; {println("Over")} 
} 
live = "Hello" ... || "Terminal" ; {println("Over")} 
}
SubScript Actors: DataStore - 1 
InformationRequest 
DetailsRequest 
data 
details 
InformationRequest 
(data, details) 
26 
Proxy Store 
class DataStore extends Actor { 
def receive = { 
case InformationRequest(name) => sender ! getData (name) 
case DetailsRequest (data) => sender ! getDetails(data) 
} 
}
27 
SubScript Actors: DataStore - 2 
class DataProxy(dataStore: ActorRef) extends Actor { 
def waitingForRequest = { 
case req: InformationRequest => 
dataStore ! req 
context become waitingForData(sender) 
} 
def waitingForData(requester: ActorRef) = { 
case data: Data => 
dataStore ! DetailsRequest(data) 
context become waitingForDetails(requester, data) 
} 
def waitingForDetails(requester: ActorRef, data: Data) = { 
case details: Details => 
requester ! (data, details) 
context become waitingForRequest 
} 
}
28 
SubScript Actors: DataStore - 3 
class DataProxy(dataStore: ActorRef) extends SubScriptActor { 
script live = 
<< req: InformationRequest 
=> dataStore ! req 
==> var response: (Data, Details) = null 
<< data: Data 
=> dataStore ! DetailsRequest(data) 
==> << details: Details 
==> response = (data, details) >> 
>> 
{sender ! response} 
>> 
... 
}
29 
SubScript Actors: DataStore - 4 
implicit script future2script[F:Future[F]](f:F) 
class DataProxy(dataStore: ActorRef) extends SubScriptActor { 
script live = 
<< req: InformationRequest ==> {dataStore ? req} 
~~data:Data~~> {dataStore ? DetailsRequest(data)} 
~~details:Details~~> { sender ! (data, details)} 
>> 
... 
} 
script live = 
<< req: InformationRequest 
==> {dataStore ? req} 
~~> v:Any ==> ( val data = v.asInstanceOf[Data] 
{dataStore ? DetailsRequest(data)} 
~~> w:Any ==> ( val details = w.asInstanceOf[Details] 
{ sender ! (data, details)} 
)) 
>> 
...
30 
SubScript Actors: Shorthand Notations 
<< case a1: T1 => b1 ==> s1 
case a2: T2 => b2 ==> s2 
... 
case an: Tn => bn ==> sn >> 
<< case a1: T1 => b1 
case a2: T2 => b2 
... 
case an: Tn => bn >> 
<< case a1: T1 
case a2: T2 
... 
case an: Tn >> 
<< case a: T => b ==> s >> 
<< a: T => b ==> s >> 
<< a: T => b >> 
<< a: T >> 
<< 10 >>
31 
SubScript Actors: Implementation - 1 
trait SubScriptActor extends Actor { 
private val callHandlers = ListBuffer[PartialFunction[Any, Unit]]() 
def _live(): ScriptNode[Any] 
private def script terminate = Terminator.block 
private def script die = {if (context ne null) context stop self} 
override def aroundPreStart() { 
runner.launch( [ live || terminate ; die ] ) 
super.aroundPreStart() 
} 
override def aroundReceive(receive: Actor.Receive, msg: Any) { 
... 
callHandlers.collectFirst { 
case handler if handler isDefinedAt msg => handler(msg) } match { 
case None => super.aroundReceive( receive , msg) 
case Some(_) => super.aroundReceive({case _: Any =>}, msg) 
} } 
... 
}
32 
SubScript Actors: Implementation - 2 
<< case a1: T1 => b1 ==> s1 
case a2: T2 => b2 ==> 
... 
case an: Tn => bn ==> sn >> 
r$(case a1: T1 => b1; [s1] 
case a2: T2 => b2; null 
... 
case an: Tn => bn; [sn]) 
trait SubScriptActor extends Actor { 
... 
script r$(handler: PartialFunction[Any, ScriptNode[Any]]) = 
var s:ScriptNode[Any]=null 
@{val handlerWithAA = handler andThen {hr => {s = hr; there.eventHappened}} 
synchronized {callHandlers += handlerWithAA} 
there.onDeactivate {synchronized {callHandlers -= handlerWithAA}} 
}: 
{. .} 
if s != null then s 
}
Conclusion 
• Easy and efficient programming 
• Support in Scalac branch 
• Simple implementation: 5000 lines, 50% 
• Still much to do and to discover 
• Open Source: 
subscript-lang.org 
github.com/AndreVanDelft/scala 
• Help is welcome 
Participate! 
33

More Related Content

What's hot

Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
intelliyole
 
The Ring programming language version 1.3 book - Part 84 of 88
The Ring programming language version 1.3 book - Part 84 of 88The Ring programming language version 1.3 book - Part 84 of 88
The Ring programming language version 1.3 book - Part 84 of 88
Mahmoud Samir Fayed
 
响应式编程及框架
响应式编程及框架响应式编程及框架
响应式编程及框架
jeffz
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)jeffz
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Development
vito jeng
 
RxJS Evolved
RxJS EvolvedRxJS Evolved
RxJS Evolved
trxcllnt
 
Thinking Functionally with JavaScript
Thinking Functionally with JavaScriptThinking Functionally with JavaScript
Thinking Functionally with JavaScript
Luis Atencio
 
미려한 UI/UX를 위한 여정
미려한 UI/UX를 위한 여정미려한 UI/UX를 위한 여정
미려한 UI/UX를 위한 여정
SeungChul Kang
 
ES6 in Real Life
ES6 in Real LifeES6 in Real Life
ES6 in Real Life
Domenic Denicola
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programmingjeffz
 
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
Sumant Tambe
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
NAVER / MusicPlatform
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to Come
Cory Forsyth
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015
Leonardo Borges
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Data
greenwop
 
Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016
Etiene Dalcol
 
Collection v3
Collection v3Collection v3
Collection v3
Sunil OS
 
Scala introduction
Scala introductionScala introduction
Scala introduction
vito jeng
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
Susan Potter
 

What's hot (20)

Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
 
The Ring programming language version 1.3 book - Part 84 of 88
The Ring programming language version 1.3 book - Part 84 of 88The Ring programming language version 1.3 book - Part 84 of 88
The Ring programming language version 1.3 book - Part 84 of 88
 
响应式编程及框架
响应式编程及框架响应式编程及框架
响应式编程及框架
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Development
 
RxJS Evolved
RxJS EvolvedRxJS Evolved
RxJS Evolved
 
Thinking Functionally with JavaScript
Thinking Functionally with JavaScriptThinking Functionally with JavaScript
Thinking Functionally with JavaScript
 
미려한 UI/UX를 위한 여정
미려한 UI/UX를 위한 여정미려한 UI/UX를 위한 여정
미려한 UI/UX를 위한 여정
 
ES6 in Real Life
ES6 in Real LifeES6 in Real Life
ES6 in Real Life
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programming
 
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
 
Clojure intro
Clojure introClojure intro
Clojure intro
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to Come
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Data
 
Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016
 
Collection v3
Collection v3Collection v3
Collection v3
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
 

Viewers also liked

КОРПОРАТИВНЫЕ УСЛУГИ
КОРПОРАТИВНЫЕ УСЛУГИКОРПОРАТИВНЫЕ УСЛУГИ
КОРПОРАТИВНЫЕ УСЛУГИGeeksLab Odessa
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
GeeksLab Odessa
 
PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)
PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)
PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)
GeeksLab Odessa
 
Мастер-класс"От идеи к продукту"_Евгений Плохой
Мастер-класс"От идеи к продукту"_Евгений ПлохойМастер-класс"От идеи к продукту"_Евгений Плохой
Мастер-класс"От идеи к продукту"_Евгений Плохой
GeeksLab Odessa
 
Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...
Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...
Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...
GeeksLab Odessa
 
WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...
WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...
WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...
GeeksLab Odessa
 
JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"
JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"
JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"
GeeksLab Odessa
 
JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"
JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"
JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"
GeeksLab Odessa
 
Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...
Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...
Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...
GeeksLab Odessa
 
AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".
AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".
AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".
GeeksLab Odessa
 
Андриан Буданцов_Секретные способы идентификации пользователей iOS
Андриан Буданцов_Секретные способы идентификации пользователей iOSАндриан Буданцов_Секретные способы идентификации пользователей iOS
Андриан Буданцов_Секретные способы идентификации пользователей iOS
GeeksLab Odessa
 
PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"
PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"
PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"
GeeksLab Odessa
 
JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"
JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"
JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"
GeeksLab Odessa
 
JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...
JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...
JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...
GeeksLab Odessa
 
AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...
AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...
AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...
GeeksLab Odessa
 
Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...
Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...
Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...
GeeksLab Odessa
 
JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...
JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...
JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...
GeeksLab Odessa
 

Viewers also liked (17)

КОРПОРАТИВНЫЕ УСЛУГИ
КОРПОРАТИВНЫЕ УСЛУГИКОРПОРАТИВНЫЕ УСЛУГИ
КОРПОРАТИВНЫЕ УСЛУГИ
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)
PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)
PMLab. Тимофей Евграшин. Культура в ИТ (Version 2.0)
 
Мастер-класс"От идеи к продукту"_Евгений Плохой
Мастер-класс"От идеи к продукту"_Евгений ПлохойМастер-класс"От идеи к продукту"_Евгений Плохой
Мастер-класс"От идеи к продукту"_Евгений Плохой
 
Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...
Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...
Евгений Плохой (CEO Capable Bits) - Математика "крутого" продукта. StartupLab...
 
WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...
WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...
WebCamp2014:Internet Marketing Day: Изменение вектора бизнеса из оффлайн сегм...
 
JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"
JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"
JSLab. Максим Климишин. "Трансдюсеры, CSP каналы, неизменяемые структуры данных"
 
JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"
JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"
JSLab. Грибанов Александр. "Yeoman - избавляемся от рутинных задач"
 
Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...
Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...
Кирилл Соляр (исполнительный директор SpOnge, Креативное бюро) - Как привлечь...
 
AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".
AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".
AI&BigData Lab. Дмитрий Новицкий "Big Data и биоинформатика".
 
Андриан Буданцов_Секретные способы идентификации пользователей iOS
Андриан Буданцов_Секретные способы идентификации пользователей iOSАндриан Буданцов_Секретные способы идентификации пользователей iOS
Андриан Буданцов_Секретные способы идентификации пользователей iOS
 
PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"
PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"
PMLab. Михаил Пергаменщик. "Особенности договоров на agile-разработку ПО"
 
JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"
JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"
JSLab. Роман Якобчук. "Flux в стиле FRP: связываем React и Bacon"
 
JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...
JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...
JSLab. Дмитрий Смолин, Дмитрий Филипенко. "React и Webpack с помощью кирки, л...
 
AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...
AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...
AI&BigData Lab. Быковский Александр "Ассоциативные правила для генерации реко...
 
Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...
Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...
Java/Scala Lab 2016. Дмитрий Соколов: Принципы работы с транзакциями при помо...
 
JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...
JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...
JS Lab`16. Денис Кузин: "ShareJS - режим синхронной работы. История одного вн...
 

Similar to Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного программирования

Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
Alex Payne
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35
Bilal Ahmed
 
Go Concurrency Patterns
Go Concurrency PatternsGo Concurrency Patterns
Go Concurrency Patterns
ElifTech
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
PROIDEA
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio module
Saúl Ibarra Corretgé
 
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiMonitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
InfluxData
 
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Flink Forward
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212
Mahmoud Samir Fayed
 
History of asynchronous in .NET
History of asynchronous in .NETHistory of asynchronous in .NET
History of asynchronous in .NET
Marcin Tyborowski
 
Angular2 for Beginners
Angular2 for BeginnersAngular2 for Beginners
Angular2 for Beginners
Oswald Campesato
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
PyData
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
Albert Bifet
 
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Brendan Eich
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Sages
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
Yusuke Kita
 
Monads in Swift
Monads in SwiftMonads in Swift
Monads in Swift
Vincent Pradeilles
 
C++ process new
C++ process newC++ process new
C++ process new
敬倫 林
 
Apache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapApache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmap
Kostas Tzoumas
 
Return of c++
Return of c++Return of c++
Return of c++
Yongwei Wu
 

Similar to Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного программирования (20)

Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35
 
Go Concurrency Patterns
Go Concurrency PatternsGo Concurrency Patterns
Go Concurrency Patterns
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio module
 
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiMonitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
Monitoring Your ISP Using InfluxDB Cloud and Raspberry Pi
 
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212The Ring programming language version 1.10 book - Part 39 of 212
The Ring programming language version 1.10 book - Part 39 of 212
 
History of asynchronous in .NET
History of asynchronous in .NETHistory of asynchronous in .NET
History of asynchronous in .NET
 
Angular2 for Beginners
Angular2 for BeginnersAngular2 for Beginners
Angular2 for Beginners
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
 
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
 
Monads in Swift
Monads in SwiftMonads in Swift
Monads in Swift
 
C++ process new
C++ process newC++ process new
C++ process new
 
Apache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapApache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmap
 
Return of c++
Return of c++Return of c++
Return of c++
 

More from GeeksLab Odessa

DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
GeeksLab Odessa
 
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
GeeksLab Odessa
 
DataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторDataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский Виктор
GeeksLab Odessa
 
DataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеDataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображение
GeeksLab Odessa
 
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
GeeksLab Odessa
 
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
GeeksLab Odessa
 
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
GeeksLab Odessa
 
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
GeeksLab Odessa
 
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
GeeksLab Odessa
 
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
GeeksLab Odessa
 
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
GeeksLab Odessa
 
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
GeeksLab Odessa
 
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
GeeksLab Odessa
 
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
GeeksLab Odessa
 
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
GeeksLab Odessa
 
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
GeeksLab Odessa
 

More from GeeksLab Odessa (20)

DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
 
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
 
DataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторDataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский Виктор
 
DataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеDataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображение
 
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
 
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
 
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
 
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
 
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
 
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
 
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
 
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
 
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
 
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
 
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
 
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
 

Recently uploaded

GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного программирования

  • 1. 1 Reactive Programming with Algebra André van Delft Anatoliy Kmetyuk Amsterdam.Scala meetup 2 December 2014 Java/Scala Lab, Odessa 6 December 2014 Scala Exchange, London 9 December 2014
  • 2. Overview • Introduction – Programming is Still Hard – Some History – Algebra of Communicating Processes • SubScript – Example application – Debugger demo • Dataflow – Twitter Client – SubScript Actors • Conclusion 2
  • 3. Programming is Still Hard 3 Mainstream programming languages: imperative • good in batch processing • not good in parsing, concurrency, event handling • Callback Hell Neglected idioms • Non-imperative choice: BNF, YACC • Data flow: Unix pipes Math!
  • 4. Algebra can be easy and fun 4 Area Objects Operations Rules Numbers 0, 1, ..., x, y, ... + ・ - / x+y = y+x Logic F, T, x, y, ... ∨ ∧ ¬x∨y = y∨x Processes 0, 1, a, b,..., x, y, ... + ・ & | && || / x+y = y+x
  • 5. Some History 5 1955 Stephen Kleene ~~> regular expressions, * Noam Chomsky ~~> language grammars 1960 John Backus & Peter Naur ~~> BNF Tony Brooker ~~> Compiler Compiler 1971 Hans Bekič ~~> Algebra of Processes 1973 Stephen Johnson ~~> YACC 1974 Nico Habermann & Roy Campbell ~~> Path Expressions 1978 Tony Hoare ~~> Communicating Sequential Processes (CSP) 1980 Robin Milner ~~> Calculus of Communicating Systems (CCS) 1982 Jan Bergstra & Jan Willem Klop ~~> Algebra of Communicating Processes (ACP) 1989 Robin Milner ~~> Pi-Calculus Henk Goeman ~~> Self-applicative Processes
  • 6. Algebra of Communicating Processes - 1 6 Bergstra & Klop, Amsterdam, 1982 - ... ACP ~ Boolean Algebra + choice · sequence 0 deadlock 1 empty process atomic actions a,b,… parallelism communication disruption, interruption time, space, probabilities money ...
  • 7. Algebra of Communicating Processes - 2 7 Less known than CSP, CCS Specification & Verification • Communication Protocols • Production Plants • Railways • Coins and Coffee Machines • Money and Economy Strengths • Familiar syntax • Precise semantics • Reasoning by term rewriting • Events as actions
  • 8. Algebra of Communicating Processes - 3 8 x+y = y+x (x+y)+z = x+(y+z) x+x = x (x+y)·z = x·z+y·z (x·y)·z = x·(y·z) 0+x = x 0·x = 0 1·x = x x·1 = x 34 (x+1)·y = x·y + 1·y = x·y + y
  • 9. 9 Algebra of Communicating Processes - 4 x║y = x╙y + y╙x + x|y (x+y)╙z = ... a·x╙y = ... 1╙x = ... 0╙x = ... (x+y)|z = ... ... = ...
  • 10. ACP Language Extensions • 1980: Jan van den Bos - Input Tool Model [Pascal, Modula-2] • 1988-2011: AvD - Scriptic [Pascal, Modula-2, C, C++, Java] • 1994: Jan Bergstra & Paul Klint - Toolbus • 2011-...: AvD - SubScript [Scala, JavaScript (?)] Application Areas: • GUI Controllers • Text Parsers • Discrete Event Simulation • Reactive, Actors, Dataflow 10
  • 11. GUI application - 1 • Input Field • Search Button • Searching for… • Results 11
  • 12. GUI application - 2 val searchButton = new Button("Go”) { reactions.+= { case ButtonClicked(b) => enabled = false outputTA.text = "Starting search...” new Thread(new Runnable { def run() { Thread.sleep(3000) SwingUtilities.invokeLater(new Runnable{ def run() {outputTA.text="Search ready” enabled = true }}) }}).start } } 12
  • 13. GUI application - 3 live = clicked(searchButton) searchButton @gui: {outputTA.text="Starting search.."} {* Thread.sleep(3000) *} @gui: {outputTA.text="Search ready"} ... • Sequence operator: white space and ; • gui: code executor for • SwingUtilities.InvokeLater+InvokeAndWait • {* ... *}: by executor for new Thread 13
  • 14. GUI application - 4 live = searchSequence... searchSequence = searchCommand showSearchingText searchInDatabase showSearchResults searchCommand = searchButton showSearchingText = @gui: {outputTA.text = "…"} showSearchResults = @gui: {outputTA.text = "…"} searchInDatabase = {* Thread.sleep(3000) *} 14
  • 15. GUI application - 5 • Search: button or Enter key • Cancel: button or Escape key • Exit: button or ; ; “Are you sure?”… • Search only allowed when input field not empty • Progress indication 15
  • 16. GUI application - 6 || exit live = searchSequence... searchCommand = searchButton + Key.Enter cancelCommand = cancelButton + Key.Escape exitCommand = exitButton + windowClosing exit = exitCommand @gui: while(!areYouSure) cancelSearch = cancelCommand @gui: showCanceledText searchSequence = searchGuard searchCommand; showSearchingText searchInDatabase showSearchResults / cancelSearch searchGuard = if(!searchTF.text.isEmpty) . anyEvent(searchTF) ... searchInDatabase = {*Thread.sleep(3000)*} || progressMonitor progressMonitor = {*Thread.sleep( 250)*} @gui:{searchTF.text+=here.pass} ... 16
  • 17. SubScript Features "Scripts" – process refinements as class members script a = b; {c} • Much like methods: override, implicit, named args, varargs, ... • Invoked from Scala: _execute(a, aScriptExecutor) Default executor: _execute(a) • Body: process expression Operators: + ; & | && || / ... Operands: script call, code fragment, if, while, ... • Output parameters: ?, ... • Shared scripts: script send,receive = {} 17
  • 18. Implementation - 1 • Branch of Scalac: 1300 lines (scanner + parser + typer) 18 script Main = ({Hello} + ε); {World} import subscript.DSL._ def Main = _script('Main) { _seq(_alt(_normal{here=>Hello}, _empty), _normal{here=>World} ) } • Virtual Machine: 2000 lines – static script trees – dynamic Call Graph • Swing event handling scripts: 260 lines • Graphical Debugger: 550 lines (10 in SubScript)
  • 20. Debugger - 2 live = stepping || exit stepping = {* awaitMessageBeingHandled(true) *} if shouldStep then ( @gui: {! updateDisplay !} stepCommand || if autoCheckBox.selected then sleepStepTimeout ) { messageBeingHandled(false) } ... exit = exitCommand var isSure = false @gui: { isSure = confirmExit } while (!isSure) exitCommand = exitButton + windowClosing 20 built using SubScript
  • 21. One-time Dataflow - 1 exit = exitCommand var isSure = false @gui: { isSure = confirmExit } while (!isSure) exit = exitCommand @gui:confirmExit ~~> while(!_) 21 • Script result type script confirmExit:Boolean = ... • Result values $success confirmExit^ confirmExit^$1 • Script Lambda’s b:Boolean => [while(!b)] while(!_) • x~~>y definition do_flowTo([x^],[y^]) do_flowTo[T,U](s:script[T],t:T=>script[U]): U = s^$1 then t($1)^
  • 22. Example: Twitter Search Client - 1 22
  • 23. 23 trait Controller { val view: View def start(): Unit val twitter = Twitter() val tweetsCount = 10 val keyTypeDelay = 500 // to prevent exceeding Twitter API calls limit def clearView = view.main(Array()) def searchTweets = twitter.search(view.searchField.text, tweetsCount) def updateTweetsView(ts:Seq[Tweet]) = view.setTweets(ts) } class SubScriptController(val view: View) extends Controller { def start() = _execute(_live()) script.. live = clearView; mainSequence/.. mainSequence = anyEvent(view.searchField) {* Thread sleep keyTypeDelay *} {*searchTweets*} ~~> @gui:updateTweetsView } Example: Twitter Search Client - 2
  • 24. Example: Twitter Search Client - 3 24 trait Controller { val view: View ... } live = clearView; mainSequence/.. mainSequence = anyEvent(view.searchField) class PureController(val view: View) extends Controller with Reactor { def start() = {initialize; bindInputCallback} def bindInputCallback = { listenTo(view.searchField.keys) val fWait = InterruptableFuture {Thread sleep keyTypeDelay} val fSearch = InterruptableFuture {searchTweets} reactions += {case _ => fWait .execute() .flatMap {case _ => fSearch.execute()} .onSuccess{case tweets => Swing.onEDT{view.setTweets(tweets)}} } } } {* Thread sleep keyTypeDelay *} {* searchTweets *} ~~> @gui:updateTweetsView Work in progress: live = clearView; mainSequence... searchTweets = {* script.$success = twitter.search(view.searchField.text,tweetsCount) *} mainSequence = anyEvent(view.searchField) // {* Thread sleep keyTypeDelay *} searchTweets ~~> ts:Any ==> @gui:updateTweetsView(ts.asInstanceOf[Seq[Tweet]]))
  • 25. 25 SubScript Actors: Ping Pong class Ping(another: ActorRef) extends Actor { override def receive: PartialFunction[Any,Unit] = {case _ =>} another ! "Hello" another ! "Hello" another ! "Terminal" } class Pong extends SubScriptActor { script .. class Pong extends SubScriptActor { implicit script str2rec(s:String) = << s >> script .. live = <<"Hello">> ... || <<"Terminal">> ; {println("Over")} } live = "Hello" ... || "Terminal" ; {println("Over")} }
  • 26. SubScript Actors: DataStore - 1 InformationRequest DetailsRequest data details InformationRequest (data, details) 26 Proxy Store class DataStore extends Actor { def receive = { case InformationRequest(name) => sender ! getData (name) case DetailsRequest (data) => sender ! getDetails(data) } }
  • 27. 27 SubScript Actors: DataStore - 2 class DataProxy(dataStore: ActorRef) extends Actor { def waitingForRequest = { case req: InformationRequest => dataStore ! req context become waitingForData(sender) } def waitingForData(requester: ActorRef) = { case data: Data => dataStore ! DetailsRequest(data) context become waitingForDetails(requester, data) } def waitingForDetails(requester: ActorRef, data: Data) = { case details: Details => requester ! (data, details) context become waitingForRequest } }
  • 28. 28 SubScript Actors: DataStore - 3 class DataProxy(dataStore: ActorRef) extends SubScriptActor { script live = << req: InformationRequest => dataStore ! req ==> var response: (Data, Details) = null << data: Data => dataStore ! DetailsRequest(data) ==> << details: Details ==> response = (data, details) >> >> {sender ! response} >> ... }
  • 29. 29 SubScript Actors: DataStore - 4 implicit script future2script[F:Future[F]](f:F) class DataProxy(dataStore: ActorRef) extends SubScriptActor { script live = << req: InformationRequest ==> {dataStore ? req} ~~data:Data~~> {dataStore ? DetailsRequest(data)} ~~details:Details~~> { sender ! (data, details)} >> ... } script live = << req: InformationRequest ==> {dataStore ? req} ~~> v:Any ==> ( val data = v.asInstanceOf[Data] {dataStore ? DetailsRequest(data)} ~~> w:Any ==> ( val details = w.asInstanceOf[Details] { sender ! (data, details)} )) >> ...
  • 30. 30 SubScript Actors: Shorthand Notations << case a1: T1 => b1 ==> s1 case a2: T2 => b2 ==> s2 ... case an: Tn => bn ==> sn >> << case a1: T1 => b1 case a2: T2 => b2 ... case an: Tn => bn >> << case a1: T1 case a2: T2 ... case an: Tn >> << case a: T => b ==> s >> << a: T => b ==> s >> << a: T => b >> << a: T >> << 10 >>
  • 31. 31 SubScript Actors: Implementation - 1 trait SubScriptActor extends Actor { private val callHandlers = ListBuffer[PartialFunction[Any, Unit]]() def _live(): ScriptNode[Any] private def script terminate = Terminator.block private def script die = {if (context ne null) context stop self} override def aroundPreStart() { runner.launch( [ live || terminate ; die ] ) super.aroundPreStart() } override def aroundReceive(receive: Actor.Receive, msg: Any) { ... callHandlers.collectFirst { case handler if handler isDefinedAt msg => handler(msg) } match { case None => super.aroundReceive( receive , msg) case Some(_) => super.aroundReceive({case _: Any =>}, msg) } } ... }
  • 32. 32 SubScript Actors: Implementation - 2 << case a1: T1 => b1 ==> s1 case a2: T2 => b2 ==> ... case an: Tn => bn ==> sn >> r$(case a1: T1 => b1; [s1] case a2: T2 => b2; null ... case an: Tn => bn; [sn]) trait SubScriptActor extends Actor { ... script r$(handler: PartialFunction[Any, ScriptNode[Any]]) = var s:ScriptNode[Any]=null @{val handlerWithAA = handler andThen {hr => {s = hr; there.eventHappened}} synchronized {callHandlers += handlerWithAA} there.onDeactivate {synchronized {callHandlers -= handlerWithAA}} }: {. .} if s != null then s }
  • 33. Conclusion • Easy and efficient programming • Support in Scalac branch • Simple implementation: 5000 lines, 50% • Still much to do and to discover • Open Source: subscript-lang.org github.com/AndreVanDelft/scala • Help is welcome Participate! 33