--- Log opened Wed Feb 07 00:00:07 2007 |
00:00 | | Jan[epiphany] [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: *Writes it all down* x3] |
00:31 | <@McMartin> | Cutting, not smashing. |
00:32 | <@McMartin> | Stack cutting is a trick that lets you do try-catch in, like, four instructions. |
00:33 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code |
00:33 | <@ToxicFrog> | Do tell. |
00:33 | <@ToxicFrog> | Although ISTR hearing about this before. |
00:34 | <@McMartin> | Basically, it requires both garbage collection and a universal caller-save convention for registers |
00:34 | <@McMartin> | But then entering a try block is a matter of pushing the location of the handler on the stack |
00:34 | <@McMartin> | And throwing an exception is a matter of reassigning the stack pointer and then doing a jump. |
00:35 | <@ToxicFrog> | Aha. |
00:35 | <@McMartin> | Doesn't work for C++, since C++ basically has an catch frame on every method that declares a variable |
00:35 | <@McMartin> | OCaml's x86 implementation does it, though. |
00:49 | | * ToxicFrog has a brilliant, demented idea that sadly doesn't actually work. |
00:49 | <@ToxicFrog> | If it did work, however, it would let an object change type in mid-function-call. |
00:50 | <@ToxicFrog> | Which is more useful than it sounds. |
00:53 | <@ToxicFrog> | Now...is it worth implementing a C callout of this? |
00:53 | <@ToxicFrog> | It would make Chunk much simpler. |
00:54 | <@ToxicFrog> | You create a Chunk object and tell it to load. When it determines (from looking at the loaded TOC entry) what type it needs to be, it metamorphoses. |
01:02 | <@Reiver> | ... |
01:02 | <@ToxicFrog> | Yes? |
01:03 | | * Reiver eyes. |
01:04 | <@ToxicFrog> | Yeeeeees? |
01:08 | | * ToxicFrog pokes Reiver |
01:08 | | * Reiver eyes TF. |
01:08 | <@ToxicFrog> | What's so odd about this? |
01:09 | <@Reiver> | You're dropping into C. |
01:09 | <@Reiver> | So you can then create something that mangles itself at will? |
01:10 | <@ToxicFrog> | Not mangles. |
01:10 | <@ToxicFrog> | Transforms. |
01:11 | <@Reiver> | Extruding sideways through a colander, sans lube! |
01:12 | <@Reiver> | Same diff. ¬¬ |
01:12 | <@McMartin> | C is the VM in which the Lua code runs. |
01:12 | <@McMartin> | So it's not really mangling. |
01:12 | <@McMartin> | Mangling is writing C++ code where objects reassign their own vtables. |
01:12 | <@McMartin> | (Yes, I've seen this done. No, I wasn't allowed to kill the instructor.) |
01:13 | <@Reiver> | Hm. |
01:13 | <@Reiver> | That makes it a bit more OK, then. Carry on~ |
01:13 | <@Reiver> | (Rassign their own vtables? How, uh... how would that work?) |
01:14 | < MyCatVerbs> | Reiver: (pretty similarly to self-rewriting assembly code, in style ^^) |
01:14 | <@McMartin> | (Unsafe cast to of objects to byte array) |
01:14 | <@McMartin> | (Rewrite the appropriate bit) |
01:14 | <@Reiver> | (I... see. That's... Why is the writer still alive?) |
01:14 | <@McMartin> | MCV: Actually, rather like self-rewriting code, when done right you can encapsulate it entirely and treat it as a Really Bad Way of Just Doing Inheritance. |
01:15 | | * McMartin cyclecounted on the 6502. Indirect jumps are typically faster than self-modifying code. |
01:15 | <@McMartin> | Reiver: Because he was the instructor in the class in question, and I needed the credits. |
01:15 | <@McMartin> | I later justified the class to my advisor as a course in Alien Programming Methodology. |
01:15 | <@Reiver> | McM: You've graduated this class though, right? |
01:16 | <@McMartin> | Long since. |
01:16 | <@Reiver> | So I repeat, with rephrased emphasis. Why is this instructor still alive? |
01:16 | <@Reiver> | :p |
01:16 | <@Reiver> | And/or, was the whole course like this? |
01:17 | < MyCatVerbs> | Reiver: because breathing is a reflex action and requires no frontal lobe capacity. |
01:17 | <@Reiver> | Or was this just one of his Little Quirks? |
01:17 | <@McMartin> | Yes, the whole course was like that. |
01:17 | <@McMartin> | His relationship with Java is much like Ted Haggard's relationship to homosexuality. |
01:17 | <@Reiver> | ...Was there a sound reason for the rest of the course, or? |
01:17 | <@Reiver> | Was this "Funky Tricks You Can Pull But Probably Shouldn't"? |
01:17 | <@McMartin> | As such, the class is Useful for beating people with the stick of Just Use Java, You Idiots, although this was not his intent. |
01:18 | <@McMartin> | No, it was "How to write large-scale C++ code", and boiled down to "I hate Java, so I will reimplement it poorly." |
01:18 | < MyCatVerbs> | Heheheh. |
01:18 | <@Reiver> | ... Aha. |
01:18 | < MyCatVerbs> | "Those who do not understand Unix are doomed to reimplement it, poorly." |
01:18 | < MyCatVerbs> | Congratulations ladies and gentlemen, THE PRINCIPLE HAS BEEN EXTENDED! Wohooo! |
01:19 | <@McMartin> | (He spent a week on why garbage collection is Teh Suxx0rz lol, and then three weeks on smart pointers) |
01:19 | <@McMartin> | (Which are, um, reference-counted garbage collection) |
01:19 | <@Reiver> | ... |
01:19 | < MyCatVerbs> | McMartin: you missed a detail. |
01:19 | <@McMartin> | (Which doesn't even fucking work, to say nothing of the fact that in C++ it means that returning from a function can take unbounded amounts of computation time) |
01:19 | < MyCatVerbs> | Specifically, you failed to point out that they'll totally fail in the case of circular structures. ^^ |
01:20 | <@McMartin> | Please see parenthetical comment~ |
01:20 | <@Reiver> | |
01:20 | <@Reiver> | I... |
01:20 | <@McMartin> | Also, not quite true. There are some extremely sneaky techniques you can use to get away with it most of the time. |
01:20 | <@McMartin> | But you still need a sweep technique to clean up the rest. |
01:20 | <@Reiver> | Am both horrified at the concept and would like to know more as to exactly how it was meant to work, and how it failed. |
01:20 | <@McMartin> | It is true that every form of garbage collection has a fatal flaw of some kind. |
01:21 | <@Reiver> | Sort of like a train wreck thing. |
01:21 | <@McMartin> | Happily, the new Dragon Book actually covers this stuff, and the two techniques that people Actually Use. |
01:21 | <@ToxicFrog> | Reiver, McMartin: what this would actually do is reassign the lua_Table that lurks behind the one-byte userdata object that Lua sees. |
01:21 | <@ToxicFrog> | Optionally carrying over certain table entries. |
01:21 | <@ToxicFrog> | (well, allocate a new object, then reassign tables) |
01:21 | <@McMartin> | Reiver: The "returning can take arbitrary computation" thing is a fundamental issue with C++ |
01:21 | < MyCatVerbs> | McMartin: iono, I've read a pretty good one for LISP which ran with O(1) memory consumption, at the overhead of two marker bits for each cons. |
01:22 | <@McMartin> | Which is to say, anything stack-allocated must call destructors |
01:22 | <@McMartin> | MCV: That's mark-and-sweep, and its "fatal flaw" is that you have to scan the whole heap. |
01:22 | <@McMartin> | Which isn't that fatal |
01:22 | < MyCatVerbs> | Hey, that's only fatal in real-time apps. =) |
01:22 | <@McMartin> | Especially if you only do it to back up reference-counting. |
01:23 | <@McMartin> | (Which is how Python, Lua, and I think Perl do it) |
01:23 | <@McMartin> | If you reference-count, the reachable heap is likely to remain fairly small. |
01:23 | < MyCatVerbs> | McMartin: well, you *can* put any old code in C++ destructors, but unless you're a jerk you're only *supposed* to put myriad delete and free() calls and the like in there... |
01:23 | <@McMartin> | MCV: Yes. The trick there is really recursive data structures. |
01:23 | <@McMartin> | You delete List, which deletes 20 Nodes, each of which deletes 20 Subnodes, etc. etc. |
01:24 | < MyCatVerbs> | It's like saying that pointers suck because you can do {int*p=0;*p=1;} where actually the problem is that you need to beat the shit out of anyone who ever writes that. |
01:24 | <@McMartin> | Pure Reference Count has a similar problem, viz, "must clean everything up immediately" |
01:25 | <@McMartin> | Which is why Java (which uses a very complicated technique called "generational collection") beats python in poorly-thought-out object creation tests by about a factor of 2. |
01:25 | <@McMartin> | Because Python is destroying them all, and Java Doesn't Care until it actually eats up lots of its available memory. |
01:26 | | * McMartin believes you have to get 8 MB allocated by default before GC will trigger in Java, but he's not sure. |
01:26 | < MyCatVerbs> | jerith: growisofs, incidentally, wins. |
01:26 | <@McMartin> | Otherwise, it'll just let process termination free all the memory. |
01:26 | <@McMartin> | As for how Generational and Train algorithms work, I'll just kind of gesture vaguely at the new Dragon Book. |
01:27 | < MyCatVerbs> | Probably a good rule of thumb, but don't most Java programs tend to live for several hours at a time anyway? |
01:27 | <@McMartin> | Yeah, and those that do actually run the GC. |
01:27 | <@McMartin> | Generational and Train both have the nice property that you can also do them a bit at a time. |
01:27 | <@McMartin> | Mark-and-sweep and Stop-and-copy require that you, well, stop. |
01:28 | <@McMartin> | Generational can usually be interrupted without messing up the heap or leaking memory. |
01:28 | <@ToxicFrog> | Stop-and-copy? |
01:28 | <@ToxicFrog> | Copy everything reachable from the root, delete the old version of the heap, move the copy into its place? |
01:28 | <@McMartin> | (And also starts mostly ignoring objects once they've survived a few collections, on the grounds that their lifetime is probably The Whole Program, so we'll check them only if we get *really* strapped for space.) |
01:28 | <@McMartin> | TF: Quite so. |
01:28 | <@McMartin> | Also compacts memory neatly. |
01:29 | <@McMartin> | However, you only get to use half your address space. |
01:29 | <@McMartin> | Also, you don't really have to move the copy into place. |
01:29 | <@ToxicFrog> | Well, or something with the same effect such as updating all references etc. |
01:29 | <@McMartin> | You just divide the address space in half, update your handles as needed. |
01:29 | <@McMartin> | Yeah. |
01:29 | <@McMartin> | GC + Pointer Arithmetic does not mix. |
01:31 | < MyCatVerbs> | I thought half the point of GC'd languages is that they give you the ability to slap the bejeezus anyone who messes up their pointer arithmetic? |
01:31 | < MyCatVerbs> | *bejeezus out of |
01:31 | | MyCatVerbs is now known as MyCatSleeps |
01:32 | < MyCatSleeps> | Have fun, all. |
01:33 | <@McMartin> | Most GC techniques (refcounting and mark-and-sweep excepted) will move objects around under the hood. |
01:33 | <@McMartin> | So Raw Pointers of any kind are a no-no. |
01:34 | <@McMartin> | (That's actually the other "fatal flaw" with M&S - by the time you actually clean out the whole heap, the stuff that's left is scattered all over the place and your cache begins to thrash liek whoa) |
01:34 | < MyCatSleeps> | McMartin: I suppose this is an advantage of machines with GC designed into the hardware architecture? That they can abuse their MMUs to get the crap done efficiently? |
01:35 | <@McMartin> | It's been too long since I've had to deal with that stuff. |
01:35 | <@McMartin> | I think tag bits are usually used to make the mark phase go faster, though. |
01:36 | <@McMartin> | But if every integer you want has somehow ended up on a different page, I don't think there's a lot the MMU can do. |
01:37 | < MyCatSleeps> | McMartin: you could make partial runs of stop-and-copy to shunt long-lived stuff into close-by pages? |
01:42 | | * Reiver reads the one line of /me in the backscroll |
01:42 | <@Reiver> | McM: I believe it's JVM specific, isn't it? |
01:42 | <@Reiver> | Like thread handling. |
01:42 | <@Reiver> | (Guidelines, not rules.) |
01:46 | <@McMartin> | MyCatSleeps: That's basically what "generational" is. |
01:46 | <@McMartin> | Reiver: kinda, though the basic theme is still the same. |
01:47 | <@McMartin> | I mean, yes, every runtime with a GC needs a few tweaks to make it actually, like, work |
01:47 | <@Reiver> | Ah, but it's got a more consistent ruleset? |
01:48 | | * Reiver had been told "Don't rely on the garbage collecter ever running or not running, because every JVM will have different rules as to when to do it" |
01:48 | <@Reiver> | Same with thread handling, file path writing, etc |
01:48 | <@ToxicFrog> | Reiver: well, some VNs give you a degree of control over the GC. |
01:57 | <@Reiver> | TF: Well, you can manually call it |
01:57 | <@Reiver> | But I thought that was it? |
01:58 | | Thaqui [~Thaqui@Nightstar-26359.jetstream.xtra.co.nz] has quit [Quit: Leaving] |
02:02 | <@ToxicFrog> | Reiver: http://www.lua.org/manual/5.1/manual.html#5.1 |
02:03 | <@Reiver> | I meant Java. |
02:03 | <@Reiver> | -.^ |
02:06 | <@ToxicFrog> | Aah. |
02:06 | <@McMartin> | You can, but (a) you shouldn't, and (b) I don't think it guarantees it. |
02:06 | <@McMartin> | (You shouldn't because it counts "long-lived" as "number of collections an object survived", so you may be shoving stuff into the "let it rot" area faster) |
02:08 | <@Reiver> | ..."Long-lived"? |
02:08 | | * Reiver did not hear of thing thingy. |
02:08 | <@Reiver> | (Granted, it was a Crash Course In Java so, but) |
02:09 | <@McMartin> | The JVM uses a garbage collector that pays more attention to newer objects, because the longer an object has been around, the more likely it is that it will continue to survive. |
02:09 | <@McMartin> | In particular, most objects created at Program Start will last the Entire Length of the Program and never need collection at all. |
02:10 | <@Reiver> | Right |
02:12 | <@McMartin> | I don't belive the JVM spec demands a specific garbage collection algorithm, but the one that Sun's JVM actually uses does this. |
02:12 | <@McMartin> | And it ignores "long-lived" objects until it's basically otherwise Completely Run Out Of Memory |
02:13 | | * Reiver nod. |
02:13 | <@Reiver> | So running the collector when not needed a lot will mean it gets increasingly less efficient each time it runs? |
02:14 | <@McMartin> | Basically. |
02:14 | <@McMartin> | It doesn't scan all of memory each time anyway, so most applications will run it roughly every 100ms without incident. |
02:15 | <@Reiver> | This was done with the origional intent of making the collector faster when it runs, yes? |
02:15 | <@Reiver> | Skipthat, skipthat, eyethat, skipthat? |
02:16 | <@McMartin> | Right. |
02:16 | <@McMartin> | Also to let you maintain locality of reference even if it wasn't there to begin with, and to prevent having to scan all of memory at once, which is Unhealthy, and to delay cleanup until you actually need the space. |
02:17 | | * Reiver nod. |
02:17 | <@Reiver> | The GC runs every 100ms or so by standard? |
02:18 | <@McMartin> | Well, the last time I actually did profiling, it was on Eclipse. |
02:18 | <@McMartin> | And it seems to have run roughly that often. |
02:18 | | * Reiver nod. |
02:18 | <@Reiver> | I hadn't realised it was that often - I'd actually assumed it was an 'occasional' thing. |
02:19 | <@Reiver> | Then again, we'd had it implied that it was a 'when you start to run out of memory' thing as opposed to actually regular, so |
02:19 | <@McMartin> | On the other hand, this is Eclipse. >_> |
02:19 | <@McMartin> | Eclipse probably does start to run out of memory before startup completes. |
02:19 | <@McMartin> | The "Construct 1000 Objects and quit" doesn't. |
02:21 | <@McMartin> | ... but also probably doesn't take the 200 million instructions 100 ms would be. |
02:21 | <@Reiver> | Truth. |
02:21 | | * Reiver nods. |
02:41 | | Serah-Lost [~-@87.72.36.ns-26407] has quit [Ping Timeout] |
02:42 | | Serah-Lost [~-@87.72.36.ns-26407] has joined #Code |
03:05 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: Jouets de Dieu, jouets de jouets, les jouets de me, na?tre Clair enfant voire.] |
03:17 | | Vornicus-Latens is now known as Vornicus |
03:18 | | Vornicus is now known as NSGuest-306 |
03:18 | | NSGuest-306 is now known as Vornicus |
03:59 | | Takyoji [~Takyoji@Nightstar-25280.dhcp.roch.mn.charter.com] has joined #code |
03:59 | < Takyoji> | Anyone know PCRE? |
04:00 | <@ToxicFrog> | http://www.greenend.org.uk/rjk/2002/06/regexp.html |
04:00 | <@ToxicFrog> | Unless you mean "the API", in which case, sorry, no idea, read the man pages. |
04:02 | < Takyoji> | Because I'm trying to figure out how to grab something in a string with a "q=" before it and "&" after it |
04:02 | < Takyoji> | But don't know how to |
04:02 | < Takyoji> | in PHP |
04:04 | <@ToxicFrog> | Well. Generally, it' |
04:04 | <@ToxicFrog> | s /q=([^&]*)&/ |
04:04 | <@ToxicFrog> | And the captured string will be the first backreference. |
04:04 | <@ToxicFrog> | I take it what you're after here is QUERY_STRING parsing? |
04:04 | <@ToxicFrog> | I thought PHP did that automatically? |
04:06 | < Takyoji> | I'm basically trying to extract the value of a given string of GET data in a URL |
04:06 | <@ToxicFrog> | PHP should have a function for that somewhere. |
04:06 | <@ToxicFrog> | I have a function that will do this, but it's in Lua: |
04:07 | <@ToxicFrog> | for key,value in string.gmatch(QUERY_STRING, "([^=]+)=([^&]*)&?") do |
04:07 | <@ToxicFrog> | args[key] = value |
04:08 | <@ToxicFrog> | end |
04:08 | <@ToxicFrog> | And after that, args.q would be what you're looking for. |
04:08 | <@ToxicFrog> | But since you're working in PHP that doesn't really help you. |
04:08 | < Takyoji> | yea |
04:09 | <@ToxicFrog> | Anyways. The regex you want is q=([^&]*)& |
04:10 | <@ToxicFrog> | And then you use whatever your local regex API is to execute that and get the first capture/backreference out of it. |
04:12 | < Takyoji> | k |
04:12 | <@ToxicFrog> | (you are aware, I hope, that if this is the last entry in the QUERY_STRING it won't have an & on the back) |
04:13 | <@ToxicFrog> | You know, much as I flail at Perl, it does have some useful stuff. |
04:13 | <@ToxicFrog> | Like the nongreedy versions of ? * + |
04:14 | <@McMartin> | ?? |
04:14 | | * Vornicus tries to remember the regex he saw that used ?? |
04:14 | <@ToxicFrog> | ?? is nongreedy ?, yes |
04:15 | <@ToxicFrog> | And +? and *? |
04:15 | <@ToxicFrog> | And there is, as far as I can tell, no way to mimic them with the primitives given by POSIX EREs |
04:15 | <@ToxicFrog> | Although proving this formally is beyond me. |
04:20 | | MahalWORK is now known as Mahal |
04:24 | < Takyoji> | Night folks |
04:24 | | Takyoji [~Takyoji@Nightstar-25280.dhcp.roch.mn.charter.com] has quit [Quit: Leaving] |
04:34 | <@McMartin> | TF: Hmm. There's no way to do it easily. |
04:34 | <@McMartin> | I'd have to wield a fair amount of Finite Automaton Fu to see if it's doable in general. |
04:35 | <@McMartin> | But I think you could do either with NFAs, which means there'd be some way to phrase it as a standard (highly unwieldy!) regexp. |
04:35 | <@ToxicFrog> | Hmm. Presumably PCREs are DFAs once they're actually compiled. |
04:35 | <@ToxicFrog> | On the other hand, this is Perl. |
04:35 | <@ToxicFrog> | They could just as easily be runes of the elder gods. |
04:35 | <@McMartin> | Backreferences make PREs non-regular. |
04:36 | <@McMartin> | Also, upon further thought, non-greediness may violate the way standard NFAs work. |
04:36 | <@ToxicFrog> | Hmm, true. |
04:36 | <@McMartin> | In which case they may too be non-regular. |
04:36 | <@McMartin> | So I revise my statement. |
04:36 | <@ToxicFrog> | ...irregular expressions. |
04:36 | <@McMartin> | "I would have to do lots of automaton work to prove this one way or the other." |
04:36 | <@McMartin> | However |
04:36 | <@McMartin> | If it isn't regular, it's not context-free either, and kicks you directly up to "Turing-decidable". |
04:38 | | * McMartin blinks again |
04:38 | <@McMartin> | No, that's not true either. |
04:38 | | * McMartin is totally out of it. |
04:38 | <@McMartin> | Greedy vs. non has nothing to do to the language class. |
04:38 | <@McMartin> | It has to do with the order you search the possibilities in. |
04:38 | <@McMartin> | viz, the question "does this string match this pattern?" is the same for both greedy and non. |
04:38 | <@ToxicFrog> | ...and, actually. |
04:39 | <@ToxicFrog> | How *do* backreferences make PEREs nonregular? |
04:39 | <@McMartin> | You can match this language with them: |
04:39 | <@McMartin> | a^mba^m |
04:40 | <@ToxicFrog> | Which is turing-decidable but not regular. |
04:40 | <@McMartin> | Which is not regular, and is, in fact, one of the classic CFG ones. |
04:40 | <@ToxicFrog> | However, I think we have different definitions for backreferences. |
04:40 | <@McMartin> | By "backreferences" I mean where the pattern uses \1 or \2. |
04:40 | <@ToxicFrog> | I refer to what Lua calls "captures" - you can snare parts of the matched string for later examination. |
04:40 | <@McMartin> | Yeah. |
04:40 | <@McMartin> | Perl lets you put captures previously made during the match into the pattern itself. |
04:40 | <@ToxicFrog> | This *doesn't* necessarily mean you can use them in the pattern. |
04:40 | <@ToxicFrog> | Aah. |
04:41 | <@McMartin> | Captures are a side issue. |
04:41 | <@McMartin> | And, indeed, my brand-new intuition is that greedy vs. non-greedy doesn't change the answer to "does this string match?" but instead changes the content of the captures. |
04:41 | <@ToxicFrog> | Hmm. Lua also lets you put them into the pattern. |
04:41 | <@ToxicFrog> | Freaky. |
04:41 | <@ToxicFrog> | Useful, but freaky. |
04:41 | <@McMartin> | (Also, you can match a^mba^mca^m, which is not only nonregular but non-context-free.) |
04:42 | <@ToxicFrog> | (but still turing-decidable, unless I'm tired enough that my wetware turing machine is starting to malfunction) |
04:42 | <@McMartin> | (Correct) |
04:43 | <@McMartin> | (Actually, also easily doable with flex, if you're clever about coding the actions) |
04:43 | <@ToxicFrog> | (flex is made of spiders ;.;) |
04:45 | <@ToxicFrog> | (well, actually, no, flex is ok, yacc is made of spiders) |
07:35 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout] |
07:35 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
07:35 | | mode/#code [+o Chalcedon] by ChanServ |
08:18 | | gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code |
08:35 | | Mahal is now known as MahalBEDD |
08:42 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: ] |
09:18 | | Serah-Lost [~-@87.72.36.ns-26407] has quit [Ping Timeout] |
09:21 | | Serah-Lost [~-@87.72.36.ns-26407] has joined #Code |
09:41 | | Reiver is now known as ReivZzz |
09:57 | | You're now known as TheWatcher[wr0k] |
10:58 | | timelady [~romana@Nightstar-14449.lns7.adl2.internode.on.net] has joined #Code |
11:24 | | gnolam is now known as mechagnolam |
11:35 | | timelady [~romana@Nightstar-14449.lns7.adl2.internode.on.net] has quit [Quit: run away! run away!] |
13:07 | | MyCatVerbs [~rb6822@Nightstar-23667.cs.bris.ac.uk] has joined #code |
13:08 | < MyCatVerbs> | Help! I'm involuntarily leaning emacs' keys! |
13:31 | | MyCatVerbs [~rb6822@Nightstar-23667.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!] |
14:04 | | MyCatVerbs [~rb6822@Nightstar-23335.cs.bris.ac.uk] has joined #code |
14:27 | < MyCatVerbs> | Dear RedHat devs: please choke and die. |
14:27 | | * MyCatVerbs hatehatehateHATEHATEHAEEET! distros which strip the man pages out of their packages. |
14:44 | | MyCatVerbs [~rb6822@Nightstar-23335.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!] |
15:05 | | You're now known as TheWatcher[afk] |
15:15 | | MyCatVerbs [~rb6822@Nightstar-18478.cs.bris.ac.uk] has joined #code |
15:27 | | You're now known as TheWatcher |
15:47 | < MyCatVerbs> | Pondering. mIRC's built-in scripting kludge/language. Is it just me or does it really strongly resemble both FORTRAN and BASIC? |
15:48 | < UndeadAnno> | BASIC, yes, I think. |
15:48 | < UndeadAnno> | I haven't been coding in BASIC for a long, long time. |
15:48 | <@ToxicFrog> | There's a bit of perl mixed in there too, I think, except without perl's usefulness. |
15:49 | < UndeadAnno> | I like the fact that all variables are of the same type. ;) |
15:49 | < MyCatVerbs> | Strings! They're all mutable, fruitable, variable-length strings! |
15:49 | < EvilDarkLord> | Fruitable? |
15:50 | < MyCatVerbs> | EvilDarkLord: delicious. From the perspective of a C programmer sitting in char* hell, *anything*'s good. =) |
15:50 | < UndeadAnno> | Heh. |
15:50 | < EvilDarkLord> | I dread the prospect of starting to code in C++. Is this a reasonable feeling? |
15:51 | < MyCatVerbs> | EvilDarkLord: if you're very used to C, C++ might mindfuck you once or twice but it won't injure your ability to get stuff to work. |
15:53 | < EvilDarkLord> | I am not used to anything worse than Java. |
15:53 | < MyCatVerbs> | You will, however, miss out on the largest part of the benefits from going to C++ unless you put in some serious study on it and the idioms required to make it just as fast as C. |
15:53 | <@ToxicFrog> | EvilDarkLord: C++ is much easy to work in than Java, IME, but also lacks its safety mechanisms. |
15:54 | <@ToxicFrog> | Also - as McMartin will gladly tell you - the spec tends to mutate in ways that break existing code. |
15:54 | < EvilDarkLord> | Ow. |
15:55 | < MyCatVerbs> | ...easier? Java does all the memory management for you and that tends to take up 20-30% of the work. oO |
15:55 | | * EvilDarkLord rather liked Python at first glance. It's so easy to get started. |
15:55 | <@ToxicFrog> | Oh, and the Standard Template Library is a crawling abomination from the depths of hell itself. |
15:55 | <@ToxicFrog> | MCV: well, maybe not quite the right word. |
15:56 | < MyCatVerbs> | ToxicFrog: I did notice that the Boost project had to resort to peer review in order to get C++ code that actually works really well. =) |
15:56 | <@ToxicFrog> | Peer review is a good idea no matter what language you're working in. |
15:57 | <@ToxicFrog> | I submit as evidence the XPOD system in CacheOS, which was written in Java, not peer reviewed, and is easily the worst piece of code in the entire OS. |
15:57 | <@ToxicFrog> | Which, I note, is written primarily in a mix of C, C++ and assembler. |
15:57 | < MyCatVerbs> | ToxicFrog: true, most libre software benefits from it pretty much by default. But *excellent* C++ code is sufficiently hard enough to craft that Boost had to make it part of their core processes rather than implicit. |
16:00 | <@ToxicFrog> | Anyways. EvilDarkLord, unless you have a compelling reason to use C++ (drivers, kernel, high-performance physics or graphics engine, course requirements, etc), given that your only prior experience is Java, I would recommend trying out a high-level language for a while for a change of pace. |
16:00 | <@ToxicFrog> | It's good for the soul. |
16:00 | <@ToxicFrog> | Scheme, or Lua, or Python, say. |
16:00 | < MyCatVerbs> | Common LISP! It's so delicious! |
16:00 | | * ToxicFrog smacks MCV |
16:00 | < MyCatVerbs> | Hehehe. |
16:00 | <@ToxicFrog> | Common LISP is what Perl would be if Perl were a LISP variant. |
16:01 | < MyCatVerbs> | ToxicFrog: I've been reading an introductory text on it and so far I'm getting the impression that, while being expressive enough to be able to type one's thoughts out more or less vertabim, it's still ugly enough to get shit done. ^^ |
16:01 | <@ToxicFrog> | EvilDarkLord: actually, you've probably been linked to this before, but http://mitpress.mit.edu/sicp/full-text/book/book.html |
16:02 | <@ToxicFrog> | MyCatVerbs: I'm sorry, type warts on variables are ass. |
16:02 | < MyCatVerbs> | Though I think the whole seperate namespacing for functions and variables is total chickenshit whackdjoo. |
16:02 | <@ToxicFrog> | And now, midterms! Back in 5-6 hours. |
16:02 | < MyCatVerbs> | Good luck. |
16:02 | < MyCatVerbs> | Suspect you won't need it. Have fun and I hope the invigilators don't all have halitosis! |
16:03 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code |
16:03 | < Vornicus> | Type warts suck. |
16:03 | < Vornicus> | Scope warts are okay though. |
16:04 | < MyCatVerbs> | Scope warts? Where do you see those? |
16:04 | < Vornicus> | Ruby has them. |
16:04 | < Vornicus> | local @instance @@class $global |
16:04 | < MyCatVerbs> | Ahhh. I was thinking of C++'s :: operator and getting confuzz'd. |
16:05 | < Janus> | Oh, those type of warts. |
16:06 | < MyCatVerbs> | Janus: yeah, CLISP has things like #'(thingummy) all over the place when you want to pass functions around. |
16:06 | | * EvilDarkLord grin. Tried Scheme for some time, enough to get through some three sections of SICP. |
16:08 | < MyCatVerbs> | Personally, I think I'ma read "Learn Scheme in fixnum days," before finishing SICP. |
16:32 | | mechagnolam is now known as gnolam |
17:23 | | MyCatVerbs [~rb6822@Nightstar-18478.cs.bris.ac.uk] has quit [Quit: We are building a religion, we are building it bigger. We are widening the corridors and adding more floors.] |
17:33 | | UndeadAnno [~farkoff@Nightstar-29113.neoplus.adsl.tpnet.pl] has quit [Ping Timeout] |
17:41 | | EvilDarkLord [althalas@Nightstar-15301.a88-115-211-62.elisa-laajakaista.fi] has quit [Ping Timeout] |
17:42 | | UndeadAnno [~farkoff@Nightstar-29151.neoplus.adsl.tpnet.pl] has joined #Code |
17:43 | <@jerith> | MyCatSleeps: Yes, growisofs wins. :-) |
17:48 | | EvilDarkLord [althalas@Nightstar-15301.a88-115-211-62.elisa-laajakaista.fi] has joined #code |
17:51 | | UndeadAnno is now known as AnnoDomini |
17:51 | | AnnoDomini is now known as UndeadAnno |
18:00 | | MahalBEDD is now known as Mahal |
18:15 | | Vornicus is now known as Vornicus-Latens |
18:26 | | MyCatSleeps is now known as MyCatVerbs |
18:31 | < Janus> | Mmm... may I ask a small question? Which would be faster, "ducky = duck_ary[n];" ... or "ducky = duck_stack->duck" ? |
18:32 | | * Janus has canard on the mind. |
18:32 | < MyCatVerbs> | Janus: array access is really really fast, unless you have to do bounds checking. |
18:32 | < MyCatVerbs> | Otherwise it's merely blazingly fast. |
18:34 | < Janus> | I know. It's just that it's one of those '50 times every frame' type of things. And, I've been wondering about it for awhile. |
18:34 | < gnolam> | 50 times ever frame is not enough to matter. |
18:34 | < gnolam> | Come back when it's 50/000/. |
18:35 | < gnolam> | And hmm... shouldn't it be the same speed in this case? base address + offset? |
18:35 | < Janus> | They'd be the same speed then? |
18:36 | < Janus> | Alright, thanks for the enlightenment then~ |
18:36 | <@jerith> | The second requires a pointer dereference as well as a lookup, I think. |
18:36 | <@jerith> | Then again, it's been so long since I last worked with a C-like language... |
18:37 | <@jerith> | What kind of thing is duck_stack? |
18:37 | < Janus> | It can go either way, so I'll stick with the array. |
18:38 | < Janus> | duck_stack is a linked list object. (ergo, one member being the data, another being a pointer, ect.) |
18:39 | <@jerith> | Are you walking it in sequence? |
18:39 | <@jerith> | Even so, the array's almost certainly faster. |
18:39 | <@jerith> | Also, ++n beats n++. |
18:40 | <@jerith> | (The latter has to keep a bunch of state around for the postincrement.) |
18:41 | < Janus> | (All my for loops have ++n, so looks like I lucked out there.) |
18:42 | <@jerith> | I learned that little gem the other day while two coworkers were discussing C++. |
18:42 | < Raif> | Actually, in an optimized program and for primitive types, pre decrement is equivalent to post. |
18:42 | < Raif> | There's no performance differenc. |
18:42 | < Raif> | For non-trivial types, however (iterators, for instance), there is. |
18:43 | < gnolam> | jerith: Hasn't compilers been optimizing that away in loops for the last 10-15 years? |
18:43 | | * gnolam checks GCC. |
18:43 | < gnolam> | Yup, same output. |
18:43 | < Raif> | As I said. :) |
18:44 | < gnolam> | Eh, had to go AFW mid-sentence. :) |
18:48 | < Raif> | oh, also, for the record Janus: Optimized, 40,000 array accesses in an indexed list (which involves bounds checking, array access and two dereferences) comes out to about a hundredth of a second, if I remember some perf readings. |
18:49 | < Raif> | It might have been a thousandth. |
18:50 | < Raif> | Either way, 50 will never make a difference. :) |
18:50 | | * jerith grins. |
18:50 | <@jerith> | The compiler's not always smart enough to know the difference. |
18:50 | <@jerith> | Especially if you're using a crap compiler... |
18:51 | < Janus> | That's a lot of room for error for my part, which there can never be enough of~ |
18:51 | < Raif> | Solution: Don't use a crap compiler. :) |
18:51 | <@jerith> | Indeed. |
18:51 | < Raif> | VS2k5 pro can be had for $120 bucks if you know a microsoft employee, and free if you're a student. |
18:52 | < Raif> | GCC has always been free. |
18:52 | <@jerith> | Also, Knuth's Law. |
18:52 | < Janus> | VS2k5's C++ version was free. Though, lord if I know how to deploy anything with it. |
19:01 | < Raif> | No, only get the student version. |
19:01 | < Raif> | The express one has no optimizing compiler. |
19:06 | < Janus> | I thought Express meant Good... |
19:07 | <@jerith> | Ah, that's why I have such awful memories of it. |
19:07 | <@jerith> | I once tried to compile something that required VC++. |
19:10 | | * MyCatVerbs has, like, the whole bloody collection now, but hasn't actually installed any of it.. |
19:17 | | * Janus meanders off to find said biscuits. |
19:19 | <@jerith> | Bikkies! |
19:19 | | * jerith steals. |
20:04 | < Janus> | Yay, another question~ |
20:06 | < Janus> | Suppose one of the ducks breaks/evolves/ignites, and it's entry in the 'duck_stack' needs to be ejected... |
20:07 | < MyCatVerbs> | Hmmmm. Learning to use a REPL loop as a shell... |
20:08 | | * Janus epiphanied |
20:12 | < Janus> | ... if a linked list has a pointer to an object, and that object destroys itself, what happens to the pointer? |
20:13 | < MyCatVerbs> | Janus: you're in C++ or C, right? The answer is nothing. |
20:13 | < Janus> | So, it'll just point to a random spit of RAM from then on? |
20:13 | < Janus> | *same |
20:14 | < MyCatVerbs> | Janus: you can still attempt to access that pointer and on some operating systems it might even work once or twice if the wind is blowing in the right direction. |
20:15 | < Janus> | Then... I guess it'll still have to physically go through the list then. |
20:15 | < MyCatVerbs> | But yeah, it's bad mojo. |
20:15 | < MyCatVerbs> | One common practice is to always set free'd pointers to zero. |
20:16 | <@jerith> | 22:01 < mithrandi> "We use the designer to create our dialogs. You can setup Visual Studio to generate IronPython, but having it create C# makes us less tempted to edit the generated code." |
20:17 | <@jerith> | And now it is bedtime. |
20:17 | <@jerith> | G'night all. |
20:17 | < EvilDarkLord> | G'ni. |
20:17 | < Janus> | Night-nite Sir jerith. |
20:18 | < MyCatVerbs> | Nini. |
20:20 | < MyCatVerbs> | Hehee. Should hack an extra special form into all open source Scheme interpreters - (meaning-of-life? x) would return #t if x==42 or #f otherwise. |
21:31 | | MyCatVerbs is now known as MyCatEats |
21:34 | | MyCatEats [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has quit [Ping Timeout] |
21:34 | | MyCatEats [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has joined #code |
22:10 | | You're now known as TheWatcher[T-2] |
22:15 | | You're now known as TheWatcher[zZzZ] |
22:26 | | ReivZzz is now known as Reiver |
22:34 | | BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has joined #Code |
22:38 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
22:38 | | mode/#code [+o Chalcedon] by ChanServ |
23:08 | | BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has quit [Quit: ] |
23:25 | | Netsplit DeepThought.NY.US.Nightstar.Net <-> Troika.TX.US.Nightstar.Net quits: @Pi, Raif, UndeadAnno, @jerith, @Mahal, @Reiver, MyCatEats, @Chalain |
23:27 | | Chalain [~chalain@Admin.Nightstar.Net] has joined #Code |
23:27 | | ServerMode/#Code [+o Chalain] by Troika.TX.US.Nightstar.Net |
23:27 | | mode/#code [+o Chalain] by ChanServ |
23:27 | | Reiver [~reaverta@IRCop.Nightstar.Net] has joined #Code |
23:27 | | mode/#code [+o Reiver] by ChanServ |
23:27 | | Raif [~corvusign@Nightstar-22484.hsd1.ca.comcast.net] has joined #Code |
23:28 | | mode/#code [+o Raif] by ChanServ |
23:28 | | Mahal [~Mahal@Nightstar-4998.worldnet.co.nz] has joined #Code |
23:28 | | mode/#code [+o Mahal] by ChanServ |
23:28 | | jerith [~jerith@IRCop.Nightstar.Net] has joined #code |
23:28 | | mode/#code [+o jerith] by ChanServ |
23:28 | | MyCatEats [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has joined #code |
23:31 | | UndeadAnno [~farkoff@Nightstar-29151.neoplus.adsl.tpnet.pl] has joined #Code |
23:40 | | Netsplit DeepThought.NY.US.Nightstar.Net <-> Troika.TX.US.Nightstar.Net quits: @Raif, UndeadAnno, @jerith, @Mahal, @Chalain |
23:42 | | mode/#code [+o Chalain] by ChanServ |
23:42 | | Netsplit over, joins: @Chalain |
23:42 | | Netsplit over, joins: Raif |
23:42 | | mode/#code [+o Raif] by ChanServ |
23:43 | | Netsplit over, joins: jerith |
23:43 | | mode/#code [+o jerith] by ChanServ |
23:43 | | Netsplit over, joins: Mahal |
23:43 | | mode/#code [+o Mahal] by ChanServ |
23:45 | | MyCatEats is now known as MyCatSleeps |
23:47 | | UndeadAnno [~farkoff@Nightstar-29151.neoplus.adsl.tpnet.pl] has joined #Code |
23:58 | | Netsplit DeepThought.NY.US.Nightstar.Net <-> Troika.TX.US.Nightstar.Net quits: @Raif, UndeadAnno, @jerith, @Chalain |
--- Log closed Thu Feb 08 00:00:07 2007 |