Git Product home page Git Product logo

unlambda-rs's Introduction

unlambda

Build Status Docs Latest Version

It's a Rust unlambda interpreter that you can use as a library. The code is mostly okay, (by which I entirely mean it works, doesn't leak memory (AFAIK) and the API doesn't disgust me). But has way less documentation that I usually want to provide.

Anyway, this was written on a whim a while ago. I had intended to write a rust unlambda binary, and maybe I'll get to that but this project does nobody any good sitting in my ~/code folder. I'm trying to get the >90% projects out there and on to crates.io if they're any good at all, and so here we are.

Anyway, it's a little rough around the edges (some things I wouldn't do today), exposes more of it's guts than you might expect, and the docs for anything beyond the basics are almost non-existent.

That said, the important parts of the api are exposed at the top level, although essentially almost everything is pub. I mean, if you want to use write a program that evaluates unlambda and don't want to write the interpreter yourself, then there's no real need for me to hold stuff back that might get in your way? I don't know. It helps that unlambda is basically a fixed format and doesn't get updates, so barring bugfixes this is probably final-ish.

Example

let source = "`.!`.d`.l`.r`.o`.w`. `.,`.o`.l`.l`.e`.Hi";
// `unlambda::Input` is the "stdin", which can be a string,
// a file, actual stdin, ... It defaults to the empty string.
let input = unlambda::Input::default();
// Produces an error if we fail to parse, or if the
// unlambda program does some IO which itself produces an error.
let output = unlambda::eval_to_string(source, input)?;
assert_eq!(output, "Hello, world!");

License

This code is public domain, as explained [./LICENSE-CC0].

It's potentially worth noting that the Unlambda distribution itself is distributed under the GPL, but I don't belive I've done anything that would make that apply to this code.

unlambda-rs's People

Contributors

thomcc 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.