Cool Projects

C

Charles Oliver Nutter

Alasdair said:
So, anyone working on something awesome?

Brag here...

I've been rewriting the Java integration layer in JRuby for performance
and efficiency. Most normal Ruby-Java method calls are 5-10x faster on
trunk than in JRuby 1.1.3. Still a bunch of work to do before 1.1.4 though.

Also, I've continued working on my pet language Duby on and off. Since
the rewrite of the AST translator (from JRuby's Ruby AST to Duby's AST)
and inference engine (so there's no dependencies on Java type names) I
haven't gotten the JVM bytecode backend up and running yet. But it's
working pretty well.

Code like

def fib(a => Fixnum)
if a < 2
a
else
fib(a - 1) + fib(a - 2)
end
end

Correctly infers return types, and under the original Duby compiler it
could produce idiomatic JVM bytecode using integer primitives that was
as fast as hand-written Java code.

I like to watch the inference engine work too...

âž” jruby -d -r duby/plugin/math.rb lib/ruby/site_ruby/1.8/duby/typer.rb
fib.rb

* [Simple] Learned local type under MethodDefinition(fib) : a = Type(fixnum)
* [Simple] Retrieved local type in MethodDefinition(fib) : a = Type(fixnum)
* [AST] [Fixnum] resolved!
* [Simple] Method type for "<" Type(fixnum) on Type(fixnum) not found.
* [Simple] Invoking plugin: #<Duby::Typer::MathTyper:0xfc9d2b>
* [Math] Method type for "<" Type(fixnum) on Type(fixnum) = Type(boolean)
* [AST] [Call] resolved!
* [AST] [Condition] resolved!
* [Simple] Retrieved local type in MethodDefinition(fib) : a = Type(fixnum)
* [Simple] Retrieved local type in MethodDefinition(fib) : a = Type(fixnum)
* [AST] [Fixnum] resolved!
* [Simple] Method type for "-" Type(fixnum) on Type(fixnum) not found.
* [Simple] Invoking plugin: #<Duby::Typer::MathTyper:0xfc9d2b>
* [Math] Method type for "-" Type(fixnum) on Type(fixnum) = Type(fixnum)
* [AST] [Call] resolved!
* [Simple] Method type for "fib" Type(fixnum) on Type(script) not found.
* [Simple] Invoking plugin: #<Duby::Typer::MathTyper:0xfc9d2b>
* [Math] Method type for "fib" Type(fixnum) on Type(script) not found
* [Simple] Deferring inference for FunctionalCall(fib)
* [Simple] Retrieved local type in MethodDefinition(fib) : a = Type(fixnum)
* [AST] [Fixnum] resolved!
* [Simple] Method type for "-" Type(fixnum) on Type(fixnum) not found.
* [Simple] Invoking plugin: #<Duby::Typer::MathTyper:0xfc9d2b>
* [Math] Method type for "-" Type(fixnum) on Type(fixnum) = Type(fixnum)
* [AST] [Call] resolved!
* [Simple] Method type for "fib" Type(fixnum) on Type(script) not found.
* [Simple] Invoking plugin: #<Duby::Typer::MathTyper:0xfc9d2b>
* [Math] Method type for "fib" Type(fixnum) on Type(script) not found
* [Simple] Deferring inference for FunctionalCall(fib)
* [Simple] Method type for "+" on not found.
* [Simple] Invoking plugin: #<Duby::Typer::MathTyper:0xfc9d2b>
* [Math] Method type for "+" on not found
* [Simple] Deferring inference for Call(+)
* [Simple] Deferring inference for If
* [Simple] Learned method fib (Type(fixnum)) on Type(script) = Type(fixnum)
* [Simple] Entering type inference cycle
* [Simple] Method type for "fib" Type(fixnum) on Type(script) = Type(fixnum)
* [AST] [FunctionalCall] resolved!
* [Simple] [Cycle 0]: Inferred type for FunctionalCall(fib): Type(fixnum)
* [Simple] Method type for "fib" Type(fixnum) on Type(script) = Type(fixnum)
* [AST] [FunctionalCall] resolved!
* [Simple] [Cycle 0]: Inferred type for FunctionalCall(fib): Type(fixnum)
* [Simple] Method type for "+" Type(fixnum) on Type(fixnum) not found.
* [Simple] Invoking plugin: #<Duby::Typer::MathTyper:0xfc9d2b>
* [Math] Method type for "+" Type(fixnum) on Type(fixnum) = Type(fixnum)
* [AST] [Call] resolved!
* [Simple] [Cycle 0]: Inferred type for Call(+): Type(fixnum)
* [AST] [If] resolved!
* [Simple] [Cycle 0]: Inferred type for If: Type(fixnum)
* [Simple] Inference cycle 0 resolved all types, exiting

AST:
Script
MethodDefinition(fib)
{:return=>Type(fixnum), :a=>Type(fixnum)}
Arguments
RequiredArgument(a)
If
Condition
Call(<)
Local(name = a, scope = MethodDefinition(fib))
Fixnum(2)
Local(name = a, scope = MethodDefinition(fib))
Call(+)
FunctionalCall(fib)
Call(-)
Local(name = a, scope = MethodDefinition(fib))
Fixnum(1)
FunctionalCall(fib)
Call(-)
Local(name = a, scope = MethodDefinition(fib))
Fixnum(2)

- Charlie
 
M

Mohit Sindhwani

Ståle Z.H said:
I'm currently working on:
- building a small set of network utility classes (nothing big, it's
just for fun/experimentation)
- a Ruby/GTK application that downloads videos from youtube
- a simple CMS in Rails

I probably won't finish most of this, but it's fun to work with
nevertheless. \o/

Not really awesome and in no way comparable to the work that some of you
guys are doing, but I'm working on something that I find is a bit of
fun. I'm using Ruby to read through Word documents and parse them to
produce a bunch of files. These files are then automatically imported
into the Radiant CMS into pre-defined places. It makes a nice way to do
something as Word (or having done something as Word) and then push it
online into the CMS.

It's just fun!

Cheers,
Mohit.
8/2/2008 | 10:21 PM.
 
B

Bryan Richardson

A co-worker and myself have been working on a passive network mapping
tool called ANTFARM for a few years now and have finally received
copyright rights from our employer to open source the software. I have
created a project at RubyForge called ANTFARM and will be making the
code available there in the very near future.
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

I'm working on a small app to manage the scheduled start-up and shutdown of
arbitrary numbers of computers in arbitrary numbers of groups. While not
cool in the traditional sense I figured why not save the school some money
on the electric bill and save the environment some pain all while
introducing my self to GUI programming.
 
M

Martin DeMello

So, anyone working on something awesome?

Brag here...

I'm working on a crossword editor (mostly biased towards UK-style
cryptics, but once that's solidly in place I'll expand its range),
there currently being no really good free one available. Right now
it's barely started, and going slowly due to lack of copious free
time, but since it's something I'm writing first and foremost for my
own use, I have high hopes for it :) Also, it gives me an excuse to
play with Shoes.

martin
 
D

Daniel Lucraft

Valar: http://github.com/danlucraft/valar/tree/master

It's rb++ but for the Vala language.

Vala (live.gnome.org/Vala) is a C#-like language with automated memory
management and collections like ArrayLists and HashMaps. Vala compiles
into C so is pretty performant.

ValaR makes it dead simple to write Ruby extensions in Vala. Compile
your vala code into a library and point valar at the generated vapi
file. Vala will generate the C glue code to allow you to call your Vala
library from Ruby.

Features:

* automated conversions between Vala and Ruby types.
e.g.
int -> Integer,
string -> String,
ArrayList<string> -> ["foo", "bar", ...],
HashMap<int, string> -> {1 => "foo"}

* An object oriented Ruby API. Instead of RSTRING_PTR(str),
you can write str.to_vala()

* Ruby types. So instead of VALUE, VALUE, VALUE, you
write Ruby.Value, Ruby.Array, Ruby.String and enjoy automatically
generated type checking to rule out segfaults.

* Automated memory management, linked to the Ruby garbage collector.

It's dependent on Ruby-Gnome2 and isn't packaged as a gem yet, my bad.
Also I'm writing a tutorial on how to get it working which I will link
to in the readme soonish.

best,
Dan
 
D

Daniel Lucraft

Phlip said:
Block closures?

Someone needs to teach C# a lesson...

No closures, but there are anonymous methods e.g:

public void run () {
// assigning anonymous method as signal handler
this.foo += s => {
stdout.printf ("Lambda expression %s!\n", name);
};

// Calling lambda expression
this.foo();
}

best,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
FloridaHan

Latest Threads

Top