Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Created March 30, 2011 03:13
Show Gist options
  • Save donpdonp/893793 to your computer and use it in GitHub Desktop.
Save donpdonp/893793 to your computer and use it in GitHub Desktop.
why ruby is better than java
## Ruby [1,2,3].each{|i| puts "I am #{i}"}
donp@sparky:~$ mirahc -j -e '[1,2,3].each{|i| puts "I am #{i}"}'
Parsing...
<inline script>
Inferring types...
Compiling...
DashE
Done!
## Java
donp@sparky:~$ cat DashE.java
// Generated from DashE
public class DashE extends java.lang.Object {
public static void main(java.lang.String[] argv) {
java.util.Iterator __xform_tmp_1 = null;
java.lang.Object i = null;
__xform_tmp_1 = java.util.Collections.unmodifiableList(java.util.Arrays.asList(1, 2, 3)).iterator();
label1:
while (__xform_tmp_1.hasNext()) {
i = __xform_tmp_1.next();
label2:
{
java.io.PrintStream temp$3 = java.lang.System.out;
temp$3.println("I am " + i);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment