« first day (623 days earlier)      last day (4334 days later) » 

3:00 PM
@DeadMG Wait, wait, what are x and y?
 
@EtiennedeMartel Range and iterator, respectively.
 
@JohannesSchaublitb That's neither call by name nor lazy evaluation, that's just currying :)
 
hm wait now I confuse this. it was the nullary function thing that made pass by name work
 
Call by name is weird.
 
@DeadMG Oh, well, .NET has both IEnumerable and IEnumerator, and the usual approach is to put in the enumerator a reference to its parent enumerable.
 
3:01 PM
def f(x: => Unit) = if (randomChance()) x; else 42;
^ this is an example for lazy evaluation; x will only be called if randomChance returns true
 
And you say Scala has less confusing syntax than Haskell.
 
@EtiennedeMartel Yeah. That's not quite so trivial for function-local types.
 
Ell
woo thunder :D
 
Poo thunder.
 
Ell
anyone know a way to send a large file over the internet without going through a server? peer 2 peer style?
 
3:03 PM
@Ell BitTorrent
 
Ell
actually I suppose I can host my own torrent
 
types in Wide don't have to obey declaration/definition like in C++
 
Ell
I'll look into that now
 
but when you specify them at the function level, then they obey the same rules of definition orders as any other variable
making it less trivial to define types which have interdependent relationships
 
@CatPlusPlus Well, Scala syntax feels a bit less strange than Haskell if you're used to the classic imperative languages. What do you find confusing about it?
 
3:04 PM
x: =>
 
def foo(x: Unit)      // this is call by value
def bar(x: => Unit)   // this is call by name (lazy evaluation)
foo(a + b)   // a + b is evaluated once by the caller
bar(a + b)   // a + b will be evaluated by the callee each time it is needed
 
@EtiennedeMartel Did you also notice my sexy tuple mapping?
{1, 2.0, "Hello, World!"}.Map(function(x) { Standard.IO.Output(x); });
 
@DeadMG Yeah.
Well, a tuple is a container, after all.
 
@DeadMG What is the parameter type of function in that case?
 
@FredOverflow Template.
 
3:10 PM
So you have polymorphic lambdas? That's quite sexy and novel!
 
well, it can certainly lead to some useful scenarios
let's face it, you guys would kill me if I specced a new language where you had Standard.Algorithms.ForEach(Container.Begin(), Container.End(), function(Type x) {... });
 
Ell
haha
 
@FredOverflow I see what you did there.
 
@EtiennedeMartel I don't.
I mean, I get it that I hardly invented the concept personally
but I don't see that it's sarcasm-requiring-ly unuseful or something
 
@DeadMG Yes, I'm so tired of .begin() and .end()!
13
Q: What is the status of ranges in C++?

FredOverflowSometimes I get tired of all this my_vector.begin(), my_vector.end() noise. Last year at boostcon, Andrei Alexandrescu's keynote speech was titled Iterators Must Go (video) Is there any progress on introducing ranges into C++, so I can finally say std::sort(my_vector)?

 
3:15 PM
That Oven library looks nice.
 
Wait, if tuples are containers, what is their value_type? Obviously, your definition of containers differs from C++'s notion of containers.
 
@FredOverflow Is that a problem?
 
Does anyone know if I can target just directories in a Makefile? I want to make a target that matches multiple directories, like so dir/%:, but I want to make it skip files...
 
Wait, function(x)? Did you change your lambda syntax from C++11 to JavaScript?
@EtiennedeMartel no, just an observation
 
It might be std::pair<T, std::tuple<Rest>>.
 
3:16 PM
@FredOverflow I have no need of such things.
 
But really, who cares about C++ notions.
 
@FredOverflow Lua, actually- but JavaScript is really just Lua with bullshit bolted on.
 
@DeadMG Did C++ have the need initially because of missing auto?
 
@FredOverflow Yes- and decltype.
 
@DeadMG What about capture lists, Wide doesn't need them?
 
3:17 PM
in C++11 the need for many member typedefs is completely eliminated.
@FredOverflow I need them for the same reasons C++ does.
I just didn't need one for these specific examples
 
@DeadMG Okay so what's the syntax for a lambda that captures everything by reference by default, but catches x and y by value?
 
@FredOverflow Right now, it's gonna be function(x)[&, =x, =y]{ stuff }
but the capture list is grammatically very unambiguous and I can change it to almost whatever I want.
 
Also, do you have other capture modes besides by reference and by value? Like capture by name or capture the flag?
 
@FredOverflow Actually, I do.
you can say [&, x := expression] to capture some expression by value, rather than an explicit name
 
Does Wide have move semantics?
 
3:20 PM
this closes some holes in the C++ model, where you couldn't, for example, move into a lambda, but in Wide, you can do [&, x := Move(uniqueptr)]
@FredOverflow Yes.
wtf else am I gonna do, copy all over the place? :D
 
Can you "capture by move"?
 
@FredOverflow See above.
 
user784668
Hai guise.
 
@DeadMG Sorry, I must be blind. Cool.
 
[&, x := Move(uniqueptr)]
 
3:21 PM
@Fanael Hi, flower dude.
 
So, move semantics... more or less the same as in C++11? Rvalue references?
 
@FredOverflow Give or take. The inference rules are different.
for one, as you can tell, function parameters and return values can be inferred
also, function-local variables are now always auto&&
 
Damn, the Montreal Jazz Fest began two days ago, and I didn't even look at the program.
 
for sanity, though, I had to leave type member variables as auto by default
 
Ell
hmm seeding is not working :S
 
3:24 PM
also, I introduced a feature where you can see before collapse
@Ell Firewall, probably.
 
@DeadMG I think type inference should always be the default, with the ability to specify a type if needed.
 
Ell
right kk i'll check
 
@EtiennedeMartel There are some places where types cannot be inferred.
but apart from that, it's always-inference
 
user784668
Are we discussing Wide again?
 
INFER ALL THE TYPES!
@Fanael Yeah.
 
Ell
3:26 PM
hmm still not working
 
user784668
@EtiennedeMartel -> Haskell
 
"but the template member function will not." I don't think that is true. The spec says that such members are instantiated too. It is just that many implementations (including modern ones like Clang) will not instantiate the member template definitions. That's a conforming deviation, because if the member template definition contained an error, the member template definition would be "ill-formed; no diagnostic required". For Clang, the reason they don't instantiate member template definitions is performance - they would need to typecheck a lot more then. — Johannes Schaub - litb 3 mins ago
 
@FredOverflow In fact, I don't even have member typedefs. Or member constexprs or anything like that. You can introduce them if you want, but they don't exist by default.
 
Ell
@DeadMG if I can dl torrents, does it mean I can seed them? firewall wise I mean
 
@Ell No.
firewalls typically permit outgoing connections but block incoming ones
 
3:31 PM
It's mostly NAT issue.
Personal firewalls usually only block ICMP by default.
 
Ell
I have port forwarded, and firewall seems okay
 
(and not just us, for it seems everyone has the same issues)
 
@FredOverflow Delayed reaction much?
 
I'm new to this meme generation thing :)
 
3:40 PM
lol
 
That's one cool logo.
 
INFER -> ALL THE TYPES would have been the "idiomatic" meme in this regard
 
Apparently, I need to read "Effective memes".
 
That would be a good book to write.
 
3:42 PM
well, look
 
Ell
learn memes in 24 days
 
every meme takes a simple form, it's like a function
this one is like function(x, y) { return x + "\nALL THE " + y; }
and it's like, "I performed X on every Y in existence"
 
@DeadMG I'd say more like return x.ToUpper() + "\nALL THE " + y.ToUpper();
 
@EtiennedeMartel Very true (although my String class possesses no such method).
 
@DeadMG I'm a C# programmer, remember? But, yeah, good idea. Interface bloat is a bitch.
 
user784668
3:44 PM
@EtiennedeMartel \x y -> map toUpper x ++ "\nALL THE " + map toUpper y
 
@EtiennedeMartel Well, imagine that poor Java programmer who has to write the Unicode Rope class.
 
@DeadMG He's a hero.
 
so in Wide, I made one that simply took a range of Unicode codepoints.
 
i didnt know Java has a rope
 
user784668
@JohannesSchaublitb Java has only enough rope to hang yourself.
 
3:46 PM
Well, there are external libraries for Java "like boost".
 
@JohannesSchaublitb Yeah, to hang themselves with.
 
@JohannesSchaublitb It doesn't. But the point I'm making is that if you tried to write one, you'd be quite fucked because all the Java Unicode APIs are tightly coupled to their String class.
 
Why would you even need a Rope in Java?
 
3:47 PM
@DeadMG I wonder, what more services do a string need to offer compared to a vector of characters ("character" being unicode code points in this case).
 
user784668
And what do you mean by Rope?
 
In computer programming a rope, or cord, is a data structure for efficiently storing and manipulating a very long string. For example, a text editing program may use a rope to represent the text being edited, so that operations such as insertion, deletion, and random access can be done efficiently. Description A rope is a binary tree in which each node has a weight. Leaf nodes (as well as some single-child internal nodes) also contain a short string. The weight of a node is equal to the length of its string plus the sum of all the weights in its left subtree. Thus a node with two child...
 
@EtiennedeMartel Primarily, validation and preservation of undefined Unicode encoding.
 
@DeadMG That does make sense.
 
if you had vector<codeunit>, you could easily violate whatever the rules are for your UTF format.
but you are correct in that it is primarily a storage solution akin to vector<codeunit>
in addition, in Wide, the implementation's UTF is undefined, so on Linux you can have UTF8 and Windows UTF16
 
user784668
3:50 PM
@FredOverflow chat.stackoverflow.com/transcript/message/4337296#4337296 made me doubt if that's the rope you're talking about.
 
@Fanael Why?
 
user784668
Dunno.
 
a rope is an (albiet specialist) container
a range is a container abstraction
 
@FredOverflow That can't be right. A rope is a language feature for hanging yourself.
 
user784668
@Mysticial +1
 
3:52 PM
@Mysticial Does Java have a language feature for hanging yourself?
 
@Mysticial GG
@FredOverflow It is a language feature for hanging yourself.
 
user784668
@FredOverflow All of them. It's Java.
 
@DeadMG Java is a language feature?
still need to read this someday
 
user784668
@FredOverflow Being Java is Java's feature.
 
@FredOverflow Oh my god.
 
3:54 PM
I think we should give credit to Java for giving us the JVM.
 
@FredOverflow Yeah, the JVM is great.
It's a shame that Scala, Clojure and Groovy never gained more traction.
 
They probably will someday :)
 
Let's hope so.
 
user784668
@FredOverflow CLR
 
3:56 PM
@Fanael Not as portable.
 
@EtiennedeMartel Although I'm skeptical when it comes to Clojure taking off. I just can't stand looking at all those parenthesis.
 
user784668
@EtiennedeMartel Then port it. Mono shows it's possible.
 
Where I work, we mostly do games with a freemium model, so we need an infrastructure to handle the microtransactions. Our engine is in C++, our tools in C#, and the servers all run Java.
 
user784668
@EtiennedeMartel Poor servers.
 
well
 
user784668
3:57 PM
@FredOverflow Clojure's a Lisp?
 
it's 5pm, a whole 20 hours after I woke up
 
@DeadMG Time to get drunk!
 
Clojure (pronounced like "closure") is a recent dialect of the Lisp programming language created by Rich Hickey. It is a functional general-purpose language. Clojure time-handling constructs simplify multithreaded programming. Clojure runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines. Like other Lisps, Clojure treats code as data and has a sophisticated macro system. History Rich Hickey is the creator of the Clojure programming language. Before Clojure, he developed dotLisp, a similar project based on the .NET platform. Hickey spent about 2½ years workin...
 
time to solve the Halting problem
4
for all inputs, DeadMG always halts right now
 
@Fanael Honestly, the JVM is rock solid.
 
user784668
3:59 PM
@EtiennedeMartel But they run Java.
 
@Fanael No, they jit Java bytecode into machine code.
And optimize it while they're at it.
Sure, it eats RAM like hell, but it's a server, it's not like it got anything better to do.
 
user784668
@EtiennedeMartel They interpret a JVM written in Java bytecode that interprets itself interpreting the server software.
 
user784668
@EtiennedeMartel Servers always do.
 
@EtiennedeMartel But you could fit more server instances if each instance didn't eat so much ram! :-)
 
@Fanael Most JVMs are written in C++.
@Insilico Most instances are VMs anyway.
 
4:00 PM
@EtiennedeMartel I thought it was a mix of C and C++.
 
@Insilico Yeah, well, "ugly pre 98 C++".
 
user784668
@EtiennedeMartel I know. Isn't it obvious I'm kidding?
 
@Fanael Yes. BUT I WON'T BACK DOWN.
 
Ell
what is the best compilation model?
 
@Ell Whatever's not C++'s compilation model.
 
user784668
4:02 PM
@Insilico …nor C.
 
Seriously, anything is way better than C or C++'s compilation model
But it's especially painful in C++
 
@Ell any compilation model without header files
 
user784668
@Ell Bacon.
 
I wonder if that's one of the reasons why the Boost libraries are almost always header-only.
 
@Insilico Does any other (high-level) language allow for crazy IPO?
 
4:03 PM
@Mysticial IPO?
 
interprocedural optimization
 
user784668
@Insilico Intraprocedular optimization?
 
@Insilico Header-only is a must for templates.
 
@Mysticial Doesn't Java and/or C# do IPO on the fly?
 
Yes, the JVM has the ability to inline function calls on the fly, if runtime measurements indicate that it makes sense to do so.
 
4:04 PM
@Insilico I dunno.
I know inlining for sure.
Though I'm wondering, if C/C++ didn't have such a messy compilation process...
 
@FredOverflow True, which makes the C++ build process more painful.
 
user784668
@Insilico C# is often AOTed, no "on the fly" there.
 
would it take any longer to compile things.
 
user784668
@Mysticial Wait for C++3x and see for yourself.
 
Because you can do partial compilation. Since you link separately.
 
4:06 PM
@Mysticial Depends. If your code is basically wanking all over templates then that might increase compilation times even if you had a noncrappy build system.
 
user784668
Interpreting a Turing-complete language isn't going to be fast anyway.
 
@Insilico Hmm... that aside.
Suppose I'm working on a million line project: one in C++ and one in Java.
And I make a tiny change to the program and rerun.
In C++, you need to recompile just that one module and relink everything.
 
@Mysticial That's a toss up IMO
 
In Java?
 
user784668
@Mysticial You forgot to build.
 
user784668
4:07 PM
@Mysticial Rejit whatever the JIT feels like.
 
@Fanael Good point.
 
user784668
@Mysticial Unchanged things may be in JIT cache, for example.
 
I read some study that C++ can achieve the best performance (out of the few languages the study uses) but requires a bit of tuning by the programmer to achieve that.
 
Right now, I have a 150k line project that takes about 5 min. to link completely.
 
Or a lot of tuning, depending on how smart you are.
@Mysticial Your compiler doesn't do incremental link?
 
4:09 PM
@Insilico Visual Studio, is it enabled by default?
 
@Mysticial Only for Debug builds, I think, by default.
Release builds always do a full link, IIRC
 
Right now, I've solved the problem by pulling the bulk of the code out into a .dll
 
user784668
@Mysticial But even if they didn't change, the optimized binary may, because of devirtualization, changed branch likelihood or other PGO-like stuff.
 
@Insilico Oh... that isn't gonna work. Since Debug builds are more than 10x slower.
 
In my experience the structure of your files and the code in it actually make quite a difference.
@Mysticial I think you can do incremental link with release builds
It's just not the default.
Lemme check
 
user784668
4:11 PM
@Insilico Incremental link has some performance penalty IIRC.
 
Actually the incremental link option is the default, apparently.
 
It's disabled for Release.
I haven't tried to enable it for Release.
 
@Mysticial Yes, but that's because of Visual Studio's options, not because it's the default for the linker itself.
 
user784668
@Mysticial It should work. Be prepared for lots of calls to jmps, though.
 
@Fanael A tiny performance penalty is fine. I don't mind the function call overhead between different modules. As long as all the tight loops are fully optimized it won't result in a 10x penalty.
 
4:13 PM
@Mysticial I don't see anywhere in the docs that says you can't do incremental link with "typical" options
 
In some sense, I'm using "Release" as my debug build. And I use ICC as my final builds.
 
(e.g. optimizations enabled)
@Mysticial Try incremental link for release and see how that goes.
 
So I don't mind a tiny performance hit for "Release builds".
@Insilico Guess I'll try that now. lol
 
@Mysticial ICC == Intel C++ compiler?
 
@Insilico yeah
 
4:15 PM
ICC does some crazy optimizations that VC++ nor GCC does.
 
user784668
@Mysticial So it's an optimized debug build, not a release (=final) build :P
 
And this is that Pi program btw. Nothing else I've done comes anywhere near 100k lines.
 
user784668
@Insilico Like?
 
@Fanael Yeah, I don't mind 10% hit. But 10x is too much.
My normal compilation runs take about 10 seconds each (under full optimizations).
So I can't tolerate 10x penalty of Debug.
 
1894
A: Why is processing a sorted array faster than an unsorted array?

MysticialYou are the victim of branch prediction fail. What is Branch Prediction? Consider a railroad junction: Image by Mecanismo, from Wikimedia Commons: http://commons.wikimedia.org/wiki/File:Entroncamento_do_Transpraia.JPG Now for the sake of argument, suppose this is back in the 1800s - before...

> Intel Compiler 11 does something miraculous. It interchanges the two loops, thereby hoisting the unpredictable branch to the outer loop. So not only is it immune the mispredictions, it is also twice as fast as whatever VC++ and GCC can generate! In other words, ICC took advantage of the test-loop to defeat the benchmark...
 
4:18 PM
I can only hope for that question to retain a high residual rate... now that the excitement has finally died down.
 
ICC does optimize very well. It's almost as if Intel also made processors...
9
Oh wait.
 
lol
 
@EtiennedeMartel YOU DON'T SAY.
 
user784668
@Insilico GCC knows how to interchange loops, but it apparently doesn't do that for this code.
 
@Fanael Yeah, I'm aware of the loop interchange thing. It's just that ICC apparently knows how to do it for more cases
 
user784668
4:21 PM
@Insilico Well, Graphite is still kind of work in progress in GCC. They don't enable it by default.
 
@Insilico Although I've studied loop-interchange in one of my classes, that snippet was the first example where I've seen a production compiler do it.
 
@Mysticial Loop interchange is kind of an old idea, isn't it?
 
@Insilico I dunno. I've never paid attention to when these things were invented.
 
user784668
@Mysticial: is your avatar Rio Kazumiya?
 
user784668
@Insilico Most optimizations are. The problem is the most interesting ones were regarded as too expensive until recently.
 
4:23 PM
@Fanael :)
 
user784668
@Insilico I compiled that code both with and without -floop-interchange and compared the assembly. Effect: files A and B are identical.
 
Dammit, my optimizations options conflict with increment linking...
oh whatever... my manual split into .dll works as wonders right now
 
@Mysticial So /INCREMENTAL doesn't work with /O3?
Or is it because of /LTCG?
 
@Insilico MSDN lists a whole bunch of things that automatically turn off incremental linking. Nearly all of them are enabled.
 
Oh, okay.
I guess it's back to splitting up into dlls then.
 
4:28 PM
@Insilico I did that a while ago. The entire pi-program (currently) is 277,987 lines of code.
I pulled 188,593 lines into a separate .dll.
 
user784668
@Mysticial Don't you think it should be 314,159 lines of code?
 
That's all the back-end bloody optimized stuff which take forever to compile and link.
All the front-end stuff (which is what I'm working on) is easy to compile.
@Fanael lol
 
@Fanael No, it should be 271,828 lines of code just to be ironic.
 
Ell
so who wants to start a gui library with me yeahhh? what with kyrostat needing one and shiz?
 
user784668
@Insilico 141,213 to be even more ironic.
 
4:30 PM
@Ell I have a GUI library, but it's shit.
Better than Qt or WxWidgets though.
 
Ell
@Insilico whats wrong with it?
 
@Ell Well, you see, it's something I develop on an "as needed" basis. :-)
 
Ell
right, are you part of the kyrostat team or whatever it's called?
 
@Ell No, because I'm too lazy to ask.
 
Ell
I'm not either :L
but I also need a gui library for opengl
well ogre, but you know games and stuff
 
4:32 PM
@Ell Ahh, then I can't help you then (my GUI library sits on top of the OS's native controls)
I might get around and build a library using "lightweight" components a la Swing but better and it won't look like Java.
 
Ell
ohh I see, howcome you didn't go for an existing one?
 
@Ell Because the existing ones are shit. :-P
 
Ell
they are :(
so is everything else >.<
 
Also it's an interesting learning experience.
And let me tell you, library design is hard.
I think I threw away huge parts of the code at least 10 times now.
 
Ell
I know :/
I can't even programme :P
 
4:34 PM
@Ell Oh, the writing part wasn't the hard part.
The part where I use the keyboard to write the code is easy.
 
Ell
the design specifically?
 
Yes. The design.
 
Ell
yeah
 
You come up with one design, then when you actually go try to use it you find out it's total shit.
My very, very first design had message maps in it (simply because MFC, wxWidgets and ATL did it)
 
Ell
well a gui is fairly suited to a plain OOP design isnt it? one class = one control. every control has x, y, width, height
use boost::signal for eventing
 
4:35 PM
@Ell The devil's in the details.
 
Ell
bish bash bosh, simple easy and usable, right?
 
That's what's really frustrating about it.
 
Ell
@Insilico what kind of details are we talking about?
 
@Ell Like how do you "glue" your code with the operating system
 
Ell
actually I've not figured a design out for how skinning would work
yeah
 
4:36 PM
Should you allocate everything on the free store, or make them class members.
Should this be one class, or two classes?
blah blah blah
 
Ell
can I have a specific instance of an issue you have encountered?
 
I've tried making message map macros but they were a pain in the ass so I quickly scrapped that.
 
Ell
I have nothing to do today so I need things to think about :L
 
@Ell I think one issue I ran into was about lifetimes of the Window objects.
I had it such that the lifetime of the HWND was tied to the class object
(i.e. DestroyWindow() in the destructor, CreateWindow() in the constructor)
 
Ell
@Insilico surely that is fine?
 
4:39 PM
@Ell It was, if the window was by itself.
 
Ell
yeah
 
When the window is part of a hierarchy of windows, it got way more complicated.
(i.e. child windows, parent windows)
 
Ell
hmm
 
When you DestroyWindow() a parent window, it also destroys the child windows
So you had "zombie" child window instances.
 
Ell
that makes sense to me?
zombie?
ugh I'm sorry I have to eat dinner :L I will be back soon to continue the discussion :)
 
4:40 PM
Like the destructors were supposed to be the only thing that called DestroyWindow().
But there were other parts of the code that was calling DestroyWindow() on my windows (namely the parent windows)
 
user784668
How many times do you have to call DestroyWindow to make Windows unbootable?
 
@Fanael An infinite number of times? You can't actually make Windows unbootable via DestroyWindow(). :-P
 
user784668
@Insilico You borked my lame joke.
 
@Fanael Yes. Because it was lame.
 
user784668
@Insilico Good lame jokes are good because they're lame and good.
 
4:49 PM
@Fanael No. Good lame jokes are good because they are good. :-P
Yours was not necessarily a good lame joke. :-P
Wow I've been running my UTF-8 converter benchmarks on Debug builds. -____-
 
user784668
I wish compilers had options that pessimize the code instead of optimizing it.
 
@Fanael You can just insert a bunch of nops. :-)
 
@Fanael One way to pessimize it is with -fno-inline.
 
user784668
@Insilico It's not that much of a pessimization (they only take time to decode, not to execute, better to insert some nop-like movs and leas), and it'd be nice if compilers could do it automatically.
 
@Fanael Perhaps you can structure your code so that it completely destroys branch prediction.
 
user784668
4:55 PM
@StackedCrooked It's disabling an optimization, not enabling a pessimization. I want to get code that worse than what I'd get with -O0.
 
@Fanael It is worse than O0. Copy elision (RVO) is also enabled by default btw.
 
If you keep fooling the branch predictor the processor would have to flush the pipeline every time.
 
user784668
@StackedCrooked No, -O0 inlines nothing except __attribute__((__always_inline__)) anyway.
 
@Fanael You can do what the OP did in this question:
1059
Q: Why is processing a sorted array faster than an unsorted array?

GManNickGHere is a piece of code that shows some very peculiar performance. For some strange reason, sorting the data miraculously speeds up the code by almost 6x: #include <algorithm> #include <ctime> #include <iostream> int main() { // generate data const unsigned arraySize =...

 
user784668
@Insilico That, again, is disabling optimization (or, in this case, what's possibly an optimization).
 

« first day (623 days earlier)      last day (4334 days later) »