Better HN
topnewbestaskshowjobs
Log inSign up

nicbn

13 karma · joined Dec 7, 2023 (2y ago) · 13 submissions

Submissions

1.

Dynamic Any-Casting in C++(nicbn.com ↗)

1 points · by nicbn · 1w ago · discuss

comment 10mo ago · link · parent

Wikipedia has a table for how many papers each project produced:

https://en.wikipedia.org/wiki/Berkeley_Open_Infrastructure_f...

According to this, Rosetta@home (which is like Folding@home that runs on BOINC) produced 234 papers.

comment 1y ago · link · parent

Does that in multiple places. Maybe they wanted a way to quickly revert it? Or enable on countries where they think they can get away with it?

comment 1y ago · link · parent

iirc pthread uses the same ABI under the hood, only its compiled into the libc

comment 1y ago · link · parent

100% period.

comment 1y ago · link · parent

Would it be possible for someone within a compatible jurisdiction to mirror SQLite3 and provide it under some license such that it could be used by anyone?

comment 2y ago · link · parent

It's common among Rust projects (the standard library also uses it).

Apache 2 has a patent grant so it's preferred by companies, but is not compatible with GPLv2, and MIT is compatible with GPLv2.

Source: https://prev.rust-lang.org/id-ID/faq.html#why-a-dual-mit-asl...

comment 2y ago · link · parent

Check out: https://m.youtube.com/watch?v=kQeDnFUNW-Q

And gate starts at 4:49. Or gate starts at 6:27. The trick is to make some gears not stationary, moving along as other gears push them.

comment 2y ago · link · parent

https://caniuse.com/webp

Any updated (modern) browser should be able to see webp just fine, I'd rather just serve it without a backup plan if I'm planning to have webp in my website.

comment 2y ago · link · parent

But to know via scientific method requires proof (or disproof) by experimentation

comment 2y ago · link · parent

Fair enough. But it is needed to point out that there's a catch in that in order to use dynamic dispatch (subclasses, interfaces, ...) you'd still need to use pointers in C++.

Deep down the problem could be rephrased as "there are no structs in Java". In C# for example you could have a vector of structs and enjoy linear memory access.

comment 2y ago · link · parent

If you aren't using OOP features (such as inheritance), you're not really doing OOP, despite using C++.

In the case of C++ I'd put something like: you can use free or costly abstractions, and OOP in general has a preference towards costly ones.

Also vector is a weird point to make, it's been some time I had to deal with Java (luckily) but arrays there are also linear AFAIK. And there are GCs that have a bump allocator for new objects (not sure if Java fits here), so cache would benefit more than in sparse malloc allocations in C/C++.

comment 2y ago · link · parent

(As with OO) depends heavily on implementation, but my 2 cents is that functional doesn't apply as much constraints to optimization.

If a compiler is sophisticated enough a functional program should perform as well as a procedural one that uses a comparable garbage collector. But of course real compilers have shortcomings.

I recommend taking a read at Haskell's wiki performance article[1] to have an understanding of the shortcomings that are specific to Haskell.

[1] https://wiki.haskell.org/Performance