{"id":24775436,"url":"https://github.com/ashton314/mini_scheme","last_synced_at":"2025-10-08T10:19:53.999Z","repository":{"id":5626030,"uuid":"6833990","full_name":"ashton314/mini_scheme","owner":"ashton314","description":"A tiny implementation of the Scheme programming language: the core written in Perl, and the auxiliary functions written in Scheme itself. The interpreter uses the syntactic analysis method of evaluation outlined in \"Structure and Interpretation of Computer Programs\" (Sussman et al)","archived":false,"fork":false,"pushed_at":"2017-02-28T06:14:57.000Z","size":151,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-11T23:25:36.807Z","etag":null,"topics":["metacircular-interpreter","perl","scheme","scheme-interpreter","syntactic-analysis"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashton314.png","metadata":{"files":{"readme":"README.pod","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-23T22:41:18.000Z","updated_at":"2022-06-09T13:56:28.000Z","dependencies_parsed_at":"2022-07-07T11:04:31.050Z","dependency_job_id":null,"html_url":"https://github.com/ashton314/mini_scheme","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ashton314/mini_scheme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashton314%2Fmini_scheme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashton314%2Fmini_scheme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashton314%2Fmini_scheme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashton314%2Fmini_scheme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashton314","download_url":"https://codeload.github.com/ashton314/mini_scheme/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashton314%2Fmini_scheme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278926080,"owners_count":26069819,"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-10-08T02:00:06.501Z","response_time":56,"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":["metacircular-interpreter","perl","scheme","scheme-interpreter","syntactic-analysis"],"created_at":"2025-01-29T06:54:26.344Z","updated_at":"2025-10-08T10:19:53.948Z","avatar_url":"https://github.com/ashton314.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=head1 NAME\n\nMini Scheme -- A science project\n\n=head1 DESCRIPTION\n\nLoad syntactic analyzer implementation:\n\n  perl scheme.pl [-quiet] [-no-init] [-no-stats] [-echo-file \u003cfilename\u003e] [-load \u003cfilename\u003e] [-init-file \u003cfilename\u003e]\n\nLoad metacircular evaluator implementation:\n\n  perl metacircular.pl [-quiet] [-no-init] [-no-stats] [-echo-file \u003cfilename\u003e] [-load \u003cfilename\u003e] [-init-file \u003cfilename\u003e]\n\n=head1 BACKGROUND\n\nThis is for a science project that I am doing. The abstract of my project:\n\n=over 2\n\nB\u003cTitle\u003e\n\nStudying the Effects of a Syntactic Analyzer on Scheme Program Execution Time\n\nB\u003cIntroduction\u003e\n\nIn the MIT introductory book to computer programming, Structure and\nInterpretation of Computer Programs, the outline for a simple Scheme\ninterpreter is given. In following sections, enhancements are made to\nthis interpreter. One of the most radical changes to the interpreter\nis done by separating syntactic analysis of a Scheme expression from\nthe execution of the same. According to the authors, this greatly\nimproves execution times.\n\nThe purpose of this experiment is to study the effects of a syntactic\nanalyzer on run time. We believe that if a syntactic analyzer is used\nbefore evaluation of Scheme code, a great increase in speed will be\nobserved.\n\n=back\n\nFor the full, up-to-date lab report, see the doc/ directory in this\nproject.\n\n=head1 METACIRCULAR VS. SYNTACTIC ANALYZER\n\nIn chapter 4 of I\u003cStructure and Interpretation of Computer Programs\u003e,\nthe authors describe a simple scheme interpreter. In subsequent\nsections, enhancements are made to this interpreter. The two main\nversions of interpreters are \"metacircular\" interpreters and \"syntactic\nanalyzers\".\n\n=head2 METACIRCULAR\n\nTODO: Write how a metacircular evaluator works.\n\n=head2 SYNTACTIC ANALYZER\n\nTODO: Write how a syntactic analyzer works.\n\n=head1 CONTROL FLAGS\n\n=over 4\n\n=item quiet\n\nWhen this flag is present, load messages are silenced.\n\n=item no-init\n\nWhen this flag is present, the init file in F\u003cinit.scm\u003e is not loaded.\n\n=item no-stats\n\nWhen this flag present, memory statistics are suppressed.\n\n=item load\n\nTakes a filename and loads it immediately after loading the L\u003c/init file\u003e and printing the memory statistics.\n\n=item echo-file\n\nThis takes a file name to output memory statistics.\n\n=item init-file\n\nTakes a alternate L\u003c/init file\u003e to load. Default is F\u003cinit.scm\u003e in the working directory.\n\n=back\n\n=head1 KNOWN ISSUES\n\n=over 4\n\n=item *\n\nNo hygienic macro system.\n\n=item *\n\nThe numeric tower is not implemented. All number types are snarfed directly from Perl.\n\n=item *\n\nSTRING is a special form. This is purely for ease of implementation.\n\n=item *\n\nThe following features are adapted from CMU Common Lisp:\n\n=over 4\n\n=item *\n\nNIL is a symbol.\n\n=back\n\n=item *\n\nNo tail-call optimizations.\n\n=item *\n\nNext to no type checking.\n\n=item *\n\nNext to no error checking.\n\n=back\n\n=head1 FEATURES\n\n=over 4\n\n=item Init file\n\nThe default init file is init.scm in the working directory. An alternate file may be specified with the L\u003c/-init-file\u003e option.\n\n=item Lexical Addressing\n\nThis cut down my execution times by about 50%. Big win.\n\n=back\n\n=head1 FEATURES TO ADD\n\nWhen I get around to it, I'll try to add these things in:\n\n=over 4\n\n=item Debugger\n\nB\u003cBIG\u003e maybe.\n\n=back\n\n=head1 TODO\n\n=over 4\n\n=item *\n\nI think I could optimize memory in the following manner: because of\nsyntactic analysis, we can know what variables are going to be needed\nin a given expression. We can use this to do two things: warn the user\nwhen there is a variable that is not used, and optimize which\nvariables get saved in a closure environment.\n\n=item *\n\nI I\u003cmight\u003e be able to replace the Cons class with some more low-level\nmanaging of hashes. This might make it a bit more difficult to\ndistinguish between different data types, but it might make my data\nstructures operate a bit faster. I think I might be able to get a big\nspeed gain out of this.\n\n=back\n\n=head1 BUGS\n\n=over 4\n\n=item *\n\nDOTimes is not working in the metacircular interpreter. Big problem.\n\n=item *\n\nMacros are not inserted into the global enviroment. This allows for\nnamespace collision. If a symbol, defined as a macro, is defined as a\nfunction, the macro will be expanded, to the confusion of the\nprogrammer. Also, a symbol may be a variable without\nconflict.\n\nI could add checking for this in variable/function lookups,\ndefinitions, and assignments.\n\n=item *\n\nThe Cons package may have self-referential data structures, not\nallowing the garbage collector to reallocate memory so consumed.\n\n=item *\n\nToo slow. I'm looking for optimizations.\n\n=item *\n\nNIL really needs some clean-up.\n\n=item *\n\nBackquote does not handle dotted tail notation properly.\n\n=back\n\n=head1 AUTHOR\n\nAshton Wiersdorf \u003cashton.wiersdorf@mailblock.net\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashton314%2Fmini_scheme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashton314%2Fmini_scheme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashton314%2Fmini_scheme/lists"}