{"id":13513425,"url":"https://github.com/ruby/prism","last_synced_at":"2026-03-17T12:14:43.190Z","repository":{"id":65033052,"uuid":"538556964","full_name":"ruby/prism","owner":"ruby","description":"Prism Ruby parser","archived":false,"fork":false,"pushed_at":"2026-01-09T12:40:54.000Z","size":21388,"stargazers_count":970,"open_issues_count":26,"forks_count":176,"subscribers_count":161,"default_branch":"main","last_synced_at":"2026-01-11T16:57:09.184Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ruby.github.io/prism/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-19T15:00:03.000Z","updated_at":"2026-01-11T16:24:53.000Z","dependencies_parsed_at":"2023-10-13T05:56:24.294Z","dependency_job_id":"87b4ea6f-578e-45c8-a374-befb858a45c8","html_url":"https://github.com/ruby/prism","commit_stats":null,"previous_names":["shopify/yarp","ruby/yarp"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/ruby/prism","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fprism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fprism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fprism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fprism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/prism/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fprism/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:00:24.801Z","updated_at":"2026-01-16T05:00:58.235Z","avatar_url":"https://github.com/ruby.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePrism Ruby parser\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"Prism Ruby parser\" height=\"256px\" src=\"https://github.com/ruby/prism/blob/main/doc/images/prism.png?raw=true\"\u003e\n\u003c/div\u003e\n\nThis is a parser for the Ruby programming language. It is designed to be portable, error tolerant, and maintainable. It is written in C99 and has no dependencies.\n\n## Overview\n\nThe repository contains the infrastructure for both a shared library (libprism) and a native CRuby extension. The shared library has no bindings to CRuby itself, and so can be used by other projects. The native CRuby extension links against `ruby.h`, and so is suitable in the context of CRuby.\n\n```\n.\n├── Makefile              configuration to compile the shared library and native tests\n├── Rakefile              configuration to compile the native extension and run the Ruby tests\n├── bin\n│   ├── lex               runs the lexer on a file or string, prints the tokens, and compares to ripper\n│   ├── parse             runs the parse on a file or string and prints the AST\n│   └── prism             a CLI for development and debugging\n├── config.yml            specification for tokens and nodes in the tree\n├── doc                   documentation website\n├── docs                  markdown documentation about the project\n├── ext\n│   └── prism\n│       ├── extconf.rb    configuration to generate the Makefile for the native extension\n│       └── extension.c   the native extension that interacts with libprism\n├── fuzz                  files related to fuzz testing\n├── gemfiles              gemfiles used by different Ruby versions in CI\n├── include\n│   ├── prism             header files for the shared library\n│   └── prism.h           main header file for the shared library\n├── java                  Java bindings for the shared library\n├── java-wasm             Java WASM bindings for the shared library\n├── javascript            JavaScript WASM bindings for the shared library\n├── lib\n│   ├── prism             Ruby library files\n│   └── prism.rb          main entrypoint for the Ruby library\n├── rakelib               various Rake tasks for the project\n├── rbi                   RBI type signatures for the Ruby library\n├── rust\n│   ├── ruby-prism        Rustified crate for the shared library\n│   └── ruby-prism-sys    FFI binding for Rust\n├── sample\n│   └── prism             Sample code that uses the Ruby API for documentation purposes\n├── sig                   RBS type signatures for the Ruby library\n├── src\n│   ├── util              various utility files\n│   └── prism.c           main entrypoint for the shared library\n├── templates             contains ERB templates generated by templates/template.rb\n│   └── template.rb       generates code from the nodes and tokens configured by config.yml\n└── test\n    └── prism\n        ├── fixtures      Ruby code used for testing\n        └── snapshots     snapshots of generated syntax trees corresponding to fixtures\n```\n\n## Getting started\n\nTo compile the shared library, you will need:\n\n* C99 compiler\n* GNU make\n* Ruby 2.7.0 or later\n\nOnce you have these dependencies, run:\n\n```\nbundle install\n```\n\nto fetch the Ruby dependencies. Finally, run:\n\n```\nbundle exec rake compile\n```\n\nto compile the shared library. It will be built in the `build` directory. To test that everything is working, run:\n\n```\nbin/parse -e \"1 + 2\"\n```\n\nto see the syntax tree for the expression `1 + 2`.\n\n## Contributing\n\nSee the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information. We additionally have documentation about the overall design of the project as well as various subtopics.\n\n* [Build system](docs/build_system.md)\n* [Configuration](docs/configuration.md)\n* [CRuby compilation](docs/cruby_compilation.md)\n* [Design](docs/design.md)\n* [Encoding](docs/encoding.md)\n* [Fuzzing](docs/fuzzing.md)\n* [Heredocs](docs/heredocs.md)\n* [JavaScript](docs/javascript.md)\n* [Local variable depth](docs/local_variable_depth.md)\n* [Mapping](docs/mapping.md)\n* [Parser translation](docs/parser_translation.md)\n* [Parsing rules](docs/parsing_rules.md)\n* [Releasing](docs/releasing.md)\n* [Ripper translation](docs/ripper_translation.md)\n* [Ruby API](docs/ruby_api.md)\n* [RubyParser translation](docs/ruby_parser_translation.md)\n* [Serialization](docs/serialization.md)\n* [Testing](docs/testing.md)\n\n## Examples\n\nPrism has been integrated into the majority of Ruby runtimes, many libraries, and some applications. Below is a list of some of the projects that use Prism:\n\n### Runtimes\n\n* [CRuby](https://github.com/ruby/ruby/pull/7964) (via C)\n* [Garnet](https://github.com/camertron/garnet-js) (via WASM)\n* [JRuby](https://github.com/jruby/jruby/pull/8103) (via Java)\n* [Natalie](https://github.com/natalie-lang/natalie/pull/1213) (via C++ and Ruby)\n* [Opal](https://github.com/opal/opal/pull/2642) (via Ruby and WASM)\n* [TruffleRuby](https://github.com/truffleruby/truffleruby/issues/3117) (via Java)\n\n### Libraries\n\n* [dispersion](https://github.com/joeldrapper/dispersion)\n* [minifyrb](https://github.com/koic/minifyrb)\n* [packwerk](https://github.com/Shopify/packwerk/pull/388) (via parser translator)\n* [rbi](https://github.com/Shopify/rbi)\n* [rails](https://github.com/rails/rails)\n  * [parsing renders](https://github.com/rails/rails/pull/49438)\n  * [parsing rdoc](https://github.com/rails/rails/pull/50870)\n  * [parsing tests](https://github.com/rails/rails/pull/51006)\n* [repl_type_completor](https://github.com/ruby/repl_type_completor)\n* [rubocop](https://docs.rubocop.org/rubocop/configuration.html#setting-the-parser-engine) (via parser translator)\n* [ruby-lsp](https://github.com/Shopify/ruby-lsp)\n* [smart_todo](https://github.com/Shopify/smart_todo/pull/69)\n* [sorbet-eraser](https://github.com/kddnewton/sorbet-eraser/pull/25)\n* [synvert](https://github.com/xinminlabs/synvert-core-ruby)\n* [typeprof](https://github.com/ruby/typeprof)\n* [unparser](https://github.com/mbj/unparser) (via parser translator)\n\n### Applications\n\n* [gem.sh](https://github.com/marcoroth/gem.sh/pull/96)\n* [Sorbet](https://github.com/sorbet/sorbet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fprism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fprism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fprism/lists"}