« first day (914 days earlier)      last day (4037 days later) » 

3:00 PM
now I feel better
pwned a big proposal that Herb turned up to see with a simple question
 
Xeo
Which one?
And what question?
 
dynarray
 
Xeo
You can't just leave out the details man
 
ohmyfuckkillitiwthfire
 
and I asked him about allocator support for dynamic allocation backup
 
Xeo
3:01 PM
hrhr
 
and he kinda stood there and was like "Er... er... er...."
 
Xeo
Time saved, I'd say.
 
the core feature for run-time arrays was approved anyway
 
what
god fucking no we don't want/need that why
 
Xeo
3:02 PM
@DeadMG It wasn't his proposal btw
 
why add useless features
 
@DeadMG What?
Which one?
 
n3639
not sure if it's externally visible as it's a revised paper
 
Xeo
Nopes
 
3:03 PM
What feature is this that's been approved?
 
Ahahaha new xkcd
 
Tell me it doesn't mess with the type system.
 
run-time arrays? Someone please explain.
 
@R.MartinhoFernandes It doesn't
 
@R.MartinhoFernandes I had fixed that. (Not sure if this is the best approach though.) Oh, damn, this still has the const_cast... Here it is without.
 
3:04 PM
@ShotgunNinja It's a vector.
 
the summary of n3639 is "C99 VLAs but virtually every place you try to get the size/etc is banned."
 
It just guarantees that... something. I don't know how they can describe that in terms of C++.
 
no decltype, typeinfo, sizeof, taking the address of, basically everything.
virtually all you can do is allocate it, and index into it.
 
@R.MartinhoFernandes Does it provide syntactic sugar or something?
 
3:05 PM
And that's better than... what and why
 
Idon'tgetit
 
3 mins ago, by Bartek Banachewicz
why add useless features
 
Why add more exceptions?
 
@ShotgunNinja it's for crappy as fuck compatibility with C99 :/
 
3:06 PM
dynarray was better, to be honest.
 
@BartekBanachewicz Barf.
 
@R.MartinhoFernandes It did add another exception type.
 
At least dynarray was a citizen.
 
And here it goes for "let's make C a subset of C++"
Crap I can't believe I believed in that, even for 15 minutes.
 
@DeadMG I guess standardizing alloca might have been better.
 
3:07 PM
@R.MartinhoFernandes The only use for dynarray is "Maybe special compiler opts in some circumstances".
I'd prefer the core feature because at least when you use it, you actually know what result you're getting.
 
Standardise alloca and add stack allocator
 
@DeadMG But this thing is pretty much alloca, except it doesn't look like alloca.
 
@R.MartinhoFernandes There is a coating of some type-safety over it, e.g. exceptions and such.
 
What's the syntax?
 
Does it have a beard
 
3:09 PM
usual T arr[expr]
 
@DeadMG FUCK IT.
I don't want to use dynamic arrays by accident.
 
Xeo
:s
Just sizeof all your stack arrays, and you'll be fine!
 
C++ keeps getting better and better
 
@R.MartinhoFernandes don't use C-style arrays at all, huh?
oh my god university teachers will teach that instead of vectors
kill me
 
@R.MartinhoFernandes Even better, if you do, no warning or problem until you randomly get an exception because your impl decided you might overflow stack or go over the implementation-defined limit.
 
3:11 PM
@CatPlusPlus lol
 
@ScottW Oh ffffffffffffffffffffffffffffff
 
Xeo
@DeadMG No chance to oppose it?
 
@DeadMG Right, that's exactly why it's awful.
 
@Xeo It already passed Core.
 
What is the usecase for that anyway
 
Xeo
3:12 PM
@DeadMG This makes me sad.
But even if it passed Core, there should still be a chance to take it back, no? :(
 
yeah
 
@CatPlusPlus People love arrays. (esp if they don't know any other data structures)
 
but IDK about that
 
"A maybe slightly faster in some specific cases vector but with no useful features whatsoever and something"?
 
but seriously, what's the reasoning behind it besides C99?
 
3:13 PM
@BartekBanachewicz It has nothing to do with C99.
 
dynarray is the bads, though
 
C99 VLAs are too messy (and optional in C11).
 
Fuck low level details forever
 
@R.MartinhoFernandes so why on earth it even appeared?
 
@R.MartinhoFernandes Are you sure that's not an influence?
 
3:13 PM
who fucking proposed it
 
Xeo
@DeadMG We need to get rid of that... really. Why the fuck did CWG pass that
 
What's the difference between dynarray and vla?
 
I prefer alloca.
 
Xeo
> The proposal presented in this paper was approved by EWG and handed over to CWG during the Portland meeting of WG21.
Why did it even pass EWG :(
 
A function is the sane way to do this.
 
3:14 PM
A vector is the C++ way to do this.
 
Perhaps it can lead to better SBO implementations. I can't think of many other use cases though.
 
And we already have vector.
 
@BartekBanachewicz Not doing something is not a way of doing that thing.
A function does not introduce weird declarations that can only work in some places and it does not introduce new types.
 
@R.MartinhoFernandes it allocates runtime-sized contiguous typed memory. How is that not doing it?
 
@BartekBanachewicz Do you even know what VLAs and alloca do?
 
user1357851
3:16 PM
@ScottW I wish ... it's a drawing
 
@R.MartinhoFernandes sounds Hawaiian
 
@R.MartinhoFernandes VLAs allow passing size that's not a compile-time constant, no?
 
That's only half the story.
 
@StackedCrooked Eh
 
Ooh, there's another half?
 
3:16 PM
Not worth it
There's another jalf
 
The important bit here is using the stack.
 
Xeo
@StackedCrooked nonononono. Can't pass stack memory around
 
Otherwise it's just a vector.
 
@CatPlusPlus Do they fight a lot?
 
@StackedCrooked It can only works on local variables.
 
3:17 PM
@Xeo VLA in struct doesn't work?
 
@R.MartinhoFernandes how is that different from a vector with something like stack_allocator?
 
Nobody knows how VLAs work
There is no stack_allocator
And there can't be without alloca
 
@BartekBanachewicz Go ahead and write that (hint: you cannot allocate from a random stack frame: it has to be from one in particular, and that is not one frame that belongs to the implementation)
 
Xeo
And even with alloca a stack_allocator doesn't really work.
 
@R.MartinhoFernandes well then that should be added to the standard, if anything
 
3:19 PM
It coould maybe theoretically but again fuck that it's not worth it
 
@BartekBanachewicz Go ahead an try to spec it (hint: it's fucked up)
 
@ScottW ...and? Did he need more than one statement to do this or something (or was referring to the previous awful code?)
 
@R.MartinhoFernandes is it more fucked up than the arrays that passed?
 
Where will a stack allocator allocate from?
 
uh... stack?
 
Xeo
3:20 PM
@BartekBanachewicz Yes
Way more
 
@BartekBanachewicz Which part of the stack?
 
Xeo
@BartekBanachewicz On which stackframe?
 
As soon as a function returns, that memory is gone.
 
the same that these arrays do, presumably
 
@ScottW don't hire him!
 
3:20 PM
THE stackframe DUH
 
Xeo
The arrays are on the stackframe you want the memory from
 
@BartekBanachewicz These arrays allocate from the stack frame where they are declared.
 
Xeo
The code in the allocate function of an allocator... is not.
 
oh crap.
 
A stack allocator's allocate function will be called god knows where.
 
Xeo
3:21 PM
Finally clicked?
 
alloca is magic: it allocates memory in a stack frame above it.
 
@ScottW was he allowed to use std::reverse?
 
you know, excuse me for asking that way, but sometimes, and I've seen it many times, such noob questioning might really make valid points
 
You could cheese stack_allocator to be magic too
 
@R.MartinhoFernandes wat?
 
3:22 PM
@ScottW Ah, okay. I think I'd stay well away.
 
@CatPlusPlus Much harder to spec because you don't call it directly.
 
Yeah
Again, not worth the effort or anything
 
Xeo
@StackedCrooked std::equal(str.begin(), str.end(), str.rbegin());
 
@Abyx It certainly cannot allocate memory on its own frame.
 
a function knows nothing about previous stack frame
 
3:23 PM
@Abyx that's why it's so fucked up, I guess
> The alloca() function is machine- and compiler-dependent.
 
alloca knows
It knows
 
Xeo
Okay, can we drop that now and have an organized pitch-forks-and-torches revolt against the built-in dynarray?
 
That's why it's magic, duh.
 
@Xeo ...or "return input == std::string(input.rbegin(), input.rend());` or any number of other trivial methods.
 
@R.MartinhoFernandes dunno about your alloca, but in VC++ alloca is just sub esp, n
 
Xeo
3:23 PM
@JerryCoffin Meh, actual reversing...
 
@Abyx AKA magic.
 
It invades the calling stack space
 
@R.MartinhoFernandes I don't get it
 
I won't try.
 
> On many systems alloca() cannot be used inside the list of arguments of a function call, because the stack space reserved by alloca() would appear on the stack in the middle of the space for the function arguments.
That's so... I mean...
I am thinking embedded now, but still.
 
3:25 PM
Also have fun writing a spec based around SP on a C++ abstract machine
 
If something is dangerous enough for C devs to call it dangerous, I want it to stay far away from me.
 
:v:
It's not really dangerous per se
 
rather completely IB, CB, MB, and friday-morning-B
 
It's as dangerous as big local buffer meaning you can punch through the upper bound of the stack
 
3:26 PM
anyway, if anyone is bored/interested I wouldn't mind hearing what you guys think of this: programmers.stackexchange.com/questions/195262/…
 
@Aeluned this is just weird pImpl, no?
 
yeah, it's weird.
 
can't you use normal pImpl?
 
If it's PImpl then inner class will never be exposed and there's no issue whether it looks ~pwetty~ or not
(And don't use reference data members ever)
 
3:28 PM
yeah, the inner class is exposed.
 
@CatPlusPlus that's why I added "weird"
 
It's not "weird" if it's exposed, it's just not PImpl
 
it's a reference data member because it's guaranteed to exist for the lifetime of Foo.
 
Regular composition
 
3:28 PM
Foo owns and creates it.
 
okey, so, if you are concerned by exposing, why not simply hide it?
 
I'm just stubbornly trying to avoid Getter functions I guess.
 
It can't be a reference member in that case that's one
 
@Aeluned Let the users of Foo hold their own references if they care that much about Foo::bar.
 
Two, never use goddamn reference data members
 
user1357851
3:29 PM
@LokiAstari Loki! you probably don't remember me, but I think I trolled you once & you wouldn't upvote my awesome answer
 
ok, so just use GetBar().
 
@Xeo Not particularly recommending that, but compared to the original code, I'd say there's no contest.
 
@StackedCrooked yup. nothing is writing a (/var/chroot)/tmp/status now (I suspect I'm missing a non-webserver daemon)
 
1 min ago, by Cat Plus Plus
Regular composition
 
@StackedCrooked Woof :)
 
3:32 PM
gave dynarray another good slap
 
@Telkitty Shrugs in complete indifference. I piss a lot of people off, nothing personal.
 
@sehe I don't recall a status file in chroot/tmp
I normally only committer.sh running in the background.
 
user142019
@DeadMG as that something like an alloca wrapper?
 
kiiinda
 
@sehe The only files that are written to /var/chroot/tmp/ are main.cpp and cmd.sh iirc.
 
3:34 PM
part alloca wrapper, part compiler magic, part library feature
 
user142019
OIC.
 
@StackedCrooked Ok, I get not (visible) response at 'compile and run' and I see errors:
webserver.rb:151
pid 10319
Wed Apr 17 17:34:37 +0200 2013: Read error: #<Errno::ENOENT: No such file or directory - /var/chroot/tmp/status>
webserver.rb:125:in `read'
webserver.rb:125:in `compile'
webserver.rb:33:in `process'
webserver.rb:33:in `synchronize'
webserver.rb:33:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/http_response.rb:65:in `start'
 
user142019
It seems useful.
 
user142019
(Reading N2648.)
 
I suspect it is because I used sudo -E -u webserver ruby webserver.rb 0.0.0.0 8989 because run.sh won't work (it binds to loopback network only)
 
3:36 PM
@CatPlusPlus what's the harm in the case that I linked to? GetBar() would return a reference either way. Isn't it the same thing? I just want to know why you use the word 'never'.
 
@sehe you need to run webserver-sinatra.rb, not webserver.rb (which is obsolete).
sorry, I should clean that up.
 
Reference data members are trouble that's generally not worth it
Also they model non-ownership so if your object creates and owns the thing it can't be a reference data member
 
@sehe Actually, you need to cd to the Web directory and run ./run.sh from there.
 
@StackedCrooked I figured. But run.sh doesn't work
@StackedCrooked netstat -tlpn shows:
 
@Zoidberg No, it's bad. I gave it a couple of excellent kicks.
 
user142019
3:38 PM
lol k :P
 
tcp        0      0 127.0.0.1:8989          0.0.0.0:*               LISTEN      10543/ruby
 
I pointed out that the usefulness of the type is strictly predicated on a compiler optimization, and he provides no way to know if it actually happens; so there's no way to know if using dynarray is even remotely justified
 
Nice opening for that paper
> Programs can become more efficient
You already know it's ~PERFORMANCE~
 
hi, am I wrong, or = operator here is "wrong"(works, but should not be done like that) : en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29
 
It's fine
 
3:40 PM
that looks good
 
@CatPlusPlus In an area that even with (for an obvious example) std::vector is virtually never a bottleneck anyway. Sheer brilliance!
 
That's how you should do assignment operator
 
user142019
@NoSenseEtAl Copy and swap is the idiom for implementing operator=.
 
@Zoidberg really ? I thought always take by ref and do memberwise assign... I guess it makes sense
less code less bugs
 
user142019
@NoSenseEtAl that doesn't work with owning char*.
 
3:41 PM
@NoSenseEtAl That's plain dumb, cause the compiler will generate that assignment operator for you.
 
user142019
That's the whole point of the rule of three.
 
@Zoidberg you do new ofc, not naive =
 
Less code more bugs
 
user142019
Then you're duplicating code.
 
Rule of zero or bust
 
3:42 PM
@CatPlusPlus LOL
 
That's a thing
 
user142019
@NoSenseEtAl FYI, he is serious.
 
rule of zero, rule of five... sings meet me halfway :P
 
@CatPlusPlus You mean purrformance?
 
3:42 PM
@sehe I usually bind to the VM's IP address and port 8080. I also need to configure port forwarding from my main OS's IP local address to the VM's IP address and port in order to access it from my main OS.
 
@EtiennedeMartel ~~~performance~~~
 
someone write a wikipedia entry for rule of zero
 
I just got Nexus 4
it looks really nice, I gotta say
 
@Zoidberg I know , unique_ptr magic :D
 
user142019
@bamboon inb4 deleted as not encyclopedia-worthy.
 
3:43 PM
but Android...
 
@BartekBanachewicz sweet, now put ubuntu-phone on it
 
@NoSenseEtAl :( No.
 
Fuck Wikipedia
 
@bamboon meh, I just want to run one ES test on it
 
@BartekBanachewicz Tested one for work a while back -- nice phone.
 
3:44 PM
It's not about unique_ptr, it's about not mixing resource management with other responsibilities.
 
@Zoidberg why, when there is also Ro3?
 
@JerryCoffin I am really fighting hard to not buy an android phone, I have to admit
 
Resources Are Primitives
 
@BartekBanachewicz ES? Engineering Sample?
 
user142019
3:44 PM
@bamboon OpenGL ES
 
@bamboon OpenGL ES :)
 
@StackedCrooked Well, if it listens on loopback, forwarding it doesn't help. I tried the public IP too, no dice. I added it to /etc/hosts using the FQDN and, no luck
 
AFAIR it's a regular client-grade model
 
aha
 
meh. It costs more or less the same as iPhone 4S
so no, I'll pass and just grind that cash towards iP
 
3:47 PM
@sehe My port forwarding usually looks something like: 10.0.0.27:8080 (local) -> 10.0.0.123:80 (VM). In the webbrowser I must also go to 10.0.0.27:8080. localhost or 127.0.0.1 don't always work.
 
@BartekBanachewicz More comparable to an iPhone 5 -- but still still nicer than it.
 
@R.MartinhoFernandes Needs moar std::align! Nah, just kidding.
 
@StackedCrooked Again, don't bother with the port forwarding. That's not the issue. The server isn't listening on the right interface...
 
@JerryCoffin you mean the iPhone is nicer, obviously? :P
 
I wouldn't want to inflict std::align on anyone.
 
3:48 PM
@LucDanton I don't know how aligned is what alloca returns, but I assume as much as malloc.
 
@StackedCrooked Note, that the other mongrel based server works, externally (passing 0.0.0.0 for the host)
 
@BartekBanachewicz No, I mean the Nexus is much nicer than any phone Apple has ever produced.
10
 
@JerryCoffin Let the war begin ...
 
Wait, for local testing I use shotgun webserver-sinatra.rb params to launch the server.
 
The war just ended.
 
3:49 PM
@JerryCoffin maybe the phone is (which I hardly believe. The screen is of much worse quality at sight. It's also slower than iP5). Still, shitty OS ruins it
 
@StackedCrooked ?! I obviously want it on the external ITF. I can't even do local testing, since the server is a VPS and headless
 
@R.MartinhoFernandes Because the man page only states it gives bytes, I bothered implementing std::align for my stack_arena thingy :( Never tested/googled what it actually does in that regard.
 
Yes iOS is shitty I completely agree
 
@LucDanton Oh, ok, then I assumed wrong. I am going to wiggle my way out of it by claiming it's in the compiler magic section :P
 
time to vote strongly against dynarray
 
3:50 PM
@CatPlusPlus Hey, hey.
 
I even used the broken placement array new.
 
Are you playing Dark Souls right now? <3
 
@R.MartinhoFernandes The famed broken placement array new
 
Ok, after Cat enters the discussion, I immediately leave it.
time to verify if I really found a bug in our driver.
 
@DeadMG It just struck me how good it is that the Cat isn't there :|
 
3:51 PM
Victory
Flawless
 
@BartekBanachewicz Depends. The driver of your car? Yes.
 
damn
dynarray passes LEWG with fairly strong support.
 
@sehe I don't have a driver's licence :P
 
user142019
lol
 
user142019
pwnt
 
3:52 PM
@DeadMG lol
 
Ahahaha
 
user142019
BLEWG
 
@sehe but wai
 
@BartekBanachewicz The iPhone screen is a little nicer ("much nicer" is from reading specs, not looking at real screens). In actual use, difference in speed mostly comes down to individual apps (some on iP5 are quite sluggish compared to equivalents on the Nexus). Andoid is crappy, but iOS is many times worse.
 
My comp just crashed. Mobile resort..
 
user142019
3:54 PM
lol
 
user142019
pwnt
 
@JerryCoffin to be honest, the thing that holds me the most is the fact that I only have to pay for iOS apps once to get most of them on the iPhone, when I eventually buy it. Which doesn't really work on Android (tablets), no?
 
Windows Phone is the best anyway.
 
user142019
iOS > Android
 
@StackedCrooked Windows? xD
 
3:56 PM
linux work pc
 
@sehe linuxes crash too, y'know
 
@Zoidberg Eh I don't know
They're both bad
 
@BartekBanachewicz sssssh
 
It froze after launching vbox installer.
 
@LucDanton Did you write your std::align wrapper, or did you put up with the weird interface?
 
user142019
3:57 PM
Speaking of iOS, time to update my iPod.
 
I tried my best at implementing the specs. So no idea what it actually does.
 
Oh you did it from scratch?
 
@BartekBanachewicz I'm honestly not sure -- I wasn't testing an Android tablet at the same time, so I didn't check how many apps would also work on a tablet. At least in the cases I tried, no extra payment was needed to use on two different Android phones though.
 
@sehe you can configure the port and address by editing Web/coliru_env.source (which I think you probably did)
 
@R.MartinhoFernandes Yeah, no implementation at the time. I don't know if there is one right now.
 
3:59 PM
I think I am wrapping it, so there probably is one.
 
even worse
LEWG put it through for C++14 rather than TS
 
I might be misremembering, or might have that #ifdefed for libc++.
 
@JerryCoffin I think Android considers tablet and phone apps completely different (and well, there's a good reasoning behind that).
 
@DeadMG haha
 
@R.MartinhoFernandes The latter, as I recall.
 

« first day (914 days earlier)      last day (4037 days later) »