Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
GemStone Maglev Ruby Repository
Ruby C Smalltalk JavaScript Bison Shell Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Licenses
benchmark @ 5eca34e
bin
docs
etc
examples
gci
lib/ruby
rakelib
spec
src
tools
.gitignore
.gitmodules
LICENSES.txt
README.rdoc
Rakefile
THANKS
debug.mspec
default.mspec
passing.mspec

README.rdoc

License

Please see LICENSES.txt in this directory.

Prerequisites

Some prerequisites must be installed on your machine before MagLev can run correctly. For details, see the Prerequisites file in the docs directory.

A MagLev build requires a compatible version of the GemStone 3.x binaries. Use the installer mentioned below to ensure your MagLev and GemStone versions are in sync. Simply cloning this repository could result in an intermediate version that won't run with any GemStone build.

Documentation

To generate the HTML version of this and other documentation:

cd to the directory holding this README

$ rake rdoc

open html/index.html in your web browser of choice

Quick Start

Install MagLev

Once you've downloaded MagLev by running installMaglev-<system>.sh or upgradeMaglev-<system>.sh, set your MAGLEV_HOME and PATH variables:

export MAGLEV_HOME=<path_to_the_directory_containing_this_README>
export PATH=$MAGLEV_HOME/bin:$PATH

Start the MagLev server

The server is started with rake:

$ cd $MAGLEV_HOME
$ rake maglev:start

Check status of MagLev server

To check that the MagLev repository server started correctly, run rake maglev:status, or simply, rake:

$ cd $MAGLEV_HOME
$ rake maglev:status

If the server is not running, you'll see output like:

(in /Users/pmclain/projects/MagLev-20645.MacOSX)
GemStone server not running.
MagLev Parse Server is not running on port 2001

If a server is running, you'll see output like:

(in /Users/pmclain/projects/MagLev-20645.MacOSX)

MAGLEV_HOME = /Users/pmclain/projects/MagLev-20645.MacOSX
Status  Version    Owner    Pid   Port   Started     Type  Name
------ --------- --------- ----- ----- ------------ ------ ----
  OK   3.0.0     pmclain   38889 50377 Dec 08 13:21 Netldi gs64ldi
  OK   3.0.0     pmclain   38892 60165 Dec 08 13:21 Stone  gs64stone
  OK   3.0.0     pmclain   38893 60157 Dec 08 13:21 cache  gs64stone@cairo.gemstone.com

MagLev Parse Server port = 2001
COMMAND   PID    USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
ruby    38918 pmclain    3u  IPv6 0x3c524bc      0t0  TCP *:2001 (LISTEN)
ruby    38918 pmclain    4u  IPv4 0x6d63e64      0t0  TCP *:2001 (LISTEN)

If the parse server is reported as NOT running, see the troubleshooting file.

maglev-ruby: Execute a Ruby file

You should now be able to run a simple ruby script:

$ cat > hello.rb
puts "Hello from MagLev"
^D
$ maglev-ruby hello.rb
Hello from MagLev
$

maglev-irb: Open an interactive maglev shell

MagLev now includes a slightly modified copy of irb called maglev-irb. References in this documentation to maglev-irb currently apply to the deprecated maglev-irb version, temporarily renamed topaz-irb. We'll update the docs soon.

MagLev provides an IRB-like utility, $MAGLEV_HOME/bin/maglev-irb. It provides a minimal interactive environment with some limitations:

$ maglev-irb
>> 1 + 1
=> 2
*> puts "Hi"
Hi
=> nil
*> ^D
$

See maglev-irb for details.

Next Steps

Examples

You can try running the scripts in the examples directory.

Webrick

A simple example that starts a webrick server which you can connect to at localhost:2000/. To run the script, make sure maglev-ruby is on your path, and then:

$ $MAGLEV_HOME/examples/webrick/time_server.rb

^C will terminate the webrick server VM.

Further reading

The following documentation explains more:

Release Notes

Notes on and limitations of the current release.

Server

How to start and stop the MagLev server.

Debug

How to run MagLev in debug mode

Layout

Guide to the MagLev distribution file layout

Specs

Running mspec and rubyspecs with MagLev

Rake

Rake tasks for MagLev

maglev-irb

MagLev interactive utility

Troubleshooting

Solutions for common problems

Prerequisites

External software needed by MagLev

Persistence API

Persistence and transactions

Smalltalk FFI

GemStone Smalltalk FFI

MySQL Driver

MySQL driver

Benchmarks

Ruby Benchmark Suite benchmarks

Applications

Sample Ruby apps we're testing in MagLev

Hints:

  • set MAGLEV_HOME to the full path of this directory, and add $MAGLEV_HOME/bin to your PATH. Then you can use maglev-ruby etc. from anywhere.

  • if you have multiple installations, set PARSETREE_PORT to control which port the parser server listens on

Ruby code:

  • src/ and src/lib/ are both on the require path

  • src/kernel/ has the core Array, String etc. files

Something went wrong with that request. Please try again.