« first day (1465 days earlier)      last day (3478 days later) » 

user1804599
2:02 PM
And I should find some way to get OpenGL debugger to work on OS X.
 
@rightføld Just enable debug output then and go full 4.x core
 
user1804599
glDebugMessageCallback gave a linker error yesterday.
 
are your drivers up-to-date?
 
user1804599
I don't know.
 
user1804599
I just installed Yosemite.
 
user1804599
2:04 PM
So probably.
 
debug_output became core in 4.3
Apple might not support it yet.
 
user1804599
> It turns out Yosemite still features OpenGL 4.1
 
user1804599
bollocks
 
user1804599
Maybe GL_ARB_debug_output works.
 
try to find some older build of gDebugger for mac then
@Sofffia you could've at least upvoted my comment :<
 
user1804599
2:07 PM
3
A: OpenGL debugger / error tracer for OS X 10.7 (Lion)?

Gavin MacleanYou could try the OpenGL Profiler provided along with the development tools: /Developer/Applications/Graphics Tools/OpenGL Profiler This will let you attach to an application, dump a trace, or break when OpenGL encounters an error.

 
user1804599
Ah, I have that tool. I thought it was just for performance measuring.
 
you'll need mostly breaking on error and state dump
VBO dumps would be nice too.
 
user1804599
I'd already be happy if it just terminates the program on error and shows me a stack trace.
 
Ell
@BartekBanachewicz have you tried VOGL?
or whatever valves debugger is called
 
@BartekBanachewicz there
 
user1804599
2:10 PM
Rather than black screen of death confusion.
 
Wait
What's going on
What's happening
Oh my God what is this thing
between my legs
it's so gigantic
OOOOOOHHH GOOOOODDDD
 
@Ell that's not really a debugger
 
Ell
@Sofffia ppfft you wish
@BartekBanachewicz sorry, tracer
I forgot what it's called :(
 
yep, that's not really what rightfold needs
 
Ladies
Oh FFS
 
Ell
2:11 PM
yeah, he just reminded me of it :)
 
@rightføld the programs don't crash just because you typed in wrong numbers there. You might not have errors, but it can still be a black screen.
 
The idea was to come back as Jefffrey
butt caching
 
Ell
@Sofffia I figured :P
 
user1804599
@BartekBanachewicz I know.
 
user1804599
But some cases is better than no cases.
 
2:12 PM
@Ell "frame debugger"
@rightføld GL error checking mostly prevents you from doing absurdly bad stuff. It's really far from correctness
but sure, check that too by all means
 
user1804599
Meh screw it. I give up.
 
that wasn't too long
 
she said
 
two hours more and I'm going home yay
 
Ell
Man. I want to be able to print a parameter pack at runtime, but it's not a thing is it? :3
I'll make it a thing just for this
 
2:19 PM
@BartekBanachewicz I'm not a fan of people posting answers as comments btw
 
@Ell go for it
@Sofffia I am a fan of them. I even have posters of them on the walls in my room.
 
@Sofffia it wasn't a proper answer.
 
@BartekBanachewicz How so?
 
@Ell no, C++ calls aren't created at runtime.
@Sofffia a hint, more like.
 
I've literally taken your comment, added an example and voilà...
answer
Anyway, that's why I don't upvote those kind of comments.
Not because I hate you or something.
 
user1804599
2:21 PM
% cat pybabel_extract_hack.py
def _(string):
    return string
 
That's what I wanted to point out.
Everybody loves _(...) in python.
I can't believe it's actually the recommended behavior in Django for translating strings.
 
user1804599
>>> def _(string):
...     return string
...
>>> _(...)
Ellipsis
 
user1804599
@Sofffia I sure do!
 
Are you in your "fuck letters, I want to be an egyptian" programming phase?
iunno
that phase that gave birth to brainfuck, haskell or similar languages
 
general question for the audience. Say you have an old version that needs to be supported, and there is some bug raised on it. Where do you fix it?
 
Ell
2:25 PM
new version
then backport
idk
 
oh... I never thought someone would actually suggest such a mad idea.
 
user1804599
@Sofffia I wish my keyboard had ∧ and ∨ keys.
 
user1804599
Fuck && and ||.
 
Ell
man I'm getting so confused with my pointers
 
@rightføld or what!!!!
 
Ell
2:26 PM
I've added and removed pointers everywhere
 
@Ell hint: stop using them.
 
Ell
I need them
 
@rightføld it has v
 
@Ell what are you trying to do?
 
Ell
@TonyTheLion open multi methods
 
2:28 PM
@Ell hint: you probably don't
 
@TonyTheLion You mean 'what the Ell are you trying to do?'.
 
@Ell sounds like XY problem
 
Ell
what does? o.O needing pointers?
 
@Ell yes. You are struggling to use pointers, you have already committed yourself to those being the correct solution. Step back, what is your root problem you are trying to solve?
 
Ell
@thecoshman I need to pass a variable polymorphically
I could use a refence, but pointers are easier to deal with atm
 
2:32 PM
@rightføld I feel your pain
 
user1804599
Du pain.
 
@Ell not really... just pass the value.
 
Du pain au chocolat
 
@MartinJames mmmm
 
@thecoshman That won’t behave polymorphically.
 
2:33 PM
@Sofffia lol
 
..or work for non-copyable classes.
 
Ell
@thecoshman it will be sliced if passed by value
 
@LucDanton sure it will, you're just not trying hard enough
 
@Sofffia infix ops are more readable than infix words
(words separated by ops not by words)
 
I was expecting you to say that
 
2:34 PM
no, seriously.
consider:
 
I know where you stand in the "yay operators vs fuck operators" dispute.
And I'm on the opposite side.
 
function <$> value_a <*> value_b

vs

function `apply` value_a `combine` value_b
 
Ell
I can't read either of those :L
 
@BartekBanachewicz yeah, both of those are non-obvious
 
@Sofffia I'm not on the very edge for "yay" (I still like use set with Lens)
@thecoshman what
 
2:36 PM
for the love of god, if you really have to have infix something then use words for everything that is not: normal math (+, -, *, ^, /), logic operators (&, &&, |, ||, /=) and >>= and >>.
 
"normal math"
 
I've listed what I consider "normal math"
 
Try not using $ then.
 
2:37 PM
@BartekBanachewicz how does 'apply' equate to '$', how does 'combine' equate to '*'?
 
Ell
you missed %
 
Yes, both $ and % are acceptable
 
@thecoshman $ is application with different fixity, and * is pretty much arbitrary here.
 
Of course I've forgot some super important operators, but you get the point
 
2:37 PM
Don't come up with something silly like >>>>> ffs
 
yeah arrows
 
@BartekBanachewicz point is, you chose bad examples, for either side.
 
@BartekBanachewicz It's not arbitrary.
 
@thecoshman what?
 
Or something like </> or <+> or whatever
 
2:38 PM
@thecoshman Did not. He chose perfectly common code on one side and the equivalent on the other.
 
@R.MartinhoFernandes Okay, I simply fail to see the relation between multiplication and ... uh, not sure what <*> is called really.
 
foo + bar vs foo plus bar is a much better example... except as always with '+' we are never to sure if it means 'add these to together in some way' or 'concatenate'
 
I might accept <$> and <*> too, in some cases.
That's really on the edge of "fuck operators" though
 
@R.MartinhoFernandes well, 'combine' is a bad example of an operator what ever way you feel about 'word' based operators. 'combine' in what way?
 
is it possible to get a function pointer from a std::function? (to interface with C code)
 
2:39 PM
@thecoshman in an Applicative way, at least in this case.
 
@gnzlbg &my_function_object
 
No.
 
@gnzlbg RTFM
 
Xeo
@BartekBanachewicz It's application under the applicative context. :D
 
2:40 PM
in Functional Programming, Apr 9 '13 at 16:53, by FredOverflow
> (_<_) is too hieroglyphic. It looks like an emoticon of someones bottom.
 
@FredOverflow bottom(_|_) -> poo.
 
Xeo
@BartekBanachewicz <*> :: f (a -> b) -> f a -> f b is like multiplication - the applicative functor distributes over ->. 2 (a + b) => 2 a + 2 b.
 
@thecoshman Would `ap` make it any easier for you?
 
If you need it so much, maybe it's better to think to forward declarations, in order to avoid compiling all the time. — Jepessen 2 mins ago
what =.=;
 
@BartekBanachewicz Don't assume multiplication.
 
2:42 PM
@R.MartinhoFernandes probably knowing the language would :P
 
Ell
@Sofffia nooo
 
@thecoshman So yeah. `ap` would actually be compilable code.
 
@Sofffia I read TFM but missed that, thanks (in other types to get the underlying pointer you use "get()").
 
Oh well thanks for two incompatible explanations @Xeo @r.m :P
 
Xeo
:D
 
Ell
2:42 PM
@gnzlbg target() doesn't always return a function pointer IIRC
 
@R.MartinhoFernandes oh I gathered that much.
 
Ell
if you've stored a lambda it will return a pointer to the lamdba. Maybe. I think.
 
Xeo
@Sofffia Meh, that's stupid.
target is pretty much useless in my book.
 
@Ell you said maybe, can't be wrong (maybe) :P
 
@Ell You’re right. The underlying thing need not be a function pointer.
 
2:43 PM
@Ell What have I done?
 
@BartekBanachewicz The multiplication sign is the symbol commonly used for the distributive operation in a ring. Actual multiplication happens to be the most well-known example of such a thing.
 
Ell
@Sofffia as xeo said, target is pretty much useless
and can't be used to get a function pointer from a std::function (always)
 
@R.MartinhoFernandes there we go.
I was expecting that TBH but I wasn't sure.
 
@gnzlbg If you always had a function pointer, that’s what you would be using. If you have a real need for std::function<Sig>, then you can’t (easily) interface with an API taking just a function pointer.
 
@Ell If std::function was initialized with a function pointer, then you get a function pointer, no?
 
Ell
2:45 PM
@Sofffia Correct, but it's not always initialized with a function pointer
 
(Additionally, that operation is also commonly known as "multiplication" even when in a generic context where it can be any suitable operation; so, in a way, you can actually assume multiplication :P)
 
int i = 0; std::function<int()> f = [i]() mutable { return i++; }; what possible function can you be pointing to from here on?
 
@Ell Of course not
 
@LucDanton I want to store a callback to a function, and pass it to C. I could use a function pointer (and might end up doing that), but my first impulse was to write std::function and call get... got a compiler error and google wasn't much of a help :/
 
Ell
@gnzlbg you'll have to write a dispatcher function which will call a std::function
 
Xeo
2:46 PM
@gnzlbg If there was a way to magically convert any type of callable into a function pointer ... man, people would be partying all over the place!
 
@gnzlbg If the API is sensible, it doesn’t take just a function pointer, but something like R(*)(void*, …whatever…) and void*.
 
Why would you use std::function if you don't want the type erasure?
 
@Xeo I wouldn't. :<
 
Ell
you hand the c api the function pointer to the dispatcher function
 
@R.MartinhoFernandes because I didn't wanted to google how to write a function pointer signature -.- and didn't wanted to thin "what if someone passes me a lambda, or a member function pointer..."
 
Xeo
2:47 PM
with typedefs
 
Technically speaking std::function<X> x; auto* y = &x; y(...); should work, right?
 
using fun = R(Args...);
fun* ptr;
 
@gnzlbg If I did std::function<void()> f = [] {}; in one TU, and do do f.get() (assuming it would exist) in another, what would you get?
 
@gnzlbg You cannot convert a std::function into a function pointer. What about the captured state?
 
Xeo
@Sofffia no?
 
2:48 PM
stateless lambdas decay to raw pointers vOv
 
Yes, they are the sole exception.
 
maybe you should ask him whether he really needs closures
 
@Xeo You would need (*y)(...)?
 
Xeo
yes
 
@LucDanton a linker error?
 
2:48 PM
@gnzlbg If people can pass you such a thing, you need to pass a (free function) dispatcher to the C API, if it has a user state parameter, and the std::function as that parameter. If it doesn't have one you're out of luck.
 
For some reasons I thought operator() was special in this regard.
 
@R.MartinhoFernandes I'll use a function pointer and if someone wants to do something fancier, it is their problem
 
Xeo
@R.MartinhoFernandes Which point on your "I will hate you" list was that?
 
Hmm, probably missing.
 
@gnzlbg The C++ compilation model may be peculiar, but it’s not quite that daft ;)
 
2:50 PM
But then, that's for C APIs.
Or stable C++ ABIs, I guess.
Nah, that can be achieved with pimpl.
 
mm, i think i don't understand fully why get is impossible tho.
couldn't the std::function give me a pointer to some internal function, that then inside does the indirection and calls whatever was stored inside std::function? (like wrapping a C++ interface in a C API)
 
@gnzlbg How do you get what was stored inside the function?
 
LIke R says, it you can only pass in one function pointer, you're shagged.
 
std::function::operator() has one parameter more than the function it wraps.
 
@gnzlbg Function pointers always point to static functions. They cannot point to non-static member functions.
 
2:53 PM
@R.MartinhoFernandes you don't get it, you just get a function pointer to something you can call.
 
Xeo
and what does that called function do?
 
@gnzlbg A pointer to which function? There is such a function for each object you can ever create at runtime?
 
@FredOverflow Either flavour of functions is stateless though, that’s a red herring.
 
Xeo
("magic" is not an acceptable answer at this point)
 
@Xeo As long as you point out that std::function is a pure library feature though!
 
2:54 PM
@FredOverflow ah! I guess this is what i was missing. Function pointers cannot point to some member function of a run-time object?
 
There is no 'this' to call it on.
 
2 mins ago, by R. Martinho Fernandes
std::function::operator() has one parameter more than the function it wraps.
 
@MartinJames so we would have to pass an object pointer with the function pointer, and it won't be just a function pointer that i can pass to C anymore :/
 
If you could get a function pointer to it (there's no technical reason you could not do so), the pointer would have the wrong signature.
The C API does not accept R(*)(std::function<R(Args...)>*, Args...).
 
@gnzlbg What does the C function pointer look like? What's the signature?
 
2:56 PM
@R.MartinhoFernandes yep, i get it now, thanks.
 
Maybe you can explicitly pass the captured context?
 
I suppose your C API doesn't have that user state parameter, then?
 
GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun )
typedef void(* GLFWerrorfun)(int, const char *)
 
Yep, screwed.
GLFW sucks.
 
@gnzlbg you're screwed
 
2:58 PM
Im moving from SFML to GLFW
 
Totally:(
 
Really, this is a definite seal of amateurishness.
 
Ell
not having a void* userdata is an absolute no-go
 
@R.MartinhoFernandes yep, i started with opengl 3 days ago
 
@R.MartinhoFernandes Yes, and it really pisses me off when I see it:((
 
Xeo
2:58 PM
@gnzlbg Not on your part. On the library author's
 
@gnzlbg No, I meant on the part of GLFW.
 
because they don't accept an extra argument?
 
Anyone who writes a C interface that sets up callbacks with no aux. context data should be fired immediate.
 

« first day (1465 days earlier)      last day (3478 days later) »