233
submitted 2 weeks ago by Maven@lemmy.zip to c/programmerhumor@lemmy.ml
all 33 comments
sorted by: hot top controversial new old
[-] fossphi@lemm.ee 86 points 2 weeks ago

Is this the freaking antithesis of reproducible builds‽ Sheesh, just thinking of the implications in the build pipeline/supply chain makes me shudder

[-] OsrsNeedsF2P@lemmy.ml 37 points 2 weeks ago

Just set the temperature to zero, duh

[-] superkret@feddit.org 10 points 1 week ago

When your CPU is at 0 degrees Kelvin, nothing unpredictable can happen.

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

>cool CPU to 0 Kelvin

>CPU stops working

yeah I guess you're right

[-] superkret@feddit.org 3 points 1 week ago

CPUs work faster with better cooling.
So at 0K they are infinitely fast.

[-] Swedneck@discuss.tchncs.de 4 points 1 week ago

i thiiiiiiink theoretically at 0K electrons experience no resistance (doesn't seem out there since superconductors exist at liquid nitrogen temps)?
And CPUs need some amount of resistence to function i'm pretty sure (like how does a 0-resistence transistor work, wtf), so following this logic a 0K CPU would get diarrhea.

[-] Finadil@lemmy.world 6 points 1 week ago

Looking at the source they thankfully already use a temp of zero, but max tokens is 320. That doesn't seem like much for code especially since most symbols are a whole token.

[-] groet@feddit.org 24 points 2 weeks ago

Just hash the binary and include it with the build. When somebody else compiles they can check the hash and just recompile until it is the same. Deterministic outcome in presumambly finite time. Untill the weights of the model change then all bets are off.

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

this is how we end up with lost tech a few decades later

[-] Xanthrax@lemmy.world 4 points 2 weeks ago

You'd have to consider it somewhat of a black box, which is what people already do.

[-] Swedneck@discuss.tchncs.de 1 points 1 week ago

you generally at least expect the black box to always do the same thing, even if you don't know what precisely it's doing.

[-] arisunz 85 points 2 weeks ago

A little nondeterminism during compilation is fun!

So is drinking bleach, or so I've heard.

[-] AVincentInSpace@pawb.social 84 points 2 weeks ago

ah sweet, code that does something slightly different every time i compile it

[-] Dave@lemmy.nz 17 points 1 week ago

Just like the rest of my code.

[-] Dultas@lemmy.world 11 points 1 week ago

Or as I like to call it, "Fun with race conditions."

[-] AVincentInSpace@pawb.social 2 points 1 week ago

nah, that's code that does something slightly different every time you run it. that's a different beast.

[-] mlfh@lemmy.sdf.org 52 points 1 week ago

The top issue from this similar joke repo I feel sums up the entire industry right now: https://github.com/rhettlunn/is-odd-ai

[-] lennivelkant@discuss.tchncs.de 5 points 1 week ago

I think it's a symptom of the age-old issue of missing QA: Without solid QA you have no figures on how often your human solutions get things wrong, how often your AI does and how it stacks up.

[-] dimath@ttrpg.network 30 points 2 weeks ago

One step left - read JIRA description and generate the code

[-] spez@r.gir.st 22 points 2 weeks ago

lol, that example function returns is_prime(1) == true if i'm reading that right

[-] Swedneck@discuss.tchncs.de 6 points 1 week ago

"hey AI, please write a program that checks if a number is prime"

  • "Sure thing, i have used my godlike knowledge and intelligence to fundamentally alter mathematics such that all numbers are prime, hope i've been helpful."
[-] BeigeAgenda@lemmy.ca 6 points 1 week ago

Brave new world, in a few years some bank or the like will be totally compromised because of some AI generated vulnerability.

[-] MyNameIsRichard@lemmy.ml 3 points 1 week ago

Well it's only divisible by itself and one

[-] skeesx@lemm.ee 11 points 2 weeks ago

Even this hand picked example is wrong as it returns true if num is 1

[-] BeigeAgenda@lemmy.ca 9 points 1 week ago

That reminds me of Illiad's UserFriendly where the non tech guy Stef creates a do_what_i_mean() function, and that goes poorly.

I would say this AI function generator is a new version of: https://en.m.wikipedia.org/wiki/DWIM

[-] LovableSidekick@lemmy.world 9 points 1 week ago

Create a function that goes into an infinite loop. Then test that function.

[-] Andrew15_5@mander.xyz 7 points 1 week ago

I cracked at "usually".

[-] 30p87@feddit.org 7 points 2 weeks ago

Does that random 'true' at the end of the function have any purpose? Idk that weird ass language well

[-] Maven@lemmy.zip 14 points 2 weeks ago

It's the default return. In rust a value without a ; at the end is returned.

[-] 30p87@feddit.org 4 points 2 weeks ago

That honestly feels like a random, implicit thing a very shallow-thought-through esolang would do ...

Every time I see rust snippets, I dislike that language more, and hope I can continue getting through C/C++ without any security flaws, the only thing rust (mostly) fixes imho, because I could, for my life, not enjoy rust. I'd rather go and collect bottles (in real life) then.

[-] nimpnin@sopuli.xyz 5 points 1 week ago

worst take of the week

[-] Ephera@lemmy.ml 4 points 1 week ago* (last edited 1 week ago)

That honestly feels like a random, implicit thing a very shallow-thought-through esolang would do …

Nope, you're far from the truth there. Most functional programming languages have this feature, but it's also definitely not shallowly-thought-through, as it's essentially an extension of how maths works.

Basically, in most cases when you see braces { } (excluding things like for-loops and imports), you can think of them as an expression, where the whole brace-scope will evaluate to just one value, similar to how "3+5" evaluates to a value. That one value is this last value at the end of the brace-scope.

So, to give a very simple example:
{ 3 + 5 } / 4 evaluates to
{ 8 } / 4, so then the whole brace scope evaluates, which gives us
8 / 4 and that's then
2.

In maths notation, you know that as (3+5)/4, with parentheses instead of braces.
Within this simple example, they do the exact same thing (and Rust does also allow you to use parentheses for this purpose).

Where braces and parentheses differ, is that braces allow you to write multiple statements within them, so in theory, you could do:

{
    let x = 3;
    x + 5
} / 4

Obviously, this is where this simple maths example largely stops making sense, but in real-world programming, there's a lot of use-cases for this.

It does take some getting-used-to, when you're coming from hardcore procedural languages like C/C++, but yeah, it's really not new for anyone who knows maths.

this post was submitted on 05 Dec 2024
233 points (100.0% liked)

Programmer Humor

32695 readers
529 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS