Re: anyone define port types?

2016-06-23 Thread William ML Leslie
On 23 June 2016 at 20:43, Andy Wingo wrote: > On Thu 23 Jun 2016 11:24, Chris Vine writes: >> Secondly, as I understand it in the end you want pre-emptive "green" >> threads for guile, whereas my code equates to co-operative >> multi-tasking, whilst

Re: anyone define port types?

2016-06-23 Thread Andy Wingo
On Thu 23 Jun 2016 11:24, Chris Vine writes: > A few things on that. First, there will always be a use for an event > loop to do event-loopy things, irrespective of whether and how a > coroutine interface is put around it. Sometimes you want to abstract > things

Re: anyone define port types?

2016-06-23 Thread Marko Rauhamaa
Chris Vine : > First, there will always be a use for an event loop to do event-loopy > things, irrespective of whether and how a coroutine interface is put > around it. Sometimes you want to abstract things away, sometimes you > don't. Callback hell is my preferred

Re: anyone define port types?

2016-06-23 Thread Chris Vine
On Thu, 23 Jun 2016 09:36:48 +0200 Andy Wingo wrote: [snip] > Excellent. Though I think that eventually we will want to bless one > of these concurrency patterns as the default one, we're a long way > away from that, and even if we do bless one I think we will always > want to

Re: anyone define port types?

2016-06-23 Thread Andy Wingo
Little typo: On Thu 23 Jun 2016 09:36, Andy Wingo writes: > The only drawback that I know of with the strategy of simply allowing > users to use Guile's I/O primitives (e.g., `read-line') and assuming > that they'll suspend when they block is that not all of the primitives >

Re: anyone define port types?

2016-06-23 Thread Andy Wingo
On Thu 23 Jun 2016 00:44, Chris Vine writes: > I have stirred myself and installed guile-2.1.3. On looking more at > the suspendable ports code it became obvious and I haven't needed to > adopt anything like ethreads with its "thread" abstraction: instead I > have

Re: anyone define port types?

2016-06-22 Thread Chris Vine
On Mon, 20 Jun 2016 10:01:57 +0100 Chris Vine wrote: > On Mon, 20 Jun 2016 09:34:26 +0200 > Andy Wingo wrote: > [snip] > > I must not be communicating clearly because this is definitely not > > what I am proposing. The prompt doesn't service

Re: anyone define port types?

2016-06-20 Thread Chris Vine
On Mon, 20 Jun 2016 09:34:26 +0200 Andy Wingo wrote: [snip] > I must not be communicating clearly because this is definitely not > what I am proposing. The prompt doesn't service anything, and it's > just the one user-space thread which is suspended, and when it > suspends, it

Re: anyone define port types?

2016-06-20 Thread Andy Wingo
On Mon 20 Jun 2016 08:45, Chris Vine writes: > For simplicity, let's say you have a file watch in the glib event loop > which has made a non-blocking read of the first byte of a multi-byte > UTF-8 character, and the suspendable-ports implementation is in use >

Re: anyone define port types?

2016-06-20 Thread Chris Vine
On Mon, 20 Jun 2016 13:38:39 +1000 William ML Leslie wrote: > On 20 June 2016 at 06:09, Chris Vine > wrote: > > OK I am grateful for your patience in explaining this. I need to > > think about it, but while this works where all events

Re: anyone define port types?

2016-06-19 Thread William ML Leslie
On 20 June 2016 at 06:09, Chris Vine wrote: > OK I am grateful for your patience in explaining this. I need to think > about it, but while this works where all events come from user-derived > events, I doubt that this would work with guile-gnome and the glib main >

Re: anyone define port types?

2016-06-19 Thread Chris Vine
On Sun, 19 Jun 2016 19:48:03 +0200 Andy Wingo wrote: > On Sun 19 Jun 2016 17:33, Chris Vine > writes: > > > The answer I have adopted when reading from TCP sockets is to > > extract individual bytes only from the port into a bytevector using > >

Re: anyone define port types?

2016-06-19 Thread Andy Wingo
On Sun 19 Jun 2016 17:33, Chris Vine writes: > The answer I have adopted when reading from TCP sockets is to extract > individual bytes only from the port into a bytevector using R6RS's > get-u8 procedure and (if the port is textual rather than binary) to >

Re: anyone define port types?

2016-06-19 Thread Chris Vine
On Sun, 19 Jun 2016 11:13:17 +0200 Andy Wingo wrote: > Hi :) > > On Sun 12 Jun 2016 10:25, Chris Vine > writes: > > >> > >> http://www.gnu.org/software/guile/docs/master/guile.html/Input-and-Output.html > >> > > > > The documentation

Re: anyone define port types?

2016-06-19 Thread Andy Wingo
Hi, You are arguing for new I/O primitives with different semantics, and that's fine and good :) My goal was to add the ability to sensibly work with non-blocking ports using Guile's existing primitives, especially the textual ones. This effort was started because of the ethreads work I did

Re: anyone define port types?

2016-06-19 Thread Andy Wingo
Hi :) On Sun 12 Jun 2016 10:25, Chris Vine writes: >> >> http://www.gnu.org/software/guile/docs/master/guile.html/Input-and-Output.html > > The documentation indicates that with the C ports implementation in > guile-2.2, reads will block on non-blocking file

Re: anyone define port types?

2016-06-12 Thread Chris Vine
On Sat, 11 Jun 2016 19:02:09 +0200 Andy Wingo wrote: > On Thu 14 Apr 2016 16:08, l...@gnu.org (Ludovic Courtès) writes: > > > Andy Wingo skribis: > > > >> I am working on improving our port implementation to take > >> advantage of the opportunity to break ABI

Re: anyone define port types?

2016-06-11 Thread Andy Wingo
On Thu 14 Apr 2016 16:08, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> I am working on improving our port implementation to take advantage of >> the opportunity to break ABI in 2.2. I am wondering how much I can >> break C API as well -- there are some

Re: anyone define port types?

2016-06-11 Thread Andy Wingo
On Fri 01 Apr 2016 16:38, l...@gnu.org (Ludovic Courtès) writes: > Here’s a port type! :-) > > https://gitlab.com/gnutls/gnutls/blob/master/guile/src/core.c#L785 Thanks! So port types written in C will have to change unfortunately :/ From NEWS: ** Complete overhaul of port internals

Re: anyone define port types?

2016-06-11 Thread Andy Wingo
On Wed 30 Mar 2016 08:29, Panicz Maciej Godek writes: > Hi Andy, > I have been using soft ports to implement a text widget in my GUI > framework. I also used GOOPS, which I regret to this day, and so the > whole framework needs a serious rewrite, but if you're collecting

Re: anyone define port types?

2016-06-11 Thread Andy Wingo
On Wed 06 Apr 2016 01:55, Matt Wette writes: >> On Apr 5, 2016, at 7:06 AM, Mark H Weaver wrote: >> >> Matt Wette writes: >> On Mar 28, 2016, at 12:04 PM, Andy Wingo wrote: I am working on

Re: anyone define port types?

2016-04-14 Thread Ludovic Courtès
Hey! Andy Wingo skribis: > I am working on improving our port implementation to take advantage of > the opportunity to break ABI in 2.2. I am wondering how much I can > break C API as well -- there are some changes that would allow better > user-space threading > (e.g.

Re: anyone define port types?

2016-04-05 Thread Matt Wette
> On Apr 5, 2016, at 7:06 AM, Mark H Weaver wrote: > > Matt Wette writes: > >>> On Mar 28, 2016, at 12:04 PM, Andy Wingo wrote: >>> I am working on improving our port implementation to take advantage of >>> the opportunity to break

Re: anyone define port types?

2016-04-05 Thread Mark H Weaver
Matt Wette writes: >> On Mar 28, 2016, at 12:04 PM, Andy Wingo wrote: >> I am working on improving our port implementation to take advantage of >> the opportunity to break ABI in 2.2. I am wondering how much I can >> break C API as well -- there are

Re: anyone define port types?

2016-04-01 Thread Ludovic Courtès
Hello! Here’s a port type! :-) https://gitlab.com/gnutls/gnutls/blob/master/guile/src/core.c#L785 Ludo’.

Re: anyone define port types?

2016-03-31 Thread Marko Rauhamaa
Jan Wedekind : > On Thu, 31 Mar 2016, Marko Rauhamaa wrote: >> (get-x) is only a fig leaf for (slot-ref). In general, no user of an >> object should think the object holds a piece of information >> called x. Instead, you should be interacting with the abstract object >> . > >

Re: anyone define port types?

2016-03-31 Thread Jan Wedekind
On Thu, 31 Mar 2016, Marko Rauhamaa wrote: Jan Wedekind : On Wed, 30 Mar 2016, Marko Rauhamaa wrote: GOOPS' has the worst possible object model: objects are seen as mere data records. The concept of a "slot" is an anathema to OOP. Ok, I have updated the example to use

Re: anyone define port types?

2016-03-31 Thread Marko Rauhamaa
Barry Fishman : > On 2016-03-30 22:57:25 +0300, Marko Rauhamaa wrote: >> All you can serialize is information. Objects are living things we >> experience through interactions alone. > > Do we really want our computers to behave like organic black boxes? I'll say yes. > In

Re: anyone define port types?

2016-03-31 Thread Barry Fishman
On 2016-03-30 22:57:25 +0300, Marko Rauhamaa wrote: > Panicz Maciej Godek : > >> 2016-03-30 19:53 GMT+02:00 Marko Rauhamaa : >> The problem with closures is, among others, that they are >> non-serializable > > What is there to serialize in objects? How do

Re: anyone define port types?

2016-03-30 Thread Marko Rauhamaa
Jan Wedekind : > On Wed, 30 Mar 2016, Marko Rauhamaa wrote: >> GOOPS' has the worst possible object model: objects are seen as mere >> data records. The concept of a "slot" is an anathema to OOP. > > Ok, I have updated the example to use accessor functions instead of >

Re: anyone define port types?

2016-03-30 Thread Jan Wedekind
On Wed, 30 Mar 2016, Marko Rauhamaa wrote: Jan Wedekind : GOOPS supports "open" classes and multiple-dispatch. E.g. you can extend the "write" method to control how an object is displayed within the Guile REPL [1]. Another interesting approach are multi-methods in Clojure

Re: anyone define port types?

2016-03-30 Thread Jan Wedekind
On Wed, 30 Mar 2016, Marko Rauhamaa wrote: Panicz Maciej Godek : 2016-03-30 13:18 GMT+02:00 Jan Nieuwenhuizen : Panicz Maciej Godek writes: I also used GOOPS, which I regret to this day, and so the whole framework needs a serious rewrite What is

Re: anyone define port types?

2016-03-30 Thread Marko Rauhamaa
Jan Wedekind : > GOOPS supports "open" classes and multiple-dispatch. E.g. you can extend > the "write" method to control how an object is displayed within the > Guile REPL [1]. Another interesting approach are multi-methods in > Clojure which don't even require explicit types

Re: anyone define port types?

2016-03-30 Thread Marko Rauhamaa
Panicz Maciej Godek : > 2016-03-30 19:53 GMT+02:00 Marko Rauhamaa : > The problem with closures is, among others, that they are > non-serializable What is there to serialize in objects? How do you serialize a car? How do you serialize an ant? How do you

Re: anyone define port types?

2016-03-30 Thread Panicz Maciej Godek
2016-03-30 19:53 GMT+02:00 Marko Rauhamaa : > I like OOP, only I don't like GOOPS. Its classes and generic functions > seem so idiomatically out of place, unschemish, if you will. > > This is how OOP ought to be done: > >

Re: anyone define port types?

2016-03-30 Thread Panicz Maciej Godek
2016-03-30 13:18 GMT+02:00 Jan Nieuwenhuizen : > Panicz Maciej Godek writes: > > > I also used GOOPS, which I regret to this day, and so the > > whole framework needs a serious rewrite > > What is it that you do not like about GOOPS? Most specifically, I dislike its middle

Re: anyone define port types?

2016-03-30 Thread Jan Nieuwenhuizen
Panicz Maciej Godek writes: > I also used GOOPS, which I regret to this day, and so the > whole framework needs a serious rewrite What is it that you do not like about GOOPS? I have a project that may be in the same position. I used GOOPS initially, then rewrote it to use either GOOPS, plain

Re: anyone define port types?

2016-03-30 Thread Panicz Maciej Godek
Hi Andy, I have been using soft ports to implement a text widget in my GUI framework. I also used GOOPS, which I regret to this day, and so the whole framework needs a serious rewrite, but if you're collecting various species to the museum of make-soft-port, you can have a look:

Re: anyone define port types?

2016-03-29 Thread Nala Ginrut
On Mon, 2016-03-28 at 21:04 +0200, Andy Wingo wrote: > Hi! > > I am working on improving our port implementation to take advantage of > the opportunity to break ABI in 2.2. I am wondering how much I can > break C API as well -- there are some changes that would allow better > user-space

Re: anyone define port types?

2016-03-29 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Mar 28, 2016 at 09:04:42PM +0200, Andy Wingo wrote: > Hi! > > I am working on improving our port implementation to take advantage of > the opportunity to break ABI in 2.2. I am wondering how much I can > break C API as well -- there are some

Re: anyone define port types?

2016-03-28 Thread Matt Wette
> On Mar 28, 2016, at 12:04 PM, Andy Wingo wrote: > I am working on improving our port implementation to take advantage of > the opportunity to break ABI in 2.2. I am wondering how much I can > break C API as well -- there are some changes that would allow better > user-space

anyone define port types?

2016-03-28 Thread Andy Wingo
Hi! I am working on improving our port implementation to take advantage of the opportunity to break ABI in 2.2. I am wondering how much I can break C API as well -- there are some changes that would allow better user-space threading (e.g.