« first day (1682 days earlier)      last day (3271 days later) » 

9:00 AM
To be honest it's as easy as changing that.
I don't actually use nullptr_t explicitly.
 
user1804599
Make a function called some if you find optional<T> too long to type.
 
optional<int*> o = nullopt; // empty optional
optional<int*> m = nulltpr; // nullptr optional
 
@BartekBanachewicz There's no problem in this case either.
 
So if I really wanted to change it I could :|
 
user1804599
Only a retard would make an implicit conversion from T to optional<T>.
 
9:00 AM
@Rapptz It was a joke.
 
@Puppy there is in that while int* i = nullptr; assignment works, optional<int*> o = nullptr; doesn't
 
Knowing that /api/plural/ yields a list, should I go for /api/plural/id or /api/singular/id
~bikeshed~
 
@buttifulbuttefly singular
 
@BartekBanachewicz I don't see that as an actual problem.
 
@buttifulbuttefly /api/plural/id.
 
9:01 AM
optional<T> does not have to mimic T's interface in every way.
 
that's what I see in the wild (assuming this is a REST HTTP API)
 
so you propose an optional that silently changes some of the wrapped type assignments to mean something else
and you don't see a problem with it.
well.
 
I would probably not accept anything other than a T in the assignment operator.
 
user1804599
It should mimic T's interface in no way at all.
 
user1804599
It's not its job.
 
user1804599
9:03 AM
It's T's job.
 
Anyway like I said the constructor is implicit so you can easily construct from e.g. an init list or something.
 
@Puppy why don't you forbid all implicit conversions while we're at it.
 
I would not accept random things that can be assigned to T.
 
@Rapptz mmm right
 
@BartekBanachewicz I forbid implicit conversions where necessary.
 
user1804599
9:03 AM
Make reset take T.
 
I thought that the rabid functional guys hated implicit conversions anyway
 
lol
 
user1804599
Then you don't need operator= to take T (and it's shouldn't as it's retarded).
 
Yeah I checked on SO too
 
9:04 AM
awesome rhetorics, @Puppy
 
got any links?
not sure how I'd google this
 
I can't into English today.
 
user1804599
@buttifulbuttefly plural.
 
user1804599
Singular is ugly.
 
user1804599
It's a namespace, not a variable.
 
9:10 AM
fixed by default or scientific by default?
inb4 defaultfloat
 
user1804599
@Rapptz define "default".
 
JSON.stringify starts using scientific at 1e+21
 
user1804599
The type of 4.5 is the rational type in any sane programming language with typed constants.
 
Hm.
 
9:12 AM
JSON.stringify(10000000000000001) => 10000000000000000
lol
 
user1804599
ewwwwwwwwww implicitly losing information
 
user1804599
bugs will punish you for it
 
Ummm wait, does JS store numbers as double or bignum
 
double.
 
user1804599
Double.
 
user1804599
9:13 AM
Do you really think they designed something well?
 
user1804599
In JS, when you don't know whether it picked sane alternative A or insane alternative B, it's B.
 
@rightfold ..or C - the alternative you didn't even consider.
 
bignum would be annoying tbh
 
user1804599
Nope. It's the only sane thing to do.
 
lol
sane would be having doubles and integers rather than having only double
 
user1804599
9:16 AM
Bignums are safer and no less convenient and therefore should be preferred as default.
 
user1804599
@Rapptz Yes, and have both be bignums.
 
nty
 
user1804599
And also have rational, of course, because that's what you often really want when you're using double.
 
user1804599
@Rapptz have fun with your overflow bugs, then.
 
user1804599
I won't worry about them!
 
9:19 AM
yeah I love expressing irrational numbers with a rational type
great thinking
 
> and also have rational, of course
tbh this is one of the rare cases where @rightfold is right
 
> because that's what you often really want when you're using double.
 
> often
 
user1804599
@Rapptz I never said you should express irrational numbers with a rational type???
 
of course you also want fixed-width integers
 
user1804599
9:20 AM
Often you don't need irrationals. Of course, expressing irrational numbers with a rational type would be completely irrational.
 
Anyway.
 
and by fixed width I mean uint32_t and friends
 
@buttifulbuttefly Bad idea I think.
 
for interfacing with hardware and shit
 
user1804599
However, whether you go floating-point or not, literals losing information is literally retarded.
 
user1804599
9:21 AM
Literals should either compile-time error if they can't be exactly expressed in the type they have, or have a type they can be exactly expressed in.
 
@Rapptz Rated 22/7.
 
Who thinks I meant writing code to interface with actual shit? Because FYI that's not what I meant. :P
 
@Rapptz Up to you, as long as I can display the numbers in a fixed way (1e6 too small to start using sci notation)
 
that's really weird though
std::defaultfloat shouldn't do that
 
Maybe it's just MSVC.
 
9:24 AM
@buttifulbuttefly I didn't consider this.
I implemented std::defaultfloat before
It turns 1e6 into X = 6 (because it's 1 * 10^6 obv) and P is set to the precision (in this case 10) and if P > X >= -4 then it uses fixed notation.
Otherwise it uses scientific
 
user1804599
@Griwes meh, you can have functions like Perl's pack.
 
@rightfold I prefer casting addresses to MMIO registers to actual language structures.
It's convenient.
 
user1804599
I don't.
 
whatever floats your goat
 
user1804599
The serialisation format should not dictate the data structure.
 
user1804599
9:27 AM
They should be completely orthogonal.
 
@Rapptz wait.
 
I like my register be actual variables.
There's nothing more convenient than that.
 
no
 
user1804599
9:28 AM
@Griwes I prefer maintainability over convenience.
 
Disregard everything I said. I wasn't looking at the correct output.
 
@rightfold It is maintainable.
 
user1804599
@AndyProwl you're confusing them with Polymorphic Potato.
 
@rightfold Yeah sounded related
he had a Lounge style
 
user1804599
Bit 420 is the high bit.
 
9:30 AM
@rightfold Good luck serializing and deserializing these all over again whenever you want to read a single field.
 
user1804599
When programming, you don't do things "all over again".
 
terrible monday
 
user1804599
Instead, you write functions that do it.
 
@rightfold sigh
 
user1804599
DRY is programming 101.
 
9:31 AM
jesus
to deserialize
 
user1804599
Jesus is dead.
 
you have to call that function
 
@buttifulbuttefly Last May holiday!
 
user1804599
Yes.
 
and you have to do that all over again every time you want to read the field
vs just reading the field
 
user1804599
9:31 AM
There's no huge difference between x.y and readX().y.
 
If you prefer calling a function every time, you are insane.
@rightfold Yes, there is. Readability.
 
user1804599
auto x = readX();
x.y
x.z
x.w
 
@LucDanton Speak for yourself. Not on holiday.
 
user1804599
@Griwes Then use a programming language which supports UAP.
 
@buttifulbuttefly I’m spreading the expat love.
 
9:32 AM
@Griwes Yes, you're right. x.y implies something completely different to readX().y, which is that the programmer controls x and the value won't spontaneously change.
 
lol
 
user1804599
If readX() changes x then it's a bad API.
 
readX().y is a more honest approach if an external system can change the value.
 
> This is a public wiki. Do not blindly use code you find here aboard any spacecraft.

If someone vandalizes the example for std::lower_bound right before you copy-paste it into your vacuous bureaucracy detection module, don't be surprised if your spacecraft is overrun by Vogons.

In fact, if you're writing code for spacecraft, you probably shouldn't be copy-pasting anything.
 
user1804599
See CQS.
 
user1804599
9:33 AM
Oh you mean that.
 
@rightfold I'm just using a language that let's me have fixed width integers so I can not care about all this nonsense. So... whatever.
 
user1804599
Concurrent updates, yes.
 
user1804599
Then you need a getter anyway.
 
If your language doesn't support that, it's useless for interfacing with anything hardware related.
Therefore it's useless for me.
 
user1804599
I disagree wholeheartedly.
 
9:33 AM
that... is not terribly meaningful really.
 
Feel free to disagree.
 
user1804599
I always do.
 
I imagine that not all that much software interfaces directly with hardware.
 
user1804599
No need to tell me.
 
user1804599
@Puppy My software interfaces directly with the CPU!
 
9:34 AM
my software interfaces with all of your moms
4
 
the code generation layer of the compiler interfaces directly with the CPU
 
@Puppy I want my code to be usable in as many contexts as possible (since I don't want to reimplement stuff in tens of languages just because they all suck for some of the cases I care about).
 
@AndyProwl lol
 
@Puppy I want to be able to take some piece of my userspace library, slap it into kernel land and have it just work. The simplest way to get that is to use the same language everywhere.
 
32 mins ago, by Puppy
I thought that the rabid functional guys hated implicit conversions anyway
lol
well okay
 
user1804599
9:36 AM
Functional programming and implicit conversions are orthogonal.
 
@Griwes That's true but also not very meaningful because that's just not a very useful thing to do.
 
Hence I have multiple requirements for languages I use, and frankly, there isn't a language that meets all of them at the moment.
 
@rightfold not if you want to insult people
 
@Puppy For you - maybe. For me - yes it is.
 
user1804599
@BartekBanachewicz fuck you!
 
user1804599
9:37 AM
insulted, still orthogonal
 
@Griwes I'm thinking less about me and you and more about the overall proportions here.
namely that the overall proportion of programmers with that requirement is going to be very minimal.
 
user1804599
@Griwes Then design one that does.
 
functional programming and insults are orthogonal
@rightfold And what do you think I am doing?
 
user1804599
I don't think anything about what you're doing.
 
@Griwes I don't like this style
 
user1804599
9:38 AM
I'm more thinking about when I will get my ass out of my bed and into the shower.
 
@Griwes WORLD NEEDS MORE LANGUAGES GO
 
user1804599
Yes, Go is pretty nice.
 
@Puppy Please do notice that in almost every message in this discussion I mentioned that I am being egocentric in this context.
 
Go wasn't a dissapointment for me
 
@BartekBanachewicz Yes, they all suck.
 
9:39 AM
Go is pointless
 
@Griwes I actually was watching BSG: Razor and therefore did not really read the whole discussion.
 
user1804599
Factor is point-free.
 
@Puppy That's fair. :D
 
@Griwes see you should be puppycentric
 
pointfree is terrible
 
9:40 AM
but I think that I certainly won't argue that you have the requirements that you say you do.
 
user1804599
Use Perl.
 
@rightfold Oh yes, the language of all the syntaxes ever invented.
Is there a syntax Perl doesn't support?
 
@Griwes Makes me wonder why did you choose this thing to throw at it. Doesn't perl have more flaws?
 
user1804599
Modules can change the code of the modules that import them at parse-time.
 
user1804599
It's called source filters.
 
user1804599
9:43 AM
So a lot of syntax is allowed.
 
@BartekBanachewicz Dunno, I don't know perl save for the ~10 scripts that didn't do anything meaningful I wrote for some uni course.
 
@BartekBanachewicz Probably, but I'm not sure that you really need more than "Parsing it is literally undecidable"
 
you know
 
user1804599
Pretty much everything that starts with use SomeFilter; is valid Perl code if SomeFilter is a source filter that outputs valid Perl code.
 
if it wasn't for rightfold, we wouldn't have a single discussion about perl here
pretty much everyone except maybe java zealots like coshman agree that perl sucks
 
user1804599
9:45 AM
Parsing Perl isn't undecidable if you can execute arbitrary Perl code at parse-time.
 
user1804599
Then it's just context-sensitive.
 
we should stop getting dragged in perl discussions, assess that it's fucking terrible for once and stop talking about it whatsoever
we can then slapfight about something marginally more useful
 
s/perl/perl java c haskell/
 
@Puppy except like half of the room writes in haskell, so it doesn't really apply
I think you're the only one actually actively opposed to it
 
user1804599
use Filter::sh 'tr XYZ PQR';
$a = 1;
print "XYZ a = $a\n";
 
user1804599
9:46 AM
prints PQR a = 1 XD
 
as for C and Java I pretty much agree.
 
Anybody tried intel cilk? One of the main problems with OpenMP style parallelism is the difficulty of building assembly line models.
 
user1804599
@Griwes yes, that's just context-sensitivity.
 
user1804599
While executing the code you can determine that and hence you can parse it while executing the code.
 
user1804599
9:51 AM
It's known at compile-time what the prototype of whatever is.
 
user1804599
The grammar of Perl isn't formally specified anyway, so you can't even discuss it.
 
user1804599
You can only discuss one particular implementation of it, which is obviously decidable since it exists.
 
see @Griwes that's what I meant
 
user1804599
You also have to be able to execute arbitrary C++ code if you want to parse C++ code.
 
@rightfold I don't think this is true.
 
user1804599
9:55 AM
234
A: Is C++ context-free or context-sensitive?

riciBelow is my (current) favorite demonstration of why parsing C++ is (probably) Turing-complete, since it shows a program which is syntactically correct if and only if a given integer is prime. So I assert that C++ is neither context-free nor context-sensitive. If you allow arbitrary symbol seque...

 
user1804599
Add constexpr functions to the mix for extra horror.
 
user1804599
OK, not arbitrary C++ code, but still a Turing-complete subset.
 
You can have implementation-defined limitations on it.
 
user1804599
You can also make this example into something that parses differently based on the result, instead of resulting in a syntax error.
 
err what
C++ is parsed before constexpr is executed.
 
user1804599
9:57 AM
Please read the answer I linked.
 
user1804599
Especially the example at the bottom of it.
 
user1804599
Constant expressions are evaluated while parsing.
 
Is Noam Chomsky a serious thing?
 
@rightfold mm. That's a bit different innit.
 
user1804599
@BartekBanachewicz No. Technically, it's still arbitrary C++.
 
user1804599
9:58 AM
Since it's Turing-complete, you can write a C++ interpreter in it.
 
yes, arbitrary > arbitrary C++
 

« first day (1682 days earlier)      last day (3271 days later) »