librelist archives

« back to archive

FRP + Shoes

FRP + Shoes

From:
Steve Klabnik
Date:
2013-04-23 @ 13:36
Hey Shoes-ers!

I wanted to show off something I've been building for the past few
days: Functional Reactive Programming with Shoes!

Basically, I'm at a conference, and someone showed off a FRP library
in JavaScript, so I've been porting it to Ruby. And one of the better
applications of FRP is GUI stuff, so of course, I thought of Shoes!

Here's the repo: https://github.com/steveklabnik/frp_shoes

I'm not sure that this is something that'd ever go in Shoes proper,
but it's pretty neat, in my humble opinion.

Shoes on!

Re: [shoes] FRP + Shoes

From:
Arne Brasseur
Date:
2013-04-23 @ 14:04
I hadn't heard of FRP yet but I like how it looks, very decoupled!


On 23 April 2013 15:36, Steve Klabnik <steve@steveklabnik.com> wrote:

> Hey Shoes-ers!
>
> I wanted to show off something I've been building for the past few
> days: Functional Reactive Programming with Shoes!
>
> Basically, I'm at a conference, and someone showed off a FRP library
> in JavaScript, so I've been porting it to Ruby. And one of the better
> applications of FRP is GUI stuff, so of course, I thought of Shoes!
>
> Here's the repo: https://github.com/steveklabnik/frp_shoes
>
> I'm not sure that this is something that'd ever go in Shoes proper,
> but it's pretty neat, in my humble opinion.
>
> Shoes on!
>

Re: [shoes] FRP + Shoes

From:
Steve Klabnik
Date:
2013-04-23 @ 14:21
> I hadn't heard of FRP yet but I like how it looks, very decoupled!

:) Some links:

http://stackoverflow.com/questions/1028250/what-is-functional-reactive-programming

https://github.com/raimohanska/bacon.js#intro

Re: [shoes] FRP + Shoes

From:
Douglas Allen
Date:
2013-04-23 @ 14:10
Thanks Shoes-er! Hi Steve.

I was trying to build good old shoes from github src. 'shoes/shoes'
I noticed that it will try to build from mingw but the good book says that
pkg-config is the easier way. Why doesn't that get implemented into the
extconf.rb? Could this be done?
Most posix systems will include that as well. It is a simple matter to
install the GTK+ package which includes pkg-config. I'm having a hard time
getting the extconf.rb that is in this version of shoes to find my headers.
I get them all but pangocairo.h. And I notice from the pango.pc that it
'Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0' but those last two
are not being looked for in this extconf.rb. I'm still pretty new to doing
any C programming but I do know what a makefile is. It's just that I'm
still pretty new to how Ruby wants to do the generation of one. Any
pointers?


On Tue, Apr 23, 2013 at 8:36 AM, Steve Klabnik <steve@steveklabnik.com>wrote:

> Hey Shoes-ers!
>
> I wanted to show off something I've been building for the past few
> days: Functional Reactive Programming with Shoes!
>
> Basically, I'm at a conference, and someone showed off a FRP library
> in JavaScript, so I've been porting it to Ruby. And one of the better
> applications of FRP is GUI stuff, so of course, I thought of Shoes!
>
> Here's the repo: https://github.com/steveklabnik/frp_shoes
>
> I'm not sure that this is something that'd ever go in Shoes proper,
> but it's pretty neat, in my humble opinion.
>
> Shoes on!
>

Re: [shoes] FRP + Shoes

From:
Douglas Allen
Date:
2013-04-23 @ 14:20
P.S. pangowin32.pc 'Requires: pango'
        cairowin32.pc 'Requires: cairo'
       cairo-win32-font.pc 'Requires: cairo'
        so it doesn't matter if we use them or not because they all have
the same requirements. The win32 ones that is. I don't even know why they
are in there but maybe directives need them that way. Not sure how that
works.


On Tue, Apr 23, 2013 at 9:10 AM, Douglas Allen <kb9agt@gmail.com> wrote:

> Thanks Shoes-er! Hi Steve.
>
> I was trying to build good old shoes from github src. 'shoes/shoes'
> I noticed that it will try to build from mingw but the good book says that
> pkg-config is the easier way. Why doesn't that get implemented into the
> extconf.rb? Could this be done?
> Most posix systems will include that as well. It is a simple matter to
> install the GTK+ package which includes pkg-config. I'm having a hard time
> getting the extconf.rb that is in this version of shoes to find my headers.
> I get them all but pangocairo.h. And I notice from the pango.pc that it
> 'Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0' but those last two
> are not being looked for in this extconf.rb. I'm still pretty new to doing
> any C programming but I do know what a makefile is. It's just that I'm
> still pretty new to how Ruby wants to do the generation of one. Any
> pointers?
>
>
> On Tue, Apr 23, 2013 at 8:36 AM, Steve Klabnik <steve@steveklabnik.com>wrote:
>
>> Hey Shoes-ers!
>>
>> I wanted to show off something I've been building for the past few
>> days: Functional Reactive Programming with Shoes!
>>
>> Basically, I'm at a conference, and someone showed off a FRP library
>> in JavaScript, so I've been porting it to Ruby. And one of the better
>> applications of FRP is GUI stuff, so of course, I thought of Shoes!
>>
>> Here's the repo: https://github.com/steveklabnik/frp_shoes
>>
>> I'm not sure that this is something that'd ever go in Shoes proper,
>> but it's pretty neat, in my humble opinion.
>>
>> Shoes on!
>>
>
>

Re: [shoes] FRP + Shoes

From:
Steve Klabnik
Date:
2013-04-23 @ 14:19
Hey Douglas,

You should make your own thread for this, but really, shoes/shoes
isn't being actively developed, so it's likely that it just won't
build.

Re: [shoes] FRP + Shoes

From:
Douglas Allen
Date:
2013-04-23 @ 14:22
K. Do you think if I asked on this mail list then for some help that maybe
the Shoes-ers out there will help me try it?


On Tue, Apr 23, 2013 at 9:19 AM, Steve Klabnik <steve@steveklabnik.com>wrote:

> Hey Douglas,
>
> You should make your own thread for this, but really, shoes/shoes
> isn't being actively developed, so it's likely that it just won't
> build.
>

Re: [shoes] FRP + Shoes

From:
Douglas Allen
Date:
2013-04-23 @ 14:24
One more quick question. I get permission denied when running rake -T in
some of the branches. Is it because I didn't fork it yet? I just cloned it.


On Tue, Apr 23, 2013 at 9:22 AM, Douglas Allen <kb9agt@gmail.com> wrote:

> K. Do you think if I asked on this mail list then for some help that maybe
> the Shoes-ers out there will help me try it?
>
>
> On Tue, Apr 23, 2013 at 9:19 AM, Steve Klabnik <steve@steveklabnik.com>wrote:
>
>> Hey Douglas,
>>
>> You should make your own thread for this, but really, shoes/shoes
>> isn't being actively developed, so it's likely that it just won't
>> build.
>>
>
>

Re: [shoes] FRP + Shoes

From:
Arne Brasseur
Date:
2013-04-23 @ 14:53
Hi Douglas,

If I may pitch in at this point... like Steve said no one is really working
on Shoes 3 any more. If you have fixes for existing issues then that's
great and very much appreciated, but consider if perhaps your time is not
better spent improving Shoes 4.

We're a bit in a vacuum at the moment between the bit-rotting Shoes 3 and
the not-quite-ready-for-prime-time Shoes 4. It's unfortunate but that's
just how it is. From reading CLOSURE I think even _why got tired of
developing for three platforms simultaneously and "chasing NULL". At the
moment it seems in particular the windows build is broken, and unless a
windows API expert with lots of patience steps in that's unlikely to change.

If you need a Shoes for your app today I would suggest you give Shoes 4 or
Green Shoes a try and report any issues you find.

Arne

On 23 April 2013 16:24, Douglas Allen <kb9agt@gmail.com> wrote:

> One more quick question. I get permission denied when running rake -T in
> some of the branches. Is it because I didn't fork it yet? I just cloned it.
>
>
> On Tue, Apr 23, 2013 at 9:22 AM, Douglas Allen <kb9agt@gmail.com> wrote:
>
>> K. Do you think if I asked on this mail list then for some help that
>> maybe the Shoes-ers out there will help me try it?
>>
>>
>> On Tue, Apr 23, 2013 at 9:19 AM, Steve Klabnik <steve@steveklabnik.com>wrote:
>>
>>> Hey Douglas,
>>>
>>> You should make your own thread for this, but really, shoes/shoes
>>> isn't being actively developed, so it's likely that it just won't
>>> build.
>>>
>>
>>
>

Re: [shoes] FRP + Shoes

From:
Steve Klabnik
Date:
2013-04-23 @ 14:59
Bringing it back on-topic....

Eric, you had a question on Twitter:
https://twitter.com/wasnotrice/status/326691975006920704

Yes, you push arbitrary Ruby objects onto streams, and then can
process them however you want. I'm not 100% sure how you'd build a
Capybara, but I think it could be done.

Re: [shoes] FRP + Shoes

From:
J. Kaiden
Date:
2013-04-23 @ 21:33
hey Steve and all -

  wow - this looks really neat - going to read up on it...  thanks for the
links.

 - j


On Tue, Apr 23, 2013 at 4:59 PM, Steve Klabnik <steve@steveklabnik.com>wrote:

> Bringing it back on-topic....
>
> Eric, you had a question on Twitter:
> https://twitter.com/wasnotrice/status/326691975006920704
>
> Yes, you push arbitrary Ruby objects onto streams, and then can
> process them however you want. I'm not 100% sure how you'd build a
> Capybara, but I think it could be done.
>

Re: [shoes] FRP + Shoes

From:
ashbb
Date:
2013-04-25 @ 14:37
Hi Steve,

I don't know about FRP. So, I have a question. ;-)

Can you say the following code is written in FRP style?
The update seems to be handled in just one place.

Shoes.app :height => 150, :width => 250 do
  background rgb(240, 250, 208)
  blk = proc do |s|
      eval "@count = @count #{s.text}"
      @label.replace "Current count: #@count"
  end
  stack :margin => 10 do
    button "+1", &blk
    button "-1", &blk
    @count = 0
    @label = para "Current count: #@count"
  end
end

ashbb

Re: [shoes] FRP + Shoes

From:
Steve Klabnik
Date:
2013-04-25 @ 17:11
Hey ash!

It's not written in FRP style because FRP is about two things:

1. Emitting streams of events.
2. Processing those streams by using map and filter.

That is another way to write the app so that it only has one set of
processing rules, of course :)

I'm excited to have a more stable Shoes so we can actually start
figuring out the best way to build Shoes apps. :D

Re: [shoes] FRP + Shoes

From:
ashbb
Date:
2013-04-28 @ 00:43
Hi Steve,

> FRP is about two things:
>
> 1. Emitting streams of events.
> 2. Processing those streams by using map and filter.
Aha, I see, thanks.

I don't understand the advantage of FRP style coding yet.
But I'm looking forward to further progress in this project. ;-)

Cheers,
ashbb

Re: [shoes] FRP + Shoes

From:
Steve Klabnik
Date:
2013-04-28 @ 02:36
We'll see if it makes sense here. :)

In JavaScript, it helps get rid of tons of nested callbacks:
http://blog.flowdock.com/2013/01/22/functional-reactive-programming-with-bacon-js/