←2006-11-21 2006-11-22 2006-11-23→ ↑2006 ↑all
00:19:37 -!- CakeProphet has quit (Read error: 110 (Connection timed out)).
00:34:22 -!- fizzie has quit (Read error: 60 (Operation timed out)).
01:22:42 <Razor-X> LaTeX has arithmetic support?
01:22:50 <Razor-X> News to me, because it would sure help my formulas out.
01:23:06 <xor> I love latex
01:23:09 <Razor-X> (I'm going to write a little prepocessor in Scheme to make that a bit easier on me, though.)
01:23:16 <oerjan> of course it has
01:23:49 <xor> It's so funny when someone sees my reports and is like "How did you do that?"
01:23:50 <RodgerTheGreat> I know LaTeX can graph functions and such for you...
01:23:53 -!- fizzie has joined.
01:24:02 <RodgerTheGreat> hehe
01:24:02 <xor> RodgerTheGreat: really?!
01:24:08 <Razor-X> My Physics teachers *adore* my LaTeX.
01:24:11 <Razor-X> xor: Yeah, it can.
01:24:13 <Razor-X> *teacher
01:24:24 <Razor-X> Well, he loves me using it.
01:24:24 <xor> my physics teacher is TERRIBLE
01:24:28 <Razor-X> He likes me less.
01:24:36 <Razor-X> And I like him much less than that even.
01:24:36 <RodgerTheGreat> I remember reading about that last time I flipped through a LaTeX manual
01:24:48 <xor> We just took a test, he graded it very badly
01:26:25 <Razor-X> I hate the man in general. He teaches awfully, and will mean I'll probably have to study that much harder on the AP test.
01:26:40 <Razor-X> He *ALWAYS* goes offtopic. Today it was about designers designing things for their gender groups.
01:26:47 <xor> yep, mine too
01:26:53 <xor> teaches badly, doesn't go off topic
01:26:59 <RodgerTheGreat> I've had entirely too many shitty teachers in my school career.
01:27:31 <Razor-X> And he feels like picking on me, for some odd reason.
01:27:35 <RodgerTheGreat> every now and again, I get a really fantastic one, but most teachers are evil and/or incompetent.
01:27:48 <xor> I need to go in and rub some stuff in his face
01:27:55 <Razor-X> I need to kill mine.
01:27:57 <xor> About precision and accuracy
01:27:59 <RodgerTheGreat> Sexist high-school teachers. Surprise!
01:28:19 <Razor-X> He spends 2 WHOLE HOURS on idiocy and has a very ... odd ... view of what Calculus is.
01:28:34 <xor> My phsyics teacher is afraid of calculus
01:28:42 <xor> Or, thinks we should be
01:28:49 <Razor-X> Example of Calculus from my Physics teacher:
01:29:41 <Razor-X> ``Using the data, you can chart the viscosity of the liquid in day 1, day 2, day 20, etc. Now take it to its limit [My Note: That's his favorite phrase], use Calculus. Using Calculus you can find out what the viscosity is on the 7th day 11th hour.''
01:29:49 <Asztal> my high school physics teachers were good... I think. I can't remember.
01:29:52 <RodgerTheGreat> My government teacher was insanely sexist. I was on numerous occasions tempted to prove to the class that she was a hypocritical numbskull, but I decided that remaining neutral in her eyes would be less dangerous than earning her hatred.
01:29:53 <Razor-X> Someone didn't tell our Physics teacher about fractional days.
01:30:06 <Razor-X> What's scary is that he's teaching an AP class.
01:30:07 <RodgerTheGreat> "keep your enemies so close they don't know they're your enemies"
01:30:30 <Razor-X> Hyper-feminists are fun in their oversighted stupidity.
01:31:18 <RodgerTheGreat> the problem is that they tend to get away with sexism a bit more easily than men.
01:31:40 <Razor-X> I agree. And I'm female, so :)
01:32:13 <Razor-X> What irks me is when women call for equality, but then shamelessly use their ``We're weak! Help us!'' covetisms if they do something wrong/bad.
01:33:56 <RodgerTheGreat> it's fairly frustrating that so many vehement feminists seem to want all the benefits of "perfect equality" without any of the negatives. In my book, discrimination is discrimination, wether it's "justified" or not.
01:34:22 <Razor-X> Exactly.
01:34:58 <RodgerTheGreat> I'm sure that not all feminists are hypocrites, but the most vocal ones really give the whole movement a bad name- not unlike most things.
01:35:46 <RodgerTheGreat> Christianity, Atheism, Black people, White people, Men, Women, Democrats, Republicans...
01:36:27 <RodgerTheGreat> it makes me want to become a hermit or something.
01:37:24 <xor> feminism is to womens rights as black nationalism is to black rights
01:37:46 <RodgerTheGreat> heh- an excellent analogy
01:38:26 <Razor-X> Heh. True.
01:39:00 <Razor-X> Well also, the feminist movement has died down nowadays. So the self-proclaimed zealots tend to be the ones who want one-sided favoritism instead of equality.
01:39:51 <RodgerTheGreat> very true
01:40:44 <Razor-X> Which brings to mind a parallel I made earlier about temporary hacker death.
01:41:38 <xor> That reminds me--I get to go talk to the programming teacher at my school
01:42:07 <Razor-X> They teach telephony at our school... although on what language basis, I have absolutely no idea.
01:42:10 <xor> "OOP is the awnser! Long live Java!"
01:42:33 -!- myu has joined.
01:42:47 <Razor-X> Hey, Java isn't that bad.
01:42:56 <Razor-X> Especially considering C++ *shudder*.
01:42:59 <RodgerTheGreat> there is seriously nothing wrong with Java as a language
01:43:09 <xor> Razor-X: c++ too
01:43:13 <Razor-X> I think Java's stigma comes from this:
01:43:29 <RodgerTheGreat> Not every language needs to be about speed or compiler efficiency
01:43:31 * Sgeo randomly says "LSL"
01:43:56 <Razor-X> A) 99% of today's Java programmers can't code for poop because they've only been trained at one level of programming and have no real ``aptitude''. B) The implementations are very very ineffecient.
01:44:20 <xor> On the phone, he asks, "Has he tried an object oriented language like C++ or Java?"
01:44:43 <Razor-X> Java is good in that, it's readable for someone with C-only experience.
01:44:53 <Razor-X> It definitely succeeds there, where C++ utterly fails.
01:45:03 <RodgerTheGreat> I'd say those are fair criticisms, as long as you bear in mind the advantages of Java
01:45:27 <xor> I need some compelling arguments against C++ and Java for when I go in
01:45:48 <RodgerTheGreat> Java nails cross-platform operation like virtually no other language, and that's certainly worth some hits on speed
01:45:50 <Razor-X> I have a bunch of complaints against C++, but I don't mind Java that much.
01:46:06 <xor> What are your complaints against C++?
01:47:38 <Razor-X> The syntax is horribly discontiguous with C syntax. The data abstractions are often overly abstract, much unlike its C counterpart. C++'s object system is useless overhead for an object system that only contains the cogs of objects (instances, constructors, destructors), C++ programmers infuriatingly choose to use C++ abstract-equivalents to perfectly good C counterparts.
01:47:45 <RodgerTheGreat> I just don't really like C or C++, because they really make it clear that they weren't designed for usability as much as the ability to compile to machinecode. That doesn't mean I won't ever use them, but there's a difference between coding for fun and coding for work. I'm never going to code in C/C++ for *fun*.
01:48:42 <myu> i think all the languages belonging to the C-family are poor languages.. c/c++/java/php/python etc
01:48:47 <Asztal> I hate: C++'s compilation model.
01:48:51 <Razor-X> The standard library is immense immense. But this is also a criticism that applies to Java and CL too.
01:49:23 <myu> so guys, what do you think are the highest level languages?
01:49:30 <xor> pseudo code
01:49:36 <Razor-X> Well said :D
01:49:39 <RodgerTheGreat> I'd say that Java's API is a more useful "standard library" than what comes with C, even if you say that it's bloated.
01:49:54 <RodgerTheGreat> human language.
01:50:29 <oerjan> why, telepathy of course :)
01:50:30 <Razor-X> Well, there's another point too. Java's API is still usable if you only read the basics and skim when you need more. C++'s isn't.
01:50:33 <xor> human language can be a bitch to express a program in
01:50:35 <RodgerTheGreat> program specifications in English are effectively equivalent to sourcecode if they're detailed, they just need an extremely complex compiler (a human) to convert.
01:50:36 <Razor-X> CL is somewhere in between.
01:50:42 <myu> yeah human language isn't very high level
01:50:51 <RodgerTheGreat> Razor-X: I wholeheartedly agree
01:51:08 <myu> CL is so old, it makes no sense that CL would be one of the highest level languages these days heh :P
01:51:20 <xor> myu: Yep, it's crazy
01:51:24 <Razor-X> Forth is one of those languages that doesen't fit anywhere.
01:51:27 <RodgerTheGreat> in my mind, the best single thing about Java is the fact that it's designed in a very uniform way.
01:51:30 <xor> 50 years old, and still good
01:52:02 <Razor-X> That too! C++ is a hodgepodge. std::tuple, std::pair, std::list, I mean... what the **** ?
01:52:19 <RodgerTheGreat> yeah- one of the things that brings me pain when I code in C++/
01:52:48 <RodgerTheGreat> most C++ coders will respond "but I can do it with fewer characters than you can in Java!".
01:52:52 <Razor-X> C is good for what it is -- effecient (although Pascal may be a bit better, and Forth is good for lower-than-C-higher-than-ASM level).
01:53:06 <Razor-X> Sure. After reading a 1000 page+ manual.
01:53:07 <xor> Forth is just weird
01:53:16 <Razor-X> I like Forth.
01:53:20 <xor> I know
01:53:38 <RodgerTheGreat> Java 5.0 I/O is *infinitely* better than it has been in the past, and even back then it wasn't too horrible if you understood what you were doing,
01:53:51 <myu> i'm a forth programmer, getting into ruby nowadays though
01:54:13 <Razor-X> Ruby is alright. Nothing too novel, but a good language as far as languages go.
01:54:28 <Razor-X> Scheme is probably my strongest language and is my Lingua Fortica.
01:54:33 <RodgerTheGreat> I just wish that fewere people would piss and moan when they're required to use a language they don't like. All languages have a time and a purpose, and whining doesn't make coding go any faster.
01:54:51 <myu> even tho i spent years with forth its so slow to code in.. takes so much time to figure out the simplest solution and to code the DSL etc
01:54:57 * RodgerTheGreat spits water across the room at hearing the dreaded name "Ruby"
01:54:58 <myu> i imagine lisp coding is similarly slow
01:55:03 <Razor-X> It's not.
01:55:05 <myu> ruby is very readable
01:55:16 <Asztal> I love it.
01:55:21 <Razor-X> Forth is slow only because you start from machine-level up.
01:55:56 <myu> Razor-X: i'm talking about proper forth coding, no words longer than 2 lines, no using 'pick', etc ;)
01:56:03 <RodgerTheGreat> hey, if you like Ruby, good for you... All I'm saying is that I've wrapped my brain around a lot of esolangs, and ruby made me want to take an icepick to my skull.
01:56:06 <Razor-X> myu: Well, even then.
01:56:29 <Razor-X> myu: And Forth does become a pain if you factor at more than 2 lines, IMO.
01:56:31 <myu> yeah, its from the machine-level up but i wonder why no programmers have really brought forth out of the lowlevel?
01:56:42 <Razor-X> Because it belongs in that arena.
01:56:46 <myu> heh
01:56:56 <Razor-X> How many other languages can you play around interactively at the char and byte level?
01:57:11 <RodgerTheGreat> it'd be like asking why there aren't more interpreters for C.
01:57:17 <Razor-X> Quickly debug your driver code and rewrite it on the spot.
01:57:46 <Razor-X> Once you understand how to use a Lisp dialect correctly, you can code most things quickly. Especially because you can build your *own* abstractions instead of reading a 1000 page manual on monolothic ones.
01:57:52 <myu> fine, but forth is extendable, it can play in the HLL arena if it wants to
01:58:39 <myu> its essentially lisp, except postfix/stack-based instead of list-based :P
01:59:06 <RodgerTheGreat> hm.
01:59:08 <myu> my friends complained about lisp requiring them to think recursively, but i just have to think backwards from my forth thinking
01:59:16 <Razor-X> Of course, Lisp and Forth suffer from one fatal flaw (IMO) -- over-diversification. With the power to create your own abstractions, you get a fairly watered down standard.
01:59:26 <myu> yeah thats a good point
01:59:28 <RodgerTheGreat> y'know- I've always wondered about this- what are the "atomic" primitives in LISP?
01:59:30 <Razor-X> Recursive thinking takes time to get into, at first.
01:59:42 <myu> RodgerTheGreat: car, cdr etc ?
01:59:55 <RodgerTheGreat> is there a complete list somewhere?
02:00:23 <RodgerTheGreat> or does everything boil down to BF with a bunch of parentheses and lambda operators?
02:00:41 <myu> heh
02:01:45 <Razor-X> RodgerTheGreat: In Scheme, you have the integer, the character, and the procedure.
02:02:06 <Razor-X> Variables are syntactic sugar for procedures.
02:02:27 <Razor-X> Strings are part of the basic standard, but aren't considered primitive (but it is a disparate data-type, unlike C).
02:02:32 <RodgerTheGreat> well, what operators do you have access to at the lowest level?
02:02:44 <Razor-X> (lambda)
02:02:51 <RodgerTheGreat> I know things like + and - are synthetic
02:03:12 <RodgerTheGreat> *only* lambda?
02:03:14 <Razor-X> In a true from-scratch Lisp, you use combinator logic to create everything. Church numerals for numbers, etc.
02:03:23 <RodgerTheGreat> ah
02:03:24 <RodgerTheGreat> I see
02:03:45 <Razor-X> Of course, for purposes of speed, that's suicide.
02:04:11 <oerjan> you forgot symbols
02:04:21 <RodgerTheGreat> yeah, I can understand the speed thing
02:04:28 <Razor-X> Well, that's not really an atom as much as the name for an atom.
02:04:49 <Razor-X> In Lisp, everything is either a symbol or a procedure. Hmmm, maybe that is a more adequate answer.
02:05:08 <RodgerTheGreat> that's why x86 CPU's all have math coprocessors integrally, rather than doing things like sines in software
02:05:13 <Razor-X> And you have the extra syntactic capability to bind procedures to symbols.
02:05:22 <RodgerTheGreat> (lambda)
02:06:23 <Razor-X> (define blah 4) == (define blah (lambda () 4)), (define) syntactic extension for binding, blah -- a symbol, (lambda () 4) a procedure.
02:06:32 <Razor-X> That's variable assignment for you.
02:06:41 <Razor-X> Of course, it's different in CL, which is a lot more impure.
02:07:12 <oerjan> you mean (define (blah) 4) == (define blah (lambda () 4)))
02:07:30 <Razor-X> Errr, yes.
02:08:38 <RodgerTheGreat> I'm assuming CL means Common Lisp?
02:08:43 <Razor-X> Yes.
02:08:48 <RodgerTheGreat> ah, ok
02:09:15 <myu> i hear CL is a bastardization of the one true lisp and that all real lispers shouldn't be using CL
02:09:32 <Razor-X> The division goes deep.
02:09:50 <Razor-X> Like Hindu-Pakistan, Taiwan-China, etc.
02:10:13 <oerjan> but scheme is even further from the original lisp than CL is
02:10:29 <RodgerTheGreat> the basics work the same
02:10:57 <RodgerTheGreat> I used a scheme interpreter to work through some beginning LISP tutorials.
02:11:14 <Razor-X> CL is more programmer-pragmatic, but Scheme compared to CL is a lot like C compared to C++. One is lean, but requires more work, the other is fat, but requires less.
02:11:19 -!- GregorR-L has quit (Read error: 113 (No route to host)).
02:11:44 <RodgerTheGreat> and, interestingly enough, LOGO is actually very similar in structure to LISP proper, although the syntax looks different
02:11:49 <Razor-X> Scheme is more ``pure'' from the Lambda Calculus perspective.
02:12:15 <RodgerTheGreat> anyone here know LOGO? :D
02:12:16 <Razor-X> And then you have Haskell :)
02:12:38 <Razor-X> RodgerTheGreat: Was my first ever programming language. Back when I went to a private school.
02:13:12 <RodgerTheGreat> when was this?
02:13:40 <Razor-X> 1-3rd grade, then I left. I came back, but they taught Pascal at that age.
02:14:27 <Razor-X> I and a group of friends one day sneakily copied 6th grader programs to our floppies, stole them home, and read over their source and learned a bunch of new stuff.
02:14:38 <Razor-X> That was interesting :)
02:14:41 <RodgerTheGreat> argh. fucking public schools. My first experience with programming was in 6th grade when I found a macintosh version of QBASIC and tried punching in code from the back of my math book.
02:15:31 <RodgerTheGreat> they really *need* to be teaching kids languages like LOGO or BASIC in elementary school.
02:18:54 -!- Arrogant has joined.
02:19:36 <RodgerTheGreat> In a similar vein, I think we should take a note from advertising companies and drill things into people's brains from an extremely early age through repetition. F=Ma. For every action, there is an equal and opposite reaction. Sin(pi)=0, and so on. Comprehension can come later.
02:20:51 <RodgerTheGreat> we need to improve our use of the first few years of jello-like malleability in our children's minds.
02:21:22 <RodgerTheGreat> You can teach an old dog new tricks, but it's sure as hell easier to teach a puppy.
02:22:18 <RodgerTheGreat> howdy, Arrogant, by the way.
02:27:50 <RodgerTheGreat> apparently, I have killed this conversational thread. :/
02:28:01 * RodgerTheGreat crawls back inside his hermit-cave
02:30:51 <Asztal> да!
03:00:16 -!- Arrogant has quit ("Leaving").
03:09:04 <lament> da?
03:09:11 <oerjan> nyet!
03:09:46 <lament> dadadadadadada
03:09:56 <oerjan> .gertrude
03:10:35 <lament> few words are as funny as 'nyet'.
03:10:48 <lament> i guess 'borscht' is another one.
03:11:45 <oerjan> isn't that borschtsch?
03:12:16 <lament> borschtshcshtshc
03:12:19 <lament> ,maybe
03:14:37 <oerjan> wikipedia says no, then yes (in german)
03:20:44 <xor> Razor-X: How does that "lisp from only lambda" work?
03:21:07 <xor> I've never understood that
03:22:49 -!- oerjan has quit ("Good night").
03:28:25 -!- myu has left (?).
03:36:59 <SimonRC> C, IMO, is a great portable assembler.
03:37:28 <xor> C is fun
03:37:41 <SimonRC> xor: Lambda can be abused in fun ways.
03:37:50 <xor> example
03:38:15 <SimonRC> define (CONS X Y) to be (LAMBDA (F) (F X Y))
03:38:36 <SimonRC> Then CAR = (LAMBDA (X Y) X) and CDR = (LAMBDA (X Y) Y)
03:38:43 <SimonRC> You see how that satisfies the requirements?
03:39:18 <xor> What's F?
03:39:31 <SimonRC> huh?
03:39:37 <xor> (LAMBDA (F) (F X Y))
03:39:38 <SimonRC> you knwo hoe LAMBDA works, right?
03:39:41 <xor> yeah
03:39:52 <SimonRC> well, F is the variable that is bound by that lambds
03:40:26 <xor> But that function takes one argument
03:40:29 <xor> cons takes 2
03:40:36 <SimonRC> erm
03:40:48 <SimonRC> I'm not defining CONS to be that
03:40:59 <SimonRC> I'm defining (CONS X Y) to be that
03:41:10 <xor> ooooooh
03:41:24 <SimonRC> Therefore CONS is (LAMBDA (X Y) (LAMBDA (F) (F X Y)))
03:42:18 <SimonRC> plus I fucked up the definitions of CAR and CDR
03:42:30 <xor> yeah
03:42:56 <SimonRC> CAR should be (LAMBDA (P) (P (LAMBDA (X Y) X)))
03:43:06 <SimonRC> and CDR should be (LAMBDA (P) (P (LAMBDA (X Y) Y)))
03:43:38 <xor> oh, so cons returns it's contents
03:43:42 <SimonRC> so you have (CAR (CONS A B)) = ((LAMBDA (X Y) X) A B) = A
03:44:01 <SimonRC> xor: no, cons returns a function that takes another function and applies it to its contents
03:44:55 <SimonRC> You represent any datastructure by a function that takes in another function and applies it to the members of the datastructure.
03:45:31 <SimonRC> This is a *more* powerful concept than most modern languages have.
03:46:18 <SimonRC> With lazy evaluation, it gives you properties for free, you just have to add them to the function that is created by the datastructure constructor.
03:46:55 <xor> but then it would be ((lambda (f) (f x y)) #'car)
03:47:03 <SimonRC> You also get algebraic data type pattern-matching for free. You just take in multiple functions to apply to the contents of the datastructure, rather than just one.
03:47:15 <SimonRC> xor: nonono, this is an L1, not an L2
03:47:37 <xor> ?
03:47:38 <SimonRC> xor: oh, wait, yes
03:47:48 <SimonRC> what is "it"
03:48:08 <xor> wait
03:48:12 * xor thinks
03:48:29 <SimonRC> It's a bit like CPS
03:49:01 <SimonRC> A datastructure is something capable of passing the data in it to a function that know what to do with that data.
03:49:52 <xor> ahhh, I understand
03:52:28 <xor> clever
03:52:45 <xor> But how would you implement, for example, +
03:52:46 <xor> ?
04:03:47 <SimonRC> well...
04:03:53 <SimonRC> you could make it primitive, or...
04:04:23 <SimonRC> we consider "data Nat = Zero | Succ Nat"
04:04:30 <SimonRC> this becomes:
04:05:41 <SimonRC> "(ZERO) = (lambda (FZ FN) (FZ))" and "(SUCC N) = "(LAMBDA (FZ FN) (FN N))"
04:05:45 <SimonRC> things are easy from there
04:06:54 <xor> aaagh
04:07:11 <SimonRC> if tyou want a more efficient representation, you can read "every number has at most two digits" by this guy I know: http://www-old.cs.st-andrews.ac.uk/~eb/
04:07:26 <SimonRC> xor: you see how the Haskell declaration works, right?
04:07:44 <xor> no
04:07:46 <SimonRC> ah
04:08:03 <SimonRC> A natural number is either zero or one more than anotehr natural number
04:08:11 <xor> yes
04:08:31 <SimonRC> And you know a bit of Haskell, right?
04:08:55 <xor> A tiny bit
04:08:58 <SimonRC> hmm
04:09:15 <SimonRC> Do you know what "data" does?
04:10:05 <xor> a function that takes Nat and returns Zero | Succ Nat ?
04:10:13 <SimonRC> erm, no
04:10:20 <SimonRC> this will be tricky
04:10:33 <SimonRC> I have no idea how to explain algebraic data types to you.
04:10:50 <SimonRC> do you know about C's "union" types?
04:10:54 <xor> yeah
04:11:28 <SimonRC> right, well you can consider "data" to declare something like a tagged union of structs.
04:12:55 <SimonRC> in this case, n item of type "Nat" is *like* the union of a stucture containing no fields (tagged "Zero") or a structure containing 1 field (tagged "Succ") and that field contains a "Nat".
04:13:32 <xor> hmm
04:13:52 <xor> So the number of links in this chain is the number it represents
04:14:00 <SimonRC> yeas
04:14:02 <SimonRC> yes
04:14:08 <SimonRC> In english...
04:14:24 <SimonRC> A natural number is either zero or one more than another natural number
04:14:29 <xor> yes
04:14:44 <xor> but what about "(ZERO) = (lambda (FZ FN) (FZ))" and "(SUCC N) = "(LAMBDA (FZ FN) (FN N))"
04:14:50 <SimonRC> ah
04:16:00 <SimonRC> Well, since there are two possible types of contents for a Nat, the function that represents a Nat must take in two functions that say what to do in the two possible cases
04:16:29 <SimonRC> a nat here is of the form (LAMBDA (FZ FN) ...)
04:17:28 <SimonRC> To use a nat called N, you do the following call: (N <what-to-do-in-the-zero-case> <what-to-do-in-the-succ-case>)
04:18:15 <SimonRC> (remember that CONS only has one possible casem so a cons was a function that took one other function as an argument)
04:19:04 <xor> hmm
04:19:07 <SimonRC> but a nat takes two arguments that say what to do for the two possible cases of nat (zero and succ)
04:19:57 <xor> that's crazy
04:20:25 <SimonRC> It is a mechanical translation from Haskell. And it seem very elegant to me.
04:20:40 <xor> It is
04:20:46 <xor> It's just something I've never seen before
04:21:31 <SimonRC> I haven;t really understood if before but it just clicked earlier today
04:21:51 <SimonRC> is it sticking in your head?
04:21:59 <SimonRC> or does it not quite stay?
04:22:33 <xor> I think it makes sense
04:23:59 <SimonRC> Good, I'll explain why zero and succ work. zero is a "constructor", i.e. a function that creates a nat. zero returns the nat that takes in the zero-case handler (FZ) and the succ-case handler (FN) and just calls the zero-case handler, right?
04:24:34 <xor> yeah
04:25:33 <SimonRC> and SUCC takes in the FZ and FN, then calls FN with a single argument: the number it is the Succ of.
04:25:53 <SimonRC> (Succ = Successor, i.e. the "next" number)
04:26:05 <xor> yes
04:26:43 <SimonRC> so..., to construct plus...
04:27:01 <SimonRC> plus take 2 arguments
04:27:12 <SimonRC> wecase-analyse the first argument
04:27:28 <xor> wecase-analyse?
04:27:34 <SimonRC> we case-analyse
04:27:41 <xor> oh
04:28:22 <SimonRC> plus of zero and foo is equal to foo. plus of (succ of bar) and baz is the succ of (plauss of bar and baz)
04:28:26 <SimonRC> they're the two cases
04:28:49 <SimonRC> that seem correct, right?
04:29:01 <xor> I don't understand
04:29:06 <SimonRC> ok...
04:29:30 <xor> What is this called?
04:29:35 <SimonRC> case analysis
04:29:45 <xor> no, this whole thing
04:29:49 <SimonRC> duno
04:30:22 <SimonRC> I have read about the basics of it and it is all clicking into place as we go along
04:30:46 <xor> Read what?
04:31:46 <SimonRC> erm
04:31:51 <SimonRC> I can't remember
04:32:14 <xor> The term "lambda calculus" rings a bell
04:32:34 <SimonRC> this is a standard set of tricks for representing data in the lambda calculus
04:33:48 <SimonRC> Well, I remember being told in a simplified fasion that algebraic data types are equivalent to functions in the manner above, and that you can represent any data with complicated functions, and the ADT for Nat is a well-known thing, but the lambdas for NAt I just worked out off the top of my head
04:34:16 -!- anonfunc has joined.
04:34:16 <xor> ADT?
04:34:25 <SimonRC> algebraic data type
04:34:30 <xor> oh
04:34:48 <SimonRC> to continue... you know that 0 + foo = foo, and (1 + bar) + baz = 1 + (bar + baz), right?
04:45:25 <xor> yeah
04:45:56 <SimonRC> well, plus is a function of 2 arguments:
04:46:17 <SimonRC> It considers the two possible structures of the first argument first:
04:46:21 <SimonRC> plus of zero and foo is equal to foo
04:46:27 <SimonRC> plus of (succ of bar) and baz is the succ of (plauss of bar and baz)
04:47:16 <xor> yeah
04:48:11 <SimonRC> that is case-analysis of the first argument
04:49:06 <SimonRC> now, to do case analysis of an argument, we make a function that says what to do in each case, then pass all those functions to the value we are analysing.
04:49:59 <xor> ok
04:50:53 <SimonRC> for example, to analyse a value (N) of type nat, we construct a function to say what to do in the zero case, and a function saying what to do in the succ case, and pass them to N
04:51:27 <xor> call N, right?
04:51:30 <SimonRC> yes
04:51:34 <xor> k
04:51:51 <SimonRC> the zero-case handler must be a function of 0 arguments that returns the result for the zero case
04:52:13 <SimonRC> and we know that if the first argument is zero, the result is just the second argument
04:52:52 <SimonRC> so, for (PLUS X Y), the zero-case handler is (LAMBDA () Y)
04:56:05 <SimonRC> right?
04:56:09 <xor> yeah
04:57:06 <SimonRC> and if the first argument is (SUCC N), the result is (SUCC (PLUS N Y))
04:57:22 <xor> I think
04:57:28 <SimonRC> so the succ-case handler is (LAMBDA (N) (SUCC (PLUS N Y)))
04:58:00 <xor> yeah
04:59:16 <SimonRC> and putting these together:
05:00:11 <SimonRC> PLUS = (LAMBDA (X Y) (X (LAMBDA () Y) (LAMBDA (N) (SUCC (PLUS N Y)))))
05:00:14 <SimonRC> TADA!
05:00:32 <xor> wow
05:00:39 <SimonRC> totally silly, too
05:01:31 <SimonRC> Do remember that I am discovering this as I chat to you, and my terminology is not standard.
05:01:41 <SimonRC> Of course, this might not be useful.
05:01:54 <xor> http://en.wikipedia.org/wiki/Church_numeral
05:02:52 <SimonRC> But it is really simple to do once you know Haskell reasonably well, as a nice-enough subset of Haskell has a 1-to-1 correspondance with it
05:02:55 <SimonRC> plus = (lambda (x y) (x (lambda () y) (lambda (n) (succ (plus n y)))))
05:02:58 <SimonRC> plus = \ x y -> case x of { Zero -> y ; Succ n -> Succ (plus x y) }
05:03:10 <SimonRC> (with extra spaces added to make it line up)
05:03:32 <SimonRC> oooh
05:03:46 <SimonRC> well, I was definitely not teaching you church numerals
05:04:39 <SimonRC> I was teching you some other kind of numerals
05:06:14 <SimonRC> if, however CH is a church numeral, then "my" notation can be constructed thus: (CH SUCC ZERO)
05:06:18 <SimonRC> he
05:06:19 <SimonRC> hehehe
05:06:50 <SimonRC> and the opposite conversion is:
05:08:37 <SimonRC> NAT-TO-CHURCH = (LAMBDA (N) (LAMBDA (F) (LAMBDA (X) (N (LAMBDA () X) (LAMBDA (M) (F (NAT-TO-CHURCH M))))))
05:08:40 <SimonRC> TADA!
05:08:43 <SimonRC> I think
05:09:11 <SimonRC> this is a bit nasty because church numerals are traditionally curried
05:09:15 <xor> That's a lot of lambdas
05:09:17 <SimonRC> yeah
05:09:36 <xor> Well that was very interesting
05:10:08 <SimonRC> If, however, we use a version of LAMBDA that curries, and assume that function-calling curries too, we get:
05:10:43 <SimonRC> (arranged for comprehensibility not brevity)
05:11:14 -!- Sgeo has quit ("Ex-Chat").
05:11:16 <SimonRC> NAT-TO-CHURCH = (LAMBDA (N) (LAMBDA (F X) (N (LAMBDA () X) (LAMBDA (M) F (NAT-TO-CHURCH M))))))
05:22:09 -!- CakeProphet has joined.
05:24:02 <Razor-X> xor: Read on the basics of Lambda Calculus.
05:24:42 <Razor-X> Learn the basic combinators and take a look at the Church Numerals (or, if you understood the Lambda Calculus, you should be able to reason out the Church Numerals already (I did)).
05:27:14 <Razor-X> You can also be adventerous and implement Lambda Calculus in Lisp. You'll quickly see that, this way of dealing with Lisp is to Church's computational metaphor as BF is to Turing's computational method.
05:27:38 <Razor-X> (Unlambda and BF is a more apt comparison here.)
05:28:49 * SimonRC doesn't quite get that analogy.
05:29:08 <Razor-X> Well, BF is pretty close to Turing's infinite tape.
05:34:42 <xor> Razor-X: That's what I will do
05:35:20 <xor> But lambda calculus in lisp would be nothing
05:38:34 <SimonRC> I think that the lambda calculus interprets turing machines rather more efficiently than turing machines interpret the lambda calculus
05:38:48 <SimonRC> also, i have some idea of how to do the former sanely, but no the latter
05:50:53 -!- CXI has quit (Read error: 104 (Connection reset by peer)).
06:01:28 <Razor-X> That is true. And I have an idea about the former too.
06:03:37 -!- CXI has joined.
06:35:25 -!- GregorR-L has joined.
07:42:08 -!- wooby has joined.
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:00:05 -!- GregorR-L has quit ("Leaving").
08:22:25 -!- puzzlet_ has quit (Read error: 113 (No route to host)).
08:30:16 -!- puzzlet_ has joined.
10:26:36 -!- jix has joined.
11:44:11 -!- ivan` has quit (Read error: 104 (Connection reset by peer)).
11:57:18 -!- wooby has quit.
14:20:33 -!- jix_ has joined.
14:29:40 -!- jix has quit (Read error: 110 (Connection timed out)).
14:33:48 -!- CakeProphet_ has joined.
14:37:12 -!- CakeProphet__ has joined.
14:42:18 -!- CakeProphet___ has joined.
14:44:00 -!- CakeProphet has quit (Read error: 113 (No route to host)).
14:44:01 -!- CakeProphet___ has changed nick to CakeProphet.
14:55:18 -!- CakeProphet_ has quit (Read error: 110 (Connection timed out)).
15:00:22 -!- CakeProphet__ has quit (Read error: 110 (Connection timed out)).
15:05:29 -!- CakeProphet has quit (Read error: 104 (Connection reset by peer)).
15:05:31 -!- CakeProphet___ has joined.
15:05:34 -!- CakeProphet___ has changed nick to CakeProphet.
15:06:51 -!- oerjan has joined.
15:36:22 -!- lindi- has quit (Read error: 104 (Connection reset by peer)).
15:45:27 -!- lindi- has joined.
16:16:34 -!- lindi- has quit (Read error: 104 (Connection reset by peer)).
16:21:11 -!- lindi- has joined.
16:32:23 -!- GregorR-L has joined.
16:43:29 <sp3tt> It appears that it is impossible to write a brainfuck interpreter in LaTeX.
16:43:33 <sp3tt> String handling sucks.
16:48:43 <GregorR-L> I don't think LaTeX is TC, so of course not.
16:48:49 <sp3tt> It is.
16:50:43 <GregorR-L> Well then it is possible.
16:51:15 <GregorR-L> Either it's TC, and therefore you can write a BF interpreter in it, or it's not, so you can't (or at least can't write a complete one)
16:51:59 <sp3tt> Well, if the only package for string handling I can find doesn't work :/
16:54:21 <sp3tt> And if LaTeX wants to throw error messages that seem to be caused by something that doesn't exist...
16:54:42 <oerjan> to write a BF interpreter you need to be able to read string input. this has nothing to do with being turing complete, consider iota and jot.
16:57:04 <oerjan> it might be that the required command is in the underlying TeX and not documented in LaTeX.
16:57:08 <GregorR-L> Oh yes, this is true - what I was referring to is really BF minus ".,"
16:57:43 <sp3tt> . is simple, , is harder.
16:57:48 <oerjan> and i was referring to inputting the BF program itself.
16:57:52 <sp3tt> One could use ! to separate them.
17:05:05 <sp3tt> The program and the input that is.
17:34:43 -!- tgwizard has joined.
17:36:02 -!- cmeme has quit (Remote closed the connection).
17:37:00 -!- cmeme has joined.
17:37:13 -!- cmeme has quit (Read error: 104 (Connection reset by peer)).
17:38:09 -!- cmeme has joined.
17:38:22 -!- cmeme has quit (Read error: 104 (Connection reset by peer)).
17:39:41 -!- cmeme has joined.
17:40:12 -!- cmeme has quit (Remote closed the connection).
17:40:43 -!- cmeme has joined.
17:55:47 <oerjan> try TeX by Topic at http://www.eijkhout.net/tbt/. the chapter on token lists might be particularly useful.
17:57:09 <oerjan> from what the book says about the \read macro it might be hard to read input without matching brackets.
17:57:53 -!- cmeme has quit (Read error: 104 (Connection reset by peer)).
17:58:41 -!- cmeme has joined.
17:59:11 -!- cmeme has quit (Remote closed the connection).
17:59:42 -!- cmeme has joined.
18:00:49 -!- cmeme has quit (Read error: 104 (Connection reset by peer)).
18:01:12 <oerjan> maybe something with the character category codes i see mentioned can fix that.
18:01:24 -!- cmeme has joined.
18:01:54 -!- cmeme has quit (Remote closed the connection).
18:02:26 -!- cmeme has joined.
18:03:44 -!- oerjan has quit ("Off to eat").
20:33:56 -!- Sgeo has joined.
21:15:09 -!- jix_ has quit ("Bitte waehlen Sie eine Beerdigungnachricht").
21:33:16 -!- Asztal has quit ("Chatzilla 0.9.75 [IceWeasel 1.0.1b2] (kidding!)").
21:36:57 -!- GreaseMonkey has joined.
22:37:32 -!- Asztal has joined.
23:27:59 -!- tgwizard has quit (Remote closed the connection).
23:29:09 -!- sp3tt has quit (Remote closed the connection).
23:29:16 -!- sp3tt has joined.
23:52:13 -!- sp3tt has quit (Read error: 110 (Connection timed out)).
←2006-11-21 2006-11-22 2006-11-23→ ↑2006 ↑all