« first day (1246 days earlier)      last day (3702 days later) » 

8:02 PM
meh, I develop on a mac and it's pretty good, but a lot of their software has been incredibly flakey lately
 
0
Q: C++1y/14: auto template variables?

Andrew TomazosIs the following C++1y/C++14 program ill-formed? template<class T> constexpr auto X = 42; int main() { static_assert(X<int> == 42, ""); } Why / why not? Clang trunk complains that: error: invalid operands to binary expression ('auto' and 'int')

 
sbi
8:14 PM
Good evening.
 
evening.
 
sbi
Oh, it's you guys here tonight. Where have all the interesting people gone?
 
afternoon
 
sbi
:)
 
@sbi dunno we have only a boring mon ape here
 
8:16 PM
@sbi Don't worry, I have returned.
 
sbi
@Abyx Oh, really? Who is that?
@DeadMG That was exactly what i was worrying about...
Feb 19 at 8:27, by Tony The Lion
I think the Ape makes some very valid points
(Did I ever mention that I like @Tony?)
 
@LightnessRacesinOrbit that's confusing to say the least
 
sbi
@R.MartinhoFernandes Age is not a function of the number of years you've lived. (Didn't I tell you that before?)
@Borgleader Mostly with one of my sons, though. (That caused a bit of a fuzz last night, when his mother (where he stays this week) found out we're playing together, and got jealous that he would spend time with me while staying with her.
Mothers can be so incredibly irrational.
Of course, you all know that.
 
sure it is not. the age doesn't stop to increase when you die.
 
sbi
@R.MartinhoFernandes How socially awkward to suggest that.
 
8:20 PM
so the correct thing to state is "Age is a function of the number of years you've lived + the number of yours you've been dead"
 
sbi
@melak47 I thought you're doing this all the time, here and elsewhere?
@JohannesSchaub-litb No, that is not the correct thing to say. It's tempting for a numberhead like you to think so, but it is wrong.
 
@sbi what's that supposed to mean :(
 
numberheads have been right most of the time, as proven by history
 
sbi
@melak47 That means that you don't have to wait until then to be socially awkward together. You already do this, all the time.
@JohannesSchaub-litb So they think.
 
Xeo
Oh look, it's TGOM
 
8:24 PM
@sbi Oh thats cool :) (except for the wife jealousy part)
 
sbi
@sehe It's a bit more relaxed since I withdrew from a lot of volunteering my time for that semi-political cause. For example, I used this week's excellent weather by taking most of the week off and digging through my garden. That was wonderful. (Even though I now hurt in places I didn't know I have places at.)
 
hmm, i wonder what's the best thing to do with a stream when you want to parse text from a stream?
 
sbi
@Borgleader Ex-wife. (One of them.)
 
say, I have a class Parser { ... } and it gets a stream from its ctor
 
sbi
@JohannesSchaub-litb Write a parser?
 
8:25 PM
@JohannesSchaub-litb Lex it first.
 
should it take it by std::istream &is; as a member, should it move to std::istream is; as a member?
i mean, how do you keep the stream?
 
you don't
 
i have the feeling that moving would appropriate
 
use iterator pair.
 
Xeo
A value std::istream member would slice in almost all cases
 
8:26 PM
i don't want my whole parser as a template, since I know in beforehand that i will read chars from it.
@Xeo ah right, forgot about that :/
looks like a std::istream *is; should do it?
 
@JohannesSchaub-litb Yes, but tying yourself to a specific input source seems a smidge silly.
 
it's non-owning, so it should be fine?
 
personally
 
@DeadMG i thought I would use streams so that I decouple myself from the specific source
 
no, that's iterators.
 
8:28 PM
perhaps i should look at boost streams. somehow I mislike the std streams
 
I go iterator range -> range -> lexer -> parser.
 
sbi
IME, for parsing you often need a way to backtrack, and streams are bad at that. When I wrote the last serious recursive descent parser (for XPath), I created my own buffer that would read from a stream, but buffers characters read since the last commit operation, until the next commit. That way I could backtrack to any earlier point after the last commit.
 
or managed code callback -> range -> lexer -> parser.
 
sbi
@sehe Oh, and no, RSS. Really. But I only read the interesting parts of the transcript. Why waste time?
 
if you have a std::istream* member, how am I going to express a VS managed ITextBuffer as a std::istream*?
 
8:30 PM
i think i will write my own istream based on FILE
I don'T think i need rollback. my grammar seems LL(1)
 
sbi
"You don't write your own stream. You write a stream buffer."
 
@sbi I wrote backtracking as an adapter on top of the lexer, so the input source and the lexer don't need to care about backtracking, which is nice.
although personally
I am leaning towards creating a generator to meet my needs.
 
@DeadMG that of course only works if the lexer works the same in the other branch aswell
 
@JohannesSchaub-litb If the parser backtracks, this should certainly not ever involve any changes in the lexed token stream.
it's a backtrack in the parser's decision tree that should have absolutely nothing, ever, to do with the lexer.
 
sometimes the lexer depends on the parser. with some cruel language
 
8:34 PM
I'm pretty sure that even C++ would not require such functionality.
I'm familiar with most of the nasty spots there
oh wait, I think there is something about class members which might require that.
but fortunately, Wide has no such cases.
 
let's say you have regular expressions in your language and "[A/*v]" is a valid regular expression. but if not in a regular expression, the "/*" would be lexed as the start of a comment
i've met similar language cruelness in real life :)
 
that's a general lexing problem, which has little to do with the parser.
 
well if only the parser knows when a regex starts, then it has to do with the parser
only the parser knows when the "[" must start an array index
 
the parser doesn't decide when a regex starts, the lexer does.
the parser only decides when a regex is grammatically valid.
 
well, i have experience with some language where it was that way
 
8:37 PM
well, obviously your design can only be as not screwed up as the language you're parsing.
 
can't tell you what exactly the matter was but surely it was something very similar like this
 
but IME doing things like error handling was more annoying than things like backtracking.
in fact, I feel that the best parsers do not backtrack.
 
the most difficult thing IMO is recovering with something to continue parsing
 
yes.
there are many possible ways to handle bad tokens and it's quite grammar-specific I feel.
 
just giving up and printing the first error is way more easy
 
8:40 PM
I figured that I wanted my parser to handle it mostly when the user was typing in their code live
and that errors would mostly occur because they had not finished inserting in the middle
so if you come across a bad token, it should be because that token is actually the start of another production later on that is valid.
which works quite nicely.
you kinda throw the bad token down the stack and each rule checks to see whether or not it could use this token to continue
the problem is that I have to author each continuation point manually
 
This is a conversation I know nothing about, so what better time to wade in!
 
and I also find that neither LL nor LR is very suitable for generating parsers
 
Is the parsing strategy the reason that C++ errors (at least in VC++) look so esoteric and come in an order other than what you might expect?
 
at least, not ones you'd actually want to use in most cases
@TomW C++'s compilation model and grammar and such in general are horrendous, so there's not really any good implementation.
 
sbi
@ThePhD That strikes me as pretty one-sided wishes. Isn't there anything besides music and computer you are interested in?
 
8:47 PM
@DeadMG grammar? what's wrong with it?
 
It's hell
 
@Jefffrey Everything.
 
I visualise a really complicated data structure of some kind that's half-finished being unwound in order to list errors, where the unwinding is a lot less sophisticated than the process that built it in the first place
 
Writing C++ parsers is an exercise in willpower (so you don't kill yourself)
 
@DeadMG such as?
 
8:48 PM
well, let's see.
parser state and semantic state influences lexer state in a bunch of cases, like identifier/typename, >>, <::, and such.
 
Xeo
@Jefffrey typename, template disambiguators
MVP
 
ambiguities like MVP and typename, template problems.
 
Xeo
operators vs declarators
 
Declarators in general
 
Xeo
^
Fuck C grammar
 
8:49 PM
so yeah
there's actually a whole load of cases.
 
It's context-sensitive mess that has new things bolted on with every new version
 
<> for templates just makes things worse.
 
@DeadMG what else would you use?
 
you can't resolve the parse tree without instantiating the template in some cases, and templates are Turing-Complete.
@Jefffrey D uses !(), Wide just uses () in most cases.
 
the phrase 'in some cases' speaks for itself
 
Xeo
8:50 PM
@Jefffrey Whatever.
Whatever is not ambiguous
 
Haskell also uses Haskell's function application syntax.
 
std::vector@int@ of course
 
jesus christ no
 
there'd be nothing wrong with std::vector(int).
 
std::vector`int`
 
8:51 PM
std::vector$int$
 
but it's T* p; that really causes the problem.
because then the parser needs to know if T is a type or not.
 
@DeadMG wouldn't that be context sensitive as well?
 
Xeo
obtw puppy, I just had the first 'human soul saves the world' scene in Doctor Who. S5E3, at the end
Feels like the series changed completely with the eleventh doc
 
sbi
@ThePhD That's a horrible idea, IYAM. For one, if a girl buys clothes for someone else, if she is good, she'll buy the clothes she believes that someone else would want to wear – which is very likely not what she wants to wear for herself. But also, this is just dodging her question in a very, very thinly veiled way, and might actually make her mad at you.
I mean, why is this so hard? Ask her to cook a nice dinner for you. To bring some food to your birthday party. To invite you to a movie. A concert. The zoo. Whatever. Life's big. Much bigger than recorded music and computers.
 
@Xeo Moffat took over as head showrunner
 
Xeo
8:52 PM
Yeah, I read that
 
@Jefffrey Nope, not really.
 
Xeo
I have to admit that I liked his stories when Russel T Davies was the headwriter, though
 
because the parser doesn't really need to give a shit whether or not int is a type or not or vector is a template or not.
 
@sbi such wisdom
 
@DeadMG std::vector(...) what is it? template or temporary declaration? -> depends on the arguments
 
sbi
8:53 PM
@DeadMG That's a function prototype.
 
We're discussing hypothetical other grammar, not current one
 
@Jefffrey The parser doesn't need to care about the difference- or wouldn't in a hypothetical better grammar.
 
std::vector!(int)
 
Wide has std.vector(int) and int(5) for template instantiation and temporary creation, respectively- they both use the same syntax and there's no grammatical ambiguities there.
 
user3010322
@sbi These all be possible... if she didn't live in another state at the moment. And asking her (or displacing myself) several states away just to see her isn't exactly feasible. Believe me, if "make me a dinner" was a good enough response, I would have done it.
 
sbi
8:55 PM
@Borgleader I have several girls, one of them slowly approaching the end of her teenager time. I also had several mothers for all those kids. In short: I've been burnt by such things many times.
 
because the parser simply doesn't care what std.vector is or what calling it with int means.
all it has to know is that it can resolve it to a function call.
the analyzer can trivially handle the difference later.
 
@DeadMG you are talking about a huge refactoring of the language
 
user3010322
But it's all restricted to things which are long-range fire: it drastically ties my hands when I can't say "nothing" or "anything".
 
not just <> for templates
 
Xeo
@Jefffrey C++ can't be fixed
 
8:56 PM
@Jefffrey Well, yes, fixing the problems in C++ would entail a large grammatical refactor because so much of it is broken.
 
Xeo
backwards compatability breaks its neck
 
and you are talking to the guy who is building his own language instead, so you don't need to tell me what's involved.
 
@Xeo agreed
 
obtw @Xeo speaking of which
I managed to convince Clang to cough up the goods.
so now, you can access a kind of "aggregate" header that includes all the headers you requested in one go without re-parsing any header more than once.
kind of like automatically building a PCH for you.
and also solves the problem that Clang can't share information between translation units.
 
user3010322
@sbi I have other wishes, but they're not... like... fulfillable by her. I have a number of things I'd like to do and get, but they're not things she can buy -- or even if she showed up right next to me right now -- that she could do. Among them is the crisis that is my family. I would ask for help studying Japanese, but she's already helping me with that, of her own volition, because we both love Japanese Culture and Japan. It's... not as if she's doing a total of absolutely nothing and
 
sbi
8:58 PM
@ThePhD So ask her to send you something to make your apartment/room more livable. A nice set of sheets. A nice towel for you to use after a shower. A shirt she thinks would suit you. A kitchen utensil she thinks you're lacking. A book she thinks you might benefit from. Music she thinks you might like. A picture for your wall...
 

« first day (1246 days earlier)      last day (3702 days later) »