{"id":15736792,"url":"https://github.com/sampsyo/lang-start","last_synced_at":"2025-03-13T07:32:16.429Z","repository":{"id":66788091,"uuid":"134164408","full_name":"sampsyo/lang-start","owner":"sampsyo","description":"skeleton for a language implementation in OCaml","archived":false,"fork":false,"pushed_at":"2019-06-08T18:23:26.000Z","size":11,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T19:07:20.387Z","etag":null,"topics":["example","interpreter","ocaml"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/sampsyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2018-05-20T15:51:18.000Z","updated_at":"2023-07-18T14:13:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"ada20552-f249-4441-acc3-267e1bd515c5","html_url":"https://github.com/sampsyo/lang-start","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampsyo%2Flang-start","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampsyo%2Flang-start/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampsyo%2Flang-start/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sampsyo%2Flang-start/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sampsyo","download_url":"https://codeload.github.com/sampsyo/lang-start/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243361386,"owners_count":20278560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["example","interpreter","ocaml"],"created_at":"2024-10-04T01:41:28.581Z","updated_at":"2025-03-13T07:32:16.424Z","avatar_url":"https://github.com/sampsyo.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"Starting an Interpreter in OCaml\n================================\n\nThis is a skeleton showing how to start writing a tiny interpreter in OCaml.\nIt just parses, pretty-prints, and evaluates a trivial arithmetic AST.\n\nTo build the project, you will need [Dune][] v1.10.0+.\nYou can install it using `opam install dune`.\n\nThere is one dependency: [Menhir][].\nIf you don't already have it, this will work to get it (or you can just do `opam install menhir`):\n\n    $ dune build @check  # Generate the OPAM file.\n    $ opam install . --deps-only\n\nYou can build the project and run an example in one step:\n\n    $ echo '8*(3+2)+2' | dune exec calc\n\nIf you just need to compile, use `dune build`.\nOr, to watch for changes and automatically rebuild, install [fswatch][] and then:\n\n    $ dune build --watch\n\nExplore the implementation in a [utop][] REPL:\n\n    $ opam install utop\n    $ dune utop src\n\nThis repository contains:\n\n* `src/`: The language implementation.\n    * `ast.ml`: An ADT for the language syntax.\n    * `parser.mly`: A [Menhir][] parser for expressions.\n    * `lexer.mll`: The [ocamllex][lexyacc] lexer for that parser.\n    * `ops.ml`: Functions to pretty-print and evaluate expressions.\n* `bin/calc.ml`: A tool that reads a program from standard input.\n* `dune-project`, `src/dune`, and `bin/dune`:\n  The build configuration for [Dune][].\n\n[dune]: https://github.com/ocaml/dune\n[menhir]: http://gallium.inria.fr/~fpottier/menhir/\n[lexyacc]: https://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html\n[utop]: https://github.com/diml/utop\n[fswatch]: https://github.com/emcrisostomo/fswatch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsampsyo%2Flang-start","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsampsyo%2Flang-start","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsampsyo%2Flang-start/lists"}