MagLev (software)

Last updated
MagLev
Developer(s) GemTalk Systems
Initial release2008;16 years ago (2008)
Stable release
1.2.0 Alpha 4 / May 17, 2013 (2013-05-17)
Repository
Written in Smalltalk, Ruby
Operating system Cross-platform: Solaris, AIX, Linux, Mac OS X
Platform GemStone/S
Type Ruby programming language interpreter
License MIT, GPL, others [1]
Website maglev.github.com

MagLev is an alternative implementation of the Ruby programming language built on the GemStone/S virtual machine from GemTalk Systems. Much of Maglev was set out to be written in Ruby as much as possible, resulting in some collaboration with the Rubinius project. As of the first beta release, the project runs RubyGems 1.3.5 natively, with support for C and Smalltalk extensions. MagLev has a distinct VM architecture that allows it to share code and data between runtimes and execution cycles through a Ruby API. [2]

Contents

Architecture

Maglev runs inside an image like Smalltalk, offering transparent object persistence [3] [ failed verification ] [4] to Ruby objects and classes. Object persistence is based on ACID transactions that allow multiple running instances to see a shared object graph. Maglev uses a process-based concurrency model, mapping Ruby threads to Smalltalk Processes [5] [ self-published source? ], which are scheduled in the VM as green threads. Using MagLev should yield performance increases when using Ruby, along with allowing Ruby processes over multiple machines to use the same objects at the same time. [6]

Installation

MagLev is installed with RVM, using the following code snippets, copied directly from the maglev github. [7]

rvm install maglev rvm use maglev

The status can be checked using

$ maglev status

Ruby compatibility

Maglev targets Ruby 1.8.7 and runs a significant number of RubySpec. It supports several C extensions including Nokogiri, JSON and bcrypt.

Gemstone/S resources

Related Research Articles

<span class="mw-page-title-main">Object database</span> Type of database management system

An object database or object-oriented database is a database management system in which information is represented in the form of objects as used in object-oriented programming. Object databases are different from relational databases which are table-oriented. A third type, object–relational databases, is a hybrid of both approaches. Object databases have been considered since the early 1980s.

<span class="mw-page-title-main">Ruby (programming language)</span> General-purpose programming language

Ruby is an interpreted, high-level, general-purpose programming language that supports multiple programming paradigms. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

<span class="mw-page-title-main">Smalltalk</span> Object-oriented programming language released first in 1972

Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learning Research Group (LRG) scientists, including Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Merry, and Scott Wallace.

In computing, serialization is the process of translating a data structure or object state into a format that can be stored or transmitted and reconstructed later. When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward. Serialization of object-oriented objects does not include any of their associated methods with which they were previously linked.

In computing, a virtual machine (VM) is the virtualization or emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve specialized hardware, software, or a combination of the two. Virtual machines differ and are organized by their function, shown here:

<span class="mw-page-title-main">Squeak</span> Object-oriented programming language

Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imagineering, where it was intended for use in internal Disney projects. The group would later go on to be supported by HP Labs, SAP, and most recently, Y Combinator.

The actor model in computer science is a mathematical model of concurrent computation that treats an actor as the basic building block of concurrent computation. In response to a message it receives, an actor can: make local decisions, create more actors, send more messages, and determine how to respond to the next message received. Actors may modify their own private state, but can only affect each other indirectly through messaging.

Jikes Research Virtual Machine is a mature virtual machine that runs programs written for the Java platform. Unlike most other Java virtual machines (JVMs), it is written in the programming language Java, in a style of implementation termed meta-circular. It is free and open source software released under an Eclipse Public License.

In computer science, future, promise, delay, and deferred refer to constructs used for synchronizing program execution in some concurrent programming languages. They describe an object that acts as a proxy for a result that is initially unknown, usually because the computation of its value is not yet complete.

In computer science and engineering, transactional memory attempts to simplify concurrent programming by allowing a group of load and store instructions to execute in an atomic way. It is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. Transactional memory systems provide high-level abstraction as an alternative to low-level thread synchronization. This abstraction allows for coordination between concurrent reads and writes of shared data in parallel systems.

In computer programming, a green thread is a thread that is scheduled by a runtime library or virtual machine (VM) instead of natively by the underlying operating system (OS). Green threads emulate multithreaded environments without relying on any native OS abilities, and they are managed in user space instead of kernel space, enabling them to work in environments that do not have native thread support.

GemStone/S is computer software, an application framework that was first available for the programming language Smalltalk as an object database. It is proprietary commercial software.

Rubinius is an alternative Ruby implementation created by Evan Phoenix. Based loosely on the Smalltalk-80 Blue Book design, Rubinius seeks to "provide a rich, high-performance environment for running Ruby code."

A global interpreter lock (GIL) is a mechanism used in computer-language interpreters to synchronize the execution of threads so that only one native thread can execute basic operations at a time. As a general rule, an interpreter that uses GIL will see only one thread to execute at a time, even if runs on a multi-core processor, although some implementations provide for CPU intensive code to release the GIL, allowing multiple threads to use multiple cores. Some popular interpreters that have GIL are CPython and Ruby MRI.

<span class="mw-page-title-main">Pharo</span>

Pharo is an open source, cross-platform implementation of the classic Smalltalk-80 programming language and runtime. It is based on the OpenSmalltalk virtual machine called Cog (VM), which evaluates a dynamic, reflective, and object-oriented programming language with a syntax closely resembling Smalltalk-80.

The Maxine virtual machine is an open source virtual machine that is developed at the University of Manchester. It was formerly developed by Sun Microsystems Laboratories, since renamed Oracle Labs. The emphasis in Maxine's software architecture is on modular design and code reuse for flexibility, configurability, and productivity for industrial and academic virtual machine researchers. It is one of a growing number of Java virtual machines written entirely in Java in a meta-circular style. Examples include Squawk and Jikes RVM.

Ruby Version Manager, often abbreviated as RVM, is a software platform for Unix-like operating systems designed to manage multiple installations of Ruby on the same device.

References

  1. "License agreements". raw.githubusercontent.com. Retrieved 2023-02-21.
  2. "Distributed Ruby with the MagLev VM - igvita.com". www.igvita.com. Retrieved 21 February 2023.
  3. "Programming Guide for GemStone/S 64 Bit Version 1" (PDF), VMware , July 2012, retrieved July 29, 2012
  4. "MagLev – Object Persistence with Ruby and Smalltalk" (PDF), Bachelor thesis, Hasso Plattner Institute , July 1, 2013, retrieved February 22, 2014
  5. Phoenix, Evan (October 14, 2011), "Ruby, Concurrency, and You", Engine Yard Blog, retrieved July 29, 2012
  6. "MagLev Alpha Released: A New, Scalable Ruby Implementation". www.rubyinside.com. Retrieved 21 February 2023.
  7. "Get Started with MagLev".