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.4k
Introduction to CircleCI
yubessy
1
110
Docker Hands-on
yubessy
0
100
Resource Polymorphism
yubessy
0
280
不動点コンビネータ?
yubessy
0
280
とりあえず機械学習したかった
yubessy
0
330
Type Erasure と Reflection のはなし
yubessy
1
440
量子暗号
yubessy
0
210
5分ちょいでわかった気になるラムダアーキテクチャ
yubessy
0
2.2k
Other Decks in Programming
See All in Programming
Parallel::Pipesの紹介
skaji
2
840
Zennの運営完全に理解した #完全に理解したTalk
wadayusuke
1
130
#QiitaBash TDDでAIに設計イメージを伝える
ryosukedtomita
2
1.6k
Use Perl as Better Shell Script
karupanerura
0
620
コンポーネントライブラリで実現する、アクセシビリティの正しい実装パターン
schktjm
1
630
External SecretsのさくらProvider初期実装を担当しています
logica0419
0
210
ts-morph実践:型を利用するcodemodのテクニック
ypresto
1
520
型付け力を強化するための Hoogle のすゝめ / Boosting Your Type Mastery with Hoogle
guvalif
1
230
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
120
クラシルリワードにおける iOSアプリ開発の取り組み
funzin
1
790
TypeScript製IaCツールのAWS CDKが様々な言語で実装できる理由 ~他言語変換の仕組み~ / cdk-language-transformation
gotok365
7
370
ドメイン駆動設計とXPで支える子どもの未来 / Domain-Driven Design and XP Supporting Children's Future
nrslib
0
350
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
245
12k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Designing for Performance
lara
608
69k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
Balancing Empowerment & Direction
lara
1
81
The Pragmatic Product Professional
lauravandoore
35
6.7k
For a Future-Friendly Web
brad_frost
178
9.7k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
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