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
LiveScript
Search
Pine Mizune
February 10, 2016
Programming
710
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LiveScript
Meguro.es #2 で発表した資料です。
http://meguroes.connpass.com/event/25018/
Pine Mizune
February 10, 2016
More Decks by Pine Mizune
See All by Pine Mizune
多言語対応と絵文字ジェネレーター / i18n of Emoji Generator
pine
0
890
C++ 製グラフィックライブラリ Skia の紹介 / Introduction to the graphics library Skia written by C++
pine
0
2k
asyncio + aiohttp で作るウェブサービス / How to develop a web service with asyncio and aiohttp
pine
0
700
Lerna による明示的疎結合アーキテクチャ
pine
1
680
CircleCI 2.0 x JavaScript
pine
3
580
Perl 卒業式
pine
0
380
Android Studio の気になる warnings を抑制する方法まとめ
pine
0
530
Emoji Generator meets Browser Extensions
pine
1
3k
近年の OSS 開発における CI 選択のベストプラクティス
pine
3
4.5k
Other Decks in Programming
See All in Programming
メールのエイリアス機能を履き違えない
isshinfunada
0
250
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
500
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
2
440
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.2k
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.2k
FastAPI の並行処理モデルを完全に理解する
hoto17296
8
3k
My Marp Sample
sinoue0108
0
120
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
350
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
240
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
390
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
210
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
720
Featured
See All Featured
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
480
Become a Pro
speakerdeck
PRO
31
6.2k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
30 Presentation Tips
portentint
PRO
1
380
Discover your Explorer Soul
emna__ayadi
2
1.3k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
820
Ethics towards AI in product and experience design
skipperchong
2
350
Thoughts on Productivity
jonyablonski
76
5.3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
390
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Transcript
Live Script 10 Feb, 2016 / Meguro.es #2 Pine Mizune
⾃⼰紹介 o ID / HN: @pine613 o 好きな言語: JavaScript /
Crystal o 仕事で書いてる: Perl / Swift / Kotlin o Mobile Factory, Inc o 最寄り: 五反田駅 o 本日は @mizuki_r 氏の代打です ⽬⿊のとなり
⽬次 1. LiveScript とは何か 2. 別に Babel でよくない ? 3.
LiveScript の特筆すべき⽂法 – 関数型記法・ほか 4. まとめ
LiveScript とは何か ? • CoffeeScript から派生した AltJS • 関数型言語として進化 •
利用人口が少ない
別に Babel で良くない ? • ⾃分もそう思います! • 本筋の開発で使うことは意図してません • このプレゼンで意図した使い⽅
– ⼩さなモジュール – gulpfile / webpack.config
インストール⽅法 repl があるのでぜひ弄ってみてください! $ npm i -g livescript ※ repl:
対話型インタプリタ
LiveScript の⽂法 1. 基本⽂法 2. パイピング 3. 関数 4. カリー化・関数合成
基本⽂法 (1/2) if 2 + 2 == 4 'somethingʼ else
ʻsomething elseʼ 基本は CoffeeScript と同じ if (2 + 2 == 4) { 'somethingʼ; } else { ʻsomething elseʼ; } LiveScript JavaScript
基本⽂法 (2/2) require! { lodash: _ gulp } require が圧倒的に楽
const _ = require(ʻlodashʼ) const gulp = require(ʻgulpʼ) LiveScript JavaScript
パイピング x = [1 2 3] |> reverse |> head
メソッドのネスト呼び出しの糖衣構文 let x = head(reverse([1, 2, 3])) LiveScript JavaScript
関数 (1/2) f = (x) -> x * x f(10)
#=> 100 CoffeeScript と同様に定義可能 const f = (x) => x * x f(10) #=> 100 LiveScript JavaScript
関数 (2/2) fold (+) [ 1 to 10 ] #=>
55 演算子は関数として扱える fold( (a, b) => a + b, [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ) LiveScript JavaScript
カリー化 f = (* 2) f(8) # => 16 f
= (a, b) --> a + b g = f(2) g(8) #=> 16 部分的に引数を固定した関数を得る LiveScript
関数合成 f = (x) => x + 2 g =
(x) => x * 10 (f >> g) 3 #=> 50 LiveScript 2つの関数を合成して関数を生成 let f = (x) => x + 2 let g = (x) => x * 10 g(f(3)) #=> 50 JavaScript
まとめ • LiveScript は CoffeeScript 派生言語 • 関数型方面へ進化 • ES2015
に飽きた時の暇つぶしにどうぞ
【宣伝】Gotanda.js #3 開催します n Gotanda.js #3 in freee ü 日時:
2016 年 3 月 11 日 (金) ü 会場: freee 株式会社 ü 内容: LT x 8 (5min LT x 8) ü 申し込みは Connpass から! http://gotandajs.connpass.com/event/26027/
fin.