Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Carp言語さわってみた 〜鯉を取り戻せ編〜
Search
t-sin
July 28, 2022
Programming
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Carp言語さわってみた 〜鯉を取り戻せ編〜
Shibuya.lisp lispmeetup #104
で発表したときの資料です。
t-sin
July 28, 2022
More Decks by t-sin
See All by t-sin
Lispの紹介 〜 令和最新版
tsin45
0
900
Common Lisp製のゲームエンジンTrialについてすこし
tsin45
0
1.5k
Common Lispでのゲームボーイエミュレータ実装進捗報告 vol.1
tsin45
0
960
Other Decks in Programming
See All in Programming
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
280
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.3k
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
630
phperだってパンチカードでコーディングしたい
o0h
PRO
0
350
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
Railsバージョンを4倍にした話
optim
0
460
JIS keyboard support in Omarchy
lef237
0
140
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Ruling the World: When Life Gets Gamed
codingconduct
0
400
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
WCS-LA-2024
lcolladotor
0
890
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
Mind Mapping
helmedeiros
1
400
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Transcript
Carp言語さわってみた 〜鯉を取り戻せ編〜 @t-sin 2022-07-28 lispmeetup #104
Carp言語とは • Clojureふうの構文をもつLisp系言語 • GCレス、VMレス • 静的型付き言語 • 所有権追跡 •
簡単にCコードと統合できる • Lispのマクロ • REPL
Carpに興味を持った理由 • GC/VMがないLispである点 • 静的型システムおよび所有権追跡がある点 – 近ごろRustをさわってたので気になってた – Rust的な安全性がある? •
performance sensitiveなユースケースを想定してる点 – t-sinの興味: 音声信号処理、ゲーム • 重要: ドキュメントにあるREPLのプロンプトが「鯉」である点 – ”The 鲤 character on the last line is the REPL prompt”って書いてある – 以前「 」だったらしく「それ鯉 鲮 (carp) じゃないよ」ってissueが立ってた https://github.com/carp-lang/Carp/issues/578
Hello Carp! $ ./bin/carp Welcome to Carp 0.5.5 This is
free software with ABSOLUTELY NO WARRANTY. Evaluate (help) for more information. > (IO.println "Hello Carp!") Hello Carp!
鯉じゃない!!! $ ./bin/carp Welcome to Carp 0.5.5 This is free
software with ABSOLUTELY NO WARRANTY. Evaluate (help) for more information. > (IO.println "Hello Carp!") Hello Carp!
鯉の条件 • どうして鯉にならないのか • プロンプト文字列はProject.config内の値が使われる – マニュアル: https://github.com/carp-lang/Carp/blob/35465b9ffa8ce59a83af54a0637f8e93e49 59dc4/docs/Manual.md#configuring-a-project –
(Project.config "prompt" "鯉")とすると変えられるっぽい > (Project.config "prompt" "鯉") 鯉 (IO.println "鯉") 鯉
顧客が求めている鯉 • 「設定変えれば鯉にできる」 – →そうではない • なにもしなくても鯉になる条件を知りたい – REPLで鯉したい
鯉を取り戻せ • まず鯉プロンプトについて変更があったか調べる • もしかしたらなくなってるかも😭 – issue: なし – PR:
なし • つまり鯉REPLは消されていない
鯉を取り戻せ • 豆知識: CarpはHaskellで実装されている • あの>なる謎のプロンプトはどこから? – とりあえずsrc/ディレクトリを見てみる – Carpリポジトリのディレクトリ構造
→→ • Project.configの定義ここ https://github.com/carp-lang/Carp/blob/35465b9ffa8ce59a83af54a0637f8e93e4959dc 4/src/Project.hs – ただし値は入ってない ~/tmp/carp-lang/Carp$ tree -d -L 1 . ├── app ├── bench ├── core ├── docs ├── docs-html ├── examples ├── headerparse ├── resources ├── scripts ├── src └── test
ほんとうの鯉の条件 • Project.configの初期化はどこでやっているのか – src/には実行ファイルcarpのエントリポントない • app/Main.hs !! https://github.com/carp-lang/Carp/blob/35465b9ffa8ce59a83af54a0637f8e93e4959dc 4/app/Main.hs#L57
• macでのみプロンプトが鯉になる – 当環境はUbuntu – すべてが鯉にならない
鯉するCarp環境 • 起動したら自動で鯉にするには? • 設定ファイルを書きましょう – ~/.config/carp/profile.carp $ cat ~/.config/carp/profile.carp
(Project.config "prompt" "鯉")
鯉についての一考察 • macのみ鯉になるのはなぜか – Windowsは、コマンドプロンプトでUnicodeの文字「鯉」を 表示すると壊れそう – GNU/Linuxは、Unicodeのambiguous widthへの配慮? もしかしたらロケールがxx_YY.UTF-8じゃないケースへの配慮かも
• GNU/Linuxでも「鯉」にしようぜと言いたい… – issueを立てて訊いてみた https://github.com/carp-lang/Carp/issues/1423 – 「Unicodeをサポートしてない端末エミュレータもあるから」とのこと
きょうのまとめ • Carp言語の特徴を紹介した – REPLが鯉の言語です • GNU/LinuxでREPLが鯉にならない理由を調査した • 鯉ってサイコー!
きょうのまとめ • Carp言語の特徴を紹介した – REPLが鯉の言語です • GNU/LinuxでREPLが鯉にならない理由を調査した • 鯉ってサイコー! •
REPLに鯉がいないのが気になりすぎて大脱線しました • 次回はちゃんとCarpを紹介します – シンセ的なものをつくってみたりする予定