Giter VIP home page Giter VIP logo

alicante's Introduction

Alicante

This repository contains the code for our concurrent GC implementations. Here's a guide to our file organization:

In src:

  1. compile.js contains the code for a Source -> SVML compiler.
  2. vm_*.js files contain different VMs with various GC implementations.
  3. merge_files.py is a Python script that can be run as python merge_files.py vm_[vm_file] to obtain a compiled_vm_X.js that contains the compiler and the respective VM. This is to facilitate testing in Source Academy (the online IDE for Source). (Note about this later)

A guide to the VM files:

  1. vm_classic_stop_world.js: A VM that runs instructions uninterrupted until it runs out of memory. Upon running out of memory, it stops the world, collects garbage via mark-and-sweep, and then continues running instructions.
  2. vm_aggro_stop_world.js: A VM with aggressive stop-the-world garbage collection. After running each instruction, it runs a complete mark-and-sweep to collect garbage. We use this to establish lower bounds of memory usage for test programs.
  3. vm_dijkstra_gc.js: A VM with the Dijkstra GC implementation

Setup

To install the dependencies to run the testsuite locally, run the following (after cloning the repo):

yarn install

Note that this might take a few minutes.

Testing:

For local testing

  1. To target vm_X.js, create a test directory called tests/vm_X
  2. In this test directory, add any tests in the form
P = parse_and_compile(`
[YOUR TEST PROGRAM]
`);

const DESIRED_HEAP_MEMORY = {add what you want};
initialize_machine(DESIRED_HEAP_MEMORY);
run();

(For the concurrent GC, you might want to try running with a custom interleaving. Check out the current test examples in vm_dijkstra_gc for an example of how to do that.)

  1. After this, run
yarn test

which will run all tests in each test directory and print the outputs in test-outputs with the same test folder structure. The outputs are logs of memory operations such as usage at each step, marking, appending, or stopping the world (as well as the actual output of the program).

For remote testing

Sometimes, the REPL run on the local test may prematurely detect infinite loops or infinite recursion and stop the program, even when there's no infinite loop. An alternative is to use the Source Academy playground - an online IDE for Source. Choose Source 4 as the language.

Then, use merge_files.py with an argument of your VM of choice. This, as mentioned before, gives you a file compiled_VM_x.js. Copy the contents of that file to the online IDE. Then, at the end, copy over the test code and run using the online IDE.

alicante's People

Contributors

jivesh avatar rahul0506 avatar github-classroom[bot] avatar

Watchers

 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.