GithubHelp home page GithubHelp logo

par's Introduction

#Par

Par is a stack-based language based on CJam and Pyth. Try it now.

Par is implemented in JavaScript and run entirely client-side. It has been tested well in Firefox and somewhat in Chrome, but does not work at all in Internet Explorer.

You can run the official test suite on your browser by visiting http://ypnypn.github.io/Par/tests.html.

##The encoding

Par uses less than 256 characters, from across the Unicode range.

On the website, you can simply type these characters from the keyboard, or use the buttons on the right of the page.

Alternatively, you can use a hex-editor on your computer, and then upload a .par file.

For example, the following hex file:

1a 02

refers to the twenty-seventh button on the webpage (9), followed by the third (!). This encodes the program 9!, which calculates 9 factorial, or 362880.

Thus, this encoding uses only one byte per character. A consequence of this is that only those characters on the webpage can be used in Par. For example, the tab character can not be used, even in string literals.

##The language

A Par program places values on the stack and performs operations on them.

There are three common datatypes - numbers, strings, and arrays.

Number literals mean what they are. If a literal starts with 0, the next character begins a new number. When following a number literal, and also begin new literals.

12 034₁5            -- pushes 12, 0, 34, 15

String literals begin and end with `, with \ used to escape. Single-character literals can be made with '.

`abc`'d`e\`\t\\f`   -- pushes "abc", "d", and "e`     \f"

Arrays can be created with the ( operator, Lisp-style.

(2 3`abc`())        -- pushes (2 3 abc ())

par's People

Contributors

catsarefluffy avatar ypnypn avatar

Watchers

 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.