[ANN] BiteScript 0.0.1 - a DSL for JVM bytecode


#1

BiteScript is a Ruby DSL for generating JVM bytecode and classes. It is
used by the Duby programming language and by the upcoming “compiler2”
Ruby-to-Java compiler in JRuby.

Project page: http://kenai.com/projects/jvmscript

Install: gem install bitescript

Dependencies: JRuby 1.2 or higher

Changes:

  • First public release. Most features up to Java 1.4 are supported plus
    Java 5 annotations.

Sample code:

require ‘bitescript’

include BiteScript

fb = FileBuilder.build(FILE) do
public_class “SimpleLoop” do
public_static_method “main”, void, string[] do
aload 0
push_int 0
aaload
label :top
dup
aprintln
goto :top
returnvoid
end
end
end

fb.generate do |filename, class_builder|
File.open(filename, ‘w’) do |file|
file.write(class_builder.generate)
end
end


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

BiteScript is a Ruby DSL for generating JVM bytecode and classes. It is
used by the Duby programming language and by the upcoming “compiler2”
Ruby-to-Java compiler in JRuby.

Project page: http://kenai.com/projects/jvmscript

Install: gem install bitescript

Cool,

I tried to run this from the command line:

$ jruby examples/mixed_bag.rb
examples/mixed_bag.rb:3:in `require’: no such file to load –
bitescript (LoadError)
from examples/mixed_bag.rb:3

I had to use the ‘-rubygems’ parameter for JRuby:

[jvmscript-hg]$ jruby -rubygems examples/mixed_bag.rb
[hello, bitescript]
jruby examples.miced

I’ve got RUBYOPT set:

$ echo $RUBYOPT
rubygems

But evidently RUBYOPT is still not supported in JRuby:

http://jira.codehaus.org/browse/JRUBY-937

or in jirb:

$ jirb
irb(main):001:0> require ‘java’
=> false
irb(main):002:0> require ‘jruby’
=> false
irb(main):003:0> require ‘bitescript’
LoadError: no such file to load – bitescript
from (irb):4:in `require’
from (irb):4


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#3

Stephen B. wrote:

But evidently RUBYOPT is still not supported in JRuby:

http://jira.codehaus.org/browse/JRUBY-937

Yes, I started implementing RUBYOPT in the 1.2 cycle, but it turned out
to be more complicated than I expected. Instead of simply being able to
add RUBYOPT env vars to the command line in our bash script, we need to
actually pass them through to the full Ruby argument processing. It also
needs to be able to accept arguments with no - in front, so it’s
somewhat different from normal arg processing.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email