Skip to content

Instantly share code, notes, and snippets.

View chrisseaton's full-sized avatar

Chris Seaton chrisseaton

View GitHub Profile
def foo(*a)
# Isn't the * below redundant? Doesn't it cast a to an Array if it isn't one already?
# But if you remove it the behaviour changes - how come?
yield *a
end
puts foo(1, 2) { |a| a }
# MRI, JRuby, prints 1; Truffle prints 1 2
<metadata modelVersion="1.1.0">
<groupId>com.oracle.truffle</groupId>
<artifactId>truffle</artifactId>
<versioning>
<latest>0.0.1-SNAPSHOT</latest>
<release/>
<versions>
<version>0.0.1-SNAPSHOT</version>
</versions>
<lastUpdated>20131026113944</lastUpdated>
# Make a new clean directory to do all this in
mkdir truffle-test
cd truffle-test
# Get JRuby and Graal
curl http://lafo.ssw.uni-linz.ac.at/graalvm/openjdk-8-graalvm-b122-macosx-x86_64-9cd47b39b0ef1bfbf2c67d6030bbf2617bea819d.tar.gz | tar -zx
git clone git://jruby.org/jruby.git
cd jruby
# We want the Truffle branch
../../bin/jruby -J-server -J-d64 -Xtruffle -Xtruffle.printRuntime=true harness.rb -s 120 mandelbrot.rb
def foo
yield
end
foo do
break
end
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link href="dist/css/bootstrap.css" rel="stylesheet" media="screen">
<script src="assets/js/jquery.js"></script>
<script src="dist/js/bootstrap.js"></script>