Giter Site home page Giter Site logo

cloudxtreme / rsqueak Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hpi-swa/rsqueak

0.0 1.0 0.0 676.52 MB

A Squeak VM written in RPython

License: BSD 3-Clause "New" or "Revised" License

Batchfile 0.16% PowerShell 0.19% Python 98.44% Shell 0.95% Smalltalk 0.01% C++ 0.05% C 0.04% Objective-C 0.16%

rsqueak's Introduction

RSqueak/VM

A Squeak VM written in RPython.

Prebuilt binaries

We also built for Armv7 (Raspberry Pi2, Beagleboard, ...) and Armv6 on the Raspberry Pi 1:

Finding a working image

Although RSqueak can load images starting with Squeak 2, many primitives are not implemented and instead rely on in-image fallback code to be available and correct. This is why only a Trunk image of Squeak with the latest version of the main VMMaker branch fully works.

If you do not wish to prepare your own image, we regularily upload development images here. Be sure to grab also the relevant changes and sources files.

Building from Source

Common to all systems

We have scripts for installing dependencies, building, running the unit tests, and running JIT tests in the .build subdirectory. You need the PyPy source tree, and the rsdl source tree. If you already have all these, run .build/build.py. It will generate a config file .build/buildconfig.ini where you can set your paths. You can also run .build/download_dependencies.py to download the dependencies automatically. You will also need a Python and a C compiler for 32-bit compilation.

Windows

On Windows, you will have to use the C compiler that comes with Visual Studio 2008, because newer ones crash the JIT. It suffices to just install the Microsoft C compiler V90 plus Windows SDK 7. The packages provided in the link install it to the default paths. If you already have the compiler and SDK, you can also just update the paths in .build/buildconfig.ini.

Linux

RSqueak/VM currently needs to be compiled using a 32-bit python and 32-bit libraries for everything. The easiest way to ensure that is to use a chroot, but you can also install the :i386 version of SDL 1.2 for your distro. In any case, you'll need to install SDL 1.2. On 32-bit Debian-derivatives, this can be achieved by running

apt-get install libsdl1.2-dev

If you're on a 64-bit Debian-derivative, this might work:

apt-get install libsdl1.2-dev:i386 binfmt-support

Optionally you can also install FLTK-1.3 if you want to compile a fallback file chooser when the VM is launched without image argument:

apt-get install libfltk1.3-dev
Mac OS X

RSqueak/VM currently needs to be compiled using a 32-bit python and 32-bit clang. To do so, run

export VERSIONER_PYTHON_PREFER_32_BIT=yes

before you run any of the python scripts in the .build directory. You also need to download SDL-1.2 as a framework (homebrew version is not tested). Check the .travis/build-osx.sh if you get stuck anywhere.

Developing

The .build directory includes several scripts that make development easier. Once you've setup your system for building, you can use these to work on the RSqueak/VM.

run.py

This script executes RSqueak/VM in hosted mode, that is, it runs on top of a Python interpreter. This is very slow (we recommend using PyPy), but it can be useful to debug specific aspects of the VM quickly. Ideally, you set up an image so that it executes the code that you are interested in early during startup (DisplayScreen class>>startUp is a good candidate) and then you add your breakpoints to the source. You can also pass commandline arguments to the script or tweak the default arguments in the script itself.

unittests.py

The second script that is useful for working on issues regarding the interpreter is unittests.py. By default it runs all tests under the spyvm/test directory (but not those in spyvm/test/jittest/). This is a standalone pytest script, so you can pass arguments or select single test files as you would for pytest.

jittests.py

This script requires that you have already built an rsqueak binary and that you have the C Squeak VM installed. It executes the tests in spyvm/test/jittest/ and checks for the JIT output. We use these tests to ensure that development on the VM does not break JIT optimizations.

jit.py

This script is useful to figure out what the JIT is doing. Like run.py, it executes the RSqueak/VM in hosted mode, but this time it also simulates the JIT. This is even slower, but allows us to test small code snippets without having to retranslate the entire VM. The code snippets are configured directly in the file. When you run it, it does part of the translation process (but only enough to execute your specific code) and then runs the code. When the JIT kicks in, the compiled loop is shown in a PyGame window. You can then inspect it at your leisure and when you quit the window, the code continues executing. In order for this to work, you need to have pygame and graphviz installed and in your PATH.

shell.py

This script sets all the environment variables as if for translating the VM, and the drops you into an interactive Python prompt. You can type terminal() to drop into a system shell (%COMSPEC% on Windows $SHELL or /bin/sh on Unices) which then has all the environment variables set up that you need to do manual partial translations or similar things.

rsqueak's People

Contributors

abstraktor avatar antongulenko avatar cfbolz avatar codezeilen avatar fniephaus avatar j4yk avatar krono avatar lwassermann avatar matthias-springer avatar psieg avatar timfel 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.