Re: [9fans] ken cc for linux
On Mar 13, 2015, at 1:19 PM, Kurt H Maier k...@sciops.net wrote: github One of these days I’ll get back to finishing the hg-git module for Plan 9. I wish it weren’t required, but as the world has moved to git either git needs to run on Plan 9 or we get the hg-git plugin working and a stub to let go use it when you want to do `{go get github.com/some/big/repo}. Alas, having git on Plan 9 may not be all that useful for me as git is the first revision control tool I’ve used where the commands and overall structure begs for a GUI to make sense of it all. I guess that’s what all the web interfaces and forks are for… -jas
Re: [9fans] ken cc for linux
Quoting Ryan Gonzalez rym...@gmail.com: I wouldn't say it suddenly vanished, though. A quick search shows some were predicting this would happen. Lots of major projects have moved to GitHub or Bitbucket. It was obvious it was dying when every google project started unassing the site last year. Google is huge on shoving their devs' faces into their corporate dogfood; any time a google project abandons a google product you can bet it's going to be taken out back and drowned in short order. It's still a pain in the ass, regardless of how much notice they give, but the really hilarious part was watching all of the googlers pretend they just suddenly decided their projects would be better off at github. khm
Re: [9fans] ken cc for linux
I prefer GitHub. Much nicer, easier to use, has a PR system (no patches!), etc. The website also works better on mobile devices. Google Code's source browser doesn't work on my phone. I wouldn't say it suddenly vanished, though. A quick search shows some were predicting this would happen. Lots of major projects have moved to GitHub or Bitbucket. On Fri, Mar 13, 2015 at 8:24 AM, Charles Forsyth charles.fors...@gmail.com wrote: On 13 March 2015 at 01:31, erik quanstrom quans...@quanstro.net wrote: was, as in google code is dead. It's a good example of how the cloudy future is seriously unsettled by services suddenly vanishing, even from big suppliers. Also, I rather trust the Google storage infrastructure, but I'm not sure about the other two. -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
Re: [9fans] ken cc for linux
On 13 March 2015 at 01:31, erik quanstrom quans...@quanstro.net wrote: was, as in google code is dead. It's a good example of how the cloudy future is seriously unsettled by services suddenly vanishing, even from big suppliers. Also, I rather trust the Google storage infrastructure, but I'm not sure about the other two.
Re: [9fans] ken cc for linux
On Wed, Mar 11, 2015 at 10:04 PM, Ryan Gonzalez rym...@gmail.com wrote: As you can see, Go actually had a working 64-bit compiler. Plan 9 and Inferno have working 64-bit compilers. They are used for the many Plan 9 amd64 kernels. Go's C compilers all came from Inferno, including 6c. -- Aram Hăvărneanu
Re: [9fans] ken cc for linux
On Wed, Mar 11, 2015 at 10:04 PM, Ryan Gonzalez rym...@gmail.com wrote: Go had vastly better versions, but it seems they got ripped out recently. I think Go 1.3 may have had them, in which case you'd do something like: go tool 6c tst.c go tool 6l -o tst tst.6 First, Go did not have vastly better versions, Go's compilers came from Inferno and the back-ends were very minimally modified, mainly to fix bugs. The linkers and other lower level details were modified a lot, but they make what you want to do harder, not easier. Second, what you typed will try to link with the Go runtime, which is definitely not what you want. Third, it will not work, at least not without further work, main is not the entry point. Fourth, you don't have a standard library available. Go's compiler were there for building the Go runtime. To use them for anything else, you'd need *a lot* of work, much more work than by starting with the Plan 9/Inferno/Ken-cc directly. -- Aram Hăvărneanu
Re: [9fans] ken cc for linux
On 12 March 2015 at 08:51, Aram Hăvărneanu ara...@mgk.ro wrote: Plan 9 and Inferno have working 64-bit compilers. Periodically I pull the Plan 9 and Inferno variants into line, so they should be about the same. It's one reason I split off the Thumb implementation, although it handled ARM/Thumb interlinking better than some. Looking at the current differences, I think I'm inclined now to keep a master copy and then pull from that into the two distributions (could just pull directly for Inferno). I've used it and lib9 in several other projects where other compilers couldn't be used for licensing reasons, or because they were awful. An ANSI cpp is included. I believe there are small ANSI C libraries available. It's trickier for Linux work. Not only is there ELF/DWARF to deal with, and those are both families of a powerset of options, but there are shared libraries and different run-time conventions. Just look at the disaster of most implementations of variable length parameter lists: thanks to function prototypes, which are now (what?) 30 years old, we know where they are, and can make a simple array on the stack. Instead some platforms, even otherwise tasteful ones, for the caller not relying on the prototype, just in case you don't use them, 30 years on, and instead using the complex register-oriented calling convention even for those, and use pages of complex filth to compensate. (I wouldn't mind using registers a bit more in the calling convention, if it proved cost-effective, but I'd still pass variable-length parameter lists on the stack.) Most things need only a handful of system calls, but overall it looks like a big effort, and I'm not sure what the goal would be. I have done wrapper programs that create an environment to run Plan 9 a.out programs on Linux and another, but that was mainly to assist compiler development on new platforms.
Re: [9fans] ken cc for linux
Thanks Charles. I agree completely and will add that they will pry Ken's compilers, so wonderfully supported by you, from my cold, dead fingers. South Suite's new kernel will always be compiled with 6c. As far as performance goes, to paraphrase Chuck Yeager, it's not the compiler, it's the coder. I'd rather have brilliant coders than idiot savant compilers. bwc iPhone email On Mar 12, 2015, at 11:23 AM, Charles Forsyth charles.fors...@gmail.com wrote: On 12 March 2015 at 10:06, Charles Forsyth charles.fors...@gmail.com wrote: I've used it and lib9 in several other projects where other compilers couldn't be used for licensing reasons, or because they were awful. I'll add that the compilers are great for kernel and other New World systems work. Once stable on a given platform, they've been quite robust (I never suspect them at the start as a bug cause). Code quality is rarely a bottleneck for systems work in my experience (and there's a good reason that removing -O3 is a way to fix bugs with other compilers). If I were writing scientific computation, I wouldn't use C anyway, but if I did, I'd worry much more about the effectiveness of optimisation. For systems work? It's really, really low on the list. The cross-module type checking has also spotted a few things that every other compiler missed. Cross-compilation is easy and precise, with next to no configuration required, unlike nearly all the others; I rely on that a lot. It's worth the price of entry for that alone, for me, having suffered with gcc on an old OS project of mine; I'd never use it again for anything new. (Obviously I still use gcc for the 8 hour[!] Linux kernel compiles and builds.) lcc used to include all the code generators, so I suppose that would be just as good, except that it spits out assembly and you have to rely on external components, which still leaves you cross when attempting to cross-compile.
Re: [9fans] ken cc for linux
On 12 March 2015 at 10:06, Charles Forsyth charles.fors...@gmail.com wrote: I've used it and lib9 in several other projects where other compilers couldn't be used for licensing reasons, or because they were awful. I'll add that the compilers are great for kernel and other New World systems work. Once stable on a given platform, they've been quite robust (I never suspect them at the start as a bug cause). Code quality is rarely a bottleneck for systems work in my experience (and there's a good reason that removing -O3 is a way to fix bugs with other compilers). If I were writing scientific computation, I wouldn't use C anyway, but if I did, I'd worry much more about the effectiveness of optimisation. For systems work? It's really, really low on the list. The cross-module type checking has also spotted a few things that every other compiler missed. Cross-compilation is easy and precise, with next to no configuration required, unlike nearly all the others; I rely on that a lot. It's worth the price of entry for that alone, for me, having suffered with gcc on an old OS project of mine; I'd never use it again for anything new. (Obviously I still use gcc for the 8 hour[!] Linux kernel compiles and builds.) lcc used to include all the code generators, so I suppose that would be just as good, except that it spits out assembly and you have to rely on external components, which still leaves you cross when attempting to cross-compile.
Re: [9fans] ken cc for linux
I know. I'm referring to the ken-cc port. On Thu, Mar 12, 2015 at 3:51 AM, Aram Hăvărneanu ara...@mgk.ro wrote: On Wed, Mar 11, 2015 at 10:04 PM, Ryan Gonzalez rym...@gmail.com wrote: As you can see, Go actually had a working 64-bit compiler. Plan 9 and Inferno have working 64-bit compilers. They are used for the many Plan 9 amd64 kernels. Go's C compilers all came from Inferno, including 6c. -- Aram Hăvărneanu -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
Re: [9fans] ken cc for linux
That reminds me that I've got various small repairs and changes to merge in. Possibly the best way will be to point to a test version in an announcement here, and then people can check that they work for them, so nothing breaks unexpectedly on recompilation. One potential big future change (not yet made) is to switch to strictly ANSI rules for unsigned+signed values meeting in the usual arithmetic conversions. The rules are horrible, but it's one of the few ways in which the compiler implements something that's neither an extension nor a restriction compared to the standard. You'll never miss most of the others. One approach there is to have the compiler consider the type under both systems and warn if the difference might cause trouble (typically in comparisons, but there might be other cases). Most of the Plan 9 source has been compiled under the ANSI regime in the form of Plan 9 Ports, so I'd expect that most of the tricky cases have already been fixed.
Re: [9fans] ken cc for linux
On Thu, Mar 12, 2015 at 3:50 AM, Aram Hăvărneanu ara...@mgk.ro wrote: On Wed, Mar 11, 2015 at 10:04 PM, Ryan Gonzalez rym...@gmail.com wrote: Go had vastly better versions, but it seems they got ripped out recently. I think Go 1.3 may have had them, in which case you'd do something like: go tool 6c tst.c go tool 6l -o tst tst.6 First, Go did not have vastly better versions, Go's compilers came from Inferno and the back-ends were very minimally modified, mainly to fix bugs. The linkers and other lower level details were modified a lot, but they make what you want to do harder, not easier. Well, they worked with ELF files. Second, what you typed will try to link with the Go runtime, which is definitely not what you want. Third, it will not work, at least not without further work, main is not the entry point. Fourth, you don't have a standard library available. I know. ken-cc doesn't give you a standard library either. I'm getting these commands off the top of my head, not a manual somewhere. Go's compiler were there for building the Go runtime. To use them for anything else, you'd need *a lot* of work, much more work than by starting with the Plan 9/Inferno/Ken-cc directly. Eh... -- Aram Hăvărneanu -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
[9fans] ken cc for linux
Thanks for the link to the Google code repo. I'm currently on x86_64 Ubuntu 12.04. Building was not so smooth, several files are missing for the Power 64 port. I did as best I could to build things. I suppose my expectations aren't what they should be. I was looking for the usual configure make make install experience, and it wasn't there. I like to compile gawk with multiple compilers and thought I'd try ken's, but it wasn't clear to me which o.out file to use, or how to install it such that it will get the system's include files and libraries. If this is easy to do, I'd appreciate hearing how. If not, then I'm not going to worry about it. :-) Much thanks, Arnold
Re: [9fans] ken cc for linux
One potential big future change (not yet made) is to switch to strictly ANSI rules for unsigned+signed values meeting in the usual arithmetic conversions. The rules are horrible, but it's one of the few ways in which the compiler implements something that's neither an extension nor a restriction compared to the standard. You'll never miss most of the others. One approach there is to have the compiler consider the type under both systems and warn if the difference might cause trouble (typically in comparisons, but there might be other cases). Most of the Plan 9 source has been compiled under the ANSI regime in the form of Plan 9 Ports, so I'd expect that most of the tricky cases have already been fixed. if this is done, please do add the diagnostic as an error. i'd rather not spend any more brain than necessary on the usual conversions. - erik
Re: [9fans] ken cc for linux
the code was in Google code I think, his porting instructions should work for the latest gawk too. was, as in google code is dead. - erik
Re: [9fans] ken cc for linux
Hi All. Thanks for the clarifications about ken's compiler. I don't know that I'll bother going to the go dist right now. Gawk has been compiled with APE, I was mearly suggesting it might be helpful to Aharon if this was repeated to confirm the continued portability of the gawk code. I appreciate and accept your offer. To get the current code: git clone http://git.savannah.gnu.org/r/gawk.git cd gawk git checkout gawk-4.1-stable ./bootstrap.sh ./configure make make check If you can't get to git from APE, then on Linux do the above and add make dist to create tarballs. The bootstrap.sh file merely sets timestamps. No autotools required! :-) Steve, feel free to continue the discussion with me off list, but please change the subject line so that your mail won't get squirrelled off into the 9fans mailbox by accident. Thanks! Arnold
Re: [9fans] ken cc for linux
It doesn't come with a suitable libc that you expect. -- Aram Hăvărneanu
Re: [9fans] ken cc for linux
Warning: this will get messy *fast*. On Wed, Mar 11, 2015 at 3:30 PM, Aharon Robbins arn...@skeeve.com wrote: Thanks for the link to the Google code repo. I'm currently on x86_64 Ubuntu 12.04. Building was not so smooth, several files are missing for the Power 64 port. Yup. Comment out the lines in the mkfiles. In src/cmd/mkfile, I commented out lines 34-36. I think you already need mk installed; you can grab it from here http://swtch.com/plan9port/unix/mk-with-libs.tgz. I did as best I could to build things. I suppose my expectations aren't what they should be. I was looking for the usual configure make make install experience, and it wasn't there. I like to compile gawk with multiple compilers and thought I'd try ken's, but it wasn't clear to me which o.out file to use, or how to install it such that it will get the system's include files and libraries. I doubt the Plan 9 compilers will even get *close* to building gawk. See, the compilers implement a variant of ANSI C with some C99-ish extensions. For once, the preprocessor does not work with #if's. You can only use #ifdef's. Because of this, 99% of the C standard library headers will NOT work with the compilers. Another issue is that it seems that the linker does not read ELF files, so linking with about anything is out of the question. As for the compilers you need to invoke... The directories in src/cmd are formatting like *n*c, *n*a, and *n*l, where the *c ones are the compiles, *a, the assemblers, and *l, the linkers. The executable is at src/cmd/dir/o.out. For Ubuntu 64-bit, you'll want src/cmd/6c/o.out to compile and src/cmd/6l/o.out to link. Or, at least you would...if the files weren't missing. Since half of them are, you'll instead want src/cmd/8c/o.out to compile and src/cmd/8l/o.out to link. Those are the 32-bit compilers. I set up symlinks in ken-cc/bin using bin/8c as an alias for src/cmd/8c/o.out. Same thing for 8l. The command lines look something like: 8c tst.c # outputs tst.8 8l -o tst tst.8 # outputs tst Bottom line: you may be out of luck if you want to use ken-cc as a general-purpose C compiler. It isn't. At all. It's fun to toy with, though. Go had vastly better versions, but it seems they got ripped out recently. I think Go 1.3 may have had them, in which case you'd do something like: go tool 6c tst.c go tool 6l -o tst tst.6 As you can see, Go actually had a working 64-bit compiler. I have yet to figure out why the hell symlinks to the compilers never get set up in the bin directory. If this is easy to do, I'd appreciate hearing how. If not, then I'm not going to worry about it. :-) Much thanks, Arnold -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
Re: [9fans] ken cc for linux
awl compiles under APE with a little work. someone, sorry I have forgotten who, did Stirling work a few years ago and got many Linux tools ported - to support 3rd party stuff. to my chagrin I never managed to get avn to work on top of this. the code was in Google code I think, his porting instructions should work for the latest gawk too. if not put the code somewhere and I will have a go. -Steve On 11 Mar 2015, at 21:04, Ryan Gonzalez rym...@gmail.com wrote: Warning: this will get messy *fast*. On Wed, Mar 11, 2015 at 3:30 PM, Aharon Robbins arn...@skeeve.com wrote: Thanks for the link to the Google code repo. I'm currently on x86_64 Ubuntu 12.04. Building was not so smooth, several files are missing for the Power 64 port. Yup. Comment out the lines in the mkfiles. In src/cmd/mkfile, I commented out lines 34-36. I think you already need mk installed; you can grab it from here. I did as best I could to build things. I suppose my expectations aren't what they should be. I was looking for the usual configure make make install experience, and it wasn't there. I like to compile gawk with multiple compilers and thought I'd try ken's, but it wasn't clear to me which o.out file to use, or how to install it such that it will get the system's include files and libraries. I doubt the Plan 9 compilers will even get *close* to building gawk. See, the compilers implement a variant of ANSI C with some C99-ish extensions. For once, the preprocessor does not work with #if's. You can only use #ifdef's. Because of this, 99% of the C standard library headers will NOT work with the compilers. Another issue is that it seems that the linker does not read ELF files, so linking with about anything is out of the question. As for the compilers you need to invoke... The directories in src/cmd are formatting like nc, na, and nl, where the *c ones are the compiles, *a, the assemblers, and *l, the linkers. The executable is at src/cmd/dir/o.out. For Ubuntu 64-bit, you'll want src/cmd/6c/o.out to compile and src/cmd/6l/o.out to link. Or, at least you would...if the files weren't missing. Since half of them are, you'll instead want src/cmd/8c/o.out to compile and src/cmd/8l/o.out to link. Those are the 32-bit compilers. I set up symlinks in ken-cc/bin using bin/8c as an alias for src/cmd/8c/o.out. Same thing for 8l. The command lines look something like: 8c tst.c # outputs tst.8 8l -o tst tst.8 # outputs tst Bottom line: you may be out of luck if you want to use ken-cc as a general-purpose C compiler. It isn't. At all. It's fun to toy with, though. Go had vastly better versions, but it seems they got ripped out recently. I think Go 1.3 may have had them, in which case you'd do something like: go tool 6c tst.c go tool 6l -o tst tst.6 As you can see, Go actually had a working 64-bit compiler. I have yet to figure out why the hell symlinks to the compilers never get set up in the bin directory. If this is easy to do, I'd appreciate hearing how. If not, then I'm not going to worry about it. :-) Much thanks, Arnold -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
Re: [9fans] ken cc for linux
That's ape with ape/pcc, which is ANSI-compliant, not a port of the non-compliant base compilers (6c, 8c, etc.). On Wed, Mar 11, 2015 at 4:54 PM, Quintile st...@quintile.net wrote: awl compiles under APE with a little work. someone, sorry I have forgotten who, did Stirling work a few years ago and got many Linux tools ported - to support 3rd party stuff. to my chagrin I never managed to get avn to work on top of this. the code was in Google code I think, his porting instructions should work for the latest gawk too. if not put the code somewhere and I will have a go. -Steve On 11 Mar 2015, at 21:04, Ryan Gonzalez rym...@gmail.com wrote: Warning: this will get messy *fast*. On Wed, Mar 11, 2015 at 3:30 PM, Aharon Robbins arn...@skeeve.com wrote: Thanks for the link to the Google code repo. I'm currently on x86_64 Ubuntu 12.04. Building was not so smooth, several files are missing for the Power 64 port. Yup. Comment out the lines in the mkfiles. In src/cmd/mkfile, I commented out lines 34-36. I think you already need mk installed; you can grab it from here http://swtch.com/plan9port/unix/mk-with-libs.tgz. I did as best I could to build things. I suppose my expectations aren't what they should be. I was looking for the usual configure make make install experience, and it wasn't there. I like to compile gawk with multiple compilers and thought I'd try ken's, but it wasn't clear to me which o.out file to use, or how to install it such that it will get the system's include files and libraries. I doubt the Plan 9 compilers will even get *close* to building gawk. See, the compilers implement a variant of ANSI C with some C99-ish extensions. For once, the preprocessor does not work with #if's. You can only use #ifdef's. Because of this, 99% of the C standard library headers will NOT work with the compilers. Another issue is that it seems that the linker does not read ELF files, so linking with about anything is out of the question. As for the compilers you need to invoke... The directories in src/cmd are formatting like *n*c, *n*a, and *n*l, where the *c ones are the compiles, *a, the assemblers, and *l, the linkers. The executable is at src/cmd/dir/o.out. For Ubuntu 64-bit, you'll want src/cmd/6c/o.out to compile and src/cmd/6l/o.out to link. Or, at least you would...if the files weren't missing. Since half of them are, you'll instead want src/cmd/8c/o.out to compile and src/cmd/8l/o.out to link. Those are the 32-bit compilers. I set up symlinks in ken-cc/bin using bin/8c as an alias for src/cmd/8c/o.out. Same thing for 8l. The command lines look something like: 8c tst.c # outputs tst.8 8l -o tst tst.8 # outputs tst Bottom line: you may be out of luck if you want to use ken-cc as a general-purpose C compiler. It isn't. At all. It's fun to toy with, though. Go had vastly better versions, but it seems they got ripped out recently. I think Go 1.3 may have had them, in which case you'd do something like: go tool 6c tst.c go tool 6l -o tst tst.6 As you can see, Go actually had a working 64-bit compiler. I have yet to figure out why the hell symlinks to the compilers never get set up in the bin directory. If this is easy to do, I'd appreciate hearing how. If not, then I'm not going to worry about it. :-) Much thanks, Arnold -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/ -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
Re: [9fans] ken cc for linux
That's ape with ape/pcc, which is ANSI-compliant, not a port of the non-compliant base compilers (6c, 8c, etc.). This is true, however pcc is just a driver that runs cpp and pipes its output to 8c (assuming you are on a 386). hugo% cd /sys/src/ape/cmd hugo% hugo% pcc -v -c -D_POSIX_SOURCE kill.c cpp -D__STDC__=1 -N -D_POSIX_SOURCE -I/386/include/ape -I/sys/include/ape kill.c | 8c -o kill.8 Gawk has been compiled with APE, I was mearly suggesting it might be helpful to Aharon if this was repeated to confirm the continued portability of the gawk code. -Steve