« first day (2012 days earlier)      last day (2938 days later) » 

Ven
12:02 PM
shoots @nwp
 
> That's broken, at a fundemental level
 
nwp
@Ven now I know why they have beans in Java, to reach the cloud!
 
I am going to write a C++ library
 
nwp
@BartekBanachewicz drunk? desperate? both?
 
@nwp the latter
and it's not for me
 
12:13 PM
@BartekBanachewicz What for?
 
@набиячлэвэлиь closure creation
 
nwp
I thought lambdas already did that
 
(args) => {coed}
 
@nwp not for C function pointers
 
Ven
use boost.phoenix, of course. (:
 
12:17 PM
@Ven does that work
 
Ven
if you're willing to sacrifice your free will, your soul, and any kind of hope in either humanity or technology, yes
 
hi everyone, I guess.
 
Ven
yo
 
oh, don't worry. I won't delete comments, especially the last one. :/
Just in case you were concerned of that habit re-appearing.
@BartekBanachewicz will it be in a Github repository?
 
@edition I guess
 
12:25 PM
@BartekBanachewicz cool.
 
@edition not sure yet though
 
@набиячлэвэлиь is your profile image based of the IntellJ logo?
 
@edition it's netbeans
 
@BartekBanachewicz Ah, that one.
 
Ven
i'm tired of recruiters calling me "hey we say your résumé on platform X" I disabled it around 4 months ago you morons
 
12:38 PM
Hi, I'm a 19 year old who can write C++ code. I have few qualifications to speak of. Please hire me.
 
Ven
In this case, 1) I'm not 19 y.o. 2) They don't want to hire me for C++ stuff, but for web shit (PHP).
 
@Ven oh, take it and put food on the table.
 
Ven
fuck no
I'd rather die free than write PHP and live!
(seriously tho, I have a C++ job, much better than PHP)
 
went shopping - bought 4 pieces of clothing, 1 hard drive and 1.2kg Chinese style sausage ...
 
Ven
This is the kitty shop, duh duh duh duh.
 
12:41 PM
@Telkitty is that disguising a naughty message?
 
Ven
More disgusting, it's a telkitty message.
 
Oops, but no. That's really I have bought.
 
@Telkitty why not Italian sausage (salami)?
why you sausage racist?
 
@Ven "much better than PHP". Somehow I doubt any compliment in the world could be much weaker than that.
 
coz Chinese ones are sweet, I like sweet things when it's not too sweet
 
12:42 PM
@Telkitty ok.
 
Ven
@JerryCoffin hence the "much" :)
 
@Ven It needs to be much better than PHP just to get to neutral...
 
Ven
it's C++, it still sucks.
 
@edition it can do this so far
void test3() {
    int(*func2)() = closure::bindAll(f3, 1, 2, 3);
    int result = func2();
    printf("result : %d", result);
}
 
Ven
12:47 PM
@Telkitty gonna get stuck in its fluff
@BartekBanachewicz rewriting std::bind, are we? :P
 
nwp
@BartekBanachewicz you use global variables for that?
 
Ven
of course..
 
@Ven again, std::bind doesn't give you a function pointer
@nwp @Ven no.
 
Ven
(I'm joking)
 
nwp
where does the 1, 2, 3 go then?
 
12:48 PM
@nwp into a closure.
 
Ven
means you have to take everything by const auto&?
I can't return that function, can I?
 
no?
@Ven you can
 
Ven
how do you manage the lifetime of your arguments then?
 
nwp
it is not in func2 and not in a global variable. I don't understand "in a closure"
 
Ven
wat
 
12:49 PM
@Ven they leak so far vOv. I need a destruction method.
@nwp It's in a dynamically allocated executable memory.
 
Ven
with a destruction method, you can't return that function pointer.
 
nwp
oh, that makes sense, but I didn't think you were a badlet
 
@nwp What else do you propose?
@Ven well you can, you just need to remember to clean up after it manually vOv
 
Ven
ew.
 
at least it allows you to encapsulate it all in a class; then the class can manage those
 
Ven
12:51 PM
well. I guess you could offer some kind of unique_ptr-style construct to hold both the function and its block of "context"... Kinda like std::function :)
if you encapsulate it in a class, you bought nothing compared to std::function, did you?
 
nwp
@BartekBanachewicz either put it into an object -> use a lambda or use some template magic to put stuff into global vectors and suffer synchronization overhead or drop threads
 
@Ven Well, not really. This is meant to be used for C APIs taking callbacks.
 
@BartekBanachewicz it's a trampoline?
 
@BartekBanachewicz I'll have to see the code behind closure::bindAll to really understand it.
 
@nwp This is way worse.
@slaphappy no
 
Ven
12:53 PM
wat? how is this a trampoline?
this is definitely not a trampoline
 
nwp
@BartekBanachewicz worse than leaking memory? what if the destructors actually do something useful?
 
yeah I had to think about it
 
Ven
(nice double edit)
 
@nwp You can manually destroy that memory, so you won't leak it.
 
Ven
your stuff is basically a unique_ptr with a function pointer inside
 
12:54 PM
um no, not really.
i mean, well...
yeah, I guess you could use unique_ptr to track it actually
okey, that's actually a good idea
 
Ven
seems like you can to me
 
nwp
@BartekBanachewicz maybe return a pair<functionpointer, handle> where the user is responsible to handle->free() after the last call to functionpointer()
 
since you can .get() the unique_ptr
@nwp that's precisely what unique_ptr is
@Ven except that it's not like std::function at all, that's what misled me
Ven was right
 
Ven
well, it's "a std::function that can actually be converted to a function pointer". But I'm oversimplifying, so it doesn't make sense..
 
yeah that's just unique_ptr with a custom deleter.
 
12:56 PM
@BartekBanachewicz I mean, is it a pointer to a function that's been built by bindAll at runtime?
 
@BartekBanachewicz Well, it's not like std::function, but proper use would be closely related.
 
@Ven yeah.
the callability is irrelevant here. The conversion (decay?) is.
@slaphappy Yes.
 
you would probably do like closure::bind<int()>([=] { return stuff; });
 
@Ven so the question now is: can unique_ptr hold function pointers?
 
nwp
"the user is responsible to handle->free() after the last call" really doesn't sound like unique_ptr to me
 
12:58 PM
@BartekBanachewicz It can hold anything with the proper deleter.
 
Ven
@BartekBanachewicz it's a pointer.
 
@Ven function pointers weren't pointers last time I checked
 
Ven
@nwp because you use RAII to replace "the user"
 
@Puppy nice, thanks.
 
@BartekBanachewicz They... are and are not, it depends in exactly which way you mean it.
 
12:59 PM
@nwp "The user is responsible for maintaining the lifetime of that object"
 
in the most literal sense of being a T*, I believe that they are, but in terms of being convertible to void*, they are not.
 
@Puppy Ask @Ven which way he meant it.
 
@BartekBanachewicz yeah, MS calls those trampolines sometimes. But given the wikipedia article, it usually means something else, so
 
I would expect that unique_ptr<int()> would be OK.
 
@BartekBanachewicz How do you deal with DEP?
 
1:00 PM
either way, unique_ptr holds T so
@slaphappy OS-specific.
 
@BartekBanachewicz T* if you don't customize it through the deleter, which would probably be fine in this case.
 
@BartekBanachewicz iow you don't?
 
Ven
@slaphappy yeah, trampolines are usually used in the functional world to mean "function helping with stack overflows" (preventing it by limiting stack depth to a fixed amount)
 
@slaphappy DEP doesn't apply to dynamically allocated executable memory.
 
@Puppy I need to customize it, OS specific again
@Puppy actually it does
well maybe it's not DEP per se in this case
 
1:01 PM
@Puppy I didn't know you could allocate executable memory
 
@slaphappy That's how every JIT has to work.
 
@slaphappy you can allocate something that you can make executable
 
Ven
(how could JITs or anything like that could work otherwise?)
 
DEP is not about stopping people from dynamically allocating executable memory; it's about stopping people from executing memory that hasn't been explicitly marked as OK to execute.
 
Yeah, of course. I just never thought about it
 
1:02 PM
@Ven "could" overflow
 
not sure if I could just use some jit library for that
but it's actually fun doing this myself
 
@BartekBanachewicz You probably need to let the user provide an allocator
 
Ven
@Shoe what are you replying to?
 
LLVM ;p
 
Ven
>LLVM JIT
 
1:02 PM
@Puppy yeah, my code has like 200 LoC right
 
lol
 
Ven
lol.
 
I'm not really the "thinking" kind
 
LLVM is a big dependency but it can certainly do all this stuff for you very easily.
 
@Puppy I agree. With both parts.
 
1:02 PM
and if you're a Linux person
then it's easy to get an LLVM package and not give a shit about how big it is.
 
Ven
@slaphappy pas de sentiments, que des centimètres ?
 
so I'd probably recommend it.
 
@Ven Follow the reply :)
 
I might implement something like that for Wide if I ever need it since I have to depend on LLVM anyway
 
I won't recommend it to anyone sans desperate users of GLUT on StackOverflow
so...
 
Ven
1:03 PM
@Shoe I don't understand.
 
use GLUT -> your own fault really
 
@BartekBanachewicz also sqlite plugins. I remember needing something of the sort.
also everyone who has to work with shitty apis really
 
@Puppy any shitty C API, yeah ^
 
hint hint: me
 
Ven
@BartekBanachewicz github.com/kobalicek/asmjit ?
 
1:04 PM
 
@slaphappy yeah I've realized that a lot of people actually have to deal with those and there's not a single reasonable solution
 
@BartekBanachewicz Non-shitty ones offer void* userdata, which is awkward but passable.
 
@Ven yeah, saw that already as well
@Puppy hence edit
 
yeah
 
Ven
@Shoe got it. tried to understand the link with my prior message about overflow.
 
1:05 PM
I see
 
@Ven it actually solves that problem quite nicely, so I might as well point people to that. But again, making it is fun
 
mooornin'
 
Ven
@BartekBanachewicz sure, reinventing the wheel is fun, but shaving too many yaks at a time usually mean you'll get bored before the end.
hi @jaggedSpire :)
 
I tried ASMJIT a while back
but ditched it in favour of LLVM.
because LLVM's not shit.
 
@Ven hey, I got some of the goods >_>
 
1:07 PM
but that was like seven years ago now so I'm sure he could have made a lot of improvements
 
@Ven Dunno, I just figured I might add some code to it to make it more robust
I'd never use it myself
 
Ven
constructive criticism, ladies and gents.
 
red panda! /cc @Borgleader @Ell @ThePhD @TonyTheLion @Ven @Xeo @набиячлэвэлиь
 
Ven
@Puppy seven?
 
that's the initial commit of his git repo.
not the start of the project.
he obvioslyy didn't produce 15k lines of JIT and then commit it
 
1:09 PM
I'm not sure how big the feature overlap between my library and asmjit is
he has the full instruction set which I don't really need
 
ISTR that ASMJIT wasn't very abstract either
 
anyway debugging this thing is really fun :D
 
lots of doing shit with immediates and stuff that LLVM doesn't expose to you
 
also I got to brush off my variadics skillz a bit
template<typename Ret, typename... Args>
rfpv<Ret> bindAll(Ret(*fun)(Args...), Args... args) {
    auto builder = BinaryFunctionBuilder();
    builder.addFunctionHeader();

    builder.pushArgumentPack(args...);
 
mmm variadics
yessss, finally got the Fanatic badge
 
1:15 PM
why BinaryFunctionBuilder? the callerr clearly isn't binary ;p
 
I just feel that there isn't adequate library support for that
 
I feel like that for everything in every language
 
oh bartek.
what kind of types ae you planning to support?
 
nwp
all of them of course
maximum fun
 
because I'm smelling an ABI catastrophe coming on
 
1:16 PM
@Puppy I guess ints and pointers should be doable
 
nwp
mutexes might be impossible
 
Actually void* could be enough but
It's the upper layer anyway, the user-facing one
 
if you point to a std::function with the void*, that could be enough.
 
So far I don't even support partial binding, and I'm not sure whether this direction is worth pursuing
I started some work on it because that was the first goal
 
well suffice to say that even LLVM does not support the C ABI.
 
1:18 PM
I wanted to hack shared stacks because performance
But now I don't really need it
 
so I'd be careful about trying to pass your generated functions off as C-compatibl.e
 
user1804599
> Immutable.Map().set(NaN, 42).get(NaN)
42
 
user1804599
interesting
 
language?
 
user1804599
ScavaJript
 
1:20 PM
prolly js
 
sbi
Hi.
 
evening ape
 
@Puppy I need a huge disclaimer "THIS MAY NOT WORK AT ALL AND CRASH YOUR CODE" anyway
 
sbi
1:21 PM
In the streams classes, do the stream buffers know about locales? Do they need them? (I'm sitting here staring at an UML where basic_streambuf<> references a locale object and wonder...)
 
they may do.
 
Ven
There's a difference in mysql between "empty pswd" and "no pswd"?
 
sbi
@Puppy Is that your opinion or a quote from the standard?
 
what happens when a thread crashes?
 
nwp
pretty sure a thread cannot crash without UB, so it is UB
 
1:23 PM
mmm.
 
sbi
@BartekBanachewicz Then the thread is dead. It's then called a dead thread.
 
I was thinking about unit tests
but I'd like to isolate the crashes
 
sbi
@R.MartinhoFernandes Thanks, that's what I needed!
 
Ven
it's gonna call std::terminate, not UB, afaik
 
1:24 PM
@BartekBanachewicz Uncaught exceptions in any thread call std::terminate.
 
Ven
^ @nwp
 
> Example
This section is incomplete
Reason: no example
35
Q: What happens when an exception goes unhandled in a multithreaded C++11 program?

R. Martinho FernandesIf I have a C++11 program running two threads, and one of them throws an unhandled exception, what happens? Will the entire program die a fiery death? Will the thread where the exception is thrown die alone (and if so, can I obtain the exception in this case)? Something else entirely?

 
I am not sure whether this would result in an exception
 
Ven
? std::terminate doesn't. Unless you std::set_terminate earlier to have it do that..
 
Tonight, while driving back, I have thought up a new genre - nerd horror, aka geeky horror. My first story would be titled 'Ghost in the PC' (that's right, PC, not mac, because f*ck Apple)
 
1:27 PM
@Telkitty all the best.
 
Ven
Ghost in the Terminal
:)
 
nwp
@Telkitty I hereby allow you to incorporate my story element that explains that beans in Java are magical and grow into the clouds and are therefore a relevant feature
 
eh it crashes in x64
welp
 
It's about a super elite ninja hacker's PC went all wacky - PC started doing things by itself - like turning itself on and off at random, woman in the youtube video crawling out of youtube and went to another tab etc etc
 
Ven
1:30 PM
[]() – you got the order wrong.
 
you suck
 
[foo](URL)
 
@Telkitty what about code that is hidden in every device around the world.
 
nwp
@ScarletAmaranth QQ
 
Ven
@BartekBanachewicz I'm glad I could look like I have any sort of clue about what I'm doing in C++ :P.
 
1:32 PM
@Ven it's a s horror not about a story on trojan horse malware
 
Ven
oh!
 
@nwp was thinking should I put in a section where the super elite ninja hacker went on stackoverflow and ask the question 'what do I do if a woman in video crawling out of youtube and went to another tab?'
 
nwp
only if it gets closed as too broad (your mom joke incoming)
 
@edition lemme emphasize, it's a horror, not a story about trojan horse, malware or virus ... PC anywhere, vnc or any other kind of remote access
 
user1804599
Building GHC from source.
 
user1804599
1:35 PM
RIP machine.
 
sbi
Why do some stream manipulators return an object of an / unspecified */ type? What's the point?
 
nwp
I don't know, I'm not good with horror
 
I guess no one ever came up with such genre because no one is ever interested in such a genre >_<
 
sbi
@nwp That answer doesn't make sense.
 
@sbi it's an object that converts to something that's specified (to disallow unwanted conversions)
 
sbi
1:37 PM
@slaphappy What?
 
nwp
@sbi that was related to telkitty's story, not to your stream manipulators
although now that I think about it I understand your confusion
 
sbi
@nwp orly?
 
@sbi to make the insertion operator/extraction operator work—the setw call itself cannot possibly affect the stream
 
@sbi The no-arg manipulators are implemented as a function pointer with a given signature, the manipulators with arguments are implemented with objects which have operator<< defined with first argument being std::ostream&
 
sbi
@nwp There once was a long discussion here that ended with me posting a list of problems I have with C++' streams as they are. It's a long list, with serious items.
@LucDanton But operator<< could, couldn't it? I'm confused.
 
1:40 PM
or are you asking why is it a function that returns an object and not an object name itself?
 
@sbi yeah, it operates on the object of unspecified type
 
sbi
@milleniumbug Oh wait, I think I got it. std::setw() returns something that's passed to operator<<().
@Luc ^
 
ya got it
 
sbi
Damn. Now that I got it, I specifically remember that I once knew this.
I feel old now.
 
It's essentially setw_manipulator_t, but you're not supposed to use such a type directly, so they keep it unnamed.
 
sbi
1:46 PM
OK, one more question about std::setw(): The documentation says (and I remember a discussion regarding a question about the stickiness of manipulators years ago on SO yielding the same result) that a specified set of functions will essentially call stream.width(0). I take this to mean that these functions will reset the stream's width before they return? I mean, if operator<<() would reset it first, then width() simply wouldn't work.
Or am I missing something here?
 
Nah, that's it.
 
half of the manipulators are sticky and the other half isn't, which is another syndrome of <iostream> being annoying
 
perhaps they should always return the new "state" of the stream
but fuck logic
 
sbi
@milleniumbug Nope, that's wrong (see the FAQ I mentioned). The only one not sticky is setw() – which is only due to the fact that the output operations manipulate the width. That's annoying, too, but not what you describe.
 
blast from the past: Voldemort types
 
1:50 PM
what types would Voldemort types be
 
sbi
@milleniumbug See here. (For the young ones here: Martin is Loki.)
 
nwp
@ScarletAmaranth unspeakable types such as lambdas
 
@nwp ah ok; so by definition, unspecified; at least in stupid C++
thanks, now I am smarter
(absolutely however, still dumb)
 
sbi
> Still confused, but on a higher level.
 
that about sums me up
 
nwp
1:52 PM
sounds normal to me
 
fun fact: std::nullptr_t is an alias to such a type, i.e. using nullptr_t = decltype(nullptr);
 
nwp
not like I never do or say stupid things :(
 
sbi
@ScarletAmaranth This is C++. Except for maybe a dozen smarties, this sums up all of us.
 
@sbi TIL. That'll definitely ease the pain the next time I'll need to deal with iostream.
 
sbi
@R.MartinhoFernandes Thanks.
bends over his slides again
 

« first day (2012 days earlier)      last day (2938 days later) »