« first day (1286 days earlier)      last day (3655 days later) » 

3:00 PM
well we could theoretically use TS just for the VDSL part
var f = (x,y) => x + y;
f.signature = { ins : ["int", "int"], outs : ["int"] };
this sucks as hell
oooor
 
Xeo
think of it as inverse haskell signature!
 
well I could make it so you have to click in the function signature and it's fixed (non-editable)
 
Xeo
f.signature = [Int, Int, Int], and the last one is the result (where var Int = "int")
 
@BartekBanachewicz f.signature = { ints : ["int", "int"], outs : ["out", "out"] }; FTFY
 
user1804599
lol, funny.
 
user1804599
3:02 PM
Traceur uses in and of, as does CoffeeScript, but the other way around.
 
user1804599
@R.MartinhoFernandes lol
 
user1804599
Looks like something C would do.
 
@Xeo I thought about it, but the functions might be able to return multiple values, so two arrays make more sense in this context
@R.MartinhoFernandes lol
 
Xeo
@BartekBanachewicz f.signature = [A, B, {C, D}]!
 
3:03 PM
@Xeo the "type literals" are a good idea though
@Xeo I thought about it too and I think that in the case of target users it's way more convoluted.
 
user1804599
@BartekBanachewicz wuts dat?
 
Xeo
var Int = "int";
 
user1804599
That is a good idea, indeed.
 
if I make specifying ins and outs from a GUI they would be a bit redundant though
 
Proximity programming is a good idea I think.
 
3:05 PM
there's a problem with returns though
 
Sit within 5 m of the devs one works with.
 
user1804599
Hmm.
 
user1804599
Backcalls support currying.
 
user1804599
That can lead to such confusing code. :)
 
OH I'm evil.
 
3:09 PM
Bah subtree push doesn't work
Or maybe it does and I'm looking at wrong thing
 
Xeo
@DeadMG Actually, I know of a situation when they will be heavy: When 'stream-ifying' material lists, like vector.
 
right now I reference lvalues and move rvalues.
 
Xeo
yeah, but what do you do in the case of span?
where the stream needs to be passed to both takeWhile and dropWhile
(if you implement it in terms of that, I guess)
 
Move it to one and reference it from the other.
So evil.
 
Xeo
@R.MartinhoFernandes yeah...
span([](int i){ return i <= 50; })(enumFromTo(1)(100));
Welp, this works, though
 
user3010322
3:14 PM
I can't get enough of this. <3
 
She didn't say that, did she?
 
user3010322
@R.MartinhoFernandes In my dreams, she did.
 
fuck me I'm bored =(
well I don't really mean that
 
user3010322
Fucking may or may not be an intellectually stimulating activity.
 
user3010322
3:17 PM
You might still be bored.
 
but still I'm bored
 
> f.name = "f";
"f"
> f.name
""
thanks JS
 
Xeo
lol?
 
it's apparently reserved
or something
 
what?
 
3:19 PM
see above.
 
user3010322
....
 
user3010322
Fuck.
 
Xeo
nice
 
user3010322
It just got shitty. :c
 
"name" is reserved?
 
user3010322
3:20 PM
So. When I get a call from lua, it tells me the number of arguments waiting on its stack...
 
@Abyx like so /cc @Xeo
 
user3010322
... But if I'm going to call a C++ constructor,
 
user3010322
I need to know the types passed in by Lua.
 
omg
 
user3010322
.... But I can't know that at compile-time
 
3:20 PM
@ThePhD don't mirror Lua types by C++ types
 
user3010322
It's a goddamn scripting language
 
Xeo
@BartekBanachewicz Well don't do it with anonymous functions, then
 
Python3 is the only scripting language.
 
user3010322
Maybe
 
Xeo
3:21 PM
why var f = (...) => ... instead of function f(...)?
 
user3010322
Maybe I can create a giant switch-matrix
 
user3010322
that switches on the types lua passed in
 
user3010322
But wait, there's double v. float, int v. long long in C++...
 
@BartekBanachewicz Why does f.name = "f"; not produce a slew of curses from the compiler.
 
user3010322
Maybe all C++ objects given to lua should be explicitly default constructable.
 
user3010322
3:22 PM
THat's a good compromise, I guess.
 
@R.MartinhoFernandes because javascript is a terrible language
@Xeo because the project is going to be written in ES6 so I wanted to make a PoC in it too
 
user3010322
constructors<types<>, types<int>, types<float, int>, types <float, int, double>>
 
IOW I was checking if Traceur works
 
user3010322
..... Buahahahahaha. What a fucking abomination.
 
user3010322
@Rapptz We've hit the impasse.
 
3:24 PM
@ThePhD just fuck the goddamn idea of mirroring objects :/
 
user3010322
If I fuck the idea, then I'm done.
 
user3010322
And what fun is there in being done?
 
user3010322
I'll make it work!
 
do something productive instead
 
user3010322
Already doing that.
 
3:25 PM
it's not productive
 
user3010322
I finished my final project for my classes already. All that's left are Hell Exams.
 
the fact you think it is doesn't change that in the slightest
well why do I care anyway
 
user3010322
I've got nothing to do but twiddle my thumbs. I mean, I can work on my raytracer some more and bang my head against refractions.
 
I should make input and output blocks now
 
Oh noes, toUpper.
 
3:27 PM
what about it? it's just for tests
I wanted to ensure you can't connect blue wire to orange socket
and vice versa
 
Xeo
[r = std::move(xs), curr = begin(r)]{ ... } doesn't work :<
 
user3010322
o.0
 
Xeo
r is not visible at the initialisation of curr
 
I have no idea how to make the data flow work right now though
 
Xeo
meeeeh
 
3:28 PM
@Xeo meeeh
 
Xeo
auto toStream = [](auto xs){
    using std::begin;
    using std::end;
    return [curr = begin(xs), r = std::move(xs)]() mutable -> boost::optional<decltype(*begin(xs))>{
        if (curr != end(r))
            return *curr++;
        return boost::none;
    };
};
Haha!
I actually need to move the stupid xs here, otherwise I invalidate the iterator
actually
that doesn't work with std::array. Fuck.
now that sucks
 
@Xeo Doesn't work with any container, does it?
 
Xeo
I need to get the range into the lambda first, and then get the begin of that in-lambda range
@R.MartinhoFernandes It doesn't work for std::array and SSO-std::string
all other containers don't invalidate iterators on move
 
user3010322
Uh
 
user3010322
Is there a way to call new
 
user3010322
3:32 PM
without, uh
 
user3010322
actually calling the constructor of an object?
 
Xeo
i.e., just allocating the memory?
 
@ThePhD operator new()
 
user3010322
Like, new Sexy();
 
user3010322
Yeah
 
3:32 PM
I wonder if I can safely do that recursively
I guess yes
 
user3010322
@Griwes So I have to do like ::operator new T() ?
 
@ThePhD No. Either ::operator new(size); or T::operator new(size);.
 
Xeo
void* p = ::operator new(sizeof(Sexy))
Sexy* s = ::new (p) Sexy(args...);
 
Depending on which one you want to call.
 
user3010322
I want the void pointer, I'm sure of it.
 
3:34 PM
@Xeo What a sexy piece of code.
 
@ThePhD Just keep in mind that you can have a member operator new... :P
 
user3010322
@Griwes I think I want to avoid the member operator new.
 
user3010322
Unless, uh. Can I participate with both, if the second one is present?
 
user3010322
Is ignoring one or the other bad?
 
3:35 PM
@ThePhD This can result in your code being broken (say, a type may assume it's in a special area in memory it needs...).
@ThePhD SFINAE on member's existence vOv
 
user3010322
Oh. Sounds like a hassle.
 
user3010322
I've got no problem letting weirdo's code smash upon the rocks.
 
:D
 
function run(input, node) {
    var output = node.process(input);

    if (node.type === "outputBlock") {
        node.value = output;
        return;
    }

    var connections = jsPlumb.getConnections({
        source = node
    });

    connections.forEach(connection => run(output, connection.target));
}
this should work
 
No hassle, really, just some typename = decltype(T::operator new(1)) or something.
 
Xeo
3:39 PM
Right, time to head home
 
user3010322
Desperately need a demangler. ._.
 
user3010322
GCC has one with its compiler header. Anyone know if Clang comes with a demangler for its typeid names?
 
There's probably some <cxxabi.h> thing.
 
user3010322
I got that for GCC, now I need to figure out if there's one for MSVC
 
user3010322
Ugh
 
user3010322
3:47 PM
__unDName for MSVC?
 
user3010322
Gross.
 
@ThePhD Why do you want that anyway?
There are better ways of acquiring storage.
 
user3010322
If I don't, I have to pass in the class name manually, which ruins the compile-time static identification for the class and its member functions
 
user3010322
(I'm using a static variable inside the template function to identify the class)
 
user3010322
OH
 
user3010322
3:50 PM
For the storage stuff
 
user3010322
Mostly a curiosity, after seeing some weird stuff Lua's asking me to do
 
user3010322
Double pointer argument asking. <_>
 
> Paedophile teacher abused boys
well that's his job innit so no surprise there really
 
user3010322
@R.MartinhoFernandes Particularly, I get the data from Lua, and then I have to new in the space of the user data I just created:
 
user3010322
// Allocate memory for a pointer to to object
T** s = static_cast<T**>( lua_newuserdata( L, sizeof( T* ) ) );
 
user3010322
3:52 PM
I then have to new up a fresh thing in that spot
 
@LightnessRacesinOrbit No it's not. If the teacher is doing it's job properly, it should be abusing boys and girls equally:)
 
You want to call the constructor, no?
 
user3010322
If I'm reading this right, then no, Id on't want to yet?
 
AFAIK lua_newuserdata allocates memory.
The only thing left to do is call a constructor...
Allocating more memory won't help.
 
user3010322
3:54 PM
It allocates memory for an object, but I still have to do...
 
user3010322
T* myobject = *s;
myobject = new ...
 
What? Create an object?
Guess how you create objects in C++.
 
user3010322
Like, it's given me space for a pointer
 
1 min ago, by R. Martinho Fernandes
The only thing left to do is call a constructor...
 
And you want to create a pointer?
 
user3010322
3:55 PM
Not for the object itself. And then I need to hook the new call of lua up to the constructor
 
You want placement-new, not operator new.
@ThePhD Wait what?
Why go the long way around?
 
user3010322
I could be doing this wrong, since this is my first time messing with the object table on lua. :c
 
There's literally two steps to object construction
 
Can't you just lua_newuserdata( L, sizeof( T )) and then create the object there?
 
user3010322
That's my original thought, but the lua stack has a finitely bounded space.
 
user3010322
3:57 PM
If T's big, I'm imposing a hard upper limit that changes with the size of the T that are used.
 
So you want to call a C++ constructor from Lua?
 
user3010322
Yes, but that's part of it.
 
user3010322
Whenever the object is "constructed" in Lua terms (I'm trying to get a 1 <-> 1 mapping going), I want to call the constructor. WHenver the memory is allocated in Lua for the purpose of that object, I want to allocate the memory.
 
I still don't understand why doing all this. Can't you just expose a creation function to Lua and use new regularly?
I see no reason to separate allocation from construction.
 
user3010322
4:01 PM
Reading through the metatable, I thought I was going to separate them.
 
> YS: What is the meaning of your name?
 
user3010322
But I might as well just throw them all in the same bin.
 
> Bjarne: Meaning? I don’t usually think of Danish names as having meaning, but ‘Stroustrup’ is a tiny village in Jutland, and the etymology of ‘Bjarne’ is ‘bear.’
 
user3010322
ANd just put it all in the new call.
 
4:02 PM
template<typename T, typename... Args>
T* make(Args... args) { return new T(args...); } // forward and shit
Then you just need to bind the appropriate specialisation.
 
user3010322
> ... and I was under the mistaken impression that computer science was a form of applied mathematics.
 
user3010322
Heh.
 
SetDepressed( true );
From our code.
 
user3010322
Lol.
 
@MartinJames fair point
 
4:04 PM
Sometimes I look at C++ code and think. He should have called C++, CTemplate or Templated-C
 
C with templates.
C with auto.
 
the auto thing didn't exist at the time
 
Neither did humour.
 
really :(
 
user1804599
Clusterfuck.
 
4:10 PM
@πάνταῥεῖ are you annoyed that the OP doesn't show what he's done, or are you unaware that Boost Thread is effectively a fore-shadow of C++11 <thread> support? — sehe 32 secs ago
I wonder what has gotten into him. Close-vote and all
@LightnessRacesinOrbit darn, this Josh guy has quite the eye blinders too :) i.imgur.com/ozhYAnd.png
I love how he's all sarcastic about people not being polite, when his only response was "So edit it and fix it" :)
 
user3010322
Ugh
 
user3010322
__uNDName is completley undocumented anywhere
 
@LoïcFaure-Lacroix Actually, auto was one of the earliest C++ features, but Bjarne had to take it out again due to C incompatibility.
 
user3010322
I guess I'll have to go through the UnDecorateSymbol thing with the stupid DbgHelp header
 
user1804599
@FredOverflow Compatibility with code that does not exist!
 
4:21 PM
> Let's say we have class A and class B that both have private data and are very different from each other. We want to implement copy/assignment/move constructors for both classes such that A can be constructed with private data from B and vice versa. LOLWAT
 
@sehe Panic, maybe. Exclamation marks and everything.
 
@rightfold auto x = 3.14 meant auto int x = 3.14 in C, but double x = 3.14 in early C++.
 
@EtiennedeMartel Yeah. I didn't expect this from panta-rhei
 
user1804599
Also meh, C compatibility.
 
user1804599
The only compatibility you really need is being able to import headers and use the declarations in them.
 
user1804599
4:23 PM
Fuck syntax compatibility.
 
@EtiennedeMartel you can wait for me :) ninja-edit
 
@sehe Neverrrrr
 
How about long beep; or even long long beep;? — FredOverflow 9 secs ago
 
user3010322
... , ( T::* func )( TAn... ),  ...
 
user3010322
Does that look like an okay definition for a member function thunk? (variadic)
 
user3010322
4:32 PM
It's, uh. In an argument list
 
@ThePhD You are missing the return type.
 
user3010322
Ahhh.
 
user3010322
Got it.
 
Sig Class::*
 
is there some sort of article describing why business go for brands like HP and Dell instead of getting custom builds?
I've been searching but to no avail
 
4:35 PM
Fuck abstracting databases away and shitty workarounds
 
and I'd need to pass it to someone
 
Gimme schema support for running tests tia
 
@AlexM. Support?
 
why do businesses buy anything from other businesses rather than procuring it in-house
 
Cheaper deals?
 
4:36 PM
it can be cheaper than doing it yourself, especially if there are economies of scale involved, you can be protected from negative consequences by contractual agreement or law in general, you can't get the capital you need to do it yourself, etc.
 
the usual counter-argument custom build people give is that custom builds are cheaper than the branded things
 
Assuming you only get one, maybe.
 
@AlexM. Time (= cost), support (= cost)
 
@AlexM. Also, those numbers probably ignore the support costs.
 
you might be able to build one machine for cheaper than buying it from Dell
but it's doubtful you can build and support a hundred thousand machines for cheaper.
 
4:38 PM
You also have to pay people to make the custom builds.
 
user3010322
Not everybody is into computers or has the time to build a computer.
 
And you have to pick components and hope they work well together and...
 
Can't pretend it's just hardware costs. It doesn't select and assemble itself. Yet.
 
There's a reason why it's a business, basically
 
user3010322
There's a need. Or a really big want.
 
4:39 PM
so I guess there's no article describing everything
 
user3010322
Probably not, but it's a no-brainer?
 
Dunno. It seems rather obvious to me.
 
guess I'll have to write things myself then lol
 
Why can't I precreate a test database Django why
There is TEST_CREATE setting but a) it's Oracle-specific (:lol:) b) it doesn't really do what you'd want it to do (namely drop and recreate the schema instead of the database)
 
Any new pony porn games?
 
4:41 PM
I'm so close to forking Django it's not even funny
 
user3010322
Oh, right
 
user3010322
operator() can't be static. :(
 
you say "It's not even funny", I say, "It's fucking hilarious".
 
user3010322
Hm.
 
user3010322
Let me try again...
 
user3010322
4:43 PM
Er
 
user3010322
That was poorly worded...
 
@CatPlusPlus a) lolwut
 
I have no idea
 
@ThePhD What would that mean?
 
user3010322
@R.MartinhoFernandes I wanted to explicitly access my_functor::operator();
 
user3010322
4:44 PM
But, uh. No dice.
 
Constructor is the static operator()
 
How does static matter?
 
user3010322
@CatPlusPlus ... Oooh.
 
user3010322
When you say it like that, it makes sense.
 
user3010322
@R.MartinhoFernandes lua_CFunction (messing with C function pointers)
 
4:46 PM
> <Unable to read memory>
Thanks VC debugger.
 
user3010322
@R.MartinhoFernandes Is it a templated function?
 
Could you at least show me the fucking address you couldn't read?
 
That's easymode
Where's the challenge
 
Managed to fool it into telling me it's 0xCCCCCCCC. My new favourite address.
 
user3010322
Anyhoops, I have a templated TReturn ( T::* )( TAn... ) member function pointer thunk thingymahjigger, with no name. I have a T. If given a T instance, is it possible to instance.(T::*)( TAn... ) ( args... ); ?
 
4:48 PM
@sehe haha
 
what the fuck would that even mean/do
 
Random words strung together.
 
user3010322
Call the member function with that signature on that instance.
 
"the" member function?
 
user3010322
Or, that's what I want to do.
 
4:49 PM
there could be several of them.
 
(object.*member_function_pointer)(arguments...)
 
not even imagining what would happen if templates.
 
Parentheses mandatory.
 
user3010322
If I don't have the member_function_pointer object, what happens then?
 
user3010322
I'm fucked?
 
4:49 PM
Then there's nothing you can call.
 
what did you intend to do without it?
 
You're not making a lot of sense.
 
user3010322
Like, I have object and arguments
 
you have no idea what member function you want to call.
 
And you want to call any random function?
 
4:50 PM
how could the compiler possibly know what member function to call.
 
There's no "call-whatever-works" operator.
 
user3010322
Arrgh. I'm doing a bad job. :c
 
call-some-random-shit
 
user3010322
I have the member_function_pointer thing, BUT when lua calls me back it's from a C function: I lose member_function_pointer object itself (but I still have all the type info). I was hoping that would be enough to call the right member function.
 
you need to know what function you want to call as well as what the signature is and what object you want to call it on.
 
4:52 PM
Here's some type info: int. Guess what int I want.
 
user3010322
Okay... is there a compile-time version of member_function_pointer I can keep around?
 
Given struct foo {}; int (foo::*)() is a valid type, even though it has only a single inhabitant.
 
you need a function's address to call it, whether it's a member or not
 
@ThePhD What? No. Just don't lose it.
 
user3010322
Okay then...
 
user3010322
4:53 PM
... This is impossible without a macro.
 
user3010322
If I can't name the function using template information, then I can't do this without using the text-pasting of a macro.
 
I don't care, sorry.
 
user3010322
OH
 
user3010322
MEMBER FUNCTION POINTERS CAN BE COMPILE-TIME AND PASSED THROUGH TEMPLATES
 
user3010322
Duh, I proved this before. I'm saved!
 
4:56 PM
I like it when SQLAlchemy produces a query like "SELECT ... FROM ... WHERE 0 = 1". Just wonderful.
 
there is no such thing as a compile time pointer ^^
 
user3010322
There are compile-time member function thunks.
 
Does VS delete the copy ctor if you explicitly delete the move one?
 
@Drax Yes. But member pointers are not pointers, so those two statements do not disagree.
 
Wait what.
 
user3010322
4:57 PM
Uh, I don't think so.
 
I realised how dumb that is, but question still stands in the name of curiosity.
@Drax Why not?
 

« first day (1286 days earlier)      last day (3655 days later) »