By the time I was ready to ditch the host operating system and install Plan 9 on bare hardware, my desire for the modern web experience had ebbed to an all time low.
As much as I love Plan 9, not having a modern web browser is a non-starter. Too much of the world depends on that: I need to be able to read the news, video conference, consult reference materials, do my banking, order pizza, and so on…
Ultimately, the magic of Plan 9 is you can write a file server for the seamless/grubhub API, and then all you need to do is mount your pizza place of choice, and kick off the delivery with
Actually sounds like a super simple way to order pizza. From here a pretty simple UI could be made.
My issue with plan 9/9front is as sl says: it just isn’t for me at this time, and maybe never. But the ideas it has, can and have been, used in other places.
When it comes to powerful text editing, the tools I use work across practically any OS I touch. And to me its those tools that are powerful as long as they remain small (so that they can maintainable, and portable).
My point is the comment is making it seem unrealistically easy in terms of effort for reward to use ‘magic’ to implement a 9p filesystem for ordering pizza.
Yeah, that sounds like a super simple way to order pizza because its skipping most of the things involved in ordering pizza, like choosing the pizza place and giving them your address and payment info.
i lean hard on my smartphone for some of this. so far, for the same reasons as you, i’ve been unable to avoid either one or the other (using a modern web browser on my pc or carrying a smartphone). what i can do is limit the number of vectors exposing me to harm, as often and as thoroughly as possible. it’s fair to say that if the modern web is a hard requirement then living in plan 9 may not be for you. realize, though, that in spite of the many enticements being offered, it is still perfectly possible to get a lot of computing done without directly transmitting data to surveillance companies.*
(* sins of the telecom carriers sadly acknowledged.)
I would assume that it is because it makes a relicense easier. Like if something more appropriate than a BSD 3 Clause is released. If he becomes evil, we have the right to form an new organization and fork. So we have all the guarantees of the current license plus the ability to move forward in a case where it is appropriate.
Think about the current state of Linux. Let’s say BSD or Apache were considered? It would be impossible to move because of all the people who would have to agree to the move or the rewrite of the code they own.
As far as I can tell, he just holds the copyright for the overall distribution I guess. All the code has copyright notices by a bunch of other people. It really doesn’t matter who has it, in that sense.
I’d like to spend one single day watching @SirCmpwn working. I don’t understand how someone with a regular job can get so much done in their free time.
Keep up the work the great work! I’ll definitely migrate to sway as soon as the porting to wlroots is finished.
One of these days you should write something about productivity. It amazes me how much work you get done in such a methodical way. Congratulation for your work, I can’t wait to try Oil Shell!
Thanks for the support! I’ll answer briefly here – I have a few “advantages”, and one “meta” tip.
I had 7 years of projects that went almost nowhere, so all those learning experiences allow me to develop Oil faster. Examples: http://andychu.net/projects/
I actually found some references to an “oil shell” I had in mind going back to 2013 or 2012! There was almost no code, but there was some design. So I’ve been thinking about this problem for a long time. (There is a longer story if anyone wants to hear it – I actually suggested to Rob Pike and Russ Cox in 2009, in person, that there be a better shell to complement Go’s “better C”. This might have been before Go’s open source release.)
I took a break from work in early 2016, and unsurprisingly, being full time helps!
So if you take all that into account, my productivity probably isn’t out of the ordinary (at least for someone with 14 years of professional experience).
Also, take into the account the fact that I’m writing this in Python, and that is like a “superpower” if you compare doing the same work in C or C++. I started this project with 2000-3000 lines of C++, and I wouldn’t have gotten anywhere close to finished if I had stayed on that course.
If I have one tip, it would be “don’t get stuck”. My previous projects involved a lot of design, and truly clean slate design without any users makes it more likely that you’ll get stuck on something, or waste effort.
This one is more constrained because I made the decision to be compatible. I think this has helped in a lot of ways, one being that I don’t really get stuck. I just have to make things work roughly the way bash does, sometimes cursing it, sometimes documenting deviations and planning for better semantics in Oil, but I don’t get stuck.
If you don’t get stuck for 20 months, work full time, and don’t work on anything that’s not in the finished product, a lot of things will get done!
First, to call itself a process could [simply] execute /proc/self/exe, which is a in-memory representation of the process.
There’s no such representation available as a file. /proc/self/exe is just a symlink to the executable that was used to create the process.
Because of that, it’s OK to overwrite the command’s arguments, including os.Args[0]. No harm will be made, as the executable is not read from the disk.
You can always call a process with whatever args[0] you like. No harm would be done.
Although /proc/self/exe looks like a symbolic link, it behaves differently if you open it. It’s actually more like a hard link to the original file. You can rename or delete the original file, and still open it via /proc/self/exe.
No harm will be made, as the executable is not read from the disk.
the executable is definitely read from the disk
Again, this was only possible because we are executing /proc/self/exe instead of loading the executable from disk again.
no
The kernel already has open file descriptors for all running processes, so the child process will be based on the in-memory representation of the parent.
no that’s not how it works, and file descriptors aren’t magic objects that cache all the data in memory
The executable could even be removed from the disk and the child would still be executed.
that’s because it won’t actually be removed if it’s still used, not because there’s a copy in memory
<3 systems engineering blog posts written by people who didn’t take unix101
Instead of telling people they are idiots, please use this opportunity to correct the mistakes that the others made. It’ll make you feel good, and not make the others feel bad. Let’s prop up everyone, And not just sit there flexing muscles.
I don’t think it’s strictly correct, but for the purpose of the code in question it is accurate. That is, /proc/self/exe points to the executable file that was used to launch “this” process - even if it has moved or been deleted - and this most likely matches the “in memory” image of the program executable; but I don’t believe that’s guaranteed.
If you want to test and make sure, try a program which opens its own executable for writing and trashes the contents, and then execute /proc/self/exe. I’m pretty sure you’ll find it crashes.
I think it’s guaranteed on local file systems as a consequence of other behavior. I don’t think you can open a file for writing when it’s executing – you should get ETXTBSY when you try to do that. That means that as long as you’re pointing at the original binary, nobody has modified it.
If you want to test and make sure, try a program which opens its own executable for writing and trashes the contents, and then execute /proc/self/exe. I’m pretty sure you’ll find it crashes
Actually, scratch that. You won’t be able to write to the executable since you’ll get ETXTBUSY when you try to open it. So, for pretty much all intents and purposes, the comment is correct.
In order to satisfy my curiosity, I created this small program [1] that calls /proc/self/exe infinitely and prints the result of readlink.
When I run the program and then delete its binary (i.e., the binary that /proc/self/exe points to), the program keeps successfully calling itself. The only difference is that now /proc/self/exe points to /my/path/proc (deleted).
const in method/function arguments. const in Go has limited uses, and is effectively the most basic #define in C, though it does support some compile-time arithmetic.
Oct 2020?
Yes, newsletters for 0.3 and 0.4.4 were sent a bit late. They’ll try to do better for 0.5, which should be released this month :).
Is it only me who’s impressed that Zig has fewer syscalls than C?
I was already interested in checking out Zig at some point but this has sparked my curiosity anew.
As much as I love Plan 9, not having a modern web browser is a non-starter. Too much of the world depends on that: I need to be able to read the news, video conference, consult reference materials, do my banking, order pizza, and so on…
Ultimately, the magic of Plan 9 is you can write a file server for the seamless/grubhub API, and then all you need to do is mount your pizza place of choice, and kick off the delivery with
echo cheese > /n/pizza
Except someone needs to do the work, which is mostly a waste of time, not to mention api’s for services like that are far from stable.
Mostly a waste of time?
Once it’s done, it’s usually done for years. And APIs are getting better, not worse, generally.
cat /n/pizza/toppings; echo 'pepperoni' >> /n/pizza/order; echo 'done' >> /n/pizza/order
Actually sounds like a super simple way to order pizza. From here a pretty simple UI could be made.
My issue with plan 9/9front is as sl says: it just isn’t for me at this time, and maybe never. But the ideas it has, can and have been, used in other places.
When it comes to powerful text editing, the tools I use work across practically any OS I touch. And to me its those tools that are powerful as long as they remain small (so that they can maintainable, and portable).
My point is the comment is making it seem unrealistically easy in terms of effort for reward to use ‘magic’ to implement a 9p filesystem for ordering pizza.
I was joking :). Writing a 9p server isn’t exactly easy, but, to extend indirection’s comment, it would be kind of nice to grep and echo for pizza
Writing a 9p server is an hour or so of work, at least with lib9p. Maybe less. Getting it to order pizza is harder.
Yeah, that sounds like a super simple way to order pizza because its skipping most of the things involved in ordering pizza, like choosing the pizza place and giving them your address and payment info.
All that stuff could be done once.
echo '1 north pole' > /n/pizza/address; cat /n/pizza/places; echo 'pizzapizza' >> /n/pizza/place; echo 'mypaymentinfosoateuhstaoheus' > /n/pizza/payment
or whatever.Not saying the same can’t be done with other systems.
username checks out
i lean hard on my smartphone for some of this. so far, for the same reasons as you, i’ve been unable to avoid either one or the other (using a modern web browser on my pc or carrying a smartphone). what i can do is limit the number of vectors exposing me to harm, as often and as thoroughly as possible. it’s fair to say that if the modern web is a hard requirement then living in plan 9 may not be for you. realize, though, that in spite of the many enticements being offered, it is still perfectly possible to get a lot of computing done without directly transmitting data to surveillance companies.*
(* sins of the telecom carriers sadly acknowledged.)
You could do it the other way around and run Plan 9 in a browser, according to this little project:
https://github.com/sirnewton01/9webdraw
There’s vmx or vnc for when you really need it.
As it mentions, you can install another OS in a vm and run a browser there.
I know, I just hate switching work environments back and forth…
A modern browser is itself a VM.
The browser is the new Emacs
No, the browser is successful.
M-x oh-snap
I actually try this, you know…
Honest question: Do you know why Theo holds the copyright? Is it better than having the Foundation holding it?
“Copyright 1997-2019, Theo de Raadt.”
I would assume that it is because it makes a relicense easier. Like if something more appropriate than a BSD 3 Clause is released. If he becomes evil, we have the right to form an new organization and fork. So we have all the guarantees of the current license plus the ability to move forward in a case where it is appropriate.
Think about the current state of Linux. Let’s say BSD or Apache were considered? It would be impossible to move because of all the people who would have to agree to the move or the rewrite of the code they own.
Or am I totally off base?
As far as I can tell, he just holds the copyright for the overall distribution I guess. All the code has copyright notices by a bunch of other people. It really doesn’t matter who has it, in that sense.
I’d like to spend one single day watching @SirCmpwn working. I don’t understand how someone with a regular job can get so much done in their free time.
Keep up the work the great work! I’ll definitely migrate to sway as soon as the porting to wlroots is finished.
With lots of help!
One of these days you should write something about productivity. It amazes me how much work you get done in such a methodical way. Congratulation for your work, I can’t wait to try Oil Shell!
Thanks for the support! I’ll answer briefly here – I have a few “advantages”, and one “meta” tip.
So if you take all that into account, my productivity probably isn’t out of the ordinary (at least for someone with 14 years of professional experience).
Also, take into the account the fact that I’m writing this in Python, and that is like a “superpower” if you compare doing the same work in C or C++. I started this project with 2000-3000 lines of C++, and I wouldn’t have gotten anywhere close to finished if I had stayed on that course.
If I have one tip, it would be “don’t get stuck”. My previous projects involved a lot of design, and truly clean slate design without any users makes it more likely that you’ll get stuck on something, or waste effort.
This one is more constrained because I made the decision to be compatible. I think this has helped in a lot of ways, one being that I don’t really get stuck. I just have to make things work roughly the way bash does, sometimes cursing it, sometimes documenting deviations and planning for better semantics in Oil, but I don’t get stuck.
If you don’t get stuck for 20 months, work full time, and don’t work on anything that’s not in the finished product, a lot of things will get done!
There’s no such representation available as a file. /proc/self/exe is just a symlink to the executable that was used to create the process.
You can always call a process with whatever args[0] you like. No harm would be done.
Although /proc/self/exe looks like a symbolic link, it behaves differently if you open it. It’s actually more like a hard link to the original file. You can rename or delete the original file, and still open it via /proc/self/exe.
the executable is definitely read from the disk
no
no that’s not how it works, and file descriptors aren’t magic objects that cache all the data in memory
that’s because it won’t actually be removed if it’s still used, not because there’s a copy in memory
<3 systems engineering blog posts written by people who didn’t take unix101
Instead of telling people they are idiots, please use this opportunity to correct the mistakes that the others made. It’ll make you feel good, and not make the others feel bad. Let’s prop up everyone, And not just sit there flexing muscles.
Sorry for disappointing you :)
I got that (wrongly) from a code comment in Moby (please check my comment above) and didn’t check the facts.
I’m not saying that the OP was correct, I’m just saying that:
,,, is also not completely correct.
Thanks for pointing out my mistakes! I just fixed the text.
I made some bad assumptions when I read this comment [1] in from from Docker and failed to validate it. Sorry.
By the way, is it just by bad English or that comment is actually wrong as well?
[1] https://github.com/moby/moby/blob/48c3df015d3118b92032b7bdbf105b5e7617720d/pkg/reexec/command_linux.go#L18
I don’t think it’s strictly correct, but for the purpose of the code in question it is accurate. That is, /proc/self/exe points to the executable file that was used to launch “this” process - even if it has moved or been deleted - and this most likely matches the “in memory” image of the program executable; but I don’t believe that’s guaranteed.
If you want to test and make sure, try a program which opens its own executable for writing and trashes the contents, and then execute /proc/self/exe. I’m pretty sure you’ll find it crashes.
I think it’s guaranteed on local file systems as a consequence of other behavior. I don’t think you can open a file for writing when it’s executing – you should get ETXTBSY when you try to do that. That means that as long as you’re pointing at the original binary, nobody has modified it.
I don’t think that holds on NFS, though.
Actually, scratch that. You won’t be able to write to the executable since you’ll get ETXTBUSY when you try to open it. So, for pretty much all intents and purposes, the comment is correct.
Interesting. Thank you for your insights.
In order to satisfy my curiosity, I created this small program [1] that calls /proc/self/exe infinitely and prints the result of readlink.
When I run the program and then delete its binary (i.e., the binary that /proc/self/exe points to), the program keeps successfully calling itself. The only difference is that now /proc/self/exe points to /my/path/proc (deleted).
[1] https://gist.github.com/bertinatto/5769867b5e838a773b38e57d2fd5ce13
Wow, this was smooth! Congratulations to everyone involved!
Just out of my curiosity, the site was running on OpenBSD before?
Thanks for sharing!
I’m getting 502’ ed at the moment, but I was able to check a few topics. I’ll make to check it out again on my next endevours.
Congratulations for the work!
Sorry about 502. We just pushed a big update since our links were not working on mobile. Should be up now.
I hope you like it. Would love to hear your thoughts. :)
Was he talking about const here or I’m missing something?
const
in method/function arguments.const
in Go has limited uses, and is effectively the most basic#define
in C, though it does support some compile-time arithmetic.Cool, thanks!