« first day (944 days earlier)      last day (4003 days later) » 

10:06 PM
@StackedCrooked Where is <condition_variable> from? C++14?
 
One of my design choices for a 2D side scroller was having a Level class with an instance of a Map and a vector of entities along with some physical constants and other shit. I don't know if this is fine or not, but it accomplishes what I want and it seems like a logical approach to the problem. (The Map has a vector of Tiles and an instance of a Tileset class)
 
let me give you a hint
if your design or idea ever includes the word "Entity", you are doing it wrong.
 
@DeadMG That's in C++11
 
huh
 
10:07 PM
I've never seen that before
oh well
 
> Defined in header <condition_variable>
 
Ell
I don't think that's necessarily true
 
a bunch of the C++11 threading stuff is terrible anyway
 
The condition_variable is one of the few things that work as expected.
One of the very few :P
 
user142019
@StackedCrooked I would implement actor model like this but I can't test it since either it or Coliru is broken.
 
user142019
10:10 PM
Aaaand you shouldn't be able to receive() on other actors, of course. :)
 
user142019
The only two ways I can imagine to do that would be through thread_locals or through inheritance and protected but that's clumsy.
 
@DeadMG All it has are coordinates and a pointer to the its type. I didn't know what to call it or how to approach the problem differently.
 
@rightfold it's like the same but F and T are swapped
Coliru doing a quick reboot.
 
user142019
Coroutines!
 
user142019
> Oeps! Google Chrome kan geen verbinding maken met coliru.stacked-crooked.com
 
Ell
10:14 PM
Someone explain to me the point of fibers
It is my understanding they aren't run concurrently
 
Convex hulls, you suck so much... :(
 
Ell
So what is the point in them?
 
user142019
2 mins ago, by rightfold
Coroutines!
 
coroutines suck
 
user142019
No, they don't.
 
10:15 PM
all the headaches of more than one thread... none of the hardware concurrency performance increases that actually justifies that
 
user142019
You don't need multiple threads for coroutines.
 
user142019
Depending on the language.
 
Ok, fork bombs are killed properly again.
@rightfold It's ok again.
Coliru has been unstable for a while now. But I've been fixing various things, one at a time, over the past few days.
 
user142019
+ g++ main.cpp -std=c++11
cc1plus: error: unrecognized command line option '-std=c++11'
 
user142019
What the fuck?
 
10:22 PM
The limits are inserted in cmd.h, as you can see here.
@rightfold g++-4.8
 
user142019
OIC
 
Same problem I was having.
I'm running OS X Lion and I have to update to Mountain Lion because gcc 4.2 is about as good as it gets for this version of the OS.
(At least, according to MacPorts)
 
@Magtheridon96 Fixed @rightfold
 
Let's say hypothetically that a user of a high-level language (say, c#) wanted to get a bit closer to the metal in the language tree. C appeals to him, because its minimalist, but he's worried about reinventing every wheel. Example: Linq, which is implemented in C++ libraries, but not C. Could he learn a minimalist version of C++ instead, without getting wrapped around the axle?
 
user142019
Can a tuple element be a reference?
 
user142019
10:25 PM
@RobertHarvey Maybe D.
 
user142019
Not sure though, but it has way fewer quirks than C++.
 
@RobertHarvey Sure.
 
Ell
@Robert I don't think its possible to learn minimalist c++ really. The two words don't go together
 
@RobertHarvey Depends on exactly what he defines as getting wrapped around the axle.
 
@StackedCrooked Cool <3. I'd still rather have it installed here though. (For senseless, aesthetic reasons. Like my pimped out Terminal ;_;)
 
10:26 PM
@RobertHarvey Yes. But even a minimalist version of C++ is a lot.
 
By wrapped around the axle, he means getting mired in the sheer level of detail that seems to characterize the C++ ecosystem.
 
No. You can read a book like Accelerated C++ where you learn the things that matter.
 
@RobertHarvey If he's just interested in using a library, you can get away with not having to know every single detail.
 
if you just want to consume some popular libraries, you don't need that much.
but the simple fact is that being close to the metal entails taking care of details you wouldn't have to in C#.
the smart move is to stay away from the C part of C++
3
 
The sheer detail comes in when you need to write at least a decent library.
 
10:28 PM
> wanted to get a bit closer to the metal in the language tree
 
and the biggest mistake would be to assume that C++ is just like C, or just like C#, of which it is most definitely neither.
 
@DeadMG He has heard that. That's why he wonders if he should avoid C altogether.
 
^ what is the true motivation?
 
@RobertHarvey Absolutely.
 
But why? Is C really that poor of a language?
 
10:28 PM
@RobertHarvey Yes.
 
depends on exactly what you're looking for from a language
 
@RobertHarvey C is very painful to work with. Even the most trivial code (concatenating two strings) requires you to write messy and error code prone.
 
but from a modern standpoint, it basically has absolutely no useful features whatsoever.
 
@DeadMG He's looking primarily for minimalism.
 
@RobertHarvey It's not IMO, the problem is that it's completely pointless to limit yourself to just the C part of C++.
 
10:29 PM
@StackedCrooked But isn't that why libraries exist?
 
@RobertHarvey He's not going to find it close to the metal.
 
If you're using C++, then there should be no problem with using C++ features.
 
C is not a poor language, it's powerful. It's just annoying to code in and has the potential to produce less readable code.
 
@RobertHarvey Libraries cannot protect you from fundamental language flaws.
 
Ah, now we're getting somewhere.
 
10:30 PM
@RobertHarvey Yes. I was talking about usage of the libraries.
It's that bad.
 
I mean
 
@RobertHarvey Have you tried string manipulation in C? It's a pain in the ass.
 
just for example, since C provides no language features for resource cleanup
 
In C libraries can't relieve the programmer of resource management.
 
there is no library in C, ever, that can protect you from double frees, use after frees, etc.
 
Xeo
10:31 PM
@RobertHarvey Lack of abstractions in the language ain't gonna help with building an abstraction as a library
 
so you have to perform the extremely difficult and definitely non-minimal task of manually assuring resource cleanup.
 
Then there's the part about arrays being the most advanced built-in structure you have.
 
The philosophy of C++ is to have library-only solutions as much as you can. So it's possible to be able to have nice things like RAII using only C++ language features.
 
You don't need a garbage collector, just use a smart pointer.
 
10:32 PM
in this case, you could argue that "not having resource cleanup features" is minimal, but the simple fact is that you are just doing work the compiler should be doing, the work isn't being avoided, you're just doing it manually.
 
Hmm... In C#, data structures are implemented mostly in libraries, although arrays do enjoy first-class support. But even their implementation is done in the Framework.
 
It's not like Java where they special-cased the whole operator overloading thing for the String class so you can type "String str = a + b + c;"
 
You can concatenate strings in C++ with operator+ though
 
@RobertHarvey In C++ you rarely need to use arrays. You nearly always use std::vector<T> (dynamic) or std::array<T, N> (static).
 
@Rapptz Yes. What I mean is that you can write a String class that can be used like "a + b + c" using only C++ language features without putting in a special case for the compiler for a specific class.
 
10:34 PM
@RobertHarvey That is not a C library.
 
So, coming from C#, you think he would be happier in C++. Is it sufficiently low-level to satisfy his spartan sensibilities?
 
then there are those occasions where you use std::deque when your vectors vary too widely in size
 
@RobertHarvey Not if he's used to IntelliSense.
 
@RobertHarvey C++ can be as low-level or as high-level as you want.
 
C++ is love (Go away Jesus)
 
10:35 PM
IS in C++ sucks. :(
 
@RobertHarvey In C++, you can choose what level you want to work at. There are no features in C which are lower level than what's possible to use in C++ (although not recommended because the C part of C++ sucks).
 
@RobertHarvey You can't go more low-level actually.
 
Assembly!
 
from another perspective, C++ is the only language where you can have both LINQ and strange memory hacking (if you really want to do that)
 
Once you go C you run back to C++!
 
10:37 PM
There isn't a built in LINQ library though so
 
in any case, your requirements sound a bit contradictory
 
If you disable exceptions and rtti in the compiler options. And don't use iostream then I think your binaries will be just like C binaries.
 
not in-detail but close to the metal is quite a contradiction, really.
 
Assembly appeals to him, actually. Except that he doesn't like being thrown off a cliff every time he starts his program.
 
ultimately
 
user142019
10:38 PM
> clang++ main.cpp -std=c++11 -ltbb && printf 'run\nbt\n' | gdb ./a.out
 
user142019
Most useful.
 
I think that he should find something more specific that he wants to do, rather than just "hacking" or "being close to the metal".
 
Why would you want to be close to the metal
 
I have no idea
 
Because Blacksmiths are cool
 
10:39 PM
@RobertHarvey Programmers that want to be 'close to the metal' are often not thinking rationally about their program's requirements. They are just chasing an idealized thought.
 
He likes performance. He also likes being able to hold the entire language in his head at once.
 
those two things do not go hand in hand.
 
You can't hold C++ in your head at once.
 
I can :P
 
No, you can.t
 
10:40 PM
but most people most assuredly can't
 
~performance~
 
You can hold asm in your head.
 
That's it for this conversation for me
 
Yes, you can.
 
sure, except you'll produce worse code than the optimizer for C and C++.
 
10:41 PM
With modern compilers, C++ code is very performant
 
Well, unless you do optimisations yourself with SSE and what not.
 
not to mention the fact that you'll never get around to benchmarking your program to enjoy how fast it is when it crashes incessantly
 
You don't have to use assembly rather than C++ if you want performance.
 
But he can just write and experimental C++ programs and the generated assembly.
 
So it comes down to what subset of C++ he should learn.
First, anyway.
 
10:42 PM
I don't think C++ has subsets.
 
stay away from the C libraries and C APIs for as long as possible
 
@Rapptz uh.
 
@Rapptz It has, mathematically.
 
@RobertHarvey Assuming we're talking about a competent programmer, RAII.
 
@melak47 Disregarding C.
 
10:43 PM
Basic templates
 
aside from that
 
If you don't use the parts of c++ that suck then you are already using a subset.
 
you want to start with the stdlib and the basic template, RAII stuff
 
@Rapptz templates?
 
Well, when you think about it that way then okay.
 
10:43 PM
Stay away from template metaprogramming, it will hurt your head the first time you play around with it.
 
yeah
 
@melak47 How is this a subset? o.o
 
The subset of C++ you want to learn is ∅
 
try not to think about how some templates are actually implemented
 
Is subset synonymous with "part of"?
 
10:44 PM
@Insilico hi
 
@Tushar hi.
 
great u r alive
 
If he wants high performance so much then he might want to have a look into static polymorphism, policies etc.
But for starters, I hope he understands the importance of memory locality and shit. Other wise he'll become another void-star programmer.
 
user142019
I can't find what's going on. Why am I getting a segfault? coliru.stacked-crooked.com/…
 
10:45 PM
This is not a "string" but yeah for C it's better than crappy C strings
 
@Insilico great u r alive
 
@StackedCrooked He does. In C# you wouldn't have much control over that.
 
How does one quantize C++?
 
One should probably talk about the rule of 3/5/0 too.
 
@RobertHarvey Some programmers think that using pointers all over the place (to avoid accidental copies) somehow makes the code faster.
 
10:46 PM
Oh, and don't forget about this: tinyurl.com/dont-use-pointers
 
@RobertHarvey Firstly, that can't fix the fundamental defects in the C language, like having to destroy it yourself. And secondly, claims of improved performance without specific implementations of std::string referenced with specific benchmarks is a sure-fire claim that he's talking out his ass
 
Many programmers are bad and are thinking about ~~~performance~~~ when they've got nothing to ~~~performance~~~
2
 
Does anyone else really dislike libstdcxx?
 
@DeadMG Not to mention lots of people who try to benchmark things completely fail to apply statistics to properly analyze the data.
 
I really dislike C++
Does that count?
 
10:47 PM
@ChristinaBrooks i really dislike
 
I like C++ but I absolutely hate libstdcxx. I have my own implementations of some common data structures that I use.
 
@Insilico So you don't have to use pointers at all in C++, if you don't want to?
 
libstdcxx is one specific implementation of C++ standard library and ugh you suck
 
TypedArray, TypedList and TypedRootedList
 
10:48 PM
Well, it's the Darwin implementation, but I assume that all libcxx implementations are that bulky and that disgusting.
 
user142019
You mean std::vector<T> and std::list<T>?
 
@RobertHarvey Well, you need smart pointers, but they're not really the same thing.
 
@RobertHarvey also
 
See also:
 
@rightfold Except that doesn't require linking against an annoying library.
 
10:49 PM
What are you on about
 
Linking against stdcxx gives your application cancer.
 
user142019
> plonk
 
You're really terrible programmer
hth
 
@RobertHarvey I'm not willing to say you won't need pointers ever in C++.
 
user142019
Oh hey the chat looks much nicer now.
 
10:50 PM
Why is that?
 
You're reinventing the standard library.
 
well... yeah, it really depends on what exactly you're going to use them for.
 
Step back for a second and see how retarded that is.
 
First of all, I'm an embedded programmer.
 
BUT CANCER ANNOYING LIBRARY HURR BLURFF
 
10:50 PM
@RobertHarvey the only time you use naked pointers is when accessing objects that you don't own. (if you own a resource then it should always be managed by a smart pointer)
 
@RobertHarvey: It's just that lots of people way overuse pointers in C++ for situations that require absolutely no pointers.
 
in C, pointers are non-owning aliases, random-access iterators, owning aliases, horrible XOR hacked things... etc.
 
Embedded, terrible, same thing
 
in C++ we pretty much just use them for non-owning aliases
 
I like EC++
 
10:51 PM
Type std::
And enjoy the ride~
 
@ChristinaBrooks EC++?
 
It's like C but with classes.
Embedded C++
 
Can't use exceptions, multiple inheritance and RTTI
 
@ChristinaBrooks :(
 
10:52 PM
@CatPlusPlus Is there something wrong with your face?
 
Yes
But that's beside the point
 
Embedded C++ (EC++) is a dialect of the C++ programming language for embedded systems. It was defined by an industry group led by major Japanese central processing unit (CPU) manufacturers, including NEC, Hitachi, Fujitsu, and Toshiba, to address the shortcomings of C++ for embedded applications. The goal of the effort is to preserve the most useful object-oriented features of the C++ language yet minimize code size while maximizing execution efficiency and making compiler construction simpler. The official website states the goal as "to provide embedded systems programmers with a subset of...
 
user142019
It looks terrible, like C++, but more terrible.
 
> Embedded C++ is a proper subset of C++. The following language features have been removed: ... Namespaces... Templates
 
Here is some of my terrible EC++ code: pastebin.mozilla.org/2414241
 
10:53 PM
Does Embedded C++ still exist? It thought it died 10+ years ago.
 
The following language features have been removed:
...
Namespaces
...
Templates
 
WTF kind of shit is that.
 
user142019
> New style casts (static_cast, dynamic_cast, reinterpret_cast and const_cast)
 
PERFORMANCE ACHIEVED
Ugh
 
Why would they remove preprocessor specific shit like that?
 
user142019
10:53 PM
It's basically C.
 
Ell
Holyfmygod why
 
> "To the best of my knowledge EC++ is dead (2004), and if it isn't it ought to be."[
Yup
 
Looks a lot more readable than "normal" C++.
 
It very much ought to be
 
10:54 PM
LOOK AT HOW PRETTY MY CODE IS
 
We already established you're bad at C++ so
 
user142019
It looks fucking terrible.
 
user142019
Stop whining.
 
With all the gotos.
 
Also god no it's fugly as hell
 
10:54 PM
It's almost as though "Embedded C++" could be renamed to "Fucked-up version of C++ with the features I don't understand removed".
 
Also stop trolling tia
 
I would tap your code
 
user142019
@ChristinaBrooks You better goto here;.
 
user142019
Also, brown list.
 
user142019
It's really trolling season.
 
10:56 PM
Why the hell did they remove namespaces? Of all C++ features to remove?
 
I don't understand why C++ people get so pissy about this crap.
 
So can we request that bug that removed chat link to be brought back
@Insilico Because they have no idea about programming
 
user142019
Maybe ask actual C++ people and not us?
 
Haha, like the ones on ##c++
oh my
 
I'm not touching C++ with a stick attached to larger stick
But you're still a terrible programmer
 
10:57 PM
haha, I'm not
 
user142019
Prove it.
 
@ChristinaBrooks Look at my conversation above for a better way to approach C++ developers with a question. Hint: have an imaginary friend.
 
Don't call me a C++ developer :<
 
To be fair, it was quite obvious your friend was imaginary.
 
I did something even cooler. I wrote a simple ObjC runtime that could run inside a bootloader.
 
10:58 PM
lol
 
user142019
Oh wow how cool.
 
People said I was nuts.
 
user142019
Objective-C is also terrible.
 
user142019
You are nuts.
 
It's even more terrible in a bootloader.
 
10:58 PM
I had the inspiration to learn Objective C the other day
 
@rightfold The flavor of Java in Android is worse.
 
user142019
Yes, but nothing is worse than Java in Android.
 
@RobertHarvey Android has it's own flavor of Java?
 
Holy shit, I've never seen more brackets in my life.
 
I opened up XCode and saw how methods are called and I was like "no".
 
10:59 PM
Or is it just Java + Android libraries?
 
It's stuck on Java 6 so in a way
 
user142019
@Magtheridon96 Xcode*
 
Ell
I think some Java libs are replaced with android ones
 
XCODE
 
I guess it's Java. But it's Java put through a blender.
 
10:59 PM
Aren't you glad you're a programmer
 

« first day (944 days earlier)      last day (4003 days later) »