Readit News logoReadit News
mmaniac commented on Matt Godbolt sold me on Rust by showing me C++   collabora.com/news-and-bl... · Posted by u/LorenDB
mmaniac · 10 months ago
> You know what's the most interesting part of this whole article? The thing Rust is very famous for, memory safety, did not feature at all.

I think that's the essential point, really... It'd be hard to argue that the rest of Rust isn't overall "better" than C++, but the compromises made to flexibility and ergonomics to achieve memory safety in Rust are the biggest points of contention for Rust critics.

mmaniac commented on A decompilation and port of Sonic Advance 2-a GameBoy Advance game written in C   github.com/SAT-R/sa2... · Posted by u/bane
aikinai · a year ago
They might have used some middleware, but GBA had no SDK I believe.
mmaniac · a year ago
The GBA SDK is pretty minimal in terms of library support. It's mostly functions for accessing save data plus wrappers around syscalls found in the bootrom. Those syscalls are some basic math functions, a few decompression algorithms, and an early version of the MusicPlayer2000 sound engine.
mmaniac commented on Modern C   gustedt.gitlabpages.inria... · Posted by u/ibobev
pjmlp · a year ago
It won't work, modern C is all about being C++ without classes and templates, while coming up with worse approaches (_Generic), apparently.

Now better ways of doing strings and arrays, no need for something as modern as 1976's PL/I way of doing them.

mmaniac · a year ago
What's so bad about _Generic?

I would not let the name distract you - it's equivalent to overloading, not "generics" (i.e. parametric polymorphism)

In that capacity I think it's quite a lot more sane than C++. Having a closed set of overloads, not having name mangling, not having complex name lookup rules are all a good thing.

mmaniac commented on Ask HN: Why some languages use 1 byte for boolean type    · Posted by u/Genius_um
unwind · a year ago
No, it's quite well-defined as far as I know. Fields must be packed in the order they are declared, and be suitably aligned, basically.
mmaniac · a year ago
Time to put my language lawyering cap on.

C99 §6.7.2.1.13

> Within a structure object, the non-bit-field members and the units in which bit-fields reside have addresses that increase in the order in which they are declared. A pointer to a structure object, suitably converted, points to its initial member (or if that member is a bit-field, then to the unit in which it resides), and vice versa. There may be unnamed padding within a structure object, but not at its beginning

C99 §6.7.2.1.13

> An implementation may allocate any addressable storage unit large enough to hold a bit-field. If enough space remains, a bit-field that immediately follows another bit-field in a structure shall be packed into adjacent bits of the same unit. If insufficient space remains, whether a bit-field that does not fit is put into the next unit or overlaps adjacent units is implementation-defined. The order of allocation of bit-fields within a unit (high-order to low-order or low-order to high-order) is implementation-defined. The alignment of the addressable storage unit is unspecified.

Which is standardese for pretty much exactly everything you said :)

The consequence of the first rule is that there's only one sane way to lay out structs. The only way to break that rule which I can imagine would be to add extra padding - you can't swap the order of any members under these rules.

mmaniac commented on Ask HN: Why some languages use 1 byte for boolean type    · Posted by u/Genius_um
unwind · a year ago
Just for completeness' sake: bit fields are a feature in plain old C too, and the syntax is the same [1].

Their most "obnoxious" feature is that the layout is implementation defined, so they are not very portable between compilers and/or architectures.

Often used in an embedded setting to model hardware registers, when you can know/control what compiler implementation is used.

[1]: https://en.wikipedia.org/wiki/Bit_field#C_programming_langua...

Edit: more with the words.

mmaniac · a year ago
Isn't struct layout in C implementation defined in general?

C itself doesn't specify any ABI. A given platform simply uses one as a matter of convention.

mmaniac commented on The 90s Gamer Experience: Handwritten Notes and Maps   rz01.org/90s-gamer-handwr... · Posted by u/exitnode
mmaniac · a year ago
Etrian Odyssey released in 2007 and was a fun throwback to this sort of experience. The concept for this game is that the Nintendo DS's touch screen can be used to draw a map and keep notes while dungeon crawling. It's funny to think that it's about as old now as the style of games it was imitating then.

The 3DS also had a note-keeping system built into the main menu and usable in any game, but I don't think many people bothered.

mmaniac commented on "Homotopical macrocosms for higher category theory" identified as woke DEI grant   mathstodon.xyz/@johncarlo... · Posted by u/nabla9
vkou · a year ago
The firehose of money won't go away, but you can bet dollars to donuts that it will be redirected right towards a spoils system, where the administration's friends and supporters will be reaping the rewards of victory.

And it won't even be coy about it.

mmaniac · a year ago
Nothing new under the sun.
mmaniac commented on "Homotopical macrocosms for higher category theory" identified as woke DEI grant   mathstodon.xyz/@johncarlo... · Posted by u/nabla9
ndsipa_pomu · a year ago
What really bugs me as an onlooker is that I thought the constitution specified gun ownership precisely to prevent tyrannical governments (e.g. the English) and yet now there appears to be developing exactly that.
mmaniac · a year ago
Those rights, like to bear arms and freely associate, only exist on paper. That they are in a state of nominal existence and practical abrogation serves to deradicalise and defuse resistance against the government, not encourage it.
mmaniac commented on Ask HN: Which messaging apps do you use?    · Posted by u/whoitwas
mmaniac · a year ago
All my online friends are on Discord, but I don't like it.

Family and IRL friends use WhatsApp.

mmaniac commented on Pat Gelsinger was wrong for Intel   bcantrill.dtrace.org/2024... · Posted by u/hasheddan
sangnoir · a year ago
> ...Intel was falling behind even AMD

The "even" makes the tone of your comment feel a tiny bit disrespectful towards AMD. By 2021, it was clear to me that AMD had their gloves off and were winning. Zen 3 was released in 2020 - the third generation of nearly flawless execution by AMD that Intel failed to respond to - outside of cutting the prices on some CPUs. For a while, Intel held onto the "fastest single-core speeds". Back in 2017, my first thought after being blown away by the performance of a first-gen Zen PC build was "I should buy shares in AMD" - AMD clearly had a superior product with an even better value proposition.

mmaniac · a year ago
I think the point is that Intel had such a lead in the Bulldozer era that for AMD to overtake them was a tremendous failure.

I would not say that the first gen of Zen is was a clear winner over Skylake. It took a couple iterations before AMD clearly took the lead. AMD was simply so far behind that several large generational improvements were needed to do better than Intel.

u/mmaniac

KarmaCake day328October 24, 2023
About
trmetroidmaniac@gmail.com
View Original