Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Scala Native
Search
yubessy
January 29, 2018
Programming
0
210
Scala Native
社内勉強会用資料です
yubessy
January 29, 2018
Tweet
Share
More Decks by yubessy
See All by yubessy
DDIA (Designing Data-Intensive Applications) はいいぞ
yubessy
0
1.1k
Introduction to CircleCI
yubessy
1
98
Docker Hands-on
yubessy
0
89
Resource Polymorphism
yubessy
0
240
不動点コンビネータ?
yubessy
0
230
とりあえず機械学習したかった
yubessy
0
320
Type Erasure と Reflection のはなし
yubessy
1
390
量子暗号
yubessy
0
190
5分ちょいでわかった気になるラムダアーキテクチャ
yubessy
0
2k
Other Decks in Programming
See All in Programming
検証も兼ねて個人開発でHonoとかと向き合った話
hanetsuki
1
1.3k
使ってみよう Azure AI Document Intelligence
kosmosebi
2
360
Fast JSX: Don't clone props object #28768
yossydev
1
190
Exploring the Implementation of “t.Run”, “t.Parallel”, and “t.Cleanup”
akarin
1
130
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
1k
AppRouter Panel Talk
yosuke_furukawa
PRO
1
470
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
670
Git Rebase
bkuhlmann
11
1.6k
Going beyond Apache Parquet's default settings
xhochy
0
130
Elm Form Validation
bkuhlmann
0
510
Ruby Pattern Matching
bkuhlmann
0
930
SIMD Parallel Programming with the Vector API
josepaumard
0
230
Featured
See All Featured
In The Pink: A Labor of Love
frogandcode
138
21k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
It's Worth the Effort
3n
180
27k
KATA
mclloyd
16
12k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
261
12k
Transcript
Scala Native @yubessy 0x64 Reboot #10 " "
: : ( ) x -> o +
Scala Native Scala Scala JVM -> Java Scala Native ->
Java
LLVM (?) Scala Native Scala SBT
$ sbt new scala-native/scala-native.g8 object Main { def main(args: Array[String]):
Unit = println("Hello, world!") } $ sbt run Hello, World!
LLVM https://github.com/okapies/scala-native-example bonacci
(rec) def fib(n: Long): Long = n match { case
0 => 0 case 1 => 1 case _ => fib(n - 2) + fib(n - 1) }
(tail rec) def fibImpl(n: Long, a: Long, b: Long): Long
= n match { case 0 => a case _ => fibImpl(n - 1, b, a + b) } def fib(n: Long): Long = { fibImpl(n, 0, 1) }
(mut rec) def fib(n: Long): Long = n match {
case 0 => 0 case _ => fibS(n - 1) } def fibS(n: Long): Long = n match { case 0 => 1 case _ => fib(n - 1) + fibS(n - 1) }
(μs) rec tail rec mut rec JAR 74801223 262 67248872
Native -O0 168336051 4 164421481 Native -O2 77311107 4 34026913 Native -O0 ( ) rec, mute rec JAR . tail rec Native -O2 ( ) mute rec JAR
Scala Native LLVM