SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
NEScala2016Roundup
by @hunglin at @VideoBlocks
1
About
● A media company - Creative Content Everyone Can Afford
● Since 2011, we saved more than $5B for our customers
● We reached 1M clips of inventory + $1M marketplace
sales faster than any company in history
● 15 engineers (total 60+ employees)
2
AboutMe
● Use Scala for about 5 years
● Not using Scala day to day for the past 9 months
● Scala developer, not sorcerer.
● Data Handyman @ Videoblocks - We Heart Data
● codingphilosophy.com
3
4
● On 3/4 - 3/5
● Since 2011
● At Philadelphia this year (last year in Boston)
● 3/4: conference - 1 track, 11 talks
● 3/5: unconference - 2-5 tracks, 26 talks
● pretty academia as usual
● $60 - order of magnitude cheaper, and better
NEScala2016
5
You have to be there!
Day1:Conference
6
7
Scalaz-StreamMasterclass
● https://github.com/runarorama/ircz
● monad is just a fancy way of saying "accumulate the
effects"
● monoid is just a fancy way of saying "collect the
elements"
8
9
SparkRDD
● compile-time type safe
● api is based on Scala collection (good and bad)
10
def collect(): Array[T]
def collect[U](f: PartialFunction[T,U])(implicit arg0: ClassTag[U]): RDD[U]
//val rdd = sc.textFile("hdfs:/user/bmc/wikipedia‐pagecounts.gz")
//val parsedRDD = rdd.flatMap { line=>
// line.split("""s+""") match {
// case Array(project,_,numRequests,_)=>Some((project,numRequests))
// case_=>None
// }}
parsedRDD.filter { case (project,numRequest) => project=="en" }.
reduceByKey(_+_).
take(100).
Foreach{ case (project,requests) => println(s"$project:$requests") }
SparkDataFrame
● DSL
● Optimized by catalyst
● lost type safety
11
val df = parsedRDD.toDF("project", "numRequests")
df.groupBy($"page").
agg(sum($"numRequests").as("count")).
limit(100).
show(100)
scala>:typedf.collect()
Array[org.apache.spark.sql.Row]
SparkDataset
● DSL + RDD api
● Type safety
● Optimized
● Use Tungsten, faster (20x) and smaller (4x)
12
val df = sqlContext.read.json("people.json")
case class Person(name: String, age: Long)
val ds: Dataset[Person] = df.as[Person]
ds.groupBy(_.name).count()
experimental
13
MacrosforMortals
● illTyped from Shapeless
● AST is pretty hard to deal with
● quasiquotes: val tree = q"class C"
14
15
Logical Programming in Scala
https://github.com/stewSquared/ukanren 16
17
MonadicLogging?
● Monad to accumulate effects (log)
● Write log of the same thread together
● Write log with logic
○ if (latency > 10ms) { mlog.toStdOut }
● Maybe too complicated and defeat the purpose of
logging?
○ Async + JVM crash, how to know what's going?
18
19
StreamFrameworkComparison
● Apache Flink
● Apache Spark
● Google Cloud Dataflow
● Apache Samza
20
21
AsyncTest
● Do we need it?
● It is required by Scala.js
22
23
CBT:CommunityBuildTool
● https://github.com/cvogt/cbt
● Side project from Chris Vogt
● Write Scala code to build, instead of the DSL (black
magic) of SBT
24
25
Modularity
● We shouldn't need to Mock if we modularize our code
correctly
● https://adriaanm.github.io/files/higher.pdf
26
27
DataPipelinewithAkkaStream
● Websocket as emitter
● Kafka as queue
● Akka Stream as process engine
28
29
TypeParameterv.s.TypeMember
● Sometimes compiler has issues with type parameter
○ trait Foo[F <: Foo[T]]
30
trait Foo[+T]
trait Foo {
Type T <: Exception
}
Day2:Unconference
31
32
33
Rapture-GuavaofScala
34
● single point of failure is GREAT in code
● config through import
● Rapture JSON supports 8 JSON backend
● syntax error of html or json are checked by compiler
● use gitter to report bug to Jon
Scala.js
● All Scala code are supported, but not all libraries
● union type
● D3, react, autowire
35
SI-2712
36
Scala Issue: Implement higher-order unification for type
constructor inference.
object Test {
def meh[M[_], A](x: M[A]): M[A] = x
meh{(x: Int) => x} // should solve ?M = [X] X => X and ?A = Int ...
}
37
Resources
38
● Runar's blog: http://blog.higher-order.com/
● Slides of Brendan's talk: https://speakerdeck.com/bwmcadams/nescala-16-scala-
macros-for-mortals-or-how-i-learned-to-stop-worrying-and-mumbling-wtf
● Logic programming: https://github.com/stewSquared/ukanren
● Akka stream: https://github.com/pkinsky/akka-streams-example
● Type member vs type parameter: http://www.artima.com/weblogs/viewpost.jsp?
thread=270195
● Good blog of category theory: http://bartoszmilewski.com/2014/10/28/category-
theory-for-programmers-the-preface/
● Unconference grid: https://goo.gl/ei5ijy
● Rapture (The Grava of Scala) https://github.com/propensive/rapture
● Another javascript library in shapeless: https://github.com/travisbrown/circe
● Typesafe RPC: https://github.com/lihaoyi/autowire
● https://issues.scala-lang.org/browse/SI-2712

Weitere ähnliche Inhalte

Was ist angesagt?

Typescript language
Typescript languageTypescript language
Typescript language.NET Crowd
 
Last Month in PHP - December 2016
Last Month in PHP - December 2016Last Month in PHP - December 2016
Last Month in PHP - December 2016Eric Poe
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...Viktor Turskyi
 
Running Through Typescript
Running Through TypescriptRunning Through Typescript
Running Through TypescriptNikhil Wanpal
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenchesJohannes Rudolph
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1eddify
 
Andrew Berezovsky - Drupal 8 How to Migr8
Andrew Berezovsky - Drupal 8 How to Migr8Andrew Berezovsky - Drupal 8 How to Migr8
Andrew Berezovsky - Drupal 8 How to Migr8DrupalSib
 
PSGL (PlayStation Graphics Library)
PSGL (PlayStation Graphics Library)PSGL (PlayStation Graphics Library)
PSGL (PlayStation Graphics Library)Slide_N
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012Rafael Rosa
 
High Availability for the LAMP Stack
High Availability for the LAMP StackHigh Availability for the LAMP Stack
High Availability for the LAMP StackJason Cannon
 
From silos to circles
From silos to circlesFrom silos to circles
From silos to circlesrobpark68
 
ATLRUG Community Announcements for December 2016
ATLRUG Community Announcements for December 2016ATLRUG Community Announcements for December 2016
ATLRUG Community Announcements for December 2016jasnow
 

Was ist angesagt? (18)

Untitled talk at Riviera.rb
Untitled talk at Riviera.rbUntitled talk at Riviera.rb
Untitled talk at Riviera.rb
 
Typescript language
Typescript languageTypescript language
Typescript language
 
Last Month in PHP - December 2016
Last Month in PHP - December 2016Last Month in PHP - December 2016
Last Month in PHP - December 2016
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
 
Running Through Typescript
Running Through TypescriptRunning Through Typescript
Running Through Typescript
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenches
 
Web Assembly
Web AssemblyWeb Assembly
Web Assembly
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
 
Andrew Berezovsky - Drupal 8 How to Migr8
Andrew Berezovsky - Drupal 8 How to Migr8Andrew Berezovsky - Drupal 8 How to Migr8
Andrew Berezovsky - Drupal 8 How to Migr8
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
 
PSGL (PlayStation Graphics Library)
PSGL (PlayStation Graphics Library)PSGL (PlayStation Graphics Library)
PSGL (PlayStation Graphics Library)
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012
 
High Availability for the LAMP Stack
High Availability for the LAMP StackHigh Availability for the LAMP Stack
High Availability for the LAMP Stack
 
From silos to circles
From silos to circlesFrom silos to circles
From silos to circles
 
ATLRUG Community Announcements for December 2016
ATLRUG Community Announcements for December 2016ATLRUG Community Announcements for December 2016
ATLRUG Community Announcements for December 2016
 
VN Tech Seminor Vol.1
VN Tech Seminor Vol.1VN Tech Seminor Vol.1
VN Tech Seminor Vol.1
 
Rails data migrations
Rails data migrationsRails data migrations
Rails data migrations
 
How to sell drupal 8
How to sell drupal 8How to sell drupal 8
How to sell drupal 8
 

Ähnlich wie NE Scala 2016 roundup

DrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low CodeDrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low CodeAlejandro Moreno
 
Efficient Django
Efficient DjangoEfficient Django
Efficient DjangoDavid Arcos
 
Kotlin REST & GraphQL API
Kotlin REST & GraphQL APIKotlin REST & GraphQL API
Kotlin REST & GraphQL APISean O'Brien
 
Accelerating Big Data beyond the JVM - Fosdem 2018
Accelerating Big Data beyond the JVM - Fosdem 2018Accelerating Big Data beyond the JVM - Fosdem 2018
Accelerating Big Data beyond the JVM - Fosdem 2018Holden Karau
 
Are general purpose big data systems eating the world?
Are general purpose big data systems eating the world?Are general purpose big data systems eating the world?
Are general purpose big data systems eating the world?Holden Karau
 
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)Holden Karau
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusBoldRadius Solutions
 
Introduction to Idem for Microsoft Azure
Introduction to Idem for Microsoft AzureIntroduction to Idem for Microsoft Azure
Introduction to Idem for Microsoft AzureNicholas Hughes
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance ComputingLuciano Mammino
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache SparkHolden Karau
 
Apache Spark Performance Observations
Apache Spark Performance ObservationsApache Spark Performance Observations
Apache Spark Performance ObservationsAdam Roberts
 
Shaping the Future of Automatic Programming
Shaping the Future of Automatic ProgrammingShaping the Future of Automatic Programming
Shaping the Future of Automatic ProgrammingChristos Tsakostas
 
stackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk Sternstackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk SternNETWAYS
 
IBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkIBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkAdamRobertsIBM
 
Making the big data ecosystem work together with python apache arrow, spark,...
Making the big data ecosystem work together with python  apache arrow, spark,...Making the big data ecosystem work together with python  apache arrow, spark,...
Making the big data ecosystem work together with python apache arrow, spark,...Holden Karau
 
Making the big data ecosystem work together with Python & Apache Arrow, Apach...
Making the big data ecosystem work together with Python & Apache Arrow, Apach...Making the big data ecosystem work together with Python & Apache Arrow, Apach...
Making the big data ecosystem work together with Python & Apache Arrow, Apach...Holden Karau
 
Big data beyond the JVM - DDTX 2018
Big data beyond the JVM -  DDTX 2018Big data beyond the JVM -  DDTX 2018
Big data beyond the JVM - DDTX 2018Holden Karau
 

Ähnlich wie NE Scala 2016 roundup (20)

DrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low CodeDrupalCon Europe 2020 Low Code
DrupalCon Europe 2020 Low Code
 
Efficient Django
Efficient DjangoEfficient Django
Efficient Django
 
Kotlin REST & GraphQL API
Kotlin REST & GraphQL APIKotlin REST & GraphQL API
Kotlin REST & GraphQL API
 
Accelerating Big Data beyond the JVM - Fosdem 2018
Accelerating Big Data beyond the JVM - Fosdem 2018Accelerating Big Data beyond the JVM - Fosdem 2018
Accelerating Big Data beyond the JVM - Fosdem 2018
 
Are general purpose big data systems eating the world?
Are general purpose big data systems eating the world?Are general purpose big data systems eating the world?
Are general purpose big data systems eating the world?
 
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)
Sharing (or stealing) the jewels of python with big data &amp; the jvm (1)
 
Scala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadiusScala Days Highlights | BoldRadius
Scala Days Highlights | BoldRadius
 
Ecma6 in the wild
Ecma6 in the wildEcma6 in the wild
Ecma6 in the wild
 
Ecma6 in the wild
Ecma6 in the wildEcma6 in the wild
Ecma6 in the wild
 
Introduction to Idem for Microsoft Azure
Introduction to Idem for Microsoft AzureIntroduction to Idem for Microsoft Azure
Introduction to Idem for Microsoft Azure
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance Computing
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache Spark
 
Apache Spark Performance Observations
Apache Spark Performance ObservationsApache Spark Performance Observations
Apache Spark Performance Observations
 
Shaping the Future of Automatic Programming
Shaping the Future of Automatic ProgrammingShaping the Future of Automatic Programming
Shaping the Future of Automatic Programming
 
stackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk Sternstackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk Stern
 
Ratpack 101 - GR8Conf 2015
Ratpack 101 - GR8Conf 2015Ratpack 101 - GR8Conf 2015
Ratpack 101 - GR8Conf 2015
 
IBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkIBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache Spark
 
Making the big data ecosystem work together with python apache arrow, spark,...
Making the big data ecosystem work together with python  apache arrow, spark,...Making the big data ecosystem work together with python  apache arrow, spark,...
Making the big data ecosystem work together with python apache arrow, spark,...
 
Making the big data ecosystem work together with Python & Apache Arrow, Apach...
Making the big data ecosystem work together with Python & Apache Arrow, Apach...Making the big data ecosystem work together with Python & Apache Arrow, Apach...
Making the big data ecosystem work together with Python & Apache Arrow, Apach...
 
Big data beyond the JVM - DDTX 2018
Big data beyond the JVM -  DDTX 2018Big data beyond the JVM -  DDTX 2018
Big data beyond the JVM - DDTX 2018
 

Mehr von Hung Lin

Handle TBs with $1500 per month
Handle TBs with $1500 per monthHandle TBs with $1500 per month
Handle TBs with $1500 per monthHung Lin
 
6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production 6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production Hung Lin
 
Micro Services
Micro ServicesMicro Services
Micro ServicesHung Lin
 
Lunch_and_Learn_20150603
Lunch_and_Learn_20150603Lunch_and_Learn_20150603
Lunch_and_Learn_20150603Hung Lin
 
Tech Talk - Things I Learned at Scala Days 2013
Tech Talk - Things I Learned at Scala Days 2013Tech Talk - Things I Learned at Scala Days 2013
Tech Talk - Things I Learned at Scala Days 2013Hung Lin
 
nescala 2013
nescala 2013nescala 2013
nescala 2013Hung Lin
 

Mehr von Hung Lin (6)

Handle TBs with $1500 per month
Handle TBs with $1500 per monthHandle TBs with $1500 per month
Handle TBs with $1500 per month
 
6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production 6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production
 
Micro Services
Micro ServicesMicro Services
Micro Services
 
Lunch_and_Learn_20150603
Lunch_and_Learn_20150603Lunch_and_Learn_20150603
Lunch_and_Learn_20150603
 
Tech Talk - Things I Learned at Scala Days 2013
Tech Talk - Things I Learned at Scala Days 2013Tech Talk - Things I Learned at Scala Days 2013
Tech Talk - Things I Learned at Scala Days 2013
 
nescala 2013
nescala 2013nescala 2013
nescala 2013
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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 SavingEdi Saputra
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
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 Processorsdebabhi2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 

Kürzlich hochgeladen (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

NE Scala 2016 roundup

  • 2. About ● A media company - Creative Content Everyone Can Afford ● Since 2011, we saved more than $5B for our customers ● We reached 1M clips of inventory + $1M marketplace sales faster than any company in history ● 15 engineers (total 60+ employees) 2
  • 3. AboutMe ● Use Scala for about 5 years ● Not using Scala day to day for the past 9 months ● Scala developer, not sorcerer. ● Data Handyman @ Videoblocks - We Heart Data ● codingphilosophy.com 3
  • 4. 4
  • 5. ● On 3/4 - 3/5 ● Since 2011 ● At Philadelphia this year (last year in Boston) ● 3/4: conference - 1 track, 11 talks ● 3/5: unconference - 2-5 tracks, 26 talks ● pretty academia as usual ● $60 - order of magnitude cheaper, and better NEScala2016 5 You have to be there!
  • 7. 7
  • 8. Scalaz-StreamMasterclass ● https://github.com/runarorama/ircz ● monad is just a fancy way of saying "accumulate the effects" ● monoid is just a fancy way of saying "collect the elements" 8
  • 9. 9
  • 10. SparkRDD ● compile-time type safe ● api is based on Scala collection (good and bad) 10 def collect(): Array[T] def collect[U](f: PartialFunction[T,U])(implicit arg0: ClassTag[U]): RDD[U] //val rdd = sc.textFile("hdfs:/user/bmc/wikipedia‐pagecounts.gz") //val parsedRDD = rdd.flatMap { line=> // line.split("""s+""") match { // case Array(project,_,numRequests,_)=>Some((project,numRequests)) // case_=>None // }} parsedRDD.filter { case (project,numRequest) => project=="en" }. reduceByKey(_+_). take(100). Foreach{ case (project,requests) => println(s"$project:$requests") }
  • 11. SparkDataFrame ● DSL ● Optimized by catalyst ● lost type safety 11 val df = parsedRDD.toDF("project", "numRequests") df.groupBy($"page"). agg(sum($"numRequests").as("count")). limit(100). show(100) scala>:typedf.collect() Array[org.apache.spark.sql.Row]
  • 12. SparkDataset ● DSL + RDD api ● Type safety ● Optimized ● Use Tungsten, faster (20x) and smaller (4x) 12 val df = sqlContext.read.json("people.json") case class Person(name: String, age: Long) val ds: Dataset[Person] = df.as[Person] ds.groupBy(_.name).count() experimental
  • 13. 13
  • 14. MacrosforMortals ● illTyped from Shapeless ● AST is pretty hard to deal with ● quasiquotes: val tree = q"class C" 14
  • 15. 15
  • 16. Logical Programming in Scala https://github.com/stewSquared/ukanren 16
  • 17. 17
  • 18. MonadicLogging? ● Monad to accumulate effects (log) ● Write log of the same thread together ● Write log with logic ○ if (latency > 10ms) { mlog.toStdOut } ● Maybe too complicated and defeat the purpose of logging? ○ Async + JVM crash, how to know what's going? 18
  • 19. 19
  • 20. StreamFrameworkComparison ● Apache Flink ● Apache Spark ● Google Cloud Dataflow ● Apache Samza 20
  • 21. 21
  • 22. AsyncTest ● Do we need it? ● It is required by Scala.js 22
  • 23. 23
  • 24. CBT:CommunityBuildTool ● https://github.com/cvogt/cbt ● Side project from Chris Vogt ● Write Scala code to build, instead of the DSL (black magic) of SBT 24
  • 25. 25
  • 26. Modularity ● We shouldn't need to Mock if we modularize our code correctly ● https://adriaanm.github.io/files/higher.pdf 26
  • 27. 27
  • 28. DataPipelinewithAkkaStream ● Websocket as emitter ● Kafka as queue ● Akka Stream as process engine 28
  • 29. 29
  • 30. TypeParameterv.s.TypeMember ● Sometimes compiler has issues with type parameter ○ trait Foo[F <: Foo[T]] 30 trait Foo[+T] trait Foo { Type T <: Exception }
  • 32. 32
  • 33. 33
  • 34. Rapture-GuavaofScala 34 ● single point of failure is GREAT in code ● config through import ● Rapture JSON supports 8 JSON backend ● syntax error of html or json are checked by compiler ● use gitter to report bug to Jon
  • 35. Scala.js ● All Scala code are supported, but not all libraries ● union type ● D3, react, autowire 35
  • 36. SI-2712 36 Scala Issue: Implement higher-order unification for type constructor inference. object Test { def meh[M[_], A](x: M[A]): M[A] = x meh{(x: Int) => x} // should solve ?M = [X] X => X and ?A = Int ... }
  • 37. 37
  • 38. Resources 38 ● Runar's blog: http://blog.higher-order.com/ ● Slides of Brendan's talk: https://speakerdeck.com/bwmcadams/nescala-16-scala- macros-for-mortals-or-how-i-learned-to-stop-worrying-and-mumbling-wtf ● Logic programming: https://github.com/stewSquared/ukanren ● Akka stream: https://github.com/pkinsky/akka-streams-example ● Type member vs type parameter: http://www.artima.com/weblogs/viewpost.jsp? thread=270195 ● Good blog of category theory: http://bartoszmilewski.com/2014/10/28/category- theory-for-programmers-the-preface/ ● Unconference grid: https://goo.gl/ei5ijy ● Rapture (The Grava of Scala) https://github.com/propensive/rapture ● Another javascript library in shapeless: https://github.com/travisbrown/circe ● Typesafe RPC: https://github.com/lihaoyi/autowire ● https://issues.scala-lang.org/browse/SI-2712