Readit News logoReadit News
bxparks commented on Hash tables in Go and advantage of self-hosted compilers   rushter.com/blog/go-and-h... · Posted by u/f311a
andunie · 19 hours ago
So what is this article about?

1. How to do sets in Go?

2. What changed between Go 1.24 and 1.25?

3. Trusting an LLM?

4. Self-hosted compilers?

It is not clear at all. Also there are no conclusions, it's purely a waste of time, basically the story of a guy figuring out for no reason that the way maps are implemented has changed in Go.

And the title is about self-hosted compilers, whose "advantage" turned out to be just that the guy was able to read the code? How is that an advantage? I guess it is an advantage for him.

The TypeScript compiler is also written in Go instead of in TypeScript. So this shouldn't be an advantage? But this guy likes to read Go, so it would also be an advantage to him.

bxparks · 15 hours ago
I agree that the article is a bit unfocused about the supporting material. But the primary topic is clear: it's about the memory consumption of the Go map implementation.

This is an article written by a real human person, who's going to meander a bit. I prefer that over an LLM article which is 100% focused, 100% confident, and 100% wrong. Let's give the human person a little bit of slack.

bxparks commented on Building a High-Performance OpenAPI Parser in Go   speakeasy.com/blog/buildi... · Posted by u/subomi
bxparks · 3 days ago
Off topic: Something on that web page causes Firefox on my MBA2020 to use 133% of CPU, 30% of GPU Helper, the fan goes to full speed, and scrolling is slow and janky. I can barely read the article.

When I go to Reader mode, the CPU goes down to less than 20%, scrolling works great, and the fan goes off.

Did they implement scrolling using JavaScript?

bxparks commented on Pop_OS 24.04 LTS with COSMIC desktop environment   blog.system76.com/post/po... · Posted by u/onnnon
jorvi · 9 days ago
Overview is when you press the Super ('Windows') key.

What appears is an unholy amalgamation of a launcher, a workspace strip, a window overview, workspace peeking, and a dock.

Worse yet is that every time you go in or out of this overview, an animation plays, making things fly and animate everywhere constantly, whenever you want to take any action.

Whenever someone points out to Gnome developers that most people only want to open a launcher to type "52*93" or find a contact, that they just want to mouse over a dock to have a lightweight way to see if an application is open (and to switch to it), they get irate and tell you their vision is vastly superior.

Gnome could be pretty great if the developers their attitude to their users wants and the feedback on their issue tracker wasn't extreme snark and "actually we are right". Even if clear UI defects are pointed out, no, in fact they are right.

The Gnome peoples also frustrate any attempt at improving Wayland at a more rapid clip.

There is a reason why Valve went with KDE. KDE has its own set of problems, but at least they are receptive, cooperative and friendly. I genuinely hope Valve puts enough money into KDE that Gnome with its high and mighty attitude gets completely railroaded.

bxparks · 9 days ago
Sounds awful. Luckily we still have other options. I hope I never have to use GNOME again.
bxparks commented on Pop_OS 24.04 LTS with COSMIC desktop environment   blog.system76.com/post/po... · Posted by u/onnnon
johannesrexx · 9 days ago
We put a beautiful wallpaper on the Desktop. Ahhhh.

Along comes a Luddite and puts icons on it, totally ruining its beauty. For fsck's sake! Just No.

Thankfully, along comes GNOME and it just says No.

I agree.

bxparks · 9 days ago
If you want a pristine desktop, don't put icons there. If I want to put icons on my desktop, it's none of your f'ing business.
bxparks commented on Pop_OS 24.04 LTS with COSMIC desktop environment   blog.system76.com/post/po... · Posted by u/onnnon
jorvi · 9 days ago
I really hate that at some point in the past, KDE developers decided that they hated how deeply intuitive virtual desktops are and deprecated them in favor of something deeply unintuitive (Activities). Any issue or complaint mentioning it is shot down with "you're holding it wrong."

Please just give virtual desktops first class support and lets forget about the Activities experiment. Most users hate it.

The attitude regarding it is about as bad as Gnome forcing Overview on everyone, refusing to provide a first party dock or lightweight launcher. Despite almost every distro and 95% of Gnome users immediately installing Dash to Dock.

bxparks · 9 days ago
I'm not familiar with the Gnome terminologies. Is Overview the one where they removed all the desktop icons, breaking 40 years of GUI conventions going back to the 1970s? (It's impossible to do a search on a product called "Overview".) I blew away Gnome after that, installed Mint MATE (now Cinnamon), and vowed to never touch Gnome again.
bxparks commented on When would you ever want bubblesort? (2023)   buttondown.com/hillelwayn... · Posted by u/atan2
thomasmg · 10 days ago
There is stable in-place merge sort, it runs in O(n*log(n)^2). It is about 3 times more complex than shell sort. I implemented it here https://github.com/thomasmueller/bau-lang/blob/main/src/test... (most sort algos you mentioned above are in the same direcory btw)

You didn't mention heap sort. A simple implementation, which doesn't do any method calls just like shell sort (also next to the merge sort above) is about twice as complex than shell sort.

bxparks · 10 days ago
Thanks for the reference to in-place merge sort. GitHub is having a lot problems right now, I cannot see your code. I will look at it when I get a chance.

I think I ignored Heap sort because it uses O(N) extra RAM, which is precious on a resource-constrained microcontroller.

bxparks commented on When would you ever want bubblesort? (2023)   buttondown.com/hillelwayn... · Posted by u/atan2
archargelod · 10 days ago
Terminating condition in Bubble sort is "did we swap any values during this loop"? Yes -> continue, No -> list is already sorted, exit the loop.

I don't believe that insertion/selection sort is easier to grasp. Can you type it from memory, without looking it up? Here's bubble sort:

    var swapped = true
    while swapped:
      swapped = false
      for i in 0 .. list.len-2:
        if list[i] > list[i+1]:
          swap(list[i], list[i+1])
          swapped = true

bxparks · 10 days ago
Different strokes for different folks I guess.

Selection sort was the first sorting algorithm that I ever created: Find the smallest element for slot #1. Find the next smallest for slot #2. And so on. I've recreated it from scratch many times. The double for-loop means that it is guaranteed to finish, and it is obviously O(N^2).

I did not learn about Bubble sort until my university class, where I thought, this is a terrible algorithm: It's not completely obvious that it will finish, and it's not obvious what the runtime complexity is. For example, if the inner loop used ">=" instead of ">", it would work for test data sets with unique elements, then hang forever with a real data set that contained duplicates.

bxparks commented on When would you ever want bubblesort? (2023)   buttondown.com/hillelwayn... · Posted by u/atan2
jhallenworld · 10 days ago
I've used it on a tiny microcontroller because libc's quicksort was huge.
bxparks · 10 days ago
Shell sort is sooo much faster than Bubble sort for tiny microcontrollers, for only a little bit more flash memory, like 40-100 bytes. If that's too much, then Insertion sort is 6X faster than Bubble sort, for only 10-20 bytes of extra flash.
bxparks commented on When would you ever want bubblesort? (2023)   buttondown.com/hillelwayn... · Posted by u/atan2
JKCalhoun · 10 days ago
The appeal of bubble sort for me is that is it the only one I understand well enough to implement myself without having to think much about it.
bxparks · 10 days ago
I read this all the time from other people, but for me, Selection sort is the easiest to remember and implement. My next easiest would be Insertion sort.

Bubble sort doesn't click for me easily. I think it's because the terminating condition seems uglier than Selection sort or Insertion sort. I always have a little voice in the back of my mind, "Is this outer loop guaranteed to terminate?"

bxparks commented on When would you ever want bubblesort? (2023)   buttondown.com/hillelwayn... · Posted by u/atan2
bxparks · 10 days ago
On 8-bit and 32-bit microcontrollers (e.g. 8-bit AVR, 32-bit ESP8266/ESP32), Insertion sort is 6X faster than Bubble Sort on random data. I have tested this up to about N=1000.

Both Insertion sort and Bubble sort are O(N^2). Both are stable sorts. Insertion sort consumes only about 10-20 bytes more flash memory than Bubble sort. It's hard to think of situations where Bubble sort would be preferred over Insertion sort.

Shell sort is vastly superior if you can afford an extra 40-100 bytes of flash memory. (It's not too much more complicated than Insertion sort, but sometimes, we don't have 100 extra bytes.) It is O(N^k), where k ≈ 1.3 to 1.5. As soon as N ⪆ 30, Shell sort will start clobbering Insertion sort. For N ≈ 1000, Shell sort is 10X faster than Insertion sort, which in turn is 6X faster than Bubble sort. Unfortunately Shell sort is not stable.

Comb sort has a similar O(N^k) runtime complexity as Shell sort. But it seems slower than Shell sort by a constant factor. Comb sort is also not stable. I cannot think of any reason to use Comb sort over Shell sort.

Quick sort is not much faster than Shell until about N ≈ 300. Above that, the O(N*log(N) of Quick sort wins over the O(N^k) of Shell sort. But Quick sort is not stable.

Merge sort is stable and runs in O(N*log(N)), but it consumes an extra O(N) of RAM, which may be impossible on a microcontroller. You may be forced back to Insertion sort for a stable sort.

u/bxparks

KarmaCake day1435September 21, 2019View Original