« first day (1616 days earlier)      last day (3331 days later) » 

user3010322
9:02 PM
@melak47 Have you ever given thought about how to choose OpenGL / D3D at runtime in your implementation? I'm having a hard time myself on how to do it.
 
user3010322
/cc @LightnessRacesinOrbit (since you worked on this specific problem too, I think)
 
user3010322
So far the only thing I can think of is virtual functions on a private implementation.
 
and you wanna avoid virtual calls in your renderer
I think that's probably what I did, back when I didn't know what I was doing
 
user3010322
Well.
 
user3010322
Right now my system is compile-time.
 
user3010322
9:05 PM
But I want the user to be able to choose which backend they want to utilize when they first launch.
 
user3010322
(And then to also have an implementation in Vulkan, when it's ready.)
 
sure
plink me when you figure it out plz :)
 
user3010322
Haha, kay.
 
user3010322
I might do something like a function pointer collection or something.
 
user1804599
@ThePhD std::function.
 
9:08 PM
@ThePhD That's unlikely to help a lot (after all, a vtable is basically just a collection of pointers to functions). You could save one level of indirection by putting an instance of the vtable in each object, instead of having each contain a pointer to a vtable, but if you're using it much, it's unlikely to make any real difference (the vtable pointer will in a register anyway).
 
user3010322
So it'll have to be a virtual function anywhos.... ah, damn.
 
what's wrong with virtual functions?
 
user1804599
Nothing.
 
user3010322
I mean.
 
@khajvah The big problem is that they're virtual, so they don't really exist. Makes it really hard to call them.
 
user3010322
9:11 PM
I'm only going to have 3 or 4 options, so maybe even just using a switch statement would be useful.
 
@Puppy In wide, do you use a parser generator or write a recursive descent parser, or?
 
user1804599
Presumably someone is concerned about performance without any reasonable argument.
 
wrote a descent parser
 
user3010322
@orlp He wrote his own LALR(1) parser for Wide's grammar.
 
user3010322
Wait, wat.
 
9:12 PM
it was not LALR(1).
Wide's grammar is LALR(1).
very different thing.
 
user3010322
I'm confuzzed.
 
user1804599
It's LOLLRURMOM(1)
4
 
parser generator's output is shit, so I wrote my own parser
 
A grammar isn't LARL(1), do you mean context-free?
 
no.
 
user1804599
9:13 PM
Use Parsec.
 
and grammars are LALR(1) if they can be parsed by a LALR(1) parser.
 
user3010322
LALR implies LR, which is a form of grammar that technically should be definable by a context-free grammar (e.g. with Pushdown Automata and a finite number of states).
 
guess I was wrong nvm
 
@JerryCoffin I was gonna say the same thing
 
@sehe Great minds, etc.
:-)
 
user3010322
9:14 PM
Time to do some benchmarks between a switch of 4 elements and virtual function calls...
 
maybe spend that time on benchmarking whether this code is your bottleneck?
 
user1804599
@ThePhD Add std::function as well.
 
8
A: Cost of a virtual function in a tight loop

Jerry CoffinAlthough it's not the same code and may not be the same compiler as you're using, here's a bit of reference data from a rather old benchmark (bench++ by Joe Orost): Test Name: F000005 Class Name: Style CPU Time: 7.70 nanoseconds plus or minus 0.3...

 
user3010322
@orlp Nothing in my code is a bottleneck right now. It ran fine on D3D, just porting to OpenGL and came up to the question of "how does the user choose which graphics runtime they get when they start the thing up"?
 
user3010322
@JerryCoffin Guess I'm using virtual functions!
 
9:18 PM
@ThePhD ... and therefore you need to do a benchmark?
 
user3010322
Uh. Not really. I have to pick a runtime solution, I was just curious as to which I should select, in the end.
 
@ThePhD I'm not sure it'll make any real difference in speed, but I'd probably handle this a little differently. D3D is Windows only in any case, so I'd probably define a class, and implement it in each of two (and eventually 3) different DLLs. Then load and use one of the DLLs when you know which one you want.
 
I probably don't understand the problem but why do you need to call virtual functions during every iteration? Can't you just get the choice of the user as some other object and reuse it?
 
@JerryCoffin Personally I might go for re-linking, I'm not a fan of dynamic linking.
 
@Puppy He seems to want to avoid that.
 
9:29 PM
well
tomorrow I'mma have a tough time playing D&D
I seem to have found myself playing a Chaotic Neutral character
 
What is going through my head right now:

*Your reading level is not high enough to read the documentation of licenses.*
So if you use the Apache license then you have to type "Copyright [yyyy] [name of copyright owner]". But doesn't Copyright imply that it's not open-source?
 
user3010322
@JerryCoffin Eugh. I've always tried to keep my hands off of having to load DLLs at runtime and having to clean them up... it probably won't be fun. ;~;
 
user3010322
Oh well. 'TIS THE PRICE THAT MUST BE PAID.
 
@DonLarynx no.
 
@Puppy Never mind. I am teh stupid.
 
9:39 PM
@ThePhD you could link all 3 version of your program, and switch a config that says which one to load :p
 
He/she can use "distribution terms"
 
@DonLarynx I know.
 
cool
 
There's such a huge emphasis on putting things in linear arrays for cache coherency when you do updates on all your game objects... I wonder if it really matters
 
user3010322
@melak47 Starbound does it like that. They ship 2 exes.
 
9:41 PM
or you could switch out your renderer dll or something. :v
 
@райтфолд Good idea.
 
user1804599
Line 26 is awesome.
 
yo
 
From GNU:

The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that [...] you do both of the following:
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.

So basically, if you create 10 executables, you get 10 object codes, so you have to copy the license 10 times. Isn't that a litt
 
9:58 PM
@ThePhD Oh, not necessarily (but it might well be worthwhile nonetheless).
 
Okay, I got a preview done
Yeah, yeah, I'm an ass and all that
 
Hrmm. So. What exactly do you want? "Parsing the std::vector<Word> input" makes exactly zero sense. Text is parsed. Objects are traversed. Pick your poison. But since you mention boost-spirit as well as parsing forgive me for assuming you... actually wanted to parse something — sehe 9 secs ago
 
user1804599
I'm also writing a program for parsing something. :D
 
any idea where the standard specifies object lifetime for trivial-copyable types? 3.8.1 says that object lifetime ends when the underlined memory is reused but 3.9.3 seems to permit it for trivially-copyable types even though it's not directly specified in 3.8.1.
 
@sehe parsing a vector, cause it's implicitly defined.
 
10:09 PM
Wut
 
undefined, sehe. undefined!
 
Don is drunk
> seems to permit it
permit what
@Veritas Anyways, look around here, it recently came up (I think):
Feb 26 at 15:05, by Luc Danton
> If, after the lifetime of an object has ended and before the storage which the object occupied is reused or released, a new object is created at the storage location which the original object occupied, a pointer thatpointed to the original object, a reference that referred to the original object, or the name of the original object will automatically refer to the new object and, once the lifetime of the new object has started, can be used to manipulate the new object, if:
The context was unions, IIRC
 
@Veritas Are you sure you meant trivial-copyable? Because that concerns, well, copies.
 
rewriting the memory using memcpy, but isn't that reusing the memory?
 
Isn't a "irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form" just a copyleft license?
 
10:13 PM
@Veritas No. That's manipulating the objects. And that method could be fine for PODs
 
@Veritas No (arguably). Part of the meaning of 'trivially copyable' is that writing the bytes is the same as assigning.
Do keep in mind that the source of the bytes has to be 'legitimate'. You cannot write anything.
 
@Veritas Do you mean you copy different objects (of different types) over it? Because that would count as reuse, I think. Are you e.g. copying raw pools of which varying PODs are allocated?
 
copying a different object of the same type
 
Then it becomes slightly interesting, because on the one hand you're copying a pool (which is just an object) and it's char[] (which is just POD). However, the "logically" contained objects might change meaning.
 
@Veritas Yes, that’s the same as assignment. No reuse.
 
10:16 PM
@Veritas That's not an issue. It's the same as int x = 4; x = 5; indeed
 
basically I think that I am looking for the part where the standard defines reuse
 
That’s a good question.
 
Reuse happens after lifetime ends, IYAM
Of course. When does lifetime end for a dynamically allocated POD object :/ (or even trivially destructibles)
Guys, 23:17, almost prime time. Heading off :) Good night
 
later
 
The meaning of a program that copies the bytes of a trivial (not just trivially copyable) object can be that either you reuse the storage to initialize a new object; or that you assign to it by doing so. Both interpretations agree (i.e. no UB and behavior of the program is the same).
 
10:20 PM
I probably have to read the standard more methodically.
 
I’ve always done that sort of 'non-deterministic' analysis when the trivial properties are involved.
 
Oh look, a question from Bangalore:
http://stackoverflow.com/questions/29176524/what-exactly-is-ascii-code
 
@MartinJames Must be monsoon there or something :-P ...
 
10:36 PM
@πάνταῥεῖ I was thinking moron season..
 
@MartinJames Nah! That's thought too harsh. Don't forget, they also have to struggle with heavy Turbo C++ storms there.
 
@MartinJames I like how that user's other questions are about the Linux kernel details; he seems to be very motivated to dig into it with nearly zero knowledge of programming.
I kinda hope the next question to be "how do I modify a .c file?"
 
@DanielKO 'nearly zero knowledge of programming' - obviously not an enthusiast, but could well fit in 'professional' :)
 
hi
 
10:47 PM
@edition lo
 
I found out how to remove a menu from a Win32 application.
just deleted it from the resource file.
 
i feel like stackoverflow.com/questions/29174936/… doesn't belong
 
@edition Err... OK?
 
can't make it fit into any category, though
 
10:53 PM
it worked
 
@edition Oh, you mean without raising an exception at runtime?
 
posted on March 20, 2015 by Scott Meyers

There's lots going on in the Effective Modern C++ 'verse these days. Behind the scenes, I'm gearing up to  revise the book for an upcoming forth printing, during which I hope to make a big dent in the list of known errata, but in the meantime, please note the following: The Effective Modern C++ Sample Page has been updated to include a new sample Item. This time it's Item 14: Declare fu

 
user1804599
OK, parser works, time to write name resolver.
 
@райтфолд Name resolved -> Pantoona :-P
inb4 leftfold ...
 
user1804599
lol
 
user1804599
11:00 PM
-2
Q: Something really silly

GrantYes, this is a homework problem on inheritance but I need your help on something else and not the actual part. I'm required to build a vehicle class and then inherit it. It's supposed to have three data members: year, make and model. What could make and model mean? Can you give me some example...

 
@райтфолд someone posted an answer. sigh.
repwhores
 
@Blob Even Vlad would not answer that shite.
 
@райтфолд I don't get to flag questions as "blatantly off-topic" very often.
 
user1804599
I downvote and closevote at the first slight hint of incompetence.
 
> put on hold as unclear what you're asking
no it's not -.-
 
user1804599
11:04 PM
Today I popped a pimple that was hiding in my ear. It was a delightful experience.
 
How to pronounce the following names: @райтфолд @πάνταῥεῖ
 
user1804599
Just like they are written?
 
@edition you don't.
well, i don't
 
@Blob With sewage like that, I click on the close-reason that requires the minimal mouse-movement.
 
@edition Mine is easy: Panta rei
 
user1804599
11:05 PM
Mine is easier.
 
@πάνταῥεῖ what? i always thought navta pei
navta pei, pantoona
 
user1804599
It's just “райтфолд.”
 
@райтфолд Your's isn't a thing but an obfuscation ...
 
user1804599
use std::io;

MAIN {
    io::writeln("Hello, world!");
}
 
user1804599
I consider . instead of ::.
 
user1804599
11:06 PM
Although that may give the impression that modules are objects.
 
?
 
@edition he's referring to his own language. ignore it.
 
user1804599
she
 
user1804599
dammit
 
is it possible to redefine C to BASIC?
 
11:08 PM
less typing
 
user1804599
BASIC++
 
using macros
 
#define C BASIC
 
typedef char** SPAGHETTI;
 
user1804599
SPAGHETTE @Jefffrey
 
11:11 PM
@edition Wut?
@райтфолд "their", "its" ?
 
guys im sad. any recommendations? games? vids?
i want a decent game that runs on my comp
 
@Blob C++ is fun.
 
preferably open world and lots of fun
 
Age of empires.
 
@edition no it's not
 
11:14 PM
@edition You can do nasty things with macros, but I don't believe you can actually do it that nasty to provide BASIC syntax for a C compiler.
 
oh, trying to redefine numbers to labels?
lol
 
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "language.h"

start_here(number argc, spaghetti argv)
{
spaghetti bolognase;
}
 
@Blob What is your comp? Does it run anything more complex than solitaire?
 
@DanielKO i5. no graphics card
 
@edition And the start_here() macro looks like what please?
 
11:17 PM
nethack perhaps?
 
int main
 
^won't work
 
user1804599
I've been programming without syntax highlighting for weeks now.
 
user1804599
And it's been much better.
 
user1804599
Fuck syntax highlighting.
 
11:22 PM
@райтфолд I kinda wanna flag this as offensive.
 
@DanielKO everything he says is offensive
 
user1804599
Then you haven't read the rules.
 
user1804599
They say that flagging is forbidden in Lounge<C++>.
 
@райтфолд no
only strongly discouraged
 
#include "language.h"

start_here
{
spaghetti bolognase = { "cheese", "mince", "spaghetti" };
speak("Ingredients: %s %s %s", bolognase[first], bolognase[second], bolognase[third]);
wait_for_the_user();
goodbye;
}
 
11:25 PM
@edition why?
 
Its for entertainment.
 
@edition After 23 IOCCCs on record, you gotta try harder for entertainment.
 
@Blob It's merely silly than offensive, but that's just a narrow ridge ;-P ...
 
@DanielKO A matter of taste. If he wants to program without syntax highlighting, that's his funeral privilege.
 
@edition Ah I see now, you were looking for Chef actually:
@JerryCoffin Every time you offense a vi hardened editing hero, a kitten dies! Remind this!
 
11:41 PM
@райтфолд Reaching insanity eh
 
user1804599
No.
 
@Grant "I warned you" You should have warned yourself, before posting such non question here. Going to delete it now. — πάντα ῥεῖ 21 mins ago
 
@πάνταῥεῖ Oh, I think you're quite off-track here. The point isn't to avoid offending Vi users. The point is to offend users of all editors and IDEs simultaneously and equally.
 
^Even Sheldon had learned how to deal with sarcasm meanwhile ...
 
11:46 PM
@JerryCoffin besides microsoft word, which i suspect he uses
 
@Blob In fact we have an employee in our company, who thinks that Word + VBA is a fantastic IDE for his purposes. He was writing sophisticated word macros to validate form tempates filled in, for handing over a production level firmware versions. Unfortunately these macros need a quite old Word version to work, also no one really conforms with him, that this is a benefit.
 
that's... kind of incredible actually
 
@Veritas What in particular?
 
Word + VBA as an IDE
 

« first day (1616 days earlier)      last day (3331 days later) »