Giter Site home page Giter Site logo

s's Introduction

This is a baby Scheme interpreter in continuation-passing style with tail calls and call/cc. Written in CoffeeScript, compiled to JavaScript, runs in the browser.

The purpose of this exercise was to help me reach an intuitive understanding of continuations. My approach of structuring continuations as data structures rather than higher-order procedures is based on the ideas in Chapter 5 of Essentials of Programming Languages, 3rd ed.

The code here may be of interest to anyone else without a formal CS education but nonetheless curious about the nature of computing. It may also provide a good jumping-off point for anyone wishing to explore the following:

  • Graphical programming. Replace the parser with an HTML UI for composing source code and inspecting values.
  • Threading, concurrency, and scheduling. Adjust the interpreter's run method to implement green threads, or spawn web workers for multiprocessing.
  • Macros. Implement quasiquote, unquote, and unquote-splicing. Go all the way with R6RS hygienic macros.
  • Safe code execution. Bridge a safe subset of JavaScript with Scheme and embed it in your web application for third-party extensions.

© 2013 Sam Stephenson
MIT licensed

s's People

Contributors

sstephenson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.