9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Skip Tavakkolian <skip.tavakkolian@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Go and 21-bit runes (and a bit of Go status)
Date: Mon,  2 Dec 2013 15:26:06 -0800	[thread overview]
Message-ID: <CAJSxfmK1LD8AMJNGGnmW7ZC5Vh2uzr6ZtV1uogJt-DR7jvbZGQ@mail.gmail.com> (raw)
In-Reply-To: <23d08c32941ef86be9e751700edf48b0@coraid.com>

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

At a high level it is about excess baggage that needs to be carried to
provide a familiar environment for either language.  Python needs Posix, so
we have to carry its APE baggage, whereas Go brings its own Plan9-ish
baggage (?[cl], lib9, libbio, etc.) and you'll need to give it some hooks
to hang them on.

To the best of my knowledge, until now the following are the changes to
Plan 9 and/or Go to support Go on Plan 9. Do these seem onerous?

1. Addition of TSEMACQUIRE system call.  Does it have other applications?
2. Use of Go's libbio, rather than Plan 9's. Alternatively libbio on Plan 9
can be changed. It's not clear to me why this would be a bad thing.
3. Modifications to 8g to get around an 8c bug (for the curious, see the
test case from Anthony that reproduces it, below). Go team accepted the
patch to get around this, even though it is a bug in Plan 9's 8c.
4. modification to get around having to use runtime·memmove in
runtime·sighandler
(for the curious, this is because runtime·memmove uses SSE MOVOU
instructions, which touch XMM registers).

* Repro for Plan 9 8c bug:
unsigned long long x;

int f(int);

void
test(void)
{
int a;
 a = f(a-x+a);
}



On Mon, Dec 2, 2013 at 1:51 PM, erik quanstrom <quanstro@labs.coraid.com>wrote:

> On Mon Dec  2 16:08:20 EST 2013, skip.tavakkolian@gmail.com wrote:
> > wait! so, you had to make changes to Plan 9 to support Python? :)
> >
> > (sorry, couldn't resist)
>
> i'll take the bait.
>
> the changes were very different from the changes for go.  python
> is an ape program, and ape has been very neglected.  many
> of these changes were not strictly necessary for the python port.
> none are really python specific.  they fix broken things in ape.
> go needs new system calls, and makes other demands, like the
> silly libbio macros.
>
> here's a highlevel overview of what was done.  stars by the necessary
> changes:
>
> *0.  support for ssl was added to ape by importing mp, sec, bio into
> ape.  also compile crypt from /sys/src/libc/port (necessary to avoid using
> openssl)
>
> *1.  <inttypes.h> was moved to /$objtype/include/ape because it's not
> portable.  (necessary for amd64 port)
>
> *2.  inet_ntop, inet_pton, getaddrinfo (and friends) were added.
> python doesn't work well with old-style name lookup.
>
> *3.  all the system calls have had their signatures corrected e.g.:
>         - extern        int     _RENDEZVOUS(unsigned long, unsigned long);
>         + extern        void*   _RENDEZVOUS(void*, void*);
> this is required for amd64.  change brk() and _buf() accordingly.
>
> *4.  fix frexp, modf, (endian issues, subnormal #s) and copysign().
>
> *5.  make a lame attempt to deal with wait4() vs rfork.
>
> *6.  _IO_getc needs to return EOF on eof.
>
> *7.  fix %p  for 64-bit add vfscanf in stdio; use USED() not #pragma ref
>
> *8.  getsrvbyaddr() remember that htons!
>
> *9.  further envp rework.
>
> *10.  socketpair: wrong signature.
>
> and unnecessary but helpful fixes:
>
> 0.  all ape compoents are built with -VTw to prevent simple linker
> mistakes.  snprintf() now always uses the c99 definition to prevent link
> errors with -T.
>
> *1.  support for ssl was added to ape by importing mp, sec, bio into
> ape.  (necessary to avoid using openssl)
>
> *2.  <inttypes.h> was moved to /$objtype/include/ape because it's not
> portable.  (necessary for amd64 port)
>
> 3. ip6 support was added.
>
> *4.  inet_ntop, inet_pton, getaddrinfo (and friends) were added.
> python doesn't work well with old-style name lookup.
>
> 5.  librexexp was fixed in line with fixes to the normal lib.
>
> 6.  Rune and wchar_t are an uint/int for 21-bit runes.  decode 21-bit
> runes in mbwc.c
>
> 7.  getcallerpc/getfcr implemented for all arches.
>
> 8. make qsort 64-bit safe.
>
> 9.  fix const in strcspn, strpbrk, strrchr, strspn, strstr, rename,
> pathconf
>
> 10.  fix types in setuid, setgid, signal, mkfifo, getgrent, getpwent
>
> 11.  fix conflict between bind() [libdraw] and bind [socket].
>
> 12.  fmt: fix %p; fix %C (21-bit rune)
>
> 13.  utf: 21-bit runes
>
> 14.  libv: fix impossible definition of nap().
>
> - erik
>
>

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

  reply	other threads:[~2013-12-02 23:26 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-02 10:53 lucio
2013-06-02 14:10 ` erik quanstrom
2013-06-02 15:24   ` lucio
2013-06-03  4:20     ` erik quanstrom
2013-06-03  5:38       ` lucio
2013-06-03 13:28         ` erik quanstrom
2013-06-03 16:34           ` lucio
2013-06-03 16:46             ` erik quanstrom
2013-06-03 17:04               ` lucio
2013-06-03 17:07                 ` erik quanstrom
2013-06-03 17:33                   ` Bakul Shah
2013-06-03 17:38                 ` Charles Forsyth
2013-06-03  5:48       ` [9fans] More Go status lucio
2013-06-03 17:53       ` [9fans] SSE in a note handler Steve Simon
2013-06-02 15:01 ` [9fans] Go and 21-bit runes (and a bit of Go status) cinap_lenrek
2013-06-02 15:22   ` lucio
2013-06-02 15:38     ` cinap_lenrek
2013-06-02 15:54       ` lucio
2013-06-02 15:59         ` Kurt H Maier
2013-06-02 16:08           ` lucio
2013-06-02 19:37   ` Anthony Martin
2013-12-02  2:10     ` Skip Tavakkolian
2013-12-02  8:22       ` Anthony Martin
2013-12-02 14:33         ` erik quanstrom
2013-12-02 14:59           ` lucio
2013-12-02 15:22             ` Kurt H Maier
2013-12-02 17:19               ` lucio
2013-12-02 18:39                 ` Kurt H Maier
2013-12-02 20:09                   ` Skip Tavakkolian
2013-12-02 20:11                     ` erik quanstrom
2013-12-02 20:22                       ` Skip Tavakkolian
2013-12-02 20:24                       ` David du Colombier
2013-12-02 20:38                         ` erik quanstrom
2013-12-02 20:44                           ` Bakul Shah
2013-12-02 20:45                             ` erik quanstrom
2013-12-02 20:59                               ` Bakul Shah
2013-12-02 21:03                                 ` erik quanstrom
2013-12-02 23:35                                   ` Bakul Shah
2013-12-03  0:11                                     ` erik quanstrom
2013-12-02 20:45                           ` David du Colombier
2013-12-02 21:06                           ` Skip Tavakkolian
2013-12-02 21:45                             ` Jeff Sickel
2013-12-02 21:47                               ` erik quanstrom
2013-12-02 21:51                             ` erik quanstrom
2013-12-02 23:26                               ` Skip Tavakkolian [this message]
2013-12-02 23:43                                 ` Steve Simon
2013-12-03  0:16                                   ` Anthony Martin
2013-12-03  2:55                                     ` erik quanstrom
2013-12-03  0:12                                 ` erik quanstrom
2013-12-03  0:21                                   ` Anthony Martin
2013-12-03  0:49                                   ` Aram Hăvărneanu
2013-12-03  0:52                                     ` erik quanstrom
2013-12-03  1:01                                       ` Anthony Martin
2013-12-03  1:06                                       ` Jeremy Jackins
2013-12-03  1:34                                         ` Jeff Sickel
2013-12-03  7:43                                           ` lucio
2013-12-03  7:33                                     ` lucio
2013-12-03  7:29                                   ` lucio
2013-12-03 15:20                                     ` erik quanstrom
2013-12-03  7:31                                   ` lucio
2013-12-03  8:14                                     ` Jeff Sickel
2013-12-03  9:16                                       ` lucio
2013-12-03  9:21                                       ` lucio
2013-12-03 14:51                                         ` erik quanstrom
2013-12-03  9:46                                       ` Charles Forsyth
2013-12-03 10:04                                         ` lucio
2013-12-03 11:39                                           ` Aram Hăvărneanu
2013-12-03 14:42                                           ` erik quanstrom
2013-12-03 14:51                                             ` Charles Forsyth
2013-12-03 15:54                                               ` Jeff Sickel
2013-12-03 16:04                                               ` lucio
2013-12-03 16:47                                                 ` Charles Forsyth
2013-12-03 17:44                                                   ` Skip Tavakkolian
2013-12-03 23:12                                                   ` john francis lee
2013-12-04  0:13                                                     ` sl
2013-12-04  4:25                                                   ` lucio
2013-12-04  4:35                                                     ` erik quanstrom
2013-12-04  6:19                                                       ` lucio
2013-12-04  7:04                                                         ` [9fans] Go port [was Re: Go and 21-bit runes (and a bit of Go status)] Jeff Sickel
2013-12-04  7:20                                                           ` [9fans] Go port [was Re: Go and 21-bit runes (and a bit of Go lucio
2013-12-04  7:52                                                             ` Jeff Sickel
2013-12-04 15:11                                                               ` lucio
2013-12-04  4:37                                                     ` [9fans] Go and 21-bit runes (and a bit of Go status) Jens Staal
2013-12-04  4:46                                                       ` erik quanstrom
2013-12-03  7:10                                 ` lucio
2013-12-03  7:23                                   ` Skip Tavakkolian
2013-12-03  7:37                                     ` lucio
2013-12-03 15:04                                     ` erik quanstrom
2013-12-03  9:48                                 ` Richard Miller
2013-12-03 10:08                                   ` lucio
2013-12-03 11:14                                     ` Charles Forsyth
2013-12-03 11:24                                       ` lucio
2013-12-03  6:53                     ` lucio
2013-12-03  4:49                   ` lucio
2013-12-03  8:02                     ` Kurt H Maier
2013-12-03  9:12                       ` lucio
2013-12-02 15:50             ` erik quanstrom
2013-12-02 17:23               ` lucio
2013-12-02 18:35                 ` erik quanstrom
2013-12-03  4:35                   ` lucio
2013-12-02 22:52               ` Anthony Martin
2013-12-03  6:20                 ` andrey mirtchovski
2013-12-02 16:10           ` Skip Tavakkolian
2013-12-02 17:25             ` lucio
2013-12-02 19:13               ` Skip Tavakkolian
2013-12-02 19:34                 ` erik quanstrom
2013-12-03  6:34                   ` lucio
2013-12-03  5:02                 ` lucio
2013-12-02 17:31             ` Jeff Sickel
2013-12-02 17:52               ` lucio
2013-12-02 18:33                 ` erik quanstrom
2013-12-02 19:16                   ` Skip Tavakkolian
2013-12-02 19:26                     ` erik quanstrom
2013-12-02 19:33                       ` Skip Tavakkolian
2013-12-02 19:31                   ` Christopher Nielsen
2013-12-02 20:17                     ` David du Colombier
2013-12-02 19:37                   ` Bakul Shah
2013-12-02 19:57                     ` Skip Tavakkolian
2013-12-03  6:47                       ` lucio
2013-12-03  6:45                     ` lucio
2013-12-03  4:32                   ` lucio
2013-12-03 17:22 erik quanstrom
2013-12-03 17:37 ` Bence Fábián
2013-12-03 17:59   ` erik quanstrom
2013-12-04  5:48 ` lucio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJSxfmK1LD8AMJNGGnmW7ZC5Vh2uzr6ZtV1uogJt-DR7jvbZGQ@mail.gmail.com \
    --to=skip.tavakkolian@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).