@nanko I realized this one time during a long car ride on some narrow highways and hilly areas, it was terrifying. I also mentally lowered the distance to consider from half a meter of actual distance to few centimetres/degrees of the wheel turning. Never liked cars, but that was the first time I actually got kind of spooked.
@fikran Just return a struct. C++ has meta structs called tuples that are more flexible, and type deduction and structured binding for convenience.
toy prog challenge solution
@digital_carver wow, you went straight for the challenging ones, I'm yet to get through those myself. Glad you liked it. I spent disproportionate amount of time on some of the earlier ones.
re: true co-routines in C
@amiloradovsky@functional.cafe what I'm trying to say is that semantics don't change as far as c/c++ are concerned. Running out of stack space is like running out of ram/rom for your code or data segment, and again optimizations are everything when you have to deal with these kind of low level details. People do write c/c++ code with specific platforms and specific optimizations in mind, not for portability, but for readability. They may ban some compiler flags and require others, and the language standards are intentionally vague in places to allow for such things.
I'm trying to answer your question "how do you jump into a procedure without storing return address in stack", and I guess my answer is "the language allows this in a natural way, so it is in the realm of compilers to support this kind of use case well (unless you want to jump across ABI in this fashion)".
re: true co-routines in C
@amiloradovsky@functional.cafe with -O2 it produces calls for me and crashes, with -O3 - jumps and doesn't crash. If you don't like optimizations, you can probably find the specific flags that do this, and dependent on your platform it can be pretty reliable. In generic high level code you shouldn't rely on this, yes, but there you shouldn't be thinking about the stack and specific assembly instructions either. Point is "there is no stack", and the compiler knows this.
true co-routines in C
@amiloradovsky@functional.cafe as far as a know there is no stack in C/C++, the compiler can and will optimize your call graph.
Here is an example:
http://ix.io/2GE1/cpp
Compiling this in separate translation untis with optimizations and disassembling with objump, I see a call to two from main, then jumps from two to one and back, until in one of them the condition trips and it returns to main. The optimizations should work with c++ style callbacks as well, as long as they are known at compile time. For c style entirely runtime callbacks, you'll need new syntax, but then again you shouldn't be using those unless you are defining an ABI, which would be one insane leaky intrusive ABI, making such leaps of faith.
What people usually call coroutines, I would explains as state machines disguised as function, and in context of this kind of micro-optimizations I think they would be much more complex beasts, subject to many different types of optimizations. C++20 has them, for what it's worth.
foss rant
@LoliKing @rok0 copy to clipboard paste in gimp? My screenshot ui has "open in ..." dropdown and it defaults to gimp. If gimp is too intimidating, it's highly configurable open source software and the truth is that you just need to hire a nerd to configure it for your needs. A freelancer would probably do it for like 50-100$. If that becomes the norm, you'll probably have even more affordable local service that would also give you warranty, that for certain period of time the config will work on most major distros and gimp versions for example. It's an uphill battle, but if you realize that the alternative pretty much is "I let an armed terrorist live in my house, cause they do the groceries(or fix the plumbing or clean the toilet, or both)" it's not that hard of a pill to swallow. I suspect it's not even a money issue, it's more that we and the gimp nerds that are supposed to provide us a service just don't want to deal with people (each other) on that level.
@urusan stop selling their snake oil, those things you call pros are not in any way pros. It's like if someone came into your home, pointed a gun at you and went "you don't get to pee, unless I tell you", and then someone else does the same and goes "you can go pee whenever you want" and you go "wow, that's a pro!"
@freemo The stupid notation one has to spend more time on explaining that the actual problem. Knuth had a rising and falling factorial notation, cause you know those brainlet programmers actually care about performing computation.
99 * 98 * 97 * 96 * 95 * 94, we call 99!6 (not the actual notation), meaning count down from 99 6 times and multiply those numbers (directly ties into the combinatorial rationale). The 99 choose 6 becomes (99!6)/(6!6).
There original problem becomes:
(99!6)/(6!6) * (99!1)(1!1)
x!1 is clearly just x, so we arrive already to second to last step of your original derivations
(99!6)/(6!6) * 99
@dankmaximus even if it's not worth for you to sue someone who, say, punched you in the face, you don't write on your forehead "feel free to puch". Now you live in a world where equivalent of punching you in the face is the norm, and GPL simply says, "punching people in the face is not allowed around here, and if I can afford it I will drag you through courts over it".
@dankmaximus Well, unfortunately that is how civilized people go about enforcing anything on anyone, they don't corner you in a dark alley with a knife, or hax your computer, or implement DRM, or normalize exploitation. Most of the time however the threat of it is enough to stop the offender, if they have something to loose.
@dankmaximus so you are just saying that you can't enforce the terms without going to court?
@ravenclaw
@dankmaximus oh no, shame x_x
I still blame you for using a word that is not a word even :V
unforcable? bah!
@ravenclaw
What are you even on about? What does the virality of the license have to do with forking? Show me a GPL project I'll fork it right before your eyes. Good luck doing that with proprietary software. All you are saying is that you love proprietary software and want to take open source projects and make them proprietary, except you can't say it directly so you are BSing.
Saying I'm a web-dev I don't care about the OS, is like saying I'm an interior decorator I don't care about plumbing. Well if you don't care, then why are you even talking about it? A good plumber will never tell you to choose your own pipes, they know you rely on them to help with this choice and they can accept that responsibility, cause they are not total pussies like every software developer ever. They will simply not let you use something that will rot in a couple of years, or something that will be impossible to replace or repair. They are independent and they serve the general public, not international monopolies.
@2ck The link seems to be talking about genes of specific organs, like growing a kidney in a dish, which has little to do with that you are referring to, which would be I guess modification of a genome of a zygote. Changing the genome of a zygote makes very little sense, especially en masse.
I only read the beginning and the end, but here is what I got out if it:
"
We just wanna make human replacement parts...
... if you wanna change heritable traits, GTFO, especially you - germline MOFOs!
"
There can be many reasons to use ubuntu and it's derivatives, but devolving to "I would rather use macOS" when questioned is kind of telling. Especially unfortunate when coming from a software developer, who is supposed to help general public to make choices that are beneficial to them, not help them choose the right megacorp to own them.
Now enlighten me please, how exactly is GPL unforkable?
how wonderful, another use case wayland broke
https://github.com/debauchee/barrier/issues/109
The video just describes a particular implementation, standard is still the same standard, that you can get for free in the draft form, or have to buy in a final form for some reason. This function if from C++20 standard, but you don't really need the document, it's a very simple function to describe, it just takes any two arithmetic types and returns their midpoint/average, more precisely what mathematical formulas a+(b-a)/2 or (a+b)/2 would give you. It's not easy to implement though, that's why they added it to the standard.