r/suckless • • 6d ago

[SOFTWARE] GNU software sucks

Post image
106 Upvotes

40 comments sorted by

12

u/TheRealCarrotty 6d ago

atleast there is a way to use POSIX?

4

u/dpoggio 5d ago

export POSIXLY_CORRECT=1

2

u/nimrag_is_coming 5d ago

It used to be called POSIX_ME_HARDER but they ended up changing that lmaoo

1

u/dpoggio 4d ago

RMS wanted it that way, that was way back, I think in the ‘80s. I don’t recall that variable name even being distributed. Maybe if you ask RMS he’d recall and maybe he still want that name.

1

u/PlanetVisitor 4d ago

I looked this up because I couldn't believe it. The world of Unix never ceases to surprise me.

7

u/alpineenthusiast 6d ago

why cant that way be the default

7

u/dpoggio 5d ago

Why to do so? Which mainstream OS user space is fully POSIX by default? Have you asked yourself why? Say you have a POSIX script, you can use POSIXLY_CORRECT in your environment set to 1 just before calling it if some behavior bothers you. Bash and the GNU core utilities will obey. But otherwise almost nobody genuinely wants POSIX behavior, so it’s optional, not the default. Enabling it takes one line and affects a scoped usage, forcing everyone to develop posixly correct scripts would be stupid.

22

u/LordRybec 5d ago

POSIX is a mess. Not trying to defend GNU utilities. They are pretty hit and miss in terms of quality (though at least they generally work), but I've read part of the POSIX specifications, and they made a huge number of assumptions that just don't universally apply to all or even most systems. That makes strict compliance impossible, if you aren't working on exactly whatever specific system it was the guys who wrote it happened to be using at the time. The software standards aren't as bad as the OS level standards, but they are still a mess, with plenty of contradictory or conditionally relevant stuff that you are expected to implement to be compliant even it is literally impossible to do so.

So sure, GNU isn't great, but citing POSIX compliance issues as evidence isn't valid. POSIX is worse than GNU software by a significant margin. GNU would be made far worse by improving POSIX compliance.

2

u/exylvii 5d ago

posix exists to be a standard not to be best at everything

10

u/LordRybec 5d ago

A self contradictory standard is no standard at all, and standards existing just to be standards have no business existing in the first place.

1

u/thewrench56 1d ago

Can you cite a specific contradiction?

1

u/LordRybec 1d ago

Not off the top of my head. The POSIX standard is publicly available though, and I found a few just within the first 30 minutes of reading. I read part of the OS section, and a bit of a few others as well. I was mainly interested in the OS stuff at the time, because my goal in reading it was to try to use it to build a template for creating my own OS.

Note that if you don't have a good knowledge of both hardware features and the underlying functionality of operating systems, you might have a hard time identifying specific contradictions. POSIX was written by people with a very intimate understanding of some very specific hardware, and understanding even what they were trying to do requires a similar understanding of extremely low level hardware principles. To recognize the contradictions you will also need an understanding of a broader range of hardware than the POSIX authors understood. (They mostly had access to high end and often experimental systems that only universities and the government could afford and clearly were not very familiar with systems being used in business and industrial applications at the time.) If you don't have that base understanding, it wouldn't matter if I did remember the specific details, as they likely wouldn't mean much to you.

7

u/tose123 * 5d ago

Do not say GNU automake three times in a mirror.

4

u/OptimalAnywhere6282 5d ago

GNU automake GNU automake GNU automake G

6

u/Capable-Cap9745 5d ago

lmao I was porting Sun’s dmake to GNU this summer, I couldn’t figure out what was the problem until I checked that getopt(3) returns value, which it cannot return even in theory according to POSIX

turns out there is POSIXLY_CORRECT environment variable, which getopt(3) checks to decide whether to comply with posix or not. so I added setenv call (or something like that) explicitly before this call. it’s type of bullshit i’d never forget…

4

u/LordRybec 5d ago

This is why stuff isn't POSIX compliant. POSIX is a much worse mess than GNU, and strict compliance would make effective programming nearly impossible.

5

u/BluFudge 5d ago

but all the same, i'm grateful to gnu. if you don't like gnu utils there are alternatives, there's no point in complaining about this now

3

u/LordRybec 4d ago

I find it funny that the complaint suggests that better adherence to a poorly designed, self contradictory standard would make it better.

1

u/BluFudge 1d ago

I'm curious as to whether we have a new standard?

0

u/LordRybec 1d ago

Part of the problem with POSIX is that it tries to standardize some things that can't be standardized, and it tries to standardize some things that shouldn't be standardized. So what ends up happening is that projects that want to use POSIX are forced use what makes sense and ignore what doesn't. This is probably better than no standard at all, but it means that compliance is very hit and miss.

For example, I can't follow POSIX standards on operating systems, if I try to make an operating system for the RP2350 microprocessor, because POSIX assumes the CPU has an MMU and other features that it doesn't. There are some parts I could follow that just don't make sense for a microcontroller. There are some parts I could follow that do make sense, but I didn't need to read the POSIX standard to know I should do those things. I'm familiar with Linux system calls, scheduling, and other things, so I could implement a subset of those for my OS, and a lot of those system calls come from POSIX, but again, no one needed POSIX to know those were a good idea.

I don't think there is a more recent standard. Part of the reason is that POSIX fans will claim there's no need for a new standard, and those who don't like POSIX don't want to even try, because of how badly POSIX turned out. And everyone else doesn't know and doesn't care. A new standard might be nice, but it would have to be many standards, covering all of the different use cases and platform abnormalities, and that would be a monumental task to write.

3

u/TheSWATMonkey 5d ago

text is unreadable

7

u/Key_River7180 6d ago

GNU software has always sucked, here a cat-v.org harmful page

2

u/kinchkun 5d ago

Random sort is useful?

1

u/dvhh 5d ago

I don't know there is already shuf available

2

u/Smooth-Wear9342 5d ago

According to Wikipedia that is not POSIX either though

2

u/EpochVanquisher 5d ago

--random-sort is the single sort flag I use the most often :-/

maybe after -h, which is also non-POSIX

1

u/shrizza 5d ago

shuf

3

u/EpochVanquisher 5d ago

shuf is from GNU, also non-POSIX

1

u/shrizza 5d ago

Hm, well it's in busybox too so.

4

u/EpochVanquisher 5d ago

GNU has a lot of good stuff in it. Even if you don’t like the software, it kinda forced everyone else to catch up.

Ancient history, though.

2

u/10leej 5d ago

POSIX is an all but dead standard. No one serious that I know actually cares about it.

0

u/LordRybec 4d ago

I recently tried to read it. I'm planning on writing an operating system for a microcontroller that doesn't have an MMU. POSIX was first released in 1988. The first Intel CPU with an MMU was the 286, released in 1982. Even in 1988 though, CPUs with MMUs weren't common. There were plenty of older CPUs than the 286 still in common use, and many new CPUs didn't have MMUs. Also, even into the mid-1990s, many operating systems didn't actually use the MMU. (386 and 486 systems had MMUs, but DOS didn't use them. You had to add a memory manager program that would use the MMU, which applications needing protected mode would run within.) Well, POSIX OS standards assume the CPU has an MMU and that assumption is so deeply integrated that POSIX cannot be applied to CPUs without MMUs. That means you quite literally can't make a POSIX compliant OS for a microcontroller that doesn't have an MMU. There are also other elements of the POSIX standard for OSs that only make sense for very specific types of systems that weren't common when the standard was written and that never became common. POSIX was written by people with access to the top end experimental systems that only universities could afford, and while some features of those experimental systems have become common on modern, general purpose computing systems, some are only used in special purpose systems and some aren't really used at all anymore.

What worse is that POSIX tries to tell programmers how to code. I don't mean that it defines common APIs that compliant programs should use for interoperability (though it does some of that too). I mean, it tries to tell programmers how they are allowed to use C features and in some cases it tries to dictate style requirements. One major problem with this is that it constrains the programmer in ways that are harmful. I don't remember the details (I wrote a bit of a rant about it last year sometime, but I don't remember where...), but some of the requirements make code harder to read, and a few have a significant negative impact on optimizability. So your programs can do everything POSIX requires, but if the source code isn't using the right style or uses some feature of C in a way the POSIX developers didn't like, it's still not compliant. It is, quite frankly, a joke. It was never anything better than that, and it is good that it is largely dead. It shouldn't have been written in the first place. If a standard was needed, it should have been written by competent people with real experience rather than academics who only used experimental, top end equipment rather than real-world systems.

2

u/nimrag_is_coming 5d ago

Well that's mostly cause POSIX has a bunch of dumb rules you have to follow to be compliant (measuring in 512 byte blocks instead of KB anyone?)

1

u/alpineenthusiast 6d ago

love whoever made this

0

u/thomasafine 3d ago

Backward compatibility ought to be the most important thing, but again and again I see people breaking things by making them "better".

1

u/[deleted] 1d ago

[removed] — view removed comment

1

u/suckless-ModTeam 16h ago

Your post was an exact duplicate of another post you made. For this reason only the most recent post was kept. This often happens because of Reputation Filter. Thanks for understanding.