Gąska is a tart savour and wants to give floating jobs to Javascript
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
I've spent too long in JS land. There, an expression is a statement.
This is (ab)used for directives now.
"use strict"; // (very) old interpreters see a valid string expression statement; otherwise, it's a directive to enable strict mode
-
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
I've spent too long in JS land. There, an expression is a statement.
Yes. I doubt anyone here disputes that JS is its own crazytown (aside from being contrary for the purpose of being contrary).
-
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
I've spent too long in JS land. There, an expression is a statement.
This is (ab)used for directives now.
"use strict"; // (very) old interpreters see a valid string expression statement; otherwise, it's a directive to enable strict mode
That works in C too.
$ cat test.c int main(void) { "use strict"; return 0; } $ make test cc -Wall -Wextra -O3 test.c -o test test.c: In function ‘main’: test.c:3:5: warning: statement with no effect [-Wunused-value] "use strict"; ^
I suspect though that in the statement
a * b;
, ifa
is a valid type, then the type declaration has higher precedence than the multiplication.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Yes, but then there's no ambiguity.
If your program has both
typedef struct xyz abc;
andint abc = 123;
somewhere about (this is legal in a translation unit in C), determining whatabc * pqr;
might mean is non-trivial because it can be both a declaration ofpqr
and a (pointless) multiplication; both are syntactically valid interpretations. And because variable shadowing is also legal, the prior existence ofpqr
does not help at all. But nonetheless people manage to make useful stuff with C; they don't usually write ambiguous code in practice.It's fortunate that I'm not one of these people who thinks that perfect context free grammars are the way to go.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
-
@dkf said in Gąska is a tart savour and wants to give floating jobs to Javascript:
If your program has both typedef struct xyz abc; and int abc = 123; somewhere about (this is legal in a translation unit in C), determining what abc * pqr; might mean is non-trivial because it can be both a declaration of pqr and a (pointless) multiplication; both are syntactically valid interpretations.
This is actually quite a common case in POSIX. The
stat
API defines both the functionstat
and astruct stat
(and the former actually takes a pointer to the latter as an argument). IIRC, you need to disambiguate the type manually by sayingstruct stat
.For fun:
typedef struct foo { int foo; } foo; void f() { foo foo; foo bar; }
This only produces an error on the
foo bar
line in some quick tests (foo foo
is fine).
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Mason_Wheeler you're obviously going to have to be more verbose about that because our collective mind reading modules are failing to tell us whatever the fuck you were thinking when you wrote that.
You must've never seen any C code in your entire career to not get what he meant with
a * a
in his initial post. Either that, or you're literally illiterate - unable to comprehend writing.Given your track record, I'm going with the latter.
I know, you have a habit of tripping yourself up with pedantry. His complaint reminds me of @blakeyrat complaining about theoretical problems that aren't really problems that real people encounter like nulls in file names.
I really don't get you. One day you lose your shit after I correct you when you confuse a program with a command, and another you're being an asshole because someone forgot a semicolon in something that isn't even a code snippet. What's wrong with you? Multiple personality disorder, a literal addiction to arguments, some other mental illness?
-
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Straight out of The Hobbit:
Gandalf: "Good morning"
Bilbo: "Do you wish me a good morning, or mean that it is a good morning whether I want it or not; or that you feel good this morning; or that it is a morning to be good on?"Yet you not complaining about English not being context free.
God, Bilbo is a ic dickweed.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Mason_Wheeler you're obviously going to have to be more verbose about that because our collective mind reading modules are failing to tell us whatever the fuck you were thinking when you wrote that.
You must've never seen any C code in your entire career to not get what he meant with
a * a
in his initial post. Either that, or you're literally illiterate - unable to comprehend writing.Given your track record, I'm going with the latter.
I know, you have a habit of tripping yourself up with pedantry. His complaint reminds me of @blakeyrat complaining about theoretical problems that aren't really problems that real people encounter like nulls in file names.
I really don't get you. One day you lose your shit after I correct you when you confuse a program with a command, and another you're being an asshole because someone forgot a semicolon in something that isn't even a code snippet. What's wrong with you? Multiple personality disorder, a literal addiction to arguments, some other mental illness?
That command / program thing was pretty retarded on your part, true, demonstrating your devotion to picking a particular definition of a word and refusing to comprehend any others. But it has nothing on your comments to me here in this thread, which are nothing but baseless, "You're dumb!" comments.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Mason_Wheeler you're obviously going to have to be more verbose about that because our collective mind reading modules are failing to tell us whatever the fuck you were thinking when you wrote that.
You must've never seen any C code in your entire career to not get what he meant with
a * a
in his initial post. Either that, or you're literally illiterate - unable to comprehend writing.Given your track record, I'm going with the latter.
I know, you have a habit of tripping yourself up with pedantry. His complaint reminds me of @blakeyrat complaining about theoretical problems that aren't really problems that real people encounter like nulls in file names.
I really don't get you. One day you lose your shit after I correct you when you confuse a program with a command, and another you're being an asshole because someone forgot a semicolon in something that isn't even a code snippet. What's wrong with you? Multiple personality disorder, a literal addiction to arguments, some other mental illness?
That command / program thing was pretty retarded on your part, true, demonstrating your devotion to picking a particular definition of a word and refusing to comprehend any others.
Well, there's only one kind of program and one kind of command in POSIX standard. Your complete inability to figure out the context - and hence the only definitions of those two words that make any sense - can only be explained by either illiteracy or some form of psychosis that forces you to be contrarian just for the sake of being contrarian, with zero regard of what you're actually saying or whether it's true or not.
-
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
is with those line numbers though?
Here's what my psychic powers tell me:
You're seeing things as they're formatted by ... something. The line numbers are based on the original source text before the formatting. The actual formatting before prettification is even worse.
-
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Straight out of The Hobbit:
Gandalf: "Good morning"
Bilbo: "Do you wish me a good morning, or mean that it is a good morning whether I want it or not; or that you feel good this morning; or that it is a morning to be good on?"Yet you not complaining about English not being context free.
God, Bilbo is a ic dickweed.
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
I guess he had a bad instinct about what will follow, a gut feeling not to trust Gandalf hence ry -- he was just trying to make him go away, but Gandalf said "why not both" (actually he said "all of the above"), and poor Bilbo had to go on a dragon killing adventure.
It seems you're getting the characters slightly mixed up, it's actually Bilbo who wishes Gandalf a good morning, then Gandalf starts asking what Bilbo meant.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
Or the rest of the statement as already pointed out.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Mason_Wheeler you're obviously going to have to be more verbose about that because our collective mind reading modules are failing to tell us whatever the fuck you were thinking when you wrote that.
You must've never seen any C code in your entire career to not get what he meant with
a * a
in his initial post. Either that, or you're literally illiterate - unable to comprehend writing.Given your track record, I'm going with the latter.
I know, you have a habit of tripping yourself up with pedantry. His complaint reminds me of @blakeyrat complaining about theoretical problems that aren't really problems that real people encounter like nulls in file names.
I really don't get you. One day you lose your shit after I correct you when you confuse a program with a command, and another you're being an asshole because someone forgot a semicolon in something that isn't even a code snippet. What's wrong with you? Multiple personality disorder, a literal addiction to arguments, some other mental illness?
That command / program thing was pretty retarded on your part, true, demonstrating your devotion to picking a particular definition of a word and refusing to comprehend any others.
Well, there's only one kind of program and one kind of command in POSIX standard. Your complete inability to figure out the context - and hence the only definitions of those two words that make any sense - can only be explained by either illiteracy or some form of psychosis that forces you to be contrarian just for the sake of being contrarian, with zero regard of what you're actually saying or whether it's true or not.
You're still making zero sense on this subject, just like you had no obvious comprehension of my original answers on that subject.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error imagine how cool JS would be if it was designed in 2010, when the OOP brainworm was at its low. No prototypal inheritance and all the problems related to it!
Wow, I've got not one but TWO downvotes for shitting on JS. That's really funny, considering the reason this thread exists at all was because I decided to defend JS for once, and people got mad at me!
He does have two accounts, you know.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
Or the rest of the statement as already pointed out.
What are you talking about?
void f1(void) { typedef int a; a * b; } void f2(void) { int a = 6, b = 9; a * b; }
Two perfectly valid statements. You can try compiling it yourself - works in every C and C++ compiler with every standard revision. What "rest" is supposedly missing here?
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
Or the rest of the statement as already pointed out.
What are you talking about?
What @dkf said upthread.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
Or the rest of the statement as already pointed out.
What are you talking about?
What @dkf said upthread.
@dkf said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Leaving aside the missing ;, it's an expression and expressions are valid statements
So why do you still insist it's not?
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
Or the rest of the statement as already pointed out.
What are you talking about?
What @dkf said upthread.
@dkf said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Leaving aside the missing ;, it's an expression and expressions are valid statements
So why do you still insist it's not?
Misleading quoting by you (and surprise surprise depending on some pedantic dickweed definition argument) doesn't make your wrong statements right.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
Or the rest of the statement as already pointed out.
What are you talking about?
What @dkf said upthread.
@dkf said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Leaving aside the missing ;, it's an expression and expressions are valid statements
So why do you still insist it's not?
Misleading quoting by you
Did you expect me to quote five large posts in their entirety? "What he said upthread" is even more misleading than what I did, because you didn't even state which part specifically you're referring to (clearly you're referring only to the parts that suit your argument and explicitly excluding all the parts where @dkf contradicted you - except nobody can even verify that because you haven't quoted the parts you meant).
(and surprise surprise depending on some pedantic dickweed definition argument)
You literally said
a * b
is not a valid C statement. Literally right here:@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.This is objectively wrong and it's trivial to prove. No matter how you look at it, no matter which definitions you pick - it's always objectively wrong. Unless by "valid" you meant something else than valid, or by "statement" meant something else than statement, there are no possible interpretations of your words - pedantic or otherwise - where you aren't completely wrong, except one: if the only reason it's not valid is the missing semicolon and otherwise it's all fine. But you already said it's not the case.
Referencing @dkf is especially funny after he upvoted the post where I said you're wrong.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.Are you intentionally lying or have you actually never seen C code in your life?
Well, it lacks a statement terminator so I guess it's not valid.
Yep. Or a left hand side. Or the rest of whatever the statement was.
Up until now I thought you're just being an insufferable asshole and going for a "hahaha he forgot semicolon, what an idiot!" But those two ors could only be written by someone who really doesn't know the first thing about C.
I'm only insufferable to you because you know I was right and talking about "those two ors" like that makes it sound like you've never written any C so maybe you should stop this :@levicki: impression.
Or maybe you should refresh your knowledge about C and remember that both declaring uninitialized pointer as well as a standalone multiplication without using the result for anything are both valid statements. Literally the only thing "wrong" was the lack of semicolon.
Or the rest of the statement as already pointed out.
What are you talking about?
What @dkf said upthread.
@dkf said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Leaving aside the missing ;, it's an expression and expressions are valid statements
So why do you still insist it's not?
Misleading quoting by you
Did you expect me to quote five large posts in their entirety?
No, but I'm not at all surprised that you cherry picked something that if you squint and ignore the rest of his post would be able to "prove" your nonsensical case.
"What he said upthread" is even more misleading than what I did, because you didn't even state which part specifically you're referring to (clearly you're referring only to the parts that suit your argument and explicitly excluding all the parts where @dkf contradicted you - except nobody can even verify that because you haven't quoted the parts you meant).
Yes, because as the command / program example proves it doesn't matter. You're a brick wall. You were talking about "just missing a semicolon" and I referred you to there and then you ignored his other examples that were more than that.
(and surprise surprise depending on some pedantic dickweed definition argument)
You literally said
a * b
is not a valid C statement. Literally right here:Yes. And probably because I'm not fluent in any C standard you're staking this argument over the precise definition of "a statement" instead of interpreting language like a human and not getting into pedantic arguments about minutiae for (what could easily turn into) dozens of posts.
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Also
a * b
is not a valid C statement so try again.This is objectively wrong and it's trivial to prove.
No.
Referencing @dkf is especially funny after he upvoted the post where I said you're wrong.
Yes, on some pedantic orgasmic definition world. And then he elaborated on ways that proved exactly what I was saying.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
(and surprise surprise depending on some pedantic dickweed definition argument)
You literally said
a * b
is not a valid C statement. Literally right here:Yes. And probably because I'm not fluent in any C standard you're staking this argument over the precise definition of "a statement" instead of interpreting language like a human and not getting into pedantic arguments about minutiae for (what could easily turn into) dozens of posts.
"Interpreting language like a human"? Like, do you expect programming language to have a subject and a predicate in every line? Seriously, even with all your illiteracy and personality disorders, I still refuse to believe even you would be so stupid to think that linguistic terms such as "statement" apply without any modifications to programming languages.
TL;DR: you're full of shit and you know it and it's you who's being extremely pedantic with definitions of words, not me. Also, by your own admission, I was right that you don't know C.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
"Interpreting language like a human"? Like, do you expect programming language to have a subject and a predicate in every line?
OMG, this is dumb even for you. I meant interpreting what I wrote when I used the word "statement." Jeebus.
-
Billy, what's your favorite
Game Grumps episodeWTDWTF thread?I like the one where they argued about the word "statement" for a looong time.
-
@boomzilla exactly. It's so dumb I cannot comprehend it. What in the name of God could you possibly mean by "not a valid statement" if you didn't mean it as a programming language statement?
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
It's so dumb I cannot comprehend it.
Yes, that's what I've been saying.
What in the name of God could you possibly mean by "not a valid statement" if you didn't mean it as a programming language statement?
Just cut it out already. You're embarrassing yourself.
-
@error said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Billy, what's your favorite
Game Grumps episodeWTDWTF thread?I like the one where they argued about the word "statement" for a looong time.
Funny thing - for 90% of that thread, I thought @boomzilla has something insightful to say about why
a * b
isn't valid C. But noooo, of course it turned out to be a failed attempt at being pedantic.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
It's so dumb I cannot comprehend it.
Yes, that's what I've been saying.
And your illiteracy made you not notice that you've just admitted that what you were saying this whole time was extremely dumb.
So anyway. It's 143rd post of this thread and you still haven't stated even once what is missing from
a * b
that doesn't make it a valid statement. And you still haven't explained what you meant by "statement". You spent a whole lot of time saying what you DIDN'T mean, but not even a single word about what you DID mean.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
It's so dumb I cannot comprehend it.
Yes, that's what I've been saying.
And your illiteracy made you not notice that you've just admitted that what you were saying this whole time was extremely dumb.
Yes, because you have to twist the words around so they fit into your head. It couldn't possibly be that you can't understand simple things.
So anyway. It's 143rd post of this thread and you still haven't stated even once what is missing from
a * b
that doesn't make it a valid statement. And you still haven't explained what you meant by "statement". You spent a whole lot of time saying what you DIDN'T mean, but not even a single word about what you DID mean.Holy fucking shit. It's missing at minimum a semicolon. Plus possibly all the other sorts of stuff like @dkf mentioned. I didn't realize I had to spell that out for you, but I guess I've learned that I really can't underestimate your intelligence when you've got some retarded notion stuck in your head. Which generally give it the minimal amount of context that would distinguish it from the sorts of things imagined were gigantic problems.
-
@boomzilla said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
It's so dumb I cannot comprehend it.
Yes, that's what I've been saying.
What in the name of God could you possibly mean by "not a valid statement" if you didn't mean it as a programming language statement?
Just cut it out already. You're embarrassing yourself.
To be quite honest...I'm not sure at all what you're saying. Because @Gąska is making sense and you're totally not. Reality inversion, I know. Chalk it up to these strange times.
-
@levicki Don't be disingenuous. Of course that won't compile, because
a
isn't declared anywhere. Now you're from "valid statement" to "valid function body", a claim which no one ever made.
-
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Try to compile this, I even added a semicolon to make it a "valid statement".
/* test.c */ int main() { a * b; }
Would you really have preferred it if he refered to some formal grammar definition to argue that
<multiplicative-expression> ::= <cast-expression> | <multiplicative-expression> * <cast-expression> | <multiplicative-expression> / <cast-expression> | <multiplicative-expression> % <cast-expression> <cast-expression> ::= <unary-expression> | ... ... <primary-expression> ::= <identifier> | ...
and
<declaration> ::= {<declaration-specifier>}+ {<init-declarator>}* ; <declaration-specifier> ::= <storage-class-specifier> | <type-specifier> | <type-qualifier> <type-specifier> ::= void | char | short | int | long | float | double | signed | unsigned | <struct-or-union-specifier> | <enum-specifier> | <typedef-name> <init-declarator> ::= <declarator> | <declarator> = <initializer> <declarator> ::= {<pointer>}? <direct-declarator> <pointer> ::= * {<type-qualifier>}* {<pointer>}? <direct-declarator> ::= <identifier> | ( <declarator> ) | <direct-declarator> [ {<constant-expression>}? ] | <direct-declarator> ( <parameter-type-list> ) | <direct-declarator> ( {<identifier>}* )
are ambiguous uses for
*
, i.e. that<identifier> * <identifier>
could be resolved by either<multiplicative-expression> * <cast-expression>
or by<typedef-name> * <identifier>
?Because I'm having a really hard time deciphering that shit just to make this post, and I doubt it would have been more understandable. I think
a
was a lot easier to read than that.
-
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Try to compile this, I even added a semicolon to make it a "valid statement".
/* test.c */ int main() { a * b; }
$ gcc -Da="return 0" -Db=0 test.c
WFM.
-
@cvi said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Try to compile this, I even added a semicolon to make it a "valid statement".
/* test.c */ int main() { a * b; }
$ gcc -Da=int text.c
WFM.
-
-
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
disingenious assertion that a * b (without any other context) is somehow ambiguous only in C, but not in other programming languages.
He's kidding, right? Please tell me he's kidding.
-
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Mason_Wheeler said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@levicki Of course that won't compile, because
a
isn't declared anywhere.It isn't declared because you chose not to declare it in your contrived example, just so you could make a disingenious assertion that
a * b
(without any other context) is somehow ambiguous only in C, but not in other programming languages.I didn't say "not in other programming languages." There are a few (generally derived directly from C, such as C++ or Objective-C) where
a*
can denote "pointer-to-a
," leading to the same ambiguity. (And in fact this is significantly worse in C++, where Turing-complete templates can theoretically make this ambiguity literally impossible to resolve!)What I said is that Pascal, specifically, does not have this problem; that it has a proper context-free grammar and is thus objectively easier for both humans and machines to understand. When you start putting words in my mouth, you're the one who comes across as disingenuous.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@levicki said in Gąska is a tart savour and wants to give floating jobs to Javascript:
disingenious assertion that a * b (without any other context) is somehow ambiguous only in C, but not in other programming languages.
He's kidding, right? Please tell me he's kidding.
He's a living incarnation of Poe's Law. It's impossible to tell if he's trolling or Just Actually That Stupid.
-
@Mason_Wheeler said in Gąska is a tart savour and wants to give floating jobs to Javascript:
it has a proper context-free grammar and is thus objectively easier for both humans and machines to understand
Meh. Does anybody actually care, though?
As an end-user, I don't really give a fuck about how easy it was to write a parser (not to mention that context sensitive grammars are well supported in various parser generators; my personal favourite being PEGTL).
C++ famously has the most vexing parse. Unlike the ambiguity with
*
that's been used as an example, the "most vexing parse" actually occasionally causes a bit of confusion (admittedly, the ambiguity is due to different reasons). But even that is so infrequent that I basically had forgotten about it until this point in the discussion. (And I also don't really see students encountering it a bunch. If they do, it's easy enough to resolve for them that it's basically a non-issue).tl;dr: IMO whether a language uses a context-free or context sensitive grammar doesn't matter at all when compared to other design decisions.
-
@cvi said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Mason_Wheeler said in Gąska is a tart savour and wants to give floating jobs to Javascript:
it has a proper context-free grammar and is thus objectively easier for both humans and machines to understand
Meh. Does anybody actually care, though?
Tool programmers. And, indirectly, all programmers, although they fail to see the root cause and instead bitch about how all the tools for the language in question suck. And if you remember what was the main complaint against C++ in late 2000s, you'd see it's a very real problem with very real consequences.
C++ famously has the most vexing parse. Unlike the ambiguity with
*
that's been used as an example, the "most vexing parse" actually occasionally causes a bit of confusion (admittedly, the ambiguity is due to different reasons). But even that is so infrequent that I basically had forgotten about it until this point in the discussion.Because everyone uses initializer lists nowadays so the most vexing parse cannot happen anymore. Also, enough man-centuries were spent on the tools development over the last decade that you can't easily see how much they sucked for most of C++'s existence compared to other, both younger and older languages.
-
@cvi said in Gąska is a tart savour and wants to give floating jobs to Javascript:
not to mention that context sensitive grammars are well supported in various parser generators; my personal favourite being PEGTL
Interesting you mention that, I had briefly thought about using it to parse a C++ subset (of right-hand-side expressions only) for a code generator. But I haven't looked into it seriously enough and can't really find an actual formal grammar for C++ to pick said subset, and certainly don't want to cook up my own buggy one.
So far I've gone with "whatever the user enters is treated as valid" and they'll have to deal with horrible error messages from the actual compiler if it isn't.@cvi said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Does anybody actually care, though?
As @Gąska mentioned, I assume C++'s horribly complexity (including templates and macros) is what makes it so hard to analyze for automated tooling. That's why things like Java had much better support for refactoring, code completion, etc. for years. Actually correct tools, not just approximations that fail on edge cases.
-
@topspin said in Gąska is a tart savour and wants to give floating jobs to Javascript:
can't really find an actual formal grammar for C++
IIRC there's no official one at all and nobody made an unofficial one either. It's just so hard to formalize, and hand-writing a stateful recursive-descent parser is so much easier.
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
And if you remember what was the main complaint against C++ in late 2000s, you'd see it's a very real problem with very real consequences.
I would argue that the difficulties in
parsingcreating tooling for C++ come from elsewhere, with the fact that its grammar is context sensitive being a minor footnote along the way.C is relatively easy to parse, but as demonstrated in this thread, it's context sensitive as well.
Because everyone uses initializer lists nowadays [...]
Heh. You wish. (FWIW, I wish too.)
Either way, my observation predates the brace-initialization syntax from C++11.
both younger and older languages.
The tooling may have sucked for C++, but plenty of younger and older languages just plain-out sucked to begin with.
Maybe to phrase my previous assertion differently: If you list the 10 most important features of a language, and having a context-free grammar makes that top 10, then that language is uninteresting/not really worth perusing further and IME probably sucks in other regards. The number "10" is a bit of an ass-pull, so increase it as needed.
-
@topspin said in Gąska is a tart savour and wants to give floating jobs to Javascript:
But I haven't looked into it seriously enough and can't really find an actual formal grammar for C++ to pick said subset, and certainly don't want to cook up my own buggy one.
There is a "Grammar Summary (informative)" in the spec drafts. Might be enough for expressions (e.g. A.4)?
-
@cvi said in Gąska is a tart savour and wants to give floating jobs to Javascript:
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
And if you remember what was the main complaint against C++ in late 2000s, you'd see it's a very real problem with very real consequences.
I would argue that the difficulties in parsing C++ come from elsewhere, with the fact that it is context sensitive being a minor footnote along the way.
Being context-sensitive prevents you from doing lexical analysis before any sort of semantic analysis. You HAVE to turn a type declaration into an information for your parser that there is such type with such name in such scope as soon as possible, or you'll be unable to correctly parse the rest of the file. It basically forces you to write spaghetti.
C is relatively easy to parse, but as demonstrated in this thread, it's context sensitive as well.
Yes, and as demonstrated by... well... life, its tools suck too. Though that's arguably more of a cultural problem than technical problem. Also, while C is context-sensitive in some cases, C++ is much more so. And because it's overall a much simpler language (lacking many features), it's less of a problem. But it's still a problem, because it still forces parser developers to write spaghetti code.
Either way, my observation predates the brace-initialization syntax from C++11.
Well, my observations predating C++11 were such that I tripped over the most vexing parse at least once a month. Maybe you didn't pass default-constructed parameters to stack-allocated objects as often as I did?
both younger and older languages.
The tooling may have sucked for C++, but plenty of younger and older languages just plain-out sucked to begin with.
C++ is the only one where there were large scale efforts to make better IDEs yet as of 2010 you still couldn't reliably rename method name and have all its overrides and calls automatically updated.
Maybe to phrase my previous assertion differently: If you list the 10 most important features of a language, and having a context-free grammar makes that top 10, then that language is uninteresting/not really worth perusing further and IME probably sucks in other regards. The number "10" is a bit of an ass-pull, so increase it as needed.
10 is a large number. Are you able to list 10 features of, say, Java (or some other language of choice) that more important than "it's relatively easy to develop code analysis and transformation tools for it because of context-free grammar"?
-
levicki: "nobody cares about proper context-free grammar"
Also levicki: "Is the compiled code performance close to native code performance?"
-
@cvi said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Either way, my observation predates the brace-initialization syntax from C++11.
What a coincidence. So does my compiler!
-
@Gąska said in Gąska is a tart savour and wants to give floating jobs to Javascript:
Being context-sensitive prevents you from doing lexical analysis before any sort of semantic analysis. You HAVE to turn a type declaration into an information for your parser that there is such type with such name in such scope as soon as possible, or you'll be unable to correctly parse the rest of the file. It basically forces you to write spaghetti.
Well, this is exactly what the
a*b
example was demonstrating, no? As said, with a good parser generator that seems to be easy.Well, my observations predating C++11 were such that I tripped over the most vexing parse at least once a month. Maybe you didn't pass default-constructed parameters to stack-allocated objects as often as I did?
I was TA:ing frequently back then, so part of my observation comes from seeing the problems that students were dealing with. The vexing parse popped up occasionally, and as the name indicates, it's vexing, but it just wasn't a huge issue or time sink. Would the language be better if it didn't exist? Yeah. Are there other more pressing issues. Definitively.
10 is a large number. Are you able to list 10 features of, say, Java (or some other language of choice) that more important than "it's relatively easy to develop code analysis and transformation tools for it because of context-free grammar"?
Here's a random list for Lua. It has more than 10 items. (It may even have a context free grammar, but whatever., the list doesn't mention it.)