« first day (139 days earlier)      last day (4808 days later) » 

sbi
8:00 PM
@PiotrLegnica You know, I've been living without a TV now for more than two decades. From what I hear, I'm not missing anything...
 
No, you're not.
 
sbi
@TimLutherLewis So why do you have a TV?
 
The wife has a TV, I have the internet.
 
@TimLutherLewis Red Dwarf did a nice parody of that one.
 
Every now and again the BBC shows something interesting.
 
8:01 PM
 
Ah yes, I remember that :)
 
that was pretty funny
 
Good TV shows are addicting.
 
sbi
@PiotrLegnica Indeed. I have yet to find one, though.
 
I've watched exactly one tv show in the last decade
that was pretty good though
 
8:06 PM
If you don't have a TV, good luck with that :)
 
That was battlestar galactica
although to be fair, I didn't even watch that on tv :D
 
I enjoyed Lost. It was a bit silly but compelling enough.
 
sbi
@TimLutherLewis One of my daughters is following episodes of several series on youtube. Also, when I am/we are visiting relatives, those do watch TV, so I have a chance to see first hand what's common these days once in a while. I'm also quite interested in newspapers and magazines reflecting what's on TV, so I have a pretty good spectrum of informed opinions about some trends in the last two decades.
And I have a (mild) interest in football/soccer, which makes me watch the games of the European or world championships every other year, and I find what has happened to sports broadcasts in the last twenty years a pretty good reflection of what happened to the rest of TV in that time.
Finally, watching current movies or cinema ads also, to some extend, reflects the changes in the rest of the visual entertainment industry.
So I do have somewhat of an overview of what has happened and I do know the differences pretty well between today's TV and what I was watching two decades ago. And if I'm impressed with these changes, then only about the fact that people are really putting up with this shit every day.
 
@sbi: I don't understand either. I used to bemoan the lack of intelligent programming on TV (although BBC 2 & 4 are quite good these days) but now I've got the sum of all human knowledge at my fingertips every waking hour.
 
@Tim Luther: Pretty much that
why would I sit down and watch a show about programming, when I can get it on demand?
I don't watch anything on TV anymore, because it's on demand on my internets
 
8:20 PM
Huzzah for the internets! TV didn't appeal to the nerds so they made something better.
 
sbi
@TimLutherLewis Who was it that wrote: "We used to believe that a million monkeys hammering away on a million typewriters for a million years will, eventually, produce the work of Shakespeare. Thanks to the Internet we now know that this isn't true." :)
 
@sbi :)
 
ROFL
well played
some of the things available on the nets far outstrip Shakespeare
I personally think that Shakespeare is vastly overrated and have a pretty low opinion of it
 
sbi
@DeadMG Are you sitting with your eyes fixated in your chat browser window, fingers poised over the keyboard, ready to type any time? Because I don't know how else you could hammer out a reply the very moment some message arrives...
 
@sbi telepathic link
 
8:23 PM
Nobody would recreate the works of Shakespeare on the internet - they'd just repost it.
 
nah
 
sbi
@jalf And no kidding! It took @Tim 6mins until he replied to my little TV essay, and @Dead replied to him in under 60secs!
 
I just don't really have much else to do, except everything I should do
I have two screens, so
 
I told myself I'll set up Buildbot today. That was about 8 hours ago.
 
heh
I have a lot of work to do
but somehow, it never gets done
I dunno, I've been very bad about working and stuff ever since I learned to code in the most rudimentary fashion
 
sbi
8:27 PM
@PiotrLegnica have you looked at hudson? I've seen (and helped) this being set up in less than 8hrs several times.
Except now it's called...
 
I think the idea was that he hasn't started yet
 
Jenkins.
 
sbi
...jenkins?
@PiotrLegnica Yeah. That's one thing the Java crowd got right. (There might be more, but I only know that.)
 
Well, hadn't tried in a while, might as well give it another try.
 
sbi
@DeadMG I think the idea was that he'd already be done... :)
 
8:29 PM
lol
 
That is, when I'm done being lazy.
Starting something is a good start, but doesn't guarantee finishing it. ;)
 
I'm surprised at how productive I've been on my pet project lately. I'm usually terrible about procrastinating and never getting anything done too
 
sbi
@jalf Procrastinate now! Don't put it off!
 
@sbi: ROFL
 
Yay, I finally understand (concat .) . map
Oh wait, wrong chat room :)
 
8:35 PM
lol
 
sbi
@FredOverflow Oh c'mon, you're just showing off!
 
I think I drank too much wine
 
Wow, the Haskell chat room has been deserted for 10 days...
 
that's because functional programming is functionally useless
 
Functional programming without any side-effects is useless.
 
8:36 PM
more importantly
 
Which does not apply to Haskell.
 
why would I program functionally in Haskell instead of functionally in C++?
 
It's just that you have to be very explicit about side-effects in Haskell, and I like that.
@DeadMG Because Haskell has lots of features that make functional programming easier which C++ lacks.
 
I dunno, it seems to me that functional languages are as bad about functions as Java is about OOP and scripting languages are about unnecessary dynamism
like?
and what about all the parts of my program that aren't suited to functional programming?
 
Haskell has cool typesystem.
 
8:38 PM
@DeadMG Type classes, type inference, partial function application, currying, pattern matching, Monads...
 
sbi
@DeadMG One can never drink too much wine. (There is, though, I have to admit, the deplorable concept of drinking too much wine in too short time.)
 
the difference is that functions are a pretty natural building block for code. That's why you have them in OOP languages and dynamic languages as well ;)
 
how are type classes and type inference different to the available template/auto/decltype etc available in C++?
 
@sbi Is that a figure of speech? Or are you literally talking about drinking wine?
@DeadMG Type classes are somehow like C++0x concepts -- which do not exist :)
 
well
I won't argue that I would dearly love concepts
but they're hardly a game changer
 
8:40 PM
How much C++ code does it take to write a higher-order function that composes to functions?
 
how often is it necessary?
 
The Haskell code is (f . g) x = f (g x)
 
sbi
@FredOverflow Well, I have here a beer with me. But nevertheless, I do very much enjoy a glass of a Spanish Tempranillo, preferably barrique. And I'm pretty sure that, despite my advanced age, I yet haven't had enough of it.
 
@DeadMG In the context of functional programming, function composition is extremely important. FP without function composition is like OO without member objects.
 
my original point was that I find functional programming of extremely limited application
whereas OO is applicable to, well, virtually everything
thus rendering your point kind of moot
 
8:43 PM
@DeadMG I was just answering to that question. (how do I quote here?)
(How do I quote here?)
 
there's a noobie hints thing on the side
 
OO is not a panacea.
 
sbi
@FredO BTW, you might be interested in youtube.com/watch?v=6M6hvc5vZOQ. You can fast forward to 7:12. (For the rest of you: You need to be able to understand German, and need to know a certain political scandal here in Germany of the last weeks to appreciate that.)
 
of course not
 
@DeadMG Which does not contain the word "quote" :(
 
8:44 PM
but I prefer to have a more.. liberal definition of object-orientation than most
 
@sbi Not another Guttenberg video :)
 
> quote
 
sbi
@FredOverflow And OO isn't a pancake either.
 
besides
 
Looks like standard Markdown, start line with >
 
8:44 PM
@PiotrLegnica No I mean quote a message from this chat.
 
sbi
@FredOverflow Yeah, I know, but Pispers is really great.
 
OO does not have to be a panacea to be applicable to many, many things
 
Oh. Then pasting a link should do the trick.
23 secs ago, by FredOverflow
@PiotrLegnica No I mean quote a message from this chat.
 
whereas I haven't seen anything that would be done better functionally than object-orientated
 
@DeadMG Parsers immediately come to mind.
 
8:46 PM
mmm
 
@PiotrLegnica How did you do that exactly?
 
so when you have, say, a namespace in C++, that doesn't leap out at you screaming "I WOULD LOVE TO BE AN OBJECT"?
 
@FredOverflow Copy message's permalink and paste it.
 
@PiotrLegnica I don't know how to get the permalink :(
 
parsing is a naturally object-orientated process, because programs are semantically composed of objects
 
8:47 PM
@FredOverflow When you hover over the message, there's a down arrow, click > permalink.
 
@DeadMG Compile-time objects? Never heard of such a thing :)
 
lol
any technique applicable at run-time is of course applicable at compile-time, as that's just run-time of a different program
 
1 min ago, by PiotrLegnica
@FredOverflow Copy message's permalink and paste it.
I must be blind :) Thanks.
@DeadMG So how does virtual dispatch work at compile-time?
 
the same way as it does at run-time?
I mean, this is the runtime of my parser program
 
How do I create an object at compile-time?
 
8:49 PM
so it works exactly how it works at run-time
namespace x {} // parser, make me a namespace object called x
 
What are the operations on that namespace object?
 
access, x::, and extend, namespace x { ... }
at least, from the source's point of view
you'd probably need more from inside the parser
 
I suppose all those compile-time objects are immutable?
 
no
I just mutated it by extending it
 
Have you ever done any serious FP and then decided it's not worth it?
 
8:53 PM
we did a module on it at university
but I definitely struggled to understand the point
why would I want to program in a style that restricts what I can do?
 
Well, it's a lot easier to reason about programs written in pure functional languages thanks to referential transparency.
 
sbi
@DeadMG How can you dismiss something you haven't understood the point of?
2
@DeadMG Then why do you program in C++? It's a lot more restrictive than machine code.
 
Once a Haskell program compiles, the majority of silly bugs are already eliminated.
 
can machine code express templates? objects?
when you write in C++, then I make substantial gains over the preceding languages
especially in various high-level constructs
but I don't see the same benefits in functional programs
 
sbi
@DeadMG Which just goes to show that you see too little of it.
 
8:56 PM
yes, that's pretty much what I said, I've never seen any uses of it
 
The types tell you a lot more in Haskell than in C++. For example, when you see a function with the signature "a to a", you already know that it must be the identity function. It cannot be anything else.
Curiously, that gave rise to the phenomenon of "code inference", where you write the type of a function and some tool automatically infers the code for it :)
 
an identity function
how utterly pointless
 
Writing "generic code" requires far less boilerplate code in Haskell. You very seldomly have to write types.
 
the same is true of D
 
sbi
@FredOverflow I can see why one would want to question the point of that. Especially when one is a programmer, and gets paid for writing code...
 
8:58 PM
@sbi Of course, that's just a fun fact :)
 
@FredOverflow Identity function is f x = x, isn't it? :P a -> a can be a lot more than that.
 
C++ was not really designed to write non-trivial generic code, so it's no surprise that doing so is quite difficult
 
@PiotrLegnica What else could it be? I'm curious.
 
f x = x + x
 
but I don't see superior generic programming as something of functional programming, more like, a specific language
 
sbi
8:59 PM
@DeadMG I presume it's not more pointless than factorial<42>, the "Hello, world!" of TMP, or the identity template @Johannes had thrown in here once in a while.
 
Or a fold on a list of [a]
 
@PiotrLegnica Nope, type a has no + operation :) That would not be generic.
 
@sbi: I can readily see that it would be more useless
 
There are no operations you can call on a, so it must be the identity function.
 
@FredOverflow Yeah, you're right. I need to refresh my Haskell, apparently.
 
9:07 PM
I also love Haskell's list comprehensions. For example, to flatten a list of lists to a list:
flatten xss = [x | xs <- xss, x <- xs]
 
ewwww
 
Python has them, too. It's hard to see modern code that doesn't use it.
 
I'd much rather have function names in there
not just icky syntax
 
This is very close to mathematics. Are you saying mathematics sucks? ;)
 
for developing computer applications?
 
9:10 PM
/me thinks @DeadMG sounds like a php programmer right now ;)
 
yes
I think that programming languages should be programmable
 
Okay so what is your take on C++0x's lambdas, which are anonymous functions?
 
I love them
but I sure as hell wouldn't love a language built on them
 
You just said that you prefer named functions.
 
they serve a purpose, and no more
no
I prefer named functions over syntax
 
9:11 PM
I'm sorry, but any modern programmer will disagree with you on the "uselessness" of list comprehensions.
 
I didn't say they were useless
I said I preferred named functions over a syntactic approach
and by extension, I'd rather write my C++0x STL version of that than the Haskell version
 
Okay, so can you demonstrate to me how flatten should be implemented?
 
you want the super-generic version or the quickest I can write?
 
Completely generic like the Haskell one-liner.
 
so what if it's one line? code is written once, read a thousand times
note to self: if you start using your dumping project for real work, it's a hint that you need a new project
 
9:15 PM
@DeadMG Yes, and reading boilerplate code is a waste of time.
 
not really boilerplate, it's the important part, in my opinion
 
I prefer reading declarative specification-like code to reading imperative imlementation details, but that's just a personal preference.
 
Code is usually read by someone who already knows the language and its idioms, so it's not really an issue, IMHO.
Avoiding list comps in Haskell or Python would be like avoiding STL in C++.
 
@PiotrLegnica I agree. Otherwise, we would have to argue that RAII and SFINAE are terrible, because not every C++ programmer can immediately understand them.
(And thus code using those idioms.)
So how does one write flatten in C++... should one use iterators for the input? I guess so... what about the output, probably also an iterator? Or should one return a vector?
I guess coming up with a good interface is already quite hard...
 
obviously one returns a new object
 
9:25 PM
Oh wait, do I have to specify what the iterators point to? Are they iterators to vectors?
 
my compiler doesn't seem to want my template template parameters
 
@DeadMG Why is that so obvious? Do we use a vector, or do we make it configurable by the client?
 
@FredO: Ideally, you would use template template parameters, such that it's deducible
but my compiler disagrees
 
Well, you can't just say template <typename T> class container, because std::vector takes three template arguments. (But not all containers take three.)
 
nor can you take all containers using lists, as they are not maps or unordered_sets or static arrays
infact, to be completely equal, I should only take std::list
 
9:29 PM
Hm, let me think about that some more...
 
template<typename T> std::list<T> flatten(const std::list<std::list<T>>& ref) {
	std::list<T> ret;
	std::for_each(ref.begin(), ref.end(), [&](const std::list<T>& l2) {
		ret.insert(ret.end(), l2.begin(), l2.end());
	});
	return ret;
}
you know, I could make it lazily evaluate into any container
 
Here is my iterator attempt:
template <typename InputIterator, typename OutputIterator>
void flatten(InputIterator begin, InputIterator end, OutputIterator result)
{
    for (; begin != end; ++begin)
    {
        result = std::copy(begin->begin(), begin->end(), result);
    }
}
 
sure
but my call site is just
auto res = flatten(x)
whereas I'll bet that yours is a lot messier
 
Well yeah, but I'm used to messy STL algorithm calls :)
 
lol
 
9:33 PM
Boo
 
while discussing with dgregor implementation question of clang's "auto", we found a funny bug in gcc
 
Tell us more!
 
I'd like to get LLVM/CLANG working one of these days but haven't had the time - too much stuff to do, too little time.
How does it compare to MSVC?
 
@DeadMG I guess it's hard to find a conclusion here. In theory, you are right, the std::list version is more or less equivalent to the Haskell code. In practice, no C++ programmer would use an algorithm that only worked on std::list, right?
 
9:36 PM
heh
 
they are working on a MSVC compatibility mode, which would store the tokens of templates first, and only parse them when instantiating. not really doing 2-phase lookup
 
well
it's not that C++ isn't capable of doing better than that for being generic
I just can't seem to work out why it won't accept it
 
What's the code, maybe I can help.
 
ah
now it works
template<typename T, typename T1Alloc, typename T2Alloc, template<typename, typename> class T1> typename T1<T, Alloc> flatten(const T1<T1<T, T1Alloc>, T2Alloc>& ref) {
	T1<T, Alloc> ret;
	std::for_each(ref.begin(), ref.end(), [&](const T1<T, Alloc>& l2) {
		ret.insert(ret.end(), l2.begin(), l2.end());
	});
	return ret;
}
 
@Johannes: that would be ideal for me as I have a large C++ porject that I'd like to migrate to something more portable.
 
9:39 PM
whoops
I mean
template<typename T, typename T1Alloc, typename T2Alloc, template<typename, typename> class T1> T1<T, T2Alloc> flatten(const T1<T1<T, T1Alloc>, T2Alloc>& ref) {
	T1<T, T2Alloc> ret;
	std::for_each(ref.begin(), ref.end(), [&](const T1<T, T1Alloc>& l2) {
		ret.insert(ret.end(), l2.begin(), l2.end());
	});
	return ret;
}
other one has some bugs about which allocator goes where
int main() {
	std::list<std::list<int>> x;
	std::vector<std::vector<int>> y;
	auto res = flatten(x);
	auto moar = flatten(y);
}
successful compilation
 
@FredOverflow if you do template<typename T> void f() { T t; auto x = t; }, then GCC gives "x" the type T
 
About the result, not every STL container supports insert... or does it?
 
pretty sure that they do
 
std::array<> doesn't
 
even the associative containers support insert
 
9:42 PM
depending on what you consider part of the "STL" and what not
 
@JohannesSchaublitb Of course not, but that does not count :)
 
heh, true
but then, using std::array simply doesn't work on a conceptual level, so I'm not too bothered
 
I have a bit simpler, though it can't infer return type.
template <typename T, typename U>
T flatten(const U& ref) {
	static char _static_assert[boost::is_same<typename U::value_type, T>::value ? 1 : 0];

	T ret;
	BOOST_FOREACH(const T& l, ref) {
		ret.insert(ret.end(), l.begin(), l.end());
	}

	return ret;
}
 
@JohannesSchaublitb And what's wrong with that?
 
mm
I considered trying to work with something like that
but I dislike working with the STL typedefs
 
9:43 PM
@FredOverflow it's deeply wrong
 
they feel so unnecessary, it puts me off
or rather
 
consider what happens when T is U& or U const (for appropriately defined templates)
 
they feel like they're fixing a language flaw
 
I keep my STL use pretty shallow. It's banned at work for performance reasons.
 
@JohannesSchaublitb But then T t; does not compile, right?
@JohannesSchaublitb So the const and the reference should be stripped away? Not deeply familiar with auto semantics...
 
9:45 PM
auto automatically converts to value type
 
TBH, I never had to flatten the list of lists in C++ (mostly because I try to avoid them), so I wouldn't bother with the generic solution anyway. ;)
 
string const x = ""; auto y = x; should surely be just "string".
 
yeah
 
and string const& x = ""; auto y = x; should also be just "string" and not "string const&"
 
you can only save cv and reference qualifiers by explicitly using decltype
like
decltype(func()) ret = func();
else, auto strips cv and reference
 
9:47 PM
IIRC, decltype(t) would be T, but decltype((t)) would be stripped<T>::type, right?
 
so gcc gives errors for template<typename T> void f() { auto x = T(), y = 0; }
 
@Johannes: As it should do, since y is undeclared
 
(With stripped being a composition of remove_reference and remove_const.)
 
@FredO: No
 
@DeadMG huh
 
9:48 PM
@DeadMG Oh, why not?
 
I'm not too familiar with how (expr) changes from expr but it's my understanding that it adds references where appropriate
not removes
	int i = 0;
	decltype(i) x = i;
	decltype((i)) y = i;
 
@FredOverflow decltype(t) is T. decltype((t)) is U& if t is an lvalue, and U otherwise, where U is the type of the expression t.
 
where x resolves to int and y resolves to int&
I dislike that kind of thing
what benefit does that provide?
 
@JohannesSchaublitb Interesting, which section of the standard governs that?
 
an issue report that currently is being resolved changes decltype and says decltype((t)) is U&&, if t is an xvalue, and strikes the special handling of function calls along the way
@FredOverflow 7.1.6.2p4
 
9:53 PM
need a shit brb
 
good luck :)
 
@DeadMG You know this a chat room, not some where for you to leave a train of thought
 
@thecoshman Yeah, we have twitter for that.
(I suppose.)
 
a chat room is the definition of a place for me to leave my train of thought
besides,it's only because I'm drunk
I swear, I only had like two glasses, then I checked back and the bottle was empty
 
10:00 PM
@FredOverflow ah true, the worlds biggest brain fart
 
@DeadMG Sounds like a resource leak.
 
a wine leak
leeeaaakkyyyy
 
@DeadMG been their. just one glass turns out to be one bottle
 
I think I have never programmed while intoxicated.
 
me neither
oh wait
 
10:02 PM
@FredOverflow really? is amazing!
 
technically, I wrote flatten whilst intoxicated
obviously I need to move on my super-concurrent physics engine
 
@DeadMG I hope your beer didn't go flat while implementing flatten. Yeah I know, you drank wine, but wine doesn't go flat, right?
 
this wine sure has
not that I mind terribly
but oh fuck me, I'm gonna be feeling like total shit tomorrow
irritated bowel + alcohol = a bad day
 
@thecoshman Why would I? I am only drunk when I'm with other people, and watching me program is hardly their definition of party...
 
@FredOverflow well, yer not drunk, but having a few beers
 
10:07 PM
@thecoshman I don't drink alone.
 
@FredOverflow :O not even a few beers?
 
I guess programming could be interesting when combined with other drugs, though... but I wouldn't know.
@thecoshman Nope, not my kind of thing. I get "social" when I drink, and I would not want to be alone then ;)
 
sbi
@FredOverflow You never drink alone. There's always thousands drinking at the same time.
 
@sbi Thousands? I think you're slightly underestimating the global consumption of alcohol :)
 
I prefer to be in small groups
three/four at most
 
10:09 PM
@FredOverflow thousands taking a sip with you
 
@DeadMG Jim, Jack and Johnnie? ;)
 
sbi
@FredOverflow I was only including the local group. :)
 
man
lost my hero in a totally noob fashion
never play starcraft when drunk
 
I also rarely play games. Yesterday I played Minecraft for the first time. Most boring game ever.
 
Not actually had a drink in months, no cash fir it :(
 
10:11 PM
I mean, if I want to build stuff, I might as well just start Visual Studio.
 
@FredOverflow strange atraction
 
@thecoshman You play it?
I must say the youtube videos are amazing, but playing it myself just bored the crap out of me.
 
@FredOverflow a bit when I have a few seconds
 
@FredOverflow: Minecraft is great if it hooks you. My daughter plays it too much.
 
@TimLutherLewis Got heavily into for abit
 
10:15 PM
minecraft was too much perspiration and not enough inspiration for me
 
Digdigdig!
It's lego+zombies+OCD. What's not to like?
 
uh
all of the above?
 
Lego is great, Zombies are fine as long as they know who's in charge.
OCD is kind of a given for coders. At least the ones I know.
2
 

« first day (139 days earlier)      last day (4808 days later) »