News for hackers. Stuff that matters.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by jjoonathan on Friday May 19, 2023 @12:40PM (#36003917)
C arrays suck on the best of days and qsort requires that you understand function pointers and types which are some of the hairiest C syntax in common use. The C Clockwise Spiral rule is truly special.

It's easy to lose sight of the climb once you're at the top.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by JohnFen on Friday May 19, 2023 @12:48PM (#36004033)
Well, we could debate this, but it's all irrelevant to the assertion that C makes it hard to use good libraries.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by jjoonathan on Friday May 19, 2023 @04:32PM (#36006539)
Oh, right, I forgot that C's library/package management situation sucks so hard that makes the awful syntax look like a comparatively small problem.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by JohnFen on Friday May 19, 2023 @04:57PM (#36006773)
This actually made me laugh out loud. Yes, if your problem with C is that it doesn't need a package management mechanism like some other languages, then C is clearly not for you. But C is very far from the only language like this.

It's a bit like criticizing a fish for having no legs.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by IshKebab on Friday May 19, 2023 @05:16PM (#36006952)
> if your problem with C is that it doesn't need a package management mechanism like some other languages

The problem isn't that it doesn't need one, it's that it doesn't have one. I have no idea why you would think that it doesn't need one.

Well there is vcpkg now anyway so it finally does have one.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by JohnFen on Friday May 19, 2023 @05:48PM (#36007215)
I sense that we have some sort of real miscommunication going on here, because the only response I can think of to

> I have no idea why you would think that it doesn't need one.

Is that I have no idea why anyone would think that it does need one.

Perhaps the disconnect is that you are wishing C addresses different use cases than it addresses? That you wish it were a different language? If so, that's fine. Use a more appropriate language for your task. I just find it odd if the criticism of C is that it isn't a different kind of language.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by IshKebab on Saturday May 20, 2023 @02:12AM (#36009737)
> Is that I have no idea why anyone would think that it does need one.

For the same reason any language needs one. What is it about C that you think excludes it from the basic requirement of "using third party libraries"?

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by cozzyd on Friday May 19, 2023 @05:33PM (#36007102)
C package management works great on my system.

  # dnf install foo-devel
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by IshKebab on Saturday May 20, 2023 @02:15AM (#36009758)
That's suboptimal for many reasons. Package names are not consistent. Installing multiple versions is usually impossible. Huge pain for library authors. Doesn't integrate with build systems usually (even basic pkg-config support is iffy). The command is OS-specific. You can't usually choose the linking method. Difficult to bundle dependencies. Usually out of date. Etc. etc.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by cozzyd on Saturday May 20, 2023 @03:00AM (#36009941)
it works quite well in practice, and unlike pip things don't break every 2 weeks.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by devnullbrain on Friday May 19, 2023 @12:56PM (#36004153)
I'd suspect kernel devs know about function pointers.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by jjoonathan on Friday May 19, 2023 @04:31PM (#36006526)
I'd expect kernel devs to carry lots of bad habits and poorly calibrated intuition from their noob days. Example: "for loops are fine."
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by sgerenser on Friday May 19, 2023 @09:01PM (#36008450)
What’s wrong with for loops?
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by jjoonathan on Sunday May 21, 2023 @11:04AM (#36021706)
They encourage accidentally quadratic behavior if they are easier than calling sort().
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by asveikau on Friday May 19, 2023 @08:30PM (#36008295)
A lot of these comments are like "C is hard if you don't know C and it scares you".

Not to mention kernel mode doesn't want a gigantic library package manager to pull in leftpad() from the internet. As mentioned, the kernel libraries on FreeBSD have a qsort, but they didn't in the original commit from 3 decades ago or whatever.