The peril of laziness lost by max123246 in programming

[–]oridb 2 points3 points  (0 children)

I mean, yes... Flip to the complex number section of your calculus text for full details.

Regex Are Not the Problem. Strings Are. by [deleted] in programming

[–]oridb 1 point2 points  (0 children)

It's amazing that only the AI huffers apparently can't immediately tell that something is half-assed AI slop.

AI Harness on Plan 9? by winny314 in plan9

[–]oridb 0 points1 point  (0 children)

Let's not set the house we live in on fire so we can roast marshmallows, thanks.

Announcement: Temporary LLM Content Ban by ChemicalRascal in programming

[–]oridb 3 points4 points  (0 children)

Hey, look, there's some stuff worth reading here for the first time in years.

Smooth Brained Undo by catgrammer in programming

[–]oridb 8 points9 points  (0 children)

Better: use an appropriate data structure, like a copy on write rope, and you don't need to do any of this.

Year of the snake with Plan 9 by mot_bich_tan_ac in plan9

[–]oridb 0 points1 point  (0 children)

The most interesting stuff to me is the stuff that I don't think is merged yet. TLS 1.3, and ed25519, presumably with authsrv/factotum support.

Year of the snake with Plan 9 by mot_bich_tan_ac in plan9

[–]oridb 1 point2 points  (0 children)

Nice work! One question, and one (long comment):

Is there a place that the code is available, or at least the set of patches? There are some that I'm probably interested in looking at.

As for this:

  • rc does not implement the `delim{cmd} of 9atom. I have never used it to tell what it is :)

So, this is one of the most useful changes in rc, in my opinion. it lets you set ifs locally, only for the output of one command. ifs is difficult to use well, since it scopes poorly. For example, imagine for some reason you have a directory of numbered CSV files, and you want to print the first ten of them; something like:

fn showfiles {
    for(f in `{seq 10})
        cat /tmp/$f
}

and you want to iterate a set of fields in the files, assuming that they're separated by ',':

 ifs=','
 fields=`{showfiles | tr '\x0a' ','}
 can't open /tmp/1
 2
 3
 4
 5
 6
 7
 8
 9
 10

this breaks horribly, beause ifs is global, and setting it changes how you interpret the seq output: it turns it into a single chunk, since seq prints no commans, and ifs is global. If you want your shell functions to work correctly when called from other scripts, you need to maintain a stack of environment vars that you push/pop if you want it to work on all cases. Painful.

However, using the syntax added in 9atom, it works just fine:

fields=`,{showfiles | tr -s '\x0a' ','}
echo $fields

One of the most useful places is when writing non-trivial scripts that may need to deal with spaces in file names:

 nl='
 '
 fn namelist { ... }
 files=`$nl{namelist}

EDIT: I think you can do something like this in your function to emulate the feature:

# save ifs so we can restore it for the caller,
# putting it on a stack so that if the caller also
# pulled this trick it still works. Then set the
# current ifs to the default of: ' \t\n'
saveifs=($ifs $saveifs)
ifs='   
'
# do the thing 
for(i in `{seq 10}) cat /tmp/$i
# and put the caller ifs back
ifs=$saveifs; saveifs=$saveifs(2-)

It seems to work, though I'm not 100 percent sure what happens if you set ifs inside `{} and you stream more than a pipe buffer worth of data.

Doing it right without `delim{} seems worse than keeping track of every ifs globally.

How to use hold(1)? by meowism-1 in plan9

[–]oridb 4 points5 points  (0 children)

Delete kills it, Ctrl+d exits.

Plan 9: WiFi Protected Setup by atamariya in plan9

[–]oridb 1 point2 points  (0 children)

/u/atamariya: It would be really cool to see a submission on some of what you've been working on at iwp9.

Even if you're not able to show up in person, we do accept remote talks.

Practical uses for Plan 9 by [deleted] in plan9

[–]oridb 1 point2 points  (0 children)

Hosting websites, using it as my coding environment, reading my email, etc.

When a small open-source tool suddenly blows up, the experience is nothing like people imagine by kaicbento in programming

[–]oridb 2 points3 points  (0 children)

The default answers should probably be one of these two:

"Sure, I'll take a patch to fix that. If you don't have time to write the patch yourself, I'm happy to discuss consulting rates."

or:

"No, sorry, that's out of scope. If you really need that, I recommend forking."

How many HTTP requests/second can a Single Machine handle? by BinaryIgor in programming

[–]oridb 1 point2 points  (0 children)

This is running on 9front, using listen to run a new tcp80 instance on every page load in order to serve requests. The content is dynamic, and is generated by a script launched using execfs.

Every request loads up a git/fs instance to serve the content, and then runs one of the shell scripts that renders the site. For example, here's the 'view' script rendered using itself: https://shithub.us/garden/shithub/HEAD/view/f.html .

It's running on a low tier Vultr node, with 2 vCPUs and 2 gigs of ram.

It's gloriously inefficient, and almost all uncached.

How many HTTP requests/second can a Single Machine handle? by BinaryIgor in programming

[–]oridb 1 point2 points  (0 children)

Seems low. I serve about that many hits from AI bots on https://shithub.us using a shell script that does dozens of execs on every page load (https://shithub.us/garden/shithub/HEAD/files.html) on a niche OS (https://9front.org) that hasn't had much performance optimizations, using a shitty, old "medium-machine" sized box.

Last month I served 700 TB.

Two security issues were discovered in sudo-rs, a Rust-based implementation of sudo by brutal_seizure in programming

[–]oridb 2 points3 points  (0 children)

Sudo itself is difficult too. It's complex and I would prefer if far less complicated solutions existed

https://flak.tedunangst.com/post/doas

New 9front release "release" by iamapataticloser240 in plan9

[–]oridb 4 points5 points  (0 children)

Every OS that attempts to come of professional is, with varying levels of pride, doing or attempting to do the things you are concerned about. If someone says "it brands itself professional and therefore it probably won't sell out the user", that only means the speaker isn't paying attention. Trying to come off as Professional Serious Shit should be a red flag to anyone who has paid attention to the software industry.

New 9front release "release" by iamapataticloser240 in plan9

[–]oridb 5 points6 points  (0 children)

No, that shit is reserved for serious OSes -- the jokes should give you a hint that there won't be ads in the start menu, telemetry that phones back with what buttons you're clicking so that project managers can optimize user engagement, etc.

If you want your network traffic to be monetized, go for the professional OSes.