All Projects → brownplt → Pyret Lang

brownplt / Pyret Lang

Licence: other
The Pyret language.

Programming Languages

javascript
184084 projects - #8 most used programming language
language
365 projects

Projects that are alternatives of or similar to Pyret Lang

Mlton
The MLton repository
Stars: ✭ 683 (-11.41%)
Mutual labels:  compiler
Csharp.lua
The C# to Lua compiler
Stars: ✭ 712 (-7.65%)
Mutual labels:  compiler
Sakai
Sakai is a freely available, feature-rich technology solution for learning, teaching, research and collaboration. Sakai is an open source software suite developed by a diverse and global adopter community.
Stars: ✭ 729 (-5.45%)
Mutual labels:  education
Constexpr 8cc
Compile-time C Compiler implemented as C++14 constant expressions
Stars: ✭ 687 (-10.89%)
Mutual labels:  compiler
Teaching App Dev Swift
DEPRECATED. Instructor lesson plans that accompany Xcode projects, for guiding in-class experiential learning.
Stars: ✭ 699 (-9.34%)
Mutual labels:  education
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (-7.13%)
Mutual labels:  compiler
Tiny Compiler
A tiny evaluator and compiler of arithmetic expressions.
Stars: ✭ 680 (-11.8%)
Mutual labels:  compiler
Resources For Beginner Bug Bounty Hunters
A list of resources for those interested in getting started in bug bounties
Stars: ✭ 7,185 (+831.91%)
Mutual labels:  education
Inc
an incremental approach to compiler construction
Stars: ✭ 702 (-8.95%)
Mutual labels:  compiler
Tl
The compiler for Teal, a typed dialect of Lua
Stars: ✭ 716 (-7.13%)
Mutual labels:  compiler
Jscl
A Lisp-to-Javascript compiler bootstrapped from Common Lisp
Stars: ✭ 688 (-10.77%)
Mutual labels:  compiler
Carbon
🖤 Create and share beautiful images of your source code
Stars: ✭ 29,304 (+3700.78%)
Mutual labels:  education
Letswritecode
🎓 code examples for Let's Write Code
Stars: ✭ 717 (-7%)
Mutual labels:  education
Tiramisu
A polyhedral compiler for expressing fast and portable data parallel algorithms
Stars: ✭ 685 (-11.15%)
Mutual labels:  compiler
Learn Vim
Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.
Stars: ✭ 7,221 (+836.58%)
Mutual labels:  education
Esper
Esper Complex Event Processing, Streaming SQL and Event Series Analysis
Stars: ✭ 680 (-11.8%)
Mutual labels:  compiler
Open C Book
开源书籍:《C语言编程透视》,配套视频课程《360° 剖析 Linux ELF》已上线,视频讲解更为系统和深入,欢迎订阅:https://www.cctalk.com/m/group/88089283
Stars: ✭ 715 (-7.26%)
Mutual labels:  compiler
Caramel
🍬 a functional language for building type-safe, scalable, and maintainable applications
Stars: ✭ 756 (-1.95%)
Mutual labels:  compiler
Vtil Core
Virtual-machine Translation Intermediate Language
Stars: ✭ 738 (-4.28%)
Mutual labels:  compiler
Bic
A C interpreter and API explorer.
Stars: ✭ 719 (-6.74%)
Mutual labels:  compiler

Yarr

Build Status

A scripting language.

To learn about the language, visit pyret.org.

To read an introduction of the language, visit the tour.

To read the documentation, visit pyret.org/docs/.

There are two main ways to use Pyret:

  1. If all you want to do is program in Pyret, there is a web-based environment at code.pyret.org that lets you run and save programs that should be all you need. If you're a student using Pyret, this is probably where you will do your assignments, for example.

  2. If you want to develop Pyret, or install it for use at the command line, the README starting below is for you.

The use of vocabulary from http://bvipirate.com/piratespeak/index.html is recommended when commenting and reporting issues.

Installing

First, make sure you've installed Node >= 6. Then run:

$ npm install
$ make
$ make test

It'll build the Pyret compiler and run the tests.

Running Pyret

If you just want to run Pyret, visit the online environment and work from there. If you're interested in Pyret development, read on:

The easiest way to run a Pyret program from the command-line is:

$ ./src/scripts/phaseX <path-to-pyret-program-here> [command-line-args...]

Where X is 0, A, B, or C, indicating a phase (described below). For example:

$ ./src/scripts/phaseA src/scripts/show-compilation.arr examples/ahoy-world.arr

Alternatively, you can compile and run a standalone JavaScript file via:

$ node build/phaseX/pyret.jarr \
    --build-runnable <path-to-pyret-program-here> \
    --outfile <path-for-standalone-js> \
    --builtin-js-dir src/js/trove/ \
    --builtin-arr-dir src/arr/trove \
    --require-config src/scripts/standalone-configA.json
$ node <path-for-standalone-js>

Phases

Pyret is a self-hosted compiler, which means that building requires some thought. If you're going to get into the guts of the compiler, a brief overview is worth reading. The build directory is separated into four distinct phases.

  1. Phase 0 is a standalone JavaScript file that contains an entire compiled Pyret compiler and runtime. This large blob gets committed into version control whenever we add a nontrivial feature to the language. It is large and somewhat slow to load, but whatever is in build/phase0/pyret.jarr is currently the canonical new-world implementation of Pyret.

  2. Phase A is set up to be populated with built versions of all the files for the compiler, built by the phase 0 compiler. Phase A is what most of the testing scripts run against, since it is the easiest to create, and after it is built it is your development snapshot of the compiler you're working on. However, just building phase1 is not enough to fully re-boostrap the compiler, because it contains a mix of old-compiler output and any new changes that were made to runtime files.

  3. Phase B is set up to be populated with built versions of all the files for the compiler, built by the phase A compiler. This version does represent a fully-bootstrapped compiler. If you run make phaseB, you get a new standalone compiler in the same format as build/phase0/pyret.js.

  4. Phase C builds from phase B. One major use of phase C is to check the bootstrapped compiler from phase B. Before committing a new standalone in phase 0, build both phaseB and phaseC, and check:

    $ diff build/phaseB/pyret.jarr build/phaseC/pyret.jarr
    

    And it should be empty, which indicates that the bootstrapped compiler is at least correct enough to recompile itself without error.

    To rebuild the compiler and get a new phase0, run

    $ make new-bootstrap
    

    which will build the phaseB and phaseC standalones, check the diff, and copy to phase0 if the diff is empty.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].