{"id":13782716,"url":"https://github.com/iafisher/scam","last_synced_at":"2025-05-11T16:31:07.991Z","repository":{"id":118783370,"uuid":"106976906","full_name":"iafisher/scam","owner":"iafisher","description":"A toy functional programming language: Scheme, but on a budget","archived":true,"fork":false,"pushed_at":"2018-07-10T00:43:24.000Z","size":576,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T06:50:26.411Z","etag":null,"topics":["interpreter","lisp","programming-language"],"latest_commit_sha":null,"homepage":null,"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/iafisher.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}},"created_at":"2017-10-15T02:09:45.000Z","updated_at":"2023-01-28T16:46:39.000Z","dependencies_parsed_at":"2023-03-27T11:19:03.029Z","dependency_job_id":null,"html_url":"https://github.com/iafisher/scam","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/iafisher%2Fscam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iafisher%2Fscam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iafisher%2Fscam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iafisher%2Fscam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iafisher","download_url":"https://codeload.github.com/iafisher/scam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253595534,"owners_count":21933407,"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":["interpreter","lisp","programming-language"],"created_at":"2024-08-03T18:01:42.508Z","updated_at":"2025-05-11T16:31:07.702Z","avatar_url":"https://github.com/iafisher.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Scam\n\nA toy functional programming language. Inspired by [SICP](https://mitpress.mit.edu/sicp/full-text/book/book.html) and [Build Your Own Lisp](http://www.buildyourownlisp.com/).\n\n\n## Language features\n\nAll the regular Scheme stuff:\n\n```racket\n\u003e\u003e\u003e (+ 1 1)\n2\n\u003e\u003e\u003e (define x \"Hello, world\")\n\u003e\u003e\u003e x\n\"Hello, world\"\n\u003e\u003e\u003e (define (square x) (* x x))\n\u003e\u003e\u003e (square 9)\n81\n```\n\nFirst-class functions:\n\n```racket\n\u003e\u003e\u003e (map square (list 1 2 3))\n[1 4 9]\n\u003e\u003e\u003e ((lambda (x y) (+ x y)) 47 53)\n100\n```\n\nLists (actually, dynamic arrays) and dictionaries, with a convenient syntax inspired by Python:\n\n```racket\n\u003e\u003e\u003e (concat [\"Scheme\" \"Racket\" \"Common Lisp\" \"Clojure\"] [\"Scam\"])\n[\"Scheme\" \"Racket\" \"Common Lisp\" \"Clojure\" \"Scam\"]\n\u003e\u003e\u003e (define dct {1:\"one\"  2:\"two\"})\n\u003e\u003e\u003e (get dct 1)\n\"one\"\n```\n\nLexical closures:\n\n```racket\n\u003e\u003e\u003e (define (make-fun x) (lambda (y) (+ x y)))\n\u003e\u003e\u003e (define inc-by-10 (make-fun 10))\n\u003e\u003e\u003e (inc-by-10 30)\n40\n```\n\n## How to compile\n\nAt present this project is highly non-portable. It will most likely only work with gcc, possibly only on Ubuntu. At a minimum, you will need to install readline, Flex and Bison. On Ubuntu this can be done with\n\n```\n$ sudo apt-get install libreadline6 libreadline6-dev flex bison\n```\n\nIt is recommended you install [valgrind](http://valgrind.org/) (to run the test suite) and a LaTeX compiler (to read the docs), but these are not strictly necessary to compile the project.\n\nOnce these dependencies have been satisfied, simply run `make` in the root directory. An executable file `scam` will be created, which starts a REPL if run with no arguments. If you have valgrind installed, you can use the `test_all.sh` script to run the test suite.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiafisher%2Fscam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiafisher%2Fscam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiafisher%2Fscam/lists"}