simontherockjohnson

joined 1 month ago
[–] simontherockjohnson@lemmy.ml 1 points 11 hours ago* (last edited 11 hours ago)

The flag -O3 exists. Or just -funroll-loops. You shouldn’t even need -funroll-all-loops in this case, since hashes have a fixed size.

I sound way more competent with the flags than I am here, haha. Does Gentoo use an alternate compiler by default?

This is in reference to an ancient linux meme cw: slur

[–] simontherockjohnson@lemmy.ml 2 points 1 day ago* (last edited 1 day ago)

Ironically 'a'++ works in C/C++ because 'a' is char where in JS 'a' is string.

[–] simontherockjohnson@lemmy.ml 2 points 1 day ago* (last edited 1 day ago)

Yeah you're actually right, it's an int in C since K&R C didn't have bool, however it's a bool in C++. I forget my standards sometimes, because like I said this doesn't really matter. It's just nerd trivia.

https://en.cppreference.com/w/cpp/types/type_info/operator_cmp.html

[–] simontherockjohnson@lemmy.ml 3 points 1 day ago* (last edited 1 day ago) (5 children)

There are plenty of sha1 implementations that are more readable and sensible and less readable and sensible. This portion is simply an manually unrolled loop (lmao these gcc nerds haven't even heard of Gentoo) of the hash chunk computation rounds. Hash functions aren't "impenetrable" they're just math. You can write math programmatically in a way that explains the math.

The point of this post is actually things like x[(I-3)&0x0f]. It's entirely the same concept as coercion to manipulate index values this way. What's funny is that void pointer math, function pointer math, void pointers and function pointers in general are typically seen as "beyond the pale" for whatever reason.

Beyond that if you know C you know why this is written this way with the parens. It's because C has fucked up order of operations. For example a + b == 7 is literally "does adding a + b equal 7", but if you write a & b == 7 you would think it means "does a AND b equal 7", but you'd be wrong. It actually means does b equal 7 AND a.

Furthermore a & (b ==7) makes no sense because b == 7 is a boolean value. Bitwise ANDing a boolean value should not work because the width of the boolean is 1 bit and the width of the int is 8 bits. ANDing should fail because there's 7 void bits between the two types. However the standard coerces booleans in these cases to fit the full width, coercing the void bits to 0's to make bitwise ANDing make sense.

Beyond that asking what the memory size of a variable in C is a fools errand because the real answer is "it depends" and "it also depends if someone decided to ignore what it typically depends on (compiler and platform) with some preprocessor fun". Remember how I said "void pointers" are beyond the pale? Yeah the typical "why" of that is because they don't have a known size, but remember the size of something for C is "it depends". 🤷

Almost every language has idiosyncratic stuff like this, but some let you make up your own shit on top of that. These kinda low hanging fruit jokes are just people virtue signaling their nerddom (JS bad am rite guis, use a real language like C), when in reality this stuff is everywhere in imperative languages and typically doesn't matter too much in practice. This isn't even getting into idiosyncracies based on how computers understand numbers which is what subtracting from 0x5F3759DF (fast inverse square root) references.

[–] simontherockjohnson@lemmy.ml 1 points 1 day ago* (last edited 1 day ago) (7 children)

I thank god every day people who make these comics are too stupid to open gcc's sha1.c because they'd see shit like:

#define M(I) ( tm =   x[I&0x0f] ^ x[(I-14)&0x0f] \
		    ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \
	       , (x[I&0x0f] = rol(tm, 1)) )

#define R(A,B,C,D,E,F,K,M)  do { E += rol( A, 5 )     \
				      + F( B, C, D )  \
				      + K	      \
				      + M;	      \
				 B = rol( B, 30 );    \
			       } while(0)

      R( a, b, c, d, e, F1, K1, x[ 0] );
      R( e, a, b, c, d, F1, K1, x[ 1] );
      R( d, e, a, b, c, F1, K1, x[ 2] );
      R( c, d, e, a, b, F1, K1, x[ 3] );
      R( b, c, d, e, a, F1, K1, x[ 4] );
      R( a, b, c, d, e, F1, K1, x[ 5] );
      R( e, a, b, c, d, F1, K1, x[ 6] );
      R( d, e, a, b, c, F1, K1, x[ 7] );
      R( c, d, e, a, b, F1, K1, x[ 8] );
      R( b, c, d, e, a, F1, K1, x[ 9] );
      R( a, b, c, d, e, F1, K1, x[10] );
      R( e, a, b, c, d, F1, K1, x[11] );
      R( d, e, a, b, c, F1, K1, x[12] );
      R( c, d, e, a, b, F1, K1, x[13] );
      R( b, c, d, e, a, F1, K1, x[14] );
      R( a, b, c, d, e, F1, K1, x[15] );
      R( dee, dee, dee, baa, dee, F1, K1, x[16] );
      R( bee, do, do, dee, baa, F1, K1, x[17] );
      R( dee, bee, do, dee, dee, F1, K1, x[18] );
      R( dee, dee, dee, ba, dee, F1, K1, x[19] );
      R( d, a, y, d, o, F1, K1, x[20] );

And think, yeah this is real programming. Remember the difference between being smart and incredibly stupid is what language you write it in. Using seemingly nonsensical coercion and operator overloaded is cringe, making your own nonsensical coercion and operator overloads is based.

That's why you should never subtract things from 0x5F3759DF in any language other than C.

[–] simontherockjohnson@lemmy.ml 5 points 6 days ago* (last edited 6 days ago)

Don't worry it's the Forward, there's 3 more articles coming about how the definition of genocide should exclude destruction in whole or in part of a group by a group that has "epigenetic trauma" from being victims of a genocide themselves.

Demo Driven Development is wayyy worse.

[–] simontherockjohnson@lemmy.ml 9 points 6 days ago* (last edited 6 days ago)

The IMF is going to give Ukraine another loan but only if Ukraine tells every pensioner in the country that if they freeze to death next winter that's on them. Ukraine will default on that one too.

[–] simontherockjohnson@lemmy.ml 9 points 1 week ago* (last edited 1 week ago)

This is only really useful in low expressiveness languages where there is not a huge set of language enhancements possible through libraries. Think Java exception handling for example.

In essence it works if you "best practices" are things like don't use switch statements.

It doesn't work if you best practices are things like use Result<T, E> from this functional result library.

Essentially LLMs don't really work "at scale" if you need anything more complicated than what the average internet tutorial code is in your language.

Same with perf.

Also this only works 60% of all the time though if that, so the more requirements you pile on the less likely it will hit all of them properly.

[–] simontherockjohnson@lemmy.ml 1 points 1 week ago* (last edited 1 week ago)

Hardware can't really have "tech debt" in the same way as software. Hardware is a physical entity, each computer is a different computer, they're the same model, the same design, but they're different computers. Each installation of software is a direct copy. If we're on the same architecture and the same version, we're running the same Firefox unless something is wrong with Mozilla.

I think hardware that's outdated is bound to happen. As a hobbyist I have my own share of "outdated hardware". In reality that shit still works. I can pull an old laptop and put Fedora Silverblue on it today and it will work just fine for surfing the web, writing on forums, doing a good amount of hobbyist software stuff, etc.

And there in lies the problem, that much of the lifecycle of hardware is directly tied to software support and typically very strongly to bad commercial software. We can give people reasons to not upgrade and we'll write better software for it. Some of the best software is effectively eternal, for example I have used vim my entire professional career even when I was writing Java.

I think the biggest problems is that there's too much hardware and proprietary hardware being made now a days, and not enough hobbyists to get it basic support. For example unless the landscape changes in 6 years I will likely have no way to revive full functionality for my M1 Apple silicon.

But that's PC's, the more egregious things are smaller form factor devices. Android has been the biggest disappointment for me to be honest. What was sold as a "Linux Phone" gave you none of the technical benefits of Linux. So much small form factor stuff essentially becomes ewaste. The small amount of platforms that gain hobbyist support are extremely rare and limited. This is exacerbated by tight integration between physical devices to server side software as a service platforms.

If the libre movement was not a hollowed out husk of it's former self and the economic conditions were able to create a new set of leaders for it we would have

  • GPLv4 that requires you to license as GPLv4 if you use any remote procedure call regardless of medium that executes GPLv4 code.

  • GPLv4.1 that requires any device where GPLv4.1 code comes factory installed must have a fully documented and unlocked bootloader and/or user serviceable firmware flash functionality

  • GPLv5 that requires you to license as GPLv5 if you have any use of GPLv5 code in the tool/supply chain of a software for examle if FoxConn is using gnutls and you use a MacBook you're licensing as GPLv5, if you are a GPLv5 compiler, you're licensing as GPLv5

  • GPLv6 that makes legal to execute your landlord if they charge you rent and any GPLv6 code is used by them directly or indirectly

That would really fix some things regarding ewaste and frankly housing. TBH I think we're gonna see general computing calm the fuck down in the next 10-20 years compared to the onslaught of release cycles in the late 2000's and 2010's. The only real possible driver is going to be if games really glom on to ray tracing bullshit beyond the AAA contractually obligated messes.

[–] simontherockjohnson@lemmy.ml 5 points 1 week ago* (last edited 1 week ago)

I honestly feel like a walking infohazard most days. I have started reflexively weaponizing my autism to that extent.

[–] simontherockjohnson@lemmy.ml 3 points 1 week ago* (last edited 1 week ago)

I was literally explaining the context of a project I'm working on to a mid-level exec and I was explaining the incentive structure of our team (with a graph that had directionality and weight) within the business. The structure was typical and showed that the strongest incentives (e.g. the things that have strongest ability to decide roadmaps, implementation and prioritization) exist surprise surprise outside the team. It's incredibly bad because there's like 7 strong outflows (lovely bold lines leaving a big box with our org label on it containing our teams as nodes tells a great simple story), in our structure to various stakeholders, and only middling and weak inter-team flows. I literally used the term "we have responsibility without authority" in the exec summary. You're 100% preaching to the choir here.

I'm stealing this one, because it's a very apt description:

 

 

First two paragraphs of 18th of The Eighteenth Brumaire of Louis Bonaparte is one of the most if not the most insightful works of sociology.

Hegel remarks somewhere[*] that all great world-historic facts and personages appear, so to speak, twice. He forgot to add: the first time as tragedy, the second time as farce. Caussidière for Danton, Louis Blanc for Robespierre, the Montagne of 1848 to 1851[66] for the Montagne of 1793 to 1795, the nephew for the uncle. And the same caricature occurs in the circumstances of the second edition of the Eighteenth Brumaire.

Men make their own history, but they do not make it as they please; they do not make it under self-selected circumstances, but under circumstances existing already, given and transmitted from the past. The tradition of all dead generations weighs like a nightmare on the brains of the living. And just as they seem to be occupied with revolutionizing themselves and things, creating something that did not exist before, precisely in such epochs of revolutionary crisis they anxiously conjure up the spirits of the past to their service, borrowing from them names, battle slogans, and costumes in order to present this new scene in world history in time-honored disguise and borrowed language. Thus Luther put on the mask of the Apostle Paul, the Revolution of 1789-1814 draped itself alternately in the guise of the Roman Republic and the Roman Empire, and the Revolution of 1848 knew nothing better to do than to parody, now 1789, now the revolutionary tradition of 1793-95. In like manner, the beginner who has learned a new language always translates it back into his mother tongue, but he assimilates the spirit of the new language and expresses himself freely in it only when he moves in it without recalling the old and when he forgets his native tongue.

Here Karl Marx also humanistically describes the root problem of production of processes in general. The problem of the cumulative error. While Marx is describing the production of history that is a productive force, it is also in a class of meta-productive forces. These are productive forces that do not directly produce material goods but affect the productive forces that do create physical goods and services.

This is literally the same metaphor as tech-debt. Software has many parallels because the production of software is also a meta-productive force. It produces an immaterial good that is productive force in itself and produces other immaterial and material goods. Tech-debt is the effect of inefficient cycles, that weighs on future cycles.

This is similar to the educational concept of Wittigenstien's ladder or lying to children, because learning itself is a meta productive force. In essence as a productive force, learning is cyclical. In order to understand how atoms function, we teach children models that are technically incorrect such as the Bohr model so they can understand approximations closer and closer to the truth. These are all productive cycles that compound on each-other.

In all these cycles the most important thing is that each future cycle must trend more strongly in the positive direction (a better understanding, better materialist outcomes, software that is cheaper to build maintain and is more resilient), rather than accumulating errors, which will eventually self-reinforce to middling and negative results and eventually collapse.

These cycles represent real risk in the real world. For example one of the most difficult things about the way we develop technology is that its not deterministic. The classic black swan scenario of solar flares causing a strong EMP would result in chaos. This is not just because would have to rebuild everything. The simple reason fact is we cannot "rebuild" the world ex nihilio because we don't have clear knowledge of certain steps along the way. Sure we could figure it out, but that's a different process. That's the process of technological discovery, not the process of applying technology.

You can think of it as rebuilding a neighborhood being hit by a bomb. The neighborhood is gone and we don't have floor plans of some of the key buildings. But it's actually worse than that. We don't have plans to the buildings that lead to the creation of those buildings. We don't have a university, but to build a university we need a foundry, we need a printing press, we need a quarry, we need a brick yard, etc. We don't have some of those, or some of the inputs to some of those. It's actually more complex than that because each of these "functions" also scales and has dependencies at different levels of scale. So we might be able to build a brick yard, but that brick yard won't be able to produce bricks that meet modern specifications until we build a smaller university to research brick making.

I literally think about these daily during the course of my software job:

  • the first time as tragedy, the second time as farce
  • Men make their own history, but they do not make it as they please
  • The tradition of all dead generations weighs like a nightmare on the brains of the living.

There was a period of time where I played nothing but Dark Souls 1 and 3 (same theme) and thought about these.

 
  1. I haven't bought snus in 10 years. I know I was carded only because your average 15 year old brocollini's out here want to littrealy be vibrating with energy like their favorite streamer Ethan Klein

  2. Your sterile reconstituted synthetic "nicotine pouches" that have been created by finance capital to get around the idiotic tobacco taxes/regulations have so many wild and crazy colors it's impossible to find mint at the store.

  3. The only good snus brand is Siberia. Seriously look at this shit

You can take my can off me once you put me up against the wall and execute me for being "cringe" under the tenants of Marxist-Lenninist-Zoomerism for writing this post.

 

Partner and I have been watching The Last of Us because we stan Pedro Pascal and Bella Ramsey.

I was telling my partner not to expect a good character story for The Last of Us Season 2 since the show has been faithfully relaying the plot of the games especially in it's scene composition.

For those who don't know TLOU Part 2 was explicitly written to be Israeli propaganda.

Neil Druckman (grew up as a West Bank Settler as a child, until his family moved to the US) has explicitly gone on the record to say that the story was inspired by the 2000 Ramallah lynching among other experiences in the West Bank. He's a reflexive center left Zionist which means he's an ultra lib loser and he donated $2,500 to both sides after October 7th and the subsequent reprisal. Also he's a huge loser who fell for the beheaded babies propaganda.

He has explicitly gone on the record to say he wanted to essentially do what Kill BIll did for the concept of "when you seek revenge dig 2 graves", where the ending both reifies it but also waters down its inherent tragedy in the eyes of the audience.

“I landed on this emotional idea of, can we, over the course of the game, make you feel this intense hate that is universal in the same way that unconditional love is universal?” Druckmann told the Post. “This hate that people feel has the same kind of universality. You hate someone so much that you want them to suffer in the way they’ve made someone you love suffer.”

So essentially the POV is that you're supposed to want to feel the currently very Israeli coded feeling of being so racist, self righteous and hateful that it drives your society to hollow itself out in it's irrational crusade to extinguish the subject of these feelings. But in a, you know, rationalizing, this is fine, this is normal, this is just people and there's nothing you can do and some of it is kinda good actually way.


I'm incredibly curious as to how TLOU Season 2 walks this tight rope with the source material, political climate, and especially since Bella Ramsey has been so outspoken about the genocide.

My partner didn't believe me about the source material, and we started watching S2E4. Within 5 minutes they changed their tune.

Because the cold open is Isaac torturing a Seraphite while reiterating Israeli style talking points about how he doesn't care about who's actually doing the most killing, and that he has some abstract right to kill all of the Seraphites as revenge / preemptive self defense / etc. When the Seraphite tells him that the WLF is eating itself and their troops are joining the Seraphites and never leaving, it leads to him getting irrationally mad and just straight up executing the Seraphite. Outside the door one of WLF guards looks a bit upset for a second before the second one said "Good he got what he deserved".


Grimly realistic stuff. Gonna be interesting how they thread this needle.

 

I'm upgrading my builds and I decided to get a new monitor so I splurged on the Samsung G9 49" Curved OLED.

My personal and work ARM MBP's require significant tweaking to get the G9 working with a good DPI and font rendering.

I finally booted up my desktop tonight and it just works. I literally didn't have to touch anything.

 

I saw Dirt Owl and Tankie Tanukie in the closet making babies and I saw one of the babies and the baby looked at me.

 

The only good programming sub on reddit was /r/ExperiencedDevs because it used to be a sub that was just devs who had actually worked on difficult code bases and scenarios, actually built teams and software soup to nuts.

For the last year or two it's the same ChatGPT careerist bullshit that doesn't even understand what it's saying. There's literally a post on there where a dev is complaining that tech lead is telling him to refactor code he's touching and he's asking the peanut gallery for solutions.

Most of the peanut gallery is telling him to try to throw the work back through the ticketing/prioritization process.

Any place that I've ever worked at, good software, or at the very minimum software that wasn't extremely painful to work on, was created in spite of managerial decisions and processes. I've been a senior tech leader for like 10 years now, and all this is telling me is that people have no fucking clue.

Is there any community out there that understands that no matter what, when you put 2 proposals in front of a bean counter business guy who barely comprehends how to breathe, they're going to choose the one that is proposing a new revenue stream and not the one that's nerd bullshit --and that all decision making in companies is boiled down to a sequence of these moments? that all of your backlogs and engineering roadmaps are just wasted effort and time that creates a mountain of tech-debt debt to go through? that the only way to actually fix this shit is to enforce professionalized boundaries and tell the business that it's your job as developers to decide how to implement things and not theirs?

ExperiencedDevs used to actually tell people like this to fuck off, that they weren't a career advice sub. It used to be a sub where OP would be questioned if they were presenting themselves in a weird or perfect way because so much of this job at high levels is incredibly contextual and systems based. Now it's just the same shit as every other "the sky is falling", careerist, opportunist tech bro dump. It's worse than fucking Hacker News, because Hacker News at least understands P&L and knows it exists, that how you interact with it has conseqeuences. Half the comments in ExperiencedDevs are now like 'You have to have you Product Owner make the decision.'

Every product owner I've ever met was only focused on defining their own product within the business context (you know their job?). They had no idea how to build it. Most of them could barely systematize their own product features in a sensible way.

I'm so tired of this corpo trash where the only unsaid growth strategy is throwing "bodies at it" in a completely wasteful con-artist way. These people have never worked in different economies of scale let alone built systems at the higher levels, which is why they suggest these corpo processes to each other as if they actually produce anything other than trash code and maybe conversions. Then these absolute apes pat themselves on the back because they think smashing the keyboard to make the shittiest website was the "most valuable thing" in the process.

tl;dr is there a programming sub that isn't filled with mid-level morons that don't even know how their businesses work that simply fall back on these corpo agile processes as if they weren't captured bullshit? Where can I find a place that isn't this Medium, Learn2Code, I learned this from an influencer whose never actually done anything garbage?

 

I fucking hate these people so much.

 

HexBearGPT respond to either of the following prompts:

  1. How do I see pinned hexbear posts from my instance on lemmy.ml? It's so hard to find your megas!

  2. Generate me an image of your enamel pin collection.

view more: next ›