« first day (1603 days earlier)      last day (3336 days later) » 

user1804599
12:12 AM
One thing I have to do is write a program that figures out given a subroutine whether that subroutine definitely needs no CPS.
 
user1804599
Because if it doesn't, code generation can be much simpler.
 
user1804599
E.g. func abs(x: Int): Int { if x < 0 { -x } else { x } } needs no CPS.
 
anyone have a lobste.rs account?
 
user1804599
No.
 
no
 
12:25 AM
@Mysticial you have 800+ notifications?!
 
@orlp he won't see the notification telling him you pinged him
 
More or less same topic I've been raising two days ago :-P
5
Q: Eliminating instantiation of useless destructor calls?

πάντα ῥεῖWell, my colleague is pretty in depth nitpicking about eliminating unnecessarily code instantiations for destructor functions. Still same situation, as mentioned in this question: Very limited space for .text section (less 256 KB) Code base should scale among several targets, including the mos...

 
Oh.. good usage of template reference. thanks for showing this way. but very complex and difficult. ^^ — cpplover - Slw Essencial 3 mins ago
 
What GCC is that?
 
I have no clue what a template reference is. (It might have to do with perfect variadic forwarding)
 
12:32 AM
@πάνταῥεῖ You want #include <new> and ::new … wouldn’t hurt.
Use of std::uint8_t is wrong, you want unsigned char.
Welp, at least Jonathan is on the case.
inb4 visibility options hurr durr
 
@LucDanton Do you really think this makes any significant difference in the behavior of the compiler?
 
It switches off the UB bit.
 
I think you should verify exactly what your colleague is doing, and make sure they are using a sensible optimisation level for a small device (try both -O2 and -Os). These second-hand questions involving ugly workarounds for unverifiable claims someone else has made are not very useful for other SO users :) — Jonathan Wakely 8 mins ago
Strong, but close to my feelings
 
@LucDanton UB is introduced with the reinterpret_cast<T*> bit already (and alleviated a bit by the alingnment attribute)
 
12:40 AM
@πάνταῥεῖ Depends on T.
That being said, yeah you don’t need unsigned char.
 
@ethang I certainly won't call him an idiot (though I have my doubt's what he's actually doing). He's a highly intelligent, and well versed C-programmer learning C++ now, and looking at things analyzing the stuff at assembly level (and what the footprint results are and why). — πάντα ῥεῖ 7 mins ago
^ This sounds like the a problem. If your whole frame of reference is "I must fight any overhead of C++"... You should first get to know the C++ way / ecosystem. Then you can slowly marry the two from experience
 
user1804599
hehe this was a nasty bug to find github.com/rightfold/mill/commit/…
 
user1804599
didn't anticipate for the possibility of branches consisting of more than one basic block
 
I normally do struct storage { storage_type data; void* address() { return this; } }; and as long as storage_type is Standard-layout and suitably sized & aligned it works out, everything conforming (as long as you don’t alias with data at the wrong times).
 
@sehe I never had to defense usage of C++ at that level he's forcing me to do. As mentioned, that guy is well versed with C language, and much better at interpreting assembly level operations seen when debugging the actual artifacts. Nevertheless I don't suppose nm is just lying at us by showing (inlined or not) instantiations of these destructor function codes, unless they're going to be called or not.
 
12:48 AM
What GCC and what options?
 
@πάνταῥεῖ I don't know what you're saying. All these things make sense. I was looking at the bigger picture
 
@LucDanton GCC 4.9.2, don't have all of the options at hand now ...
 
Oh neat. You should have visibility options available.
I’ll write an answer.
 
@LucDanton I appreciate any :-P ...
 
Eh on closer look it turns out that -flto is better for removing definitions than visibility options, at least for my single TU example.
-fwhole-program can also do the job, although it seems to be tuned somewhat differently.
@πάνταῥεῖ Nah, we need your compiler options.
 
1:01 AM
@LucDanton AFAIK they've got -flto switched on.
 
That’s worrying. Just in case, the option can appear both for compiling and for linking.
 
@LucDanton Will as them in more depth about this next week. I don't have them at hand actually as mentioned.
 
@EtiennedeMartel Day9 playing Cities: Skylines it looks fun
 
1:45 AM
this is so strange
it causes brain pain
it's like my brain knows where everything is and tries to map it to the real thing
but it's in reverse
and it gets confused
it only works with the maps I'm very familiar with
so it's definitely about thinking I'm seeing something but seeing something else
 
2:08 AM
some people do that to movies to circumvent copyright restrictions
 
2:47 AM
@AlexM. Oh my god, this is so wrong for my brain.
Wth. I don't even really play that much myself. But still...
 
3:10 AM
@R.MartinhoFernandes yeah, but it's inferring wrong
An exception that does not have a ToJSON instance could be thrown.
 
morning butches
 
Or maybe not.
My brain is melting
@ParkYoung-Bae Morning
C++ is so nice
 
> <> +1: I can't see anything to dispute this answer.
is rejected
this is getting fucking ridiculous
leading underscore does the job
@CaptainGiraffe Still here? I am ready to be entertaining.
 
3:29 AM
Use "Upvoted" or "Downvoted"
 
@LightnessRacesinOrbit lol
 
This question has nothing to do with "drivers", nothing to do with recursion, and almost nothing to do with "divide and conquer" except for the fact that you should have applied that very debugging technique before posting!! — Lightness Races in Orbit 36 secs ago
@Rapptz Meh doesn't stand out
 
++i and --i.
 
@Jefffrey I love and hate C++ at the same time
 
Yeah, like: when you don't write C++ you love it and when you write in it you hate it.
 
3:46 AM
More like: I hate its legacy
 
I like that it's mature.
It's like a LILF
Anyway, good night.
 
d14
4:06 AM
Good evening everyone.
 
Evening.
 
d14
If I want to insert a series of data into a linked list, I must first insert the first element as head before I make use of a while loop to automatically set other nodes?
Is that right?
 
You tell me. Don't be afraid to try stuff like that. ;)
 
d14
True.
 
It really depends how the linked list you're using is implemented.
Is it one you've made yourself, or gotten from somewhere else. (I'm not mistaken that the STL doesn't have one, correct?)
Or are you just using the standard List object, which I guess is s doubly linked list.
 
d14
4:16 AM
I'm just making this up myself, I'm having a little hard time transforming the idea into code
Look at what I have written
I know the logic behind it
I can insert a single node into a list
then do something like

head = firstNode
firstNode->next = NULL
 
You should really encapsulate the linked list idea into a class.
You also seem to be creating elements for the fun of it.
As well as doing some checks that from what I can tell, are completely unnecessary.
 
d14
Okay. Before while loop, I get it completely.
But in loop, I dont get it.
 
I don't get why people write code that they don't understand.
 
while (temp != NULL) will always succeed, or always fail. Based on your code, it will always succeed, since you assign temp once, and never touch it again.
@LightnessRacesinOrbit, gotta learn somehow.
 
@David Not like that, no!
Programming by guessing is stupid
Write your algorithm out on paper in your chosen notation, then and only then translate it into C++ using your C++ book and a standard library reference.
 
4:22 AM
Aww, but that would be easier. :)
 
You should and must understand every single line of code that you write
Otherwise, do not write it
This is so mind-bogglingly simple and obvious yet every day I see people doing the opposite
Can't understand that
 
I presume you've been coding a while as well. I get where you're coming from, but I also remember when I started, and just wanting things to work.
 
You're not listening.
Experienced, inexperienced, it doesn't matter.
Actually, it's even more important when you're inexperienced!
When you're learning to drive a car you don't just press random buttons and slam your foot down on random pedals before you know what they do. So why the fuck do people write lines of code for the hell of it without a clue what it'll do
It's utterly ludicrous.
 
d14
@LightnessRacesinOrbit, Thanks for the advice.
 
You are welcome, son!
 
d14
4:24 AM
smh
 
No, I agree. I just also have seen the same thing happen. And frankly, you didn't learn to drive that way? :)
 
I think they're doing it at their code.
 
Sleep well.
@d14, in your original question, the answer is yes, because you have to start with something. If you wanted to be able to just right in, then you'd need to create a class, which handles the linked list part. Actually, your current implementation is horrible since you link your data and your structure together. They should really be separate.
 
4:27 AM
lol flags
oops added an extra 'l' in there
 
But without testing it, I'm guessing your code is working?
There are three l's in there. Which one is extra?
 
d14
Not really working, nothings shows up on screen.
I will remove the while loop and write something less bogus.

by the way, are bad manners a norm in here?
 
Oh, I see why. You never link anything to temp.
And I'm not sure, I don't hang around enough to know.
 
@LightnessRacesinOrbit Some people still think that saying "fuck" or one of its derivative is a flaggable offense.
@d14 It all depends on what you mean by "bad manners", really.
 
d14
@EtiennedeMartel fuck ?
 
4:33 AM
@d14 Some of us tend to swear a lot, yes.
 
d14
@EtiennedeMartel If thats acceptable in here, hey! Go For It
 
@d14, does changing head = first; to head->next = first; work?
Wait, no, that still won't work all the way.
How about...
temp->next = first
temp = temp->next
Then change your bottom loop to start from head instead of temp.
 
user3010322
... Linked lists.
 
user3010322
They're back. ;~;
 
Well, they're probably the simplest kind of data structure.
After arrays.
 
user3010322
4:43 AM
They also support O(1) removal from the middle!
 
d14
@David et al, I have rewritten the while loop
 
@d14, while (temp->next != NULL) will fail everytime.
 
d14
Why is that? I did that to check if head is empty
 
Still not doing the assigning right either. Use what I put above, replacing first with items now.
 
Is it appropriate to ask for feedback to my codereview post here?
 
d14
4:55 AM
@David Still not working
 
No clue, but since I'm the primarily active user, go for it.
 
@d14 take off the next on your bottom while loop. If that doesn't work, let's see what you have again.
@MotokoKusanagi, if you're using C++ , why not just use List instead of creating your own doubly linked list?
 
i'm using c
 
Ah, okay. Should pay more attention. :)
 
4:58 AM
:)
oh dear. forgot to close the file
 
Well, without really understanding WHAT you're doing, the code seems pretty clean and well written, especially since I have a (very) vague idea of what is happening without a single comment (which is horrible) after just reading through it. Your linked list implementation looks solid as well, though I think I would have delete backwards, and then forward, rather than moving back, and then deleting forward.
FYI, I'm not super familiar with C, so there may be some things I missed.
 
Now that I think about it, I should have added comments before I posted that. Thanks for the advice.
I guess I got into the "it's too obvious for comments" rut because I am most familiar with the code.
 
Never, ever take that opinion. You're only familiar with it for about a week after you're done working with it. Frankly, Hello World should probably be commented, but then again, I tend to write books with my comments. :)
My commenting method is a bit extreme. I basically try to make it to where I know what's happening by just reading the comments. (I don't always go that far though)
 
5:14 AM
Maybe I should comment it; but keep an uncommented archive of the source, and then try to read my own code after a week.
 
Do it.
Or, if you have a really good memory, wait a few.
Although, you may miss how much you've lost of it unless you try to make a change.
Got any old projects that are uncommented?
 
c is shit
c plus plus is shit
your code is shit
hope that helps
 
If you hate c/c++ so much, why are you in the chat room?
 
figure it out
 
Cat, it's 6:20am, go to bed already.
 
5:19 AM
whiskeeeeey
Also weird movies
 
whiskey doesn't change the fact it's 6:20am.
:D
 
I've done precisely nothing on Friday wooooooooooo
Well, except for the chicken
 
@David I have this post that I am having trouble deciphering. It has one comment that is quite unhelpful.
 
@Griwes No, but it makes it slightly more tolerable
 
Alright, it's 6:20am, I should probably go to bed.
 
5:20 AM
I usually end up just trolling YouTube when I'm drunk
 
Wow trolling tubyoube that's ingenious
 
@MotokoKusanagi, but it's so easy :)
Case and point though on why you should always comment.
 
I've been more productive than you, since I managed to catch up with some tv shows this past night, lol.
 
yeah youtube comments can get really... odd
 
We just watched Predestination and John Wick
 
5:21 AM
predestination was so-so imo
i thought john wick was pretty good
 
Oh and Birdman
 
Also, "nie pij, Piotrek, nie pij w piątek, piątek zły jest na początek"...
 
So that's my Friday
Since I woke up at like 17
 
Look, there's a song about you.
 
i don't speak much... polish?
 
5:23 AM
I'll drink today too don't worry
 
"Peter, don't drink on Friday, it's bad to begin that then" is a horrible translation that matches the time of day.
 
i always liked the way my mother says "go climb a tree and straighten bananas"
like half of what i learned while i was there visiting family was profanity
 
Adapt bananas to EU standards would be the modern version
 
Hi,sorry for asking here,is there any moderator in the room?
 
5:27 AM
> Internal compiler error: Error reporting routines re-entered.
 
Internal cat error
 
Once again from using automatic return type deduction tightly, mmh.
 
Going to sleep
 
Ciao!
 
BAILING OUT
 
d14
6:24 AM
@David et al, This's what I've got now. When I run it, it crashes, not sure why,
 
7:23 AM
The Science of Anti-Vaccination. Nice overview of the cognitive biases involved.
 
7:56 AM
@Rapptz @R.MartinhoFernandes std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> appears to work with my GCC 5.
 
neat
 
Ya know, if identifiers can have UCNs, and if only the source character set is guaranteed to be widenable, how does one write a generic demangling typeinfo name thing?
This is stupid.
 
So I escape ampersands now. But not sure manually escaping stuff is the way to go.
 
You should leave that bug there so that the SO question is still relevant. :)
 
Yeah, it's a feature, not a bug!
TBB's malloc seems to be pretty good. Well, at least it made malloc rectangles disappear in kcachegrind.
 
8:06 AM
malloc rectangles?
 
It was reporting cost of malloc in the call graph :D
 
oh
 
But no real performance gain. Since those mallocs weren't a real bottleneck.
 
Typical - when the performance bottleneck is not your code, but it's the framework itself.
oh nvm
 
Valgrind lies though. For example it reports the packet checksum calculation to be the biggest bottleneck, yet when disabling the checksum the performance gain is very small. (Turns out that when profiling each write to a variable is like writing to a volatile.)
 
8:10 AM
Have you tried a better profiler?
 
I tried gprof. Which is sample based.
 
Like Intel VTune Amplifier. :)
 
I got the trial version but it expired before I got to use it.
Stupid me.
 
lol
One solution is to have an extra box where you can keep reinstalling the OS.
 
I think inserting timings in the code might be more reliable.
@Mysticial Ah.
I actually reformat my linux laptop frequently.
 
8:12 AM
I don't know if that counts as piracy since it achieves the same thing.
 
Well, I should give it a decent try. My boss is willing to purchase it.
It's not very expensive software (for a company).
But $899 is a bit much for me.
 
I'm only seeing it as 699. Still a lot for a consumer though.
 
Question: are functors mutually exclusive to functional programming?
 
Oh, if you want ICC with VTune, then it's $1600. Fuck. That's as much as a mid-end computer.
 
user3010322
No, they're dirty sluts that spread themselves all over any language they can get their hands on.
 
8:19 AM
It's almost better to just buy an 8-core Haswell and pirate the compiler. :P:P:P
 
I dunno how icc compares with gcc & clang these days.
 
For me, it's produces code that runs 1-3% faster. But I'm not a good test case since I do most of my optimizations manually.
Though the AVX512 auto-vectorizer in ICC scares me.
I guess that was going to happen at some point when Intel started designing instructions specifically for auto-vectorization.
 
Is it possible to have an abstract class but FORCE implementing classes to have onlly the public methods that are in the abstract class?
I don't care how the private methods work, but I want to force the classes to have only one public method.
 
You could punch the guys that do write more.
 
8:35 AM
@Eric Why would you want to do that anyway?
You would implement the child class yourself as a template. Make the constructors of the abstract class private. Make the template child class final. And friend the child class from the parent class.
Then the "implementing classes" would be implemented via template instantiations.
 
ICC still has the most complete implementation of current C++ for windows systems
unless you want to go the cygwin path that is
 
The downside of ICC is that's it's a ridiculously slow compiler.
 
@MarcelMeißner It has feature parity with GCC?
 
So I develop on MSVC. But do optimized builds on ICC.
 
There’s even Clang for Windows. Not sure what version.
 
8:41 AM
@LucDanton nope, but gcc for windows isn't really viable because mingw usually lacks a lot of features.
 
@MarcelMeißner Really? Which ones?
 
@Cinch You can look that up on the mingw homepage, give me a second and I'll find it.
 
What Standard library impl does ICC work with btw?
 
@LucDanton No idea. But I won't be surprised if they have their own.
 
Wow, that’s a lot of work.
 
8:43 AM
I know for sure that <math.h> goes directly into their MKL.
 
16
A: Intel standard library (C++)

Lightness Races in OrbitUntil version 8, ICC shipped with Dinkumware, i.e. the standard library implementation that also ships with Microsoft Visual Studio: The Intel C++ Compiler for Windows uses the Microsoft Visual C++ header files, libraries and linker. Microsoft controls the header files that define the namespa...

 
Not just that, but they will vectorize loops with math functions using calls to their "svml" - Short Vector Math Library.
 
By the way
 
@StackedCrooked Oh... So Intel was too lazy to write their own "super-optimized" linked list. :)
 
Why is Eclipse's parsing so terrible with C++?
 
8:45 AM
@D14, where is it crashing?
 
@Cinch It didn't use bison.
 
@StackedCrooked and also why is its syntax parsing so bad?
It cannot resolve changes in my code dynamically like Code::Blocks
I've kind of just shunned IDEs right now
 
C++ autocompletion and intellisense generally sucks.
 
so they can't just use some sort of parser?
 
Good suggestion. Maybe you should mention it on the mailing list.
 
8:51 AM
lol
 
No but seriously
what prevents them from using something like that?
 
You weren't serious.
 
@Cinch the binaries you get from mingw.org are pretty outdated, so you'll only get older gcc features. I couldn't find anything about how to get a recent gcc mingw
 
Qt Creator still can't handle unique_ptr.
 
@MarcelMeißner That's not a downside to GCC inherent, however
TDM-GCC32 seems to be fine
 
8:52 AM
but cross compiling from a GNU/Linux is better anways :p
 
@Cinch cough cough cough - dramatic death posing
 
developing on windows just feels wrong for me
 
wait are you serious?
I'm on Linux myself right now
but I do use GCC
(I mean what else am I supposed to use?)
Clang?
(I feel like I should)
 
stdlibc++ defines unique_ptr::pointer through some kind of SFINAE. It totally breaks the autocompletion.
 
(But idk I've been using GCC for school)
 
8:54 AM
I don't think clang is ready yet
stick to what works for you
 
Why is Clang not ready?
Isn't it a pretty robust compiler architecture compared to GCC's monolithic approach?
 
people trying to compile linux with clang had to patch the kernel and the results aren't as good as those with gcc
 
Ah I see
 
@MarcelMeißner 4.9.2 and 5.0 snapshots are outdated?
 
it's a nice approach and everything, but it doesn't seem to be ready yet
 
8:56 AM
And what about OpenCl or Vulkan's new bytecode-like language?
 
oic, hang on
 
@LucDanton I can't find these on mingw.org, where did you get them?
 
@MarcelMeißner have a look
 
@LucDanton why this instead of TDM?
 
@StackedCrooked surely this just implies TBB calls it infrequently
 
8:59 AM
Yeah, they don't give the memory back to glibc.
 
@Cinch TDM packages MinGW-w64
 
@LucDanton Oh, didn't know that, thanks
 
@Cinch OpenCL is definitly worth looking into, if you're doing number crunching stuff, map reduce and other things that perform well on gpus.
 
@MarcelMeißner idk
I want to get on the new Vulkan thing but IDK how
I don't even do OpenGL right now
and I hear OpenCL and Vulkan use the same bytecode or such?
 
tbh I've never heared about Vulkan
 
9:02 AM
@MarcelMeißner "tbh I've never heared about Vulkan" WTF?
 
I've been living under a rock recently
 
It's OpenGL Next
Khronos group has released a new API that's stripped down and strives to unify mobile, desktop, embedded, etc.
Apparently it's the futuer
and I think it can run on Windows 7 already as well too?
It's going to be released later this year but it was recently announced
 
@LucDanton Oh nice. Serendipitously found win-builds.org/doku.php
 
I haven't been able to make a good use for STL allocators in our code base. I'm starting to think that replacing malloc is the better approach.
 
@StackedCrooked ???
 
9:07 AM
@Cinch “@MarcelMeißner "tbh I've never heared about Vulkan" WTF?” WTF :)
 
I've heared about the planet ofc
 
@sehe uW0t m8?
u mocking me?
O.O
 
a little
 
it's where spock comes from
 
@StackedCrooked completely uncomparable goals
 
9:08 AM
lol XD
 
They often overlap.
 
Also anyone here do Tower of Hanoi?
 
@Cinch everyday during breakfast with my cookies
 
@sehe I noticed without look into it (until now). Neat.
 
9:29 AM
@MarcoA. I do it with the eggs, but it's much more difficult if the eggs are scrambled.
 
so... with templates... can I have two template class 'foo' and 'bar' and then have a function that takes a foo and bar but only if foo and bar are 'templated' with the same type... sort of like fn(foo<T> f, bar<T> b);
 
morning
@thecoshman yes.
 
does fn need to have template<class T> then?
 
@thecoshman pretty sure
 
9:38 AM
righeo :)
 
why templates, does?
 
yes :(
 
ouch
 
Well that sucks
Having your dreams crushed simply because you might not be able to do it...
 
9:49 AM
the top comment is probably the best thing to do
 
unfortunately that's the nature of the world
 
user1804599
The best thing to do is not to be an asshole. IOW don't force innocent people to live on this world.
 
user1804599
I sympathise with everyone for being alive.
 
Question: why don't we have closures in C++?
(Or is it in C++14 or C++1z?)
 

« first day (1603 days earlier)      last day (3336 days later) »