Arc Forumnew | comments | leaders | submitlogin
arc in java
15 points by conanite 4123 days ago | 4 comments
I'm sure I'll be shot, but someone had to do it.

  http://www.softify.com/rainbow.jar
(240KB) then

  java -jar rainbow.jar
It requires Java 5 - but because I was lazy, not because of any java 5 feature that was indispensable.

(bsv) works, but not (nsv) yet due to something attempting to concatenate a string and nil which I haven't investigated yet. It doesn't do complex numbers, either. It calculates the first 100000 prime numbers at about half the speed of the official scheme version, but there's a lot of scope for optimisation.

rainbow loads arc.arc and other libs from the arc2 distribution bundled inside the jar.

Let me know what you think. I'll link to the source once I tidy it up. It's called "rainbow" because of an obscure pun involving french. And it's 1:30am now where I live, so I'll be back tomorrow, good night.



5 points by sacado 4122 days ago | link

Wow congratulations. I was planning to add an arc2jvm module to arc2c once it will be working (as code generation is just one of the many transformation performed by the compiler, and not the hardest one), but now it is done. And in French :) :) :)

So, now, we've got more or less complete implementations of the language in javascript, CL, java and arc itself, plus the official one. I like to see arc is simple enough to be implemented quite easily in other languages. Now, a PHP implementation would be great as it would enable us to host arc programs almost everywhere :).

-----

4 points by almkglor 4122 days ago | link

> a PHP implementation ...

Oh.... my..... deux ex machina....

-----

5 points by absz 4123 days ago | link

More implementations are great -- I'm impressed! I'll try it out when I get the chance.

And as for the obscure pun: rainbow is «l'arc-en-ciel», but is there anything more with «en ciel» that I'm missing?

-----

2 points by conanite 4122 days ago | link

Yes, it's from "arc-en-ciel" - but "en ciel" doesn't mean anything in this context. One might map "en ciel" to "in java" and consider that java is heavenly, but that's not an interpretation I want to push :))

-----