Re: Porting PicoLisp to Plan9
Hi Mateusz, To clear it up, i use the `Plan 9 from User Space' (i.e., the tools ported to POSIX). I've tried that one too, very interesting;-) It took me a few (3?) months to learn to use Acme efficiently. Wow, Acme seems like a great proof of concept but I can't imagine doing anything effectively using it. The concept of the plumber is really neat though. How would you get syntax highlighting in acme, for example? Acme takes a three-buttoned mouse, preferably with a scroll. It's pretty important to have all three physical buttons, since a lot is done via chording two buttons. I think the mouse is show-stopper for me. I've been trying to eliminate mouse from my life completely. No DLL hell. Programs (and thus processes) and libraries are very small. Greater percentage of code data fits in CPU cache. Less indirect more direct data access code calls/jumps. etc. etc. and it avoids the worst bane of DLL so far: http://harmful.cat-v.org/software/dynamic-linking/versioned-symbols Yes, that's definitely nice. Rather different approach to building software components than on any other systems I know. Cheers, Tomas -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: Porting PicoLisp to Plan9
Hi Tomas, On Sunday 19 of September 2010 20:57:45 you wrote: To clear it up, i use the `Plan 9 from User Space' (i.e., the tools ported to POSIX). I've tried that one too, very interesting;-) It took me a few (3?) months to learn to use Acme efficiently. Wow, Acme seems like a great proof of concept but I can't imagine doing anything effectively using it. A piece of casual evidence: I'm using Acme as the only editor at work, the boss is happy with my performance. Consider giving a try another editor, `sam'; also included in Plan 9 from User Space. Sam seems to be more vi-like, with similar commands issued by hand in a similar way. I think sam was an evolutionary step between the vi and current Acme. Sam was developed by the same Rob Pike who later on developed the Acme. There are some strong similarities -- like the regexp based text editing language, heave reliance on the mouse, ability to work with remote local system seamlessly etc. -- but also some differences. IMO, Acme is more refined and practical than sam -- but that's not to say sam is any bad. It was popular back in its day. The concept of the plumber is really neat though. It sure is ^_^ Makes you wonder why the simple things like plumber are so complicated elsewhere... Acme yields greatly to scripting. Virtually all actions can be performed by script by sending textual commands to file associated with Acme windows Together with the plumber it provides for easy implementations of file browsing for remote computers, email and IRC use, opening various files in proper viewers etc. Smart right-click basically turns any text into hypertext. F.e., when you right-click on printf(3), it opens the relevant manpage. How would you get syntax highlighting in acme, for example? There's no support for it, AFAIK. It may help to use custom font with Acme. You need to pre-render it to Plan 9 format; described on the net. Slightly related, there's parenthesis matching in Acme for ( { [ and . If you double-click on one parenthesis, it highlights the tech between it and matching parenthesis (if any). Acme takes a three-buttoned mouse, preferably with a scroll. It's pretty important to have all three physical buttons, since a lot is done via chording two buttons. I think the mouse is show-stopper for me. I've been trying to eliminate mouse from my life completely. As a programmer I use mouse much more than the graphic designer I work with. He needs keyboard much more. Both of us are productive. Go figure. No DLL hell. Programs (and thus processes) and libraries are very small. Greater percentage of code data fits in CPU cache. Less indirect more direct data access code calls/jumps. etc. etc. and it avoids the worst bane of DLL so far: http://harmful.cat-v.org/software/dynamic-linking/versioned-symbols Yes, that's definitely nice. Rather different approach to building software components than on any other systems I know. Somebody bemoaned a decade ago that `Systems Software Research is Irrelevant' -- that there's a big stagnation in the field, and POSIX is considered as good as it may ever get. Oh well. http://herpolhode.com/rob/utah2000.pdf Hope you'll find some fun with P9 :) Cheers, -- Mateusz -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: Porting PicoLisp to Plan9
Plan9 has a GCC port on which pico compiles with a few changes. (The changes are required because the GCC port itself is not complete!). The binary runs with no problems. About the lack of shared libraries on Plan9: Plan9 don't need shared libraries because components on Plan9 can interact using just four system calls - open, read, write and close. As an example consider a graphics library that could be shared by various applications: /* Pseudo C */ handle =3D LoadLibrary (graphics.so); CallFn (handle, drawRect, 0, 0, 200, 200); Close (handle); The equivalent plan9 code will be something like this: handle =3D open (/sys/graphics/cntl); cmd =3D drawRect 0 0 200 200; write (handle, cmd, strlen (cmd)); close (handle); The interesting thing is that /sys/graphics/cntl/ could be on a remote file system. This makes distributed computing easy and shared libraries redundant. Thanks, -- Vijay On Fri, Sep 3, 2010 at 1:17 PM, Mateusz Jan Przybylski dexen.devr...@gmail.com wrote: Hi Tomas, On Thursday 02 September 2010 19:32:40 you wrote: makes up my daily work environment ;) cool. =A0I looked at it briefly but couldn't find my way around. =A0Do y= ou really use that acme editor or how it's called? =A0Is it possible to run it as console only with vi (or emacs;-)? even more ot To clear it up, i use the `Plan 9 from User Space' (i.e., the tools porte= d to POSIX). Mostly because of Acme -- for very quick edit/[compile/]run/open-file-wit= h- error cycle, and for the Rc shell -- practical for scripting. http://swtch.com/plan9port/man/man1/install.html Acme requires GUI (it could be implemented with exact same semantics in t= ext mode, I guess, but it isn't). However, it uses little bandwidth, and so i= t's usual and natural to use it over network in both native Plan 9 and ported= X11 version. ssh -Y -C gets the job done even on slow links. It took me a few (3?) months to learn to use Acme efficiently. Acme takes a three-buttoned mouse, preferably with a scroll. It's pretty important to have all three physical buttons, since a lot is done via cho= rding two buttons. Acme understands and uses a certain text processing language, based on se= d's. It's executed via the `Edit THE_PROGRAM'. For example, I indent selected portion of text with: Edit s,^, =A0 =A0 =A0 ,g To find current selection address(es), I do Edit =3D etc.etc. You ought to have plumber up and running before you start Acme http://swtch.com/plan9port/man/man4/plumber.htm to get some extra functionality, mostly related to opening files you indi= cate with rightclick. You want the plumber started on the same machine the Acme is running (one= of POSIX limitations) My plumbing rules (the file is $HOME/lib/plumbing) are as follows: #file / line in PHP format type is text data matches '(.+) on line ([0-9]+)' arg isfile $1 data set $file attr add addr=3D$2 plumb to edit include /usr/local/plan9/plumb/initial.plumbing As a curiosity, there are no shared libraries in P9 -- only what we ca= ll `static linking'. It's awesome in the longer run 3 What's so awesome about it? No DLL hell. Programs (and thus processes) and libraries are very small. Greater percentage of code data fits in CPU cache. Less indirect more direct data access code calls/jumps. etc. etc. http://harmful.cat-v.org/software/dynamic-linking/ and it avoids the worst bane of DLL so far: http://harmful.cat-v.org/software/dynamic-linking/versioned-symbols /even more ot tl;dr: Plan 9 from User Space provides tools that may appeal to a long-time POSI= X user ;-) Cheers, -- Mateusz Jan Przybylski ``One can't proceed from the informal to the formal by formal means.'' -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: Porting PicoLisp to Plan9
Hi Tomas, On Thursday 02 September 2010 19:32:40 you wrote: makes up my daily work environment ;) cool. I looked at it briefly but couldn't find my way around. Do you really use that acme editor or how it's called? Is it possible to run it as console only with vi (or emacs;-)? even more ot To clear it up, i use the `Plan 9 from User Space' (i.e., the tools ported to POSIX). Mostly because of Acme -- for very quick edit/[compile/]run/open-file-with- error cycle, and for the Rc shell -- practical for scripting. http://swtch.com/plan9port/man/man1/install.html Acme requires GUI (it could be implemented with exact same semantics in text mode, I guess, but it isn't). However, it uses little bandwidth, and so it's usual and natural to use it over network in both native Plan 9 and ported X11 version. ssh -Y -C gets the job done even on slow links. It took me a few (3?) months to learn to use Acme efficiently. Acme takes a three-buttoned mouse, preferably with a scroll. It's pretty important to have all three physical buttons, since a lot is done via chording two buttons. Acme understands and uses a certain text processing language, based on sed's. It's executed via the `Edit THE_PROGRAM'. For example, I indent selected portion of text with: Edit s,^, ,g To find current selection address(es), I do Edit = etc.etc. You ought to have plumber up and running before you start Acme http://swtch.com/plan9port/man/man4/plumber.htm to get some extra functionality, mostly related to opening files you indicate with rightclick. You want the plumber started on the same machine the Acme is running (one of POSIX limitations) My plumbing rules (the file is $HOME/lib/plumbing) are as follows: #file / line in PHP format type is text data matches '(.+) on line ([0-9]+)' arg isfile $1 data set $file attr add addr=$2 plumb to edit include /usr/local/plan9/plumb/initial.plumbing As a curiosity, there are no shared libraries in P9 -- only what we call `static linking'. It's awesome in the longer run 3 What's so awesome about it? No DLL hell. Programs (and thus processes) and libraries are very small. Greater percentage of code data fits in CPU cache. Less indirect more direct data access code calls/jumps. etc. etc. http://harmful.cat-v.org/software/dynamic-linking/ and it avoids the worst bane of DLL so far: http://harmful.cat-v.org/software/dynamic-linking/versioned-symbols /even more ot tl;dr: Plan 9 from User Space provides tools that may appeal to a long-time POSIX user ;-) Cheers, -- Mateusz Jan Przybylski ``One can't proceed from the informal to the formal by formal means.'' -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: Porting PicoLisp to Plan9
Hi Alex, Thanks for the help. I have made quite a few changes to adapt pico to the plan9 compiler. I don't think there is a compiler flag that let me align addresses. I have to search further or repeat the changes in the bigpico and try to compile that. Anyway, have to wait till I get a comfortable weekend or the next holiday. :-) Thanks, -- Vijay On Thu, Sep 2, 2010 at 11:27 AM, Alexander Burger a...@software-lab.de wro= te: Hi Vijay, I've been trying to port PicoLisp to Plan9 Great! :) (http://plan9.bell-labs.com/plan9/). The code compiled but the binary fails at startup because of the following check in boxSubr(fun f): =A0 =A0 =A0 if (num(f) 3) =A0 =A0 =A0 =A0 =A0giveup(Unaligned function); I see. This is miniPicoLisp. For reasons of internal tag bits, it is necessary that those functions start at an address aligned to a multiple of four. Do you know if there is some compile time flag, e.g. some optimization parameter, which could guarantee that? Another option might be to first compile to assembly language, do some processing on the asm file (inserting 'align' statements), and then compile to final object code. BTW, the full picoLisp doesn't have that restriction. Do you think it is possible to port that version? Cheers, - Alex -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: Porting PicoLisp to Plan9
Hi Mathew, On Thursday 02 September 2010 13:52:32 you wrote: Thanks for the help. I have made quite a few changes to adapt pico to the plan9 compiler. I don't think there is a compiler flag that let me align addresses. I have to search further or repeat the changes in the bigpico and try to compile that. Anyway, have to wait till I get a comfortable weekend or the next holiday. :-) I think you could create a C program that reads symbols their values from a compiled (and possibly linked) executable and writes a new executable with functions aligned `by hand' to desired value. There is a bunch of functions in http://plan9.bell-labs.com/magic/man2html/2/symbol http://plan9.bell-labs.com/magic/man2html/2/object and http://plan9.bell-labs.com/magic/man2html/2/mach which let you read and write symbols from to files. BTW., great initiative, to have picoLisp ported to P9 :) Cheers, -- Mateusz Jan Przybylski ``One can't proceed from the informal to the formal by formal means.'' -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: Porting PicoLisp to Plan9
Hi all, I think this will be of great help: http://doc.cat-v.org/plan_9/4th_edition/papers/ape -- Vijay On Thu, Sep 2, 2010 at 7:47 PM, Mateusz Jan Przybylski dexen.devr...@gmail.com wrote: On Thursday 02 September 2010 15:42:56 you wrote: Hi Vijay and Mateusz, On Thursday 02 September 2010 13:52:32 you wrote: Thanks for the help. I have made quite a few changes to adapt pico to the plan9 compiler. I don't think there is a compiler flag that let me Oh, so this sounds rather tough. Is Plan9 not a POSIX system? slightly ot It is not by itself. It was written as a Unix replacement, by the fathers of Unix. They found full Unix compatibility too constraining at some point. However, Plan 9 shares a lot of core concepts with Unix; in a way, it just takes Unix one logical step further. A lot of semantics and APIs is similar enough to POSIX for a thin, straightforward POSIX compatibility environment (APE) to exist. On the other hand, a lot of P9 innovations trickled down to recent Unix derivatives and wannabes, for example the clone() syscall, bitblit API, UTF-8 and so on. Moreover, a lot of Plan 9 softwari can, and indeed has been, ported to POSIX -- `Plan 9 from Userspace' resulted. Some functionality is missing because POSIX is very lacking in some areas, but it's pretty useful anyway -- and makes up my daily work environment ;) As a curiosity, there are no shared libraries in P9 -- only what we call `static linking'. It's awesome in the longer run 3 Misc resources related to Plan 9: http://cat-v.org/ /slightly ot align addresses. I have to search further or repeat the changes in the bigpico and try to compile that. Anyway, have to wait till I get a Porting picoLisp to a non-POSIX system might be very difficult, as a lot of functionality depends on it. In this regard, miniPicoLisp is much easier, as it uses more or less only plain vanilla C. I was pondering porting picoLisp to P9 for several months, and (with my limited understanding of P9) it doesn't seem very problematic. Never expected the matter of symbol alignment, thou. I think you could create a C program that reads symbols their values from a compiled (and possibly linked) executable and writes a new executable with functions aligned `by hand' to desired value. There is a bunch of functions in http://plan9.bell-labs.com/magic/man2html/2/symbol http://plan9.bell-labs.com/magic/man2html/2/object and http://plan9.bell-labs.com/magic/man2html/2/mach which let you read and write symbols from to files. Cool. But is it really able to relocate symbols? I couldn't detect that from scanning the above resources. If it does, what happens to other references from inside the object code to those relocated symbols? I dunno for sure. My understanding is, the linker (2l, as in two-ell) uses those APIs to output executables. So it's either `use them to read a compiled executable and generate a new executable', or `modify the underlying library and/or linker so it outputs stuff aligned'. -- Mateusz Jan Przybylski ``One can't proceed from the informal to the formal by formal means.'' -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Re: Porting PicoLisp to Plan9
Hi Mateusz, makes up my daily work environment ;) cool. I looked at it briefly but couldn't find my way around. Do you really use that acme editor or how it's called? Is it possible to run it as console only with vi (or emacs;-)? As a curiosity, there are no shared libraries in P9 -- only what we call `static linking'. It's awesome in the longer run 3 What's so awesome about it? Cheers, Tomas -- UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe