--- Log opened Sat Mar 08 00:00:54 2008 |
00:09 | < C_tiger> | Or split it into three fields: First Name, Last Name, Company Name. |
00:10 | | * Mango nods |
00:10 | < Mango> | part of it could be due to the software we used before this |
00:10 | < Mango> | IIRC the "company name" was in a really convoluted, non-intuitive place, and most people didn't know it existed |
00:11 | < Mango> | so it could be carryover from that |
00:11 | < C_tiger> | Yeah. |
00:11 | < C_tiger> | It doesn't help with your existing records. |
00:11 | < Mango> | heh. not at all. |
00:11 | < Mango> | I've thought about going through them and cleaning them up |
00:11 | < Mango> | but at last count, over 23,000...... |
00:11 | < Mango> | :P |
00:12 | < Mango> | it's bad enough that I have to make addresses conform to Canada Post specifications |
00:12 | < C_tiger> | perl! |
00:12 | < C_tiger> | ok, probably wouldn't help. |
00:12 | < Mango> | hehe, well, I do use a lot of regular expressions in that program |
00:12 | < Mango> | that's one I don't expect the users to follow |
00:13 | < Mango> | CP has all sorts of weird rules that normal language doesn't |
00:13 | < Mango> | took me an hour or two to learn it all :-/ |
00:14 | < C_tiger> | CP? |
00:14 | < Mango> | Canada Post |
00:14 | <@AnnoDomini> | Child Pornography. |
00:14 | < Mango> | like, you can't put a period at the end of abbreviations of street names |
00:14 | < C_tiger> | Ok, that's what I parsed it as, but I figured normal language = normal programming language. |
00:14 | < Mango> | 123 Elm St. is wrong. 123 Elm St is accepted. |
00:15 | < Mango> | :P |
00:15 | < C_tiger> | That's an easy regexp. |
00:15 | < Mango> | THAT one is ;) |
00:15 | < C_tiger> | Yeah. |
00:16 | < C_tiger> | I can imagine they're not all so clearcut. |
00:16 | < Mango> | well |
00:16 | < Mango> | 123 St. James St. => 123 St. James St |
00:16 | < Mango> | 123 St. James St. North => 123 St. James St N |
00:17 | < C_tiger> | Still, not that bad. |
00:17 | < Mango> | 123 St. James => 123 St. James |
00:17 | < Mango> | :P |
00:17 | < Mango> | doable. |
00:17 | < C_tiger> | Sure. |
00:18 | < C_tiger> | As long as you don't have "St. James and 3 Sts" |
00:18 | < Mango> | eh? |
00:18 | < C_tiger> | Which would be a pain to convert around. |
00:18 | < C_tiger> | Intersection. |
00:18 | < Mango> | ahhhh |
00:19 | < Mango> | I haven't seen that one before, at least in Canada...they'd probably call that Rural Route. |
00:20 | <@McMartin> | We have RRs in the States too, but a lot of them became State Routes. |
00:20 | < Mango> | ah. |
00:26 | | AnnoDomini [AnnoDomini@83.21.84.ns-3004] has quit [Quit: Oh hai. In teh beginnin Ceiling Cat maded the skiez An da Urfs, but he did not eated it.] |
00:27 | | gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?] |
00:28 | < Vornicus> | Arg! Why can't i figure out a way to... to... uh. |
00:29 | < Vornicus> | ...no, that still doesn't work, because I don't know how big the boundaries have to be. |
00:29 | < C_tiger> | ? |
00:30 | < Vornicus> | I'm trying to figure out a method of creating a starfield with a particular amount of connectivity, without requiring an infinite number of attempts. |
00:31 | < Serah> | There is no such thing as an infinite number of attempts, only really bloody many. |
00:31 | < C_tiger> | Yay words I don't know. :P |
00:31 | < Mango> | me also :P |
00:31 | | * Mango grins at Serah |
00:32 | < C_tiger> | There's "potentially" infinite attempts. |
00:32 | < Vornicus> | Actually in this case, I can get into a state where there are no valid locations for new stars... but I can't tell. |
00:33 | < C_tiger> | What's a starfield and what's connectivity? |
00:33 | < C_tiger> | in this context. |
00:33 | < Vornicus> | Starfield: a bunch of stars, making up a map like Master Of Orion |
00:34 | < Serah> | Well before this we were discussing child pornography I think. So I think he's trying to launch a criminal into space. |
00:34 | < Vornicus> | Connectivity: the number of stars within a certain distance of a particular star |
00:34 | < C_tiger> | Ha! I thought it was was a technical computer term... like Child Pornography. |
00:35 | < C_tiger> | I'm assuming a perfectly regular distribution isn't OK. |
00:35 | < Vornicus> | Yeah, it can't be perfectly regular |
00:35 | < Serah> | But it can be perfectly irregular, if you somehow manage to get irregularity to be perfect. |
00:36 | | * Vornicus eyes Serah |
00:36 | < Serah> | What? |
00:36 | < C_tiger> | And so connectivity is a range, then? |
00:36 | < Vornicus> | Yeah |
00:36 | < Vornicus> | Legal amounts of connectivity range from 2 to 5, for the number of stars within three parsecs; no stars are allowed within 0.75 parsecs |
00:36 | < C_tiger> | The easy way would be to make connectivity be bounded on one end by infinity :P |
00:37 | < Serah> | Make a number of randomly generated blobs, make a % chance to connect it to nearby stars, remove all unconnected stars. |
00:37 | < Serah> | I actually think I'd make the blob generator decide blob size and how close a blob can be created near it. |
00:38 | < Vornicus> | blobs? |
00:38 | < Serah> | You call 'em stars, I call 'em blobs. |
00:38 | < Serah> | In either case, they'll end up as pixels on a monitor. |
00:38 | < C_tiger> | Actually, I'd do it differently, make a regular starfield and shift each star randomly within a 3 parsec radius? |
00:38 | | * Vornicus ponders that. |
00:39 | < C_tiger> | Yes you can still have stars that don't "connect" but it means limited adjustments from surrounding stars. |
00:41 | | * Vornicus ponders, acutally, random planar graphs... |
00:41 | < C_tiger> | You know you COULD cheat and have tight clusters of 5 stars each. |
00:42 | < C_tiger> | That obeys all the rules, unless you have one that there can't be a certain radius of space where there isn't a star. |
00:42 | < Vornicus> | God I love being a mathematician. |
00:42 | < C_tiger> | God loves that too. |
00:43 | < C_tiger> | I still thing tight clusters of 5 is the way to go. |
00:43 | < C_tiger> | think* |
00:43 | < Serah> | God I love you being a mathematician. |
00:43 | < Serah> | Means I won't have to. |
00:43 | < C_tiger> | That's why Vorn is a star in #math |
00:45 | | * Vornicus ponders, gets a wonderful awful idea. |
00:46 | < Vornicus> | What if, I created a uniform distribution of stars over (0,1) (0,1), figured out the star with the closest fifth-closest star, and then used that distance to scale the entire galaxy up? |
00:47 | < C_tiger> | But that doesn't fix the regular distribution not OK problem. |
00:47 | < Vornicus> | What do you mean? |
00:47 | < Vornicus> | No, uniform like, using random.uniform() |
00:47 | < C_tiger> | Ah. |
00:47 | | * Vornicus tries that out. |
00:48 | < C_tiger> | That doesn't guarantee 2 per star. |
00:48 | < C_tiger> | but it's probably close. |
00:48 | < Vornicus> | No, it doesn't. |
00:48 | < C_tiger> | nor does it guarantee the minimum distance. |
00:48 | < C_tiger> | but again, easily fudgeable. |
00:49 | < Vornicus> | Hrm. |
00:50 | < C_tiger> | I think you're best off with a scheme like that regardless. A starting point and then adjust a few stars so all of them fit your rules. |
00:50 | < Vornicus> | Yes, recent experience tells me that this is a very good way to do things. |
00:51 | < C_tiger> | Ok, I'm super stupid with linux, how do I make a tarball again? |
00:52 | < Vornicus> | tar |
00:52 | < C_tiger> | how do I specify what goes in it? |
00:52 | < Vornicus> | tar -zcvf my_tarball.tgz thing_one thing_two yadda |
00:53 | < C_tiger> | Ah. |
00:53 | < Vornicus> | remove -z to get a flat tarball, uncompressed |
00:53 | < Vornicus> | use -j instead of -z for bzip |
00:54 | < C_tiger> | bzip? |
00:55 | < Vornicus> | bzip2 is a compression method that is /fucking good/ at text. |
01:01 | < C_tiger> | Ah. |
01:01 | < C_tiger> | Oh well, no matter. |
01:01 | < C_tiger> | It was 10 KB uncompressed. |
01:02 | < C_tiger> | I just didn't want to send a dozen files. |
01:19 | | * Vornicus fiddles, tries it. |
01:23 | | * Vornicus eyes, obviously got something wrong. |
01:35 | < Vornicus> | ...okay, how the hell... |
01:42 | < Vornicus> | Ah. That's why, uniform distribution is /really random/ |
01:42 | < C_tiger> | ? |
01:45 | < Vornicus> | ...no, it's still wrong, what's going on? |
01:46 | < C_tiger> | I'm sadly not a mind reader. |
01:47 | < Vornicus> | Oh, I'm having trouble with densities. |
01:52 | < Vornicus> | What I've got is a pile of sorted lists of distances |
01:53 | | * Serah curls up on Vorn and snoozles. |
02:08 | < Vornicus> | Okay, problem here is, there's a severe disparity in uniformly distributed density |
02:10 | < Vornicus> | On my first try with the appropriate monitoring, there's a star that's nearly a full unit away from its second closest neighbor, and a star that's less than 0.1 units away from its sixth-closest neighbor. |
02:12 | < Vornicus> | No, that's wrong. Dammit, stupid collapses, let's do this right |
02:13 | < Vornicus> | There we go. |
02:13 | < Vornicus> | There's a star that's 0.16 away from its second closest neighbor, and a star that's 0.08 away from it's sixth-closest neighbor. |
02:16 | < Vornicus> | And a star that's 0.004 away from its closest neighbor, so that's pretty drastic. |
02:18 | < Vornicus> | ...I can use the Delauney Triangulation... |
02:19 | | * Vornicus fiddles. |
02:20 | < Vornicus> | ...no, I don't like that. |
02:21 | < Vornicus> | On the other hand, I can demand a minimum connectivity but not a maximum one, and then it's not too bad. |
02:22 | < Vornicus> | ...no, I definitely need a smoother distribution. |
02:28 | | * Vornicus fiddles. How can he 'relax' the structure of his map. |
02:38 | <@Reiver> | So, Vorn: Diminishing Marginal Returns means what? |
02:41 | < Vornicus> | Diminishing marginal returns: each extra point you spend on something gets you less utility than the last. |
02:41 | < Vornicus> | Calculusly: the second derivative of utility to amount purchased is always negative. |
02:55 | < C_tiger> | Vornicus, going back to the tweaking-a-regular-distribution thing I proposed? |
02:56 | < C_tiger> | Mentally, I'd do it somewhat probabilistically. |
02:56 | < Vornicus> | Yeah. |
02:57 | < C_tiger> | Build a "bell curve" at each point where the probability is shaped by the known locations next to it. |
02:57 | <@McMartin> | Gnrk. Need to learn how to use SwingWorkers. |
02:57 | <@MyCatVerbs> | Vornicus: why don't you just random-walk the points until the distances even out a bit? |
02:58 | <@MyCatVerbs> | (For some arbitrarily-useful definition of "even") |
02:58 | < C_tiger> | So point 1 is probabilitically uniformly distributed across a sphere/circle of radius X. Point two's distribution is shaped by where point 1 ended up. |
02:58 | < C_tiger> | etc etc. |
02:58 | <@MyCatVerbs> | C_tiger: that sounds sensible. |
02:58 | < Vornicus> | C: the problem with a distribution like that is that I can't do distributions cheaply |
02:59 | < Vornicus> | I tried something like that already, and it took more than a second to update the distribution graph for each point. |
02:59 | < C_tiger> | But you only need to calculate relative to the nearest points. |
02:59 | < Vornicus> | gnar |
03:00 | < C_tiger> | Since you're confining each point to be within a space defined by the uniform distribution. |
03:00 | < C_tiger> | erm, regular distribution. |
03:00 | < Vornicus> | ...if I could figure out a decent way to relax the delaunay triangulation I could probably do this. |
03:02 | < Vornicus> | ...no, that really doesn't work anyway, you're pretty well guaranteed to get 5 or 6 connections per interior star by delaunay |
03:03 | <@ToxicFrog> | Disassemble the SEV starfield generator, reverse engineer it and use that~ |
03:03 | < Vornicus> | TF: if only~ |
03:04 | | * MyCatVerbs would honestly do the lazy thing and apply some form of simulated annealing. |
03:04 | < Vornicus> | simulated annealing? |
03:05 | <@MyCatVerbs> | Vornicus: fancy name for hill-climbing by random-walking. |
03:05 | < Vornicus> | aha |
03:05 | <@ToxicFrog> | Only with a twist. |
03:05 | <@ToxicFrog> | Basically, it's hill-climbing with a chance to explore sub-optimal results, which gradually decreases as the problem "cools" |
03:06 | <@ToxicFrog> | I have a bunch of notes on it here, had to implement it last semester. |
03:06 | <@MyCatVerbs> | Yar. Also, both the size of the jumps and the probability of not-immediately-backtracking when hitting a reduction in fitness start out high and decrease as the generation number increases. |
03:06 | <@MyCatVerbs> | Sorry for presenting the ridiculously oversimplified description. |
03:07 | | * MyCatVerbs doesn't really see the point in SA, except when you only have one CPU handy. |
03:08 | <@MyCatVerbs> | Aside from that, GAs are much more fun because they parallelize easily. |
03:09 | <@ToxicFrog> | SA can be used to hugely speed up stuff - even on a supercluster there are some problems that can't be solved in useful time using pure GAs - and can also get you out of some gene-pool stagnation issues |
03:09 | <@ToxicFrog> | Hang on, I have a case study here somewhere... |
03:10 | <@MyCatVerbs> | What, you use it for short hill-climbing expeditions between generations? |
03:10 | <@ToxicFrog> | Oh, wait. No, I was getting it confused with vibrational. |
03:11 | <@ToxicFrog> | Basically, the idea is you use GAs to identify an optimal region, and then hill-climbing to find the local optimum in that region rather that waiting for the GA to converge on it |
03:11 | <@MyCatVerbs> | Sounds sensible. |
03:11 | < C_tiger> | I thought the goal was something sub optimal. |
03:12 | <@ToxicFrog> | This doesn't as a rule produce noticeably better results, but does so much faster, because once it's in the right general area the HC converges much faster than the GA. |
03:12 | <@ToxicFrog> | Er, no? |
03:12 | <@MyCatVerbs> | SA can be viewed as a special case of GAs, right? Single population member and mutation-only. |
03:12 | <@ToxicFrog> | The goal is always something optimal. |
03:12 | <@MyCatVerbs> | Well... not quite, but close. |
03:12 | | * Vornicus ponders, decides trying iterative gravity might work. |
03:12 | <@ToxicFrog> | However, you're usually willing to accept something not quite optimal. |
03:12 | < C_tiger> | Um, but in this case, we KNOW we can satisfy all the constraints with a regular grid. |
03:13 | < C_tiger> | We're just trying to find one that is still sufficiently even but with a lot more randomness. |
03:13 | <@ToxicFrog> | MyCatVerbs: SA I have always considered a variant of hill climbing. |
03:13 | <@ToxicFrog> | However, one can reduce HC to GA by supplying the right mutation, selection, crossover, and fitness operators, so. |
03:13 | <@MyCatVerbs> | ToxicFrog: yeah, that makes more sense. |
03:14 | <@ToxicFrog> | (you generally don't want to, thougn~) |
03:14 | <@MyCatVerbs> | GA to HC, you mean? |
03:15 | <@MyCatVerbs> | Seeing as GA's rather more complicated than naive hill climbing. >_> |
03:15 | <@ToxicFrog> | No, HC to GA. |
03:15 | <@ToxicFrog> | You can't go from GA to HC in the general case. |
03:16 | <@MyCatVerbs> | ToxicFrog: okay, what do you mean by hill-climbing in this case? |
03:16 | <@MyCatVerbs> | ToxicFrog: I thought you were referring to the naive "find a direction in which an upwards slope exists and walk that way" algorithm. |
03:16 | <@ToxicFrog> | Pretty much, yes. |
03:17 | <@ToxicFrog> | More generally, one that examines all solutions within locality of the current one and moves to the optimal one |
03:17 | <@ToxicFrog> | Repeating until none of the ones within the search radius are any better than the current one. |
03:17 | <@ToxicFrog> | In effect, it goes "up" in the search space until it finds itself on a hilltop. |
03:18 | <@ToxicFrog> | SA modifies this by greatly expanding the search radius and giving it a chance to move "down", with both the radius and that chance decreasing the longer it runs for. |
03:19 | <@MyCatVerbs> | And how's GA a reduction? |
03:19 | <@MyCatVerbs> | That part I don't quite apprehend. |
03:19 | | * Vornicus fiddles, trying to determine the appropriate metric. |
03:20 | <@ToxicFrog> | "reducing problem A to problem B" -> transforming an instance of problem A into one of problem B |
03:20 | <@ToxicFrog> | This does not necessarily mean that B is any simpler or easier to solve, although usually this is why you perform the reduction |
03:21 | <@MyCatVerbs> | Vornicus: how about: just pretend all points repel each other according to the inverse square law. Distribute them completely randomly at first, then iterate two or three times. |
03:21 | <@MyCatVerbs> | ToxicFrog: oh, huh. But GA and HC are both, ah, solutions rather than problems? |
03:22 | < Vornicus> | MCV: that's the code I'm writing now; there's a bit of complication though do to my connectivity constraints. |
03:23 | <@ToxicFrog> | MyCatVerbs: the way I see it, they're different ways of representing, and solving, one underlying problem (that of finding a global maximum) |
03:23 | | * MyCatVerbs ponders. "Will punch you in the face if you attempt to foist a Myers-Briggs test (or any other such bullshit) upon them" should be its own MBTI category entirely. |
03:23 | <@ToxicFrog> | But hmm. That is a good question. |
03:24 | <@ToxicFrog> | Theory/terminology gurus, is it appropriate to use "reduce" for algorithms, such as transforming hill climbing into GA? |
03:35 | < Vornicus> | Works for me |
03:49 | < Vornicus> | Okay, two repel segments... do I want an attract, too? |
03:58 | <@McMartin> | Reduction is appropriate if the transformation can be done within the complexity class of the initial problem. |
04:04 | | Mango [~Mango@24.86.100.ns-4243] has quit [Quit: Trillian (http://www.ceruleanstudios.com] |
04:09 | | * Vornicus fiddles, can't come up with an attract. |
04:55 | | Thaqui [~Thaqui@Nightstar-123.jetstream.xtra.co.nz] has joined #code |
04:55 | | mode/#code [+o Thaqui] by ChanServ |
06:27 | | GeekSoldier|bed is now known as GeekSoldier |
06:39 | | GeekSoldier [~Rob@91.18.81.ns-3759] has quit [Ping Timeout] |
06:39 | | GeekSoldier [~Rob@91.18.100.ns-10675] has joined #code |
07:49 | | C_tiger [~c_wyz@Nightstar-16221.nycmny.east.verizon.net] has quit [Quit: something's] |
07:54 | | Thaqui [~Thaqui@Nightstar-123.jetstream.xtra.co.nz] has left #code [Leaving] |
08:15 | | AnnoDomini [AnnoDomini@83.21.84.ns-3004] has joined #Code |
08:15 | | mode/#code [+o AnnoDomini] by ChanServ |
08:28 | | Vornicus is now known as Vornicus-Latens |
08:57 | | You're now known as TheWatcher |
09:24 | | Netsplit DeepThought.NY.US.Nightstar.Net <-> Blargh.CA.US.Nightstar.Net quits: EvilDarkLord, Kazriko |
09:28 | | Kazriko [~kaz@72.174.26.ns-12779] has joined #code |
09:30 | | Kazriko is now known as NSGuest-5459 |
09:30 | | EvilDarkLord [~jjlehto3@Nightstar-2194.vipunen.hut.fi] has joined #code |
09:31 | | EvilDarkLord is now known as NSGuest-5461 |
09:35 | | Raif [~corvusign@67.161.90.ns-4200] has quit [Killed (NickServ (GHOST command used by Raif_))] |
09:35 | | Raif_ [~corvusign@67.161.90.ns-4200] has joined #Code |
09:35 | | Raif_ is now known as Raif |
09:36 | | AnnoDomini [AnnoDomini@83.21.84.ns-3004] has quit [Ping Timeout] |
09:36 | | AnnoDomini [AnnoDomini@83.21.84.ns-3004] has joined #Code |
09:36 | | mode/#code [+o AnnoDomini] by ChanServ |
09:58 | | gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code |
09:58 | | mode/#code [+o gnolam] by ChanServ |
10:29 | <@McMartin> | Idly, ToxicFrog, I also worked out why Blorple was trashing the Hell out of your system requirements. |
10:29 | <@McMartin> | It's because it was doing all of the file access and XML parsing and Blorb decoding and everything inside the event loop thread. >_< |
10:29 | | * McMartin is doing what needs to be done to fix that now. |
10:39 | | NSGuest-5459 is now known as Kazriko |
10:49 | <@AnnoDomini> | Why why why!? Why did the creators of the x86 architecture have to choose such a stupidly complex addressing method? |
11:01 | | You're now known as TheWatcher[afk] |
11:11 | <@McMartin> | Ah, Sorcerer. |
11:11 | <@McMartin> | >wake up |
11:11 | <@McMartin> | As you wake up, Frobar sticks his head in the door and invites you shopping. When you return late that evening, you find the Guild Hall sacked, and many fellow Enchanters slaughtered. Servants of evil, teeth smeared with blood, fall upon you as well. A menacing voice echoes about the room. "Pathetic Enchanters ... Who can save you now?" |
11:11 | <@McMartin> | Some days it just doesn't pay to wake up. |
11:11 | <@McMartin> | Your score is 0 of a possible 400, in 0 moves. This puts you in the class of Charlatan. |
11:12 | <@AnnoDomini> | What. |
11:12 | <@McMartin> | Sorcerer is an old Infocom game. |
11:13 | <@McMartin> | If you enter > WAKE UP as the first move, that is the message you get. |
11:13 | <@AnnoDomini> | LOL. |
11:14 | <@Reiver> | *snerk* |
11:14 | <@McMartin> | (In the real plot, after about five moves or so, you wake up from what was actually a dream sequence, and Frobar and the lads left without you. In the canonical plot you thwart the servants of evil before they return) |
11:15 | < GeekSoldier> | AD: to be able to address 1MB of RAM a long long time ago. |
11:15 | <@McMartin> | (Other losing endings involve accidentally teleporting to Cambridge, Massachussetts, and getting run down by a motorcar after being mugged.) |
11:15 | <@McMartin> | GeekSoldier: The claim here is that as long as you're going to eat 32 bits for each address *anyway*, why not let you address the full 4GB |
11:16 | <@AnnoDomini> | GeekSoldier: Why couldn't they have done something, uh, simpler? Like a special 20bit register? |
11:16 | < GeekSoldier> | perhaps because back then, 4GB was quite unthinkable? |
11:16 | <@AnnoDomini> | Hell, or even a 16bit register and a 4 bit register. |
11:16 | <@McMartin> | Geek: I dispute this, as anyone can imagine large numbers. |
11:17 | <@McMartin> | You'll notice we learned our lesson. 16 exabytes is unthinkable now but we used a flat 64-bit address space *anywa8> |
11:17 | <@McMartin> | anyway |
11:17 | < GeekSoldier> | true. |
11:17 | <@McMartin> | AnnoDomini: The only halway sane answer I can come up with is "It lets you take 16-bit programs -- which most were -- and timeshare them on hardware more easily, for the case where more programs are available |
11:17 | <@McMartin> | Er |
11:17 | <@McMartin> | For the state where there is more RAM available than programs to address it |
11:22 | < GeekSoldier> | yeah, I can see that. |
11:23 | <@Reiver> | The origional Star Trek Enterprise had a whole terabyte of memory on board, y'know. |
11:23 | <@AnnoDomini> | Heh. |
11:23 | <@Reiver> | I don't blame them for screwing up the assumption that we'd beat four gigs in a decade or two~ |
11:24 | <@McMartin> | Clearly a problem for future generations to solve. |
11:24 | <@McMartin> | Just like if we actually start running into exabyte-level storage needs, having longer disk addresses is Totally Their Problem. |
11:24 | <@McMartin> | They can write emulators for our stuff -- they'll have the source. |
11:24 | <@McMartin> | Hell. They can probably just adapt compilers for it. |
11:25 | < GeekSoldier> | I still find it a bit sad that, deep down, our PCs are running tech from 1978. |
11:25 | <@Reiver> | ...whoa, hm |
11:25 | <@McMartin> | And using it to emulate hardware from 1982! |
11:25 | | * McMartin huggles VICE |
11:25 | | * Reiver hadn't clicked that we are planning ahead by that many orders of magnitude. |
11:26 | <@McMartin> | No sense in paying costs *now* for problems that don't yet exist, if there's a migration path. |
11:26 | | * Reiver had thought that Exa-, came after Tera-, which we probably will beat eventuallyish~ |
11:26 | <@McMartin> | Google already is at petabyte level, I think. |
11:26 | <@McMartin> | The Whole Internet is pretty big. |
11:26 | <@Reiver> | Aye. And 64-bit manages a thousand times bigger /again/, so |
11:27 | <@McMartin> | Anyway, the reason the limit's 16 exabytes isn't because we think it's a good limit. |
11:27 | <@McMartin> | It's because we already use 64-bit numbers a lot for things, so we might as well make it the native address size too. |
11:27 | <@Reiver> | But because any bigger requires Much More Address Space, and address space impacts performance? |
11:27 | <@McMartin> | Well, it requires redesigning much more of your architecture, and nobody's gonna use it. |
11:28 | <@McMartin> | Remember, address space is for *RAM* |
11:28 | <@McMartin> | Or the appearance thereof. |
11:28 | <@Reiver> | (Which is why, IIRC, IP ranges were so 'small' to start with - it was entirely reasonable at the time, given unique addresses needed vs relative internet speeds of the time.) |
11:28 | <@McMartin> | 64-bit address spaces don't run out until individual programs need more than 16 exabytes each. |
11:28 | <@Reiver> | ...oh yes, heeee |
11:28 | <@Reiver> | ... Yeah, I think we'll be ok~ |
11:29 | <@McMartin> | So, building a new architecture that goes beyond that is much more work than "Yeah, the mechanisms we've been using for double precision? Put them everywhere". |
11:29 | <@McMartin> | And we need *those* much sooner. |
11:29 | <@Reiver> | We'd have to bump up computer capability improvement rate by an order of magnitude or two to see that in our lives. |
11:29 | <@McMartin> | 2038, IIRC. |
11:29 | | AnnoDomini [AnnoDomini@83.21.84.ns-3004] has quit [Ping Timeout] |
11:29 | <@McMartin> | 2038 is when we hit Epoch Fail. |
11:29 | <@Reiver> | *snrk* |
11:29 | < GeekSoldier> | McM mentions the epoch, and AD falls out... |
11:29 | < GeekSoldier> | bad omen. |
11:29 | <@Reiver> | That's when UNIX has a heart attack, innit? |
11:30 | < GeekSoldier> | yeah. |
11:30 | <@McMartin> | Only versions compiled with 32-bit compilers. |
11:30 | <@McMartin> | That's the nice thing about having the source. |
11:30 | <@McMartin> | My copy of Unix will be fine |
11:30 | < GeekSoldier> | 2^32 seconds from 1 Jan 1970. |
11:30 | <@Reiver> | ...That's going to be a problem how |
11:30 | <@McMartin> | Same way Y2K was. |
11:30 | <@Reiver> | Yeah, but |
11:30 | <@McMartin> | Standard UNIX timestamps are "seconds from 1 Jan 1970" |
11:30 | <@Reiver> | The number of 32 bit machines running in 2038 outside of mueseums or NASA data storage is...? |
11:31 | <@McMartin> | Precisely. |
11:31 | <@McMartin> | That's why having 64-bit integers be the native ones is Sensible Planning. |
11:31 | <@McMartin> | Especially since dates 30 years in the future are Really Not That Unreasonable. |
11:31 | <@Reiver> | (NASA is kind of allowed, too - they do occasionally have a reason to break out the ol' dusty bastards, when some Experiment From Long Ago starts causing chaos) |
11:31 | < GeekSoldier> | fortunately, it will not involve relearning COBOL to address the problem. |
11:31 | <@Reiver> | (F.ex, the Pioneer probes~) |
11:32 | <@McMartin> | GeekSoldier: Indeed. It will involve typing "make". |
11:32 | <@McMartin> | Slowly but surely, we learn! |
11:32 | <@McMartin> | Though places where people used "int" where they should have used time_t might be a problem. |
11:32 | <@McMartin> | You ought to be able to catch that with lint, though. |
11:32 | | * GeekSoldier nods. |
11:32 | | Vornicus-Latens [~vorn@ServicesOp.Nightstar.Net] has quit [Ping Timeout] |
11:32 | <@McMartin> | Oh, and people who used fwrite to dump structs will be hosed at the recompile. |
11:33 | <@McMartin> | But that will be well before 2038, and anyone who does direct structure dumps deserves their fate anyway. |
11:33 | < GeekSoldier> | and the epoch fail is well known and being addressed 30 years before it is to occur as well. |
11:33 | <@McMartin> | Also a plus |
11:33 | < GeekSoldier> | lol |
11:33 | <@McMartin> | Of course, we're also addressing it so that we can shove more polygons at our shiny plasma TVs. |
11:34 | <@Reiver> | *snrk* |
11:35 | <@Reiver> | And dude, it's all LCD these days~ |
11:37 | | AnnoDomini [AnnoDomini@83.21.32.ns-4025] has joined #Code |
11:37 | | mode/#code [+o AnnoDomini] by ChanServ |
12:32 | < GeekSoldier> | hmmm... a thought occurs... what about Y10k? |
12:32 | <@AnnoDomini> | Not Our Problem. |
12:32 | <@AnnoDomini> | If civilization still exists by then, I suppose it'd be a problem, though. |
12:34 | < GeekSoldier> | yeah. |
12:35 | <@AnnoDomini> | Fortunately, we know EXACTLY when Y10K will be a problem. |
12:43 | < Serah> | Y10K isn't a problem. |
12:43 | <@AnnoDomini> | To you. |
12:43 | < Serah> | Someone will have to device and operating system within the last two hundred years. This will accomodate for the issue. |
12:44 | < GeekSoldier> | by then, there will be entirely new platforms, and it should be addressed in those new platforms. |
12:45 | < GeekSoldier> | if they are still using modern equipment 8000 years from now, I will be duly impressed. |
12:49 | <@Reiver> | The funny thing is, if they were, I would put money on it being a 386/486 chip that was~ |
12:49 | <@Reiver> | Those things freakin' never die, compared to the new things! |
12:53 | < GeekSoldier> | true that, Reiver. |
13:26 | | NSGuest-5461 is now known as EvilDarkLord |
13:48 | | GeekSoldier [~Rob@91.18.100.ns-10675] has quit [Ping Timeout] |
13:51 | | GeekSoldier [~Rob@91.18.100.ns-10675] has joined #code |
13:58 | | GeekSoldier [~Rob@91.18.100.ns-10675] has quit [Ping Timeout] |
14:00 | | GeekSoldier [~Rob@91.18.100.ns-10675] has joined #code |
14:03 | | GeekSoldier [~Rob@91.18.100.ns-10675] has quit [Ping Timeout] |
14:07 | | GeekSoldier [~Rob@91.18.86.ns-26604] has joined #code |
14:42 | | You're now known as TheWatcher |
15:14 | | Moltare [~moltare@Nightstar-29340.cable.ubr02.bath.blueyonder.co.uk] has joined #code |
15:14 | < Moltare> | y halo |
15:14 | <@TheWatcher> | 'lo Mol |
15:14 | < Moltare> | I'm not a coder ¬¬ do I still get a Swiss bank account? |
15:14 | <@TheWatcher> | Welcome to... the dungeo^H^H^H^H^H^Hchannel |
15:15 | <@gnolam> | Only if Reiver finds you pretty. |
15:15 | | * Moltare preens? |
15:15 | | * ToxicFrog hands Mol an abstract syntax tree |
15:15 | <@gnolam> | And a partridge in a splay tree. |
15:22 | < Moltare> | I have a problem, gents, and it can be summed up in two lines |
15:23 | < Moltare> | 1) I must write a lexer (using flex and c), symbol table (using c and a hash table) and parser (using recursive descent, implemented in c), by this Wednesday. |
15:23 | < Moltare> | 2) Due to the nature of my course, I have never been taught any C at all. |
15:24 | < Moltare> | (In fact, I could sum it up even more consisely as OMGHALP;_;, but that's somewhat short on the details) |
15:25 | | * Reiver eyes that. |
15:25 | <@ToxicFrog> | The lexer is easy even if you don't know C, thanks to flex. |
15:25 | <@Reiver> | Have you been taught to code, making this a syntax issue? |
15:25 | <@Reiver> | Or is this a matter of programming, making this a in-the-wrong-course issue?~ |
15:25 | <@jerith> | Doesn't bison/yacc generate recursive-descent parsers? |
15:25 | < Moltare> | Reiv: I have done a term's worth of basic Java and a term's worth of PHP/SQL |
15:25 | <@ToxicFrog> | The parser and symbol table will be trickier, but of all the parser types recursive descent is probably the easiest conceptually, so that will help. |
15:25 | < Moltare> | jerith: Yep, but we're specifically not to use yacc |
15:25 | <@Reiver> | Ah, then you know how to code, and are used to boilerplate. You'll be fine~ |
15:26 | <@jerith> | Ah. |
15:26 | < Moltare> | I'm fine on the concepts. Put set of language rules -> here; put set of grammar rules -> here; divide program into (left tree)(item)(right tree) and recurse |
15:27 | < Moltare> | What I can't do to save my life is any of the bits of C that make it activate those rules, and make each section talk to each other. |
15:28 | <@ToxicFrog> | Start small, I think; step one is the flex input, with a small C main() that calls it and just prints all the tokens from the program. |
15:28 | <@gnolam> | Well, if you know PHP and Java, C syntax won't be a roblem anyway. |
15:28 | <@jerith> | How complex is the grammar you're parsing? |
15:29 | < Moltare> | Basic arithmetic, if-else and while for integers and floats |
15:30 | < Moltare> | oh, and strings |
15:31 | | * jerith suddenly recalls he has shopping to do, flees. |
15:31 | <@ToxicFrog> | So. Start by writing out the grammar and the lexical definitions. |
15:32 | < Moltare> | Got those. |
15:32 | | mode/#code [+o Moltare] by Reiver |
15:32 | <@Moltare> | And got the regexes that represent them |
15:32 | <@ToxicFrog> | Excellent. |
15:32 | <@ToxicFrog> | In that case, on to the lexer. |
15:33 | <@ToxicFrog> | How much of the flex input file do you have/how familiar are you with the flex file format? |
15:35 | <@Moltare> | I know it's in three sections, the first being declarations and includes, the second being the token regexes and their return values, the third being "anything else you need to tack on" |
15:35 | <@ToxicFrog> | Ok. |
15:36 | <@ToxicFrog> | I note that it's not necessarily "regexes and return values" |
15:36 | <@ToxicFrog> | It's "regexes and what it does when it matches them" |
15:36 | <@Moltare> | Right, sorry |
15:36 | <@ToxicFrog> | Typically, when you're interfacing it with a parser, these will indeed be returns |
15:36 | <@Moltare> | That's what I meant to say |
15:36 | <@ToxicFrog> | But it's perfectly legal to have something like: |
15:36 | <@Moltare> | At the moment mine are all printfs |
15:36 | <@ToxicFrog> | Aah. |
15:36 | <@Moltare> | Just to try to see if it did anything at all |
15:36 | <@ToxicFrog> | Ok then, that's what I was actually going to suggest. |
15:37 | <@ToxicFrog> | So all you need now is a main() at the end that calls the lexer. |
15:38 | <@ToxicFrog> | And then you'll have something that you should be able to run on your input and have it spit out what tokens it thinks it sees. |
15:38 | <@ToxicFrog> | I take it that it's writing this main() that's giving you difficulties, given lack of familiarity with C? |
15:38 | <@Moltare> | And the includes |
15:39 | <@ToxicFrog> | The includes you can actually skip for the moment. |
15:39 | <@Moltare> | Ah, right |
15:39 | <@ToxicFrog> | flex automatically includes all the standard ones in the generated lexer. |
15:39 | <@Moltare> | Apart from maths.h |
15:39 | <@Moltare> | *math |
15:39 | <@Moltare> | Since I call atof in the printfs |
15:39 | <@ToxicFrog> | (well, it includes stdio, stdlib, errno, and string) |
15:40 | <@ToxicFrog> | Aah. |
15:40 | <@ToxicFrog> | In that case, yes. |
15:40 | <@ToxicFrog> | So, the way you insert verbatim C code in sections other than the last is: %{ ...code goes here %} |
15:40 | <@AnnoDomini> | Errno sounds like an expletive/negation. |
15:40 | <@ToxicFrog> | AnnoDomini: error code handling. |
15:40 | <@ToxicFrog> | Moltare: so, in the first section, try: |
15:40 | <@ToxicFrog> | %{ |
15:40 | <@ToxicFrog> | #include <math.h> |
15:40 | <@ToxicFrog> | %} |
15:41 | <@Moltare> | Yep, got that |
15:41 | <@Moltare> | (huzzah) |
15:41 | <@ToxicFrog> | Alright, that just leaves main() |
15:41 | <@Moltare> | Currently got: |
15:41 | <@Moltare> | main( argc, argv ) |
15:41 | <@Moltare> | int argc; |
15:41 | <@Moltare> | char **argv; |
15:41 | <@Moltare> | { |
15:41 | <@Moltare> | ++argv, --argc; /* skip over program name */ |
15:41 | <@Moltare> | if ( argc > 0 ) |
15:41 | <@Moltare> | yyin = fopen( argv[0], "r" ); |
15:41 | <@Moltare> | else |
15:41 | <@Moltare> | yyin = stdin; |
15:41 | <@Moltare> | yylex(); |
15:41 | <@ToxicFrog> | Aah, copied from the manual. |
15:41 | <@Moltare> | } |
15:41 | <@Moltare> | Entirely |
15:41 | <@ToxicFrog> | Ok, first of all, you can rewrite the start of that more readably as: |
15:42 | <@ToxicFrog> | int main(int argc, char ** argv) |
15:42 | <@Moltare> | (I was surprised you can get away without declaring return types etc) |
15:42 | <@Moltare> | (Java would pitch a fit) |
15:43 | <@ToxicFrog> | Unlike Java, C arrays do not have inherent length, so it's passed in an array of strings -and- an int containing the length of the array. |
15:43 | <@gnolam> | If you don't write anything, int is implicitly assumed. |
15:43 | <@ToxicFrog> | (undeclared return types are automatically "int") |
15:43 | <@gnolam> | Note that implicit declarations are Pure Evil though. |
15:43 | <@ToxicFrog> | Yes. |
15:43 | <@ToxicFrog> | So don't use them. |
15:43 | <@TheWatcher> | although your compiler should whine at you if you use -Wall ¬¬ |
15:43 | <@Moltare> | I'll bear that in mind in all the C code I write from now on ;) |
15:43 | <@TheWatcher> | (and if you aren't using -Wall why not?) |
15:43 | <@Moltare> | (because I've never heard of it) |
15:44 | <@ToxicFrog> | (turns on all warnings) |
15:44 | <@ToxicFrog> | But we get ahead of ourselves. |
15:44 | <@ToxicFrog> | As for the rest of that function - the ++argv, --argc moves argv (the array of arguments) to the next element, and reduces the count of arguments |
15:44 | <@ToxicFrog> | So { "foo", "bar" }, argc=2 becomes { "bar" }, argc=1 |
15:44 | <@Moltare> | right |
15:45 | <@ToxicFrog> | The reason being the first argument is always the name of the program. |
15:45 | <@ToxicFrog> | Then it checks to see if it got any arguments apart from that. |
15:45 | <@ToxicFrog> | If so, it assumes the first one is the name of a file to lex, opens the file for read (that's the fopen) and assigns the open file handle to yyin |
15:45 | <@ToxicFrog> | yyin being a special global variable that flex uses to read input from. |
15:45 | <@Moltare> | Ah |
15:46 | <@Moltare> | yy* is defined by flex? |
15:46 | <@ToxicFrog> | If it didn't get any arguments, it just sets yyin = stdin, stdin being an automatically created file handle which is standard input |
15:46 | <@ToxicFrog> | (the assumption being that you're running it in that case as "lexer < file", or "program | lexer") |
15:46 | <@ToxicFrog> | (rather than "lexer file") |
15:46 | <@ToxicFrog> | flex or yacc. |
15:46 | <@Moltare> | alright |
15:47 | <@ToxicFrog> | Anyways. That main -should- work. |
15:47 | <@ToxicFrog> | So you should just be able to run flex on the file, and then compile the resulting source |
15:48 | <@ToxicFrog> | And then run the program on a file to have it spit out a list of tokens. |
15:50 | <@Moltare> | And here we reach problem one: "Premature EOF" |
15:51 | <@gnolam> | That happens to the best of us. Just take it slow and think about baseball. |
15:51 | <@Moltare> | An American sport for those too impatient for cricket? |
15:55 | | * Moltare goes looking for mismatched brackets etc, then |
15:58 | <@Moltare> | ...do I need to do something dodgy to ";" to let it know it's looking at a semicolon in quotes rather than quote/endofline/quote? |
16:06 | | AnnoDomini is now known as mickserv |
16:06 | <@ToxicFrog> | No. |
16:06 | | mickserv is now known as AnnoDomini |
16:07 | <@ToxicFrog> | Typically, premature EOF means you have a { somewhere that's missing a } |
16:07 | <@ToxicFrog> | Using an editor with brace matching powers may help here. |
16:07 | <@TheWatcher> | (emacs ftw! ¬¬) |
16:07 | <@Moltare> | (using it) |
16:08 | <@TheWatcher> | parenthesis matching on? (options menu) |
16:10 | <@Moltare> | aye |
16:11 | <@Moltare> | Just to check I'm not doing something stupid: the lines of the rules should look something like |
16:11 | <@Moltare> | "while" { printf( "A keyword: %s\n", yytext ); } |
16:11 | <@Moltare> | or |
16:11 | <@Moltare> | {DIGIT}+"."{DIGIT}* { printf( "A float: %s (%g)\n", yytext, atof( yytext ) ); } |
16:11 | <@Moltare> | where DIGIT was defined earlier as [0-9] |
16:12 | <@ToxicFrog> | Yes. |
16:13 | <@Moltare> | (just thought I'd check, since emacs is using red for the semicolons and close-parens and I wondered if that was a Hint) |
16:15 | <@ToxicFrog> | You could try pastebinning the entire file. |
16:16 | <@Moltare> | ? |
16:17 | | * ToxicFrog points at the topic |
16:18 | <@ToxicFrog> | A pastebin is a site that lets you put code there for people to look at. |
16:19 | <@Moltare> | aha |
16:19 | <@Moltare> | http://rafb.net/p/fPrNR466.html |
16:22 | <@ToxicFrog> | ...why is it all indented? |
16:23 | <@Moltare> | 'cos I don't like it all crushed up and unreadable, and afaik the amount of indentation is irrelevant |
16:24 | <@ToxicFrog> | No, it is relevant |
16:24 | <@ToxicFrog> | Flex is sensitive to indentation |
16:24 | <@ToxicFrog> | And by "it all indented" I mean "every single line is indented eight spaces, in addition to whatever other indentation you are using" |
16:24 | <@ToxicFrog> | Which is your problem. |
16:25 | <@ToxicFrog> | Among other things, to flex, "%%" is not the same as " %%", and regexes must be the first thing on the line, with no leading whitespace |
16:27 | <@Moltare> | hm |
16:27 | <@Moltare> | Fair enough, that's gone |
16:27 | <@ToxicFrog> | If you don't want your code touching the left side of the screen, the solution is to adjust your editor's margins; indenting the entire file can and will break things in many languages, including flex. |
16:27 | <@Moltare> | as is the error, wahey |
16:31 | | * Moltare sends lex.yy.c to the compiler, gets back a lex.dep, lex.err, lex.yy.o and makefile |
16:31 | <@Moltare> | Also a .prj file, but I think that's the compiler talking |
16:32 | <@ToxicFrog> | The IDE. |
16:32 | <@ToxicFrog> | lex.yy.o is the object file, which you can turn into a runnable program. |
16:35 | <@Moltare> | Sounds like a plan. What does that require? |
16:35 | <@ToxicFrog> | In general terms, "feed it to the linker" |
16:36 | <@ToxicFrog> | If you're using gcc, just gcc -Wall -o lexer lex.yy.o |
16:36 | <@Moltare> | I'm using the windows version of lcc |
16:36 | <@ToxicFrog> | ...lcc? |
16:36 | <@ToxicFrog> | Never heard of it. |
16:39 | | * Moltare goes looking for a windows version of gcc that doesn't involve installing and configuring cygwin or mingw |
16:39 | <@ToxicFrog> | ... |
16:40 | <@ToxicFrog> | The closest you're going to find to that is the mingw build of gcc. |
16:42 | <@ToxicFrog> | What do you have against mingw? |
16:43 | <@TheWatcher> | Moltare: Dev-cpp |
16:43 | <@ToxicFrog> | Dev-cpp is just a wrapper around the mingw stuff |
16:43 | <@TheWatcher> | (which actually has a version of mingw in it, but it's all wrapped up in a gu... quite) |
16:43 | <@ToxicFrog> | So if he wants to avoid mingw for some reason, that's not going to cut it |
16:44 | <@gnolam> | There's no configuration involved in MinGW. |
16:44 | <@ToxicFrog> | That too. |
16:44 | <@ToxicFrog> | It's "run installer, wait a few minutes" |
16:44 | <@ToxicFrog> | There's a bit of configuration involved in MSYS, but it's pretty much "answer a few yes/no questions" |
16:44 | <@gnolam> | Granted, they're complete morons and have thus gone from a decent 30 MB simple monolithic installer to a completely brain-dead downloading installer, but still. |
16:45 | <@gnolam> | It even sets PATH and MINGDIR for you, IIRC. |
16:47 | <@Moltare> | I'll take it, TW, it looks appropriately not-fierce |
16:47 | <@TheWatcher> | Moltare: I use it to teach my students. |
16:48 | <@gnolam> | The IDE itself is rather crap though. |
16:49 | <@gnolam> | -rather |
16:49 | <@ToxicFrog> | Moltare: it's a complete pain in the ass, but this is true of any IDE, so. |
16:49 | <@gnolam> | It sucks $barnyard_animal compared to Code::Blocks, Eclipse or MSVC. |
16:49 | <@Moltare> | If I can find where it put the new .o file I just had it make, I'll be content |
16:49 | <@ToxicFrog> | Isn't what you're after a .exe, not a .o? |
16:50 | <@ToxicFrog> | Seriously, for something this small, just use gcc |
16:50 | <@ToxicFrog> | It'll be way faster than figuring out how to bend the IDE to your will |
16:52 | <@ToxicFrog> | Or, since you have it already, figure out how to tell lcc to link |
16:54 | | gnolam is now known as gnolam|Ancient |
16:56 | | Vornotron [~vorn@Admin.Nightstar.Net] has joined #code |
16:58 | | Vornotron is now known as Vornicus |
17:19 | | You're now known as TheWatcher[afl] |
17:20 | | You're now known as TheWatcher[afk] |
17:21 | <@Moltare> | woot, it works |
17:22 | <@Moltare> | Thanks for the help, gents :) |
17:23 | < Vornicus> | Reiver: 32-bit unix systems, anyway |
17:23 | < Vornicus> | (from 6 hours ago, yes, I know, I missed the rest of the discussion) |
18:39 | | You're now known as TheWatcher |
19:07 | <@AnnoDomini> | Assembler question. I have the resulting flags of an "ADD AX,0" operation, and want to jump if AX is greater than 0. What jump instruction should I use? |
19:07 | <@AnnoDomini> | JA, JG or something else? |
19:07 | <@AnnoDomini> | This is x86. |
19:24 | | StarWind [StarWind@Nightstar-10921.dial-209-34.elcom.ru] has joined #code |
19:25 | | StarWind [StarWind@Nightstar-10921.dial-209-34.elcom.ru] has quit [Quit: ] |
19:37 | | Vornicus [~vorn@ServicesOp.Nightstar.Net] has quit [Ping Timeout] |
19:40 | | Vornicus [~vorn@Admin.Nightstar.Net] has joined #code |
19:40 | | mode/#code [+o Vornicus] by ChanServ |
19:53 | | AnnoDomini is now known as DarthAnno |
19:54 | | EvilDarkLord is now known as EvilDarkLuke |
20:03 | | EvilDarkLuke is now known as EvilDarkLord |
20:03 | | DarthAnno is now known as AnnoDomini |
21:14 | | Moltare [~moltare@Nightstar-29340.cable.ubr02.bath.blueyonder.co.uk] has quit [Ping Timeout] |
21:17 | | You're now known as TheWatcher[afk] |
21:21 | | Moltare [~moltare@Nightstar-29340.cable.ubr02.bath.blueyonder.co.uk] has joined #code |
21:35 | | gnolam|Ancient is now known as gnolam |
22:53 | | C_tiger [~c_wyz@Nightstar-16221.nycmny.east.verizon.net] has joined #code |
23:35 | <@McMartin> | Long after the fact |
23:36 | <@McMartin> | However: yacc and bison do not produce recursive-descent parsers |
23:36 | <@McMartin> | They produce shift-reduce parsers of the LALR(1) class. |
23:36 | < Moltare> | Could be why we're not to use it to make ours ¬¬ |
23:37 | <@McMartin> | Recursive descent is basically "one function for each nonterminal, and you parse that nonterminal by calling that function. You then have some other special function for eating terminals appropriately." |
23:37 | | GeekSoldier is now known as GeekSoldier|bed |
23:37 | <@McMartin> | Are you guys using the Dragon Book here? |
23:40 | < Moltare> | Um |
23:41 | < Moltare> | It's got a tiger on it |
23:41 | < Moltare> | No dragons involved |
23:42 | <@McMartin> | Ah, Appel. |
23:42 | <@McMartin> | (The Tiger Book!) |
23:42 | < Moltare> | That'd be the same tome, yes |
23:43 | <@McMartin> | Well, it's actually three, but I assume yours is the C edition. |
23:43 | | * McMartin has the Java edition in lab; it's roughly parallel, but takes a more OO approach, being Java. |
23:43 | <@McMartin> | IIRC the C version mimics ML closer than Java. |
23:44 | < Moltare> | We were told not to do it in Java because, quote, it takes twice as long and four times as much code |
23:44 | < Moltare> | How true this might be I am unable to comment, but I know the lecturer's a partisan Javahater. |
23:45 | <@McMartin> | I doubt the speed issue except on extremely small files. |
23:45 | <@McMartin> | Size will increase because the strategy commonly used involves a lot more boilerplate. |
23:46 | < Moltare> | No, twice as long sitting at the machine coding |
23:46 | <@McMartin> | The C approach involves reading out of memory, jumping to the address contained therein, and hoping to God that (a) there's code there, and (b) you, not a hostile user pwnz0ring ur b0xx0r, did it. |
23:47 | < Moltare> | Thankfully, I don't have to worry about the undercurrents |
23:47 | <@McMartin> | Given complete freedom of language for these things I'd pick OCaml, but~ |
23:47 | < Moltare> | Just do the lexer (mostly done yay), do the hash table, do the parser and write some gubbins. |
23:48 | <@McMartin> | Nod |
23:48 | <@McMartin> | (The hash table in Java would be zero lines, which may be why he's forbidding it~) |
23:51 | <@McMartin> | Unfortunately, I don't have my copy of the Tiger Book handy, but I can fix that on Monday easily enough. |
23:54 | | gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?] |
--- Log closed Sun Mar 09 00:00:04 2008 |