code logs -> 2006 -> Mon, 27 Nov 2006< code.20061126.log - code.20061128.log >
--- Log opened Mon Nov 27 00:00:29 2006
00:27 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Ping Timeout]
00:29 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
00:29 mode/#code [+o ToxicFrog] by ChanServ
00:51 Chalcedon is now known as ChalcyThesis
01:18 Ev3 [~-@87.72.36.ns-26407] has quit [Killed (NickServ (GHOST command used by Shemhazai))]
01:19 Shemhazai [~-@87.72.36.ns-26407] has joined #Code
01:27 * ToxicFrog flarghles.
01:27
<@ToxicFrog>
I cannot come up with an efficient single-tape Turing Machine that multiplies two binary numbers.
01:28
<@Vornicus>
Why would you want to?
01:28
<@ToxicFrog>
Because my Language Theory prof is a bastard.
01:31
<@Vornicus>
aha
01:32
<@ToxicFrog>
We have to write and test (using this incredibly braindead DOS turing machine simulator) (1) binary to unary conversion and (2) binary multiplication.
01:32
<@ToxicFrog>
And I do in fact have an algorithm that will do binary multiplication, BUT.
01:32
<@ToxicFrog>
It also has to be "efficient"
01:32
<@ToxicFrog>
Where "efficient" means "runs within a fairly arbitrary time limit on whatever inputs the TAs decide to give it"
01:32
<@ToxicFrog>
O(n!) is probably not going to cut it;.
01:37 ChalcyThesis is now known as ChalcyOut
01:38
< MyCatOwnz>
ToxicFrog: do you have access to journals?
01:39
< MyCatOwnz>
I might be able to link you to the authors' names for a few papers on multiplication algorithms that are somewhere around O(nlog(n))-ish (but not quite there) for a string of n bits.
01:39
<@ToxicFrog>
For a single-tape turing machine?
01:39
<@ToxicFrog>
And unless they're online, no.
01:40 Jan[Dangerzone] [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: going to the Autozone next.]
01:40
< MyCatOwnz>
What, no university-paid online journal access?
01:40
<@ToxicFrog>
If so, I don't have time to find it.
01:40
<@Vornicus>
There's some cascading stuff shown in "how fast can we multiply" in Knuth
01:40
<@ToxicFrog>
Which Knuth?
01:41
<@ToxicFrog>
I've consulted Dewdney, which actually has a chapter on single-tape multiplication, but I don't think the algorithm it gives is fast enough.
01:42
< MyCatOwnz>
A. Karatsuba and Y. Ofman did an O(n^1.59) alforithm back in '62.
01:42
<@Vornicus>
TaoCP, vol. 2. 4.3.3 is called "how fast can we multiply"
01:42
<@ToxicFrog>
...impressive.
01:42
< MyCatOwnz>
A. Schönage and V. Strasses made one in '71 which his O(nlog(n)log(log(n))) operations.
01:42
<@ToxicFrog>
MCO: all of this is on the turing machine?
01:43
<@Vornicus>
...oh, the one in there appears to require chaining
01:44
< MyCatOwnz>
ToxicFrog: These are measured in, "bit operations," which I presume would be roughly equivalent to von Neumann instructions or to logic gates. I don't know how well they'd hold out for single-tape Turing machines.
01:44 ChalcyOut [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
01:45 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
01:45 mode/#code [+o Chalcedon] by ChanServ
01:45
<@ToxicFrog>
MCO: I'm not entirely sure that it's possible to map logic gate ops or VN ops to TM in all cases.
01:46
<@ToxicFrog>
Especially while preserving complexity class.
01:46
<@ToxicFrog>
If it /is/ possible, I certainly don't know how, or I would have used the efficient n-bit algorithm given in Dewdney.
01:47
<@Vornicus>
Considering that VN is much more complex than TM, I don't think you can generally do it
01:47
< MyCatOwnz>
Oh, fuck. Not much use to you anyway. The dude was German.
01:47
< MyCatOwnz>
Vornicus: scratch, "more complex," and insert, "less shit."
01:49
<@ToxicFrog>
No, much more complex.
01:49
<@ToxicFrog>
A TM is about as shitless as you can get.
01:49
< MyCatOwnz>
ToxicFrog: a TM is bollockless. You might as well use an OISC.
01:50
< MyCatOwnz>
Totally, utterly useless. No one ever has done or will do computation in anger on a pure Turing machine.
01:51
< MyCatOwnz>
ToxicFrog: when your prof. considers the speed of your programs, how is s/he measuring them?
01:51
<@ToxicFrog>
You know that. And I know that. But my professor is a bit of a luddite.
01:51
<@ToxicFrog>
As I said earlier.
01:51
<@ToxicFrog>
<ToxicFrog> It also has to be "efficient"
01:51
<@ToxicFrog>
<ToxicFrog> Where "efficient" means "runs within a fairly arbitrary time limit on whatever inputs the TAs decide to give it"
01:51
< MyCatOwnz>
ToxicFrog: the polite term is, "pure mathematician."
01:51
< MyCatOwnz>
=D
01:51
<@ToxicFrog>
No, that's my dad.
01:51
< MyCatOwnz>
Okay, okay. I'll make the distinction.
01:52
< MyCatOwnz>
"Overpurified mathematician."
01:52
< MyCatOwnz>
ToxicFrog: anyway. Can you get away with classing a movement of some arbitrary (fixed) number of tape cells as one operation?
01:53
<@McMartin>
It's an abstraction to do so, by you can.
01:53
<@ToxicFrog>
No, I can't.
01:53
<@ToxicFrog>
Because, as I said, that's not how it's measured.
01:53
<@ToxicFrog>
The TA gives it some inputs and then sits there with a stopwatch.
01:53
<@Vornicus>
one operation is read-write-changestate-move
01:53
<@ToxicFrog>
I can't class anything as one operation unless it really is one operation.
01:54
< MyCatOwnz>
Vornicus: I was wondering about how far one was allowed to move the tape. ^_^
01:54
<@Vornicus>
one cell, probably
01:54
<@ToxicFrog>
In one instruction? One cell.
01:54
<@ToxicFrog>
That's how a turing machine works.
01:54
<@ToxicFrog>
Moving N bytes a distance of M cells is roughly 2NM operations.
01:55
< MyCatOwnz>
ToxicFrog: what values are the cells allowed to have? oO
01:56
<@ToxicFrog>
Whatever values I define in the set of the tape alphabet.
01:56
<@ToxicFrog>
Have you worked with TMs at all?
01:56
< MyCatOwnz>
ToxicFrog: I've never been that unlucky. Enlarging the scope of the question, how large is the tape alphabet? Limited to some machine-word maximum or something?
01:57
<@McMartin>
If this is being timed in real-time, your tape alphabet should probably be machine words instead of full heap objects.
01:57
<@McMartin>
Or, for that matter, instead of sub-machine words.
01:57
<@ToxicFrog>
In practice, my tape alphabet is "what I can type on the keyboard"
01:58
< MyCatOwnz>
Good measure. ^_^
01:58
<@ToxicFrog>
With the caveat that space is used for empty tape.
01:58
< MyCatOwnz>
Understandably.
01:59
<@McMartin>
Also, you should learn how to program a TM because otherwise you won't be able to program in Brainfuck.
01:59
<@Vornicus>
01:59
<@McMartin>
Brainfuck's primitives are almost a complete Turing machine in their own right, and it's been demonstrated that you can simulate the rest.
01:59
< MyCatOwnz>
McMartin: to be frank, the only program I would ever willingly write in Brainfuck would be a FORTH interpreter.
02:00 * McMartin lost interest at about the 'w' in Hello World~
02:01
< MyCatOwnz>
After reaching that point, I'd touch Brainfuck for only two purposes - either to try to tweak extra speed out of the FORTH 'terp or to... ummmm... nope, that's all I can think of.
02:02
< MyCatOwnz>
Bug fixes, perhaps? Iono. Anyway. When given a piece of shit that can simulate a real computer, do so instead of attempting to write algorithms directly onto the shitbag.
02:02
< MyCatOwnz>
Wait, rewrite that. I'd do so. Because that's me. Whether anyone else feels the need to is their own slice of bacon.
02:06
<@McMartin>
Generally, TMs are for proving that something is a real computer.
02:07
<@McMartin>
Actually, I lie. For proving that something is a real programming language.
02:07
<@McMartin>
Demonstrating that, for instance, C++ template expansion can compute anything is demonstrated by showing that you can implement a TM in it.
02:07
< MyCatOwnz>
Yes, they're handy in being a benchmark for proving *theoretical* usefulness, I'll give them that.
02:08
< MyCatOwnz>
But for programming onto? FAPP, nyet.
02:08
<@McMartin>
(And indeed, there was a serious question for some time over whether there were things Brainfuck couldn't computer. That Brainfuck is Turing-complete is not trivial)
02:08
< MyCatOwnz>
McMartin: yes, but there's two ways of provind that C++ template expansion is TM-complete.
02:09
<@McMartin>
Anything that permits recursion can prove Turing-completeness in, like, one step, so.
02:09
<@McMartin>
What's the one you're thinking of?
02:09
<@McMartin>
(While we are on the subject: http://www.stanford.edu/~mcmartin/fibofdoom.cc)
02:10 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has joined #Code
02:11
< MyCatOwnz>
McMartin: there's an easy, short one and a longish, awkward one.
02:11
< MyCatOwnz>
The awkward one writes a TM-emulator directly in C++ templates. It's a bitch.
02:11
<@McMartin>
Yeah, uh, that's kind of silly.
02:11
< MyCatOwnz>
The short one proves that the template mechanism can support two particular features. Conditionals and something else that escapes my memory right now.
02:11
<@McMartin>
(Though it's easier to prove BF T-Compluete that way.)
02:12
<@McMartin>
Conditionals and recursions.
02:12
<@McMartin>
And, uh, the ability to represent at least four variable.
02:12
<@McMartin>
Er, recursion, variables.
02:12 * McMartin can decline nouns, honest.
02:12
< MyCatOwnz>
Don't care. You still get full marks for remembering what I'd forgotten.
02:13
<@McMartin>
The real fun one is implementing the BASIC memory model without ever assigning or even declaring any variables that aren't function arguments.
02:14
< MyCatOwnz>
Admittedly, the short proof relies on an earlier proof that any machine with recursion, conditionals and four or more variables is Turing-complete, but, hey. That only needed to be proved once, after which it offers a *much* quicker and simpler proof for most languages to map to.
02:14
<@McMartin>
Yes. Brainfuck is the only one I know of that doesn't.
02:14
<@McMartin>
I think even Whitespace is easier to prove.
02:14
<@McMartin>
But it's been awhile since I looked at it.
02:15
< MyCatOwnz>
Mainly 'cuz Brainfuck is meant to be similar to a TM anyway =)
02:15
<@McMartin>
Yup. The question was whether its state transition function was good enough for the general case.
02:15 * MyCatOwnz looks up Whitespace on wikipedia.
02:15
< MyCatOwnz>
OH MY GOOD F'ING LORD!
02:16
< MyCatOwnz>
Sweet!
02:16
< MyCatOwnz>
Okay, that's worth learning to use a Turing machine for.
02:17
< MyCatOwnz>
Imagine this: a FORTH interpreter written in Whitespace, embedded in the formatting of a C program which coincidentally happens to be a Whitespace interpreter =D
02:17
<@Vornicus>
:(
02:17 * McMartin would just as soon not~
02:17
<@McMartin>
Although!
02:17
< MyCatOwnz>
I think somebody might've actually done something like that once, for the IOCCC.
02:17
<@McMartin>
IOPC, actually.
02:17
<@McMartin>
Ran as both C and Perl, computed the same thing.
02:18 * McMartin doesn't have the book here, will in two days.
02:18
< MyCatOwnz>
Hahahahahahhh... the only language I can think of that you can't embed Whitespace into is probably Python.
02:18
<@McMartin>
Also FORTRAN
02:18
< MyCatOwnz>
Crikey. Impressive.
02:24
<@ToxicFrog>
There's another one in the IOCCC, actually, which is simultaneously C, bash and...perl? I forget the third language.
02:24
<@ToxicFrog>
But it was three languages at once and had the same behaviour in all of them.
02:28
< MyCatOwnz>
One fun idea would be a program that parses correctly in three languages... and, in each, happens to be a lightweight parser for one of the other two. Circular, like.
02:30
< MyCatOwnz>
So you could just keep running it on itself, nesting over and over again, getting progressively slower each time. Then finally pointing the uppermost copy at the source code for some other three-in-one program which exhibits a different behavoir for each language, the behavoir seen would be dependant on the modulus of how many times you'd fired the program up.
02:30
< MyCatOwnz>
s/modulus/remainder from three/
02:34
<@ToxicFrog>
http://www0.us.ioccc.org/1986/applin.c
02:35
<@McMartin>
Aha. f77. I can believe that more readily.
02:35
<@McMartin>
I don't appear to have g77 installed, though.
02:36
<@McMartin>
... ah, yes. The Perl program that implements mac2unix in zero lines of code.
02:36
< MyCatOwnz>
IT COMPILED!
02:36
<@McMartin>
#!/usr/bin/perl -w015l12pi.bak
02:37
< MyCatOwnz>
gcc works, sh works.
02:37 * MyCatOwnz checks his distro's repos for the Fortran compiler.
02:40
< MyCatOwnz>
No Fortran compiler. Fortran-to-C conversion program, though.
02:40
<@ToxicFrog>
...how does that work?
02:40
<@ToxicFrog>
The perl, I mean.
02:40
<@McMartin>
Perl has command line optiosn that do generic tr on its inputs for dealing with encoding issues, IIRC.
02:41
<@ToxicFrog>
Aah.
02:45
<@McMartin>
The Obfuscated Perl contest intros were way cooler than most.
02:45
<@McMartin>
http://www.foo.be/docs/tpj/issues/vol4_2/tpj0402-0032.html
02:46
<@McMartin>
http://www.foo.be/docs/tpj/issues/vol4_3/tpj0403-0017.html
02:46
<@McMartin>
The C/Perl equivalent one implements wc.
02:47
<@McMartin>
"Befunge is the sort of thing they might hold a 'Comprehensible Befunge Contest' for."
02:47
<@ToxicFrog>
Befunge is awesome but unreadable.
02:47
<@ToxicFrog>
RAFT even more so.
02:49
<@McMartin>
Yeah. The winning Perl/Something else hybrid implemented a Befunge interpreter that interpreted itself and eventually printed out "The Perl Journal".
02:49
<@ToxicFrog>
"Note to future contestants: the new bar for crypto consideration is three or more algorithms in one program, preferably all illegal, preferably all military-grade."
02:49
< MyCatOwnz>
ToxicFrog: Maleboge.
02:49 * MyCatOwnz grins.
02:50
< MyCatOwnz>
The only language I've ever heard of that required cryptanalysis to get it to do anything useful.
02:50
<@ToxicFrog>
Meh. RAFT is worse (better?)
02:50
<@ToxicFrog>
It's like Befunge, only less readable, and the code moves around in memory while it's executing.
02:51
<@ToxicFrog>
And then we have things like pentafunge, which cannot be processed effectively by human minds.
02:51
< MyCatOwnz>
s/effectively//
02:51 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has quit [Quit: ]
02:52
< MyCatOwnz>
It's quite impressive really, the sheer creativity that goes into making a language that's still T-complete, and yet entirely incomprehensible.
02:52
<@McMartin>
The funges are a full class of languages.
02:53
<@McMartin>
Depending on the Program Counter's, uh, topology.
02:53
<@McMartin>
Hmm. The perl-funge script doesn't work for me.
02:53
<@McMartin>
Maybe it's just reallys low.
02:53
<@ToxicFrog>
What's the physics term for "number of dimensions"?
02:53
<@ToxicFrog>
Dimensionality? Dimensional arity?
02:54
< MyCatOwnz>
Dimensionality.
02:54
< MyCatOwnz>
At least, that's what they were calling it when they attempted to stuff it into our heads in (maths|physics) class. Can't remember which one, though.
02:55
< MyCatOwnz>
Ooooooohhh...
02:56
< MyCatOwnz>
Befunge looks *nice*. The thing about it being bound to exactly one 80x25 screen...
02:56
< MyCatOwnz>
I have to wonder, could it be implemented into a Nethack gimmick level? =D
02:56
<@McMartin>
"Your incantations will be pronounced within the confines of a memory cage capable of holding four million things; attempts to use more may succeed, or may shatter the cage and release your bound spirits into the air with the crashing of glass and the tinkling of tiny bells."
02:57
<@ToxicFrog>
There are implimentations without that limitation.
02:57
<@ToxicFrog>
And of course we have trefunge, tetrafunge, etc.
02:57
< MyCatOwnz>
McMartin: that sounds delicious.
02:57
<@ToxicFrog>
I wonder if we could implement n-dimensional RAFT?
02:57
< MyCatOwnz>
ToxicFrog: well, yes. But befunge-93 sounded ideal. :/
02:58
< MyCatOwnz>
You keep referring to n-funge. I presume this means n-dimensional funge?
02:58
<@McMartin>
TF: I'm mostly amused by the fact that The Perl Journal explicitly links Perl programming with commanding dread unseen spirits with deception and madness.
02:59
< MyCatOwnz>
McMartin: it has to be said that Larry Wall is a genius at marketing to programmers.
02:59
<@McMartin>
This was actually Felix Gallo.
03:00
<@McMartin>
http://www.foo.be/docs/tpj/issues/vol4_2/tpj0402-0032.html specifically, which is the Call To Arms for the Fourth Obfuscated Perl Contest.
03:01
<@McMartin>
Then there's the Fifth, which opens with "Twelve times the priest's hand rises and falls, and twelve times the knife takes life from the white-clad sacrifice. Moonlight spills over the scene like the virgin's blood over the altar, and your heart races. For you are next."
03:01
<@McMartin>
http://www.foo.be/docs/tpj/issues/vol5_2/tpj0502-0012.html
03:01
<@ToxicFrog>
McM: yes.
03:02 You're now known as TheWatcher[zZzZ]
03:03
<@ToxicFrog>
Is this your fate, or will you defeat the high priests? Do you have what it takes to construct code most obfuscated? The doors to the Fifth Annual Obfuscated Perl Contest are open. The judges are straining at their straitjackets, and their medication has been boosted in anticipation of the finer degrees of psychosis required to decipher truly obfuscated code.
03:03
<@ToxicFrog>
Now, where are the _results_?
03:03
<@McMartin>
http://www.foo.be/docs/tpj/issues/vol5_3/tpj0503-0014.html
03:04
<@ToxicFrog>
One would think that they would have links.
03:04
<@McMartin>
http://www.foo.be/docs/tpj/issues/vol4_3/tpj0403-0017.html
03:04
<@McMartin>
I'm not sure these aren't zomg pirated.
03:04
<@ToxicFrog>
Aah.
03:04
< MyCatOwnz>
Oooooohhhh...
03:05
<@McMartin>
Since tpj.com forwards to Dr. Dobb's Journal these days.
03:05
< MyCatOwnz>
/* are valid befunge characters. You could make a funge/C hybrid quite easily.
03:06
<@McMartin>
"As the old programming adage goes, "Perl is the best language for managing a hardcore porn web site." Oddly, an entrant named Mark Ryan took this to heart, submitting a porn ad generator...that was, unfortunately, clearly written and well-commented. On some level this is the most obfuscated entry ever received."
03:06
< MyCatOwnz>
...I don't get it.
03:07
<@ToxicFrog>
"Although Mssr. Bruhat's combination PostScript/Perl (yes, really) entry was The Best Ever, it was also many, many more bytes than permitted. Alas."
03:07
<@ToxicFrog>
YES! Another person with an unhealthy attachment to postscript.
03:07
<@McMartin>
"First place: there's always someone who tries something totally beyond any understanding. That someone was Les Peters, who used a rendition of rotated 90 degree Mayan numerals to extract the required text."
03:08
<@ToxicFrog>
OH GOD, MY BRAIN
03:08
<@ToxicFrog>
THERE'S FOAM IN MY BRAIN
03:08
<@ToxicFrog>
FOAM
03:09
<@Vornicus>
poor TF
03:09 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:09 mode/#code [+o Chalcy] by ChanServ
03:09
< MyCatOwnz>
I love these conversations.
03:09 * MyCatOwnz hugs Chalchedon.
03:09
<@McMartin>
Food
03:09
< MyCatOwnz>
*Chalcedon
03:10 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
03:11
<@Vornicus>
..okay, so
03:11
<@Vornicus>
Larry Wall invented Perl.
03:11
<@Vornicus>
Larry Wall also won the IOCCC at least once.
03:12
<@Vornicus>
Has Larry Wall ever won the OPC?
03:13 * Chalcy hug MCo back
03:13 Chalcy is now known as Chalcedon
03:15
<@ToxicFrog>
1st Place: Gisle Aas. Gisle's entry only serves to strengthen our deepening suspicion that something is seriously amiss in Norway. Gisle's entry is so magnificently obfuscated that it's in a class by itself; in only 143 characters, Gisle manages to confuse Perl's namespace, Perl's notion of numbers, use the tenth day after the epoch began, and put together a tour-de-force substitution which one of the judges sti
03:15
<@ToxicFrog>
ll doesn't understand. A hearty congratulations to both Gisle and his future therapist.
03:15
<@ToxicFrog>
I want to see the code for some of these.
03:16
<@ToxicFrog>
...
03:16
<@ToxicFrog>
http://www.foo.be/docs/tpj/issues/vol1_4/tpj0104-0010.html
03:21
<@ToxicFrog>
...
03:21
<@ToxicFrog>
The mil.us ICBM guidance code is written in Perl.
03:22
<@ToxicFrog>
WE'RE ALL GONNA DIE
03:22
< MyCatOwnz>
Hmmmm. Whitespace is actually a pretty good language, once you get over the obscure encoding.
03:23
< MyCatOwnz>
Quite easy to write a bijective two-way search-and-replace program in not much more than a few regexps, in order to get a decent language out of it.
03:34 Chalcedon is now known as ChalcyMending
03:39
< MyCatOwnz>
ToxicFrog: how hard/easy/painless is it to call C methods from an embedded Lua interpreter and vice-versa, please?
03:44
<@ToxicFrog>
Err. Methods, or functions?
03:44
<@ToxicFrog>
Methods requires serious wackiness on the C++ side to keep track of this and soforth, although it is doable.
03:45
<@ToxicFrog>
In any case, from lua, you call C functions the same as Lua functionbs, and they look exactly the same.
03:45
<@ToxicFrog>
From C, it's stack based, so you have the push the function, then the arguments, then lua_call - but this can be macroized.
03:45
<@ToxicFrog>
Why?
03:47
<@ToxicFrog>
If you mean "how hard is the groundwork to make this possible" - C->Lua it is as said earlier macros, or you can manipulate the stack directly. Lua->C requires some glue code on the C side but that's it, and there're programs to generate that automatically.
03:48 * ToxicFrog pokes MyCatOwnz. Why do you ask?
03:51
< MyCatOwnz>
ToxicFrog: sorry, was reading something.
03:52
< MyCatOwnz>
ToxicFrog: er, I had just been reading about how mod_perl embeds the Perl interpreter in order to make Perl scripts run much faster than they would as CGI programs (getting rid of all the fork-exec overhead, as well as not having to constantly spin off new copies of the Perl interpreter)
03:53
< MyCatOwnz>
ToxicFrog: and it occurred to me: Lua is a) sane and b) much smaller than Perl. Might it be useful for a mod_lua type project to be written? =D
03:55 * ToxicFrog shrugs. I just write all of mine directly in Lua.
03:56
<@ToxicFrog>
And call the standalone terp, I mean.
03:56
<@ToxicFrog>
That said, it really is not hard at all to embed the Lua terp in anything.
03:56
<@ToxicFrog>
That is literally what it was designed for.
03:57
< MyCatOwnz>
Well, since Lua's terp can be embedded and I presume you can make some kind of call with a FILE* or a char* to a copy of a Lua program... it ought to be really easy to make a mod_lua for Apache, quite conveniently.
03:58
<@ToxicFrog>
You can do either. Indeed, there are convenience functions for both.
03:58
< MyCatOwnz>
Sorry if I don't make much sense right now, I'm low on sleep.
03:58
<@ToxicFrog>
In particular, luaL_dofile(vm, filename) and luaL_dostring(vm, buffer).
03:59
<@ToxicFrog>
And it's trivial to make a version of dofile that accepts a FILE* instead.
03:59
<@McMartin>
You'd probably need to write a CGI model for Lua, though.
03:59
<@ToxicFrog>
CGI "model"?
04:00
<@ToxicFrog>
Functions for parsing QUERY_STRING and for doing URL (en|de)coding are, like, twenty lines total.
04:01
< MyCatOwnz>
Though you could handwrite those in MMX- and SSE-utilizing assembley, if you really *care* about performance.
04:01 * MyCatOwnz sniggers.
04:01
<@McMartin>
If you were doing things on the level of most CGI-based applications, you'd probably want some kind of Session support.
04:01
<@ToxicFrog>
Hmm, true.
04:02
<@McMartin>
Probably database bindings of some kind, too.
04:02
< MyCatOwnz>
McMartin: I *think*, offhand, that Apache can be coerced into handling cookies and authentication (secure and otherwise) on your behalf.
04:02
< MyCatOwnz>
There's probably already a *SQL binding for Lua. If not, uh...
04:03
<@McMartin>
It would be a matter of running an interface generator.
04:03
< MyCatOwnz>
Write one! Not *that* much work.
04:03
<@McMartin>
That's not a huge deal, really.
04:03
< MyCatOwnz>
I mean, all the really *hard* work is in the SQL server.
04:03
<@McMartin>
I was thinking more "In addition to the query string, you should also have a nice little table that persists across requests from the same user"
04:03
< MyCatOwnz>
Which someone else already did. Yay for them!
04:05
< MyCatOwnz>
McMartin: you could use the Apache framework's authentication & cookie handling APIs in a piece of C code that'd write out instructions for a Lua table containing that information, which would then be appended to the top of each Lua script before 'terping it?.
04:05
<@ToxicFrog>
You can actually build the table directly from C.
04:05
<@ToxicFrog>
Indeed, I already have code that does this as part of libsurtr.
04:06
<@McMartin>
What does libsurtr do?
04:06
< MyCatOwnz>
ToxicFrog: does that make your C code non-portable across different versions of the Lua interpreter (which might change struct definitions, after all) or does it not actually matter in practice?
04:06
<@ToxicFrog>
And other code that uses a Lua VM as a hash table rather than writing my own in C.
04:06
<@McMartin>
Besides steal the Orb of Fate.
04:07
<@ToxicFrog>
McMartin: preemptive send-recieve-reply multithreading in Lua.
04:07
<@ToxicFrog>
I have burbled about it before.
04:07
< MyCatOwnz>
Hash tables in C? They're not *that* hard. :/
04:07
<@McMartin>
Generic hash functions kind of suck.
04:07
<@ToxicFrog>
It's much easier to use Lua instead, though.
04:07
< MyCatOwnz>
But the dependancy creep! Blimeh!
04:08
<@ToxicFrog>
I'm already using Lua.
04:08
<@ToxicFrog>
This causes no additional dependencies.
04:08
<@McMartin>
I lean heavily towards "Using C for dynamic data structures is asking to be pwned".
04:08
< MyCatOwnz>
In that case, goforit! Also, you don't have to bother worrying about bugs in someone else's code, you can just swear at the Lua devs instead! ^_^
04:08
<@ToxicFrog>
Besides which, Lua with all the trimmings is, like, 180k counting the parser and code generator.
04:09
<@ToxicFrog>
If I were /just/ using it for the hash tables I could toss those and bring it under 100k.
04:09
<@McMartin>
Doesn't it end up dropping to like 25k?
04:09
<@ToxicFrog>
Probably under 50k if I strip all optional symbol and debug information.
04:09
<@ToxicFrog>
Probably, but I'm erring on the high side because I'm not certain.
04:10
<@ToxicFrog>
MCO: as for inter-version compatibility...different major versions of Lua are effectively different languages.
04:10
<@ToxicFrog>
Different minor versions are not entirely compatible with each other. 5.1 is mostly backwards-compatible with 5.0. I think the C API is entirely backwards-compatible.
04:11
<@ToxicFrog>
In practice, you link your program with the Lua VM rather than saying "please have Lua such-and-such installed" as a dependency.
04:11 * MyCatOwnz nods.
04:12
< MyCatOwnz>
But if you wanna embed a copy of the Lua terp into a webserver to make CGI-like scripts fast, you can see that you'd have to either track the latest Lua version or (if you ever get popular) risk annoying the crap out of the Lua community by beginning to fragment it.
04:12
<@ToxicFrog>
For added fun, McM and I have devised programs for taking a Lua script and wrapping it in C.
04:13
<@McMartin>
After pre-compiling it into a static buffer.
04:13
<@ToxicFrog>
Thus allowing you to release binaries rather than scripts with a dependency on a seperate terp, which is handy when making windows releases.
04:14
<@ToxicFrog>
MCO: well, first of all, the Lua devs /expect/ that most people using Lua will be heavily customizing their terps.
04:14
< MyCatOwnz>
ToxicFrog: that's pretty cool.
04:14
< MyCatOwnz>
Also, where did the term "terp" come from?
04:14
<@ToxicFrog>
It is, as stated earlier, intended to be an embedding language.
04:14 * McMartin hasn't really touched Enceladus since 0.3
04:14
<@ToxicFrog>
Interpreter.
04:14
< MyCatOwnz>
I've been using it for a while now but can't figure out where I must've picked it up.
04:14
<@ToxicFrog>
McMartin: I thought 0.3 was basically the final version.
04:14
<@McMartin>
I never did the Makefile templating.
04:15
<@McMartin>
I think I may have brought it to Nightstar; I got it from the IF community.
04:15
< MyCatOwnz>
ToxicFrog: what it's short for is easy. I just wanna know why and when I started using it.
04:15
<@ToxicFrog>
I kind of forked it back to blcgen awhile ago, to create a more basic program that takes a Lua script and wraps it in a C with main().
04:15
<@ToxicFrog>
Rather than generic Lua-to-C-module like Enceladus.
04:15
<@ToxicFrog>
In practice, all my scripts that I freeze like this are things like "return loadfile[[spellcast.lua]]()"
04:17 MyCatOwnz [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has quit [Quit: Need sleep. So tired, I'm starting to feel ill. Iiiick.]
04:19 * McMartin sets about doing some bugfixing, cues Scrambled Eggman
04:20
<@ToxicFrog>
I've been listening to that a fair bit.
04:22
<@ToxicFrog>
s3ka2boss == still the best boss theme ever
04:23
<@McMartin>
Both Scrambled Eggman and Malicious Fingers need GH levels. >_>
04:25
<@ToxicFrog>
The sound effects at the start of Malicious Fingers need to die in a fire, but yes.
04:26
<@ToxicFrog>
...imagine if there was a Sonic mod where you controlled Sonic by rocking out.
04:26
<@McMartin>
I think the GH controller will permit spindashing.
04:26 * McMartin will have to experiment with SMC+ and his GH controller.
04:27
<@ToxicFrog>
SMC+?
04:28
<@Vornicus>
Malicious Fingers?
04:28
<@ToxicFrog>
Vornicus: OC Remix has released another remix pack, "Project Chaos", of Sonic 3 & Knuckles.
04:28
<@McMartin>
Sonic Mega Collection +
04:28
<@ToxicFrog>
Malicious Fingers is the remix of the final boss.
04:28
<@ToxicFrog>
*final boss theme.
04:29
<@ToxicFrog>
Scrambled Eggman is the remix of the standard boss theme.
04:29 * McMartin also likes Breathtaking Vision, but it's not about Rocking Out, it's about Launching Mysterious Floating Cities.
04:29 * McMartin points vaguely at his LJ.
04:29
<@ToxicFrog>
And when I'm coding, I'm all about the rocking out.
04:29
<@McMartin>
SMC+ is the PS2 pack that includes all the Genesis games and all the Game Gear games.
04:30
<@McMartin>
Once I get my Wii I will thus have personal access to Every Single Sonic game in the mainline and several others.
04:30
<@ToxicFrog>
I have vaguely pondered getting SMC+, but in practice S3&K is the only one of those I find actively interesting, and I have already not only pwnt the rings out of it but modded it.
04:30
<@Vornicus>
aha
04:31 * McMartin will still be missing Sonic Riders.
04:31
<@ToxicFrog>
Sonic Heroes I do want to pick up at some point based on your testimony, but I can't find it.
04:31
<@McMartin>
Hmm. It should be at the "five bucks in used bins" level now.
04:32
<@McMartin>
They still haven't quite gotten 3D Sonic Games Right Yet, but Heroes is the closest they've come.
04:32
<@McMartin>
(He says, having played a whole three levels or less of SA and SA2.)
04:32
<@Vornicus>
wasn't there an awful sonic game in SMRPG-oid 3doid?
04:33
<@McMartin>
Sonic 3D Blast/Flicky's Island, yes.
04:33
<@McMartin>
That's on SMC+.
04:33 * ToxicFrog kills X2 in the face. Stop eating the keystrokes I use to control winamp, goddamit!
04:33
<@McMartin>
So is Puyo Puyo.
04:33
<@McMartin>
Excuse me, "Dr. Robotnik's Mean Bean Machine".
04:33
<@McMartin>
And Sonic Spinball, which has some of my favorite bits of soundtrack in it.
04:33
<@McMartin>
Toxic Caves really needs a properly funky cover.
04:34
<@ToxicFrog>
As for SH - the local EB is highly variable in terms of used bin.
04:34
<@ToxicFrog>
Sometimes they have three games I've looking for for ages, sometimes they have six thousand copies of NFL '05.
04:34
<@McMartin>
It went into "yay we deserve a second printing", so it might actually be special-orderable~
04:35
<@ToxicFrog>
There are so many games that deserve a second printing but haven't gotten one and thus prevent me from finding the damn things.
04:35
<@ToxicFrog>
Like Ico.
04:35
<@McMartin>
Yes. ;_;
04:35
<@ToxicFrog>
Hmm. Doomsday isn't too bad when it comes to rocking out, either.
04:36
<@McMartin>
Indeed
04:36
<@McMartin>
Dead Batteries is also pretty roxx0r.
04:37 * ToxicFrog ponders X2. Jumpdrive? I can afford it, but I should be saving up for a solar power plant.
04:37
<@ToxicFrog>
...or possibly slwwp
04:38
<@ToxicFrog>
I seem to have something of a love/hate relationship with X2, and nearly all of the hate is directed at Egosoft's interface team.
04:43
<@Stephenie>
awww :(
04:45
<@Stephenie>
haha just realized i said that here
04:45 * Stephenie hides
05:05 ChalcyMending [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
05:05 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
05:05 mode/#code [+o Chalcedon] by ChanServ
06:08 AnnoDomini [~fark.off@Nightstar-29805.neoplus.adsl.tpnet.pl] has joined #Code
06:31 EvilAwayLord is now known as EvilDarkLord
07:09 Mahal [~Mahal@Nightstar-12600.worldnet.co.nz] has quit [Quit: It's hard to be mad at someone who misses you while you're asleep. ]
08:57 Chalcedon is now known as ChalcyZzz
10:03 You're now known as TheWatcher[wr0k]
10:36 Vornicus is now known as Vornicus-Latens
11:07 Shemhazai [~-@87.72.36.ns-26407] has quit [Ping Timeout]
12:39 Thaqui [~Thaqui@124.197.11.ns-21322] has quit [Quit: Leaving]
12:48 AnnoDomini [~fark.off@Nightstar-29805.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
12:54 AnnoDomini [~fark.off@Nightstar-29019.neoplus.adsl.tpnet.pl] has joined #Code
13:48 MyCatOwnz [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has joined #code
14:52 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
15:01 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
16:09 You're now known as TheWatcher[afk]
16:23 You're now known as TheWatcher
17:19 You're now known as TheWatcher[afk]
17:29 ChalcyZzz [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Connection reset by peer]
17:30 ChalcyZzz [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
18:21 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has joined #code
18:21 mode/#code [+o Vornicus] by ChanServ
18:21 * Vornicus returns
18:23 ChalcyZzz is now known as Chalcedon
18:24 * AnnoDomini greets the Vorn.
18:26 Mahal [~Mahal@Nightstar-12600.worldnet.co.nz] has joined #Code
18:26 mode/#code [+o Mahal] by ChanServ
18:27 Mahal [~Mahal@Nightstar-12600.worldnet.co.nz] has quit [Quit: It's hard to be mad at someone who misses you while you're asleep. ]
18:27 Mahal [~Mahal@Nightstar-12600.worldnet.co.nz] has joined #Code
18:27 mode/#code [+o Mahal] by ChanServ
18:57 You're now known as TheWatcher
19:11 Mahal is now known as m-work
19:31
<@Vornicus>
gnarg
19:32 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Forjadon))]
19:34 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
19:34 mode/#code [+o Chalcedon] by ChanServ
19:42 Chalcedon is now known as ChalcyThesis
19:50
<@Vornicus>
"forjadon"?
19:50
<@Vornicus>
It sounds like an iron-working dinosaur
19:50 SouthernMyst is now known as ClassyMyst
20:29 MyCatOwnz [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has quit [Quit: Swim, swim, hungry!]
21:14 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
21:14 mode/#code [+o Chalcedon] by ChanServ
21:15 ChalcyThesis [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
21:57 Ev3 [~-@87.72.36.ns-26407] has joined #Code
22:03 You're now known as TheWatcher[T-2]
22:07 You're now known as TheWatcher[zZzZ]
22:26 AnnoDomini [~fark.off@Nightstar-29019.neoplus.adsl.tpnet.pl] has quit [Quit: Some people find sanity a little confining.]
23:34 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
23:35 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
23:40 MyCatOwnz [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has joined #code
23:52 BadmanOriginal [~Mr.Cool@Nightstar-25194.hsd1.il.comcast.net] has joined #Code
23:58 BadmanOriginal [~Mr.Cool@Nightstar-25194.hsd1.il.comcast.net] has left #Code []
--- Log closed Tue Nov 28 00:00:29 2006
code logs -> 2006 -> Mon, 27 Nov 2006< code.20061126.log - code.20061128.log >