Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Passing data between programs. (MAN)
2. Re: Passing data between programs. (Patrick LeBoutillier)
3. Re: Passing data between programs. (MAN)
----------------------------------------------------------------------
Message: 1
Date: Tue, 12 Apr 2011 12:35:30 -0300
From: MAN <[email protected]>
Subject: Re: [Haskell-beginners] Passing data between programs.
To: Mike Meyer <[email protected]>
Cc: [email protected]
Message-ID: <1302622530.2463.30.camel@dy-book>
Content-Type: text/plain; charset="UTF-8"
Pipes seem a bit better than sockets. I'm investigating the possibility
right now. As I read about sockets I remembered there's Haskell bindings
to DBus... has anybody used it? ever? (last update was over 4 years
ago).
El mar, 12-04-2011 a las 00:45 -0400, Mike Meyer escribi?:
> On Tue, 12 Apr 2011 00:45:57 -0300
> MAN <[email protected]> wrote:
>
> > I've had this problem for a while now, and it's about time I recognize I
> > need help :P
> > I've written a few programs in Haskell that excel at numeric and/or
> > complex computations; I love the efficiency of the language. I do not
> > love, however, writing GUIs for this pieces of software.
> > Perhaps it's the echoes of bad times past when trying to install gtk2hs,
> > or that I know I can crank up some decent UIs in other languages faster.
> > Whatever the reason, I've been thinking of writing the GUI for my
> > programs as an extension of the program itself, possibly in another
> > language.
> > Assuming the GUI is written in, say, Python, and want to pass data to
> > the underlying Haskell program, how to send it? I'd like to avoid
> > touching the disk, but I don't have enough experience to answer my own
> > questions:
> > - command line arguments? what if data is large?
>
> Pipes? At least on Unix. One of the two halves of the program starts
> the other, with standard input & output for the child going to/from
> the parent.
>
> > - client GUI, server Haskell program, and unix sockets? is there a
> > simpler way?
>
> These days, pipes seem to be built on top of/using the same
> architecture as sockets, so the difference between this and my pipes
> suggestion is that the pipes doesn't have to deal with rendezvous
> issues.
>
> Come to think of it, Joel Bartlett at DECWRL had a system called ezd
> that looked a lot like this, except he did it the other way around:
> his server (written in Scheme) provided high-level (for the time)
> graphics primitives whose interface was a pair of pipes. I played with
> it some back in the day, and I recall it as pretty spiffy (especially
> using Bartlett's Scheme compiler for the front end).
>
> And the internet hasn't forgotten it! I found a copy of his WRL Tech
> Report on it:
> http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-91-6.html
>
> <mike
------------------------------
Message: 2
Date: Tue, 12 Apr 2011 21:13:31 -0400
From: Patrick LeBoutillier <[email protected]>
Subject: Re: [Haskell-beginners] Passing data between programs.
To: MAN <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
Sometimes what I like to do is just make my backend program read
commands from stdin and answer back on stdout.
That keeps it simple, plus it's easy to test the backend.
Then from the frontend you can start the backend using pipes as
described by Mike earlier. From Perl I would probably use something
like http://search.cpan.org/~rjbs/perl-5.12.3/ext/IPC-Open2/lib/IPC/Open2.pm,
there probably is something similar for Python.
Patrick
On Tue, Apr 12, 2011 at 11:35 AM, MAN <[email protected]> wrote:
> Pipes seem a bit better than sockets. I'm investigating the possibility
> right now. As I read about sockets I remembered there's Haskell bindings
> to DBus... has anybody used it? ever? (last update was over 4 years
> ago).
>
> El mar, 12-04-2011 a las 00:45 -0400, Mike Meyer escribi?:
>> On Tue, 12 Apr 2011 00:45:57 -0300
>> MAN <[email protected]> wrote:
>>
>> > I've had this problem for a while now, and it's about time I recognize I
>> > need help :P
>> > I've written a few programs in Haskell that excel at numeric and/or
>> > complex computations; I love the efficiency of the language. I do not
>> > love, however, writing GUIs for this pieces of software.
>> > Perhaps it's the echoes of bad times past when trying to install gtk2hs,
>> > or that I know I can crank up some decent UIs in other languages faster.
>> > Whatever the reason, I've been thinking of writing the GUI for my
>> > programs as an extension of the program itself, possibly in another
>> > language.
>> > Assuming the GUI is written in, say, Python, and want to pass data to
>> > the underlying Haskell program, how to send it? I'd like to avoid
>> > touching the disk, but I don't have enough experience to answer my own
>> > questions:
>> > - command line arguments? what if data is large?
>>
>> Pipes? At least on Unix. One of the two halves of the program starts
>> the other, with standard input & output for the child going to/from
>> the parent.
>>
>> > - client GUI, server Haskell program, and unix sockets? is there a
>> > simpler way?
>>
>> These days, pipes seem to be built on top of/using the same
>> architecture as sockets, so the difference between this and my pipes
>> suggestion is that the pipes doesn't have to deal with rendezvous
>> issues.
>>
>> Come to think of it, Joel Bartlett at DECWRL had a system called ezd
>> that looked a lot like this, except he did it the other way around:
>> his server (written in Scheme) provided high-level (for the time)
>> graphics primitives whose interface was a pair of pipes. I played with
>> it some back in the day, and I recall it as pretty spiffy (especially
>> using Bartlett's Scheme compiler for the front end).
>>
>> And the internet hasn't forgotten it! I found a copy of his WRL Tech
>> Report on it:
>> http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-91-6.html
>>
>> ? ? ? ?<mike
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
--
=====================
Patrick LeBoutillier
Rosem?re, Qu?bec, Canada
------------------------------
Message: 3
Date: Tue, 12 Apr 2011 22:35:13 -0300
From: MAN <[email protected]>
Subject: Re: [Haskell-beginners] Passing data between programs.
To: Patrick LeBoutillier <[email protected]>
Cc: [email protected]
Message-ID: <1302658513.2223.1.camel@dy-book>
Content-Type: text/plain; charset="UTF-8"
I thinks you're all right. DBus is not the tool for this job (it does
more, and is slower). Alas, pipes it is.
Thanks, everyone!
El mar, 12-04-2011 a las 21:13 -0400, Patrick LeBoutillier escribi?:
> Hi,
>
> Sometimes what I like to do is just make my backend program read
> commands from stdin and answer back on stdout.
>
> That keeps it simple, plus it's easy to test the backend.
>
> Then from the frontend you can start the backend using pipes as
> described by Mike earlier. From Perl I would probably use something
> like http://search.cpan.org/~rjbs/perl-5.12.3/ext/IPC-Open2/lib/IPC/Open2.pm,
> there probably is something similar for Python.
>
> Patrick
>
>
> On Tue, Apr 12, 2011 at 11:35 AM, MAN <[email protected]> wrote:
> > Pipes seem a bit better than sockets. I'm investigating the possibility
> > right now. As I read about sockets I remembered there's Haskell bindings
> > to DBus... has anybody used it? ever? (last update was over 4 years
> > ago).
> >
> > El mar, 12-04-2011 a las 00:45 -0400, Mike Meyer escribi?:
> >> On Tue, 12 Apr 2011 00:45:57 -0300
> >> MAN <[email protected]> wrote:
> >>
> >> > I've had this problem for a while now, and it's about time I recognize I
> >> > need help :P
> >> > I've written a few programs in Haskell that excel at numeric and/or
> >> > complex computations; I love the efficiency of the language. I do not
> >> > love, however, writing GUIs for this pieces of software.
> >> > Perhaps it's the echoes of bad times past when trying to install gtk2hs,
> >> > or that I know I can crank up some decent UIs in other languages faster.
> >> > Whatever the reason, I've been thinking of writing the GUI for my
> >> > programs as an extension of the program itself, possibly in another
> >> > language.
> >> > Assuming the GUI is written in, say, Python, and want to pass data to
> >> > the underlying Haskell program, how to send it? I'd like to avoid
> >> > touching the disk, but I don't have enough experience to answer my own
> >> > questions:
> >> > - command line arguments? what if data is large?
> >>
> >> Pipes? At least on Unix. One of the two halves of the program starts
> >> the other, with standard input & output for the child going to/from
> >> the parent.
> >>
> >> > - client GUI, server Haskell program, and unix sockets? is there a
> >> > simpler way?
> >>
> >> These days, pipes seem to be built on top of/using the same
> >> architecture as sockets, so the difference between this and my pipes
> >> suggestion is that the pipes doesn't have to deal with rendezvous
> >> issues.
> >>
> >> Come to think of it, Joel Bartlett at DECWRL had a system called ezd
> >> that looked a lot like this, except he did it the other way around:
> >> his server (written in Scheme) provided high-level (for the time)
> >> graphics primitives whose interface was a pair of pipes. I played with
> >> it some back in the day, and I recall it as pretty spiffy (especially
> >> using Bartlett's Scheme compiler for the front end).
> >>
> >> And the internet hasn't forgotten it! I found a copy of his WRL Tech
> >> Report on it:
> >> http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-91-6.html
> >>
> >> <mike
> >
> >
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> >
>
>
>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 34, Issue 22
*****************************************