« first day (1039 days earlier)      last day (3903 days later) » 

3:00 AM
as in creating own syntax for a programming language
 
I have another Haskell question if anyone's up for it
If I'm doing foldr f x ys, and I change the function f to return a tuple instead of a list, how could I modify the foldr to fold over the tuple's snd (still a list), while also accumulating the fst tuple elements into a new list?
 
@nightcracker Look at how Lua handles variadics, they're pretty easy.
 
@DeadMG Lua has RTTI
 
I still suck pretty badly at writing metaprogramming stuff.
 
Oh it's called std::index_sequence?
I thought it was std::integer_sequence
 
3:02 AM
@nightcracker That is not really relevant for the issue at hand.
@Rapptz It was.
 
@DeadMG it is, I'm talking type-safe compile-time varargs here, so the types can be inferred and code can simply be generated.
 
Whoa that example has swallow.
@nightcracker Yeah this is why I suggested variadic templates but.. you seem opposed to the idea.
 
@nightcracker "types can be inferred" - Sounds like a job for templates for me.
 
@nightcracker The syntax that Lua uses would be just fine for a compile-time type-safe variadics.
 
3:05 AM
so how does <tgmath.h> work? Is it just "compiler magic"?
 
2
Q: How is <tgmath.h> implemented?

syncC doesn't have (to the best of my knowledge) overloading or templates, right? So how can a set of type-agnostic functions with the same name exist in plain ol' C? The usual compile-time trickery would involve a whole bunch of macros, wouldn't it?

That?
 
@MarkGarcia @Rapptz I'm building on C here, so I try to avoid generics for the moment
 
I see, good luck.
 
not sure whether it's possible though
 
@MarkGarcia Wow that blog is mad eh?
 
3:08 AM
@DeadMG same limitation - how would you iterate over arguments efficiently in any order except linearly from start to finish
 
@nightcracker In Lua, you can use local t = { ... } and simply obtain a table of the arguments.
so you can do my_variable_syntax = { ... }; similarly, or however you would care to define a tuple.
and then you can iterate over the arguments just the same as how you would do for a normal tuple.
 
@DeadMG (or use arg)
the problem is that I do not have a tuple type or anything - I guess if I solve that in a nice way I'll solve this too
 
oh right, C.
 
... is better.
arg = meh.
@nightcracker Tuples kinda important. I don't have either tuples or variadics yet, but I'm planning on something akin to what I wrote above.
besides, honestly, there's a fuckin' long way to go from "conception" to "Holy shit, I need variadics and tuples!".
 
I just keep hoping there exists better solutions than templates
because damn those are some nasty ass beasts
(and slow for compilation, bad for code generation)
 
3:15 AM
Playing with templates has to be one of the most fun parts of C++.
 
he's using C
C doesn't have templates anyway :v
 
@Rapptz Yeah, such a shame.
And not even overloadable functions.
 
oh that's fixed
things are so much easier when you haven't defined / care about an ABI yet
 
3:33 AM
@nightcracker Sure. Floating vtables. See: Haskell.
(Assuming we're talking about parametric polymorphism, primarily, not code generation)
 
He's.. talking about variadic arguments.
 
Oh. Well.
N-ary tuples. :v
 
Don't know how you'd write a tuple in C actually.
sounds interesting and annoying
 
Everything in C is annoying.
 
5
A: Is it possible to imitate python tuples in C?

Matthew SlatteryA typical pattern in C for implementing an object that can hold one of a number of different basic types is to use a struct containing one element which is a union of the possible basic types that can be stored, and one element which is an enum identifying which of those types the union is being ...

 
3:40 AM
It's sad when untagged unions are your most powerful tool.
 
the _t being reserved by POSIX thing is bull shit.
 
the joy of writing your own language
 
argh.
fucking stomachpocalypse
 
@CatPlusPlus: On OpenVMS, calling exit with any odd value denotes success. exit(0) is treated as a special case for the sake of C conformance. Yes, POSIX is a standard, but not all systems conform to it. If you want to write code that assumes POSIX, you're free to do so, but it limits your code's portability. — Keith Thompson 3 hours ago
Yes, ping me about a comment from last year, with this very useful information I do not care about in the slightest.
 
it was only like, 30 minutes before my usual bedtime
 
3:46 AM
OpenVMS supports the following industry standard tools and applications:[citation needed]
Samba (CIFS)
Apache HTTP Server
Apache Tomcat
Diskeeper
Zip/Unzip (Info-Zip)
GNU Privacy Guard (gpg)[48]
Perl[49]
:laffo:
 
@CatPlusPlus I disagree. The fact that it's avoidable is...pretty nice.
 
But is avoiding C part of C?
Are we all in C?
What is life?
 
C is not the answer. It's the question.
The answer is yes.
 
Explosions?
 
@CatPlusPlus I'm in C (at least in the phone book).
 
3:50 AM
My Condolences.
 
__C__atPlusPlus
welp that didn't work
 
You suck.
 
@nightcracker C is not the question. Sex is the question (but you're right about the answer).
 
SEXYES
 
At least C is std-free.
3
(That's an old crappy joke and I'm ashamed)
 
3:51 AM
wow
 
I don't know if I should try getting sleep, or just press on till the end of the day.
 
ok I'm starring that for humiliation
 
C doesn't have std::free indeed.
 
Right, right. You liked it, admit it.
 
But doesn't C have stdlib?
 
3:52 AM
No, it only has a poor excuse for one.
 
@Rapptz C doesn't have the std namespace.
 
@CatPlusPlus You're screwed either way.
 
@CatPlusPlus I decided for the latter.
 
I'm really bored.
 
3:54 AM
I promised my boss I'll stop by the office today.
 
I have to work today...
 
@Rapptz Cat's screwed and you're board. Sounds like Lounge<Carpentry>.
 
Ugh.
It's gonna rain, awful puns are flying low.
 
It's a pun limbo party.
 
4:04 AM
yes
we're the people
ok some theme music
 
More like
 
Damnit cat
been snatching some catnip again?
 
Wow that video's awful
 
oh boy
here we go again
ALL_BUILD.vcxproj
 
4:14 AM
There are no small 6502 questions.
 
@ScottW Yeah, I guess.
Certainly can't guarantee an answer though -- those neurons haven't been exercised in a long time.
 
Not enough PLEASE.
 
@ScottW I hesitate to say it's useless without seeing the rest of the code, but it sure doesn't seem to do anything in the code you've shown.
There was a fair (unfair?) amount of self modifying code back then though, so it's possible that's basically just there as a three-byte nop to leave space for something else to be filled in later.
 
Huh August is ending.
 
I hear september is coming
 
4:22 AM
Time flies much faster at work than at uni.
 
holy fuckin' shit, I'm so sick.
 
@DeadMG you may or may not want to change your username
RainbowSparklesMG
 
Yes.
9th October, Supernatural comes back. So at least one upside of uni coming back so fast.
And ugh team project this semester.
I don't wanna.
 
I had a 10/10 on informatics at my high school
then the team project came along...
ergh VS2012 so ugly
 
4:40 AM
you know
I could go back to university.
maybe I should.
 
why did you leave?
 
er, it's university
 
FOR FUCKS SAKE
After 1 hour of building I find out I was building debug and I wanted release >.<
 
owch.
sounds like me building Clang.
 
(LLVM)
 
I'm going to attempt sleep again
wish me the luck
 
GL
 
the luck
 
"Why do I get these grand aspirations to become more productive at night when I'm about to go to bed but then the next day I just slouch around and do nothing?"
 
I wonder if there is a lot of overhead chaining functions like this.
 
4:45 AM
@Rapptz sounds just like me
 
@Rapptz Human nature is a powerful thing :P
Is boost::signals2 something that you use a lot?
 
never
then again I'm a modern C++ illiterate
I'm honest more of a C guy =/
 
Usually I get by with std::function.
 
I want high level features, but not in the way C++ does them, because I don't want to write high level code using my blood
 
I like C++.
 
4:50 AM
@nightcracker I don't really think it's that problematic.
 
Yeah same here
C++'s issues are sorta blown out of proportion IMO.
 
I have an unnatural strong disgust for boilerplate
 
Putting :set paste in my vimrc file doesn't seem to have any effect.
 
Yet you code in C?
?_?
 
@nightcracker So do I.
 
4:51 AM
Anyway, I don't write much boilerplate.
So I don't experience issues with it.
 
@Rapptz no, I code in Python
 
@Rapptz me too.
 
@Rapptz unless I need performance, in which case I write an Python extension in C
@Rapptz using those two I usually get around pretty nice
 
Do you use include guards or #pragma once?
 
include guards
 
4:54 AM
guards
 
include guards
 
Me too. But I wonder if I should use pragma instead.
I think it's less error prone.
 
@StackedCrooked #pragma once
 
honestly they're slightly more work and slightly more error prone, but at least your shit compiles everywhere
 
My include guards are automatically generated
 
4:54 AM
#pragma once is usually automatically included when you are using VS
 
and I haven't honestly made an error using include guards ever
 
#pragma once also compiles everywhere. It's de facto.
 
On which compilers does pragma once not work?
 
Why is it more error prone? Because I might for get #endif?
 
tiny c compiler?
 
4:55 AM
never tried it on gcc
 
@StackedCrooked non-Visual Studio, Clang, and GCC compilers.
so probably ICC and.. idk
 
@StackedCrooked None that I remember. But there was once a GCC release where they deprecated the feature.
 
Oh no, ICC supports it.
 
@Chemistpp you might have a typo or you might accidentally use the same guard for two files (happens to me at least a few times per year)
 
@StackedCrooked oh I see. That makes sense.
especially if you're not writing all the files yourself
 
4:56 AM
C and C++'s module system with includes is just so awful
 
In the C and C++ programming languages, #pragma once is a non-standard but widely supported preprocessor directive designed to cause the current source file to be included only once in a single compilation. Thus, #pragma once serves the same purpose as #include guards, but with several advantages, including: less code, avoiding name clashes, and sometimes improved compile speed. Example ;File "grandparent.h" #pragma once struct foo { int member; }; ;File "parent.h" #include "grandparent.h" ;File "child.c" #include "grandparent.h" #include "parent.h" Advantages and disadvant...
 
it's a large contributor to awful compile times
 
@StackedCrooked I do MAIN_DIR_SUBDIRS_FILENAME_HPP
so I don't get many collisions
 
@Rapptz I can't stand doing that.
I do a lot of headers.
 
Here's an example
 
4:57 AM
I do OuterNamespace_InnerNamespace_FileName_H
 
ouch
I do what Rapptz does
 
#ifndef MYCOMPANY_UTILS_TIMER_H
 
oh that's fine
I thought you were using actual CamelCase
 
Most Boost headers does #pragma once inside include guards.
 
4:59 AM
Actually my coding style is heavily based on Poco's.
 
if everything else fails you can always use a 128 bit random number as include guard
 
I don't think I've ever gotten include guards wrong before
Anyway, I want modules. I can't wait til C++ gets it.
#1 most anticipated feature for me.
 
drastic compile time reduces
 
Concepts come at #2
 
concepts?
 
5:02 AM
template stuff, you probably wouldn't like it since you think it causes "boilerplate" :P
 
can you describe it?
 
Concepts is axioms and constraints.
 
@nightcracker Constraints and axioms that would significantly make using templates more enjoyable.
 
Basically to constraint a template type to a certain type class.
 
Though I doubt if writing templates would be that enjoyable.
 
5:03 AM
ah similar to go's interfaces?
 
I don't know, I was thinking more like Haskell's type classes.
 
@Rapptz Teheheh.
It'll be a mix of headers, modules, tears and pain.
 
I'm a hobbyist, so only modules and no tears.
 
Anyway, you get diagnostics at the point of use of the template, which is much better than the compiler error novels.
 
chromium tarball is 2.2 GB ...
 
5:06 AM
what
 
Are modules really gonna have a big impact?
 
jesus christ
 
Chromium also requires 64-bit OS and more than 2GB of RAM to build.
 
@StackedCrooked I think yes
 
Well, link.
@StackedCrooked If they do it right, and everyone switches to them.
 
5:08 AM
@StackedCrooked the amount of analysis options it gives to the linker and compiler allow for quite some smarter compilation process, giving smaller compilation times and potential faster code
but don't count too significant improvements on the latter
 
Does it offer anything besides faster compile times?
 
Do you need more?
 
a more intuitive way to use/create libraries
 
I would definitely like faster compile times.
 
@StackedCrooked Less workarounds and #defines.
 
5:08 AM
honestly, a lot of aspiring programmers get stuck on how linking works and such
 
Serves them right for picking C++ before knowing what the fuck.
 
hell, even I end up spending way more time than I should resolving those issues
 
But I find it odd that every shouts "modules!" while that's just one means to an end.
 
what alternative do you propose?
 
C++ compilation model is ridiculously outdated and shitty.
 
5:10 AM
that ^
 
I don't propose anything. I just think it's weird.
 
Another big part of it is need for declarations.
 
@StackedCrooked Well, have you read the proposal/presentation on it?
 
(But not in classes, no, we can't do anything consistently)
 
@Rapptz I saw the LLVM presentation.
 
5:11 AM
@StackedCrooked Ah well, C++ folks as we are, not seeing include guards and enable/disable feature #defines really does look weird. :)
 
Feature defines is an unrelated matter.
 
@StackedCrooked That's good :)
 
ah nice
llvm is building my sparc support
....
 
@Borgleader Bit late, but I couldn't help thinking of this:
Wait, how did I ping Borgleader?
@StackedCrooked See above
 
5:20 AM
@chris It scrolled, you clicked. When it's busy, it can two or three tries to get the right one...
 
@chris That was my inspiration :)
 
@JerryCoffin It was a static transcript :(
 
@chris That kind of takes away that excuse...
 
SAM
Hey yesterday, the name was Lounge<Fortran>
Now is it changed?
 
@JerryCoffin Well, I was just about to go to bed anyway :p
Good night.
 
5:21 AM
@JerryCoffin It shouldn't scroll when you're not at the end.
 
@CatPlusPlus True.
 
room topic changed to Lounge<JAVA>: Actually above wouldn't compile. [c++] [c++11] [c++-faq] [no-doubt] [no-questions]
 
@SAM Usually gets edited at least once a day (and sometimes a several times an hour).
 
6:01 AM
So.. hold on..
A game.. that can be beat in 47 seconds.. got a 91 on Metacritic.. and costs $20?
 
What game?
 
>game reviewers
 
Graphics looks like Bioshock run in Source engine.
 
Anyone remember the dupe for this?
0
Q: C++11 user-defined operator

Khurshid NormuradovI learn C++11. And I interested in user-defined operators. So I decided little bit play with it. More languages have syntax like this: int n = 1000_000_000; I try to simulate this feature in C++11. inline constexpr unsigned long long operator "" _000 (unsigned long long n)noexcept { r...

 
What is it with these broken avatars.
 
6:12 AM
wut
 
Oh, Facebook.
 
"More languages have syntax like this:"
int n = 1000_000_000;
what's that guy smoking
 
@CatPlusPlus Oh.. that explains it. I have FB blocked and get the occasionally dead avatar.
 
@nightcracker I actually remember some proposal for that kind of feature.
 
@Rapptz Yup.
Ghostery kills them for me.
I just wish the alt text didn't overflow.
 
6:15 AM
5
Q: Representing big numbers in source code for readability?

user1182183Is there a more human-readable way for representing big numbers in the source code of an application written in C++ or C? let's for example take the number 2,345,879,444,641 , in C or C++ if we wanted a program to return this number we would do return 2345879444641. But this is not really reada...

it was this..
 
foldl saves the day again!
 
@Rapptz Oh. That's it. And it's not a proposal as I've thought.
 
time to close it
 
looking at LLVM build: 'grep': command not found
 
6:36 AM
@Rapptz won't a UDL solve that problem ?
 
no
 
I see you've started to leave messages in edit reasons, too.
 
@Rapptz not this ?
 
Not constexpr.
 
lacking
 
runtime overhead is cool
 
6:53 AM
Oh gawd.
 
It's not about overhead.
 
can't do constexpr long long = "1,234,567"_lon;
 
other constexpr then? compiler overflow checks ?
 
Not portable too, btw.
 
we need constexpr strings
 
6:54 AM
Template arguments, enumerators, other contexts requiring a literal.
 
isdigit is messed up in MSVC.
 
btw when did Gam Erix leave?
tbh I didn't even notice.
 
Same. I found out he was gone through that question, lol
 
We're bad community curators.
 
@R.MartinhoFernandes Also, ew. typeid.
 
6:57 AM
@Rapptz Hmm, it now occurs to me that I didn't actually read the contents of the answer.
 
Also we need to keep Robot away from sbi's posts.
 
Backtick spam annoys the hell outta me.
@CatPlusPlus He uses bold and italics, not code.
 
Xeo
@CatPlusPlus sbi overuses _, not `
 
Back when I checked the hell hole that is the review queue I saw those a lot
 
Still markup.
 
6:58 AM
with the idiotic message of "Improve readability"
ugh
 
Review queue is funny.
Also I've now wasted 1400 days on this site.
Fifth Yearling soon, at least.
 
800 days
 

« first day (1039 days earlier)      last day (3903 days later) »