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.2k
Introduction to CircleCI
yubessy
1
98
Docker Hands-on
yubessy
0
93
Resource Polymorphism
yubessy
0
270
不動点コンビネータ?
yubessy
0
250
とりあえず機械学習したかった
yubessy
0
320
Type Erasure と Reflection のはなし
yubessy
1
420
量子暗号
yubessy
0
200
5分ちょいでわかった気になるラムダアーキテクチャ
yubessy
0
2.1k
Other Decks in Programming
See All in Programming
GCCのプラグインを作る / I Made a GCC Plugin
shouth
1
150
Vitest Browser Mode への期待 / Vitest Browser Mode
odanado
PRO
2
2.1k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
390
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
2k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
360
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
1k
VR HMDとしてのVision Pro+ゲーム開発について
yasei_no_otoko
0
110
JaSST 24 九州:ワークショップ(は除く)実践!マインドマップを活用したソフトウェアテスト+活用事例
satohiroyuki
0
270
WEBエンジニア向けAI活用入門
sutetotanuki
0
300
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
5
3.7k
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
340
Featured
See All Featured
Teambox: Starting and Learning
jrom
132
8.7k
The Power of CSS Pseudo Elements
geoffreycrofte
72
5.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Git: the NoSQL Database
bkeepers
PRO
426
64k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Docker and Python
trallard
40
3.1k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
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