code logs -> 2011 -> Wed, 17 Aug 2011< code.20110816.log - code.20110818.log >
--- Log opened Wed Aug 17 00:00:18 2011
--- Day changed Wed Aug 17 2011
00:00
<@ToxicFrog>
Struct crushing?
00:01
<@Tamber>
What happens if you pull the lever linked to the supporting int.
00:02
<@Namegduf>
Or, alternatively, if you release the lever.
00:02
<@Namegduf>
Choose wisely.
00:04 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
00:05
<@ToxicFrog>
Hmm.
00:05
<@ToxicFrog>
I wonder if variable references would be a useful feature in vstruct.
00:05
<@ToxicFrog>
Eg, instead of:
00:06 cpux_ [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has joined #code
00:06
<@ToxicFrog>
local toc = struct.unpack(fd, "n:u4"); struct.unpack(fd, toc.n .. "* c2", toc)
00:06
<@ToxicFrog>
You could instead do:
00:06 Netsplit *.net <-> *.split quits: @cpux, @simon_, @Attilla, @McMartin, @kw-sleep-n, @PinkFreud
00:06
<@ToxicFrog>
local toc = struct.unpack(fd, "n:u4 $n * c2")
00:06 cpux_ is now known as cpux
00:07
<@TheWatcher>
I doubt they'll be too useful if they involve netsplits~
00:07
<@Tamber>
Oh, sheesh. You said that about the atom-splits, too!
00:07 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
00:08 simon_ [simon@Nightstar-883ecc1d.brahmaserver.dk] has joined #code
00:08
<@ToxicFrog>
Add temporaries and you can unpack an entire TXTDAT file in one call, using something like this:
00:11
<@ToxicFrog>
n:u2 magic:u2 x4 $1:$@ $magic * (+$n) $2:$@ $n * (@$1 $3:u4 $1:$@ @$2 +$3 z)
00:12
<@ToxicFrog>
However, at that point, I'm basically reinventing Perl.
00:12
<@ToxicFrog>
So a better approach may be to make the struct components first-class.
00:13
<@Tamber>
hehe
00:16 kw-sleep-n [kwsn@Nightstar-635d16fc.org] has joined #code
00:17 You're now known as TheWatcher[T-2]
00:23 You're now known as TheWatcher[zZzZ]
00:26 McMartin [mcmartin@Nightstar-656a00f7.pltn13.sbcglobal.net] has joined #code
00:29 AnnoDomini [annodomini@Nightstar-6667002f.adsl.tpnet.pl] has quit [[NS] Quit: leaving]
00:37 mode/#code [-o Syloqs_AFH] by ChanServ
00:38 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code
00:57 kw-sleep-n is now known as kwsn
01:06 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
01:17 Omega [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code
01:18 Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [NickServ (GHOST command used by Omega)]
01:18 Omega is now known as Alek
01:30 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has joined #code
01:30 Vash is now known as Vornicus
01:37 Derakon[AFK] [Derakon@Nightstar-c826c088.ca.comcast.net] has quit [Ping timeout: 121 seconds]
02:20 SmithKurosaki [smith@Nightstar-87f33f96.cpe.mountaincable.net] has quit [Operation timed out]
02:21 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:23 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
02:50 Kindamoody[zZz] is now known as Kindamoody
03:04 Phox [Phox@Nightstar-3e5deec3.gv.shawcable.net] has quit [NickServ (GHOST command used by Neophox)]
03:04 Phox [Phox@Nightstar-3e5deec3.gv.shawcable.net] has joined #code
03:11
<@ToxicFrog>
Euuuuuuuurgh
03:12
<@ToxicFrog>
The fundamental problem with this crash I'm seeing is that vstruct handles it very poorly when you have both a readahead and a buffer underrun.
03:12
<@ToxicFrog>
To fix it, I need to rewrite vstruct's error handling code so that it can distinguish between errors it raises itself (which should be passed through to the user unaltered) and errors raised by the runtime (which should be reported as a bug in the library)
03:18 cpux is now known as shade_of_cpux
03:18
< Vornicus>
What's readahead in this case?
03:19
<@ToxicFrog>
vstruct will attempt to coalesce adjacent read operations where possible (ie, where it can determine ahead of time the size of the read)
03:20
<@ToxicFrog>
So, something like [[1024 * u4]] will result in one 4092-byte read and then 1024 substring operations, rather than calling fread() 1024 times.
03:23
<@ToxicFrog>
The problem is that the generated code for this looks similar to:
03:23
<@ToxicFrog>
buffer = fread(size)
03:23
<@ToxicFrog>
io(operation, buffer, ...)
03:23
<@ToxicFrog>
And if we're at EOF, fread(size) returns nil rather than ""
03:25
< Vornicus>
BUt if you're not at EOF but you just plain don't have data (reading off a slow pipe) you get a different problem.
03:25
< Vornicus>
Or in that case does it just block until you've got 4kB
03:25
< Vornicus>
?
03:26
<@ToxicFrog>
It'll do what fread does normally, which is block.
03:26
< Vornicus>
Okay.
03:26
< Vornicus>
(I didn't know what fread does in that situation, I have never written any sort of robust network or piping code.)
03:29
< Vornicus>
Okay, so you've got two possible problems: 1. the buffer might be short; 2. the buffer might be nil.
03:30
< Vornicus>
So you're just going to have to check that. --wait, do your exceptions, when vstruct makes them, do you get to add in a string like you do in Python, "raise ValueError, 'divide by zero'"?
03:32
< Vornicus>
If so, you can add strings to yours that go "vstruct" in there. Idunno, I'm kind of meandering now.
03:33
<@ToxicFrog>
Different error semantics. There's no Error class, but you can throw anything (including a string or an object)
03:34
<@ToxicFrog>
So yeah, it's totally doable
03:34
<@ToxicFrog>
It's just effort
03:37
<@ToxicFrog>
(and I actually have way more possible problems than that)
03:37
< Vornicus>
Ah, so
03:37
<@ToxicFrog>
The underlying thing that needs fixing is that at present, all errors are treated as internal errors
03:37
<@ToxicFrog>
So assert(buffer, "buffer underrun in vstruct.unpack") will result in a giant === INTERNAL ERROR IN VSTRUCT LIBRARY, REPORT THIS AS A BUG === banner.
03:37
< Vornicus>
So you're assuming everything is a bu--- yes. How fun.
03:46
<@ToxicFrog>
to be fair, it is
03:47
<@ToxicFrog>
the bug is "error handlers are not present for generated code"~
03:47
< Vornicus>
Heh
04:07 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
04:23 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code
04:59 Kindamoody [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
05:16 Kindamoody|out [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has joined #code
05:17 Kindamoody|out is now known as Kindamoody
05:30 Vornicus [Vash@Nightstar-f03c5637.sd.cox.net] has quit [Connection closed]
05:43 kwsn is now known as kw-sleep-n
07:13 You're now known as TheWatcher
07:19 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:11 You're now known as TheWatcher[afk]
08:11 Kindamoody is now known as Kindamoody|out
08:30 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
08:31 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
09:27 AnnoDomini [annodomini@Nightstar-3edcbb87.adsl.tpnet.pl] has joined #code
09:34 Kindamoody|out is now known as Kindamoody
09:37 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
11:16 You're now known as TheWatcher
12:54 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
13:07
< gnolam>
Ah, readability.
13:07
< gnolam>
Naturally, "DBCN 17J 2." means "use step-specific straggling logic if available.".
13:08
<@Tamber>
/Naturally/
13:10
<@TheWatcher>
Isn't that obvious?
13:11 mode/#code [+ooooooooooooooo Attilla Phox simon_ kw-sleep-n PinkFreud AnnoDomini McMartin ToxicFrog Thaqui gnolam Syloqs_AFH Alek Rhamphoryncus Kindamoody shade_of_cpux] by Tamber
13:16 RichardBarrell [mycatverbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
13:29
<@Kindamoody>
Whoops, what did Tamber do?!?
13:30
<@Tamber>
:)
13:36 SmithKurosaki [smith@Nightstar-87f33f96.cpe.mountaincable.net] has joined #code
13:43
<@TheWatcher>
Argh, godsdamnit, why is this tag filtering code not working properly?!
13:43
<@froztbyte>
wrong tags?
13:44 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
13:55
< SmithKurosaki>
I love it when things just decide to work for me. Thanks for the help before guys
13:59
<@TheWatcher>
froztbyte: alas, something far more complicated related to splitting data up into blocks and then filtering it - only I was doing filtering first, and breaking shit
14:04
<@froztbyte>
TheWatcher: erf
14:04
<@froztbyte>
TheWatcher: I've been wanting to build a general framework/tool for doing that sort of thing for ages now
14:04
<@froztbyte>
I tend to often pull off insane hacks with sed, cut, awk, some shell loops and lots of redirection
14:14 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Fuck it, I'm going back to bed.]
14:19 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
14:40 You're now known as TheWatcher[afk]
15:04 Kindamoody is now known as Kindamoody|out
15:18 SmithKurosaki [smith@Nightstar-87f33f96.cpe.mountaincable.net] has quit [Ping timeout: 121 seconds]
15:37 celticminstrel [celticminstre@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
16:38 Reiver [orthianz@9C034E.E649EA.3194C7.8381A3] has quit [Ping timeout: 121 seconds]
17:24 SmithKurosaki [smith@Nightstar-87f33f96.cpe.mountaincable.net] has joined #code
17:42 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.]
18:00
<@ToxicFrog>
<3 git stash
18:07 Irssi: #code: Total of 23 nicks [20 ops, 0 halfops, 0 voices, 3 normal]
18:28 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has joined #code
18:28 Vash is now known as Vornicus
19:27 Kindamoody|out is now known as Kindamoody
20:38 Kindamoody is now known as Kindamoody[zZz]
20:56 thomedy [thomedy@Nightstar-7f7d888c.ca.comcast.net] has joined #code
21:26 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
21:42
<@froztbyte>
I have heard a few people liking it quite a bit
21:42
<@froztbyte>
but, git
22:12 celticminstrel [celticminstre@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
22:56 thomedy [thomedy@Nightstar-7f7d888c.ca.comcast.net] has quit [Ping timeout: 121 seconds]
23:04 * Tamber hmms.
23:27 Vornicus [Vash@Nightstar-f03c5637.sd.cox.net] has quit [Client closed the connection]
23:45
<@ToxicFrog>
froztbyte: ?
23:59 shade_of_cpux is now known as cpux
--- Log closed Thu Aug 18 00:00:07 2011
code logs -> 2011 -> Wed, 17 Aug 2011< code.20110816.log - code.20110818.log >

[ Latest log file ]