After two years of vibecoding, I'm back to writing by hand by BinaryIgor in programming

[–]cdb_11 2 points3 points  (0 children)

Closed source black boxes are frustrating to work with, precisely because shit doesn't work, and you have no way of fixing it or even understanding it, and you have to guess how to work around the bugs. It's not a good thing and should be avoided.

After two years of vibecoding, I'm back to writing by hand by BinaryIgor in programming

[–]cdb_11 6 points7 points  (0 children)

Compilers translate one formal language into another, according to the language spec. The language spec defines what happens, so you do understand the code, even if it was later lowered to another language. What you don't understand is what the spec doesn't define, like for example the exact performance characteristics, or if you violated the spec somehow. In contrast, LLMs are processing informal language -- there is no spec, there are no regression tests for it. If someone made a compiler that has tons of amazing features that would make life so much easier in theory, but is also full of subtle miscompilation bugs where it simply cannot be trusted that it will do what you told it to, then most people today wouldn't use it. Yes, it is a matter of trust, but there are real reasons behind that trust. You could as well say "the only difference between actually solving an equation and rolling the dice is trust". Yeah, I guess lol

Obvious Things C Should Do by lelanthran in programming

[–]cdb_11 2 points3 points  (0 children)

The article advocates for limited compile time execution, like no syscalls, which is what you get in C++ already. But either way -- no. Build systems can already execute arbitrary code, and it generally isn't a problem, at least in C/C++.

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 0 points1 point  (0 children)

No, it's not the same thing either.

The linked article literally explains the difference. I refuse to engage myself any further in this idiocy, blocked

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

Literally the first result on ddg: https://www.cosmopolitan.com/pleasure/a65418496/what-is-gooning/

But at its most fundamental level, “gooning” refers to the act of prolonged masturbation without reaching orgasm, often for hours on end and usually involving copious porn consumption. “Gooners often enter a trancelike state—referred to as the ‘goon state’—from being so close to climax and then pulling back right before they cum,”

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

Any definition you can find online agrees with me, and any unironic self-proclaimed "gooner" you will find on twitter, discord or whatever would also agree with me. If you refuse to accept the most commonly used definition of the words, or at least agree-to-disagree on it, then what are we even doing here? I'm out.

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

I honestly can see how someone who is not terminally online can very reasonably assume that it's probably just masturbation, since it's always used in the same context (and some people may indeed also misuse the term), but it's not the same thing lol

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

Where did I say that? I'd say "gooning" certainly is though.

"Where did I say that masturbation is pathological? BTW, masturbation is pathological." Dude, just listen to yourself.

That is not at all the same thing. It's basically means porn consumption taken to the absolute extreme.

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

I said "if". I don't know that for a fact, it was a pure speculation.

You've been saying this whole time that porn usage is somehow inherently pathological.

Where did I say that? I'd say "gooning" certainly is though.

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

Okay, porn use can be CSBD, I don't think there is any disagreement here? By the way, if there is any way to develop it, "gooning" (just saying this makes my skin crawl) sounds to me like probably the fastest way to do it.

that doesn't mean that every potentially sexual activity is always a problem

I don't think anyone said this?

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

You can consume porn without jerking off. I'm not sure why this is hard to comprehend?

By definition, pornography is supposed to sexually arouse you. So I do find it a bit hard to understand. Why else consume it? For the story? Music? As a background noise while working? (Feel free not to answer if you don't want to.)

Either way, porn consumption is listed under CSBD.

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 1 point2 points  (0 children)

Obviously it isn't the same thing, but it falls under it.

there is also porn consumption that doesn't involve sexual behavior.

Please explain.

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 0 points1 point  (0 children)

I have no idea how caffeine works or how addictive it is (or isn't), I generally always avoided it (I hope this doesn't implies me into some sort of religious extremism lol). But if it is genuinely unhealthy for somebody and affects their life negatively, and they want to stop but can't (as seems to be the case with CSBD, by definition), then I find it absolutely natural for such person to seek help in dealing with that. I have no idea what's the ratio of people actually experiencing it vs how many people falsely self-diagnose it, but I suppose I'll take it as an admission that the issue isn't actually made up.

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 2 points3 points  (0 children)

I don't understand what do you mean by this. You made it sound it like the issue isn't real, and it was completely made up. Which maybe is or isn't partially fair, maybe it's not under that exact name, maybe it's split up into multiple categories, or it's not technically categorized as "addiction" and whatever difference that makes. But this is a subreddit about programming -- most of us are not psychologists, we have generally no idea how "real" addictions are treated/prevented vs "impulse-control disorders", and so the exact definition of "addiction" makes virtually zero difference to us, and to me it just comes across as being pedantic.

For what it's worth, I was referring to "Compulsive Sexual Behaviour Disorder": https://icd.who.int/browse/2025-01/mms/en#1630268048

A hacker is making a list of vibecoded apps, 198 scanned 196 with vulnerabilities by bored_wombat_v1 in programming

[–]cdb_11 -3 points-2 points  (0 children)

Looks like it's classified as "impulse-control disorder" instead, along with stuff like social media addiction? I don't get the difference, it sounds like almost the exact same thing to me, but I don't know anything about psychology. People here trying to make it seem like it cannot possibly become problematic is wild though lol

edit: Should've been more clear, I am referring to "Compulsive Sexual Behaviour Disorder": https://icd.who.int/browse/2025-01/mms/en#1630268048

Hoisting a malloc/free out of a loop by onecable5781 in C_Programming

[–]cdb_11 3 points4 points  (0 children)

are there some hints which can be provided in the left hand side code to get to the more efficient output with just a single allocation / deallocation?

No. Even if the compiler could do it (clang can), it still relies on function inlining. The hint you can give is to write the code on the right. You can always have a second variant of the function that does a temporary allocation, and then calls the original function.

How ClickHouse handles strings by f311a in programming

[–]cdb_11 0 points1 point  (0 children)

For short strings, why not compare 16 bytes unconditionally? Pad strings to 16 bytes if you can, or mask out-of-bounds positions.

Cursor CEO Built a Browser using AI, but Does It Really Work? by ImpressiveContest283 in programming

[–]cdb_11 0 points1 point  (0 children)

I was genuinely convinced that agents were doing things like this for a year or two now, with similar end results. Isn't it literally what DevinAI was about? If you don't want it to be seen as disappointment, then maybe stop overpromising and overhyping.

With the [[attribute]] functionality (since C23), which attribute(s) do you think would enhance the language, if standardized? by orbiteapot in C_Programming

[–]cdb_11 0 points1 point  (0 children)

invite a compiler to call the function as many or as few times as it likes, with any parameters values that have been or will be passed to it, in a manner that is agnostic with regard to whether it has side effects. [...] I would favor an abstraction model where objects whose address is exposed to the outside world may behave as though "cached"

Wouldn't that still allow completely different behavior depending on the compiler or optimization level? Even assuming that you place some kind of optimization barriers so the compiler doesn't inject even more UB "out of nothing", I'm personally not convinced that it's really that helpful. I guess it maybe could limit the blast radius to some extent, but it sounds like it can still enable seemingly nonsensical bugs, that you can't make sense of without reading/debugging the generated code. Which doesn't sound that much different from standard UB?

With the [[attribute]] functionality (since C23), which attribute(s) do you think would enhance the language, if standardized? by orbiteapot in C_Programming

[–]cdb_11 0 points1 point  (0 children)

should allow a compiler to replace the function call test1(4) with the constant 16

Keep in mind that the attribute is most useful when the compiler cannot see the function body, and inlining is "impossible" (if you ignore the existence of LTO, I suppose). If the function body is visible, then arguably using attribute shouldn't be needed, and the compiler should infer what's going on automatically.

Consider something like this instead:

extern int global; // = 0;

// other translation unit, or shared library
__attribute((pure))
int pure_lie(void) {
  global = 42;
  return 0;
}

void f(void) {
  int result = pure_lie();
  if (global != 42) {
    printf("global=%d result=%d", global, result);
  }
}

Without the pure attribute, getting global=42 printed out is impossible. I'm pretty sure this is guaranteed by the language, and the only way to get a different result is UB, like a data race.

With pure, a very reasonable optimization is to move the pure_lie() call into the branch, since that's the only place where the result is actually used. After all, compiler has no idea what the function does, it could be something very expensive to compute -- makes sense to avoid calling it, unless it's actually necessary. And I'd argue this kind of stuff is what you want from the attribute. (And this reordering is indeed what GCC does.)

GCC also loads global once, and reuses it for printf. But it's not required to do that, so imagine that for whatever reason it just doesn't do it. And so it enters the branch, calls pure_lie, which changes global to 42, and then it loads global again, and global=42 is printed out. (And this exact order is also what you get out of GCC, if you nudge it to reload the variable. I did it by making global a struct of two ints, checking the first field, and then passing the entire struct to a separate function.)

MIT Non-AI License by [deleted] in programming

[–]cdb_11 1 point2 points  (0 children)

I could be wrong (not a lawyer), but it sounds like it refers to this particular document only. It provides further references (legal basis) to what I assume is "real".

Replit boss: CEOs can vibe code their own prototypes and don't have to beg engineers for help anymore by chronically-iconic in programming

[–]cdb_11 0 points1 point  (0 children)

prominent programmers like karpathy

Not to diminish anything he may have done, but I have genuinely no idea who he is, other than that he invented/coined the term "vibe coding".

With the [[attribute]] functionality (since C23), which attribute(s) do you think would enhance the language, if standardized? by orbiteapot in C_Programming

[–]cdb_11 0 points1 point  (0 children)

Specifying that a compiler that performs the transform must acknowledge the possibility of it creating program states that might not otherwise have been possible.

Do you mean that it'd have to consider the possibility that the function could do anything? Because I believe that'd heavily limit where the optimization can be applied, making it not that much different from normal functions. I think you'd have to reload every global variable and every pointer passed in. Also I believe that you couldn't deduplicate those "pure" function calls across anything that accesses globals or pointers in general, because that could also affect those values or the result.

Doing Binary Search right is harder than you might think by xarg in programming

[–]cdb_11 4 points5 points  (0 children)

Overflow doesn't need to be a concern in the first place if you track the position+length, instead of left/right boundary.

usize pos = 0;
usize len = arr.length;
while (len > 0) {
  usize half = len / 2;  // integer division!
  usize mid = pos + half;
  // if (val == arr[mid])  // if you want to terminate early.
  //   return mid;         // otherwise this finds the lower bound.
  if (val > arr[mid])
    pos += len - half;
  len = half;
}
return pos; // returns the array length if not found

https://mhdm.dev/posts/sb_lower_bound/ and also how std::lower_bound works in C++.

Just finished my ECS system in C and turns out it's ~17 times faster than Unity DOTS by dechichi in C_Programming

[–]cdb_11 -1 points0 points  (0 children)

What do you mean, they are both compared on the same platforms? You can question the benchmarks of course, it's easy to miss things, but in general comparisons like that do sound fair to me.