Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 05:36:42AM +, arn...@skeeve.com wrote: Does Go use things that are bison-specific? If not, maybe Berkeley Yacc (there are various versions around) would be easier to port. That's why I ask about Bison experts, it's hard to tell how deep the usage of

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Bakul Shah
On Fri, 22 Jul 2011 08:33:50 +0200 Lucio De Re lu...@proxima.alt.za wrote: On Fri, Jul 22, 2011 at 05:36:42AM +, arn...@skeeve.com wrote: Does Go use things that are bison-specific? If not, maybe Berkeley Yacc (there are various versions around) would be easier to port. That's

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread arnold
If it's bison -y -d then maybe even Plan 9 Yacc would work. The bison dist has a manual, probably even with an index, in which you can look up suspicious constructs and decide if they can be safely tossed or not. Thanks, Arnold

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 12:42:12AM -0700, Bakul Shah wrote: $ yacc gc/go.y yacc: e - line 120 of go.y, syntax error %error-verbose ^ This is a bison dropping. I haven't looked at the go sources but hopefully this can be worked around easily. It resolves to a bunch of #ifdefs, #undefs,

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
On Fri Jul 22 01:37:35 EDT 2011, arn...@skeeve.com wrote: Does Go use things that are bison-specific? If not, maybe Berkeley Yacc (there are various versions around) would be easier to port. if it does, that is something new. plan 9 yacc had no troubles at all with the grammar when i did it.

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 08:41:49AM -0400, erik quanstrom wrote: On Fri Jul 22 01:37:35 EDT 2011, arn...@skeeve.com wrote: Does Go use things that are bison-specific? If not, maybe Berkeley Yacc (there are various versions around) would be easier to port. if it does, that is something new.

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Ethan Grammatikidis
On Fri, 22 Jul 2011 06:40:38 +0200 Lucio De Re lu...@proxima.alt.za wrote: I've been trying to port (GNU) bison to Plan 9 to make it easier to get the Go release to compile under the Plan 9 native toolchain. I needed to take a breather yesterday, it is just oh so frustrating! Has anyone got

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
if it does, that is something new. plan 9 yacc had no troubles at all with the grammar when i did it. It does, the Go syntax has changed a lot: you may have missed the efforts that went into dropping trailing semicolons and much other syntactic candy that has made Go quite unusual. why

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 11:13:26AM -0400, erik quanstrom wrote: why do you think changes to the grammar would depend on bison? Is that what I said? I meant that the yacc modules were almost certainly altered considerably since the introduction of new language features. I don't have the

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Bakul Shah
On Jul 22, 2011, at 6:03 AM, Lucio De Re lu...@proxima.alt.za wrote: So far, as Bakul pointed out, only %error-verbose (from memory) stands out in my most recent changes, but there are other reasons and, unfortunately, GNU Bison uses its own extensions to bootstrap, which is where I may

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
i think we're going off the deep end. my comments were ment to draw this line - go used to be compatable with plan old yacc, - and i don't think the go authors really want to depend on yacc, so the conclusion i would draw is that the path of least resistance is to remove the fluff from go and be

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Steve Simon
My understanding is that bison can be convinced to output some static tables which the Go authors munge into some C source (with awk). These tables allow the Go parser to generate more useful and accurate error messages. I believe using bison is not mandatory if you don't mind hacking the code a

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Bakul Shah
On Fri, 22 Jul 2011 17:37:32 +0200 Lucio De Re lu...@proxima.alt.za wrote: But until I clear my slate of a number of distractions, I can only ask more knowledgeable persons to look at the code and make suggestions to the Go Authors, directly or through my submissions to CodeReview, on how to

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 08:39:56AM -0700, Bakul Shah wrote: Is your goal to a) have the standard go distribution build on plan9 with no changes or b) do a minimal infrastructure to make future ports easy or c) do a one time port? The crucial feature is that any changes to the Go

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 05:35:24PM +0100, Steve Simon wrote: My understanding is that bison can be convinced to output some static tables which the Go authors munge into some C source (with awk). These tables allow the Go parser to generate more useful and accurate error messages. That

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
can you give am example where // comments with ' cause trouble. i can't replicate. - erik

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 07:53:30PM +0200, Lucio De Re wrote: That suggests that porting Bison is a must as anything else will not meet the criterion of being included in the Go distribution. Bootstrapping Bison seems to be my main obstacle (it relies on Bison features, not least the very same

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 01:53:41PM -0400, erik quanstrom wrote: can you give am example where // comments with ' cause trouble. i can't replicate. I don't have an example ready at hand. Russ correctly points out that the problem lies with cpp and not with 8c, while careful inspection of the

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Ethan Grammatikidis
On Fri, 22 Jul 2011 19:48:41 +0200 Lucio De Re lu...@proxima.alt.za wrote: For the rest, I have been alerted in private mail that Taru's work contains many adjustments whose intention was to get the code to compile. I have a similar code base and Erik Quanstrom has another. I know my early

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
Russ correctly points out that the problem lies with cpp and not with 8c, while careful inspection of the yacc sources including your correction to accept // does not reveal any way in which yacc can be held responsible. are you giving cpp the -+ option? cpp doesn't eat // comments by default.

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread comeauat9f...@gmail.com
On Jul 22, 2011, at 1:53 PM, erik quanstrom quans...@labs.coraid.com wrote: can you give am example where // comments with ' cause trouble. i can't replicate. My guess is that he is not referring to 8c et al but too pcc. That means something like: // I can't replicate Becomes an error. Many

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Ethan Grammatikidis
On Fri, 22 Jul 2011 17:35:24 +0100 Steve Simon st...@quintile.net wrote: My understanding is that bison can be convinced to output some static tables which the Go authors munge into some C source (with awk). I wonder what it would take to add that feature to Plan 9's yacc. I'm not normally

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Skip Tavakkolian
I really would like an educated answer to this -- if anyone has done the deep thinking: Can I assume that I can use linuxemu -- as a close enough approximation of linux -- to run the Go build (i.e. all.bash)? Or, can anyone think of a reason why it would not work? -Skip P.S. at any rate, I plan

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
On Fri Jul 22 14:25:06 EDT 2011, comeauat9f...@gmail.com wrote: On Jul 22, 2011, at 1:53 PM, erik quanstrom quans...@labs.coraid.com wrote: can you give am example where // comments with ' cause trouble. i can't replicate. My guess is that he is not referring to 8c et al but too pcc.

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
On Fri Jul 22 14:32:43 EDT 2011, eeke...@fastmail.fm wrote: On Fri, 22 Jul 2011 17:35:24 +0100 Steve Simon st...@quintile.net wrote: My understanding is that bison can be convinced to output some static tables which the Go authors munge into some C source (with awk). I wonder what it

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Bakul Shah
On Fri, 22 Jul 2011 13:53:41 EDT erik quanstrom quans...@labs.coraid.com wrote: can you give am example where // comments with ' cause trouble. i can't replicate. - erik In 9vx: term% yacc go/src/cmd/gc/go.y fatal error:newline in string or char. const., /go/src/cmd/gc/go.y:528

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread comeauat9f...@gmail.com
On Jul 22, 2011, at 2:38 PM, Bakul Shah ba...@bitblocks.com wrote: On Fri, 22 Jul 2011 13:53:41 EDT erik quanstrom quans...@labs.coraid.com wrote: can you give am example where // comments with ' cause trouble. i can't replicate. - erik In 9vx: term% yacc go/src/cmd/gc/go.y

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread comeauat9f...@gmail.com
On Jul 22, 2011, at 2:33 PM, erik quanstrom quans...@labs.coraid.com wrote: On Fri Jul 22 14:32:43 EDT 2011, eeke...@fastmail.fm wrote: On Fri, 22 Jul 2011 17:35:24 +0100 Steve Simon st...@quintile.net wrote: My understanding is that bison can be convinced to output some static tables

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
pcc accepts -+ as well as cpp, perhaps a way to pass it as an environment and/or make variable? how about making it the default and ignore the option. - erik

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 02:20:37PM -0400, erik quanstrom wrote: Russ correctly points out that the problem lies with cpp and not with 8c, while careful inspection of the yacc sources including your correction to accept // does not reveal any way in which yacc can be held responsible.

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Bakul Shah
On Fri, 22 Jul 2011 14:48:44 EDT comeauat9f...@gmail.com comeauat9f...@gmail.com wrote: On Jul 22, 2011, at 2:38 PM, Bakul Shah ba...@bitblocks.com wrote: On Fri, 22 Jul 2011 13:53:41 EDT erik quanstrom quans...@labs.coraid.com= wrote: can you give am example where // comments with '

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 02:22:54PM -0400, comeauat9f...@gmail.com wrote: On Jul 22, 2011, at 1:53 PM, erik quanstrom quans...@labs.coraid.com wrote: can you give am example where // comments with ' cause trouble. i can't replicate. My guess is that he is not referring to 8c et al but

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 07:30:47PM +0100, Ethan Grammatikidis wrote: On Fri, 22 Jul 2011 17:35:24 +0100 Steve Simon st...@quintile.net wrote: My understanding is that bison can be convinced to output some static tables which the Go authors munge into some C source (with awk). I wonder

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 11:32:43AM -0700, Skip Tavakkolian wrote: I really would like an educated answer to this -- if anyone has done the deep thinking: Can I assume that I can use linuxemu -- as a close enough approximation of linux -- to run the Go build (i.e. all.bash)? Or, can anyone

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread tlaronde
On Fri, Jul 22, 2011 at 02:53:12PM -0400, erik quanstrom wrote: pcc accepts -+ as well as cpp, perhaps a way to pass it as an environment and/or make variable? how about making it the default and ignore the option. The '//' is really an unfortunate thing, since divide multiply or multiply

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread erik quanstrom
What does pcc have to do with this? This is a yacc problem. [Also tested on 9atom] did you rebuild from source? the yacc binary might be older than ~jan 2010. - erik

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Lucio De Re
On Fri, Jul 22, 2011 at 11:55:45AM -0700, Bakul Shah wrote: On Fri, 22 Jul 2011 14:48:44 EDT comeauat9f...@gmail.com comeauat9f...@gmail.com wrote: On Jul 22, 2011, at 2:38 PM, Bakul Shah ba...@bitblocks.com wrote: On Fri, 22 Jul 2011 13:53:41 EDT erik quanstrom

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Bakul Shah
On Fri, 22 Jul 2011 19:48:41 +0200 Lucio De Re lu...@proxima.alt.za wrote: The crucial feature is that any changes to the Go distribution should slot into the Plan 9 port of Go as seamlessly as possible. Agree with the goal. As it may take me many months to get the project

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Bakul Shah
On Fri, 22 Jul 2011 15:09:35 EDT erik quanstrom quans...@labs.coraid.com wrote: What does pcc have to do with this? This is a yacc problem. [Also tested on 9atom] did you rebuild from source? the yacc binary might be older than ~jan 2010. - erik Just did. yacc.c on the 9atom VM has

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Ethan Grammatikidis
On Fri, 22 Jul 2011 21:00:53 +0200 Lucio De Re lu...@proxima.alt.za wrote: On Fri, Jul 22, 2011 at 07:30:47PM +0100, Ethan Grammatikidis wrote: On Fri, 22 Jul 2011 17:35:24 +0100 Steve Simon st...@quintile.net wrote: My understanding is that bison can be convinced to output some

Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto)

2011-07-22 Thread Russ Cox
go uses various features of bison to make writing the grammar easier and to be able to give good syntax error diagnostics. there are two viable choices here. 1. port bison. 2. run bison on another system, copy the go.tab.[ch] files over, and don't delete them. if #1 is too much, do #2, which is