9front - general discussion about 9front
 help / color / mirror / Atom feed
* bio io functions
@ 2017-05-04 16:02 Julius Schmidt
  2017-05-04 16:23 ` [9front] " Benjamin Purcell
  0 siblings, 1 reply; 16+ messages in thread
From: Julius Schmidt @ 2017-05-04 16:02 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: TEXT/PLAIN, Size: 525 bytes --]

I would like to change bio to do all I/O through a user replaceable 
function. The attached patch does just that, adding a new function Biofn() 
to register such a function, which replaces read/write.

Main uses I have in mind:

1. Allow programs to flush output buffers before stalling for more input, 
which would most likely be activated with a command line flag.

2. Use bio with things that are not file descriptors.

3. Apply filters to input/outputs (arguably could also be done with 
pipes).

4. Use bio with ioprocs.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: TEXT/x-diff; name=bio.patch, Size: 4208 bytes --]

diff -r 36315eb9647c sys/include/bio.h
--- a/sys/include/bio.h	Tue May 02 04:07:21 2017 +0200
+++ b/sys/include/bio.h	Thu May 04 15:50:15 2017 +0000
@@ -33,6 +33,7 @@
 	uchar*	ebuf;		/* pointer to end of buffer */
 	uchar*	gbuf;		/* pointer to good data in buf */
 	void	(*errorf)(char *);	/* called on error if not nil */
+	int	(*iof)(Biobufhdr*, void *, long);	/* called to do i/o */
 };
 
 struct	Biobuf
@@ -74,6 +75,7 @@
 long	Bwrite(Biobufhdr*, void*, long);
 void	Blethal(Biobufhdr*, void(*)(char*));
 void	Berror(Biobufhdr*, char*, ...);
+void	Biofn(Biobufhdr*, int(*)(Biobufhdr*, void*, long));
 
 #pragma	varargck	argpos	Bprint	2
 #pragma	varargck	argpos	Berror	2
diff -r 36315eb9647c sys/src/libbio/bflush.c
--- a/sys/src/libbio/bflush.c	Tue May 02 04:07:21 2017 +0200
+++ b/sys/src/libbio/bflush.c	Thu May 04 15:50:15 2017 +0000
@@ -12,7 +12,7 @@
 		n = bp->bsize+bp->ocount;
 		if(n == 0)
 			return 0;
-		c = write(bp->fid, bp->bbuf, n);
+		c = bp->iof(bp, bp->bbuf, n);
 		if(n == c) {
 			bp->offset += n;
 			bp->ocount = -bp->bsize;
diff -r 36315eb9647c sys/src/libbio/bgetc.c
--- a/sys/src/libbio/bgetc.c	Tue May 02 04:07:21 2017 +0200
+++ b/sys/src/libbio/bgetc.c	Thu May 04 15:50:15 2017 +0000
@@ -24,7 +24,7 @@
 	 * buffer to allow that many ungets.
 	 */
 	memmove(bp->bbuf-Bungetsize, bp->ebuf-Bungetsize, Bungetsize);
-	i = read(bp->fid, bp->bbuf, bp->bsize);
+	i = bp->iof(bp, bp->bbuf, bp->bsize);
 	bp->gbuf = bp->bbuf;
 	if(i <= 0) {
 		bp->state = Bracteof;
diff -r 36315eb9647c sys/src/libbio/binit.c
--- a/sys/src/libbio/binit.c	Tue May 02 04:07:21 2017 +0200
+++ b/sys/src/libbio/binit.c	Thu May 04 15:50:15 2017 +0000
@@ -50,6 +50,18 @@
 	}
 }
 
+static int
+bioread(Biobufhdr *bp, void *v, long n)
+{
+	return read(bp->fid, v, n);
+}
+
+static int
+biowrite(Biobufhdr *bp, void *v, long n)
+{
+	return write(bp->fid, v, n);
+}
+
 int
 Binits(Biobufhdr *bp, int f, int mode, uchar *p, int size)
 {
@@ -64,12 +76,14 @@
 	case OREAD:
 		bp->state = Bractive;
 		bp->ocount = 0;
+		bp->iof = bioread;
 		break;
 
 	case OWRITE:
 		install(bp);
 		bp->state = Bwactive;
 		bp->ocount = -size;
+		bp->iof = biowrite;
 		break;
 	}
 	bp->bbuf = p;
@@ -154,3 +168,15 @@
 	/* otherwise opened with Binit(s) */
 	return r;
 }
+
+void
+Biofn(Biobufhdr *bp, int (*f)(Biobufhdr *, void *, long))
+{
+	if(f == nil)
+		if(bp->state == Bwactive)
+			bp->iof = biowrite;
+		else
+			bp->iof = bioread;
+	else
+		bp->iof = f;
+}
diff -r 36315eb9647c sys/src/libbio/brdline.c
--- a/sys/src/libbio/brdline.c	Tue May 02 04:07:21 2017 +0200
+++ b/sys/src/libbio/brdline.c	Thu May 04 15:50:15 2017 +0000
@@ -46,7 +46,7 @@
 	 */
 	ip = (char*)bp->bbuf + i;
 	while(i < bp->bsize) {
-		j = read(bp->fid, ip, bp->bsize-i);
+		j = bp->iof(bp, ip, bp->bsize-i);
 		if(j < 0)
 			Berror(bp, "read error: %r");
 		if(j <= 0) {
diff -r 36315eb9647c sys/src/libbio/brdstr.c
--- a/sys/src/libbio/brdstr.c	Tue May 02 04:07:21 2017 +0200
+++ b/sys/src/libbio/brdstr.c	Thu May 04 15:50:15 2017 +0000
@@ -69,7 +69,7 @@
 	for(;;){
 		ip = (char*)bp->bbuf + i;
 		while(i < bp->bsize) {
-			j = read(bp->fid, ip, bp->bsize-i);
+			j = bp->iof(bp, ip, bp->bsize-i);
 			if(j < 0)
 				Berror(bp, "read error: %r");
 			if(j <= 0 && i == 0)
diff -r 36315eb9647c sys/src/libbio/bread.c
--- a/sys/src/libbio/bread.c	Tue May 02 04:07:21 2017 +0200
+++ b/sys/src/libbio/bread.c	Thu May 04 15:50:15 2017 +0000
@@ -20,7 +20,7 @@
 		if(n == 0) {
 			if(bp->state != Bractive)
 				break;
-			i = read(bp->fid, bp->bbuf, bp->bsize);
+			i = bp->iof(bp, bp->bbuf, bp->bsize);
 			if(i <= 0) {
 				bp->state = Bracteof;
 				if(i < 0) {
diff -r 36315eb9647c sys/src/libbio/bwrite.c
--- a/sys/src/libbio/bwrite.c	Tue May 02 04:07:21 2017 +0200
+++ b/sys/src/libbio/bwrite.c	Thu May 04 15:50:15 2017 +0000
@@ -21,7 +21,7 @@
 		if(n == 0) {
 			if(bp->state != Bwactive)
 				return Beof;
-			i = write(bp->fid, bp->bbuf, bp->bsize);
+			i = bp->iof(bp, bp->bbuf, bp->bsize);
 			if(i != bp->bsize) {
 				errstr(errbuf, sizeof errbuf);
 				if(strstr(errbuf, "interrupt") == nil) {

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-04 16:02 bio io functions Julius Schmidt
@ 2017-05-04 16:23 ` Benjamin Purcell
  2017-05-04 17:52   ` Giacomo Tesio
  0 siblings, 1 reply; 16+ messages in thread
From: Benjamin Purcell @ 2017-05-04 16:23 UTC (permalink / raw)
  To: 9front

I love it

spew

On Thu, May 4, 2017 at 11:02 AM, Julius Schmidt <aiju@phicode.de> wrote:
> I would like to change bio to do all I/O through a user replaceable
> function. The attached patch does just that, adding a new function Biofn()
> to register such a function, which replaces read/write.
>
> Main uses I have in mind:
>
> 1. Allow programs to flush output buffers before stalling for more input,
> which would most likely be activated with a command line flag.
>
> 2. Use bio with things that are not file descriptors.
>
> 3. Apply filters to input/outputs (arguably could also be done with pipes).
>
> 4. Use bio with ioprocs.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-04 16:23 ` [9front] " Benjamin Purcell
@ 2017-05-04 17:52   ` Giacomo Tesio
  2017-05-04 20:18     ` Bruce Ellis
  0 siblings, 1 reply; 16+ messages in thread
From: Giacomo Tesio @ 2017-05-04 17:52 UTC (permalink / raw)
  To: 9front

Nice idea. What do you have in mind instead of file descriptor?

What about returning the current function from Biofn to allow filters'
composition?


Giacomo

2017-05-04 18:23 GMT+02:00 Benjamin Purcell <benjapurcell@gmail.com>:
> I love it
>
> spew
>
> On Thu, May 4, 2017 at 11:02 AM, Julius Schmidt <aiju@phicode.de> wrote:
>> I would like to change bio to do all I/O through a user replaceable
>> function. The attached patch does just that, adding a new function Biofn()
>> to register such a function, which replaces read/write.
>>
>> Main uses I have in mind:
>>
>> 1. Allow programs to flush output buffers before stalling for more input,
>> which would most likely be activated with a command line flag.
>>
>> 2. Use bio with things that are not file descriptors.
>>
>> 3. Apply filters to input/outputs (arguably could also be done with pipes).
>>
>> 4. Use bio with ioprocs.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-04 17:52   ` Giacomo Tesio
@ 2017-05-04 20:18     ` Bruce Ellis
  2017-05-04 20:21       ` Benjamin Purcell
  2017-05-05  9:11       ` hiro
  0 siblings, 2 replies; 16+ messages in thread
From: Bruce Ellis @ 2017-05-04 20:18 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

Go provides this functionality using interfaces.

brucee

On 5 May 2017 at 03:52, Giacomo Tesio <giacomo@tesio.it> wrote:

> Nice idea. What do you have in mind instead of file descriptor?
>
> What about returning the current function from Biofn to allow filters'
> composition?
>
>
> Giacomo
>
> 2017-05-04 18:23 GMT+02:00 Benjamin Purcell <benjapurcell@gmail.com>:
> > I love it
> >
> > spew
> >
> > On Thu, May 4, 2017 at 11:02 AM, Julius Schmidt <aiju@phicode.de> wrote:
> >> I would like to change bio to do all I/O through a user replaceable
> >> function. The attached patch does just that, adding a new function
> Biofn()
> >> to register such a function, which replaces read/write.
> >>
> >> Main uses I have in mind:
> >>
> >> 1. Allow programs to flush output buffers before stalling for more
> input,
> >> which would most likely be activated with a command line flag.
> >>
> >> 2. Use bio with things that are not file descriptors.
> >>
> >> 3. Apply filters to input/outputs (arguably could also be done with
> pipes).
> >>
> >> 4. Use bio with ioprocs.
>

[-- Attachment #2: Type: text/html, Size: 1766 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-04 20:18     ` Bruce Ellis
@ 2017-05-04 20:21       ` Benjamin Purcell
  2017-05-05  9:11       ` hiro
  1 sibling, 0 replies; 16+ messages in thread
From: Benjamin Purcell @ 2017-05-04 20:21 UTC (permalink / raw)
  To: 9front

On Thu, May 4, 2017 at 3:18 PM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> Go provides this functionality using interfaces.
really I had no idea

> brucee
>
> On 5 May 2017 at 03:52, Giacomo Tesio <giacomo@tesio.it> wrote:
>>
>> Nice idea. What do you have in mind instead of file descriptor?
>>
>> What about returning the current function from Biofn to allow filters'
>> composition?
yuck.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-04 20:18     ` Bruce Ellis
  2017-05-04 20:21       ` Benjamin Purcell
@ 2017-05-05  9:11       ` hiro
  2017-05-05  9:14         ` Bruce Ellis
  1 sibling, 1 reply; 16+ messages in thread
From: hiro @ 2017-05-05  9:11 UTC (permalink / raw)
  To: 9front

On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> Go provides this functionality using interfaces.

are you saying this solution is unnecessarily primitive because it
doesn't use the high level abstraction if interfacing?


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05  9:11       ` hiro
@ 2017-05-05  9:14         ` Bruce Ellis
  2017-05-05  9:55           ` Julius Schmidt
  2017-05-05 10:21           ` Stanley Lieber
  0 siblings, 2 replies; 16+ messages in thread
From: Bruce Ellis @ 2017-05-05  9:14 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

I don't use primitive methods - like bubblesort. I'm saying Go does it
better and elegantly.

brucee

On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:

> On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> > Go provides this functionality using interfaces.
>
> are you saying this solution is unnecessarily primitive because it
> doesn't use the high level abstraction if interfacing?
>

[-- Attachment #2: Type: text/html, Size: 790 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05  9:14         ` Bruce Ellis
@ 2017-05-05  9:55           ` Julius Schmidt
  2017-05-05  9:56             ` Bruce Ellis
  2017-05-05 10:21           ` Stanley Lieber
  1 sibling, 1 reply; 16+ messages in thread
From: Julius Schmidt @ 2017-05-05  9:55 UTC (permalink / raw)
  To: 9front

I wasn't asking about Golang.

On Fri, 5 May 2017, Bruce Ellis wrote:

> I don't use primitive methods - like bubblesort. I'm saying Go does it better and elegantly.
> brucee
> 
> On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:
>       On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>       > Go provides this functionality using interfaces.
>
>       are you saying this solution is unnecessarily primitive because it
>       doesn't use the high level abstraction if interfacing?
> 
> 
> 
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05  9:55           ` Julius Schmidt
@ 2017-05-05  9:56             ` Bruce Ellis
  0 siblings, 0 replies; 16+ messages in thread
From: Bruce Ellis @ 2017-05-05  9:56 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

Well I've told you.

brucee

On 5 May 2017 at 19:55, Julius Schmidt <aiju@phicode.de> wrote:

> I wasn't asking about Golang.
>
>
> On Fri, 5 May 2017, Bruce Ellis wrote:
>
> I don't use primitive methods - like bubblesort. I'm saying Go does it
>> better and elegantly.
>> brucee
>>
>> On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:
>>       On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>       > Go provides this functionality using interfaces.
>>
>>       are you saying this solution is unnecessarily primitive because it
>>       doesn't use the high level abstraction if interfacing?
>>
>>
>>
>>
>>

[-- Attachment #2: Type: text/html, Size: 1303 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05  9:14         ` Bruce Ellis
  2017-05-05  9:55           ` Julius Schmidt
@ 2017-05-05 10:21           ` Stanley Lieber
  2017-05-05 10:29             ` Bruce Ellis
  1 sibling, 1 reply; 16+ messages in thread
From: Stanley Lieber @ 2017-05-05 10:21 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]



> On May 5, 2017, at 5:14 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> 
> I don't use primitive methods - like bubblesort. I'm saying Go does it better and elegantly.
> 
> brucee
> 
>> On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:
>> On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>> > Go provides this functionality using interfaces.
>> 
>> are you saying this solution is unnecessarily primitive because it
>> doesn't use the high level abstraction if interfacing?

Plan 9 has not yet been re-implemented in Go.

sl


[-- Attachment #2: Type: text/html, Size: 1198 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05 10:21           ` Stanley Lieber
@ 2017-05-05 10:29             ` Bruce Ellis
  2017-05-05 10:32               ` Stanley Lieber
  2017-05-05 15:24               ` Kurt H Maier
  0 siblings, 2 replies; 16+ messages in thread
From: Bruce Ellis @ 2017-05-05 10:29 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]

Go programs run fine on plan9. There are many benefits in replacing plan9
programs with a Go equivalent, e.g. the widespread deployment of algorithms
that use parallelism. What a faster cleaner world it would be.

brucee

On 5 May 2017 at 20:21, Stanley Lieber <sl@stanleylieber.com> wrote:

>
>
> On May 5, 2017, at 5:14 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>
> I don't use primitive methods - like bubblesort. I'm saying Go does it
> better and elegantly.
>
> brucee
>
> On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:
>
>> On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>> > Go provides this functionality using interfaces.
>>
>> are you saying this solution is unnecessarily primitive because it
>> doesn't use the high level abstraction if interfacing?
>
>
> Plan 9 has not yet been re-implemented in Go.
>
> sl
>
>

[-- Attachment #2: Type: text/html, Size: 1852 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05 10:29             ` Bruce Ellis
@ 2017-05-05 10:32               ` Stanley Lieber
  2017-05-05 10:33                 ` Bruce Ellis
  2017-05-05 15:24               ` Kurt H Maier
  1 sibling, 1 reply; 16+ messages in thread
From: Stanley Lieber @ 2017-05-05 10:32 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 1092 bytes --]

On May 5, 2017, at 6:29 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> 
> Go programs run fine on plan9. There are many benefits in replacing plan9 programs with a Go equivalent, e.g. the widespread deployment of algorithms that use parallelism. What a faster cleaner world it would be.
> 
> brucee
> 
>> On 5 May 2017 at 20:21, Stanley Lieber <sl@stanleylieber.com> wrote:
>> 
>> 
>>> On May 5, 2017, at 5:14 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>> 
>>> I don't use primitive methods - like bubblesort. I'm saying Go does it better and elegantly.
>>> 
>>> brucee
>>> 
>>>> On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:
>>>> On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>>> > Go provides this functionality using interfaces.
>>>> 
>>>> are you saying this solution is unnecessarily primitive because it
>>>> doesn't use the high level abstraction if interfacing?
>> 
>> Plan 9 has not yet been re-implemented in Go.
>> 
>> sl

Okay, but is this a pull request or are you just volunteering our Germans for your space program?

sl


[-- Attachment #2: Type: text/html, Size: 2297 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05 10:32               ` Stanley Lieber
@ 2017-05-05 10:33                 ` Bruce Ellis
  2017-05-05 11:05                   ` Stanley Lieber
  2017-05-05 12:11                   ` hiro
  0 siblings, 2 replies; 16+ messages in thread
From: Bruce Ellis @ 2017-05-05 10:33 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

Just stating what I've learnt.

brucee

On 5 May 2017 at 20:32, Stanley Lieber <sl@stanleylieber.com> wrote:

> On May 5, 2017, at 6:29 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>
> Go programs run fine on plan9. There are many benefits in replacing plan9
> programs with a Go equivalent, e.g. the widespread deployment of algorithms
> that use parallelism. What a faster cleaner world it would be.
>
> brucee
>
> On 5 May 2017 at 20:21, Stanley Lieber <sl@stanleylieber.com> wrote:
>
>>
>>
>> On May 5, 2017, at 5:14 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>
>> I don't use primitive methods - like bubblesort. I'm saying Go does it
>> better and elegantly.
>>
>> brucee
>>
>> On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:
>>
>>> On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>> > Go provides this functionality using interfaces.
>>>
>>> are you saying this solution is unnecessarily primitive because it
>>> doesn't use the high level abstraction if interfacing?
>>
>>
>> Plan 9 has not yet been re-implemented in Go.
>>
>> sl
>>
>
> Okay, but is this a pull request or are you just volunteering our Germans
> for your space program?
>
> sl
>
>

[-- Attachment #2: Type: text/html, Size: 2797 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05 10:33                 ` Bruce Ellis
@ 2017-05-05 11:05                   ` Stanley Lieber
  2017-05-05 12:11                   ` hiro
  1 sibling, 0 replies; 16+ messages in thread
From: Stanley Lieber @ 2017-05-05 11:05 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 2460 bytes --]

On May 5, 2017, at 6:33 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> 
> Just stating what I've learnt.
> 
> brucee
> 
>> On 5 May 2017 at 20:32, Stanley Lieber <sl@stanleylieber.com> wrote:
>>> On May 5, 2017, at 6:29 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>> 
>>> Go programs run fine on plan9. There are many benefits in replacing plan9 programs with a Go equivalent, e.g. the widespread deployment of algorithms that use parallelism. What a faster cleaner world it would be.
>>> 
>>> brucee
>>> 
>>>> On 5 May 2017 at 20:21, Stanley Lieber <sl@stanleylieber.com> wrote:
>>>> 
>>>> 
>>>>> On May 5, 2017, at 5:14 AM, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>>>> 
>>>>> I don't use primitive methods - like bubblesort. I'm saying Go does it better and elegantly.
>>>>> 
>>>>> brucee
>>>>> 
>>>>>> On 5 May 2017 at 19:11, hiro <23hiro@gmail.com> wrote:
>>>>>> On 5/4/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
>>>>>> > Go provides this functionality using interfaces.
>>>>>> 
>>>>>> are you saying this solution is unnecessarily primitive because it
>>>>>> doesn't use the high level abstraction if interfacing?
>>>> 
>>>> Plan 9 has not yet been re-implemented in Go.
>>>> 
>>>> sl
>> 
>> Okay, but is this a pull request or are you just volunteering our Germans for your space program?
>> 
>> sl

Not trying to be a dick, just observing that a C library function used throughout the system might not be the first place to start sneaking in Go. The implication would obviously be rewriting all the programs that rely upon it in this other language, and that would be a big job. "Just use Go" in this context is either unrealistic advice or a non sequitur.

Other nits: Go is not really a first class citizen on Plan 9. It cannot even be bootstrapped on 9front/386 or 9front/arm. There are unfixed bugs that complicate networking and process reclamation. For these and other reasons, the Germans already declared 9front would never ship Go. Circling back to the original suggestion, this precludes rewriting the system in Go.

Go offers some advantages over C, but also brings with it a lot of code, mechanism, and culture that attempts to solve problems that are not even present in Plan 9. I run Go programs on production Plan 9 systems every day, but it's not quite so simple as just re-implementing stuff that already works in a completely different language just to... What, exactly?

sl


[-- Attachment #2: Type: text/html, Size: 4280 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05 10:33                 ` Bruce Ellis
  2017-05-05 11:05                   ` Stanley Lieber
@ 2017-05-05 12:11                   ` hiro
  1 sibling, 0 replies; 16+ messages in thread
From: hiro @ 2017-05-05 12:11 UTC (permalink / raw)
  To: 9front

On 5/5/17, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> Just stating what I've learnt.

Thanks. I appreciate opinions that oppose my understanding.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9front] bio io functions
  2017-05-05 10:29             ` Bruce Ellis
  2017-05-05 10:32               ` Stanley Lieber
@ 2017-05-05 15:24               ` Kurt H Maier
  1 sibling, 0 replies; 16+ messages in thread
From: Kurt H Maier @ 2017-05-05 15:24 UTC (permalink / raw)
  To: 9front

On Fri, May 05, 2017 at 08:29:08PM +1000, Bruce Ellis wrote:
> Go programs run fine on plan9. 

Some go programs might

on specific architectures

until we have to patch the kernel again

etc

> There are many benefits in replacing plan9
> programs with a Go equivalent, e.g. the widespread deployment of algorithms
> that use parallelism. What a faster cleaner world it would be.

Go's GC shit is incompatible with security.  I know a lot of programmers
are excited about the new models of training wheels but there will
always be places where you're going to have to use a real programming
language


sorry about your world

khm


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-05-05 15:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04 16:02 bio io functions Julius Schmidt
2017-05-04 16:23 ` [9front] " Benjamin Purcell
2017-05-04 17:52   ` Giacomo Tesio
2017-05-04 20:18     ` Bruce Ellis
2017-05-04 20:21       ` Benjamin Purcell
2017-05-05  9:11       ` hiro
2017-05-05  9:14         ` Bruce Ellis
2017-05-05  9:55           ` Julius Schmidt
2017-05-05  9:56             ` Bruce Ellis
2017-05-05 10:21           ` Stanley Lieber
2017-05-05 10:29             ` Bruce Ellis
2017-05-05 10:32               ` Stanley Lieber
2017-05-05 10:33                 ` Bruce Ellis
2017-05-05 11:05                   ` Stanley Lieber
2017-05-05 12:11                   ` hiro
2017-05-05 15:24               ` Kurt H Maier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).