Readit News logoReadit News
n_plus_1_acc commented on Fundamentals of garbage collection (2023)   learn.microsoft.com/en-us... · Posted by u/b-man
BlimpSpike · a month ago
Kindof unrelated to the article, but I was recently wondering if it would be possible to detect and deny pointer cycles in a language in an efficient way, so that you could then use simple reference counting instead of full-blown garbage collection.

It probably wouldn't be usable for a general-purpose programming language, but for a special-purpose scripting language I could see it making the language implementation easier.

n_plus_1_acc · a month ago
Like Rust if it has no Rc?
n_plus_1_acc commented on What every programmer should know about how CPUs work [video]   youtube.com/watch?v=-HNpi... · Posted by u/bschne
csmantle · 2 months ago
The Matt Godbolt behind godbolt.org? Wow.
n_plus_1_acc · 2 months ago
All of his talks are very good
n_plus_1_acc commented on Vulnerabilities in Airoha-Based Bluetooth Headphones   insinuator.net/2025/06/ai... · Posted by u/incognitojam
incognitojam · 2 months ago
I do see an update for Sony XM4s in the Sound Connect App

  Update details in version 2.9.0
  - Enhanced security features of the system software.

n_plus_1_acc · 2 months ago
Are you sure this update address the issue?
n_plus_1_acc commented on I write type-safe generic data structures in C   danielchasehooper.com/pos... · Posted by u/todsacerdoti
o11c · 2 months ago
For your level 2 code, `uint64_t data[];` is wrong for types whose alignment is greater than `uint64_t`, and also wasteful for types whose alignment is smaller (for example, under an ilp32 ABI on 64-bit architectures).

For your level 3 code, it should be `int main() { List(Foo) foo_list = {NULL};`

Note that working around a lack of `typeof` means you can't return anything. Also, your particular workaround allows `const`ness errors since `==` is symmetrical.

You can't safely omit `payload` since you need it to know the correct size. Consider a `List(int64_t)` and you try to add an `int32_t` to it - this should be fine, but you can't `sizeof` the `int32_t`. Your code is actually lacking quite a bit to make this work.

=====

There are 2 major limitations to generics in C right now:

* Delegating to a vtable (internal or external) is limited in functionality, since structs cannot contain macros, only functions.

* Delegating to an external vtable (mandatory to avoid overhead) means that you have to forward-declare all of the types you'll ever use a vtable with. So far the best approach I've found is to declare (but not define) static functions in the same forwarding header I declare the typedefs in; note that GCC and Clang differ in what phase the "undefined static" warning appears in for the case where you don't actually include that particular type's header in a given TU.

(think about writing a function that accepts either `struct SizedBuffer {void *p; size_t len;};` or `struct BoundedBuffer {void *begin; void *end;};`, and also const versions thereof - all from different headers).

n_plus_1_acc · 2 months ago
This is also problematic, because there might be padding and the calculated size might be too small:

`malloc(sizeof(*node) + data_size);`

n_plus_1_acc commented on XSLT – Native, zero-config build system for the Web   github.com/pacocoursey/xs... · Posted by u/_kush
murukesh_s · 2 months ago
Sometimes I wish we could have kept XML alive alongside JSON.. I miss the comments, CDATA etc, especially when you have to serialize complex state. I know there are alternatives to JSON like YAML but I felt XML was better than YAML. We adopted JSON for its simplicity but tried to retrofit schema and other things that made XML complex. Like we kind of reinvented JSON Schema, and ended up like what XSD did decades ago and still lacking a good alternative to XSLT..
n_plus_1_acc · 2 months ago
I agree wholeheartedly, but the XML library in them JS ecosystem is shit.
n_plus_1_acc commented on 'Sticky thinking' hampers decisions in depression   bps.org.uk/research-diges... · Posted by u/domofutu
elric · 2 months ago
> I think anxiety in the virtual room is high and everyone just becomes paralyzed

I don't think that's necessarily anxiety. I'm sure there's a name for it, but it's a bit like the "bystander effect", where no one does anything because everyone expects someone else to deal with it. Something similar seems to happen in meetings with too many participants.

n_plus_1_acc · 2 months ago
There German word for that is Verantwortungsdiffusion (responsibility diffusion)
n_plus_1_acc commented on How Frogger 2’s source code was recovered from a destroyed tape [video]   youtube.com/watch?v=lvEO4... · Posted by u/perching_aix
n_plus_1_acc · 2 months ago
I have reported your homophobic comment.
n_plus_1_acc commented on Fossify – A suite of open-source, ad-free apps   github.com/FossifyOrg... · Posted by u/jalict
mcv · 2 months ago
It's nearly impossible to find good, honest apps on the play store anymore. Everything is loaded with ads, in-app purchases, spyware, and wants way more permissions than it needs. Google is making it more and more attractive to completely sever the ties to the play store. Although there are a few things I still want from there.
n_plus_1_acc · 2 months ago
I use aurora store to filter for ads and trackers
n_plus_1_acc commented on Show HN: Tritium – The Legal IDE in Rust   tritium.legal/preview... · Posted by u/piker
dtj1123 · 2 months ago
One thought regarding footnotes. I often find myself searching in the reverse direction, i.e. I have a footnote, where is the superscript to which it belongs?. This is quite difficult to do by eye, so perhaps some goto reference type functionality could be useful in this case.
n_plus_1_acc · 2 months ago
Trivial in LaTeX, does word not do that?

u/n_plus_1_acc

KarmaCake day511November 5, 2023View Original