{"id":13779715,"url":"https://github.com/ingramj/bs","last_synced_at":"2025-05-11T13:30:59.612Z","repository":{"id":66844468,"uuid":"465648","full_name":"ingramj/bs","owner":"ingramj","description":"An interpreter for a simple Scheme-like language","archived":false,"fork":false,"pushed_at":"2010-05-13T14:01:23.000Z","size":174,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-08-03T18:14:19.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ingramj.png","metadata":{"files":{"readme":"README","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}},"created_at":"2010-01-09T23:15:43.000Z","updated_at":"2024-05-11T12:43:43.000Z","dependencies_parsed_at":"2023-02-20T12:40:34.184Z","dependency_job_id":null,"html_url":"https://github.com/ingramj/bs","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/ingramj%2Fbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingramj%2Fbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingramj%2Fbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingramj%2Fbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ingramj","download_url":"https://codeload.github.com/ingramj/bs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056726,"owners_count":17414192,"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":[],"created_at":"2024-08-03T18:01:08.419Z","updated_at":"2024-11-17T15:30:38.548Z","avatar_url":"https://github.com/ingramj.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"bs - A Basic Scheme Implementation\n==================================\nbs is an interpreter for a simple Scheme-like language. It lacks the more\nadvanced features of Scheme, such as macros and call/cc.\n\nThe goal of bs is to implement enough of Scheme to boostrap a Scheme compiler\nwritten in Scheme. A secondary goal is to learn about writing simple\ninterpreters.\n\nThis project was inspired by Peter Michaux's \"Scheme from Scratch\" project.\nhttp://peter.michaux.ca/articles/scheme-from-scratch-introduction\n\n\nUsage\n=====\n./bs file [-p]\nWhere \"file\" is either a Scheme source file, or a \"-\" to read from stdin.\n\"-p\" causes bs to print the result of every expression it evaluated.\n\nThere is a read-eval-print loop in the file bsrepl.scm. To use it, just run\n\"./bs bsrepl.scm\"\n\n\nFeatures Implemented\n====================\nData types:\n    integers\n    booleans\n    characters\n    strings\n    pairs and lists\n    ports\nSpecial Forms:\n    quote and '\n    define\n    set!\n    if\n    cond\n    lambda\n    let\n    begin\n    and\n    or\nPrimitives:\n    eq?\n    null?\n    boolean?\n    symbol?\n    integer?\n    char?\n    string?\n    pair?\n    list?\n    procedure?\n    input-port?\n    output-port?\n    eof-object?\n    +\n    -\n    *\n    quotient\n    remainder\n    =\n    \u003c\n    \u003e\n    cons\n    car\n    set-car!\n    cdr\n    set-cdr!\n    length\n    list\n    char-\u003einteger\n    integer-\u003echar\n    number-\u003estring\n    string-\u003enumber\n    symbol-\u003estring\n    string-\u003esymbol\n    current-input-port\n    current-output-port\n    open-input-file\n    open-output-file\n    close-input-port\n    close-output-port\n    read\n    read-char\n    write\n    write-char\n    display\n    stdin-port\n    stdout-port\n    load\n    error\n    apply\n    eval\n    interaction-environment\n    null-environment\n    environment\nIn stdlib.scm:\n    number?\n    map\n    for-each\n    fold-right\n    fold-left\n    reverse\n    append\n    not\n    newline\n    call-with-input-file\n    call-with-output-file\n    caar, cddr, etc.\n\n\nCompilation\n============\nTo build bs, you'll need libgc and scons. Assuming you already have gcc\ninstalled, you can install the neccessary packages on a Debian-based system\nwith this command:\n\n    $ sudo apt-get install libgc-dev scons\n\nThen type \"scons\" in the project directory to build bs.\n\nIf you are using a non-Debian-based system, or a different compiler, you'll\nprobably need to edit the SConstruct file.\n\nThere is a simple test script in the tests/ directory. Look at the comments at\nthe top of run-tests.sh for details.\n\nSee the LICENSE file for copyright and licensing information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingramj%2Fbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fingramj%2Fbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingramj%2Fbs/lists"}