Repository navigation
Add complete R5RS-compliant Scheme interpreter in Ruby (sucheme-ruby) - #1
Conversation
- Lexer, parser, evaluator with TCO via trampolining - Complete R5RS primitives (arithmetic, strings, I/O, control, etc.) - syntax-rules macro expansion with ellipsis support - call/cc via Ruby throw/catch (escape continuations) - REPL with multiline input and error recovery - CLI with --version, --eval, --load, file execution - Web UI via Sinatra with POST /eval endpoint - 254 tests all passing (lexer, parser, evaluator, primitives, R5RS compliance) - Sample programs in 10 categories - Japanese documentation (SOW, ONBOARDING, ADR, CHANGELOG) - CI/CD with GitHub Actions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
RubyでR5RS準拠を目標としたSchemeインタプリタ本体(Lexer/Parser/Evaluator/Primitives/Env/REPL)に加え、CLI・Web UI・テスト・サンプル・ドキュメント・CI/CD一式を新規追加するPRです。
Changes:
lib/sucheme/にインタプリタのコア実装(型・字句解析・構文解析・評価器・プリミティブ・REPL)を追加- CLI(
bin/sucheme)とWeb UI(Sinatra、web/)を追加 - RSpec + SimpleCov、ベンチマーク、サンプル、ADR/オンボーディング/準拠表、GitHub Actions を追加
Reviewed changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| web/public/index.html | ブラウザ実行用の簡易UIを追加 |
| web/app.rb | Sinatraで /eval API と静的配信を追加 |
| spec/sucheme/r5rs_compliance_spec.rb | R5RS準拠観点のテストを追加 |
| spec/sucheme/primitives_spec.rb | プリミティブのテストを追加 |
| spec/sucheme/parser_spec.rb | パーサのテストを追加 |
| spec/sucheme/lexer_spec.rb | レキサのテストを追加 |
| spec/sucheme/evaluator_spec.rb | 評価器・TCO・マクロ等のテストを追加 |
| spec/spec_helper.rb | SimpleCov/RSpec設定を追加 |
| samples/10_exercises/exercises.scm | 演習サンプルを追加 |
| samples/09_continuations/callcc.scm | call/cc応用サンプルを追加 |
| samples/08_practical/practical.scm | 実用サンプルを追加 |
| samples/07_advanced/advanced.scm | 応用サンプルを追加 |
| samples/06_io/io_examples.scm | I/Oサンプルを追加 |
| samples/05_macros/macros.scm | マクロサンプルを追加 |
| samples/04_recursion/algorithms.scm | 再帰アルゴリズムサンプルを追加 |
| samples/03_functions/higher_order.scm | 高階関数サンプルを追加 |
| samples/02_data_structures/lists.scm | リスト/ベクタサンプルを追加 |
| samples/01_basics/variables.scm | 基本サンプルを追加 |
| lib/sucheme/version.rb | バージョン定義を追加 |
| lib/sucheme/types.rb | Schemeデータ型(pair/symbol/vector等)を追加 |
| lib/sucheme/repl.rb | REPLを追加 |
| lib/sucheme/primitives.rb | 組み込み手続きを大量追加 |
| lib/sucheme/parser.rb | S式パーサを追加 |
| lib/sucheme/lexer.rb | トークナイザを追加 |
| lib/sucheme/evaluator.rb | 評価器(特殊形式/マクロ/準TCO/call/cc等)を追加 |
| lib/sucheme/errors.rb | 独自例外型を追加 |
| lib/sucheme/environment.rb | レキシカル環境を追加 |
| lib/sucheme.rb | ライブラリエントリポイントを追加 |
| docs/SOW.md | 作業指示書を追加 |
| docs/R5RS_COMPLIANCE.md | R5RS対応状況表を追加 |
| docs/ONBOARDING.md | 開発環境構築ガイドを追加 |
| docs/ADR/003-architecture.md | アーキテクチャADRを追加 |
| docs/ADR/002-r5rs-compliance.md | R5RS準拠方針ADRを追加 |
| docs/ADR/001-language-ruby.md | Ruby採用ADRを追加 |
| bin/sucheme | CLIエントリポイントを追加 |
| benchmarks/benchmark.rb | ベンチマークスイートを追加 |
| README.md | READMEを刷新 |
| Gemfile | gem依存を追加 |
| CHANGELOG.md | CHANGELOGを追加 |
| .ruby-version | Rubyバージョンを固定 |
| .gitignore | 生成物/依存物の除外設定を追加 |
| .github/workflows/release.yml | タグpush時のリリース作成を追加 |
| .github/workflows/ci.yml | テスト/リントのCIを追加 |
| .github/copilot-instructions.md | AI向け開発ガイドを追加 |
| .editorconfig | エディタ設定を追加 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot レビューをすべて確認して、対応する。指摘点だけでなく、類似の問題が含まれていないか、全体を再確認する。このとき、TDDを用いて開発して、レビューの確認した内容とそれに対する判断、そして対応内容、経過報告をすべて日本語で報告する。 |
Co-authored-by: suchi <74622+suchi@users.noreply.github.com>
Co-authored-by: suchi <74622+suchi@users.noreply.github.com>
コミット レビュー内容の再確認と判断
類似問題(TDDで発見・修正)
追加したテスト(11件増:254→265)
|
Co-authored-by: suchi <74622+suchi@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 47 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RubyによるR5RS準拠のSchemeインタプリタをゼロから実装。REPL、CLI、Web UI、CI/CD、100以上のサンプルプログラム、日本語ドキュメントを含む。Windows/macOS/Linux対応。
コアインタプリタ (
lib/sucheme/)parse_allのnilバグ修正済みsyntax-rules衛生的マクロ、call/cc(throw/catchによる脱出継続)。eval_let_values/eval_let_star_valuesの二重評価バグ修正、let-values/let*-values/let-syntaxのSchemeTailCall未処理を修正string->numberのradix対応、foldl/fold-left引数順を修正インターフェース
bin/sucheme/bin/sucheme.bat):--eval,--load,--quiet,--version等。Windows用バッチラッパー付きlib/sucheme/repl.rb): 括弧未閉の複数行入力対応。Ctrl-C(Interrupt)で適切に処理web/app.rb): Sinatraベース、5秒タイムアウト・サンドボックス環境・スレッドセーフ化済み/evalエンドポイントテスト・品質
string->numberradix 2/8/16、foldl/fold-left/foldr/fold-right引数順、let-values/let-syntax副作用が1回のみ実行されることbenchmarks/benchmark.rbに竹内関数・フィボナッチ・アッカーマン関数を収録CI/CD
ubuntu-latest/windows-latest/macos-latestの3環境でテスト。OSごとのスモークテストコマンドを分岐v*タグpushで自動リリースドキュメント(日本語・Mermaidダイアグラム付き)
docs/SOW.md— 作業指示書docs/ONBOARDING.md— 開発環境構築ガイド(Windows/PowerShell手順を含む)docs/TUTORIAL.md— 包括的なSchemeチュートリアル(26セクション、全仕様を実行可能コードで解説)docs/ADR/— アーキテクチャ決定記録(3件)docs/R5RS_COMPLIANCE.md— R5RS対応状況表(複素数未実装・call/cc制限を正確に反映)samples/— 10カテゴリ100以上のSchemeサンプルプログラム.github/copilot-instructions.md— AI エージェント向けインストラクションOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.