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
bel lispの紹介
Search
Niyarin
July 29, 2021
Technology
800
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
bel lispの紹介
Niyarin
July 29, 2021
More Decks by Niyarin
See All by Niyarin
Scheme用nREPLの開発(エラー出力の改善)
niyarin
0
190
nanopass-compiler-frameworkを使ってみました
niyarin
0
510
Gorgos-parser-combinator-written-in-scheme
niyarin
0
430
outputting-beautiful-s-expression
niyarin
0
430
Serialisp
niyarin
1
750
Mongo DBとS式検索
niyarin
0
360
goodbye-python-repl
niyarin
0
410
SchemeのEphemeronとWeak Pairの説明
niyarin
0
1.1k
red-paren-scheme-rev-macro.pdf
niyarin
0
470
Other Decks in Technology
See All in Technology
ライフワーク「猫でもわかるDirectConnect」
kentapapa
0
270
Lint の層を組み直した話
bengo4com
3
320
基本から分かる!AWSセキュリティ運用の考え方と任せ方
cmusudakeisuke
1
450
[dbts2026]数十PBの超巨大データ×AI活用を支えるSnowflakeの実力〜大規模環境におけるアーキテクチャと運用のリアル〜
y_matsubara
0
110
「いつか使う」の「いつか」は来ない 〜AI駆動開発における「作らない」判断について〜
ikki0006
0
150
Context Ontology Accelerator 入門 (業務データの意味を、AI エージェントに渡す)
inariku
PRO
3
510
[General] 개발자로 해외 기업에서 일하기
skydoves
1
310
The future of architectural work
ufried
0
180
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
1
7.4k
Copilot Coworkで「みのるん式」やってみた
minorun365
PRO
2
1.6k
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
5
1.1k
超⼩型・多⾔語検索モデル Bekko Embedding
hotchpotch
1
120
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
120k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
630
Game over? The fight for quality and originality in the time of robots
wayneb77
1
330
Making Projects Easy
brettharned
120
6.8k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
370
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Technical Leadership for Architectural Decision Making
baasie
3
640
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Site-Speed That Sticks
csswizardry
13
1.6k
Prompt Engineering for Job Search
mfonobong
0
580
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Transcript
(いまさら) Belについて 簡単な紹介と処理系 Niyarin
Belとは Paul Graham氏のLisp系言語 データの種類が少ない ・Symbol, Pair, Char ,Stream ・他のありがちなデータもこれらで表現 コンパクトだが、継続やマクロがちゃんとある
・実装はたのしめると思う レキシカルスコープ、lisp-1 公式は処理系を出していない ・ただし、コアの部分さえ実装すれば動かせる ・残りの部分はbel.belとして提供されている
せっかくなのでArcについても (Wikipedia程度の情報) Paul Graham氏のLisp系言語 Belの前に開発されていた 実用的に使われた実績がある Hacker Newsのweb formとフィード (今はどうなのか不明)
Arcのフォーラム Racketで実装 コアが小さい (bel同様)
Belを読む (http://www.paulgraham.com/bel.html) bellanguage.txt belのコア言語の”カジュアル”な定義 bel.bel 拡張関数、マクロや数値の定義 belexamples.txt ちょっとの例
Belと既存のLispの慣習 ・ 空リストはnil。偽でもある。ただし、nilはシンボル ・非真性list有り ・ car, cdrはそのまま。 ペアの変更は、xar, xdr ・condがない
代わりに、 (if a1 a2 a3 a4 … an) ・ lisp1、レキシカルスコープ ・伝統的macro (風)
Belのデータ表現1 / 3 関数もリスト こんな表現 (lit clo ローカル環境 引数 本体)
・ closureを作る構文は、quasiquoteで書かれている ・ 例 ((lit clo nil (x) (+ x 1)) 100) → 101 ⚠ lit構文は、自身をそのまま返す
Belのデータ表現2 / 3 マクロもリスト 表現 (lit mac クロージャ) よくある、クロージャに式を渡して展開する やつ
(クロージャ 式) eval→ 展開結果 eval→ 実行結果
Belのデータ表現3 / 3 その他 数値もリスト 0,1,2,3,4 ... → nil, (t), (t
t), (t t t), (t t t t) … 文字列もリスト “abc” → (\a \b \c) 空リストと”真”はシンボル nil t
継続もある ・ ccc”構文”で作れる ・もちろん継続もリスト 表現の形式は実装者依存 niyarinは、 (lit cont コールスタック ローカル環境)
⚠ インタプリタのコールスタックを陽で持っておく ・dynamic-wind風の構文、afterもある 継続で外への脱出を検出し、その前に指定した処理を実行させ る
Belで実用的なコードを書けるのか? がんばればいける ・ (coin) 関数 ランダムで t , nil を出す
・ (sys <string>) 関数 <string>の内容をOSに実行させる ・ (thead x) 構文 xを評価する新しいスレッドを作る ・ IO streamデータがある。ただし、バイナリしか読めない
Belは処理系実装の題材としては良い 評価器はコンパクト 4種のデータと16個の関数と9個のsyntax quasiquote bel.belを実行するためのいくつかのsyntax-sugar 処理系実装が楽しめる要素 マクロ、継続、継続の捕捉、動的束縛、quasiquote 題材は良いが、テキストの抜けを自力で埋める必要がある
実装 ・ bel-sml (github.com/niyarin/bel-sml) niyarinの”未完成”の実装 Standard MLで書かれた素朴なインタプリタ 気合をいれればすぐできそうだが、さぼってました ・他の人の実装 ほとんどインタプリタ
(ぱっと見、それ以外は発見できず) luksamuk/believe (C), masak/bel (Perl), ajlopez/beljs (JS) cookrn/babybel(Ruby) ,
その他実装 IGJoshua/skitter (Clojure) bel-likeと謳っているが何が違うのだろう BranislavLazic/bell lが一個多かった。別言語だったよ (Lispだったけど)
おしまい まとめ Belはコンパクトで自己記述がおもしろい言語 継続とかあって実装は楽しい 公式の実装はないけど、実装はたくさんある