Is crystal going to support better functional programming features than Ruby and concurrency models?

854 views
Skip to first unread message

michel perez

unread,
Apr 9, 2015, 10:09:00 AM4/9/15
to crysta...@googlegroups.com
One of the reasons for me to learn Scala was this the lack of support for functional programming and concurrency models like Actors and STM.

Ary Borenszweig

unread,
Apr 9, 2015, 9:10:04 PM4/9/15
to crysta...@googlegroups.com
Hi!,

Right now in Crystal HEAD we have a concurrency model similar to that of Go: lightweight processes and channels for communication.

We still have to build code and abstractions on top of this to have something like actors.

I think both Ruby and Crystal support many aspects of functional programming:

~~~
puts [1, 2, 3].map { |x| x + 1 }.select { |x| x > 2 }.sum #=> 7
~~~

But maybe you mean immutable types and referential transparency? Crystal supports immutable types but you can have mutability too, after all it's an imperative language. We can't change that.

But when you say "support for functional programming", what do you mean?

Best,
ary



On Thu, Apr 9, 2015 at 11:09 AM, michel perez <michel....@gmail.com> wrote:
One of the reasons for me to learn Scala was this the lack of support for functional programming and concurrency models like Actors and STM.

--
You received this message because you are subscribed to the Google Groups "Crystal" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crystal-lang...@googlegroups.com.
To post to this group, send email to crysta...@googlegroups.com.
Visit this group at http://groups.google.com/group/crystal-lang.
To view this discussion on the web visit https://groups.google.com/d/msgid/crystal-lang/88b561de-90b7-4207-8016-eeb27cc18be3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ary Borenszweing         Manas Technology Solutions
[ar.phone]                      5258.5240       #ARY(279)
[us.phone]                      312.612.1050    #ARY(279)
[email]                         aboren...@manas.com.ar
[web]                           www.manas.com.ar
[blog]                           weblogs.manas.com.ar/ary

Tobias Pfeiffer

unread,
Apr 12, 2015, 8:37:28 AM4/12/15
to crysta...@googlegroups.com
Hi there,

thank you that seems interesting! :) Are there any docs on how to use this - what's the best place to start digging into (e.g. channels) ?

I must say for me a modern language, like crystal, should have a good answer to parallelism - to me it seems like (or how Erik put it, I believe) if Ruby was invented two years ago. What's missing for me is the good parallelism support so I'm really looking forward to what you'll come up with there.

As another note there, this was super hard to find, along with this (https://i.reddit.com/r/crystal_programming/comments/2jmcjc/the_crystal_programming_language_combining_the/cmjwtd2.compact). I believe a statement in the docs/README and/or an open issue on github would really help to make this more discoverable.

Anyway, thanks for all your work on crystal it looks really promising and interesting!

Tobi

michel perez

unread,
Apr 15, 2015, 4:24:05 PM4/15/15
to crysta...@googlegroups.com
Well I mean to partial functions, currying, inmutability not only for data structures, functions inside other functions in a more natural way (Not procs Not lambdas), Tail rec, support for deep copying objects.

TR NS

unread,
Apr 23, 2015, 9:53:48 PM4/23/15
to crysta...@googlegroups.com


On Sunday, April 12, 2015 at 8:37:28 AM UTC-4, Tobias Pfeiffer wrote:
Hi there,

thank you that seems interesting! :) Are there any docs on how to use this - what's the best place to start digging into (e.g. channels) ?

I must say for me a modern language, like crystal, should have a good answer to parallelism - to me it seems like (or how Erik put it, I believe) if Ruby was invented two years ago. What's missing for me is the good parallelism support so I'm really looking forward to what you'll come up with there.


I'm thinking Rx might do the trick (http://rxrb.codeplex.com/), or at least most of it

TR NS

unread,
Apr 26, 2015, 8:08:27 AM4/26/15
to crysta...@googlegroups.com

If there is going to be standard way of doing things*, I really think this model is the one that aligns best with Ruby's/Crystal's design.

(*Not to the exclusion of other libraries, of course.)



Reply all
Reply to author
Forward
0 new messages