{"id":14235378,"url":"https://github.com/Calysto/calysto_scheme","last_synced_at":"2025-08-10T23:31:25.952Z","repository":{"id":29496627,"uuid":"33034377","full_name":"Calysto/calysto_scheme","owner":"Calysto","description":"A Scheme kernel for Jupyter that can use Python libraries","archived":false,"fork":false,"pushed_at":"2023-09-08T22:53:43.000Z","size":8387,"stargazers_count":291,"open_issues_count":1,"forks_count":25,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-31T00:33:20.988Z","etag":null,"topics":["jupyter","programming-language","python","scheme"],"latest_commit_sha":null,"homepage":null,"language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Calysto.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-03-28T13:29:52.000Z","updated_at":"2025-07-27T05:55:27.000Z","dependencies_parsed_at":"2024-01-15T03:59:15.561Z","dependency_job_id":"93812cb3-f9b2-40fc-b715-19eda92575c8","html_url":"https://github.com/Calysto/calysto_scheme","commit_stats":{"total_commits":186,"total_committers":6,"mean_commits":31.0,"dds":"0.26344086021505375","last_synced_commit":"1db19318ed2420256667cfb852de0dc2d7227e2c"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Calysto/calysto_scheme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calysto%2Fcalysto_scheme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calysto%2Fcalysto_scheme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calysto%2Fcalysto_scheme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calysto%2Fcalysto_scheme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Calysto","download_url":"https://codeload.github.com/Calysto/calysto_scheme/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calysto%2Fcalysto_scheme/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269804862,"owners_count":24477872,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["jupyter","programming-language","python","scheme"],"created_at":"2024-08-20T21:01:50.331Z","updated_at":"2025-08-10T23:31:25.488Z","avatar_url":"https://github.com/Calysto.png","language":"Scheme","funding_links":[],"categories":["Python","Implementations"],"sub_categories":["Implemented in Python"],"readme":"# Calysto Scheme\n\nYou can try Calysto Scheme without installing anything by clicking on the following button:\n\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/Calysto/calysto_scheme/master?filepath=notebooks%2FReference%20Guide%20for%20Calysto%20Scheme.ipynb)\n\n**Calysto Scheme** is a real Scheme programming language, with full support for continuations, including call/cc. It can also use all Python libraries. Also has some extensions that make it more useful (stepper-debugger, choose/fail, stack traces), or make it better integrated with Python. For more details on using Calysto Scheme, see:\n\nhttp://nbviewer.jupyter.org/github/Calysto/calysto_scheme/blob/master/notebooks/Reference%20Guide%20for%20Calysto%20Scheme.ipynb\n\nIn Jupyter notebooks, because **Calysto Scheme** uses [MetaKernel](https://github.com/Calysto/metakernel/blob/master/README.rst), it has a fully-supported set of \"magics\"---meta-commands for additional functionality. This includes running Scheme in parallel. See all of the [MetaKernel Magics](https://github.com/Calysto/metakernel/blob/master/metakernel/magics/README.md).\n\nCalysto Scheme is written in Scheme, and then translated into Python (and other backends). The entire functionality lies in a single Python file: https://github.com/Calysto/calysto_scheme/blob/master/calysto_scheme/scheme.py However, you can easily install it (see below).\n\n**Calysto Scheme** in use:\n\n* [CS245: Programming Languages - 2014, Fall](https://jupyter.brynmawr.edu/services/public/dblank/CS245%20Programming%20Languages/2014-Fall/Programming%20Languages,%20Syllabus.ipynb)\n* [CS245: Programming Languages - 2016, Fall](https://jupyter.brynmawr.edu/services/public/dblank/CS245%20Programming%20Languages/2016-Fall/Syllabus.ipynb)\n* Videos: https://www.youtube.com/watch?v=2w-iO701g_w\n\n## Parallel Processing\n\nTo use Calysto Scheme in parallel, do the following:\n\n1. Make sure that the Python module `ipyparallel` is installed. In the shell, type:\n\n```\npip install ipyparallel\n```\n\n2. To enable the extension in the notebook, in the shell, type:\n\n```\nipcluster nbextension enable\n```\n\n3. To start up a cluster, with 10 nodes, on a local IP address, in the shell, type:\n\n```\nipcluster start --n=10\n```\n\nor listening on a specific address:\n\n```\nipcluster start --n=10 --ip=192.168.1.108\n```\n\n4. Initialize the code to use the 10 nodes, inside the notebook from a host kernel (can be any metakernel kernel), type:\n\n```\n%parallel calysto_scheme CalystoScheme\n```\n\n5. Run code in parallel, inside the notebook, type:\n\nExecute a single line, in parallel:\n\n```\n%px (+ 1 1)\n```\n\nOr execute the entire cell, in parallel:\n\n```\n%%px\n(* cluster_rank cluster_rank)\n```\n\nResults come back in a Scheme vector, in cluster_rank order. Therefore, the above would produce the result:\n\n```scheme\n#10(0 1 4 9 16 25 36 49 64 81)\n```\nYou can get the results back in the host Scheme by accessing the variable `_` (single underscore).\n\nNotice that you can use the variable `cluster_rank` to partition parts of a problem so that each node is working on something different.\n\nIn the examples above, use `-e` to evaluate the code in the host Scheme as well. Note that `cluster_rank` is not defined on the host machine, and that this assumes the host kernel is the same as the parallel machines.\n\nA full notebook example can be found here: [Mandelbrot.ipynb](https://github.com/Calysto/metakernel/blob/master/examples/Mandelbrot.ipynb)\n\n## Install\n\nEnsure that your system has `jupyter` installed, and `pyQt` and `qtconsole` if you want to use the `qtconsole` option. \n\nYou can install Calysto Scheme with Python3:\n\n```\npip3 install --upgrade calysto-scheme --user\npython3 -m calysto_scheme install --user\n```\n\nor in the system kernel folder with:\n\n```\nsudo pip3 install --upgrade calysto-scheme\nsudo python3 -m calysto_scheme install\n```\n\nYou can also use the --sys-prefix to install into your virtualenv.\n\nChange pip3/python3 to use a different pip or Python. The version of Python used will determine how Calysto Scheme is run.\n\nUse it in the Jupyter console, qtconsole, or notebook:\n\n```\njupyter console --kernel calysto_scheme\njupyter qtconsole --kernel calysto_scheme\njupyter notebook\n```\n\nYou can also just use the Python program, but it doesn't have a fancy Read-Eval-Print Loop. Just run:\n\n```\npython calysto_scheme/scheme.py\n```\n\n## Requires\n\n* Python3\n* metakernel (installed automatically)\n\nCalysto Scheme can also be un under PyPy for increased performance.\n\n## Features\n\nCalysto Scheme supports:\n\n* continuations\n* use of all Python libraries\n* choose/fail - built in fail and try again\n* produces stack trace (with line numbers), like Python\n* test suite\n\nPlanned:\n\n* Object-oriented class definitions and instance creation\n* complete Scheme functions (one can fall back to Python for now)\n\nLimitations:\n\n* Runs slow on CPython; try PyPy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCalysto%2Fcalysto_scheme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCalysto%2Fcalysto_scheme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCalysto%2Fcalysto_scheme/lists"}