« first day (632 days earlier)      last day (4544 days later) » 

15:02
0
Q: Communication between lexer and parser

FredOverflowEvery time I write a simple lexer and parser, I stumble upon the same question: how should the lexer and the parser communicate? I see four different approaches: The lexer eagerly converts the entire input string into a vector of tokens. Once this is done, the vector is fed to the parser which ...

Good morning everyone :)
Morning. Looks like I just also just got up.
@ITNinja oh noes! Ninjas!
@thecoshman poof you didnt see anything. ;)
@Mysticial haha :P
argh, tis but wisp of sea spray to be sure
15:10
@FredOverflow coroutines is the answer
i.e. lexer yields tokens
user784668
@FredOverflow "Each time the parser needs a token, it asks the lexer for the next one. This is […] quite hard in C++" what?
0
A: Communication between lexer and parser

rubenvbThe way I handle it in my toy buildsystem project in progress is by having a "file reader" class, with a function bool next_token(std::string&,const std::set<char>&). This class contains one line of input (for error reporting purposes with line number). The function accepts a std::s...

I just wrote your guy' answer from my experience.
I can even provide code.
I find it quite robust to be written by hand by... me.
I think it can even handle quotes (never tested though I did write the code to handle them)
hand-written coroutines ftw
Omg. It's linking. Finally. IT'S ALIVE.
15:16
if you can convert a recursive function to iterative form, then subroutine to reinvocable generator should be a walk in the park.
@Cicada so it was your fault?
Nope, it was nvcc's.
Looks like he fails at proprely linking __shared__ GPU memory.
@Cicada I'm betting there's docs saying it's a flaky feature :P
15:18
Nop, there's absolutely no docs :)
And nvidia forums are down
user784668
@FredOverflow I know it's a hand-written coroutine. But I fail to see why it's "quite hard".
@Cicada obviously nvidia forums are the docs. This is a multinational ;-)
15:49
Urrfff. That question code was a mess to sort out:
Why don't you make it a SSCCE next time? — sehe 3 mins ago
holywallacode
"I got a problem. Here's my code. Figure it out."
meh... who cares about SSCE...
Greetings!
@Cicada What is alive?
@Flexo So? Why would I care about the "freedom" of a piece of software I use? I don't care if my chair, glasses or bicycle being "free as in freedom". It's just as absurd an argument as "free as in beer". It's a completely useless trait by itself.
Sure, if you want to modify some software, it helps that the source code is available. But I generally only want to modify software if it is good to begin with (otherwise, I'll just ditch it and find something better). I wish Linux fanboys would focus on that part. Instead of bragging about how "free" it is (in either sense), how about talking about how good it is?
user784668
15:55
But it's free!
and now, I'd better watch some more Monty Python
@jalf Agreed... But I believe you will find that the Linux kernel is continually being improved.
@EtiennedeMartel I love those!
Ell
Ell
and a lot of other free as in speech software is also improved
@JimNorton Yeah, but again, who cares about "being improved". Is it worth using today? "It might be worth using in 5 years" isn't really going to sell anyone on it today
Ell
Ell
15:57
and wouldn't be able to be improved unless it was free as in speech
okay well look at apache, if that wasn't free as in speech, then it wouldn't be worth using today
stupid question time
@Ell But the point is, at the end of the day, it doesn't matter how free it is, or how "being improved" it is. If you want someone to use it, you have to convince them that it is worth using today
I think 100 years from now Linux will still be used in one way or another. Not so sure about Windows or OS X.
if you say it's "being improved", then I say "ok, I'll check back next year"
@StackedCrooked You're kidding I hope. Windows isn't going anywhere
Ell
Ell
15:58
But good software being improved is better than good software
@Ell Yes, but we still haven't established that it is good
if I have a function with two numeric template params, how do I specify the type with bigger storage in c++11?
@keithlayne long
@jalf In the case in the Linux kernel, I think the answer is a resounding yes, it's worth using now and for quite some time.
Tell me that it is good. Tell me why it is good. Once you have established that it is good, then "it is also free", and "it is going to get even better" are wonderful qualities. But if it's not good now, who gives a fuck?
15:59
@Neil long long? bigint?
@Neil Lifetime of Windows is pretty much tied to the lifetime of the good old desktop PC. I don't think we'll still be using those 100 years from now.
@JimNorton And, as I said back when this conversation started, before I forgot about it again, that is what Linux people should be saying. Not "it is free", or "it is being improved"
Ell
Ell
@jalf what software doesn't sell itsself as good? No software says "we are bad, but it's okay because we are being improved", instead they say "we are good, in addition to this, we are being improved and if you think there is a feature missing then you can implement it yourself" or whatever
@keithlayne What's wrong with long?
it's concrete
16:00
@StackedCrooked Definitely not windows as we know it now, no
@Ell Linux doesn't sell itself as good. It sells itself as "free", or "being improved" ,as most of the comments here have stated quite clearly. And then Linux fanboys wonder why Linux never really takes off...
Ell
Ell
well I disagree
But if what they claim about the coffers of Windows Microsoft is true, they could personally finance the company making no profits whatsoever for a good 20 years or so
Ell
Ell
linux sells itsself as stable, reliable, no virusses etc., surely that is being sold as "good" and not just "free"?
silly me, asking a c++ question in here :)
16:02
@Neil Maybe it will succeed to let go of its roots. I have my doubts though.
@StackedCrooked I never said it would be good, but Microsoft seems to be getting along fine despite it all
@Ell Ok, depends on who/what "linux" is in this context. The people who talk up Linux, the people who use Linux and try to convince others to do so almost always get hung up on "it is free", and have a ridiculously hard time understanding that "free is not enough. You also need to tell me that it is good"
It goes a long way that most people prefer Windows because that's all they know
That's an advantage you'll find that Microsoft would pay handsomely to retain
no robots are ever around when you need them
Ell
Ell
@jalf okay, you make a good point. I don't know why I'm arguing actually. I agree that people try to oversell with the "free" point, but I don't think they don't sell it as good as well
user784668
16:03
@jalf Freetards sell it as "free" or "being improved", ftfy.
Of course, if you ask Canonical or Red Hat, they will say that Linux is good. But scroll up in this chat, and look at how many Linux users just dodged the question again and again when prompted to explain that Linux is good
Ell
Ell
well for me linux is good because its free
I can't afford windoze :P
Although lately I've been hearing less and less of that "Linux is faster" crap.
user784668
@Mysticial Because Linux is becoming slower and slower :P
Ell
Ell
I don't see why linux would be faster
16:05
@jalf 90% of the webservers in the world use Linux.... Most be something good about it...
@Ell But not having an OS at all is free too. And yet you chose Linux. Why? There must be something "good" about it
@JimNorton Way to completely miss the point
@jalf:The proof that linux(ubuntu) is good is that, I only open windows once a month, since i installed ubuntu as dual boot
user784668
@JimNorton 90%? You gotta be kidding.
95% of desktop PC's run Windows. There must be something amazingly good about that, eh?
user784668
@VinayakGarg Bad "proof".
16:05
@jalf Ass, you asked for proof of why Linux is good...
And I think that 90% figure is a few years out of date
@JimNorton So Linux is good because lots of servers use it?
Ell
Ell
@jalf because I can run programmes and shit
What kind of nonsense is that?
@jalf Why would it be used if it wasn'
t reliable?
user784668
@jalf These figures were never really true. They fail to take the existence of non-Linux *nixes into account. And they fail to take the significance of ASP.NET into account.
16:06
@Ell Bingo! We finally managed to drag a reason out of you. We have a reason why Linux can be considered good. And it only took us a few hours to get there
@JimNorton Are you seriously saying that the best (so far, only) reason to use Linux is that other people do so?
"most people" do all sorts of stupid things
Ell
Ell
@jalf well tbh I think that is just being pedantic, I think you will find it's a given that an OS will be able to run programmes, else it wouldn't be labeled as such
hell, the only thing stupider than individual people is groups of people
3
@jalf shut up
You are being an idiot
@DeadMG Here, have a star =)
no, he's completely right
16:08
@JimNorton Am I? Thank you for proving my point
You just don't get it, do you?
If someone dares ask what is good about Linux, they are idiots.
it's an appeal to authority fallacy, where the "authority" is "other people"
@jalf:have you used linux?
@jalf For me it's just easier. And I can use the CLI as an often used powerful tool.
@jalf No, I made a clear point that it is used by the large majority of hosting companies as evidence of it's quality.. and you came up with an excuse to claim "not good" enough.
@JimNorton So, puzzle me this: if Linux is good because 90% of servers use it, surely Windows is better because it has an even greater Windows marketshare. Why would I use Linux then? Why would anyone ever pick the small, not-so-popular choice, if popularity is proof of quality?
16:09
@JimNorton But that's not evidence at all.
just look at PHP...
@JimNorton No, you made an appeal to authority. I said that is not "proof of quality", an asked you for a reason why we should consider it "good"
user784668
@jalf Will it count if I told you a few reasons why Linux can be considered good?
Then you called me an idiot
@DeadMG So a hosting company doesn't care about uptime? Would they not use some other OS if they could get better uptimes?
@DeadMG You keep coming up with those killers, do you have a hijacked Watson in your closet?
16:10
@Fanael Given that I've been asking, for the last two hours or so, for reasons why Linux can be considered good, then yes, it would absolutely count
@JimNorton Er, a lot of hosting companies do use some other OS, and get excellent uptime
@jalf Now you miss my point.
but more importantly, you said nothing about uptime before. You just said "it is widely used"
meh, another stupid "which is better" argument that won't go anywhere
but yea have fun with it :)
Ell
Ell
@TonyTheLion I don't think its a "which is better" argument
its something else
If you had just said "it offers excellent server uptime", then you would have won the day. Instead, you spewed some garbled nonsense about "it must be good because some unsourced statistic I just slung out says it is widely used"
16:12
I'm not saying linux is better than anything else...just that I believe I have proof that it is good.
@Ell what is it then?
Ell
Ell
@TonyTheLion a "the methods you use to prove which is better are invalid"
@JimNorton And you keep that proof awfully secret. Why don't you show us the proof?
@CaptainGiraffe Whuh?
@jalf The repo system of updating and installing from a trusted but open location is the killer app for me.
16:12
@Ell whatever, just a pointless argument, cause neither of the parties want to change their views
I rest my case
@TonyTheLion Good god....
user784668
@jalf But I won't, since it's funny to watch this pointless argument.
By the way, I use Linux quite a lot, and while I wouldn't call it good, I don't think it's worse than Windows either. But the arguments Linux-zealots use to win people over really depress me, and highlight how complete out of touch they are
Ell
Ell
@jalf I still don't think you have considered my point, you said that the fact that I could run programmes on it was a good point, and I said that that was a given for an OS. What was your reply to that? Do I have to say why having an OS at all is beneficial also?
Which was my point
Ell
Ell
16:13
I think we can all agree nothing is perfect, and everything "good" is just the best we have
@Ell I just wanted you to say more than "it is free, and therefore I use it". I think it's an important point that "it is free and it gives me something I need"
"good" is in the eye of the beholder
@jalf Please don't tell me your point is that you have met alot of arrogant bastards as a deficiency in linux.
entirely dependent on who is looking at the thing being judged
Ell
Ell
@jalf fair enough - but I think there are some arguments that are given
user784668
16:14
Linux sucks donkey balls!
@Fanael It can do a lot of other things too.
Ell
Ell
@TonyTheLion entirely true
@CaptainGiraffe No, my point is that if these arrogant bastards ever want Linux to be more commonly used than it is (and if they want it to be a better piece of software than it is), then they have to stop hiding behind "it is free", and start explaining why it is good
Linux is good because it's reliable, open-source, continually improved.... and it works...
it is also fast
16:15
typename std::conditional<sizeof(T1) >= sizeof(T2), T1, T2>::type
thank you, c++ standard
And it supports a lot of new hardware, new hardware drivers are written rather quickly...
except NVIDIA
@jalf Fair enough; I have seen those too.
who won't support it
for whatever reason
@JimNorton of which only the last one offers some kind of positive value. None of the others convey any positive values, they just say "this is not a negative either"
16:17
@jalf What is good about Linux in your mind?
NVIDIA supports Linux, they have some of the best drivers for it, they just don't open source them.
Crashing is bad. Not crashing (being reliable) is not good, it's not positive, it's just... not bad. Not having access to the source code is bad. Having access to it is... not bad. But it's not a positive unless the product is actually good enough for me to care about the soruce code
the one thing I like about Linux is that it will run on a machine with relatively low specs, and still be fast enough to use. Try that with Windows
user784668
@TonyTheLion Define "relatively low specs". Is a PIII with 512MB of RAM "relatively low specs"?
@TonyTheLion That is a good point.
@Fanael 512 MB Ram and some old Pentium Machine
16:18
@TonyTheLion Ubuntu runs like a dog on my old laptop
@jalf How about the repo thingie, grandma and grandpa would benefit greatly from a trusted source for apps?
@Fanael ARM7 200MHZ CPU with 512 MB RAM
had XP running before, was super slow
@Fanael for todays standards, that's low yes.
@JimNorton "it works" right.
@Fanael try running Win 7 on that machine, it will be rather slow
16:19
how long did it take linux to get fullscreen flash videos?
Linux will run quite happily
@MooingDuck meh, flash
user784668
@TonyTheLion I had Windows 7 installed on that machine for some time. It worked decently after disabling all the unneeded stuff.
@CaptainGiraffe Sure, that's nice too (although in fairness, OSX has an app store, and Win8 will get one too)
Linux runs quite well on this CPU which isn't a powerhouse.. tincantools.com/…
@MooingDuck ??
silly PHP flags...
16:20
@JimNorton yea, but Linux works, you don't need to disable a load of crap first. Which is the point I'm trying to make.
user784668
@Mysticial s/ flags//
user784668
@TonyTheLion It depends on the distro.
@JimNorton rich software ecosystem, including some tools that are really hard to find equivalents of in Windows, and a powerful command-line interface, come to mind as two advantages
@Fanael the distro I was using, Ubuntu
Ell
Ell
16:21
@jalf being reliable is definately a plus imho
@Fanael Someone flagged "gtfo" in the PHP room.
I had always marked Linux's software ecosystem as particularly poor, not rich
user784668
@Mysticial lol
Also for all these advantages that we are supposed to have from Linux, you need to be a pretty savvy user to take advantage of. No distro has been able to alleviate that yet.
@Ell No, it's just a non-negative. It's a zero. It just means it doesn't do anything bad. It doesn't mean it does anything good
16:22
@CaptainGiraffe that is true
Ell
Ell
@jalf I'm sorry I just disagree on that
you can say that about anything
@Ell Can I? A car is good if it can drive me from A to B. It is not good simply for "not spontaneously exploding"
Ell
Ell
@jalf the fact you can run stuff on it isn't a plus... its a non-negative that you can't not run things on it
@jalf a car is good if it is reliable - if it doesn't break down
now we're getting pedantic
Ell
Ell
the fact is everything fails at some point and it is a plus if it fails less often than something else
user784668
16:23
@jalf Unless you're a terrorist, as then you'd probably like your car to explode.
but yea, C++ lounge, what else to expect?
@Ell Except you have to resort to double negatives... Being able to run software on something is good Not being able to is bad.
@Ell No, a burned-out wreck is reliable too. It's just not useful
Ell
Ell
@jalf the double negative was just to make a point
@jalf I think we have a misunderstanding of the meaning of "reliable"
@jalf IMHO reliable means that it will do the job it was intended to do with minimal failures
@jalf a burned out wreck is not doing the job it was intended to do
reliable: Consistently good in quality or performance; able to be trusted.
if you take that as the definition, then a burnt out car doesn't come under that for me
@Ell Sure, then it is good if we first establish what its intended job was. So again, it is not *in itself good. It is good if its intended job is good
16:25
@jalf by your argument, does Windows have any positive features?
cause it no longer ain't good quality, or performance. Heck, doesn't even drive
A reliable OS is good, if the reliability allows me to access all the positive features of the OS
Ell
Ell
@jalf we have already established to a certain extent - we are talking about OSs here - if it can't run a program, then it's not an OS so we can say it is reliable because we know all oss should run programmes
@ecatmur I can play L4D on Windows. :)
@ecatmur It has DirectX and good games.
16:26
If the OS has no positive features then who cares about its reliability?
but good features are subjective
also I find the OS API to be much less lacking
and I find it's development tools to be far superior
anyways, most of this discussion is subjective, so fuck it
and, generally, the software much more user-friendly and less "The interface more closely resembles an API than a user interface"
Ell
Ell
@jalf if I said a car was reliable, would you think "hmm first I must figure out the intended job of this car, then I can find out if it is really reliable"? or would you think "ah, it's a car, it must at least have x set of features, and it says here is is reliable so it must do those x features reliably"
16:28
@Ell If you said it here on this chat? Then yes, there's a fair chance I would think the former
;)
Ell
Ell
haha touché
@DeadMG are you talking about windows now?
My point is that when you say "a car is good because it is reliable", what you mean is "it is good because it can drive, and it is not-bad because it rarely breaks down"
@DeadMG Very subjective.
@DeadMG Why can't an API be user friendly?
I have 729 answers on SO. Isn't there something special about the number 729?
16:29
The absence of breakdowns just means that no points are subtracted. It doesn't, by itself, make the car good. The thing that makes it good is the ability to drive and carry passengers
Oh wait, I confused 729 with 1729:
__NOTOC__ {| border="1" style="float: right; border-collapse: collapse; margin-left: 15px;" |----- | colspan="2" | |----- ! colspan="2" | 1729 |----- | Cardinal | One thousand seven hundred [and] twenty-nine |----- | Ordinal || 1729th |----- | Factorization | 7 \cdot 13 \cdot 19 |----- | Divisors || 1, 7, 13, 19, 91, 133, 247, 1729 |----- | Roman numeral || MDCCXXIX |----- | Greek numeral || ,αψκθ |----- | Binary || 11011000001 |----- | Octal || 3301 |----- | Duodecimal || 1001 |----- | Hexadecimal || 6C1 |} 1729 is the natural number following 1728 and preceding 1730. 1729 is known as th...
anyway, gotta run
@CaptainGiraffe Because using it involves programming it, not using it.
> 1729 is known as the Hardy–Ramanujan number after a famous anecdote of the British mathematician G. H. Hardy regarding a hospital visit to the Indian mathematician Srinivasa Ramanujan.
@FredOverflow only 1000 to go!
if you'd noticed 24 questions ago, that'd have been a significant milestone
16:31
@DeadMG Thats some pretty shoddy semantics right there. Think the original JavaBean implemented on the /input > app > output concept. Thats a good API and a pretty intuitive interface.
@ecatmur What's so special about 705?
@CaptainGiraffe Never used JavaBean.
@FredOverflow just 2^10 from the Hardy–Ramanujan number
ah :)
JavaBeans? Isn't that the whole getter/setter nonsense?
Or is that Enterprise JavaBeans? For some reason, I can never remember which is which.
@DeadMG It was like a data oriented (pipes) flow to algorithms(methods, objects), with output (pipes). Like the Enterprise buses we see modelled in xml nowadays.
16:33
Oh wait, I know the reason. Java is boring.
Ell
Ell
@jalf well I guess it's just a difference in opinion
@FredOverflow I'm thinking about the first incarnation, with the attempt to make it all graphical, hence comes the getter setter nonsense.
@CaptainGiraffe Aand I would never, ever ask or expect any user to start editing XML to use a program.
Ell
Ell
my pokedex xpath no workie :P
@DeadMG Well the xml tech in my last response is a tech soley created to make managers feel important.
Ell
Ell
16:35
does anyone know of any upsets about libgtk3 ?
right, but you're a pure fail if you hand that to an average user who just wants to read their email, browse Facebook, etc
or, indeed, anyone else who just wants to use a program
Ell
Ell
what is so bad about xml?
@DeadMG I apologize for being unclear. The original technology was designed to let users create stuff by dragging and dropping data to operations. Surfing or emailing is not creating stuff.
@Ell (1) it's big/slow, (2) it's too complicated for end users to mess with, (3) users shouldn't need to mess with configurations to launch a program.
XML was intended for configuration?
16:41
@RMartinhoFernandes Um, why do you say that? I hate it most of the time when configuration comes in an xml form.
6 mins ago, by DeadMG
@CaptainGiraffe Aand I would never, ever ask or expect any user to start editing XML to use a program.
Ell
Ell
@MooingDuck well I meant generally xml but why is it big/slow?
@RMartinhoFernandes xml was meant for data interchange or something?
@Ell sending an int in binary: 4 bytes. Sending an int in text, 11 bytes. Sending an int in xml: ~100 bytes. Also it's harder to parse than binary/text
Xeo
Xeo
Robot, the Bonobo Gorilla said he forwarded the C++ job thingy to you. Have you done anything yet with that?
Ell
Ell
@MooingDuck Oh kk
16:42
@MooingDuck You are being very generous with xml now. the soap container is a 1k min.
Ell
Ell
are there any cross platform binary formats?
@CaptainGiraffe yes I am
@Xeo I gave him my CV and haven't heard anything else yet.
@MooingDuck It's only 9 bytes as text if you use hexadecimal ;)
@Ell with varying amounts of "cross-platform" ness, yes
Ell
Ell
16:43
but xml is completely cross platform, no?
@Ell http has a few methods worked out for you. Add the mime stuff and you are set.
Xeo
Xeo
@RMartinhoFernandes I see
@Ell yes, I'm not saying XML is useless, I'm merely saying it's big and slow, and users shouldn't have to mess with it to get a program running
@Ell also, any ASCII-based format is equally cross platform
Ell
Ell
@MooingDuck Sorry I didn't mean to imply that you said that, I was just wondering if there was a binary alternative to xml
@Ell there are a few, but nobody cares
Ell
Ell
16:45
why does nobody care?
@Ell Encoding the binary as ASCII, of course.
@Ell Compressing xml is a common topic xml-ng, if my memory serves.
@Ell everyone knows how to use XML, and it works. You have to convince a massive number of people to switch to a format that nobody else uses to get enough people using it to get traction
Ell
Ell
I suppose
can you have "references" in xml?
yeah. everything has evil extensions in XML. Look at XBRL. It is one big ball of mud that consists only of hyper-generalized references (links)
16:47
@Ell why should I install the drivers for binary formats when no webpage or browser supports binary xml? Why should a browser support it when no user/webpage supports it? Why should a webpage support it when no user/browser supports it?
Lua is a fine data format
@DeadMG I hear good things of JSON too
Ell
Ell
yaml is a superset of json and contains goodies
@MooingDuck That's not wholly true or fair. How does anything go from 0 to adoption?
@DeadMG beats me
Ell
Ell
16:48
@MooingDuck good point. I'm thinking just cross language binary serialization actually
@MooingDuck Because it's a gradual process.
@FredOverflow so did stl
Ell
Ell
or for sending serialized objects over network from c++ to c++
@Ell there's lots of ways to do it.
anyway, the point is that something like Lua, or JSON can do more with less space
16:49
Angry birds uses lua for savegames and settings and whatnot
Ell
Ell
@DeadMG I would like the idea of using lua because you can use expressions too
so you can go Height = OtherThing["Height"] - 50

...can't you?
Why didn't we just standardize byte size and endianness, object layout, and be done with it.
@Ell mostly that it's smaller/faster than xml
@Ell yes, but that's a wierd way to serialize
@CaptainGiraffe cause engineers think they can make faster systems by doing it the other way.
@CaptainGiraffe we more or less have for types, not for object layout though.
Ell
Ell
16:50
@MooingDuck yeah sorry I keep drifting between serialization and other things without saying so :L in that instance I was thinking of a file format like a gui layout for ex.
@Ell someday you'll learn how to converse :P
Ell
Ell
@MooingDuck some day indeed :D
@Ell Thanks for being a good sport.
Ell
Ell
@CaptainGiraffe haha how would I not have been a good sport? I mean, what could I have said that wouldn't have been "sportly"?
@JimNorton Have any fun with the project I gave you?
16:55
@Ell Quite a few things said in this chatroom could well be understood as "unsportsmanlike conduct"
Ell
Ell
Yeah I try my best to be sportsmanly, and when I'm not it's because I don't realise it, not because I intend to
Xeo
Xeo
0
Q: C++/SFML - game architecture

rcplusplusI'm trying to make a game, but I'm not sure of the best way to set up the main loop and classes. For really small games, I could put everything in the main() loop, including event handling, collision checking, etc. However, for large games, that's seems like a highly inefficient way to get things...

To migrate or not to migrate...
@Xeo gamedev.se.net is full of morons. Do you want to help this guy or not :p?
Ell
Ell
I much prefer libgosu over sfml, for one reason - z ordering :O
then again I don't even do that stuff so :L
does anyone do ruby? I find _why's disappearance quite the strangest thing

« first day (632 days earlier)      last day (4544 days later) »