« first day (668 days earlier)      last day (4272 days later) » 

5:00 PM
@DeadMG you're assuming that it's possible to retrofit RAII to a C++ API
 
@CatPlusPlus But a compilation failure is also desirable, though.
 
@ecatmur All C++ classes have destructors, and all callers will call those destructors. Whether those destructors are trivial or not is irrelevant.
if you change your destructor to be non-trivial then nobody is broken, it's an implementation detail.
 
@R.MartinhoFernandes Yes, but I'm trying to tell you that it's extremely rare in dynamic languages to actually need this sort of stuff.
 
Nobody except those using it as a POD.
 
@DeadMG Not if you have a function-oriented API.
 
5:01 PM
@R.MartinhoFernandes Well, if you document it as a POD then that's your own stupid fault.
 
So, yes, if you suddenly change your class to manage deterministic resource then it's major change.
 
@ecatmur ...... what?
@CatPlusPlus Dynamic languages need to manage just as many files, window handles, and GPU buffers as anyone else
 
In any case, I find that a pretty weak argument. I doubt that kind of change happens more than once in a blue moon.
 
what about generic code?
do you with it or don't you?
 
What generic code?
If I have a function that uses file-like object, I assume it's already open and that it's not my problem to close it.
 
5:04 PM
right
but what if you have a function that takes some other object of unknown type?
 
It's the caller's choice how to handle it.
 
@DeadMG still the callers job to handle it
 
You only need to handle what you create.
 
@DeadMG I think your argument only holds if you need to construct/allocate/destroy/deallocate an unknown type.
 
so you can never write any Python code that takes any object of unknown type beyond the current call stack.
 
5:06 PM
What?
 
@MooingDuck Something which, in case you hadn't noticed, is rather common.
 
What?
 
@DeadMG except for containers, I don't think I've ever done it
 
How much Python code did you write?
 
@R.MartinhoFernandes Well, you said the caller should handle it. But if you keep the object after you return, then how can the caller handle it? They've probably returned themselves and can't handle it.
not to mention, say, concurrency
although, do I remember correctly in thinking that Python is basically enforced serialized anyway?
 
5:07 PM
Eh, whatever. I don't even know how to explain this. You don't write other languages like C++, it should be fairly obvious.
 
Hmm
 
so the built-in data structures are absolutely perfect for every single task and nobody, ever, would want to implement something a little different?
 
Which kind of project would Haskell be fit for ?
 
Language processing.
 
@DeadMG Usually, yes.
@kbok Any kind of project.
 
5:09 PM
that kind of thinking leads to Java.
 
Java has no built-in data structures.
 
no, but it is rigid.
because James Gosling said "You should do it this way" and the language enforces that.
 
Also, not that there are no other data structures. But if you have built-in hashmaps and built-in arrays, you rarely need to not use them.
And tuples.
Plus, deques and other less common stuff in the standard library.
 
so how does a deque of files work?
or does it just not work?
 
Why wouldn't it work?
 
5:12 PM
because you need to with a file to make the deterministic destruction work
or do you just pray that you remembered to call cleanup correctly on every exit point?
 
There's try..finally, too, if you really need it.
 
how glorious, finally whoring
 
@CatPlusPlus Ugh, exceptions.
 
I'll get back to you on solution on that when I have a problem with deques of files, because I never had.
 
@Drise Exceptions are horrific, terrible things.
 
5:15 PM
@CatPlusPlus brb doing any kind of stuff then
 
but better than the only known alternative, error codes
 
@DeadMG Yes, but still.
 
Monads.
 
I have been here nearly 3-4 months now. I still don't know what a monad is.
 
@CatPlusPlus I read about the Error monad and as far as I can tell, it's "We wanted exceptions but just having them didn't involve enough mathematical wankery, so we wanked around a lot and then took exceptions under another name"
 
5:17 PM
@DeadMG Haha, wank.
 
Most of the time you only need Either/Maybe.
 
@DeadMG Nope, missing the point.
It's more like "We wanted exceptions and we already had this nice feature built into the language that kind of makes it clean, so we used it instead".
 
@R.MartinhoFernandes Quaternions suck. I have proof.
 
@Drise Everybody knows what monads are; most just don't realize that they know it.
 
I have said that before today... <- ambiguous
 
5:19 PM
@rubenvb I was eagerly awaiting said proof the first time already.
 
@R.MartinhoFernandes Most of the other monads I've seen have been unnecessary too, so I'm beginning to miss the point of monads.
 
@R.MartinhoFernandes two words: geometric algebra.
did you know quaternions define a left-handed coordinate system?
 
I mean, correct me if I'm wrong here, but aren't both List and IO "INSERT LANGUAGE MAGIC HERE" monads?
 
and do you know how sucky left-handed coordinate systems are?
 
WHAT I MONAD? IT OUND LIKE TETICLE
 
5:21 PM
wow. Khtml is unable to render the dropbox website...
 
@DeadMG Lists are monads because they can meet the monad laws, not because they were forced into it.
Their monadiness isn't used that often if it bothers you.
 
well, I think more relevantly, I really don't see the purpose of it
the IO Monad is language magic, the Error monad is exceptions under another name, and Either/Maybe sound to me an awful lot like boost::variant/boost::optional
 
That's not very open-minded is it?
 
few months ago I saw something that you can print to clear last line of console ? I forgot anybody have that ?
 
lol
 
5:23 PM
being closed-minded would involve ignoring the robot's suggestions/counter-arguments, not starting from a position of disapproval
 
@DeadMG Yes, you can do the same with different constructs. I don't see how that affects anything.
 
@NeelBasu on some consoles there's a method for that, but there's nothing standard
 
@MooingDuck I am not asking about standard. I am asking for the hack
 
@R.MartinhoFernandes Well, I generally believe that language constructs should not be included if they're unnecessary.
 
@NeelBasu Are you talking about ANSI escape codes?
 
5:25 PM
may be I dont know
 
@Drise "In functional programming, a monad is a structure that represents computations. A type with a monad structure defines what it means to chain operations of that type together. This allows the programmer to build pipelines that process data in steps, in which each action is decorated with additional processing rules provided by the monad. "
 
@NeelBasu amasking? Cool word.
 
@DeadMG Haskell does away with a bunch of language constructs by introducing only monads.
 
there is a string that looks like mess that clears the last line
I can use that to show loading in Console
 
@NeelBasu Uh... \b?
 
5:25 PM
@R.MartinhoFernandes probably
 
@NeelBasu Sounds like it. I don't know the particular code, but you can Google it now :)
 
@R.MartinhoFernandes I found that even few days ago. but right now I am not getting. because I need it now
 
@NeelBasu by "hack" you mean it works on your machine, even if it doesn't work on your friend's machine?
 
@MooingDuck Monad -> history | grep -i "ssh 24.96.88.23"
?
 
@MooingDuck well I can run a different hack for my friend's machine
 
5:27 PM
@NeelBasu Sounds pointless to program a hack that only works once.
 
@NeelBasu tip: not all consoles have a code to clear anything
 
@Drise would cout << "\b" clear the last line printed ?
 
@NeelBasu btw: I'm still trying to find the code for you
 
@NeelBasu No. Just moves the cursor -1 position. Maybe.
 
5:27 PM
@R.MartinhoFernandes So what you're saying is that Monads replaced both exceptions and templates?
 
@NeelBasu that's a backspace, which mostly doesn't work on console output.
 
@MooingDuck Thanks. I remember it looks like a mess of ASCII symbols
 
@NeelBasu found part: "CSI n J ED – Erase Data Clears part of the screen. If n is zero (or missing), clear from cursor to end of screen. If n is one, clear from cursor to beginning of the screen. If n is two, clear entire screen (and moves cursor to upper left on MS-DOS ANSI.SYS)."
 
@Drise I'll get platform specific clear codes that I'll use for compilation
 
@DeadMG No, not templates. Exceptions, yes.
 
5:29 PM
2 mins ago, by Mooing Duck
@NeelBasu tip: not all consoles have a code to clear anything
 
@NeelBasu Sorry, I just got in on this conversation - have you tried using \r? carriage return?
 
@NeelBasu And by that I mean Windows
 
how can you have boost::optional/boost::variant alternatives without templates?
 
boost::optional<T> is pretty much the same as Maybe T. The fact that Maybe happens to be a monad lets you do some nice things, but that's all.
 
Haskell has ADTs and parametric polymorphism built in.
 
5:30 PM
@NeelBasu you could maybe do a "cout << "\r " << "\rNew stuff to print"; Maybe.
 
@R.MartinhoFernandes That does, in fact, entirely seem to be replacing templates.
 
@DeadMG The monad part is an extra.
 
@Drise Ya I'll try that
 
Polymorphism and type classes replace templates.
 
Then what is template haskell?
 
5:30 PM
Maybe is data Maybe a = Nothing | Just a. Done.
 
And Template Haskell replaces TMP.
 
right.
so what is this extra stuff?
 
@NeelBasu char(27)+"[1J" maybe? If I'm reading this right
 
@NeelBasu I warn you that I have no idea what I'm talking about, and that I may be entirely wrong. Who knows. If (works) hurray() else DontBlameMe();
 
@R.MartinhoFernandes Is Maybe then like a tuple, or more like a union?
 
5:32 PM
@StackedCrooked Like optional.
 
@MooingDuck Windows console doesn't support ANSI escapes.
 
It's the sum/union of T and an unit type.
 
@CatPlusPlus I told him that at least twice, yes
 
@MooingDuck Yes I read something weired like this
What query hit this ?
 
ANSI escape sequences are characters embedded in the text used to control formatting, color, and other output options on video text terminals. Almost all terminal emulators designed to show text output from a remote computer, and (except for Microsoft Windows) to show text output from local software, interpret at least some of the ANSI escape sequences. History Almost all manufacturers of video terminals added vendor-specific escape sequences to do operations such as placing the cursor at arbitrary positions on the screen. As these sequences were all different, elaborate libraries such ...
 
5:32 PM
@CatPlusPlus really I thought It is for windows only
 
@NeelBasu no, it's for unix-like only.
 
No, it's for every platform but Windows.
Well, most.
 
@DeadMG Just the whole monad function library. Kinda like what you get by making something a container and including <algorithm>.
 
@MooingDuck Then whats for Windows ?
 
It's not required at all. In fact, in class we learned Maybe on the third class or something, and monads only at the end of the semester.
 
5:34 PM
@NeelBasu For the third time: NOTHING. Windows does not have such a code.
 
@NeelBasu Your father! (See what I did there?)
 
so what stuff is in the monad function library?
 
@Drise He is not Bill Gates
@MooingDuck microfucked widow
 
@NeelBasu well, Windows has these anyway
 
@NeelBasu Please don't berate windows like every other hipster... It's not that bad. Get creative and come up with some otherway of making fun of them besides manipulating Microsoft.
 
5:35 PM
Windows console is bad.
2
 
Nope \r didn't work
 
^ that (windows console is bad)
 
Ell
windows console is pretty aweful you must admid
 
restarting brb
 
There's plenty wrong with Windows.
 
5:35 PM
@MooingDuck Now I need to read all this C style methods ?
@CatPlusPlus So many wrong people have fucked this widow
 
Well, she was lonely.
 
microscopic fucking
 
@NeelBasu Really. Get creative and come up with some other way of making fun of them besides manipulating Microsoft.
 
@DeadMG A bunch of generic algorithms, like map, filter, fold. If they don't sound particularly useful for Maybe, it's because they're not.
Maybe is often cited in tutorials because it's one the simplest monads and helps explain the binding parts.
 
Jesus... Do it again, and you'll be the first on my plonk list.
 
5:37 PM
@R.MartinhoFernandes i/o too.
 
Well, map is useful.
@DeadMG What do you mean?
 
well
I don't see how map/filter/fold is useful for the IO Monad
 
@R.MartinhoFernandes map is useful but windows is not
 
@NeelBasu plonk
 
Ell
windows is very useful
 
5:39 PM
They can create lists based on input.
 
Ooo that was fancy. Nice plonk animation.
 
There's plenty wrong with any platform.
And more with OSX.
 
mah tongue hurts :(
 
@CatPlusPlus The only major problem with OSX is that Apple needs to hold your hand to make sure you get a good user experience. And if you try to do something interesting that may cause issues, you can't because you would get a bad user experience.
 
Haha, good user experience.
Good one.
 
5:41 PM
@DeadMG Maah.
 
@DeadMG Ah, maybe not. There are others that are more useful for IO, though. sequence comes to mind. What IO takes more advantage of is the syntax.
do putStr "What's your name? "
   name <- getLine
   putStr ("Welcome " ++ name ++ "!")
 
Aah, parentheses.
 
@Drise I can dig up enough borked XCode installs. I don't think Apple is succeeding in holding the user's hands to provide a "good user experience".
 
@CatPlusPlus I'd normally use $, but I'd rather not have to explain that as well :)
 
@R.MartinhoFernandes ++ is concat operator?
 
5:43 PM
Yes.
 
Neat
 
A con cat.
 
what's + then?
 
It's a +.
 
Addition, duh.
 
5:44 PM
addition, scrub
btw
 
I just shared the legendary answer about parsing HTML with regexes with my colleagues. They're currently laughing their respective asses off.
 
There's a generic version of ++ for "monads with some more stuff" too. :P (Kinda like there are more operations for more refined iterators)
 
for Wide, I've been thinking about a kinda random feature
 
0
Q: C++ in iOS Development issues

user1580785So I have a .h file and when I include iostream xcode says that header file doesnt exist. But what is making me mad is that whenever I go though the new file process choosing c++ class the default .h file comes with one line of code, which includes iostream.h so when I import that to my Objective...

 
where you can replace expressions of a certain type with other expressions
 
Ell
5:45 PM
why isn't + concat?
 
so what would + on two strings do?
 
@rubenvb Fail.
 
Cause an error.
 
There is no iostream in Objective-C afai assume
 
Also putStr . mconcat $ ["Welcome ", name, "!"]
 
5:45 PM
@DeadMG Oh, I tought you were talking about a random number generator.
 
that's useful.
 
Science!
 
@EtiennedeMartel Kinda random number generator auto n = lol::random()
 
@EtiennedeMartel No, I mean in terms of, it was a random thought I had.
 
I was thinking the same.
 
5:46 PM
@Ell Because the two operations are fundamentally different.
@DeadMG Go on.
 
@Ell that's dumb and ambiguous
 
Ell
Why is it? Adding two strings = one string with the sum of both
 
I have no issue with + for strings. But it would complicate the type class hierarchy a bit.
 
@R.MartinhoFernandes Well, basically, if you have an object f, then when you use f in an expression, the author of the type of f can choose to surreptitiously replace it with some other operation.
 
The most obvious difference is that addition is commutative.
@CatPlusPlus I'm not too fond of the numeric type class hierarchy.
 
5:47 PM
for example, consider a Lazy(T) type
 
Were it about groups and rings instead it would be a lot more flexible.
 
Write your own prelude, everyone does these days.
 
then you could replace f with __f := f(); return __f;
 
@Ell because addition can be defined in terms of subtraction. What's "APPLE" - "BANANA"?
 
@Ell Right, and subtract one of the two from the sum and you get the other, right?
 
5:48 PM
@MooingDuck NaN, duh.
 
that way, if you repeatedly used a Lazy(T) type in a function, then you can statically eliminate the redundant expressions
 
@CatPlusPlus Are you serious?
 
Ell
well "Apple" - "ple" = "Ap". Not sure about yours :P
 
@R.MartinhoFernandes Half-serious. :P
 
@CatPlusPlus GEE GEE
 
Ell
5:49 PM
"APPLE" - "BANANA" = "APPLE"
 
@CatPlusPlus I had to check that
 
Ell
there is no "BANANA" in apple to subtract from
 
@Ell This makes no sense whatsoever.
 
@Ell And thus JavaScript is born.
 
5:49 PM
@Ell equals UB
 
@Ell "APPLE" - "MONOPOLY" = "".
 
@MooingDuck subtraction is defined in terms of addition. Subtraction is not a primary concept (at least I've never seen it been used as one)
 
@Ell no
 
subtraction exists because there's an inversion and an addition.
 
5:50 PM
@rubenvb You could, equally, represent it the other way around.
 
@rubenvb my point is that they're highly related
 
a + b = a - (-b) is perfectly valid and legitimate
 
@CatPlusPlus I think I'll try it, but I guess I'll need to dig into GHC internals to get literals to be of the right types.
 
@Ell ideone.com/mk9LO Good try
 
@rubenvb I've only seen it the other way, since without subtraction, you can't really get a negative number to start with (I don't recall why we started with nonnegative numbers)
 
5:51 PM
@DeadMG a - (-b) requires less concepts :P
 
@R.MartinhoFernandes Yeah, I shoulda written -b but I was busy thinking other things.
 
Ell
So concatenation isn't commutative, it doesn't mean you shouldn't use the "+" symbol
 
@MooingDuck Look at your hand. How can you have less than 0?
 
@Ell concatenation and addition are vastly different concepts. That's why you shouldn't use +
 
@MooingDuck x * -1 yields a negative number from any positive real/matrix/etc
 
5:52 PM
@Ell It's ambiguous
 
@Ell It helps write generic code.
 
Ell
I don't think they are vastly different concepts
 
@Ell It is when (+) is expected to follow a set of laws at all times.
 
In Haskell if you make some type an instance of Num, you get +, and - and all the other jazzle. Using + for concatenation would require a lot of changes.
 
@Ell two apples followed by three apples is not always the same thing as five apples
 
5:53 PM
If it can be concatenated then it probably can't be added, so + is rarely ambiguous.
 
Ell
@Drise I don't think it is, what else could "Apple" + "Banana" equal?
 
@DeadMG I think there's a math reason behind my thinking. Not sure though
 
@Drise It's not about that at all.
 
@Ell It doesn't even make sense.
 
@Ell syntax error
 
Ell
5:54 PM
@Drise that is really the first logical thing that comes to your mind?
 
@rubenvb It's that abelian group or ring or shizzle or whatever thingies.
 
@rubenvb Nope. Subtraction is the inverse of addition, so addition is also the inverse of subtraction.
 
@Ell Yes. It's what the addition operator does. It adds things.
 
@DeadMG groups aren't defined with inverse operators
 
Ell
@Drise its the concatenation operator
 
5:54 PM
@DeadMG my thought was x * (0 - 1) yields a negative, and you don't have any negative.... tokens?
 
Ell
@Drise 1 + 2 <-- Thats the addition operator
 
@Ell only for historical reasons, doesn't mean it's right.
 
@Ell If you add 5+10, you expect 15, not 510
 
might be quite redundant and irritating to define addition as the inverse of subtraction, but it works perfectly fine
 
No sane programmer will expect "x" + "y" to yield anything other than "xy" or type error.
 
5:55 PM
@Ell There's a reason they have different names. There are similarities, but they're quite short.
 
It's not ambiguous.
 
@DeadMG I don't think that quite holds.
 
@MooingDuck You don't need to "get" a negative number to use one as a token. It simply exists in the instruction stream.
 
@Ell correct
 
It's like you don't even read what Robot says.
 
5:55 PM
@MooingDuck --x == x.
 
@DeadMG my thought was merely if addition is defined in terms of subtraction, then you can do all math without negative "tokens". Simpler system overall.
 
Ell
1 + 2 <-- Addition operator
"1" + "2" <-- Concatenation operator
That is just my personal opinion
 
@MooingDuck Nobody gives a flying shit about not having negative tokens.
 
@Ell Ambiguous. Different rules for the same operator.
 
@Ell javascripts opinion too
@DeadMG I do (I am alone there, I'm aware)
 
5:56 PM
why?
 
@Ell Sure. a + b in a template.
 
they exist, they're useful, and nobody has a reason to get rid of them
@MooingDuck Always a reason to do the opposite
 
@DeadMG Bit shifting?
 
When writing generic algorithms you need to know the properties of the operations you use.
 
Ell
@R.MartinhoFernandes well it depends on the type :L
 
5:57 PM
imo, simple solution to this whole problem:
 
Ell
Okay okay, you win! I am wrong, I admit defeat :L
 
@SamDeHaan use ++
 
"Apple" + "Banana" = "Apple+Banana"
"Apple" - "Banana" = "Apple-Banana"
 
If you overload + to have different properties with different types you either get garbage, or a very limited set of properties that don't actually allow you to write a lot of algorithms.
 
@DeadMG It's like... I'm thinking about the axioms of math itself. What are the simplist/fewest irreducible parts. Defining addition in terms of subtraction leads to fewer and simpler axioms.
 
5:58 PM
0
Q: Is addition more fundamental than subtraction?

rubenvbWhen I followed an introductory! course group theory and throughout all my Math courses as a physicist, subtraction was always defined in terms of the inverse element and addition. Is this the only way? I.e.: can subtraction be defined without addition? If this is too broad a question, perhaps ...

There. Leave it to the experts.
 
@MooingDuck No it doesn't.
 
Problem solved, people will stop using +/- for concatenation!
 
@SamDeHaan Great idea.
 
but+what+if+i+want+tooo-o
 
> can subtraction be defined without addition?
 
5:59 PM
@DeadMG if you reverse both concepts, the latter is going to be defined as the former in your reversed mathematics.
 
Erm, of course it can.
 
@R.MartinhoFernandes hey, that's a valid friggin' question.
 
@rubenvb That won't be helpful.
 

« first day (668 days earlier)      last day (4272 days later) »