Git Product home page Git Product logo

parsley's Introduction

parsley

Build Crates.io

what if scheme...but rust. still working on a backronym.

cargo install parsley installs the interpreter - see the docs if you want to use it as a library.

high-level goals

  1. a lightweight Scheme implementation...
  2. that compiles to WebAssembly...
  3. usable inside of a larger application without making too many sacrifices...
  4. that is modular and extensible...
  5. but includes enough definitions to be useful out of the box.

on the horizon

  • improve test coverage
    • More tests from SICP
    • Better coverage of the standard library
    • Example crates
  • (eventually) R7RS compliance

Navigating this repo

  • The source for the main library is in src.
  • The source for the cargo install-able binary is in src/bin/parsley.
  • The source for the (gh-pages) homepage is in examples/www.
    • To run (serve) or compile (build) it, cd into that directory and use trunk. Its output will be placed in ./examples/www/dist.
  • The source for the npm package is in examples/npm.
    • To compile it, use wasm-pack. Its output will be placed in examples/npm/pkg.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

parsley's People

Contributors

g-s-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

parsley's Issues

Implement arity checking at the primitive type level

Right now, each procedure is responsible for doing its own arity checking. This works in practice, but at worst it's easy to miss that when implementing one natively, and at best it results in boilerplate code across the board.

In addition, Scheme should provide the ability to reflect on arity at runtime, which is not possible in the current model.

We can solve both these problems by storing arity as a metadatum on a procedure primitive - not only can we build the check into the procedure call mechanism, but we can expose this information at runtime.

Procedure ergonomics

provide some utilities for writing procedures - destructuring/typechecking arguments, handling primitives, etc.

error type expressivity

right now, errors are a hot mess. they should do a better job of reflecting what has actually gone wrong, and we should provide a runtime mechanism for recovering for errors.

eliminate AsAtom

we can implement From<_> on Primitive and then a generic From<T> on SExp for each relevant type.

implement lexical closures

right now, lambdas and defines are not statically scoped - if you use a global var inside a function, then mutate it before actually calling the function, the new value is used instead of the old one. example:

> (define x 3)
> (define (y z) (+ z x))
> (y 4)
7
> (set! x 5)
> (y 4)
9

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.