SlideShare a Scribd company logo
1 of 20
Download to read offline
SCALA:
— GROW OR SHRINK ?
FACTORS OF HATE/LOVE RELATIONSHIPS
SCALA WAY VS WAYS OF TECHNICAL EVOLUTION
// Ruslan Shevchenko

<ruslan@shevchenko.kiev.ua>

@rssh1
Disclaimer: %noassoc
I’m not associated with any organization, which have
influence on the language design.

Try to avoid:

complain on things, which you can’t change

speaking about decisions of others. 

Instead:

Analyze technical/social/economics phenomenas
80 vs Now =>
C / Objective-C / C++ / Objective - C++
Pascal / Modula 2
Algol 60 / Algol 68 / …
Java {1, 1.1, 1.2 … 1.5, 6, 7, 8, 9 ….. }
Scala { 2.7, .. 2.13 -> 3, … }
Smalltalk 80
C++ { __, 0x, 17, 19, 21 … }
Evolution (where is beast ?)
language usage ~ type of bacteria

software project ~ organism

people, money ~ resources
horizontal gene transfer.

gene: feature/idiom/(incapsulated into libraries …)
//biology evolution— decisions are accident
//technical evolution— decisions generated by committee
this difference is not very big.
What needed to be evolutionary stable ?
Survie

Adopt

Be attractive
What needed to be evolutionary stable ?
Survie 

Adopt

Be attractive
Population > 1 %
∃ • EPFL Labs (Gov. financing) 

• Lightbend ( Commercial financing)

• Community Center (Org ?)

• Support industry: Hydra, SoftwareMill,
etc..
• Monetization of PL ? (common problem)

• Oracle try to monetize JVM
What needed to be evolutionary stable ?
Survie

Adopt

Be attractive
Static metaprogrammig.

• Unique, popular in PL academia world.

• Will be better in Dotty: Staging/Partial
Evaluation 

• Can emulate most of the other language
features without (with little) compiler
change:

• RUST Derive: Scalaz-deriving

• coroutines - storm-enrote

• go : scala-gopher, etc.
// technical part will follow
What needed to be evolutionary stable ?
Survie

Adopt

Be attractive
Static metaprogrammig.

• Unique, popular in PL academia world.

• Will be better in Dotty: Staging/Partial
Evaluation 

• Can emulate most of the other language
features without (with little) compiler
change:

• RUST Derive: Scalaz-deriving

• coroutines - storm-enrote

• go : scala-gopher, etc.
// technical part will follow
• Metaprogramming still hard and incomplete.

• Distance between academic concept/real industrial API 

• async/await

• storm/enroute

• monadless ….. 

• Now all stalled: wait new API in dotty/(squid in scala2)

• JVM (but exists scala-native & scala-js).
What needed to be evolutionary stable ?
Survie

Adopt

Be attractive
Hello! I'm A .signature Virus. 

Join In The Fun And Copy Me Into Yours!
//memes
Learning curve
What needed to be evolutionary stable ?
Survie

Adopt

Be attractive
//memes
Learning curve
({ type EF[X]=Either[S,X] })#EF
val x = 1
culture
Isolate subsets
Software development 

is not scalable !
Education too…….. 

Kaa’s law ….
Non-Issues:

- FP/OOP (this is solved problem)

Unsolved problems:

- Distributed computing.

- Mass-parallelism (GPU, TPU)

Issues:

- concurrency support

- small boilerplate instead no-boilerplate 

- big core //gene rubbish
Concurrency support.
Monad [Future, Task] (extra wrap)

Streams [Akka-Streams, Monix, fs2] (extra wrap)

2009. CPS [shift/reset]. Tiark Rompf, Ingo Maier Martin Odersky. Implementing First-Class Polymorphic Delimited
Continuations by a Type-Directed Selective CPS-Transform.: https://infoscience.epfl.ch/record/149136/files/icfp113-rompf.pdf

— deprecated, not prod. quality

2013. Async/Await. Philipp Haller and Jason Zaugg. SIP22-Async. https://docs.scala-lang.org/sips/async.html. 

— dormant, not prod. quality (try/catch support is missing) 

2017. Coroutines. Aleksandar Prokopec, Fengyun Liu. Theory and Practice of Coroutines with Snapshots. http://
aleksandar-prokopec.com/publications/theory-and-practice-of-coroutines-with-snapshots/

—- Yet not ready, not prod. quality. 

using inside hight-order functions…. - theoretically possible (implemented in gopher)
Concurrency/Learning Curve
for{ x <- retrieveA()
y <- retrieveB() }
yield x+y
async{ retrieveA()! + retrieveB()! }
vs
• Monads

• Combinators

• Nesting
// in Go, C#, Kotlin, C++ (Karl!), Python, JavaScript

something is implemented.
small boilerplate instead no-boilerplate
pathEndOrSingleSlash {
getAll
} ~ pathPrefix(Segment) { name =>
pathEndOrSingleSlash {
put {
saveValue(name)
} ~ get {
findValue(name)
} ~ delete {
deleteValue(name)
}
}
}
def getAll():List[String] = ..
@JsonBin
@Path(“entities”)
class Service
{
List<String> getAll()
@Post
void saveValue(@Path name)
String findValue(@Path name)
@Delete
// Java version is cleaner
//too easy implement all directly
big core
any AST transformation => check all possible
variants. 

Unroll syntax sugar themselves

Possible solutions:

IR layer, which will keep simplifier code (like in
Scala.JS)

Standard transform library.
// will be better in dotty
Conclusion
FP/OOP - non issue.

The unique value - static metaprogramming. 

Will allow lower barrier to language extending, but need to
be done at first.

Where other mainstream languages outperform Scala:

Concurrency support

Tooling (smaller core)
Technical part: squid
next generation of macro 

http://epfldata.github.io/squid/home.htm

Lionel Parreaux, Amir Shaikhha, and Christoph E. Koch. 2017. Squid: Type-Safe,
Hygienic, and Reusable Quasiquotes. In Proceedings of the 2017 8th ACM
SIGPLAN Symposium on Scala (SCALA 2017).

scala> def power(n: Int, x: ClosedCode[Double]):
ClosedCode[Double] = {
| if (n > 0) code"${power(n-1, x)} * $x"
| else code"1.0"
| }
scala> val pgrm = power(3, code”0.5")
scala> pgrm.compile
Technical part: dotty metaprogramming
https://dotty.epfl.ch/docs/reference/principled-meta-
programming.html

probably, next direction for squid

inline def power(inline n: Int, x: Double) =
~powerCode(n, '(x))
private def powerCode(n: Int, x: Expr[Double]): Expr[Double] =
if (n == 0) '(1.0)
else if (n == 1) x
else if (n % 2 == 0)
'{ { val y = ~x * ~x; ~powerCode(n / 2, '(y)) } }
else
‘{ ~x * ~powerCode(n - 1, x) }
Technical part: scalar-deriving
https://gitlab.com/fommil/scalaz-deriving

no dependency from scalar ;)

scalac plugin, to expand annotation into boilerplate

@deriving(Encoder, Decoder)
case class Bar(s: String)
case class Bar(s: String)
object Bar {
implicit val _deriving_encoder: Encoder[Bar] = deriving
implicit val _deriving_decoder: Decoder[Bar] = deriving
}
Thanks for attending
Ping me, if needed

ruslan@shevchenko.kiev.ua

@rssh1

https://github.com/rssh

//PWL-Kyiv tomorrow

PaxOS and CRDT

F[S]
oo _, ,
_((-’_/ |
/ "", _//__, __/
,’,O‘ | # ",/.---’ /,-’
,’ __/-. # " .//
|‘._(;_,--’  " ||
‘-. , # ", ||
_ ||  # " ||
/,-.‘ //  " //
// ‘.‘. || |  # # ",/
| ‘.‘._//  //  # ",
‘-.: ||  # ",
‘.___ // :   # # ",
,--’----. || : || // #",
// | | || // # # ",_
|:| |:| //  # # ‘--.__
/:/ |:|   # # # ‘--._
/ / | | || |# # # ‘-.
- /:/ /| | | || ; # # # # 
__ |:| _// |:| || : # # # # 
‘-.| | /,- |:| // : # # # # / # :
 :| // |:| //_ : # | # / # |
:|//  _/ /  : : |# # | # |
|: / /|  ::/ ‘  #  # | # | #| 
/ / _ // | : |  ## # | ,| # | ||
| | || / ::/ |  |# __,.’  # | ||
|:|  /:: / | #/ |# /-’’ ‘. #  #; ||
: :::/ | | | |  #  # / ||
| | / ::/ | | | #| | | | / ||
| | | : | |# | | | | | |# | ;;
|:| / ::/ | | | #| |# | | | .;;.
: |:::| | | | | | | | #| ;;;;
|:| /:: / | #| | | | #| | | ;;;;
|:| / : / _ _ | | |# | __ _( ) ( ) ;;;;
| || |/ // _ _ _( ) ( ) _ //| / | / _ _
| :|:: |/ ////_ _ _ / _ |  | _ |//| || |/// _ __
 :| :_|/ /// _  |///| | | |_ |/| || |//////_
_ | _ / |_//  |///| | | |  ||_| |_|_|/ // /
_ _ _ //:/ _ _ _ __/_/| | | | __ _  / |/ _
_   |||/_ / _  /// _ __| | | _ _  |||/ // _
 _|//_  |/_  //_|// _ ||/ ////_
jrei  __|//// _|//  | // / ///_ || /// /
(r)rssh _ |/////_ |/// _ ||// ///__  |// /
  ||/ ///   |// // //
 - ||/ //// ////  | //// || |/// - --
--  |/ -_ /// _ //| --- // --   |/ /// --
1

More Related Content

What's hot

10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About ScalaMeir Maor
 
A Scala Corrections Library
A Scala Corrections LibraryA Scala Corrections Library
A Scala Corrections LibraryPaul Phillips
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NYCrystal Language
 
How to herd cat statues and make awesome things
How to herd cat statues and make awesome thingsHow to herd cat statues and make awesome things
How to herd cat statues and make awesome thingsmeldra
 
Live coding scala 'the java of the future'
Live coding scala 'the java of the future'Live coding scala 'the java of the future'
Live coding scala 'the java of the future'Xebia Nederland BV
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheckBeScala
 
Metasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's APIMetasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's APIKiwamu Okabe
 
Java Intro
Java IntroJava Intro
Java Introbackdoor
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMatt Butcher
 
Introduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platformIntroduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platformEastBanc Tachnologies
 
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Ruslan Shevchenko
 
Introduction to Type Level Programming
Introduction to Type Level ProgrammingIntroduction to Type Level Programming
Introduction to Type Level ProgrammingYuval Itzchakov
 
Dependent types (and other ideas for guaranteeing correctness with types)
Dependent types (and other ideas for guaranteeing correctness with types)Dependent types (and other ideas for guaranteeing correctness with types)
Dependent types (and other ideas for guaranteeing correctness with types)radexp
 
Java 8 - A step closer to Parallelism
Java 8 - A step closer to ParallelismJava 8 - A step closer to Parallelism
Java 8 - A step closer to Parallelismjbugkorea
 
Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02Omer van Kloeten
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scalafanf42
 
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!scalaconfjp
 

What's hot (20)

10 Things I Hate About Scala
10 Things I Hate About Scala10 Things I Hate About Scala
10 Things I Hate About Scala
 
A Scala Corrections Library
A Scala Corrections LibraryA Scala Corrections Library
A Scala Corrections Library
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NY
 
How to herd cat statues and make awesome things
How to herd cat statues and make awesome thingsHow to herd cat statues and make awesome things
How to herd cat statues and make awesome things
 
Live coding scala 'the java of the future'
Live coding scala 'the java of the future'Live coding scala 'the java of the future'
Live coding scala 'the java of the future'
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
 
Metasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's APIMetasepi team meeting #17: Invariant captured by ATS's API
Metasepi team meeting #17: Invariant captured by ATS's API
 
Java Intro
Java IntroJava Intro
Java Intro
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPath
 
Introduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platformIntroduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platform
 
Why Scala?
Why Scala?Why Scala?
Why Scala?
 
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
Scala-Gopher: CSP-style programming techniques with idiomatic Scala.
 
Exploring Kotlin
Exploring KotlinExploring Kotlin
Exploring Kotlin
 
Introduction to Type Level Programming
Introduction to Type Level ProgrammingIntroduction to Type Level Programming
Introduction to Type Level Programming
 
Dependent types (and other ideas for guaranteeing correctness with types)
Dependent types (and other ideas for guaranteeing correctness with types)Dependent types (and other ideas for guaranteeing correctness with types)
Dependent types (and other ideas for guaranteeing correctness with types)
 
Java 8 - A step closer to Parallelism
Java 8 - A step closer to ParallelismJava 8 - A step closer to Parallelism
Java 8 - A step closer to Parallelism
 
Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02Power Up Your Build at Underscore 2018-02
Power Up Your Build at Underscore 2018-02
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
 
Scala fundamentals
Scala fundamentalsScala fundamentals
Scala fundamentals
 

Similar to Scala / Technology evolution

Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To ScalaPeter Maas
 
ParaSail
ParaSail  ParaSail
ParaSail AdaCore
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaKonrad Malawski
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersMiles Sabin
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersMiles Sabin
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkBen Scofield
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumNgoc Dao
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tKonrad Malawski
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsAjax Experience 2009
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
 
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java DevelopersHostedbyConfluent
 

Similar to Scala / Technology evolution (20)

Bioinformatica p4-io
Bioinformatica p4-ioBioinformatica p4-io
Bioinformatica p4-io
 
Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To Scala
 
ParaSail
ParaSail  ParaSail
ParaSail
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and Akka
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web Framework
 
Goodparts
GoodpartsGoodparts
Goodparts
 
Polyglot JVM
Polyglot JVMPolyglot JVM
Polyglot JVM
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Introduction to JAX-RS
Introduction to JAX-RSIntroduction to JAX-RS
Introduction to JAX-RS
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
 
Easy R
Easy REasy R
Easy R
 
Scala presentationjune112011
Scala presentationjune112011Scala presentationjune112011
Scala presentationjune112011
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
 

More from Ruslan Shevchenko

Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Ruslan Shevchenko
 
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
Papers We Love / Kyiv :  PAXOS (and little about other consensuses )Papers We Love / Kyiv :  PAXOS (and little about other consensuses )
Papers We Love / Kyiv : PAXOS (and little about other consensuses )Ruslan Shevchenko
 
{co/contr} variance from LSP
{co/contr} variance  from LSP{co/contr} variance  from LSP
{co/contr} variance from LSPRuslan Shevchenko
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scalaRuslan Shevchenko
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applicationsRuslan Shevchenko
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platformRuslan Shevchenko
 
Behind OOD: domain modelling in post-OO world.
Behind OOD:  domain modelling in post-OO world.Behind OOD:  domain modelling in post-OO world.
Behind OOD: domain modelling in post-OO world.Ruslan Shevchenko
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scalaRuslan Shevchenko
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N yearsRuslan Shevchenko
 
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
JDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation streamJDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation stream
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation streamRuslan Shevchenko
 
Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan Shevchenko
 
Web architecture - overview of techniques.
Web architecture - overview of  techniques.Web architecture - overview of  techniques.
Web architecture - overview of techniques.Ruslan Shevchenko
 

More from Ruslan Shevchenko (20)

Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]Embedding Generic Monadic Transformer into Scala. [Tfp2022]
Embedding Generic Monadic Transformer into Scala. [Tfp2022]
 
Svitla talks 2021_03_25
Svitla talks 2021_03_25Svitla talks 2021_03_25
Svitla talks 2021_03_25
 
Akka / Lts behavior
Akka / Lts behaviorAkka / Lts behavior
Akka / Lts behavior
 
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
Papers We Love / Kyiv :  PAXOS (and little about other consensuses )Papers We Love / Kyiv :  PAXOS (and little about other consensuses )
Papers We Love / Kyiv : PAXOS (and little about other consensuses )
 
{co/contr} variance from LSP
{co/contr} variance  from LSP{co/contr} variance  from LSP
{co/contr} variance from LSP
 
N flavors of streaming
N flavors of streamingN flavors of streaming
N flavors of streaming
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scala
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Scala jargon cheatsheet
Scala jargon cheatsheetScala jargon cheatsheet
Scala jargon cheatsheet
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applications
 
Csp scala wixmeetup2016
Csp scala wixmeetup2016Csp scala wixmeetup2016
Csp scala wixmeetup2016
 
IDLs
IDLsIDLs
IDLs
 
R ext world/ useR! Kiev
R ext world/ useR!  KievR ext world/ useR!  Kiev
R ext world/ useR! Kiev
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platform
 
Behind OOD: domain modelling in post-OO world.
Behind OOD:  domain modelling in post-OO world.Behind OOD:  domain modelling in post-OO world.
Behind OOD: domain modelling in post-OO world.
 
scala-gopher: async implementation of CSP for scala
scala-gopher:  async implementation of CSP  for  scalascala-gopher:  async implementation of CSP  for  scala
scala-gopher: async implementation of CSP for scala
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
JDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation streamJDays Lviv 2014:  Java8 vs Scala:  Difference points & innovation stream
JDays Lviv 2014: Java8 vs Scala: Difference points & innovation stream
 
Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014Ruslan.shevchenko: most functional-day-kiev 2014
Ruslan.shevchenko: most functional-day-kiev 2014
 
Web architecture - overview of techniques.
Web architecture - overview of  techniques.Web architecture - overview of  techniques.
Web architecture - overview of techniques.
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

Scala / Technology evolution

  • 1. SCALA: — GROW OR SHRINK ? FACTORS OF HATE/LOVE RELATIONSHIPS SCALA WAY VS WAYS OF TECHNICAL EVOLUTION // Ruslan Shevchenko <ruslan@shevchenko.kiev.ua> @rssh1
  • 2. Disclaimer: %noassoc I’m not associated with any organization, which have influence on the language design. Try to avoid: complain on things, which you can’t change speaking about decisions of others. Instead: Analyze technical/social/economics phenomenas
  • 3. 80 vs Now => C / Objective-C / C++ / Objective - C++ Pascal / Modula 2 Algol 60 / Algol 68 / … Java {1, 1.1, 1.2 … 1.5, 6, 7, 8, 9 ….. } Scala { 2.7, .. 2.13 -> 3, … } Smalltalk 80 C++ { __, 0x, 17, 19, 21 … }
  • 4. Evolution (where is beast ?) language usage ~ type of bacteria software project ~ organism people, money ~ resources horizontal gene transfer. gene: feature/idiom/(incapsulated into libraries …) //biology evolution— decisions are accident //technical evolution— decisions generated by committee this difference is not very big.
  • 5. What needed to be evolutionary stable ? Survie Adopt Be attractive
  • 6. What needed to be evolutionary stable ? Survie Adopt Be attractive Population > 1 % ∃ • EPFL Labs (Gov. financing) • Lightbend ( Commercial financing) • Community Center (Org ?) • Support industry: Hydra, SoftwareMill, etc.. • Monetization of PL ? (common problem) • Oracle try to monetize JVM
  • 7. What needed to be evolutionary stable ? Survie Adopt Be attractive Static metaprogrammig. • Unique, popular in PL academia world. • Will be better in Dotty: Staging/Partial Evaluation • Can emulate most of the other language features without (with little) compiler change: • RUST Derive: Scalaz-deriving • coroutines - storm-enrote • go : scala-gopher, etc. // technical part will follow
  • 8. What needed to be evolutionary stable ? Survie Adopt Be attractive Static metaprogrammig. • Unique, popular in PL academia world. • Will be better in Dotty: Staging/Partial Evaluation • Can emulate most of the other language features without (with little) compiler change: • RUST Derive: Scalaz-deriving • coroutines - storm-enrote • go : scala-gopher, etc. // technical part will follow • Metaprogramming still hard and incomplete. • Distance between academic concept/real industrial API • async/await • storm/enroute • monadless ….. • Now all stalled: wait new API in dotty/(squid in scala2) • JVM (but exists scala-native & scala-js).
  • 9. What needed to be evolutionary stable ? Survie Adopt Be attractive Hello! I'm A .signature Virus. Join In The Fun And Copy Me Into Yours! //memes Learning curve
  • 10. What needed to be evolutionary stable ? Survie Adopt Be attractive //memes Learning curve ({ type EF[X]=Either[S,X] })#EF val x = 1 culture Isolate subsets Software development is not scalable ! Education too…….. Kaa’s law ….
  • 11. Non-Issues: - FP/OOP (this is solved problem) Unsolved problems: - Distributed computing. - Mass-parallelism (GPU, TPU) Issues: - concurrency support - small boilerplate instead no-boilerplate - big core //gene rubbish
  • 12. Concurrency support. Monad [Future, Task] (extra wrap) Streams [Akka-Streams, Monix, fs2] (extra wrap) 2009. CPS [shift/reset]. Tiark Rompf, Ingo Maier Martin Odersky. Implementing First-Class Polymorphic Delimited Continuations by a Type-Directed Selective CPS-Transform.: https://infoscience.epfl.ch/record/149136/files/icfp113-rompf.pdf — deprecated, not prod. quality 2013. Async/Await. Philipp Haller and Jason Zaugg. SIP22-Async. https://docs.scala-lang.org/sips/async.html. — dormant, not prod. quality (try/catch support is missing) 2017. Coroutines. Aleksandar Prokopec, Fengyun Liu. Theory and Practice of Coroutines with Snapshots. http:// aleksandar-prokopec.com/publications/theory-and-practice-of-coroutines-with-snapshots/ —- Yet not ready, not prod. quality. using inside hight-order functions…. - theoretically possible (implemented in gopher)
  • 13. Concurrency/Learning Curve for{ x <- retrieveA() y <- retrieveB() } yield x+y async{ retrieveA()! + retrieveB()! } vs • Monads • Combinators • Nesting // in Go, C#, Kotlin, C++ (Karl!), Python, JavaScript something is implemented.
  • 14. small boilerplate instead no-boilerplate pathEndOrSingleSlash { getAll } ~ pathPrefix(Segment) { name => pathEndOrSingleSlash { put { saveValue(name) } ~ get { findValue(name) } ~ delete { deleteValue(name) } } } def getAll():List[String] = .. @JsonBin @Path(“entities”) class Service { List<String> getAll() @Post void saveValue(@Path name) String findValue(@Path name) @Delete // Java version is cleaner //too easy implement all directly
  • 15. big core any AST transformation => check all possible variants. Unroll syntax sugar themselves Possible solutions: IR layer, which will keep simplifier code (like in Scala.JS) Standard transform library. // will be better in dotty
  • 16. Conclusion FP/OOP - non issue. The unique value - static metaprogramming. Will allow lower barrier to language extending, but need to be done at first. Where other mainstream languages outperform Scala: Concurrency support Tooling (smaller core)
  • 17. Technical part: squid next generation of macro http://epfldata.github.io/squid/home.htm Lionel Parreaux, Amir Shaikhha, and Christoph E. Koch. 2017. Squid: Type-Safe, Hygienic, and Reusable Quasiquotes. In Proceedings of the 2017 8th ACM SIGPLAN Symposium on Scala (SCALA 2017). scala> def power(n: Int, x: ClosedCode[Double]): ClosedCode[Double] = { | if (n > 0) code"${power(n-1, x)} * $x" | else code"1.0" | } scala> val pgrm = power(3, code”0.5") scala> pgrm.compile
  • 18. Technical part: dotty metaprogramming https://dotty.epfl.ch/docs/reference/principled-meta- programming.html probably, next direction for squid inline def power(inline n: Int, x: Double) = ~powerCode(n, '(x)) private def powerCode(n: Int, x: Expr[Double]): Expr[Double] = if (n == 0) '(1.0) else if (n == 1) x else if (n % 2 == 0) '{ { val y = ~x * ~x; ~powerCode(n / 2, '(y)) } } else ‘{ ~x * ~powerCode(n - 1, x) }
  • 19. Technical part: scalar-deriving https://gitlab.com/fommil/scalaz-deriving no dependency from scalar ;) scalac plugin, to expand annotation into boilerplate @deriving(Encoder, Decoder) case class Bar(s: String) case class Bar(s: String) object Bar { implicit val _deriving_encoder: Encoder[Bar] = deriving implicit val _deriving_decoder: Decoder[Bar] = deriving }
  • 20. Thanks for attending Ping me, if needed ruslan@shevchenko.kiev.ua @rssh1 https://github.com/rssh //PWL-Kyiv tomorrow PaxOS and CRDT F[S] oo _, , _((-’_/ | / "", _//__, __/ ,’,O‘ | # ",/.---’ /,-’ ,’ __/-. # " .// |‘._(;_,--’ " || ‘-. , # ", || _ || # " || /,-.‘ // " // // ‘.‘. || | # # ",/ | ‘.‘._// // # ", ‘-.: || # ", ‘.___ // : # # ", ,--’----. || : || // #", // | | || // # # ",_ |:| |:| // # # ‘--.__ /:/ |:| # # # ‘--._ / / | | || |# # # ‘-. - /:/ /| | | || ; # # # # __ |:| _// |:| || : # # # # ‘-.| | /,- |:| // : # # # # / # : :| // |:| //_ : # | # / # | :|// _/ / : : |# # | # | |: / /| ::/ ‘ # # | # | #| / / _ // | : | ## # | ,| # | || | | || / ::/ | |# __,.’ # | || |:| /:: / | #/ |# /-’’ ‘. # #; || : :::/ | | | | # # / || | | / ::/ | | | #| | | | / || | | | : | |# | | | | | |# | ;; |:| / ::/ | | | #| |# | | | .;;. : |:::| | | | | | | | #| ;;;; |:| /:: / | #| | | | #| | | ;;;; |:| / : / _ _ | | |# | __ _( ) ( ) ;;;; | || |/ // _ _ _( ) ( ) _ //| / | / _ _ | :|:: |/ ////_ _ _ / _ | | _ |//| || |/// _ __ :| :_|/ /// _ |///| | | |_ |/| || |//////_ _ | _ / |_// |///| | | | ||_| |_|_|/ // / _ _ _ //:/ _ _ _ __/_/| | | | __ _ / |/ _ _ |||/_ / _ /// _ __| | | _ _ |||/ // _ _|//_ |/_ //_|// _ ||/ ////_ jrei __|//// _|// | // / ///_ || /// / (r)rssh _ |/////_ |/// _ ||// ///__ |// / ||/ /// |// // // - ||/ //// //// | //// || |/// - -- -- |/ -_ /// _ //| --- // -- |/ /// -- 1