{"id":13410623,"url":"https://github.com/Zaba505/sand","last_synced_at":"2025-03-14T16:32:36.074Z","repository":{"id":57496781,"uuid":"158134327","full_name":"Zaba505/sand","owner":"Zaba505","description":"Package for creating interpreters","archived":false,"fork":false,"pushed_at":"2018-11-21T19:13:47.000Z","size":46,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-31T20:43:28.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Zaba505.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}},"created_at":"2018-11-18T22:44:41.000Z","updated_at":"2024-04-24T18:25:44.000Z","dependencies_parsed_at":"2022-09-02T20:22:38.729Z","dependency_job_id":null,"html_url":"https://github.com/Zaba505/sand","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaba505%2Fsand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaba505%2Fsand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaba505%2Fsand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaba505%2Fsand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zaba505","download_url":"https://codeload.github.com/Zaba505/sand/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243610309,"owners_count":20318939,"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":[],"created_at":"2024-07-30T20:01:08.008Z","updated_at":"2025-03-14T16:32:35.766Z","avatar_url":"https://github.com/Zaba505.png","language":"Go","readme":"[![GoDoc](https://godoc.org/github.com/Zaba505/sand?status.svg)](https://godoc.org/github.com/Zaba505/sand)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Zaba505/sand)](https://goreportcard.com/report/github.com/Zaba505/sand)\n[![Build Status](https://travis-ci.com/Zaba505/sand.svg?branch=master)](https://travis-ci.com/Zaba505/sand)\n[![Code Coverage](https://img.shields.io/codecov/c/github/Zaba505/sand/master.svg)](https://codecov.io/github/Zaba505/sand?branch=master)\n\n# sand\n`sand` is for creating interpreters, like the Python interpreter and Haskell interpreter.\nIt can also be used for creating text based games and CLI test environments.\n\nFor examples, check out the [examples](https://github.com/Zaba505/sand/tree/master/example) folder.\n\n#### Design\n`sand` implements a concurrent model. It views an interpreter as two seperate components:\nthe User Interface, `sand.UI`, and the Command Processor,`sand.Engine`. The following\ndiagram shows how under the hood `sand` operates. Every square is a goroutine.\n\n```text\n+--------+                            +--------------------------+\n|        |              +-------------\u003e     Engines Manager      +--------------+\n|  Read  \u003c----------+   |             +--------------------------+              |\n|        |          |   |                                                       |\n+----+---+          |   |                                                       |\n     |            +-+---+------+                                        +-------v------+\n     |            |            |                                        |              |     +----------+\n     +------------\u003e     UI     |                                        |    Engine    |     |  Engine  |\n                  |  (usually  +----------------------------------------\u003e    Runner    +----\u003e+   Exec   |\n     +------------\u003e    main)   |                                        |              |     |          |\n     |            |            |      XXXXXXXXXXXXXXXXXXXXXXXXXXXX      |              |     +----------+\n     |            +-+----------+      X   Manager connects UI    X      +--------------+\n+----+---+          |                 X   to Engine Runner       X\n|        |          |                 XXXXXXXXXXXXXXXXXXXXXXXXXXXX\n| Write  \u003c----------+\n|        |\n+--------+\n\n```\n\n`sand.UI` is a `struct` that is provided for you and is implemented as broad as possible;\nhowever there are few features missing, which are commonly found in popular interpreters,\nnamely: Line history and Auto-completion. These features may be added later, but as for\nnow they are not planned for.\n\n`sand.Engine` is an `interface`, which must be implemented by the user. Implementations\nof `sand.Engine` must have a comparable underlying type, see [Go Spec](https://golang.org/ref/spec#Comparison_operators)\nfor comparable types in Go.","funding_links":[],"categories":["命令行","Command Line","命令行工具### 标准 CLI`用于创建一个标准命令行应用程序的库`","命令行工具","Build Automation"],"sub_categories":["标准CLI","Standard CLI","标准 CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZaba505%2Fsand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZaba505%2Fsand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZaba505%2Fsand/lists"}