SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Scala.js
Next-gen front end development in Scala
by Otto Chrons, 2015-11-04 @ HelsinkiJS
@ochrons - otto@chrons.me
What does this JavaScript do?
var xhr = new XMLHttpRequest()
xhr.open("GET",
"https://api.twitter.com/1.1/search/" +
"tweets.json?q=%23scalajs"
)
xhr.onload = (e: Event) => {
if (xhr.status == 200) {
var r = JSON.parse(xhr.responseText)
$("#tweets").html(parseTweets(r))
}
}
xhr.send()
Is it actually JavaScript? Look again!
var xhr = new XMLHttpRequest()
xhr.open("GET",
"https://api.twitter.com/1.1/search/" +
"tweets.json?q=%23scalajs"
)
xhr.onload = (e: Event) => {
if (xhr.status == 200) {
var r = JSON.parse(xhr.responseText)
$("#tweets").html(parseTweets(r))
}
}
xhr.send()
It's strongly
typed Scala,
really!
What is Scala.js?
Write Scala, compile to JavaScript, run in browser
Full support of Scala language
Full JavaScript interoperability
As fast code as hand-written JavaScript
Generated JS code is "small enough"
Fast edit-compile-run cycle
Live Demo
How does Scala.js compare to ...
Opal
WebSharper
Everyone wants a better JavaScript
Safer
More modular, expressive, reusable code
One language across client/server
More tool-able & better IDE support
Fewer warts
Why Scala.js?
Safety Expressive Interoperability Toolable
ES6/7 Still un-typed Some new
syntax
Native Still JavaScript
TypeScript Types! Some new
syntax
Native Visual Studio
IntelliJ
ClojureScript Still un-typed Very powerful
language
Complicated Similar to
JavaScript
Dart Types! 50% JS,
50% Java
Complicated Eclipse
IntelliJ
Scala.js Very strong
types!
Very powerful
language
Very good Eclipse
IntelliJ
Why now?
Front end evolution
Stone age
aka
JQuery era
Server-rendered HTML pages
Simple JS animations
Ajax calls to server
Direct DOM manipulation
Medieval times
Rise of the Single Page App
HTML template driven
REST APIs
Angular, Backbone, Ember, ...
Renaissance
JS centric complex apps
DOM is code-generated
GraphQL, Falcor
Rise of transpilers: TS, Babel
React, Angular 2, ...
Next generation
Modern times
Rise of new languages: Scala, Clojure, Dart, TS
Complex client-server systems with shared code
JS reduced to a compile target and platform
Cross-platform: mobile and web
Live Demo 2
(if enough time)
What do JS developers get from Scala.js?
Everything in ES6/7 (=>, destructuring, string-interpolation, ...)
Everything in TypeScript (types, generics, ...)
Everything in Immutable.js (immutable collections)
+
Great language, extensive standard library, functional
programming, access to all JS libs and peace of mind 😌
How to get started?
www.scala-js.org
new website at
http://tiny.cc/sjs-new
Gitter room
https://gitter.im/scala-js/scala-js

Weitere ähnliche Inhalte

Was ist angesagt?

Log analysis with the elk stack
Log analysis with the elk stackLog analysis with the elk stack
Log analysis with the elk stack
Vikrant Chauhan
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
琛琳 饶
 
Spark with Elasticsearch - umd version 2014
Spark with Elasticsearch - umd version 2014Spark with Elasticsearch - umd version 2014
Spark with Elasticsearch - umd version 2014
Holden Karau
 
Scalable Applications with Scala
Scalable Applications with ScalaScalable Applications with Scala
Scalable Applications with Scala
Nimrod Argov
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Roel Hartman
 

Was ist angesagt? (20)

Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, AirbnbAirbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka Persistence
 
Log analysis with the elk stack
Log analysis with the elk stackLog analysis with the elk stack
Log analysis with the elk stack
 
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps lifeHow ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
 
Spark with Elasticsearch - umd version 2014
Spark with Elasticsearch - umd version 2014Spark with Elasticsearch - umd version 2014
Spark with Elasticsearch - umd version 2014
 
Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams
 
Analyzing Log Data With Apache Spark
Analyzing Log Data With Apache SparkAnalyzing Log Data With Apache Spark
Analyzing Log Data With Apache Spark
 
Scalable Applications with Scala
Scalable Applications with ScalaScalable Applications with Scala
Scalable Applications with Scala
 
Reactive streams processing using Akka Streams
Reactive streams processing using Akka StreamsReactive streams processing using Akka Streams
Reactive streams processing using Akka Streams
 
ELK Stack
ELK StackELK Stack
ELK Stack
 
Using akka streams to access s3 objects
Using akka streams to access s3 objectsUsing akka streams to access s3 objects
Using akka streams to access s3 objects
 
Spark Your Legacy (Spark Summit 2016)
Spark Your Legacy (Spark Summit 2016)Spark Your Legacy (Spark Summit 2016)
Spark Your Legacy (Spark Summit 2016)
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
 
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesAkka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutes
 
Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015
 
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
 
Next generation actors with Akka
Next generation actors with AkkaNext generation actors with Akka
Next generation actors with Akka
 
2014 akka-streams-tokyo-japanese
2014 akka-streams-tokyo-japanese2014 akka-streams-tokyo-japanese
2014 akka-streams-tokyo-japanese
 
Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 

Ähnlich wie Scala.js: Next generation front end development in Scala

Opa presentation at GamesJs
Opa presentation at GamesJsOpa presentation at GamesJs
Opa presentation at GamesJs
Henri Binsztok
 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scala
parag978978
 
Concurrency on the JVM
Concurrency on the JVMConcurrency on the JVM
Concurrency on the JVM
Vaclav Pech
 
用Tornado开发RESTful API运用
用Tornado开发RESTful API运用用Tornado开发RESTful API运用
用Tornado开发RESTful API运用
Felinx Lee
 

Ähnlich wie Scala.js: Next generation front end development in Scala (20)

Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
huhu
huhuhuhu
huhu
 
JavaScript Lessons 2023
JavaScript Lessons 2023JavaScript Lessons 2023
JavaScript Lessons 2023
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
Opa presentation at GamesJs
Opa presentation at GamesJsOpa presentation at GamesJs
Opa presentation at GamesJs
 
From Node to Go
From Node to GoFrom Node to Go
From Node to Go
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
 
Document Conversion & Retrieve and Rank 一問一答
Document Conversion & Retrieve and Rank 一問一答Document Conversion & Retrieve and Rank 一問一答
Document Conversion & Retrieve and Rank 一問一答
 
Luis Atencio on RxJS
Luis Atencio on RxJSLuis Atencio on RxJS
Luis Atencio on RxJS
 
Pick up the low-hanging concurrency fruit
Pick up the low-hanging concurrency fruitPick up the low-hanging concurrency fruit
Pick up the low-hanging concurrency fruit
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scala
 
Introduction to-scala
Introduction to-scalaIntroduction to-scala
Introduction to-scala
 
JQuery Flot
JQuery FlotJQuery Flot
JQuery Flot
 
Concurrency on the JVM
Concurrency on the JVMConcurrency on the JVM
Concurrency on the JVM
 
Not your Grandma's XQuery
Not your Grandma's XQueryNot your Grandma's XQuery
Not your Grandma's XQuery
 
用Tornado开发RESTful API运用
用Tornado开发RESTful API运用用Tornado开发RESTful API运用
用Tornado开发RESTful API运用
 

Kürzlich hochgeladen

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Kürzlich hochgeladen (20)

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 

Scala.js: Next generation front end development in Scala

  • 1. Scala.js Next-gen front end development in Scala by Otto Chrons, 2015-11-04 @ HelsinkiJS @ochrons - otto@chrons.me
  • 2. What does this JavaScript do? var xhr = new XMLHttpRequest() xhr.open("GET", "https://api.twitter.com/1.1/search/" + "tweets.json?q=%23scalajs" ) xhr.onload = (e: Event) => { if (xhr.status == 200) { var r = JSON.parse(xhr.responseText) $("#tweets").html(parseTweets(r)) } } xhr.send()
  • 3. Is it actually JavaScript? Look again! var xhr = new XMLHttpRequest() xhr.open("GET", "https://api.twitter.com/1.1/search/" + "tweets.json?q=%23scalajs" ) xhr.onload = (e: Event) => { if (xhr.status == 200) { var r = JSON.parse(xhr.responseText) $("#tweets").html(parseTweets(r)) } } xhr.send() It's strongly typed Scala, really!
  • 4. What is Scala.js? Write Scala, compile to JavaScript, run in browser Full support of Scala language Full JavaScript interoperability As fast code as hand-written JavaScript Generated JS code is "small enough" Fast edit-compile-run cycle
  • 6. How does Scala.js compare to ... Opal WebSharper
  • 7. Everyone wants a better JavaScript Safer More modular, expressive, reusable code One language across client/server More tool-able & better IDE support Fewer warts
  • 8. Why Scala.js? Safety Expressive Interoperability Toolable ES6/7 Still un-typed Some new syntax Native Still JavaScript TypeScript Types! Some new syntax Native Visual Studio IntelliJ ClojureScript Still un-typed Very powerful language Complicated Similar to JavaScript Dart Types! 50% JS, 50% Java Complicated Eclipse IntelliJ Scala.js Very strong types! Very powerful language Very good Eclipse IntelliJ
  • 9. Why now? Front end evolution Stone age aka JQuery era Server-rendered HTML pages Simple JS animations Ajax calls to server Direct DOM manipulation Medieval times Rise of the Single Page App HTML template driven REST APIs Angular, Backbone, Ember, ... Renaissance JS centric complex apps DOM is code-generated GraphQL, Falcor Rise of transpilers: TS, Babel React, Angular 2, ...
  • 10. Next generation Modern times Rise of new languages: Scala, Clojure, Dart, TS Complex client-server systems with shared code JS reduced to a compile target and platform Cross-platform: mobile and web
  • 11. Live Demo 2 (if enough time)
  • 12. What do JS developers get from Scala.js? Everything in ES6/7 (=>, destructuring, string-interpolation, ...) Everything in TypeScript (types, generics, ...) Everything in Immutable.js (immutable collections) + Great language, extensive standard library, functional programming, access to all JS libs and peace of mind 😌
  • 13. How to get started? www.scala-js.org new website at http://tiny.cc/sjs-new Gitter room https://gitter.im/scala-js/scala-js

Hinweis der Redaktion

  1. Hello everyone, my name is Otto and I'm going to talk about how to build next gen front end applications in Scala using Scala.js I'm a cofounder and CTO at Microtask and we've been using Scala on the server side for about 3 years and Scala.js on the front end for a little over half a year. Before that we had both GWT (java) and Angular JS apps. Let's start by taking a short poll. How many of you use JavaScript at work, hands up! Ok, and how many know Scala or have done something with Scala? How about using Scala at a work project? Ok, not so many.
  2. To get your brains activated, please look at the following JS code and tell me what it does. Should be quite familiar to any experienced JS developer :) Got it yet? Yes, it fetches some data from Twitter and uses JQuery to render the parsed tweets in an element identified by "tweets".
  3. Did you notice something strange about it? Maybe take another look. There seems to be a type definition on the function parameter, so maybe this is actually TypeScript? Well, it actually could be, but in reality it's just normal strongly typed Scala code. I bet most of you could read Scala.js code quite easily!
  4. Now, what is Scala.js? It's a Scala to JavaScript compiler that allows you to write normal Scala code, compile it to JS and run in a browser (or in Node.js if you want) It supports the full range of Scala language features, which is no small feat since Scala is quite an extensive multi-paradigm language. It also gives you full interoperability with all existing JavaScript code base, so you can use libraries like React and JQuery from your Scala code very easily. The compiler produces highly optimized Javascript, comparable in performance to hand-written JS, sometimes even a bit faster! Scala.js runs the produced code through Google Closure Compiler further doing DCE and minifaction, resulting in reasonably small JS file. Typically a few hundred kilobytes, including all the Scala libraries you use. Seeing the effects of your changes is fast, not quite as fast as with some JS transpilers, but fast enough to not be annoying. we're talking about 2-5 seconds here. And you don't need to do this so often as IDE and the compiler help so much
  5. Let's do a quick live demo to see what working with Scala.js is really like! .... As you saw, the code is nice and readable with great support from the IDE.
  6. There are literally hundreds of X to JavaScript compilers and transpilers out there because JavaScript is such a great platform for running code on all kinds of devices. But why do things like CoffeeScript, Dart and TypeScript exist?
  7. As great as JavaScript is as a platform, it lacks severly as a programming language. We all want better safety, to protect us from our own mistakes. Having Modularity is great and a highly experssive language gets more things done in a shorter time. Having one language across client and server, being able to reuse code and developers, which is a great benefit. When applications get more complex, the tooling and IDE support has to be there so you don't spend half your time googling around. And of course fewer warts that bite you when you least expect them.
  8. So, why Scala.js? Even though ES6 brought a lot of improvements to the JS language, it's still very unsafe and lacks in the tooling department. The IDEs try their best, but they simply cannot do much when it comes to vanilla JS code. TypeScript is addressing many issues in JS and has now support from the big players including of course Microsoft, but also Google in Angular2. But it's still Javascript :) ClojureScript is based on Clojure, a functional language much like Lisp, making it very powerful. But as it lacks static typing, it's also hard for IDEs. Interoperability with existing Javascript is quite complicated. Dart from Google is a new language inspired by JavaScript and Java (whether that's good or bad) and has a good type system. But its interoperability is not so great. Scala.js being Scala of course has very strong type system and has superb IDE support as we saw in the live demo. Core focus of Scala.js has been interoperability with JS which is where it really shines compared to many alternatives. Even though the Scala language is sometimes seen as complicated, it's really easy to get started and then move on to more complex things as you get familiar with the language.
  9. To understand why we are seeing such a boom in JS alternatives right now, we have to take a look at the evolution of front end development. It all starts in the stone age where JQuery is the king-of-the-hill when it comes to JS programming. Web pages are rendered server side and JS is really only used for simple animations and for making UX more bearable. More advanced sites are using Ajax to make live updates by doing direct DOM manipulation. At some point the applications started becoming more complex, so smart guys started thinking other ways of doing web apps and the Single Page App was born. Here we see a lot more JS being used, driven by HTML templates. REST APIs become the norm for communication and we get a lot of frameworks like Backbone, Ember and Angular. But as application complixity keeps growing, devs start seeing the problems with the HTML template driven approach so a new breed of architectures like React emerge. This time JavaScript is on the center stage, doing all the work from DOM generation to server communication. The REST model gives way to more flexible communication methods like GraphQL and Falcor. Alternatives to vanilla JS start to gain traction and the whole transpiler industry is born with the likes of TypeScript and Babel etc.
  10. But we don't want to get stuck with renaissance, what about the next generation? As complexity and application size grows, managing and refactoring large JS projects becomes quite challenging. New languages like Scala and Clojure enter the world of front end development. I would actually say that none of you in the audience is coding vanilla JS in five years time. With nodejs the front end language got traction on the server side, but now solid server side languages are moving on the front end to facilitate sharing code in complex applications. Over time Javascript is reduced to a compiler target, much like x86 assembly language, but continues to provide a great platform for applications. We're now seeing the first attempts at doing real cross-platform development on mobile and web, not just by running a browser view in a mobile app, but using native controls. You can actually now write your code in Scala, compile it to Javascript and run it natively under iOS or Android using React Native.
  11. Let's quickly look at a bit more realistic example of doing client-server in Scala.js and React
  12. So, you've been a happy puppy with JavaScript, why would you consider learning a new language and using Scala.js? First of all you get literally every language feature in ES6 and ES7, including the fat arrow, destructuring, string-interpolation, async/await etc. You also get everything in TypeScript like decent types, generics, etc. Not to mention stuff like Immutable.js, which is an immutable collection library for JavaScript. Guess what those collection algorithms are based on? Scala and Clojure collection libraries! So, you get everything JS has to offer, plus a great language, with which programming is really fun, a truly extensive standard library, access to real functional programming and associated FP libraries and but you still can use all the JS libs you know and love. Finally you get a peace of mind; when you make that critical edit at 2am to fix a bug in production, it's just going to work ok, not blow up as an Uncaught typeerror: undefined is not a function.
  13. If you got interested, head to the links shown on the slide and start learning. We are about to launch a new version of the Scala.js site, so please check out the lower link as well that will direct you to the beta site. Any questions?