SlideShare a Scribd company logo
1 of 28
Download to read offline
JS as PL Platform
review of languages, evaluated in JS
Ruslan Shevchenko
//lynx capital partners
@rssh1
JS Languages
• Why ?
• Better JavaScript (types, async, etc .. )
• Language ecosystems (C, Scala, Clojure)
• Explore ideas (tier-programming, CoP )
• Because I can ;)))
Coffescript
Dart
TypeScript
Traceur
Emscripten(C, C++, Rust)
Scala.js
Clojure-Script Kotlin
Java (gwt, applets)
Gopher.js
Idris
Opa
Ur/web
Asm.js
Shen
Coffeescript
• http://coffeescript.org/
• javascript with classes + ruby-inspired syntax
• actually used in industry
• literate programming [markdown syntax]
• syntax sugar [ =>, tuple assignment, expr.]
• “javascript + goodies from modern dynamic
language”.
Dart / Typescript
Google Microsoft
Class semantics + optional typing
trait/mixin
generic
syntax sugar, this scoping
async/await in process
interfaces [structural typing]
Traceur
• https://github.com/google/traceur-compiler
• Google
• JS [6, 7] + optional types/annotations => Js - now
• [async, async generator, =>, … , etc]
Async function
function t1(x) {
return new Promise(….)
}
async function f2(x) {
await t1(10);
return x2
}
async function f3(x) {
x1 = await t(10);
x2 = await f2(x1)
doSomething
}
function f3(x) {
f(function() {
f2(function(x2) {
doSomething
}
}
}
// simplified. (without error handling)
escape callback hell
Async generator
function* asyncGen(x) {
for(i in items) {
yield new Promise(….)
}
}
// simplified. (without error handling)
async function useGen() {
for(i on asyncGen(x)) {
… do-something
}
}
Async
• Other implementations:
• https://github.com/yortus/asyncawait (node-fibers)
• http://routines.ch/ (go-like channels)
• https://github.com/benjamn/es7-async-await (es7
=> es6)
• https://github.com/facebook/regenerator (es7 =>
es5)
asm.js
• http://asm.js
• Grown from mozilla research project. Supported
now by all major browsers [FF, chrome, next MS,
Opera]
• Subset of javascript.
• Types are set with ‘annotation operations'
asm.js
function AsmModule {
use “asm”;
function f(x,y) {
x=x|0; // x is int.
y = +y; // y is double
return + (y/(x+1)); // double
}
return {
f: f
}
}
asm.js
function AsmModule {
use “asm”;
function f(x,y) {
x=x|0; // x is int.
y = +y; // y is double
return + (y/(x+1)); // double
}
return {
f: f
}
}
- Compile to low-level efficient code
(if typechecked)
- low-level performance-critical code
- for compilers / interpreters (not people)
Emscripten
• http://kripken.github.io/emscripten-site/
• C, C++ => LLVM => Asm.js
• (near native speed, OpenGL support).
• // RUST support is underway.
Emscripten
• C, C++ ecosystem:
• curses: https://github.com/coolwanglu/
PDCurses.js
• example: http://coolwanglu.github.io/PDCurses.js/xmas.html
• vi: https://github.com/coolwanglu/vim.js
• just s/gcc/emcc/ in Makefile ;)
Emscripten
example: vi port
Emscripten
• More useful use-cases:
• Games:
• Unity 4 provide asm.js generation.
• UnrealEngine
• DosBox works perfectly
• Math: Image recognition in browser
Notables ecosystems
• Scala:
• scala.js: http://www.scala-js.org/ (full compiler)
• lightweight jscala macro (made in Kiev by @atlanter)
• Clojure: clojure-script: https://github.com/clojure/clojurescript
• Java: http://www.gwtproject.org/overview.html
• On the way:
• Erlang [Shen]: https://github.com/synrc/shen ( made in Kiev by @5HT )
• Go [Gopher.js]: https://github.com/gopherjs/gopherjs
Scala-JS
• Scala-compiler + sbt plugin. (familiar build tool to
scala developers)
• Support of javascript dependencies (WebJars)
• Typed binding to most notable JS libs
• Ports for of reactive extensions, akka
Scala-js
• Scala goodies, extremely useful:
• ADT (case classes)
• macroses [async/await work out of the box]
• typeclasses
Clojure-Script
• Clojure-compiler + lein plugin. (familiar build tool
to clojure developers)
• Support of javascript dependencies (CloJars)
• OM/React framework is ‘mainstream’ in ‘non-
mainstream world’.
Kotlin
• http://kotlinlang.org/
• Main Idea: ‘better java’ from jet-brains
• karra - web framework
• statistically typed CSS
• DSL for html
ol {
li("List Item 1")
li("List Item 2")
}
fieldset() {
label("Text Input")
input(inputType="text", value="Text")
}
JS-backed architectures:
• tier-less language
• compiler will decide, where run you code:
• frontend, backend, db…
• language-integrated persistency and forms
JS-backed architectures:
• OPA: http://opalang.org/
• frontend: browser,
• backend: node.js
• persistency: mongo-db
• Language: like ML with { } syntax
JS-backed architectures:
• Ur/Web: http://www.impredicative.com/ur/
• frontend: browser,
• backend: own server
• persistency: SQL binding to language types
• Language: like ML with Haskell typicalness
• Exists commercial applications.
Coffescript
Dart
TypeScript
Traceur
Emscripten(C, C++, Rust)
Scala.js
Clojure-Script Kotlin
Java (gwt, applets)
Gopher.js
Idris
Opa
Ur/web
Asm.js
Shen
Js-languages
• Resume, if you still want be in ‘mainstream’ JS
world:
• Static type checker [flow: http://flowtype.org/ ]
• Async [multiple implementations]
• Get used to live with this scope :(
• may-be macroses [ http://sweetjs.org/ ]
Thanks for attention
• Ruslan Shevchenko.
• https://github.com/rssh
• @rssh1

More Related Content

What's hot

A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understandingmametter
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotationsmametter
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOpsRicardo Sanchez
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes InternalsShimi Bandiel
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of RubySATOSHI TAGOMORI
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyelliando dias
 
MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?Joshua Ballanco
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with serverEugene Yokota
 
Making CLI app in ruby
Making CLI app in rubyMaking CLI app in ruby
Making CLI app in rubyHuy Do
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystemGeison Goes
 
Go: What's Different ?
Go: What's Different ?Go: What's Different ?
Go: What's Different ?Tarun Vashisth
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架jeffz
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesLogeekNightUkraine
 
Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Charles Nutter
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Eugene Yokota
 
JRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherJRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherCharles Nutter
 

What's hot (20)

A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
 
Should i Go there
Should i Go thereShould i Go there
Should i Go there
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOps
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
Crystal
CrystalCrystal
Crystal
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of Ruby
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRuby
 
Maccro Strikes Back
Maccro Strikes BackMaccro Strikes Back
Maccro Strikes Back
 
MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Making CLI app in ruby
Making CLI app in rubyMaking CLI app in ruby
Making CLI app in ruby
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystem
 
Go: What's Different ?
Go: What's Different ?Go: What's Different ?
Go: What's Different ?
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架
 
Ruby On Rails Ecosystem
Ruby On Rails EcosystemRuby On Rails Ecosystem
Ruby On Rails Ecosystem
 
Dmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script TechnologiesDmytro Kochergin Angular 2 and New Java Script Technologies
Dmytro Kochergin Angular 2 and New Java Script Technologies
 
Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
JRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform FurtherJRuby: Pushing the Java Platform Further
JRuby: Pushing the Java Platform Further
 

Similar to Jslab rssh: JS as language platform

Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins Udaya Kumar
 
JavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for BrowsersJavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for Browsersnoweverywhere
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Codemotion
 
Using existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsUsing existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsMicrosoft Tech Community
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayLuka Zakrajšek
 
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at TwitterAlex Payne
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistpmanvi
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play frameworkFelipe
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
 
Basic info on java intro
Basic info on java introBasic info on java intro
Basic info on java introkabirmahlotra
 
Basic info on java intro
Basic info on java introBasic info on java intro
Basic info on java introkabirmahlotra
 
SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.Ruslan Shevchenko
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSAlberto Paro
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsScala Italy
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaKazuhiro Sera
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!Alessandro Giorgetti
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scalascalaconfjp
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildwebLeo Zhou
 

Similar to Jslab rssh: JS as language platform (20)

Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins
 
JavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for BrowsersJavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for Browsers
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
 
Using existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsUsing existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analytics
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
 
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and GrailsPhilip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Basic info on java intro
Basic info on java introBasic info on java intro
Basic info on java intro
 
Basic info on java intro
Basic info on java introBasic info on java intro
Basic info on java intro
 
Scala Introduction
Scala IntroductionScala Introduction
Scala Introduction
 
SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.SE 20016 - programming languages landscape.
SE 20016 - programming languages landscape.
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJS
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.js
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb
 

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
 
Scala / Technology evolution
Scala  / Technology evolutionScala  / Technology evolution
Scala / Technology evolutionRuslan Shevchenko
 
{co/contr} variance from LSP
{co/contr} variance  from LSP{co/contr} variance  from LSP
{co/contr} variance from LSPRuslan Shevchenko
 
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
 
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
 
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 )
 
Scala / Technology evolution
Scala  / Technology evolutionScala  / Technology evolution
Scala / Technology evolution
 
{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
 
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.
 
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
 
R ext world/ useR! Kiev
R ext world/ useR!  KievR ext world/ useR!  Kiev
R ext world/ useR! Kiev
 
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.
 

Jslab rssh: JS as language platform

  • 1. JS as PL Platform review of languages, evaluated in JS Ruslan Shevchenko //lynx capital partners @rssh1
  • 2. JS Languages • Why ? • Better JavaScript (types, async, etc .. ) • Language ecosystems (C, Scala, Clojure) • Explore ideas (tier-programming, CoP ) • Because I can ;)))
  • 3. Coffescript Dart TypeScript Traceur Emscripten(C, C++, Rust) Scala.js Clojure-Script Kotlin Java (gwt, applets) Gopher.js Idris Opa Ur/web Asm.js Shen
  • 4. Coffeescript • http://coffeescript.org/ • javascript with classes + ruby-inspired syntax • actually used in industry • literate programming [markdown syntax] • syntax sugar [ =>, tuple assignment, expr.] • “javascript + goodies from modern dynamic language”.
  • 5. Dart / Typescript Google Microsoft Class semantics + optional typing trait/mixin generic syntax sugar, this scoping async/await in process interfaces [structural typing]
  • 6. Traceur • https://github.com/google/traceur-compiler • Google • JS [6, 7] + optional types/annotations => Js - now • [async, async generator, =>, … , etc]
  • 7. Async function function t1(x) { return new Promise(….) } async function f2(x) { await t1(10); return x2 } async function f3(x) { x1 = await t(10); x2 = await f2(x1) doSomething } function f3(x) { f(function() { f2(function(x2) { doSomething } } } // simplified. (without error handling) escape callback hell
  • 8. Async generator function* asyncGen(x) { for(i in items) { yield new Promise(….) } } // simplified. (without error handling) async function useGen() { for(i on asyncGen(x)) { … do-something } }
  • 9. Async • Other implementations: • https://github.com/yortus/asyncawait (node-fibers) • http://routines.ch/ (go-like channels) • https://github.com/benjamn/es7-async-await (es7 => es6) • https://github.com/facebook/regenerator (es7 => es5)
  • 10. asm.js • http://asm.js • Grown from mozilla research project. Supported now by all major browsers [FF, chrome, next MS, Opera] • Subset of javascript. • Types are set with ‘annotation operations'
  • 11. asm.js function AsmModule { use “asm”; function f(x,y) { x=x|0; // x is int. y = +y; // y is double return + (y/(x+1)); // double } return { f: f } }
  • 12. asm.js function AsmModule { use “asm”; function f(x,y) { x=x|0; // x is int. y = +y; // y is double return + (y/(x+1)); // double } return { f: f } } - Compile to low-level efficient code (if typechecked) - low-level performance-critical code - for compilers / interpreters (not people)
  • 13. Emscripten • http://kripken.github.io/emscripten-site/ • C, C++ => LLVM => Asm.js • (near native speed, OpenGL support). • // RUST support is underway.
  • 14. Emscripten • C, C++ ecosystem: • curses: https://github.com/coolwanglu/ PDCurses.js • example: http://coolwanglu.github.io/PDCurses.js/xmas.html • vi: https://github.com/coolwanglu/vim.js • just s/gcc/emcc/ in Makefile ;)
  • 16. Emscripten • More useful use-cases: • Games: • Unity 4 provide asm.js generation. • UnrealEngine • DosBox works perfectly • Math: Image recognition in browser
  • 17. Notables ecosystems • Scala: • scala.js: http://www.scala-js.org/ (full compiler) • lightweight jscala macro (made in Kiev by @atlanter) • Clojure: clojure-script: https://github.com/clojure/clojurescript • Java: http://www.gwtproject.org/overview.html • On the way: • Erlang [Shen]: https://github.com/synrc/shen ( made in Kiev by @5HT ) • Go [Gopher.js]: https://github.com/gopherjs/gopherjs
  • 18. Scala-JS • Scala-compiler + sbt plugin. (familiar build tool to scala developers) • Support of javascript dependencies (WebJars) • Typed binding to most notable JS libs • Ports for of reactive extensions, akka
  • 19. Scala-js • Scala goodies, extremely useful: • ADT (case classes) • macroses [async/await work out of the box] • typeclasses
  • 20. Clojure-Script • Clojure-compiler + lein plugin. (familiar build tool to clojure developers) • Support of javascript dependencies (CloJars) • OM/React framework is ‘mainstream’ in ‘non- mainstream world’.
  • 21. Kotlin • http://kotlinlang.org/ • Main Idea: ‘better java’ from jet-brains • karra - web framework • statistically typed CSS • DSL for html ol { li("List Item 1") li("List Item 2") } fieldset() { label("Text Input") input(inputType="text", value="Text") }
  • 22. JS-backed architectures: • tier-less language • compiler will decide, where run you code: • frontend, backend, db… • language-integrated persistency and forms
  • 23. JS-backed architectures: • OPA: http://opalang.org/ • frontend: browser, • backend: node.js • persistency: mongo-db • Language: like ML with { } syntax
  • 24. JS-backed architectures: • Ur/Web: http://www.impredicative.com/ur/ • frontend: browser, • backend: own server • persistency: SQL binding to language types • Language: like ML with Haskell typicalness • Exists commercial applications.
  • 25. Coffescript Dart TypeScript Traceur Emscripten(C, C++, Rust) Scala.js Clojure-Script Kotlin Java (gwt, applets) Gopher.js Idris Opa Ur/web Asm.js Shen
  • 26. Js-languages • Resume, if you still want be in ‘mainstream’ JS world: • Static type checker [flow: http://flowtype.org/ ] • Async [multiple implementations] • Get used to live with this scope :( • may-be macroses [ http://sweetjs.org/ ]
  • 27.
  • 28. Thanks for attention • Ruslan Shevchenko. • https://github.com/rssh • @rssh1