{"id":13709169,"url":"https://github.com/hmgle/yascm","last_synced_at":"2025-05-05T04:31:30.516Z","repository":{"id":146618368,"uuid":"38200046","full_name":"hmgle/yascm","owner":"hmgle","description":"Yet Another Scheme Interpreter using flex and bison","archived":false,"fork":false,"pushed_at":"2022-09-16T00:20:43.000Z","size":144,"stargazers_count":50,"open_issues_count":3,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-08T17:05:20.213Z","etag":null,"topics":["bison","flex","lisp-interpreter","scheme-interpreter"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmgle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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-06-28T13:37:12.000Z","updated_at":"2025-02-27T17:28:49.000Z","dependencies_parsed_at":"2023-05-10T22:00:42.801Z","dependency_job_id":null,"html_url":"https://github.com/hmgle/yascm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmgle%2Fyascm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmgle%2Fyascm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmgle%2Fyascm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmgle%2Fyascm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmgle","download_url":"https://codeload.github.com/hmgle/yascm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252439719,"owners_count":21748059,"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":["bison","flex","lisp-interpreter","scheme-interpreter"],"created_at":"2024-08-02T23:00:36.445Z","updated_at":"2025-05-05T04:31:30.097Z","avatar_url":"https://github.com/hmgle.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# yascm\n\n[![Build Status](https://travis-ci.org/hmgle/yascm.png?branch=master)](https://travis-ci.org/hmgle/yascm)\n\nYet Another Scheme Interpreter.\n\n## Building\n\nThe following packages need to install before build:\n\n- flex\n- bison\n\nDebian/Ubuntu Installation:\n\n```\nsudo apt-get install flex bison\n```\n\nThen run the following:\n\n```\ngit clone https://github.com/hmgle/yascm.git\ncd yascm\nmake\n```\n\nIf having trouble installing flex/bison, or you don't want to install flex/bison, you can clone the no-flex-bison branch:\n\n```\ngit clone -b no-flex-bison https://github.com/hmgle/yascm.git\ncd yascm\nmake\n```\n\n## Examples\n\n- Recursion\n\n```\n$ ./yascm\nwelcome\n\u003e (define (sum x)\n    (if (= 0 x) 0 (+ x (sum (- x 1)))))\n; ok\n\u003e (sum 10000)\n50005000\n\u003e\n```\n\n- Closure\n\n```\n$ ./yascm\nwelcome\n\u003e (define (add a)\n    (lambda (b) (+ a b)))\n; ok\n\u003e (define add3 (add 3))\n; ok\n\u003e (add3 4)\n7\n\u003e (define my-counter\n    ((lambda (count)\n       (lambda ()\n         (set! count (+ count 1))\n         count))\n     0)\n  )\n; ok\n\u003e (my-counter)\n1\n\u003e (my-counter)\n2\n\u003e (my-counter)\n3\n\u003e\n```\n\n- [Man or boy test](https://en.wikipedia.org/?title=Man_or_boy_test)\n\n```\n$ ./yascm\nwelcome\n\u003e (define (A k x1 x2 x3 x4 x5)\n    (define (B)\n      (set! k (- k 1))\n      (A k B x1 x2 x3 x4))\n    (if (\u003e 1 k)\n        (+ (x4) (x5))\n        (B)))\n; ok\n\u003e (A 10 (lambda () 1) (lambda () -1) (lambda () -1) (lambda () 1) (lambda () 0))\n-67\n\u003e \n```\n\n- [Y combinator](http://rosettacode.org/wiki/Y_combinator#Scheme)\n\n```\n$ ./yascm\n; loading stdlib.scm\n; done loading stdlib.scm\nwelcome\n\u003e (define Y\n    (lambda (h)\n      ((lambda (x) (x x))\n       (lambda (g)\n         (h (lambda args (apply (g g) args)))))))\n; ok\n\u003e (define fib\n    (Y\n      (lambda (f)\n        (lambda (x)\n          (if (\u003e 2 x)\n              x\n              (+ (f (- x 1)) (f (- x 2))))))))\n; ok\n\u003e (fib 10)\n55\n```\n\n- [The Metacircular Evaluator](https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-26.html#%_sec_4.1)\n\n```\n$ ./yascm \n; loading stdlib.scm\n; done loading stdlib.scm\nwelcome\n\u003e (load \"examples/mceval.scm\")\n; loading examples/mceval.scm\n; done loading examples/mceval.scm\n; ok\n\u003e (driver-loop)\n\n;;; M-Eval input:\n(define fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1))))))\n\n;;; M-Eval value:\nok\n\n;;; M-Eval input:\n(fact 5)\n\n;;; M-Eval value:\n120\n```\n\n- [Quine](https://en.wikipedia.org/wiki/Quine_%28computing%29)\n\n```\n$ ./yascm \n; loading stdlib.scm\n; done loading stdlib.scm\nwelcome\n\u003e ((lambda (x)\n      (list x (list (quote quote) x)))\n    (quote\n      (lambda (x)\n        (list x (list (quote quote) x)))))\n```\n\n## Testing\n\n```\n$ make test\n```\n\n## Authors\n\n- Created by hmgle \u003cdustgle@gmail.com\u003e\n- [Contributors](https://github.com/hmgle/yascm/graphs/contributors)\n\n## LICENSE\n\nGPL Version 3, see the [COPYING](COPYING) file included in the source distribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmgle%2Fyascm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmgle%2Fyascm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmgle%2Fyascm/lists"}