Better HN
topnewbestaskshowjobs
Log inSign up

SkiFire13

2,119 karma · joined Mar 10, 2021 (5y ago) · 953 submissions

Submissions

comment 3h ago · link · parent

if/while/for are also goto with another name. All jumps are goto, the difference is how readable/understandable they are.

Labeled break/continue is in some way better than unlabeled break/continue because they can carry more meaning and tell you which loop you are operating on.

You can of course write some ugly soup with this, but so can you right now with some extra variables.

And even then this does not have the full "power"s of goto. You cannot even create irreducible control flows with it.

Finally, labeled break/continue has been supported in many languages for a long time (Java supported it in its 1.0 release!) and I have never seen it being considered harmful there.

comment 4h ago · link · parent

Contracts are a glorified assert that can be enabled/disabled based on compilation flags. So nothing new, except it's UB to link binaries compiled with different contract modes (it isn't if you define your own assert macro!). So at the end of the day there are mostly no upsides, but you get more UB you didn't ask for.

comment 16h ago · link · parent

I actually found GraphQL quite enjoyable to use. My only gripe with it is that it's hard to cache in CDNs given that it's always a POST and you have to read the body to determine whether to cache it or not.

> Well thought out REST endpoints organically grown as usage is required or observed trumps hyper flexible endpoints created because "Who knows what the user might need"

The issue with having all those endpoints is that you start waiting for one endpoint response before calling another, and that adds a lot of latency for end users.

comment 1d ago · link · parent

> However C only guarantees you can you can convert a integer to a valid pointer, if that integer has been converted from a pointer, and not been modified in any way. If the integer has been modified its implementation defined what happens. Its no longer valid standard C.

The C standard doesn't even guarantee that. It only guarantees the conversion from 0 to a null pointer. Any other integer-to-pointer conversion is implementation defined.

What implementations _want_ to define is a different question though.

comment 2d ago · link · parent

> He said if the Wonder Valley project goes ahead it would release the equivalent of 23 atomic bombs of energy every day, though he noted the comparison has its limits."

Saying this comparison has its limits is an understatement. Energy released by different atomic bombs can vary across different order of magnitudes.

comment 3d ago · link · parent

One of my university professors liked to use the term _Pharmacist_ for what you refer to as _Developer_, because a pharmacist mostly gets an already written prescription and only has to fetch the medicine/drug.

Sidenote: note that in some countries someone with a degree in Computer Science cannot legally call themselves an _Engineer_, even though they have roughly the same knowledge and abilities as someone who got a Computer Engineering degree.

comment 3d ago · link · parent

> many newer software engineers literally want tickets like "modify function x_y_z() in python_file.py so that it also returns..."

These aren't software engineers, they are just people that know a programming language syntax.

comment 4d ago · link · parent

> Do people here know what interaction nets are?

Even if people know they are it doesn't help that a good chunk of the article is dedicated to their AI methods, and there are very little technical explanations of how this actually works.

comment 5d ago · link · parent

You also need to have a working product. Google seems to do anything except creating one.

comment 6d ago · link · parent

This is the comment I was looking for.

comment 1w ago · link · parent

> it must ultimately prioritise non-technical end users

> puts control in users' hands rather

These two statements are very much at odds with each other.

Non-technical users generally don't know which folder the app needs. It will be confusing for them. If anything this feature works best for *technical* users, that know, or have the ability to look up, which folders the application actually needs.

comment 1w ago · link · parent

> so you'd expect the results to be higher than average on that basis alone.

The article is focusing on that fifth of students that didn't perform well, but if that can be trusted then it means 80% of the students did end up performing better than the national median, and 80% seems pretty high to me. Do normal private schools guarantee even higher chances of my kids performing better?

comment 1w ago · link · parent

And the 5th option where you are your own AI provider.

comment 1w ago · link · parent

Except Google is now also starting to block apk installs so the only way to share toy apps is now the Play Store. Want to share your app with 10 other people? Too bad you're less than 12.

comment 1w ago · link · parent

You could do `bool::not` before, but this is clearer and doesn't require imports.

comment 1w ago · link · parent

It's not a strict prerequisite, you can just require the library being distributed to use extern "C".

comment 1w ago · link · parent

I don't think that will solve the chargeback/refund issues.

comment 1w ago · link · parent

> Even though merge sort is algorithmically faster.

Merge sort is algorithmically faster only when either quicksort is implemented naively (in the O(n²) way, which I would obviously ignore) or when data is already almost sorted (when using something more similar to timsort). In the latter case it will be faster even when the data size becomes pretty big, because merge sort will actually reduce memory movements in those cases.

comment 1w ago · link · parent

Quicksort is quick because it's space requirements are very far from _n_, as they are just O(log n).

A fast sorting algorithm whose space requirements are closer to n would be e.g. merge sort.

comment 2w ago · link · parent

> those servers have about a 5 year lifetime

The real ramp up started in 2025, most servers will live at least until 2030. If the bubble pops it will be much earlier than that.

comment 2w ago · link · parent

> the complexity and over-head of the malloc abstraction is precisely what made me very intrigued by "stack-only" languages, such a recently published Goose.

Goose's stacks have quite some complexity themselves. They preallocate a ton of memory. The compiler has to magically match your code to each stack. You are not allowed to have nested growing types (e.g. creating an adjacency list is not so easy). And after all for some usecases you still end up using an allocator (Goose's linked list example ends up building a pool allocator for the linked list nodes!)

comment 2w ago · link · parent

See the Cards examples for Material Design [1]. There's no single linear layout but multiple ones in different directions and anchors. There can also be images and multi-line text.

For another example: Adwaita's boxed lists [2] are pretty complex. Blender generally uses a simple label followed by some kind of button, in comparison Adwaita has a wrapping box, separator, special handling for first/last items, subtitles, animated expansion, and a ton of customizability.

I'm not saying these are good examples of UI, but they are surely _more complex_ than Blender. Blender has more menus and controls compared to a normal Material/Adwaita UI for sure, but they are pretty much the same, so it has quantity but not complexity from my point of view.

    [1]: https://m2.material.io/components/cards#anatomy
    [2]: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.4/boxed-lists.html

comment 2w ago · link · parent

The GPU will re-render everything anyway. What you can at most optimize is the upload of data to the GPU (i.e. upload only what has changed).

Also consider that if your UI framework supports z-level, opacity and other features like that then determining what has changed for rendering is much more complex than just determining what UI elements have changed.

comment 2w ago · link · parent

The article clearly shows each thread producing aggregation data for each partition (by grouping key), see the second figure.

They also talk about "merging" these partitions at the end, and even while talking about their optimization they talk about this merging stage.

comment 2w ago · link · parent

Apart from the main 3D viewport Blender's UI need don't look that complex. Most of its UI are panels with simple layouts and buttons/sliders/checkboxes. And I bet they don't use their UI library for the main 3D viewport.

comment 2w ago · link · parent

In my opinion this comes down to how much data you have on screen and whether you can efficiently skip off-screen data. If you can do that then it doesn't matter how your framework scales, you will be bound by screen space anyway.

That said, I indeed am not fond of GPUI and egui, but for different reasons.

In GPUI having to manually mark the state as changed is IMO a footgun and any decent UI framework should not require something like that.

In egui I found the "immediate mutation" pattern (e.g. the classic `if button.pressed() { mutate }`) to produce glitches in the UI, because it will cause half the UI to draw the old state and half the new state. You almost always want to anticipate interactions, or to delay mutations. But performance is not a problem IMO unless you're writing a complex vector graphics viewport (in which case retained UI won't help you either)

comment 2w ago · link · parent

egui has been integrated with AccessKit since a few years now

comment 2w ago · link · parent

To be fair this looks completely written by an LLM, so it's likely something those agents already know.

comment 2w ago · link · parent

Depending on what you're doing GPU accelerated rendering is more battery friendly than CPU rendering though.

comment 2w ago · link · parent

Almost all of those 200MB will be system libraries for rendering and GPU buffers.
12345
32