logoalt Hacker News

librastevetoday at 4:49 PM0 repliesview on HN

I thought it would be interesting to try the showcase examples in Raku (since I am always saying how good Raku's imitation of Ruby is)...

  - https://glot.io/snippets/he42jpfm27
  - https://glot.io/snippets/he42trx6w6
  - https://glot.io/snippets/he434b6ryj
Obviously Raku leans more to `{}` and `my $var` than Ruby - but otherwise I think it does a credible job. Obviously these are carefully chosen Ruby snippets to highlit its unique abilities in strings, "array math" and classes. On the string interpolation, I would say that Raku has the slight edge (and has the whole Q-slang for a lot of fine grained control). On the array math, I had to apply the (built in) Raku set diff operator ... so I guess that Ruby is a little more natural for this (rather quirky) feature. On the class stuff, again very close. Raku has much more powerful OO under the hood ... multi-inheritance, role-composition, punning, mixins, MOP, and yet is a delight to use in this lightweight way.