Hacker Newsnew | past | comments | ask | show | jobs | submit | drpyser22's commentslogin

No language is perfect, thats kind of the point of the author going from erlang to gleam to rust.


How does it all work?


Did you compare nix to npm? Is there a good comparison out there?


The intended userbase of pass is clearly not non-tech-savvy/non-security aware philipinno mothers, so your remark is irrelevant.


You mean that bash interprets the path and creates the socket itself?


Yes, bash does that. It's a bash feature:

https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash....

> Bash handles several filenames specially when they are used in redirections, as described in the following table. If the operating system on which Bash is running provides these special files, bash will use them; otherwise it will emulate them internally with the behavior described below.

> ...

> Bash attempts to open the corresponding [...] socket.


I think this was a design mistake. If they wanted to come up with a new syntax for sending UDP packets, fine.

If they persuaded the kernel devs to make some devfs way that those were real files, using the unix filesystem API, also fine.

But making something that looks like a real thing in the filesystem, but isn't usable by other programs that use the filesystem... Thats not right.


Even more fun is that if you create /dev/udp/127.0.0.1 (and chmod a+rwx), it won't create the file 53 if you "echo hello > /dev/udp/127.0.0.1/53". Instead it sends a UDP packet to your DNS server.

If you create a symlink to a path like /dev/udp/127.0.0.1/53 and redirect output to the symlink, a packet is not sent; the file is written as normal.

I'm guessing nobody has ever actually had a problem with this, so it's not actually a bad design choice, but I personally wouldn't have written that code. Leaky abstraction.


I dunno, if you “echo foo > /dev/null” then “cat /dev/null” you won’t get foo back. Plenty of assumptions about filesystem behaviour don’t work in all cases.

That being said, I’d prefer if the symlink actually worked and sent the packet.


Yeah when I was testing it, I definitely half-expected the symlink to work.

I will quibble with you on /dev/null a little bit. /dev/null works like any other file; there is absolutely no guarantee that you can read what you wrote on any filesystem write on UNIX. You can "echo foo > regular_file" and then "cat regular_file" and it could be gone or have completely different content. Other processes writing the file, network filesystems, quantum rays, who knows. So to me, /dev/null is not unusual in that respect at all, except that that probability function that you can read what you wrote looks a little different than a regular file.

Most importantly, /dev/null isn't a construction implemented by bash. Any program on the OS sees the same behavior as your shell script. That said, this isn't really as unusual as I originally thought. You can open a file named $HOME/foo in bash and that's going to be a very different file in your C program. I do like the $ to indicate "hey this is a quirk of the programming language that's allowing this", though.


That’s probably because bash is only looking for those types of paths in a redirection context. But if you try to use regular file utilities those paths don’t have any special meaning so they just work as normal.


Yes.


Do you need a whole OS, or just a specialized WM/Display manager? I assume a text based interface(e.g. console) world be the simplest to support?


Surely, it wouldn’t need a whole OS, but it would need a specialized layer running over the top and that that point it might as well be a forked OS with the layer on top.


The two parts article does acknowledge inefficiencies and losses, but dismisses them


According to the article author it requires costly infrastructure on the moon, compared to their proposal of beaming energy through microwave from Earth.


Space based solar would also use microwaves to beam the energy to the moon.


I disagree that naming something correctly always takes no time. Sometimes a useful and correct name is non-obvious, or repetitive, or you're trying to name something abstract or generic.


Never? That's such a defeatist/pessimistic take. Looks like its way more difficult than expected, sure. Looks like new breakthroughs will be needed maybe. Never seems unreasonable, in general and in specific.


People will never stop loving driving


People said the same thing about their horse.


A car is just a horse with more power and handling.

People proposing self-driving or AI driving are defacto arguing for private subway trains


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: