« first day (616 days earlier)      last day (4558 days later) » 

17:00
@FredOverflow oh. i thought it's like a normal switch -.-
there's nothing inherently reference-counting about COW.
@FredOverflow what about the "case 1: " case. it didn't introduce a variable
but behaved like a normal switch
@JohannesSchaublitb Normal switch has no such thing as "case some_variable", does it? Okay, it does in JavaScript, but that doesn't count :)
@DeadMG how would COW be implemented in a GC without reference counting?
@JohannesSchaublitb Right, I meant if there are variables in the patterns, then they are new variables. You cannot even say case (x, x) : (Int, Int) if you want a pair with the same number twice. You have to say case (x, y) : (Int, Int) if x == y (a so called pattern guard).
17:00
@JohannesSchaublitb By allocating new GC memory when written to?
that means you have to reallocate on every write. not really nice. if a and b are arrays that may be a performance hurt
@JohannesSchaublitb So what' new?
you can't do anything different with reference counting
hm though you could make a conservative assumption and store a bool saying "this was not yet copied" and only copy it on the first modification. if after that another reference gets to refer to the array, that bool is reset
Hasn't COW gone out of favor now that we have move semantics and concurrency?
but that's equally badly intertwining GC code in the business code as reference counting
@DeadMG no with reference counting I don't need to reallocate on every write. i only need to allocate when the variable is shared
@FredOverflow ohh i see!
17:04
@FredOverflow Nah, IMO that's mostly "COW in C++ sucks".
rather than "COW in general sucks".
@FredOverflow Yeah, COW's a bitch in multithreaded environments. Or so I heard.
one more question guys
actually, GCC does not seem to special-case strlen at all!
weird
@JohannesSchaublitb Right. You do know what COW stands for, right? Copy On Write. How can you "Copy On Write" if you don't, like, copy on write?
17:05
@JohannesSchaublitb We're gonna allow it.
@KonradRudolph it definitely does
if you pass -fno-builtins or something to it, it stops doing so
@JohannesSchaublitb Wait, lemme get back to you after using GCC instead of clang …
how do you manage type graphs in dynamically typed languages?
What is a type graph?
say you have this language construct: "(int[n])x"
17:07
@JohannesSchaublitb It doesn’t, for me
(cast of "x" to "array of n int")
@FredOverflow i mean the representation of "int[n]" in the runtime
You don't cast in dynamically typed languages.
usually in dynamically typed languages, they seem to be implemented by having type information directly in "values". but with types standing for themselfs, like a "int[n]", you have no "value" object to write that type information into.
@EtiennedeMartel i do
Ell
Ell
@JohannesSchaublitb what dynamic language do you cast in? I mean, give a language and an example?
example: you have a float and wanna cast it to an int.
@Ell ok different example. let's imagine the user can give a fixed type for a formal parameter in a dynamically typed language: "void f(int a) {}" same here: "int" stands for itself here
so are Types reference counted/garbage collected too?
Ell
Ell
17:11
write some code to show the cast, e.g. in c++ its static_cast<int>(myfloat); or whatever, but where is the cast in a dynamic language, e.g. myint = myfloat.to_i
actually, you know what, ignore me I came in half way through the convo and I haven't read back
@CheersandhthAlf if you're still here, might I ask you something? I get significant performance improvement on C++ strings for g++ if i use str2.c_str() instead of &str[0], on Ubuntu it's about 7 to 8 times faster. Could you check and see if you get the same kind of improvement on Windows?
@NikoDrašković You did measure in release mode with all optimizations enabled, right?
gist: strlen test, 2012-06-23 17:13:12Z
#include <string.h>
#include <stdio.h>

int main(void) {
    char * str = "hello, world";

    for (int i = 0; i < strlen(str); ++i
        printf("%c ", str[i]);
    printf("\n");
}
On Ubuntu, I use g++ -O3 a.cpp, is this enough?
This code does not compile differently depending on whether I pass -fno-builtin to the compiler or not
17:14
@KonradRudolph do you have optimizations on?
the only difference is that _printf is replaced by _putchar but strlen is called within the loop in both cases
@JohannesSchaublitb No, that would just remove the whole thing
The compiler is probably smart enough to figure out that str will never change. What's the big deal?
i would have expected it to optimize away the strlen
@FredOverflow That’s the point – it doesn’t figure this out, despite claims to the contrary on the ’net
17:15
@JohannesSchaublitb They don't have types in that way.
@JohannesSchaublitb With optimisations, it probably does optimise it away completely (i.e. replace it with a constant), but it’s not pulled out of the loop without optimisations
for them, an object is just (usually hash) table of name -> member
ah wait it's a pointer argument.
and if they happen to share similarities, then, well, these things le happen
guess: i think with -fbuiltin, it knows "strlen computes the length of the string", but since you have no optimizations on, it does not do any real optimizations (besides really trivial things).
if you would have done strlen("aaahaha") it would have worked
17:17
"if you had done"
@JohannesSchaublitb Well, with strong optimisations, the string literal is removed and the loop is unrolled, to print the characters one by one
but since the pointer's pointee first has to be propagated,I think GCC will first start optimizing the strlen call away with higher -O levels
@KonradRudolph ah. but i cannot imagine it to do that with -fno-builtins
With -O2, the strlen call is replaced by a constant
@JohannesSchaublitb Probably depends on whether it can inline strlen but since it’s inside a library that’s probably an LTO
@DeadMG what do you mean by "they don't have types in that way" ?
Ell
Ell
dynamic languages don't have types? just objects?
17:19
@JohannesSchaublitb Yup, just tested that, with -O2 -fno-builtin it’s not replaced
@Ell commonly
@JohannesSchaublitb They do not allow the user to create additional explicit types.
but if you start allowing the user to specify types
so the ridiculous-fish quiz is somewhat inaccurate
let's assume some language deos (i'm pretty sure they exist)
17:20
wait, I take that back, it’s a slightly different code which may be responsible for the difference observed
Would you expect drawLine(10, 10, 11, 11) to draw 1 or 2 pixels?
even with LTO, you can still override strlen with LD_PRELOAD and whatnot
Ell
Ell
If you have a language where everything is an object, you can pass types just by passing the class object
@FredOverflow I expect drawline to be inclusive, but I would accept either I think
17:21
but I guess inlining doesn't care about dynamic symbol overrides. but strlen's code isn't available either
@Ell you can pass types just by passing the object itself
@MooingDuck I'm just wondering where exactly "10, 10" is, if I think of it as an infinitely small mathematical point. Is it in the middle of the pixel? On the top left? On the lower right?
if the object stores only the toplevel kind directly. so an array object just stores "array of N elements". and the element objects will then say "int" or whatever they are
@FredOverflow it's a pixel
@JohannesSchaublitb Well, that’s your own fault then, no?
but then if you wanna be able to directly specify types explicitly that approach breaks
17:23
Should the type of the result of emplace(foo, bar, baz) be emplace_type or emplace_tuple or something else? I'm leaning towards emplace_tuple atm.
@KonradRudolph what do you mean?
if it inlines, then the user cannot replace the call anymore
that would be bad
@JohannesSchaublitb Well, if the user replaces a built-in symbol, it’s their fault ;)
And yes, once it’s inlined that point is moot
Chrome currently takes 1.6GB of RAM.
I luv this browser so much.
17:24
Yeah, me too.
"Firefox is RAM-hungry, switch to Chrome!"
@MooingDuck Ever heard of sub-pixel accuracy? You have to ask yourself: is the coordinate (0, 0) in the middle of the first pixel, or on the top left?
Ell
Ell
Ugh I hate sub-pixel accuracy - makes drawing a single pixel line a pain
@FredOverflow What's the point of these questions?
17:27
@Ell That's why Bresenham invented an algorithm.
@MooingDuck I'm thinking about writing drawLine with subpixel accuracy, and the result of drawLine(10, 10, 11, 11) would be a single pixel. Just wanted to hear from you guys how disturbing such a function would be :)
@FredOverflow as long as it's documented, that's fine.
I like inclusive ranges myself. It's just wierd to me that drawLine(10,10,11,11) is different than drawLine(11,11,10,10)
coordinate (0, 0) is on the upper left of the first pixel
17:29
@MooingDuck I'm not sure yet it would be different. They'd probably both draw the same pixel at (10, 10).
@FredOverflow oh, with subpixel accuracy that would be the case wouldn't it?
I would think so, but I won't make any promises at this point :)
@DeadMG for example Scala seems to be dynamically typed
and allows specifying types
@JohannesSchaublitb Scala is a statically typed language.
@FredOverflow drawlinw(10,10,11,10)?
17:31
I just noticed the new google doodle. It's awesome
Sometimes Scala looks dynamically typed because of all the type inference going on. But it all happens at compile-time.
Ell
Ell
magiccc
does scala have static duck typing for everything?
No, not at all.
Ell
Ell
I have never used it :L
does any language? I thought google's go did, or am I making that up?
17:34
@Ell You can read the first edition of Programming in Scala for free.
but C# is dynamically typed yes?
Ell
Ell
@JohannesSchaublitb it has both doesn't it?
@JohannesSchaublitb C#4 introduced the dynamic keyword to allow dynamic typing when it's needed. Apart from that, it's statically typed.
sbi
sbi
@KonradRudolph So say you.
Scala is nice, if you're forced at gunpoint to develop for JVM.
Otherwise, just use Haskell.
17:36
Scala isn't quite as esoteric as Haskell.
@FredOverflow so i guess C# garbage collects type objects
sbi
sbi
@sehe I don't need no external service and no login for that. It just works right out of the box with FF.
@JohannesSchaublitb Why are you so interested in Garbage Collection lately?
@FredOverflow I don't know, it's bit weird to me.
because i'm implementing C++ with GC
sbi
sbi
17:37
@FredOverflow He doesn't like to clean his apartment, so he thinks GC would come in handy.
Also not pure. :.
@JohannesSchaublitb In what context? Your own toy project? As part of a clang fork?
it's my own non-toy project. it's rocket science
@CatPlusPlus You find Scala weird, but Haskell not??
It's more syntax-heavy for sure.
Stop the damn flagging, dammit.
The meaning of : and :: is reversed between Scala and Haskell. I think Scala made the right choice.
sbi
sbi
@CatPlusPlus I have flagged for a mod to look into this. I think as long as the flag is valid, he sees who flagged.
No, they don't.
sbi
sbi
So do not invalidate it.
17:39
How can someone flag "Yes"? :)
I can't counterflag on my own message anyway.
sbi
sbi
@CatPlusPlus After it's been denied they don't.
@FredOverflow lol i'm just kidding
sbi
sbi
@CatPlusPlus I wasn't just addressing you, I was addressing the room.
They said those flags are anonymous.
And they can only see who flagged for mod.
sbi
sbi
17:40
@JohannesSchaublitb Wait. You flagged that? Again?! And you again tell us it's a "joke"?!
Are you gonna fight again?
@FredOverflow always
@sbi what's THIS!
In that case, I'll go shopping for groceries.
I hate sbi and Johannes fighting.
sbi
sbi
@FredOverflow When have we been fighting??
17:41
Didn't you kick him from the list of room owners once for some reason I cannot remember anymore? And then you started accusing one another?
Flagging is extremely disruptive to half of the chat population, and is not a fucking toy. Thank you for attention.
5
Ell
Ell
I'm getting confused over @JohannesSchaublitb. I keep thinking hes a pro but then he says something nooby. then he says something like a boss. aghh. I'll assume pro :)
@Ell He's probably bi-something, what's the word again?
sbi
sbi
@FredOverflow How can me kicking someone out be considered "fighting"?
Ell
Ell
@FredOverflow bisexual? ;)
17:42
lol no :)
BIPOLAR
Woo just in time
sbi
sbi
@FredOverflow bijective?
Do I win something?
Bee polar.
17:43
@Cicada You win all our love and devotion.
Ell
Ell
No... not bipolar :L that is a metal illness
sbi
sbi
@Cicada Us looking down our noses at you.
There was a quote by atwood earlier today on bipolarity
@CatPlusPlus polar bear
@sbi capture the flag!
sbi
sbi
17:44
@Ell That he is, too, but that shouldn't be influencing his chatting attitude.
Anyway, groceries. They don't shop themselves. Buy, erm, bye!
I hate being bipolar. It is awesome.
2
sbi
sbi
Was that you, @Johannes?
@sbi did I flag it?
sbi
sbi
17:45
@JohannesSchaublitb That's what I am asking. Did you do all this disruptive flagging?
wait. that's mean. I shall stop flagging stuff!
Why the flags?
@EtiennedeMartel dunno. seems someone is on a flagging trip
Ell
Ell
anyone know a decent free flowchart/diagramming software?
@sbi is it you who flags these things?!
Ell
Ell
17:46
ha, I don't have the burden of seeing flags
Wait, what?
sbi
sbi
The room looks so much cleaner now.
user784668
@Ell Pencil.
sbi
sbi
17:50
@Fanael That's hardware, though.
user784668
@sbi Right. What's the software, then?
@RMartinhoFernandes Providing just a T overload means that optional<std::string> o = ""; is ill-formed. optional<std::string> o = { "" }; is available however. Your take? Provide emplace construction + T + conversions?
Yes. All the text you quoted does not talk about that, while you did not quote the text that does talk about that. What's more, it's directly following the text in the spec you quoted in clause 3. I'm just surprised that you know the GCC error message talks about something else and you didn't explain how it correlates to the code. — Johannes Schaub - litb 4 hours ago
@Fanael The flesh of the finger holding the pencil is rather soft.
@LucDanton in what context?
T overload where?
ah i see.
17:52
That std::optional proposal got us thinking on where and how to provide emplace construction.
@LucDanton I hate that the C++11 semantics do not provide for perfect forwarding of "{...}"
would be so nice for things like optional<T>
Ell
Ell
The one thread-per client model will scale to 8 peeps wont it? doing not much data transfer?
@LucDanton ah new mailing?
Ell
Ell
@JohannesSchaublitb perfect forwarding of {...}?
@JohannesSchaublitb No, on one of the new groups.
17:53
@LucDanton ah neat
@Ell yes -.-
Ell
Ell
what is {...}? o.O
i still haven't fully groked how to access the new groups
Ell
Ell
just give me a google keyword if you cba to explain
i'm so confused of what the difference of that google groups to the other google groups containing the usenet dispatcher is
why they are in different "parts" of google groups
@JohannesSchaublitb The perfectest pefect forwarding takes four overloads: T, explicit U, U..., (std::initializer_list<U>, Us...). It does mean that optional<std::vector<int>> o { 1, 2 }; does the right thing. (Writing the constraints is the fun part btw.)
17:55
hmm, I think I won't fight the skeleton king with 1500 latency
At least that's the best I've found.
user784668
@MooingDuck Would you fight it with 1499 latency?
@LucDanton IMO what is needed is a way to express "pass the braced initializer list as a single argument to the constructor"
having that possibility, you would not need the std::initializer_list overload
I died
Ell
Ell
off to a party, speak later guys :) ...and gal
17:57
std::better_initializer_list<T...>?
something like template<typename T> struct optional { optional(T t{}) {} };
so that then you can say optional<vector<string>> o = { "a", "b", "c" };
user784668
@MooingDuck What are you talking about anyway?
@Fanael Diablo 3
@JohannesSchaublitb Can you emplace from that? Requires MoveConstructible, no?
@MooingDuck You sold your soul. :(
17:59
@CatPlusPlus I'd sell my soul for a cookie, much less Diablo 3
eh
D3 was thoroughly underwhelming
How can you say that? I'd have a cookie over D3.

« first day (616 days earlier)      last day (4558 days later) »