Re: Rouge: Ruby + Clojure

2012-10-25 Thread Arlen Cuss
Hi all,

As a final (!?) follow-up to this post, you can now play with Rouge online in a 
tryclj-like environment: http://try.rouge.io

Cheers,

Arlen

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Rouge: Ruby + Clojure

2012-10-19 Thread Arlen Christian Mart Cuss
Hi again,

On Friday, October 12, 2012 10:40:28 PM UTC+11, Arlen Christian Mart Cuss 
wrote:

 https://github.com/unnali/rouge#readme


As an aside, I've set up a Google Group mailing list for discussion and 
announcements:

https://groups.google.com/forum/#!forum/rouge-talk 

Cheers,

Arlen

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-19 Thread Arlen Christian Mart Cuss
Hi Armando,

On Wednesday, October 17, 2012 2:48:44 AM UTC+11, Armando Blancas wrote:

 Finally came around to install a recent Ruby build and ran a little test 
 script just to get a feel for the startup time. Looks good, though the 
 faster the merrier.


That's a neat little check!  It's encouraging, too, as I haven't done much 
work in terms of optimisation yet.  I think we have a lot of scope for 
further improvement! :)

Cheers,

Arlen

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-19 Thread Arlen Christian Mart Cuss
On Wednesday, October 17, 2012 2:20:09 PM UTC+11, Brian Marick wrote:

  hash.become(TimesliceShaped) 


For the longest time I thought you were talking about the core Hash#become 
(Hash#replace since 2002!).  I've since become acquainted with Stunted. :)

That said, I'm a sucker for non-OO design, even in Ruby—I tend to prefer 
explicitly naming the (module+)function and thus making it clear how data 
are being transformed.  This is just a personal preference, but I suppose 
it might also help with not internalising any bad ideas about a given 
(Functional)Hash *being* a particular thing by virtue of the methods we've 
attached thus far.

(I'll admit here and now, though, that I'm out of depth in experience, and 
will see how wrong I can prove myself in the coming days. :-))

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-16 Thread Armando Blancas
Finally came around to install a recent Ruby build and ran a little test 
script just to get a feel for the startup time. Looks good, though the 
faster the merrier.

~ $ ruby --version
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin10.8.0]

~/dev/tools/rouge $ cat test.clj 
(defn square [x] (* x x))

(defn fact [n]
  (if (= n 0)
1
(* n (fact (- n 1)

(print (fact (square 3)))
(print)

~/dev/tools/rouge $ time bin/rouge test.clj
362880
real 0m0.303s
user 0m0.291s
sys 0m0.011s
~/dev/tools/rouge $ time clj test.clj
362880
real 0m1.103s
user 0m1.683s
sys 0m0.127s

On Friday, October 12, 2012 4:40:28 AM UTC-7, Arlen Christian Mart Cuss 
wrote:

 Hi all,

 I'd like to announce Rouge, which is an implementation of Clojure on Ruby.

 https://github.com/unnali/rouge#readme

 The readme above shows example of some Rouge code, most of which is 
 currently taken from the boot file of Rouge itself.  The thing is fully 
 TDDed, so you can read the specs to see how (in)complete it is. :)

 I'd love it if you gave it a try, and let me know your thoughts and 
 feedback.  Even more than that, I'd love your contributions!  Clojure is a 
 beautiful language, and I'm really happy to be able to combine it with my 
 other favourite language.

 Cheers,

 Arlen


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-16 Thread Phil Hagelberg
On Fri, Oct 12, 2012 at 4:40 AM, Arlen Christian Mart Cuss a...@len.me wrote:
 I'd like to announce Rouge, which is an implementation of Clojure on Ruby.

Interesting project.

What are you planning on doing about the fact that Ruby has mutable
strings? Seems like that would be a deal-breaker for implementing
Clojure's equality semantics.

http://home.pipeline.com/~hbaker1/ObjectIdentity.html

-Phil

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Rouge: Ruby + Clojure

2012-10-16 Thread Arlen Cuss
Hi Phil,


On Wednesday, 17 October 2012 at 4:11 AM, Phil Hagelberg wrote:

 Interesting project.
Thanks!
 
 What are you planning on doing about the fact that Ruby has mutable
 strings? Seems like that would be a deal-breaker for implementing
 Clojure's equality semantics.
 
 http://home.pipeline.com/~hbaker1/ObjectIdentity.html
My initial solution is to freeze all strings in the reader.  This prevents the 
most obvious issues, as it means any string read in from the Rouge code itself 
is immutable.

The wider question of strings in Rouge code in general is going to be a 
concern, and something I'll probably have to mull over more shortly. :)  There 
are some options (which I don't quite like), such as freezing strings on entry 
to Rouge code and duping them on exit.

- Arlen

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Rouge: Ruby + Clojure

2012-10-16 Thread Brian Marick

On Oct 16, 2012, at 1:19 PM, Arlen Cuss wrote:
 My initial solution is to freeze all strings in the reader.  This prevents 
 the most obvious issues, as it means any string read in from the Rouge code 
 itself is immutable.

A problem with `freeze` in Ruby is that it both prevents changing the contents 
of an object and also the methods attached to it. I find it useful sometimes to 
take an immutable object and create a new object with a different 
interpretation:

 hash.become(TimesliceShaped)

What that does is produce an object with some new singleton methods. That lets 
me do something like Clojure's `-` or the common Ruby boxcar notation:

 timeslice.transform.update

It makes the code more readable.

This is also vaguely analogous to multimethods. The point is that we want the 
functions applicable to an object to be mutable but the contents of the object 
to be immutable.


-
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile
Writing /Functional Programming for the Object-Oriented Programmer/: 
https://leanpub.com/fp-oo


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Rouge: Ruby + Clojure

2012-10-16 Thread Arlen Cuss
On Wednesday, 17 October 2012 at 4:11 AM, Phil Hagelberg wrote:
 http://home.pipeline.com/~hbaker1/ObjectIdentity.html

Thanks for the link, too—I'm working through it with interest.

As for mutability in Rouge, I had another thought—freezing (or possibly duping 
then freezing) Ruby String objects when returned by the core evaluator would 
probably do the trick comprehensively; it would incur a performance penalty, 
but it would be at least starting on the right foot.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Rouge: Ruby + Clojure

2012-10-13 Thread Alexey Petrushin
By the way is there pure clojure lang specs, without dependency on java or 
some other tools?

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-13 Thread Softaddicts
We tried to implement Clojure on top of a black hole, it got sucked up

Luc :))


 By the way is there pure clojure lang specs, without dependency on java or 
 some other tools?
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
--
Softaddictslprefonta...@softaddicts.ca sent by ibisMail from my ipad!

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Rouge: Ruby + Clojure

2012-10-12 Thread Arlen Christian Mart Cuss
Hi all,

I'd like to announce Rouge, which is an implementation of Clojure on Ruby.

https://github.com/unnali/rouge#readme

The readme above shows example of some Rouge code, most of which is 
currently taken from the boot file of Rouge itself.  The thing is fully 
TDDed, so you can read the specs to see how (in)complete it is. :)

I'd love it if you gave it a try, and let me know your thoughts and 
feedback.  Even more than that, I'd love your contributions!  Clojure is a 
beautiful language, and I'm really happy to be able to combine it with my 
other favourite language.

Cheers,

Arlen

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-12 Thread Armando Blancas
Nice work. 

I'm getting this error:
~/dev/tools/rouge $ bin/rouge
./bin/../lib/rouge.rb:6: undefined method `define_singleton_method' for 
Rouge:Module (NoMethodError)
~/dev/tools/rouge $ ruby --version

In case any of this is relevant:
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]
~/dev/tools/rouge $ bundle --version
Bundler version 1.2.1
~/dev/tools/rouge $ gem --version
1.8.24

On Friday, October 12, 2012 4:40:28 AM UTC-7, Arlen Christian Mart Cuss 
wrote:

 Hi all,

 I'd like to announce Rouge, which is an implementation of Clojure on Ruby.

 https://github.com/unnali/rouge#readme

 The readme above shows example of some Rouge code, most of which is 
 currently taken from the boot file of Rouge itself.  The thing is fully 
 TDDed, so you can read the specs to see how (in)complete it is. :)

 I'd love it if you gave it a try, and let me know your thoughts and 
 feedback.  Even more than that, I'd love your contributions!  Clojure is a 
 beautiful language, and I'm really happy to be able to combine it with my 
 other favourite language.

 Cheers,

 Arlen


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-12 Thread Arlen Christian Mart Cuss
Hi Armando,

Thanks for giving it a go!

On second thought, I've decided against 1.8 support.  1.8 was released 
initially in 2003, and is now considered deprecated.  I gave it a solid go 
to see if the code I wrote was mostly-compatible with 1.8, but it started 
to turn into something of a dog's breakfast.

Sorry for the hassle.

— Arlen

On Saturday, October 13, 2012 8:52:05 AM UTC+11, Armando Blancas wrote:

 Nice work. 

 I'm getting this error:
 ~/dev/tools/rouge $ bin/rouge
 ./bin/../lib/rouge.rb:6: undefined method `define_singleton_method' for 
 Rouge:Module (NoMethodError)
 ~/dev/tools/rouge $ ruby --version

 In case any of this is relevant:
 ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]
 ~/dev/tools/rouge $ bundle --version
 Bundler version 1.2.1
 ~/dev/tools/rouge $ gem --version
 1.8.24

 On Friday, October 12, 2012 4:40:28 AM UTC-7, Arlen Christian Mart Cuss 
 wrote:

 Hi all,

 I'd like to announce Rouge, which is an implementation of Clojure on Ruby.

 https://github.com/unnali/rouge#readme

 The readme above shows example of some Rouge code, most of which is 
 currently taken from the boot file of Rouge itself.  The thing is fully 
 TDDed, so you can read the specs to see how (in)complete it is. :)

 I'd love it if you gave it a try, and let me know your thoughts and 
 feedback.  Even more than that, I'd love your contributions!  Clojure is a 
 beautiful language, and I'm really happy to be able to combine it with my 
 other favourite language.

 Cheers,

 Arlen



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rouge: Ruby + Clojure

2012-10-12 Thread Armando Blancas
I didn't realize 1.8 was such and old version; will get a recent build and 
give it another try. I'm interested in scripting, so the basic pieces are 
already there. With a short startup time this will be looking really useful.

On Friday, October 12, 2012 6:05:39 PM UTC-7, Arlen Christian Mart Cuss 
wrote:

 Hi Armando,

 Thanks for giving it a go!

 On second thought, I've decided against 1.8 support.  1.8 was released 
 initially in 2003, and is now considered deprecated.  I gave it a solid go 
 to see if the code I wrote was mostly-compatible with 1.8, but it started 
 to turn into something of a dog's breakfast.

 Sorry for the hassle.

 — Arlen

 On Saturday, October 13, 2012 8:52:05 AM UTC+11, Armando Blancas wrote:

 Nice work. 

 I'm getting this error:
 ~/dev/tools/rouge $ bin/rouge
 ./bin/../lib/rouge.rb:6: undefined method `define_singleton_method' for 
 Rouge:Module (NoMethodError)
 ~/dev/tools/rouge $ ruby --version

 In case any of this is relevant:
 ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]
 ~/dev/tools/rouge $ bundle --version
 Bundler version 1.2.1
 ~/dev/tools/rouge $ gem --version
 1.8.24

 On Friday, October 12, 2012 4:40:28 AM UTC-7, Arlen Christian Mart Cuss 
 wrote:

 Hi all,

 I'd like to announce Rouge, which is an implementation of Clojure on 
 Ruby.

 https://github.com/unnali/rouge#readme

 The readme above shows example of some Rouge code, most of which is 
 currently taken from the boot file of Rouge itself.  The thing is fully 
 TDDed, so you can read the specs to see how (in)complete it is. :)

 I'd love it if you gave it a try, and let me know your thoughts and 
 feedback.  Even more than that, I'd love your contributions!  Clojure is a 
 beautiful language, and I'm really happy to be able to combine it with my 
 other favourite language.

 Cheers,

 Arlen



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en