SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
meldra
 
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
ScalaCheck
BeScala
 
Java Intro
Java IntroJava Intro
Java Intro
backdoor
 

Tendances (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
 

Similaire à Scala / Technology evolution

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
Miles Sabin
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
Ajax Experience 2009
 

Similaire à 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
 

Plus de Ruslan Shevchenko

Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platform
Ruslan Shevchenko
 

Plus de 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.
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

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