{"id":14235979,"url":"https://github.com/tizoc/shen-scheme","last_synced_at":"2026-01-19T03:32:41.382Z","repository":{"id":3991800,"uuid":"5088338","full_name":"tizoc/shen-scheme","owner":"tizoc","description":"Shen/Scheme implementation","archived":false,"fork":false,"pushed_at":"2024-08-11T21:44:40.000Z","size":916,"stargazers_count":107,"open_issues_count":8,"forks_count":9,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-02-10T02:45:27.282Z","etag":null,"topics":["chez","lisp","scheme","shen","shen-language","shen-scheme"],"latest_commit_sha":null,"homepage":"","language":"Shen","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tizoc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-OLD","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":"2012-07-17T21:28:01.000Z","updated_at":"2025-02-04T11:43:18.000Z","dependencies_parsed_at":"2024-01-14T00:49:01.489Z","dependency_job_id":"26c2046f-cb83-4f1a-8143-4d8bed091329","html_url":"https://github.com/tizoc/shen-scheme","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizoc%2Fshen-scheme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizoc%2Fshen-scheme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizoc%2Fshen-scheme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizoc%2Fshen-scheme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tizoc","download_url":"https://codeload.github.com/tizoc/shen-scheme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217831,"owners_count":20903147,"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":["chez","lisp","scheme","shen","shen-language","shen-scheme"],"created_at":"2024-08-20T21:02:36.458Z","updated_at":"2026-01-19T03:32:41.373Z","avatar_url":"https://github.com/tizoc.png","language":"Shen","funding_links":[],"categories":["Shen"],"sub_categories":[],"readme":"[![Shen Version](https://img.shields.io/badge/shen-40.0-blue.svg)](https://github.com/Shen-Language)\n[![build](https://github.com/tizoc/shen-scheme/workflows/build/badge.svg)](https://github.com/tizoc/shen-scheme/actions?query=workflow%3Abuild)\n\nShen/Scheme, a Scheme port of the Shen language\n====================================================\n\n* [Shen](https://shen-language.github.io/)\n* [chez-scheme](https://cisco.github.io/ChezScheme)\n* [shen-scheme](https://github.com/tizoc/shen-scheme)\n\nShen is a portable functional programming language by [Mark Tarver](http://marktarver.com) that offers\n\n- pattern matching,\n- λ calculus consistency,\n- macros,\n- optional lazy evaluation,\n- static type checking,\n- an integrated fully functional Prolog,\n- and an inbuilt compiler-compiler.\n\nshen-scheme is a port of the Shen language that runs on top of Sheme implementations.\n\nRight now the following implementations are supported:\n\n* [chez-scheme](https://cisco.github.io/ChezScheme)\n\nThe following implementations were supported in version 0.15, but are not supported since version 0.16. Support may be added back in future releases.\n\n* [chibi-scheme](http://synthcode.com/wiki/chibi-scheme)\n* [gauche](http://practical-scheme.net/gauche/)\n\nBinaries\n--------\n\nStarting with version 0.18, binaries are provided for Windows, Linux and OSX. See [releases](https://github.com/tizoc/shen-scheme/releases).\n\nOSX users can also use homebrew to install Shen/Scheme:\n\n```\n$ brew install Shen-Language/homebrew-shen/shen-scheme\n==\u003e Installing shen-language/shen/shen-scheme\n==\u003e Downloading https://github.com/tizoc/shen-scheme/releases/download/0.17/shen-scheme-0.17-src.tar.gz\nAlready downloaded: /Users/bruno/Library/Caches/Homebrew/shen-scheme-0.17.tar.gz\n==\u003e Downloading https://github.com/cisco/ChezScheme/archive/v9.5.tar.gz\nAlready downloaded: /Users/bruno/Library/Caches/Homebrew/shen-scheme--chezscheme-9.5.tar.gz\n==\u003e make install prefix=/usr/local/Cellar/shen-scheme/0.17\n  /usr/local/Cellar/shen-scheme/0.17: 7 files, 2.8MB, built in 1 minute 16 seconds\n```\n\nBuilding\n--------\n\n### Building from the source distribution\n\n\u003e **IMPORTANT:** Download the release asset named `shen-scheme-\u003cversion\u003e-src.tar.gz` from\n\u003e the [Releases](https://github.com/tizoc/shen-scheme/releases) page. Do **not** use the\n\u003e GitHub-generated \"Source code\" tarball/zip — it is missing the pre-generated `.scm` files.\n\nRunning `make` should do the job. It will download and compile Chez under the `_build` directory, and then the `shen-scheme` binary and `shen.boot` boot files.\n\n    make prefix=/opt/shen-scheme # optional prefix, defaults to /usr/local\n\nthen to install:\n\n    make install\n\nThis will install the `shen-scheme` binary to `$(prefix)/bin/shen-scheme` and the boot file to `$(prefix)/lib/shen-scheme/shen.boot`.\n\nTo build on Windows, an environment with curl, 7zip, make and Visual Studio 2017 is needed (all installable with [chocolatey](https://chocolatey.org/)).\n\n### Building from scratch\n\nThis step is only necessary if cloning from this repository, the release tarballs include pregenerated `.scm` files.\n\nTo build from source, obtain a [copy of the Shen kernel distribution](https://github.com/Shen-Language/shen-sources/releases) and copy the `.kl` files to the `kl/` directory of shen-scheme. Then with a working Shen implementation do:\n\n    (load \"scripts/build.shen\")\n    (build program \"shen-scheme.scm\")\n\nThis will produce `.scm` files in the `compiled/` directory and a `shen-scheme.scm` file in the current directory.\n\nAfter doing this the procedure is the same as building from the source distribution.\n\nRunning\n-------\n\n`shen-scheme` will start the Shen REPL.\n`shen-scheme script \u003csome shen file\u003e` will run a script.\n`shen-scheme eval \u003cshen expression\u003e` will evaluate an expression.\n\nHome and Boot file search path\n------------------------------\n\nShen/Scheme will use as its *home directory* a path relative to the executable: `../lib/shen-scheme`.\nFor example, if the executable is `/usr/local/bin/shen-bin` then the *home directory* will be `/usr/local/lib/shen-scheme`.\nThis can be overriden by the `SHEN_SCHEME_HOME` environment variable.\n\nBy default, the boot file will be loaded from `\u003cshen-scheme-home\u003e/shen.boot`, but the location can be overriden with the `SHEN_SCHEME_BOOT` environment variable.\n\nNative Calls\n------------\n\nScheme functions live under the `scm` namespace (`scm.` prefix), and the names need to be wrapped with the `foreign` form in calls. For example: `((foreign scm.write) [1 2 3 4])` invokes Scheme's `write` function with a list as an argument.\n\nBecause Scheme functions can have variable numbers of arguments and the code passed to `scm.` is not preprocessed, any imported function that is intended to support partial application has to be wrapped with a `defun`:\n\n```\n(0-) (defun my-for-each (F L) ((foreign scm.for-each) F L))\nmy-for-each\n\n(1-) (my-for-each (/. X (do (print (+ X X)) (nl))) [1 2 3 4 5])\n2\n4\n6\n8\n10\n0\n\n(2-) (my-for-each (function print))\n#\u003cprocedure\u003e\n```\n\nLiteral Scheme Code\n-------------------\n\nScheme code can be compiled as-is with the `scm.` special form that takes a string with Scheme code as an argument.\n\nExample:\n\n```\n(0-) ((foreign scm.) \"(+ 1 2)\")\n3\n\n(1-) ((foreign scm.) \"(begin (display c#34;testc#34;) (newline))\")\ntest\n#\u003cvoid\u003e\n\n(2-) ((foreign scm.) \"(list #t #f (quote symbol) 'symbol)\")\n[true false symbol symbol]\n```\n\nImporting bindings from Scheme modules\n--------------------------------------\n\n[import expressions](https://cisco.github.io/ChezScheme/csug9.5/libraries.html#./libraries:h4) are supported through the `scm.` prefix. Names will be imported under the `scm.` namespace.\n\nExample:\n\n    (1-) ((foreign scm.import) (rename (rnrs) (+ add-numbers)))\n    #\u003cvoid\u003e\n\n    (2-) ((foreign scm.add-numbers) 1 2 3 4)\n    10\n\nLicense\n-------\n\n- Shen, Copyright © 2010-2022 Mark Tarver - [License](http://www.shenlanguage.org/license.pdf).\n- shen-scheme, Copyright © 2012-2023 Bruno Deferrari under [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftizoc%2Fshen-scheme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftizoc%2Fshen-scheme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftizoc%2Fshen-scheme/lists"}