« first day (1543 days earlier)      last day (3398 days later) » 

1:00 AM
Well, yes, looked at it.
 
@milleniumbug I think that was the one single gif that was (sometimes) accepted to be just shown... :P
 
I have to say that the 'Unconference poll' seems overly 'kraut-Berlin' oriented. I wanna go somewhere else that is NOT anywhere in UK or Berlin again. I would perfer Antarctica to UK. I would prefer West Ham to UK.
 
@MartinJames There's this "Other" field, y'know.
 
@Griwes I wanna get drunk on Polish Vodka.
 
@HansKlünder, so, what does that code do?
 
1:01 AM
@R.MartinhoFernandes here is an example where code jumps out of nested loops:
 
@MartinJames Then select the "Stinky Poland place" one.
 
@HansKlünder No, I didn't claim that. I claimed that there's no reason for my version to generate an executable any different.
 
..or that plum brandy stuff in Czech.
 
Now, what would be your version of that code, being compiled to something not bigger or slower than mine?
 
I would be more than happy to just hop on a city bus to get to the unconference... ;d
 
1:03 AM
Griwes, that code searches for some magic words. If it finds one kind of wordm it's done. If it finds another one, it can skip a big section.
 
@Griwes I don't mid getting on a plane, as long as it doesn't goto Stansted, Heathrow or Gatwick.
 
Griwes, that is an example for code in which goto is useful.
 
@HansKlünder I fail to see a use case.
I understand the code.
I can read it, you know.
 
OK, it's time for a 'Fuck goto'.
 
1:04 AM
@HansKlünder You could write it in a few lines with standard library functions instead.
 
I fail to see an application of that.
 
R.M., which library functino would you use that do not require any executablke code of the library, and do not increas the size of the executable?
 
@HansKlünder You're still missing the point.
 
I used similar code in an evironment where I had a C++ compiler, no library and very very little flash memory.
 
Your version is 9 instructions shorter than Robot's at -Os.
 
1:07 AM
Also, a large part of the standard library functions in C++ do not come with "executable code".
 
So... vOv
 
They come as templates that get inlined.
 
R.M., I an very patient to explain my point, and I would appreciate if you, instead of repeating that I "miss the point", just write down what that point should be.
Thats fine, so, which templates would you suggest, R. M. ?
 
@HansKlünder The point was spelled out a long time ago.
 
37 mins ago, by R. Martinho Fernandes
@HansKlünder It's an equivalent program. Why should the compiler output be forcibly different?
 
1:08 AM
But you did no show me the equivalent program.
 
Ell
Just give up please man its boring reading
 
@HansKlünder Yes, I did. Unless you want to claim that there's a bug in my version.
If there is a bug, it was accidental. Please mention it and I'll fix it.
 
A - sorry, I did not see the llink.
I am reading.
 
If there is no bug, it's an equivalent program, so there's no reason that forces a compiler to produce different output.
 
1:10 AM
Apparently, your code has one more conditional jump.
 
Also... 9 instructions longer only in case of writing it as @R.MartinhoFernandes did.
 
@HansKlünder Is that a bug?
@Griwes And compiling it with that compiler.
 
@HansKlünder Compare: goo.gl/9WwTDm vs goo.gl/iJ4Bub
So... you are not making a compelling case.
 
Griwes, I am happy to see the compiler found out how to optimize that.
 
No, I did.
...by moving the function into a lambda :P
Anyway. Both implementations are equivalent. You just need to help a little (by making the helper not really callable from anywhere else) the compiler to get it right vOv
Case closed, goto is useless.
@R.MartinhoFernandes :D
 
1:13 AM
However, I had the situation that my compiler neither accepted C++11 nor optimized that well.
 
You used a bad compiler.
Case closed.
Using proper tools helps avoid problems, you know.
 
Griwes, I perfectly understand that by "case closed" you express that you have no further arguments in that.
However, I have.
 
@R.MartinhoFernandes I think this one wins: files.explosm.net/rcg/JoyousExchangePaper.png
 
I was bound to a particular compiler that supported that hardware.
 
@HansKlünder By that I mean we basically decimated all your arguments that seemed to make sense.
 
1:14 AM
@HansKlünder The arguments don't apply to the case you brought. Move the goal posts all you want
 
I doubt you can find anything else.
 
oh, you didn't-
 
I did.
 
@HansKlünder In that case, your life sucks and yes you'll have to hand optimize. It's like that
 
I can't alwasy choose a recent gcc.
 
1:15 AM
You've seen the assembly. The exact same thing.
 
No, my live does not suck.
 
Then choose a recent clang.
 
I can't run clang there, either.
 
@HansKlünder Because you love hand optimizing. However, the fact that you love doing that doesn't make "goto" the only/best tool
 
sehe, I see several wrong assumotions in your single line.
 
1:16 AM
 
@Griwes I see that, and I raise you this files.explosm.net/rcg/JumpyRelationSea.png
 
I think they might've caused their own doom. :D
 
1. I don't do hand optimizing because I love it, but because the in that projects some components were supported by poor compilers only.
 
@R.MartinhoFernandes :D
@HansKlünder Stop working on these projects, problem solved.
 
1:17 AM
2. I never claimed goto ist "the only/best tool".
 
I claim that in some situations it's part of the best solution.
 
@HansKlünder Then why doesn't your life suck.
 
ouch
@HansKlünder No, it's a horrible "solution".
 
sehe, I can perfecty work with limited resources.
 
1:18 AM
goto only makes sense where you don't have proper control flow mechanisms. Like when hand-crafting assembly code.
 
@Griwes again definitions :) Some definitions of "best" include that
 
@sehe nah
 
@HansKlünder We too. The point was about whether that precludes high level programming
 
Griwes, it made sense in some code that looked similar to the simplified version I showed you.
 
The generated strips are beautiful <3
@HansKlünder seriously, start at least using the damned @. At the very least.
 
1:20 AM
@HansKlünder By now you should probably recognize that "Then choose a recent clang." is a troll. Someone handsome refutes the various, repeated, fuzzy claims that the compiler will emit more bytes, with evidence. You should probably admit a point at that time
@HansKlünder Bless you. Go in peace and sin no more
@Griwes By now you should probably realize that you're tired of him it and leave him be?
 
@sehe the claims are not fuzzy.
 
@sehe I wanted to both follow what he says and keep clicking "generate new comic", but that's hard when you don't get pings.
 
@sehe I worked with that compiler, I had, for that part of hardware, no other compiler, nobody would pay me for finding or writing a better compiler, but I got paid well for making some software fit into the very narrow flash memory.
@sehe that is not fuzzy.
@sehe and I measured the differences. I checked what the compiler would optimize and what not.
 
@HansKlünder We didn't get quite so much evidence in hand. The robot had to come up with the alternative version, and you never even once showed a disassembly
 
@HansKlünder Cool story. We believe you. Did I say "go in peace"
 
@sehe I cannot show you a disassembly because 1. the software I wrote is private property of my client, so I would violate my contract, and 2. The project was 3 years ago, and I have no access to the source nor to the compiler now.
 
> Cool story
 
@HansKlünder So it's all irrelevant for 3 years now?
 
@sehe, it's an example of a useful goto.
@sehe I did not ue goto during the last 3 years.
 
1:25 AM
You mean that your example of "useful" goto is 3 years and counting old?
 
No. It was an example of useful hand optimization.
 
user3010322
Those are some.. weird generated comics.
 
@Griwes the last time I used that is about 3 years ago. Maybe 2. Anyway, I don't have the exact sources.
 
@ThePhD You know what's the best thing about them?
 
Ell
Guys
5
Do you wash mushrooms?
 
user3010322
1:26 AM
That they're generated?
 
In many cases they could pass as real C&H comics.
 
@sehe that hand optimization used goto because that compiled into the shortest executable.
 
At one point this was about "can't run Haskell". You see what a C++ compiler can do. C++ is crippled with mutability and C heritage. Haskell does a far better job. FAR better job.
 
@sehe for me, goto was useful because it saved me a few bytes.
 
files.explosm.net/rcg/PerfectTigerBrass.png ahahahahhahahahahaha @R.MartinhoFernandes
 
1:27 AM
@HansKlünder yeah, and handoptimized assembly would likely have gotten you much farther. It was a crutch then :)
 
user3010322
I think I found a bug in GCC 4.9...
 
@sehe in fact, I optimized some of the assembler code as well.
 
@ThePhD 4.9.x is an exceptionally buggy release branch.
 
user3010322
Maybe I should backtrack to 4.8
 
@HansKlünder Assembler is the program that assembles.
 
1:28 AM
@HansKlünder I'm absolutely amazed. Of course. I'll let you in on a secret. I use goto too for pragmatic reasons. But it's a sign of sloppiness and frequently robs the compiler of the chance it had to generate optimal code for you
 
You mean "assembly".
 
@sehe and then I could use C-- happily for the rest of the project. I would have loved to use C++, but there were some restrictions.
 
@Griwes ... not letting anything go now are you :|
 
@sehe sorry - yes, probably assembly code is what I mean - the input for the assembler.
 
Ell
@Griwes 4.9 is a release branch?
I though evens were releases
 
user3010322
1:30 AM
Argh.
 
@sehe Hey. That was friendly-ish.
 
user3010322
This is bothering me too much
 
@Griwes yes, assembly code.
 
@Ell GCC is still at a sane versioning scheme. Insanity only begins with GCC 5.
 
user3010322
template <typename T, typename R, typename... Argn, R (T::* func)( Argn... )>
 
user3010322
1:31 AM
When I chop off the member function bit and move it inside of a struct's function call, and leave the rest of the template on a struct itself, it works.
 
@Griwes the point is that in that project, by using goto I could save some bytes. Thus goto was useful there.
 
user3010322
I swear that's legal C++, though!
 
user3010322
Grrr. maybe clang can tell me...
 
@ThePhD You have a template argument after a pack.
Is this the primary template?
 
user3010322
... Prrriiimaarry?
 
1:32 AM
Gah. Too long away from ##C++. Where's your testcase?!
 
user3010322
Making one now.
 
That's never gonna work if it's not a specialisation.
 
@BartekBanachewicz I still don't see that goto is useless in really all cases.
 
Bytes? I'm happy if I can save MB. Luckily, saving instruction bytes is a pointless 'optimization' for me.
All my apps can run fast enough in debug mode.
 
1:37 AM
@MartinJames But can they really?
:D
 
@Griwes lol - my apps are glue that hold system calls together.
 
user3010322
Blargha.
 
user3010322
C++ is gonna run me into the dirt.
 
user3010322
I should write more C#.
 
lol
Just give us the testcase :P
 
1:38 AM
@sehe I appreciate your interest in my personal live and into the question whether it sucks or not. I was merely rejecting a statement about software which I considered not completely correct. I appreciate your care for my personal live and assure you that occasional use of goto does not cause pain to me, though maybe some people are allergic.
 
user3010322
So what'd be the regular way to capture something like a signature like that?
 
user3010322
Use the Return( Args...) syntax and then partial-specialize ?
 
@ThePhD cv qualified member functions? just a stab. Would need to see more
 
@HansKlünder I can neither defend nor prosecute your case, since I haven't used an explicit 'goto' in a high-level language for 35 years, and so I have no experience.
 
1:41 AM
@HansKlünder Figurative speech exists :) Geez. I'm not attacking you. I'm merely concluding the "oh wells" in a dry fashion.
 
user3010322
It happens whether it's cv or not I checked both ways. The problem definitely seems like the parameter pack.
 
user3010322
(And having an argument after the parapmeter pack that's not deduced).
 
@ThePhD no, obviously not
 
I need sleep. My starvation is over.
 
@ThePhD you usually don't
 
user3010322
1:42 AM
Starvation?
 
@ThePhD Just like with normal variadic functions, the known parameters always need to come first, and the variable parameters last.
 
@sehe ok, that's fine. I tend to read things literal.
 
Me too. Trust me.
 
@ThePhD There was a mealtime cockup. Anne was late back, it was too late to cook for us both and I had to eat my keyboard. Now, I've had curry:)
 
@MartinJames that's fine. There are about 7 billion people on the world who do not support me when I claim that in this world there is at least 1 case in which goto turned out useful.
 
1:43 AM
It's inch by inch that I learn the secondary idioms, memes, gags etc. I'm probably too often in this room to realize the influence
@HansKlünder Gosh. You should really get that treated. Making up numbers from thin air is almost as senseless as stating dry-cynical qualifications about another person's quality of life.
 
@sehe 7 billion is just the amount of people in the world, minus those 3 that support me.
 
Ell
@MartinJames what curry?
 
@HansKlünder This somehow made those numbers plausible :)
 
@Ell Chicken jalfrezi, extra chicken shreds, extra birds-eye clillies, lime pickle and mango chutney.
 
Ell
Sounds yum
Apart from the lime pickle
 
1:47 AM
@Ell It was. No more stomach-grumbles :)
 
Ell
Don't know how people can stand lime pickle :P
 
@Ell I find the lime pickle offsets the sweetness of the mango.
 
Good morning.
Warning: Ctrl zooms out the image.
 
Ell
Morning
 
That andromeda galaxy looks quite cluttered with stars.
 
1:55 AM
It's bigger than the Milky Way.
 
@MarkGarcia WTF is that? Some assembled view of milky-way?
 
They should photograph it with lower ISO setting.
 
We need less ISO and more implementation!
:P
 
Oh - different galaxy. OK, still impressive.
 
1:56 AM
Maybe it just has too many stars, that therefor it looks like too much ISO.
 
@MarkGarcia Needs better zoom. :D
 
Ell
Man I'm craving cheese agai
 
@HansKlünder Ssssshhh... you spoiled it
 
Ell
I dread to think how much weight I've gained over christmas
 
user3010322
Did that template <auto X> proposal ever gain any ground anywhere?
 
user3010322
1:56 AM
Because if I had that I could take this and just... throw it out.
 
@Ell lol - revenge is sweet.
 
Why are "Guys" starred?
 
@Ell Our dog has gained 1kg. I dare not get on scales.
 
Ell
Haha
Lukcily for me I don't even own a pair
 
@Griwes Yeah. Hubble can't even match my 600x ultra refracting-reflector-zoomba telescope I bought from the kiddie store!
 
1:59 AM
@Griwes @HansKlünder So, in the interest of science. I've rewritten a nested loop with early exit from the inner loop, into a purely recursive solution using a 4 levels of function calls. There's not a loop, nor an exit. Just boolean functions. Let's compare the compiler outputs!
> loopy version goo.gl/GnkLga
> "verbose" version with everything the ~~purformance~~ crowd forbade: goo.gl/ZPDlEx
 
@milleniumbug They can't find a beautiful enough female to put in the cast. ;)
 
I'll give you a few seconds to look at it. /cc @R.MartinhoFernandes (actually, quite impressed with clang here)
 
:)
 
@Ell Shortly, we will have to drag 41kg of canine off the edge of the bed so we can get in:(
 
I'm impressed it got the same code for both -O3 and -Os :P
 
Ell
2:01 AM
41kg? That sounds big but I don't know dogs
 
@Griwes This is pretty impresive, if you ask me. I forgot that I tweaked that option halfway. It's immaterial though :)
 
oh, this is funny
-3
Q: Pointer to array of pointers, pointing to arrays (C++)

EverknowProblem I have is creating a specific matrix. I have to use a pointer **ptr, pointing to an array with x pointers. Each pointer in this array should point to a new array (in this case, an int-array; each array is a new line in the matrix then). All x+1 arrays should be created with new; in the en...

 
@Ell For the breed, he's about 7kg too massive.
 
@sehe I like how few lines of C++ are highlighted there.
 
I think the code is clearly optimal (lest one require the compiler to inline the printfs and use a single buffer or something)
 
2:02 AM
It looks like th guy who asks the question is identical to the one who answers it.
And then approves it to be the solution.
 
@HansKlünder Oh.. another rigged sockpuppet question?
 
@Griwes It's all inlined. I'm trully impressed. I know this /must/ be happening all the freaking time because a things like Boost Graph, Boost Spirit, Boost PropertyMap would all be absolutely ridiculous if compilers didn't get this right.
 
Yeah.
The power of inlining the code the compiler can see (and somehow has to generate) is huge.
 
Yes, but the puppet who is supposed to answer the question writes a comment in the role of the one who posed the question.
 
Still pretty confrontational to see it happening in your browser, so to speak
I reckon @Hans has us plonked by now.
 
2:03 AM
@MartinJames Yes, but he confuses the roles of his puppets.
 
'During Winter Bash 2014, I spent a lot of time thinking about hats.' - how sad is that?
 
@TemplateRex Thank you for suggesting this book. I'm only a few chapters in but so far it's really interesting!
 
Ell
I think I'm going to pop into here on Wednesday too...thecheeseworks.co.uk/index
 
@sehe I am sorry, I did not itend to plonk anybody.
 
FWIW, thanks @Hans for making me do this little experiment here. I love the results, and it taught me a thing or two.
 
2:05 AM
I'm totally plonked. We're going to bed.
 
@MartinJames Good night. Be nice to Anne.
 
@MartinJames be careful if you want to go to bed. Some people here think goto is bad in general which includes considering go to bed bad
 
Ell
@MartinJames night martin :)
 
@MartinJames Good night.
 
@sehe you're welcome, though I have to confess I had no idea I helped you. But I am glad I could help anyway.
 
2:08 AM
@HansKlünder Did you see this comparison I just posted a page up? chat.stackoverflow.com/transcript/message/20797504#20797504
#cpp optimizing: Debate prompts cmp. of nested loops w/early exit vs. recursive functions: http://goo.gl/GnkLga vs. http://goo.gl/ZPDlEx
^ this one, for that matter
 
I have to apoligize, I think I misunderstood one of the posters whom I considered puppets.
@sehe ah, I see.
 
No problem - I'm not the downvotey type.
 
53
Q: Dealing with contributing but abusive users

Benjamin Gruenbaumtl;dr How can I as a user deal with content of users who are helpful in general but leave abusive comments and/or answers? Is there anything I can do to help mitigate the problem when I run into such an answer? An anecdote So, today in chat I ran into an answer that starts with: Though ...

^^ Didn't take too long to figure out where this came from.
 
@sehe ah, I see - yes, I was impressed by how the optimizer works.
 
@HansKlünder It's awesome. I mean, to see it actually happen. Me too, I don't look at generated code :( Like I said, I trust the compiler everyday, but it's nice to see it in action
11 mins ago, by sehe
@Griwes It's all inlined. I'm trully impressed. I know this /must/ be happening all the freaking time because a things like Boost Graph, Boost Spirit, Boost PropertyMap would all be absolutely ridiculous if compilers didn't get this right.
With dem feels, I'm headed to my bed (using _longjmp)
 
2:15 AM
@sehe just, at that time I was a bit confused because for me it looked like on every statement I wrote, 4 different people replied and expected me to reply. I am too slow for that. But I saw the great optimization.
 
Cheers! And good night
 
@sehe, thar's true - using longjmp can save lots of goto
 
I've never really known why goto is bad, I just never used it due to it's negative connotations.
 
Well - goto isn't bad. Just, in the very most cases there are better ways to to the same.
 
@Nooble By the time you come up with names for the labels, your competitor will have a working product.
 
2:23 AM
actually, that's not true.
@milleniumbug I don't think that is true in general.
 
@HansKlünder Thanks to the power of scoping and other high-level constructs. (if that's the case, your goto usage is much smaller anyway)
 
@milleniumbug my goto usage is pretty small. In average, it's about once a year.
@milleniumbug however, in the few cases in which I considered goto useful enough to use it, I had the impression that it speeds up my work, compared to the alternatives.
 
@Nooble Also, put it in the context - old languages used to have no loops, and very primitive if statement - FORTRAN had the so called "arithmetic if" instruction - jump to that label if the value is negative, jump to the other if it's zero, and jump to yet another label if the value is positive.
There, gotos were used for pretty much everything.
 
So how are they a bad thing?
 
They are bad now that we have proper constructs for flow control.
They are too low level.
 
2:33 AM
@Nooble One reason I mentioned already, there are many others, hang on...
 
@Griwes Inferior, basically?
 
Also (why did no-one invoke this before?):
@Nooble Do you prefer templates or void *?
Think of goto as something similar to void * for "generic" functions.
 
@Nooble (take a good look at the name of the label in the xkcd comic - do you know what happens if you jump there?)
 
@Griwes They were bad all along. At one time, they were bad but unavoidable. Now they're bad and easy to avoid.
 
@Griwes for most other usages of flow controls, it would be a bad idea to replace them by goto
 
2:35 AM
There might be some obscure cases where one of those makes sense, but in general you want to avoid them, as both void * and goto are way too low level to do anything sane with them.
 
@Griwes for many cases in which goto is actually being used, it would be a good idea to restructure the code instead
@Griwes for some cases in which goto is being used, it would be a bad idea not to use goto.
 
I know pretty much no cases where goto is actually being used, short of silly jumping out of loops that are plainly wrong (read: nested), or C, which doesn't have proper ways of dealing with error handling and stuff.
 
Ell
Cleanup in c is reasonable use for goto
 
@Griwes, I know cases in which goto is useful, and I know cases, e.g. for hardware drives in embedded software, where void* is an excellent tool to get access to a particular hardcoded address.
 
@Ell Sometimes--but honestly, not very often. Of course, the issue doesn't arise at all in decently written C++ (where such cleanup obviously belongs in dtors).
 
2:39 AM
Err. void * gives you no access to anything.
You can't dereference void *.
 
@JerryCoffin that's what I think, too: sometimes. In some environments: Never.
 
@Nooble Have you read any medium-size BASIC code?
 
@Griwes Unless the compiler's broken (which some are, basically treating void * like char *).
 
@milleniumbug I've seen some yes.
 
Ell
I used void* recently
 
2:40 AM
@JerryCoffin I am consistent in disregarding broken compilers in this entire discussion.
@Ell Naughty you.
 
Ell
I can't remember finding a different way of doing what I was doing
 
It uses a lot of GOTO.
 
Ell
So I settled with it
 
@Griwes but if the hardware manufacturer gives you an incude file describing all the interesting registers by void*, that's pretty useful and you can cast it into your favourite structure.
 
@Nooble Well what was experience in figuring out what it does? Mine was abysmal.
 
Ell
2:41 AM
I could have used boost::any I suppose but I'd have gained nothing
 
@HansKlünder void * for registers? Gross.
It should be proper types...
 
@milleniumbug Barely understandable, jumped about all over the place. I think I get it now.
 
Ones that give you both the address and the size of a given register.
 
@Griwes Yes. Not for registers lile eax in the intel CPUs.
 
So no, void * for hardware registers is extremely unhelpful.
 
2:42 AM
@Griwes I wish I could do the same--unfortunately, every compiler of which I'm aware is broken in at least some respect, so my choices are to write only imaginary code, or deal with broken compilers.
 
@HansKlünder Please don't lecture me on MMIO.
And stop assuming you know something we don't.
 
@Grives but for registers like: The uart buffer starts at (void*)0x00400000
 
@HansKlünder What kind of data it contains? The void * there is not helpful.
It fights with me.
It's bytes? Then it should be uint8_t *. It's 32-bit signed integers? int32_t *. void * is probably the least helpful type ever.
 
@Griwes I neither assume you know nor you don't know. I consider it polite to, in doubt, write down what I mean.
 
Oh wait. There's also void. So second least helpful. :D
 
2:44 AM
You know I just realised there is one type of lovers who would never have hot bodies - the physically healthy type of food lovers ...
 
@JerryCoffin Feels great when the compiler is updated and then the imaginary code turns out to work!
 
@chmod711telkitty I don't know what you just said.
 
@Griwes yes, sure. It would have been polite to pass the description of registers with proper structures matching their content. If that does not happen and a hardware manufacturer gives me void* pointers, I use them and cast them into my own structure pointers.
 
I can parse it, but my semantic analyzer keeps segfaulting.
 
@LucDanton I've done some of that too--and I agree that it feels good. Hard to sell to my boss as a way to develop products on a schedule though.
 
2:46 AM
@HansKlünder Sure. So do I. But that doesn't justify calling such void * pointers "helpful" or "useful".
 
@Griwes healthy people who love food are generally fat & not 'hot' according to the currently beauty standard
 
@Griwes for me it does when they are the best description I have. Even if my only use it to cast them to something else.
 
Ell
Void* are useful for type erasure
 
@HansKlünder "There is no description that's more helpful than A" != "A is helpful".
 
Ell
On occasion :P
 
2:48 AM
Please stop trying to make this != look like a ==.
@Ell Yeah, right.
Maybe in C :P
 
Yet again a specific set of circumstances that means language feature X pops up, and which is somehow ground to comment on the language feature on its own and not the circumstances. Context is important.
 
@chmod711telkitty Mmkay. Now I have problems with placing that in any context of current discussions :P
 
Ell
Im going to try and summarize why I needed void star
 
0
Q: How do I find the "surface normal" of a tetrahedron in 4 dimensions?

appa132I am currently making a 4D game engine. It shows specific 3 dimensional cross-sections of the tetrahedrons that have been programmed in (in a 3 dimensional cross-section, each tetrahedron is seen as a triangle). I am trying to implement a form of back-face culling. Wikipedia shows 2 ways of doing...

 
I’ve used volatile to badger GCC in producing an executable that’s easier to inspect in the debugger, but the first thing that comes to mind if someone asks me about volatile is 'don’t bother'.
 
2:49 AM
> I am currently making a 4D game engine
 
@LucDanton "Don't bother unless you do MMIO" :P
 
@MohammadAliBaydoun I bet it really touches it's users.
 
@Griwes Yes, in C there are cases where it's useful, especially to create an opaque type. For example, it would be fairly reasonable for C's FILE to be #define for void, so fopen returns a void *, which you can't manipulate in any way except to pass back to other functions that expect a FILE *. Only problem is that it's not a unique type, so it's (all too) easy to accidentally mix up two things that are intended to be different opaque types.
 
There’s also volatile sig_atomic_t and I’m still sticking to 'don’t bother'.
 
@Ell I have some void *s in my kernel code, but pretty much only for placement new (I need to replace those with a proper, virtual_addr_t, type) and for printing stuff in hex.
 
2:52 AM
@Griwes Thes void pointers were helpful to me. So, void* was helpful. I could have thought about better ways wich were more helpful, but these where helpful a bit.
 
Ell
I used it to pass arguments to a stored function
 
...although I must admit that most of type erased data passing I do is via a uint64_t, eh. But that's because the interface is meant for "data", not "pointers".
 
Ell
Where the stored functions have different signatures
 
@Griwes That sounds awful-ish!
 
@HansKlünder That logic is so broken I don't even know where to start :/
@LucDanton Yeah, it does. I'll have to do several iterations of refactoring to get it righter-ish.
@HansKlünder void * wasn't helpful. Some addresses, stored in variables of type void *, were.
void * was the unhelpful part there.
 
2:54 AM
@Ell Type-erasure is indeed the #1 time I mess around with void cv*.
 
@Griwes void* was not unhelpful, just less helpful than other types might have been.
 
@LucDanton I am sure I can get this right at one point, but first I'll have to pretty much do a complete overhaul in some places, so that's gonna take some time.
@HansKlünder void *, as a type, gave you nothing. That's the definition of being unhelpful.
4am. Continue with this silly refactoring I've been doing or not, that is the question...
Tomorrow's a holiday, so I might as well do that for another hour or so...
 
@Griwes I have made use of void* in some situations. For example, in support for logging methods where I had to classify the arguments and and store a summary during compile time.
 
Did I say that void * has 0 uses?
(Tip: I didn't.)
I just said it's a low level tool. It has uses, but the legitimate ones are rare. Just like any possible legitimate uses of goto, but void * seems to be legitimate way more frequently.
 
Ell
Night folks
 

« first day (1543 days earlier)      last day (3398 days later) »