Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

All bits needed to build a gem.

  • Loading branch information...
commit c625ae98dee7c8da5d92cdf02414b76e268d64a0 1 parent 452bc3a
@headius headius authored
View
4 History.txt
@@ -0,0 +1,4 @@
+=== 0.0.1 / 2009-10-27
+
+* First gem release
+ * Most things necessary for simple apps, scripts, servlets are working
View
68 Manifest.txt
@@ -0,0 +1,68 @@
+bin/duby
+bin/dubyc
+bin/dubyp
+lib/duby.rb
+lib/duby/ast.rb
+lib/duby/compiler.rb
+lib/duby/nbcompiler.rb
+lib/duby/transform.rb
+lib/duby/typer.rb
+lib/duby/ast/call.rb
+lib/duby/ast/class.rb
+lib/duby/ast/flow.rb
+lib/duby/ast/intrinsics.rb
+lib/duby/ast/literal.rb
+lib/duby/ast/local.rb
+lib/duby/ast/method.rb
+lib/duby/ast/structure.rb
+lib/duby/ast/type.rb
+lib/duby/c/compiler.rb
+lib/duby/jvm/compiler.rb
+lib/duby/jvm/method_lookup.rb
+lib/duby/jvm/source_compiler.rb
+lib/duby/jvm/typer.rb
+lib/duby/jvm/types.rb
+lib/duby/jvm/source_generator/builder.rb
+lib/duby/jvm/source_generator/loops.rb
+lib/duby/jvm/source_generator/precompile.rb
+lib/duby/jvm/source_generator/typer.rb
+lib/duby/jvm/types/basic_types.rb
+lib/duby/jvm/types/boolean.rb
+lib/duby/jvm/types/factory.rb
+lib/duby/jvm/types/floats.rb
+lib/duby/jvm/types/integers.rb
+lib/duby/jvm/types/intrinsics.rb
+lib/duby/jvm/types/literals.rb
+lib/duby/jvm/types/methods.rb
+lib/duby/jvm/types/number.rb
+lib/duby/old/compiler_old.rb
+lib/duby/old/declaration.rb
+lib/duby/old/mapper.rb
+lib/duby/old/signature.rb
+lib/duby/old/typer_old.rb
+lib/duby/plugin/edb.rb
+lib/duby/plugin/java.rb
+lib/duby/plugin/math.rb
+test/test_ast.rb
+test/test_compilation.rb
+test/test_java_typer.rb
+test/test_javac_compiler.rb
+test/test_jvm_compiler.rb
+test/test_math_plugin.rb
+test/test_typer.rb
+examples/bench_fractal.duby
+examples/construction.duby
+examples/edb.duby
+examples/fib.duby
+examples/fields.duby
+examples/java_thing.duby
+examples/simple_class.duby
+examples/swing.duby
+examples/tak.duby
+examples/appengine/src/com/google/appengine/ext/duby/db/Model.duby
+examples/appengine/src/com/ribrdb/DubyApp.duby
+History.txt
+Manifest.txt
+README.txt
+Rakefile
+javalib/JRubyParser.jar
View
18 README
@@ -1,18 +0,0 @@
-Duby is a highly customizable programming language (or a structured assembly language) featuring type inference
-and a heavily Ruby-inspired syntax, while allowing both the inference engine and the compiler backends to be
-entirely customizable for any platform or type system. Duby currently includes a typer/compiler backend for the
-JVM.
-
-This project depends on JRuby (since it still uses the parser) and on JVMScript.
-
-JRuby is at http://www.jruby.org
-JVMScript is at http://kenai.com/projects/jvmscript
-
-=====
-TO DO
-=====
-
-Currently I'm stuck on type inference for null. I need a way to represent types that are initially
-declared = null, so I need to add some syntax to be able to specify their real type (type decls for
-e.g. fields and such) or I need some other magic that defers typing until it's first assigned
-elsewhere in the class.
View
31 README.txt
@@ -0,0 +1,31 @@
+= duby
+
+* http://kenai.com/projects/duby
+
+== DESCRIPTION:
+
+Duby is a customizable programming language featuring static types, local type inference and a heavily Ruby-inspired syntax. Duby currently includes a typer/compiler backend for the JVM which can output either JVM bytecode or Java source files.
+
+== FEATURES/PROBLEMS:
+
+* Ruby syntax
+* Compiles to .class or .java
+* Fast as Java
+
+== SYNOPSIS:
+
+duby <script.duby>
+duby -e "inline script"
+dubyc <script.duby>
+dubyc -e "inline script" # produces dash_e.class
+dubyc -java <script.duby>
+dubyc -java -e "inline script" # produces dash_e.java
+
+== REQUIREMENTS:
+
+* JRuby 1.4RC2 or higher.
+* BiteScript 0.0.4 or higher
+
+== INSTALL:
+
+* gem install duby
View
24 Rakefile
@@ -2,6 +2,10 @@ require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'java'
+require 'hoe'
+
+$: << 'lib'
+require 'duby'
task :default => :test
@@ -11,3 +15,23 @@ Rake::TestTask.new :test do |t|
t.test_files = FileList["test/**/*.rb"]
java.lang.System.set_property("jruby.duby.enabled", "true")
end
+
+# update manifest
+files = []
+files.concat Dir['bin/*'].to_a
+files.concat Dir['lib/**/*.rb'].to_a
+files.concat Dir['test/**/*.rb'].to_a
+files.concat Dir['examples/**/*.duby'].to_a
+files << 'History.txt'
+files << 'Manifest.txt'
+files << 'README.txt'
+files << 'Rakefile'
+files << 'javalib/JRubyParser.jar'
+
+File.open('Manifest.txt', 'w') {|f| f.write(files.join("\n"))}
+
+Hoe.spec 'duby' do
+ developer('Charles Oliver Nutter', 'headius@headius.com')
+ developer('Ryan Brown', 'ribrdb@google.com')
+ extra_deps << ['bitescript', '>= 0.0.4']
+end
View
12 bin/duby
@@ -1,7 +1,9 @@
#!/usr/bin/env jruby
-$: << File.dirname(File.dirname(__FILE__)) + '/lib'
-require 'duby'
-
-if __FILE__ == $0
- Duby.run(*ARGV)
+begin
+ require 'duby'
+rescue LoadError
+ $: << File.dirname(File.dirname(__FILE__)) + '/lib'
+ require 'duby'
end
+
+Duby.run(*ARGV)
View
10 bin/dubyc
@@ -1,5 +1,9 @@
#!/usr/bin/env jruby
-$: << File.dirname(File.dirname(__FILE__)) + '/lib'
-require 'duby'
+begin
+ require 'duby'
+rescue LoadError
+ $: << File.dirname(File.dirname(__FILE__)) + '/lib'
+ require 'duby'
+end
-Duby.compile(*ARGV)
+Duby.compile(*ARGV)
View
11 bin/dubyp
@@ -1,4 +1,9 @@
#!/usr/bin/env jruby
-$: << File.dirname(File.dirname(__FILE__)) + '/lib'
-require 'duby'
-puts Duby.parse(*ARGV).inspect
+begin
+ require 'duby'
+rescue LoadError
+ $: << File.dirname(File.dirname(__FILE__)) + '/lib'
+ require 'duby'
+end
+
+puts Duby.parse(*ARGV).inspect
View
30 lib/duby.rb
@@ -14,6 +14,22 @@
Dir[File.dirname(__FILE__) + "/duby/plugin/*"].each {|file| require "#{file}" if file =~ /\.rb$/}
require 'jruby'
+module Duby
+ VERSION = '0.0.1'
+
+ def self.run(*args)
+ DubyImpl.new.run(*args)
+ end
+
+ def self.compile(*args)
+ DubyImpl.new.compile(*args)
+ end
+
+ def self.parse(*args)
+ DubyImpl.new.parse(*args)
+ end
+end
+
class DubyImpl
def run(*args)
ast = parse(*args)
@@ -149,20 +165,6 @@ def expand_files(files)
end
end
-module Duby
- def self.run(*args)
- DubyImpl.new.run(*args)
- end
-
- def self.compile(*args)
- DubyImpl.new.compile(*args)
- end
-
- def self.parse(*args)
- DubyImpl.new.parse(*args)
- end
-end
-
if __FILE__ == $0
Duby.run(ARGV[0], *ARGV[1..-1])
end
View
4 lib/duby/jvm/compiler.rb
@@ -14,8 +14,8 @@ class FunctionalCall
module Compiler
class JVM
- import java.lang.System
- import java.io.PrintStream
+ java_import java.lang.System
+ java_import java.io.PrintStream
include Duby::JVM::MethodLookup
Types = Duby::JVM::Types
View
6 lib/duby/transform.rb
@@ -86,9 +86,9 @@ module AST
$CLASSPATH << File.dirname(__FILE__) + '/../../javalib/JRubyParser.jar'
Parser = org.jrubyparser.Parser
end
- import org.jrubyparser.parser.ParserConfiguration
- import org.jrubyparser.CompatVersion
- import java.io.StringReader
+ java_import org.jrubyparser.parser.ParserConfiguration
+ java_import org.jrubyparser.CompatVersion
+ java_import java.io.StringReader
def parse(src, filename='-', raise_errors=false)
ast = parse_ruby(src, filename)
Please sign in to comment.
Something went wrong with that request. Please try again.