00:04:19 -!- CoffeeMaker has joined. 00:04:19 * CoffeeMaker is making a decaf espresso orange juice with an infinite number of sugars in a bathtub with a goat in it for this channel 00:04:24 * CoffeeMaker spills the channel's coffee into a Magnetic Laser Device 00:04:24 * CoffeeMaker gives everyone in this channel a magnetic decaf espresso orange juice with an infinite number of sugars in a bathtub with a goat in it which is emitting lots of blue light and a barely audible hum 00:04:27 -!- CoffeeMaker has left (?). 00:04:31 okay. 00:04:33 !!! 00:04:39 immibis: you did this. 00:04:47 Internet 00:08:14 faxlore: ? 00:09:38 re: CoffeeMaker 00:10:46 Behold: I have made lisp an esolang. 00:10:47 (def acc [{++ _}]) 00:10:57 Paul Graham would be proud of my, er, 'terseness'. 00:11:06 lol 00:11:41 (def acc [{++ _}]) -> (def acc (lambda (_) {++ _})) -> (def acc (lambda (_) (lambda a (apply ++ (cons _ a))) 00:11:57 ergo, acc is roughly: (def acc (lambda (n) (lambda (x) (++ n x)))) 00:12:05 :-O 00:12:12 {..} is partial application, and [...] a lambda with _ meaning 'the next argument' 00:12:42 [+ _ _] is a + that only takes two arguments ;) 00:12:47 couldn't you just add implicit lambdas + *currying*? 00:12:58 oklokok: 0-arg functions, var-arg functions 00:13:07 that's a minority. 00:13:10 0-args can be replaced with thunks, va-arg is more problematic 00:13:11 and no 00:13:15 va-args are very common in lisp land. 00:13:31 +infix... 00:13:39 just have [] currying then 00:13:41 *be 00:13:42 i mean 00:13:51 Hmm, I could possibly replace (def acc [{++ _}]) with (= acc [{++ _}]), but then i couldn't use = for setf like crazy-Arc does. 00:13:54 asdf. 00:13:59 and drop tose paranthesis 00:14:03 (def acc [{++ _}]) seems like the best blend of obfuscation and readability to me ;) 00:14:08 ;p 00:14:10 compare to the scheme: 00:14:11 (def acc [{++ _}]) 00:14:24 (define (acc n) (lambda (x) (set! n (+ n x)) n)) 00:14:32 or the Common Lisp: 00:14:43 (defun acc (n) (lambda (x) (incf n x))) 00:14:49 or even the Arc: 00:14:56 (def acc (n) [++ n _]) 00:16:57 ehird`: anyway, if non currying is common, why not have two separate function applications, [] and (), where the other curries, and the other one gives the args, and actually calls, currying is COOL 00:17:05 it's AWESOME i tells ya. 00:17:11 oklokok: that's basically what i have. 00:17:13 except it's {} 00:17:17 and [] is lambda shorthand. 00:18:09 right. 00:18:18 faxlore: my lisp is crazy because . can be the car of a list :D 00:18:21 except it's not exactly the same in the usage above 00:18:22 (. a b c ...) is compose 00:18:33 :O 00:20:52 (def id [_]) 00:21:04 it looks like a mini-DSL embedded that can embed the toplevel, heh 00:23:11 faxlore: show me something that uses a lot of currying, composition, etc. and looks kinda ugly/large in normal lisp 00:23:15 and i'll CONCISIFY IT :D 00:26:33 with multiple-value-bind use? 00:27:27 ah! 00:27:34 cartesian-product 00:27:56 variadic 00:27:58 faxlore: show me your definition, i'll show you your definition short. 00:28:17 (defun cartesian-product (&rest lists) 00:28:17 (if (endp lists) '(()) 00:28:17 (apply #'append 00:28:17 (mapcar #'(lambda (head) (mapcar #'(lambda (tail) (cons head tail)) 00:28:17 (apply #'cartesian-product (rest lists)))) 00:28:17 (first lists))))) 00:31:04 faxlore: okies, translation 00:31:36 faxlore: by the way, shall i memoize it? 00:31:43 as simple as changing 'def' to 'defmemo' :) 00:31:49 I HAVE IT IN MY NEW LANGUAGE CARTESIAN-LOL: IT'S THE C FUNCTION "C" 00:32:02 hahaha 00:32:02 i'll do some sleeping now -> 00:32:16 faxlore: endp == {eq ()}? 00:32:19 wait, no 00:32:23 {eq (())}? 00:32:25 eck, i dunno 00:32:26 :D 00:33:13 {≡∅} 00:33:21 faxlore: clarify endp and i'll translate it :P 00:33:49 endp = null? 00:34:09 okay 00:34:17 nilp, then 00:36:26 um faxlore 00:36:33 do you meant to discard the mapcar in the lambda? 00:36:33 ;) 00:36:37 i think you need to balance your parens 00:36:59 * Now talking on #'(lambda 00:37:05 oops 00:37:34 haha 00:37:44 i think put it in a pastebin once you clarify it ;) 00:39:10 CL-USER> (cartesian-product '(a x) '(1 2 3)) 00:39:11 ((A 1) (A 2) (A 3) (X 1) (X 2) (X 3)) 00:39:30 works for me... 00:39:49 ok, maybe i read wrong 00:39:57 ah i see. 00:40:34 http://rafb.net/p/2Lk59U92.txt 00:41:31 (cons head tail) becomes `(,h . ,t)? 00:42:41 faxlore: http://rafb.net/p/OGdGWT60.txt 00:42:52 and naw 00:42:56 far more concise than that :-) 00:43:10 while still havinga reasonable theoretical basis! 00:43:13 hooray for [] and {} 00:44:23 faxlore: if i wanted i could make it more concise. but this way it's readable 00:44:29 make it shortec :P 00:45:00 faxlore: why, it's readable, a lot less ugly than the CL and a lot shorter 00:45:00 :D 00:45:56 * faxlore personally think, not less ugly 00:46:16 in CL you have loads of non-functional mess with #' and weird stuff like (&rest ...) 00:46:19 and arcane names 00:46:48 oh, it is pesonal style 00:46:52 faxlore: however... for shortness... I shall get out my secret weapon: EXTRACT 00:47:02 extract is a pattern-matching let, thing. 00:47:23 (extract ((a . b) p) ...) is (let ((a (car p)) (b (cdr p))) ...) 00:47:26 and similar stuff 00:47:32 none of the #' is required 00:47:44 yeah well, comment on extract :P 00:47:55 i've always wanted pattern matching in scheme 00:48:09 oklokok: not quite scheme her, more like a blend of common lisp and scheme 00:48:12 more on the side of scheme though 00:48:15 indeed. 00:48:37 This is a good use of macros 00:48:39 that was a positive comment because of "comment on extract". 00:48:57 faxlore: yep EXTRACT is a macro 00:49:38 well 00:49:42 macro or special form 00:49:56 since an implementation might not want to go to the trouble of writing such a huge thing as a macro ;) 00:50:29 emacs with dvorak ;_; 00:50:31 faxlore: care to give me any other reducing-targets? :D 00:50:52 * faxlore goes to look 00:52:01 -!- Hypercaffeinated has joined. 00:52:02 * Hypercaffeinated is making a smack in a head with a full carton of milk for this channel 00:52:02 * Hypercaffeinated gives everyone in this channel a smack in a head with a full carton of milk 00:52:02 -!- Hypercaffeinated has left (?). 00:52:54 -!- Corun has quit ("This computer has gone to sleep"). 00:53:08 stop it immibis 00:53:16 ok 00:55:49 faxlore: ... :P 01:01:47 faxlore: ping 01:03:21 Excuse my typing so slow, dvorak in difficult 01:05:47 heh 01:05:57 paredit will help you in typing out a function ;) 01:06:22 Love paredit! 01:06:35 me too although it has its flaws 01:11:10 faxlore: obviously Concise Lisp will come with its own emacs-alike written in Concise Lisp ;) 01:12:46 AAA! 01:13:01 I can type faster on Dvorak than some people can at all. 01:14:44 (I wonder if a Dvorak wave is spreading across the Internet right now.) 01:15:45 you cannot get dvoraks anywhere 01:15:50 in here. 01:15:54 rearrange your keys. 01:16:03 faxlore: AAA what. 01:16:10 doesn't sounds like something i would do. 01:16:13 *sound 01:16:24 "emacs-alike written in Concise Lisp" 01:17:48 WHAT'S WRONG WITH THAT FAXLORE :( 01:18:24 MAD!!! 01:18:34 + good 01:19:45 :D 01:20:04 faxlore: every buffer can act as a listener 01:20:07 with a seperate namespace 01:20:25 so basically it's a REPL but with files and loads of refactoring stuff and a debugger built right in to the file itself and AAAAAAAAAAAAAAAAAAAAAAAA 01:21:04 hahah 01:22:06 faxlore: also you can modify the ENTIRE EDITOR in itself 01:22:15 in its whole, complete, entirity. 01:24:04 faxlore: PLEASE BE ASTONISHED. 01:24:27 AAAAA!!!!! 01:25:38 great 01:26:01 faxlore: For example. 01:26:23 where 'edit' is to be substituted for the editors name and thus package name: 01:28:08 faxlore: http://rafb.net/p/GL1Wpg49.txt 01:28:34 (in-package X) is 'global' and thus works basically like common lisp's in-package 01:28:42 but (in-package X FORMS...) is local to that form 01:28:49 :D 01:29:03 ergo: my definition is extremely pretty and elegant and shows how awesome both the language and editor will be 01:29:05 agree/disagree 01:29:35 -!- sebbu has quit ("@+"). 01:31:27 faxlore: http://rafb.net/p/tuLeKI45.txt overriding insert-brace (which will be bound to (, {, [, etc. by default) 01:31:44 ofc there'll probably be a more featureful equivilent by default, but hey, it's a good example. 01:32:14 Cool :D 01:33:03 faxlore: this thing started off esoteric but already i'm liking it more than scheme or common lisp :P 01:33:11 just looks nice. 01:33:30 hehe, hopes it works well 01:34:59 faxlore: i might add an implicit EXTRACT to parameter lists 01:35:09 (def revpair ((a . b)) (cons b a)) 01:36:07 faxlore: bit of a problem if you want to handle nil as well though 01:37:07 -!- faxlore has quit ("If there are any aliens, time travellers or espers here, come join me!"). 01:38:02 -!- faxlore has joined. 01:38:21 wb faxlore :P 01:38:36 * faxlore has trouble with a new keyboard layout.. 01:38:41 heh 01:39:11 faxlore: I think EXTRACT might become my LOOP: crazy big language embedded in Lisp 01:39:25 Yay! 01:39:30 LOOP is -awesome- 01:39:35 i hate you :P 01:39:44 I love LOOP and FORMAT... 01:40:08 A lot of people.. use iterate 01:40:12 but I think they missed some good things 01:40:23 (in the dark corners of loop) 01:40:26 (def silly (lst) (extract (((first rest... last)) lst)) (cons last (append rest (list first))))) 01:40:39 (silly '(1 2 3 4)) => (4 2 3 1) 01:40:49 (silly '(1)) => error 01:40:54 (silly '(1 2)) => (2 1) 01:41:07 (silly '(1 2 3 4 5 6)) => (6 2 3 4 5 1) 01:44:05 faxlore: Unfortunately extract is not turing-complete. Yet. :-) 01:50:51 faxlore: Pingify 01:52:23 faxlore: By the way, (def 1+ {+ 1}) actually defines as a function, as opposed to (= 1+ {+ 1}) or whatever.I haven't decided if there's any signifigance to this or even whether it will stay like that, though, because atm functions and variables share the namespace (i.e. Lisp-1) 01:53:22 * faxlore nod.. thats a hard choice 01:53:41 faxlore: I think it's more elegant since it resembles the Lambda-calculus more and allows for higher-order functions to be much more elegant 01:53:48 and I personally don't mind typing lst instead of list ;) 01:54:06 actually it'd be confusing to have a param named list anyway even in CL 01:54:31 faxlore: An interesting thing I have is the generic lookup function ! 01:54:42 (! lst i) -> lst element i, zero-based 01:54:51 (! ary i) -> array element i, also zero-based 01:54:59 (! ht "blah") -> hash table element "blah" 01:55:45 name borrowed from haskell's infix operator !, obviously 01:55:57 -!- immibis has left (?). 01:56:48 faxlore: COMMENT OR DIE! :P 01:57:38 * faxlore takes time! yd.f t.fo ap. bry ,d.p. yd.f odrgne x.! 01:57:58 hehe, i'll wait for your comments :P juist send em in one big message 01:59:29 I woiuld debate that Lisp-1/2 is orthogonal to ST Lambda-calculus axis 01:59:43 faxlore: sure, i guess, but hey. 02:00:45 generic lookup's great... Hopes it is extensible 02:01:19 faxlore: extensible in what way 02:02:13 -!- ihope has quit (Read error: 110 (Connection timed out)). 02:02:14 * faxlore defines a new type... wishing to use ! on it 02:03:55 oh of course. 02:04:03 i think all functions will be generic 02:04:24 and the (def func (args) ...) being shorthand for it 02:04:41 well, it would be shorthand for something which would be optimized away to be non-generic until new terms are added 02:04:53 faxlore: a generic setter would be nice too but i don't really like setf 02:05:00 (setf (car x) y) just doesn't rub well with me 02:05:02 however, 02:05:13 (setter-thing ht "blah" "xyzzy") does. 02:05:25 (setter-thing lst 1 'abc) too 02:05:40 can't think of a good name though 02:05:45 well, = might work.. 02:05:53 (= lst 3 "hello") 02:05:58 (= ht "xyzzy" "plugh") 02:06:01 hmm, i guess so.. 02:06:29 faxlore: the thing with lisp-1ness is that it goes hand in hand with [..] and {..} 02:06:41 You seem much more a schemer than lisper/CLer :p 02:06:53 you want to be able to construct one of those things and return them first-class 02:07:06 faxlore: i guess so though i do accept scheme has its flaws and CL has a lot of good things 02:07:11 faxlore: what specifically make syou say that? 02:08:03 Of course, they are both incredibly well designed 02:09:05 terniary =.... bad 02:09:08 I guess I like the idea of Scheme with extra practicality added more than Common Lisp's based-on-practicality-and-featureness 02:09:15 faxlore: yeah i'd agree with that = 02:09:34 haskell has no direct setter equiv to ! but that's because they're immutable 02:09:54 set! of course has scheme destructive-marker implications 02:10:03 !set is incredibly ugly ;) 02:10:07 Huh? 02:10:37 beause off not liking setf 02:10:54 oh, well setf just seemed a bit silly to me 02:11:09 Perl6 has it as well, I think 02:11:18 (defineable lvalues) 02:11:34 you can /kind of/ pretend to yourself that you're setting what a function will return... but it'll never be transparent, it'll always shine through and really it doesn't gain much in readability (and arguably impacts on it) 02:15:48 faxlore: i'm wondering whether i should just make it even crazier by adding a scheme-like (delay X) but with no force 02:15:54 it's implicit, like haskell's lazy evaluation 02:16:02 one way road to BUGS BUGS BUGS! :D 02:16:36 too strong haskell influence 02:16:49 faxlore: i know. but funny. 02:16:53 lav 02:17:12 faxlore: hmm, it occurs to me i've got something like CLOS built in but without the classes or objects ;) 02:17:14 lazy scoping? 02:17:37 that is, you can define structures and they become regular first-class types like 'pair' or 'integer' 02:17:43 and therefore generic functions can dispatch on them 02:17:45 have you read AMOP? 02:17:54 no MOP, obviously :) 02:19:31 -!- faxlore has quit ("If there are any aliens, time travellers or espers here, come join me!"). 02:20:44 -!- faxlore has joined. 02:21:12 faxlore: personally i say 'thank god' to the going of the MOP 02:21:17 but i'm biased, ofc ;) 02:21:34 however: 02:21:43 huh? "going of the MOP" 02:21:54 (type-of my-structure) => # 02:22:03 (type-of type-type) # 02:22:08 (last line: most confusing evar) 02:22:19 so, i guess you could extend type in some crazy way 02:22:22 and get a pseudo-mop 02:23:30 is that Type : Type I see! 02:23:41 something like that, yeah. 02:23:44 absurd! 02:23:49 heh 02:23:49 :P 02:23:49 why 02:23:51 :P 02:24:34 a type is-a type. 02:24:43 thus their type is also a type. 02:24:53 but their type is 'type', so (type-of type-type) => type-type 02:24:55 (girards paradox, if you take curry howard srs) 02:26:09 oh dear, paradoxes 02:26:14 but Smalltalk does it and Smalltalk isn't insane! :P 02:26:22 yeah, it's not relevant :P 02:26:36 damn you :P 02:26:39 just attempting Type theory puns when there is an opportunity.. 02:26:46 haha 02:27:06 hey I wrote a type and term inferrence thingyjigs in haskell for the simply types lambda cal 02:27:20 I think [{++ _}] might be the first 'does something non-trivial' function in Lisp with no parentheses 02:27:21 :P 02:28:47 Hmm, how to parse [{++ _}]... First I need to come up with a name for _-advances-to-next-param lambdas :P 02:29:08 {...} can be (apply-partial ...) 02:31:40 nameless-lambda i guess. 02:31:47 (nameless-lambda (apply-partial ++ _)) 02:31:50 Kind of ugly but eh. 02:32:05 nameless-lambda's definition will of course be epic :P 02:32:08 heheh nameless-lambda 02:32:54 Note: nameless-lambda is not the opposite of named-lambda. Unfortunately. 02:32:58 (Perl documentation reference!) 02:33:04 why not expand at parse time? 02:33:22 faxlore: because i'd have to do alpha-conversion of names 02:33:42 gensym!! 02:33:46 so (read) would become 2384972398479238472389472394 times more clever than it should be 02:33:48 faxlore: eh. 02:34:01 faxlore: i guess i just think read should be dumb 02:34:09 What if I want to read in a file with [...] and {...} in? 02:34:19 #;> (gensym) 02:34:19 |%%_LEKqa1Ql9| 02:34:22 OK, nameless-lambda and apply-partial would make the thing weird for names but you could do '{...} and '[...] 02:34:30 and i know what gensym is... what lisp impl is that? weird prompt 02:34:44 SISC 02:35:17 but that's Scheme! :P 02:35:24 I thought you were a lisper. :P 02:35:55 * faxlore still lot for language 02:36:06 lost* 02:36:18 faxlore: No you're not! Concise Lisp (which needs a name change)! :P 02:36:25 LOL 02:36:56 I like the name a bit 02:37:08 it's abbreviated to CL, that might be a problem :P 02:37:53 ahh true 02:40:50 Quote Lisp! 02:40:58 For the 'Lisp 02:41:00 err 02:41:12 For the (quote lisp) => lisp pun. 02:41:21 (i.e., 02:41:31 "Quote Lisp is THE ONLY Lisp!". lame i know) 02:43:15 faxlore: I hope to get a good string library in with it... it's time for lisp to stop denying strings as Holy Things :P 02:44:15 strings as lists > strings as vectors 02:44:30 faxlore: ... right up until when you start doing serious work with them 02:44:44 serious work??? 02:44:52 more than toy string manipulation programs. 02:45:00 faxlore: Oh yeah and you'll probably HATE this but lambda is being renamed to fn for exactly the same reasons that PG did it in Arc: lambda is a lot to type for something so commonly used (did Church write "lambda"? No! He wrote one symbol. Big difference.), so eh. 02:45:30 I deo hate that 02:45:52 call it lambda or λ 02:46:09 or ` or \ 02:46:34 faxlore: ` is quasiquote 02:46:38 fn disgusts :P 02:46:41 \ escapes stuff, etc 02:46:49 unicode is... not plausible for that ;) 02:46:54 fun is fine 02:46:58 eh suggest something else.. 02:47:03 lm? 02:47:05 ld? 02:47:28 (In ML.. Not lisps) 02:47:45 faxlore: as i say: suggest 02:47:46 ugh 02:47:50 reading PG's stuff on Arc: 02:47:51 - Polymorphism: (+ "foo" "bar") -> "foobar" 02:47:54 BAD WRONG NO. 02:48:08 + a commutative, whatever-the-word-is-for-ignoring-associativity operation 02:48:10 concatentation is NOT 02:48:53 Arc is not worth learning about... publicity stunt 02:49:03 yeah, i know 02:49:12 * faxlore think that's hypocritical nonsense. 02:49:13 but still... using + for that is evil 02:49:22 he uses = as something which does assignment 02:49:28 (unless that changed) 02:49:34 get yourself a concatentation operation and use that! 02:49:41 I hear we have one called 'append'... 02:52:25 faxlore: Oh yeah, and progn/begin is called 'do' 02:52:32 'progn' - uhh, sure... 02:52:35 'begin' - begin what? 02:52:40 'do' - do these things. 02:54:41 * faxlore lol at 'progn' comment 02:54:55 :) 02:55:09 'prog': To prod with prongs 02:55:16 'n': abbreviation of "and" 02:55:22 Prod with prongs, AND: ... 02:56:24 heh 02:56:49 faxlore: I don't really like letrec (seems like a bit of a kludge to me) but I want mutually recursive functions to be easy to define. Hmm, hmm, hmm. 02:57:06 How can you say that about LETREC!!!!? 02:57:40 faxlore: heh :) 02:57:45 Let's see you derive generalied applicative order Y combinators faster than you can type 'letrec' !! 02:58:11 meep 02:58:12 :-) 02:58:22 :D 02:58:27 This is Heretical Lisp i'm aware :D 02:58:49 Heck, I'm even adding quite a few loop constructs, probably... But they expand into tail-recursive functions so that's OK 02:58:51 * faxlore can tell.. it will have much to stir deamons 02:58:54 much power* 02:59:22 :D 03:02:28 faxlore: I think I'll have something like haskell 03:02:29 's maybe 03:02:34 except implicit Just 03:02:43 so you have a (nothing), which i might give a nicer name 03:02:51 note: NOT equivilent to 'unspecified' 03:02:57 it's a BadThing(TM) 03:03:07 (kang.o) 03:03:18 -_- 03:03:36 (values) ; :) 03:03:57 (values) is 'unspecified' 03:04:13 'def' should return 'unspecified'. (if #f blah) should return 'unspecified' 03:04:49 'something which is either: some values, or: fail/nothing' should use (fail) or (nothing) or whatever. 03:08:49 anyway 03:08:51 talk more tomorrow. 03:08:52 bye. 03:09:03 see ya 03:16:00 -!- Arrogant has joined. 03:51:40 -!- faxlore has left (?). 04:19:20 -!- Arrogant has quit ("Leaving"). 04:21:51 -!- Merthsoft has joined. 04:22:09 -!- Merthsoft has left (?). 05:21:41 -!- calamari has joined. 05:23:46 -!- slereah_ has joined. 05:24:48 -!- slereah__ has quit (Read error: 104 (Connection reset by peer)). 05:25:46 -!- RodgerTheGreat has quit. 05:31:49 -!- calamari has left (?). 05:39:35 -!- Figs has joined. 05:41:17 hello 05:44:44 Does anyone know why I get weird warnings (ex, "no newline at end of file") when I include a file from within a function in C? (It has an extra newline at the end of the file...) 05:44:57 I'm doing some weird stuff, so I figure it's better to ask here than in #C :) 05:45:10 I'm no C guy. 05:46:06 I'm actually starting to like C again after learning about __func__ 05:46:19 You're a lucky man 05:46:23 -!- slereah_ has changed nick to Slereah. 05:46:37 Nah, I'm a nut case, I think. 05:47:01 Doesn't mean you're not lucky! 05:47:06 :P 05:47:19 So what's going on here these days? 05:47:27 I haven't been around in a while... 05:48:44 Language creation, all that. 06:14:52 bbl maybe 06:14:54 -!- Figs has left (?). 06:58:09 [05:02] 'def' should return 'unspecified'. (if #f blah) should return 'unspecified' 06:58:10 [05:03] 'something which is either: some values, or: fail/nothing' should use (fail) or (nothing) or whatever. 06:58:27 * oklokok thinks it's awesome to define 'undefined' :D 07:59:59 -!- clog has quit (ended). 08:00:00 -!- clog has joined. 08:55:06 -!- GreaseMonkey has quit ("Hi Im a qit msg virus. Pls rplce ur old qit msg wit tis 1 & hlp me tk ovr th wrld of IRC. Man who run behind car get exhausted"). 09:08:36 hm, game of life is rather interesting, it is in a way multitasking 09:08:44 and turing complete 10:30:59 Maybe I should try creating one. 10:33:15 I'm sure it will be less dry than that 2,3 machine I'm trying to understand 10:38:14 I should really work on that N->ZxZ function. I run in that problem when I try to make some 2D language. 11:19:55 Is there a big bestiary for the Conway game of life? 11:25:45 -!- slereah_ has joined. 11:28:58 -!- sebbu has joined. 11:34:53 * slereah_ is thinking of some convoluted way to make an I/O game of life 11:52:21 -!- Slereah has quit (Read error: 110 (Connection timed out)). 12:28:16 -!- ihope_ has joined. 12:28:17 -!- ihope_ has changed nick to ihope. 13:05:11 -!- jix has joined. 13:49:36 -!- Asztal has joined. 14:32:13 -!- SimonRC has quit (Remote closed the connection). 14:32:17 -!- SimonRC has joined. 15:38:31 -!- oerjan has joined. 15:39:53 i love highlighting oerjan. 15:40:14 you don't say. 15:42:01 (oh, and yes, i could tell you the three monad laws if you don't know them yet.) 15:43:11 -!- slereah_ has changed nick to slereah__. 15:45:37 What's a good symbol for a game of live cell? 15:45:39 #? 15:45:46 *f 15:45:53 live or dead? 15:46:10 Live. 15:46:14 Dead will be space. 15:46:48 something a bit symmetric... 15:47:20 although * is tempting. 15:47:34 the blackes thing you can get your hands on 15:47:45 Racist. 15:47:52 some of the "graphics" chars would be a better choice, surely? 15:48:07 Well, so far it's ASCII's. 15:48:23 -!- jix has quit (Nick collision from services.). 15:48:24 And run on the Kubuntu shell, so the whole screen is black. 15:48:33 -!- jix has joined. 15:49:08 s/blackes/unspaciest/ 15:49:41 (that's almost unspeciesist) 15:49:46 That's why I thought of the # 15:49:58 It seems bulky enough 15:50:05 Although * is indeed tempting 15:50:12 what about actual ANSI color? 15:50:38 How do I do colors on the snake? 15:50:48 snake? 15:50:52 Python. 15:50:59 The penguin being Linux. 15:51:07 i assume it's a terminal thing 15:51:19 there was a wikipedia page 15:51:44 Exception handling makes me frown. 15:51:52 http://en.wikipedia.org/wiki/ANSI_escape_code 16:05:25 Aw hell. 16:05:38 do I need two grids for the game? 16:06:26 for game of life? 16:06:32 One to check the previous state and one to apply change to. 16:06:50 I fear what will happen otherwise 16:06:51 there is a way to do it with only a line of extra buffer 16:07:34 since you only need to look at the next and previous lines, you can discard older lines than that 16:08:03 Problem is, my grid isn't really a set of lines. 16:08:33 The square 123456789 is this : 16:08:34 on the other hand having two full grids may allow for more simultaneous updates i think 16:08:35 [[' ', ' ', '7', ' ', '4', ' ', '1', ' ', ' '], [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '], [' ', ' ', '8', ' ', '5', ' ', '2', ' ', ' '], [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '], [' ', ' ', '9', ' ', '6', ' ', '3', ' ', ' '], [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']] 16:09:16 um is this Conway's Game of Life or something slightly different? 16:09:22 It is. 16:09:41 But I recycled the Love Machine to have an infinite plane. 16:09:56 well as long as things are sorted by either x or y direction you still should be able to do things in one of those orders... 16:10:25 It's a list of list, both using a folding function to go in all directions 16:10:54 infinite in all directions? 16:10:58 Yes. 16:11:23 It's a simpler solution than finding a N-ZxZ mapping. 16:11:47 two-directionally infinite? 16:12:07 Well, I think. I haven't checked so far. 16:12:17 I'm still writing the checking-adjacent-cells 16:12:57 now this being python the list is not _actually_ infinite just potentially so, i assume 16:13:33 Well, I think most language don't allow infinite lists. 16:13:43 unless you are employing laziness somehow 16:14:19 But I'll use the same thing as the Love Machine 9000 - when there's moar cells required, in this case when a live cell appears at the edge, I'll just append some more cells around it 16:14:48 not a whole line of them... 16:15:08 gliders can be expensive that way 16:15:47 I'll start with a whole line, and see what I can do with it 16:16:13 ideally you want it to forget again regions where everything has died 16:16:15 Although it's actually a whole square, since it's all around the grid 16:17:06 -!- Corun has joined. 16:21:22 -!- ihope has quit ("ChatZilla 0.9.80 [Firefox 2.0.0.11/2007112718]"). 16:23:10 -!- timotiis has joined. 16:40:24 -!- RodgerTheGreat has joined. 16:44:49 so now that people are alive and stuff 16:44:56 accumulator generator: 16:45:01 (def acc [{++ _}]) 16:45:06 i challenge you to show me something shorter. 16:45:12 *ACK* *GARGLE* *THUMP* 16:45:18 oerjan: :D 16:45:38 oerjan: [...] is a lambda with _ meaning 'the next argument' 16:45:42 howdy, folks 16:45:44 [_ _] is (lambda (x y) (x y)) 16:45:49 {...} is currying 16:45:52 well 16:45:54 partial application. 16:46:34 i also have pattern matching :D 16:46:42 and cond and let lose most of their parens 16:46:47 (let (a 2 b 3) ...) 16:46:58 (cond (eq a b) "stuff" (eq b c) "blah") 16:47:03 it's Heretical Lisp! 16:48:05 -!- Corun has quit ("Haxsell!"). 16:48:25 oh yeah and i'm planning making be an error by default but definable 16:48:30 for basically one purpose 16:48:57
" 2 + 2 = " (+ 2 2)> 16:48:58 mwahahaha 16:56:42 yeah i'm crazy 16:58:20 reminds me slightly of markaby. 16:58:23 div.AAAAAH! { strong 'Evil HTML lisp sez'; text "2 + 2 = #{2+2}" } 16:58:44 markaby wasn't the first html generation tool you know 17:02:52 Asztal: did you read the stuff about [] and {} 17:03:01 if not, I challenge you: decipher (def acc [{++ _}])! 17:08:08 well.. you've already said what it was 17:08:18 am I supposed to decipher how it works? 17:08:37 eh, i guess, thouigh if you read that then it miught be easier 17:08:52 yeah, decipher how it works... ifyou know ruby give me ruby code that is 100% equiv. or something :P 17:08:57 its not that hard once you get the basic principles 17:10:50 -!- faxathisia has joined. 17:11:40 hello faxathisia 17:11:52 Hiya 17:16:53 faxathisia: my lisp is even more heretiacl now 17:16:57 (let (a 2 b 3) ...) 17:17:02 (cond (eq a b) "stuff" (eq b c) "blah") 17:17:14 to be fair mccarthy *did* say he thought he got cond wrong: too many parens 17:17:40 :o... I never heard that 17:17:45 yep 17:18:19 IMO let suffers from the same problem 17:18:36 the parens are simply not needed and make the code uglier 17:19:01 Oh 17:19:14 oh what 17:19:42 Y not just have all lets imlicitly letrecs 17:21:25 because, that's ridiculous. 17:21:56 > (letrec ((a a)) a) 17:22:02 -> some internal value 17:22:13 > (let ((a a)) a) 17:22:13 Error: unbound variable: a 17:22:17 (Chicken Scheme) 17:28:16 faxathisia: that's why 17:34:37 ehird`: actually, both of those are just like arc 17:34:48 I mean, your heresies 17:35:11 SimonRC: even if arc didn't do it, i would 17:35:21 it just happens to be a good idea outside of arc [which sucks[ 17:35:28 really, why? 17:35:33 have you used arc? 17:36:09 1. its mostly hype, not that much new 2. a lot of the new things are unneeded and: 3. impure and unclean, inelegant 17:36:38 it gains conciseness at the cost of readbility and purity. 17:37:54 also a bit of irony 17:38:00 they go on about how arc concentrates on web apps 17:38:09 and yet 17:38:10 "We're trying to make something for the long term in Arc, something that will be useful to people in, say, 100 years. (If that sounds crazy, remember that we're already up to 40.) " 17:38:24 i guess web apps will still be The Hot Thing in 100 years. 17:39:21 By then, the web will be nothing but robot porn. 17:40:25 -!- tesseracter has joined. 17:40:35 if it's even still in much use 17:40:41 it may be reduced to usenet-like status 17:42:11 It will be like in "Beneath a steel sky", nothing but cheap abstract 3D shapes and epic battles for datas! 17:42:16 SimonRC: I personally think my lisp is nicer-looking, has the possibility to be much more concise, and is just plain better 17:42:31 slereah__: we'll be in 4d by then. (Great game, btw.) 17:42:52 wha? someone say something about 4D? 17:43:01 haha 17:43:03 good timing. 17:43:13 EX-TER-MI-NA-TION! 17:43:27 (which game) 17:43:33 The ending was a little disappointing though 17:43:38 Beneath a steel sky 17:44:07 Where a man named after a beer brand battles the evil empire 17:44:09 never got to the end 17:44:11 heh. 17:44:20 That game rules! 17:45:28 -!- slereah__ has changed nick to Slereah. 17:45:33 My game of life is currently a GAME OF DEATH :O 17:45:42 faxathisia: there's such a hive mind in #esoteric 17:46:04 I hate it when there's too much exceptions and list index. 17:46:05 the majority of the time we just agree with each other ;) 18:04:33 So far it works for all 4-cell combinaison! 18:06:43 *** transform thusly, is it okay? http://membres.lycos.fr/bewulf/Russell/Life.png 18:08:01 Hm. Doesn't seem to be. 18:08:17 It's supposed to rotate or something apparently 18:10:10 Seems to think that the three cells got 2, 4 and 2 neighbours. 18:10:12 Damn. 18:16:07 i want to write a noding system like everything2, except esoteric somehow 18:20:26 -!- ais523 has joined. 18:20:39 morethaneverything? 18:20:44 haha 18:20:49 i mean, technology wise 18:21:24 (although morethaneverything would not be a bad idea, it seems: see http://qntm.org/?e2code, telling of the horrible mess that apparently is the e2 code... all changes made live with no backup! yeek!) 18:26:04 "And, actually, the more you can avoid programming in C the more productive you will be." 18:26:05 Heh. 18:26:18 depends on what you're writing 18:26:55 I guess so. 18:27:18 Maybe I should write the Love Machine 9000 on something efficient one day 18:27:29 But well. 18:29:06 did you ever see Perligata? 18:29:34 No. 18:29:50 it's basically an esoteric syntax for Perl based on Latin 18:30:11 which shares the same property that it's usually possible to reorder the words in a statement and the new statement has the same meaning 18:31:53 grr... I've been given a program to run which does something easily achievable by standard Unix tools 18:32:00 but it's trying to sort a linked list using bubble sort 18:32:10 which on the size of the data set I'm using is taking a while 18:32:49 lol 18:33:02 * SimonRC recommends merge sort for linked lists 18:33:08 rewrite it in brainfuck. then you can say, "I rewrote the program in Brainfuck and it got 3 times faster." Maybe. 18:33:17 so I've set it running and I'm racing it to try to beet it with a command line tool 18:33:21 while typing on IRC at the same time 18:33:23 It is O(n lg n), unlike quicksort on arrays 18:35:06 beat it easily 18:35:21 resulting commandline? 18:35:41 * ais523 tries to figure out how to copy-paste it 18:35:51 select, middle-click? 18:36:16 tr ' ' '(newline)' < (filename) | sed -e 's/^[^a-zA-Z0-9]+//; s/[^a-zA-Z0-9]+$//;' | sort | uniq -c | sort > (filename) 18:36:27 it took a while because I was trying to deal with the newline 18:36:37 ok 18:36:42 \n would have worked, I think 18:36:48 on tcsh? 18:36:58 ew 18:37:00 csh 18:37:09 it's the default on this server 18:37:14 what does it do? 18:37:27 counts the frequencies of words in a file 18:37:37 but with an unusual definition of word, hence the sedery 18:38:12 oh, the original's finished now 18:38:21 SimonRC: "tcsh"/"it's the default on this server"/"what does it do?" 18:38:22 suck. 18:38:23 :) 18:38:32 and sometimes run programs too, apparently 18:38:54 it's sort of like a version of sh modified to be 'user-friendly' 18:39:09 so you can't do any more than a small number of redirections 18:39:20 and you have to rm a file before you can pipe output to it, unless you're appending 18:39:25 i know what csh is 18:39:30 its not a sh derivative, much. 18:39:38 sorry, when I said that the original program had ended, I was wrong 18:39:39 it is basically a u seless toy 18:39:50 sort | uniq is often wrong. check out sort -u 18:39:57 scratch that, it had ended after all 18:39:57 ais523: you are an INTERCAL programmer, right? 18:40:06 SimonRC: I was using uniq for the line count 18:40:10 ehird`: yes 18:40:20 I'm the current C-INTERCAL upstream maintainer 18:40:21 ais523: how feasable would you say an INTERCAL self-compiler would be? :-) 18:40:22 ah, ok 18:40:39 ehird`: it depends on definition and which language extensions you allow 18:40:53 the CLC-INTERCAL compiler is written in a set of extensions that are added to the language itself 18:40:58 so it is a self-compiler, in some sense 18:41:09 ais523: hm, definition being something basically like C-INTERCAL. But written in INTERCAL, of course... well, it could compile to anything 'real' (C, native code, asm, ...) 18:41:18 even though the commands used to write the compiler are entirely disjoint from the ones used to write programs 18:41:20 language extensions: I guess C-INTERCAL, since it's the most common afaik 18:41:35 C-INTERCAL: 33 users. CLC-INTERCAL: 5 users. 18:41:42 C-INTERCAL: 33 users. CLC-INTERCAL: 21 users, sorry 18:41:44 popular stuff ;) 18:41:47 self-compiling INTERCAL would instantly wreck the passtime of proposing new INTERCAL extensions 18:41:50 source: Debian popularity contest 18:41:57 SimonRC: why? 18:42:06 C-INTERCAL is incompatible with CLC-INTERCAL, right? 18:42:09 because people CBA to implement them 18:42:12 the same source says that 5 people actually use C-INTERCAL and 3 people use CLC-INTERCAL every now and then 18:42:14 i have seen 2 clc-intercal only programs, though, so... 18:42:25 they are not completely incompatible, especially in the most recent versions 18:42:36 but it is possible to write C-INTERCAL or CLC-INTERCAL-only programs 18:42:43 by using language features that are in one but not the other 18:42:53 ais523: are there any overlapping features? 18:42:58 lots 18:42:59 i'd say: most likely. 18:43:05 and duplication of that sort is, yeah. 18:43:07 computed COME FROM, basic operand overloading, etc. 18:43:16 ais523: which would you say would be best as a 'pseudo standard'? 18:43:25 see the C-INTERCAL documentation at intercal.freeshell.org 18:43:33 it lists portability for all the constructs in C-INTERCAL 18:43:49 the pseudo standard is likely just INTERCAL-72 + noncomputed COME FROM 18:43:58 because most of the other features only exist in C- and CLC-INTERCAL 18:44:05 not J-INTERCAL 18:44:07 * SimonRC likes the enabling and disabling of statements for communication of parallel processes 18:44:15 ais523: what fun 18:44:32 I though COME FROM was in '72 18:44:35 I spent ages writing that documentation, so it would be satisfying for me if lots of people read it 18:44:47 SimonRC: no it wasn't, although as far as I could tell it was also invented in 1972 18:44:52 it just wasn't added to INTERCAL until later 18:44:55 ais523: ok, to start with: a self-compiling, no-extensions INTERCAL compiler 18:45:04 that compiles to C, asm, native code, or some other similar 'real' target language. 18:45:12 feasability= 18:45:23 without extensions a machine-translation from something like Brainfuck might be the best bet 18:45:34 ehird`: binary output is an extension :D 18:45:37 hmm, that was the kind of thing i was saying against, ais523 18:45:41 oerjan: OK fine with that :P 18:45:55 it wouldn't be too bad trying to do it directly, though, apart from the expression syntax and the fact that you have to allow character I/O somehow 18:46:11 C-intercal presumably has a char IO extension 18:46:13 so i'd say that 18:46:25 wait, ESR maintained C-intercal at one point, didn't he? 18:46:28 character I/O is different in C-INTERCAL and CLC-INTERCAL, but both have command-line switches to use the other's semantics 18:46:29 OK, CLC-Intercal! :P 18:46:32 ehird`: yes 18:46:39 it was C-INTERCAL 18:46:46 yes, that's what i meant 18:46:58 => OK, let's take the char I/O for CLC-Intercal then ;) 18:47:09 Baudot is a pain to deal with 18:47:15 but I think that was the point 18:47:24 also, you have to know in advance how long the lines can be 18:47:32 bad dots? 18:47:39 or would that be braille 18:47:46 ais523: suggest a solution that fits neatly with my dislike of ESR and my dislike of THAT! 18:48:07 ;) 18:48:21 well, you could use one of CLC-INTERCAL's multithreading extensions to trap the error 18:48:30 haha wow, that's evil 18:48:36 I'm planning to implement much the same error-trapping method in C-INTERCAL at some point, by the way 18:48:56 the way it works is that there's a variable * that holds the most recent error 18:49:09 but an error kills the thread, so you have to receive it in some different thread 18:49:22 but reading from * when there hasn't been an error causes an error, so to trap the error you need three threads 18:49:33 ais523: OK, assuming C-INTERCAL binary IO etc extensions, feasability= 18:49:40 (it must be able to compile itself still, obviously) 18:49:43 one which contains the error you're trying to trap, one that errors out instantly to put a value in *, and one that does the trapping 18:49:51 not all the cintercal extensions presumably though 18:49:54 feasability=reasonable but a lot of work 18:49:58 mostly due to the expression syntax 18:50:28 incidentally, I recently discovered an easy way for an INTERCAL program to tell which interpreter it's running under 18:50:50 how? 18:50:54 IGNORE a variable, STASH it, change its value, RETRIEVE it, save that value, then change the variable to a new value to test if it's read only 18:51:26 J-INTERCAL ignores the read-only flag on STASH or RETRIEVE, so the value STASHED is viewed twice 18:52:21 sorry, I meant STASH a variable, change its value, IGNORE it, RETRIEVE it, save that value, then change the variable to a new value to test if it's read only 18:52:30 so J-INTERCAL reads out the original value twice 18:52:37 C-INTERCAL reads out the new value twice 18:52:47 and CLC? 18:52:58 and CLC-INTERCAL reads out the new value, but the non-IGNOREd status is stashed along with the variable, so you get two different answers 18:53:14 ooooh, there's a unlambda-in-intercal... 18:53:15 what about... 18:53:18 INTERCAL IN UNLAMBDA 18:53:19 :D 18:53:37 I can't think of a decent way to write an expression parser in that either 18:53:45 there are some crazy corner cases 18:54:04 one of which is specifically disallowed both by the INTERCAL-72 and C-INTERCAL documentation because it's such a pain to parse 18:54:15 and therefore can be said to not be legal INTERCAL 18:54:27 which case is that? 18:54:53 .1 <- ,3SUB",2SUB.1".2~.3"".4 18:55:02 ... nested quotes. 18:55:04 y/n 18:55:20 to be precise, nested quotes interacting with nested multidimensional arrays 18:55:35 it has nested quotes even without N>1-d arrays? 18:55:36 the problem is that .1 <- ,3SUB",2SUB.1".2 is a legal statement 18:55:37 bizzare 18:55:53 but the second set of ears have a different meaning in the two statements 18:56:07 and there could be any number of characters that need to be read before it could determine which is which 18:56:36 come to think of it, .1 <- ,3SUB",2SUB.1".2~.3".5".4 is truly ambiguous 18:56:48 but as it's not fully grouped with sparks and ears, it's illegal anyway 18:57:09 hmm: 18:57:21 when arrays aren't involved, it's possible to tell a begin quote from an end quote by checking which side of it the operator is on 18:57:36 but the multidimensional array syntax looks like DO .1 <- .3SUB#4#5#6#7 18:58:00 no operators that might work to disambiguate 18:58:15 my abstraction eliminator will be interesting... 18:58:15 ``skk -> (\z. kz(kz)) -> (\z. z) 19:06:45 I had an interesting Underload optimiser, before I deleted it by mistake 19:06:49 but it would be easy to recreate 19:07:06 if you translated sii from Unlambda to Underload using the translations on the wiki 19:07:15 it came out with (^:)^: 19:07:23 sorry, ```sii``sii 19:07:30 transformed to (^:)^: 19:15:50 the idea is that in most cases it doesn't matter whether evaluation is lazy or eager 19:16:29 and so you can partially evaluate code before it gets duplicated later 19:16:36 as long as you don't run S commands by mistake 19:25:26 ais523: by the way, my underload to C compiler is broken. i've started a rewrite, but eh 19:25:33 theoretically, its OK though, just a bug :-) 19:25:43 in what way does the bug manifest? 19:26:00 i'm not entirely sure... take a look at the fibonacci program output 19:26:32 */*/**/*************(enough *s to break my terminal's display procedures...)SEGFAULT 19:26:57 I wonder what goes wrong to cause that to happen? 19:27:09 maybe a problem with *, or :? 19:27:39 yeah i'm not sure 19:27:57 originally dup was just pushing the same object instead of copying. but i fixed that, and it still happens 19:28:44 could you paste the generated C somewhere so I could take a look? 19:34:35 ok.. it's highly ugly, written-quickly crap though 19:35:34 http://rafb.net/p/dXRULi17.html 19:36:19 the non-prewritten stuff starts at: 19:36:22 void ul_func_0(void); 19:36:27 and ends at 19:36:30 int main(void) { 19:38:15 ais523: side note: * can be made efficient in that by adding: 19:38:19 struct _ul_obj *last; 19:38:21 to ul_obj 19:38:32 and then going straight ot that in * and updating it 19:38:41 * ais523 is looking at the code right now 19:40:09 the problem is that a : command isn't duplicating inner or cdr 19:40:24 (it doesn't duplicate str either, but that isn't needed because the strings never change) 19:40:50 to work properly you'd need to recursively duplicate TOS, not just its car 19:42:33 I shall fix 19:45:31 ais523: I can get rid of cdr, and jus thave last 19:45:37 since you can't do anything with them 19:45:38 they're immutable 19:45:39 right? 19:45:58 oh, no 19:46:01 ul_call needs it ofc 19:46:05 without cdr you couldn't eval or print 19:46:17 yeah 19:46:22 ok, : will be slow 19:46:33 since it needs to copy all cdrs, right? 19:46:38 I think so 19:46:48 but a copy that isn't O(n) is impossible to achieve in general anyway 19:47:29 unless copy-on-write semantics work, and they don't because of the possiblity of code like :(a)*~(b)* 19:47:52 at least, copy-on-write wouldn't prevent the copy for ever so it wouldn't speed up the program 19:49:34 */*/**/***zsh: segmentation fault ./blah 19:50:08 * ehird` pastes 19:50:11 htf does it segfault? 19:50:19 SimonRC: intelligently. 19:50:25 huh? 19:50:37 :D 19:50:41 okies: 19:50:42 http://rafb.net/p/Wh5hpI14.html 19:50:49 probably have a dumb obvious error in ul_copy 19:52:50 well, the return statement is obviously in the wrong place, but I don't see why that would affect the code because you never use the return value 19:53:02 ais523: yes i do 19:53:05 * SimonRC goes (food, bed, etc) 19:53:09 it->last = ul_copy(src->cdr, &it->cdr); 19:53:10 no, you do use the return value; that's why you get the segfault 19:53:20 it returns the 'end' object 19:53:23 i.e. that which ->cdr = null 19:53:31 only if !src->cdr 19:53:39 because you put it inside the else part of that if by mistake 19:53:39 um yes 19:53:42 rather than after the if 19:53:42 no 19:53:44 that's on purpose... 19:53:51 read the code 19:53:53 why? 19:53:54 I assign to ->last 19:54:02 which wants to be the object without a cdr, because its' the object at the end 19:54:07 which is why i return when ->cdr == NULL 19:54:26 well, returning garbage is normally bad form which gcc will warn you about 19:54:33 it isn't garbage 19:54:34 it retusn it 19:54:37 not it->cdr 19:55:01 the function returns garbage if it doesn't reach a return statement 19:55:04 like all functions in C do 19:55:33 * oerjan senses a d'oh approaching soon... 19:55:38 D'oh! 19:55:40 say you have a list of three elements 19:55:55 then last is set on the second element of the list not the first 19:56:12 so if cdr isn't null, you want to return its last as the function's return value 19:56:24 if (src->cdr) { return (it->last = ul_copy(src->cdr, &it->cdr)); } 19:56:26 looks right to me 19:56:32 i did that before you said that heh 19:56:34 and besides, shouldn't the last for a one-element list point to itself? 19:56:41 hmm 19:56:43 otherwise you could never append to it 19:56:44 recursive structures + c scares me 19:56:46 and yeah, i can 19:56:49 i check for null in append 19:56:53 and set that, and cdr 19:57:11 wait 19:57:13 you're right 19:57:13 OK 19:57:49 with those two corrections, hopefully it should work 19:58:23 % ./blah 19:58:24 *zsh: bus error ./blah 19:58:30 probably a trivial bug. 19:58:43 its in ul_concat() sez gdb 19:58:55 so likely last being wrong, in that case 19:59:03 tmp = ul_pop(); tmp2 = ul_stack->top; tmp2->last->cdr = tmp; tmp2->last = tmp->last; 19:59:07 the bulk of ul_concat() ^^^ 19:59:12 yeah, most likely 19:59:17 time to search for ->last uses 19:59:27 * ais523 has had similar problems trying to deal with the C-INTERCAL multithreader 19:59:32 which uses similar sorts of lists 19:59:37 btw 19:59:49 if (src->cdr) { return (it->last = ul_copy(src->cdr, &it->cdr)); } else { it->last = it; it->cdr = NULL; return it; } 19:59:51 that's the new code 19:59:56 hmm, wait 19:59:57 i never set cdr 20:00:05 wait 20:00:06 Yes I Do. 20:00:37 86tmp2->last->cdr = tmp; 20:00:39 that's the dying line 20:00:40 not suprising 20:00:50 (gdb) p tmp2->last 20:00:50 $2 = (struct _ul_obj *) 0x0 20:01:08 oh 20:01:08 duh 20:01:11 it's an 'inner'-val 20:01:19 which i dont set ->last on, oops 20:01:45 I was about to say the same thing: line 26 in ul_push sets ->last to NULL rather than self 20:01:53 no 20:01:53 not that 20:01:56 that's fixed by now 20:01:57 but ul_wrap. 20:01:59 because you special-cased taht 20:02:09 ais523: the fib program runs crazy fast 20:02:20 is it working now? 20:02:38 the horiz scrollbar on my terminal goes to the smallest it can as soon as the program starts 20:03:07 you could pipe it through head, I suppose 20:03:14 ais523: just saying, it's that fast 20:03:18 ais523: also head works on lines :P 20:03:27 ais523: oh yeah, and this is with just "gcc blah.c -o blah" 20:03:29 no optimization 20:03:29 head has an option to work on chars instead 20:03:36 and I'm not surprised by the speed 20:03:48 compiled with -O2 now, i'm going to pipe it to a file for approx 10 secs then wc -c it 20:04:01 shit. 20:04:02 zsh: segmentation fault ./blah > fibs 20:04:02 * ais523 will have to make another try to write the Unlambda -> Underload compiler 20:04:16 out of memory or out of stack, maybe? 20:04:24 stack. 20:04:27 i just realised... 20:04:32 most likely out of stack with recursive calling on a ridiculously long list 20:04:32 ul_call is tail-recursive. 20:04:33 but ->fp 20:04:35 can call ul_call 20:04:36 etc 20:04:43 and no, ul_call uses goto for ->cdr 20:04:51 afaics there is no solution... 20:04:57 you NEED to retain the stack 20:05:00 I think it's more that ul_copy is unlikely to be tail-recursed by a C compiler 20:05:01 because it contains useful stuff. 20:05:14 ais523: ul_copy can't be tail-recursive 20:05:19 anyway 20:05:21 one way to settle this 20:05:22 GDB! 20:05:26 oh, of course 20:05:41 but the same code might be possible to write with a while loop if you made two passes 20:05:48 ais523: i guess 20:05:52 not nearly as fast though... 20:05:56 woah 20:05:57 ais523: 20:05:59 it was ul_copy 20:06:01 recursing for inner, because that grows slower than cdr 20:06:08 i just typed 'bt' and for many seconds i've been getting ul_copy stack frames 20:06:11 and using iteration for cdr 20:06:15 over and over and over and over and over and over and over.............. 20:06:23 ais523: can i make both iterative? 20:06:32 over 40000 so far 20:06:33 sheesh 20:06:40 50000 20:06:45 there's probably some way, but I can't figure it out in my head in a few minutes 20:07:05 and it would be inefficient without an uncdr link that pointed the other way 20:07:11 no it wouldn't 20:07:20 you could iterate once setting cdrs and finding out last 20:07:27 and then iterate a second time setting last all along the list 20:07:43 in fact, last doesn't matter except at the start of the list, so you'd only have to set it there 20:08:02 doing inner recursively would be harder 20:08:39 ais523: 130998 frames of ul_copy 20:08:42 i think whatever it takse i need iterative 20:09:03 ais523: so if you think of a way to do both without recursing... 20:09:14 also ul_call without recursing would be nice... wait... i guess i could do TCO 20:09:20 ais523: are there many tail calls in unlambda? 20:09:34 and are they very literal: last command in (...) is ^? 20:09:35 ```sii``sii is tail recursive 20:09:42 i mean in real programs liek the fibonacci 20:09:45 and most loops work with the same principle 20:09:49 and ^ is always the last command 20:09:50 EXTEREME TAIL RECURSION 20:09:54 or almost always 20:10:03 err 20:10:05 UNDERLOAD 20:10:06 UNDERLOAD 20:10:21 I write loops with (blah):^ normally 20:10:25 and such loops are tail recursive 20:10:35 ais523: ((hi)S):^S 20:10:38 produces: 20:10:40 hi(hi)S 20:10:52 even fib has non-tail-call 20:10:53 two of them 20:10:54 (()(*))(~:^:S*a~^a~!~*~:(/)S^):^ 20:11:09 because the ^ is often used for non-looping purposes 20:11:20 ais523: if i just keep my own stack, it'll be little more efficient than a good interp 20:11:21 right? 20:11:24 there it's used to split the top stack element from ((abc)(def)) to two elements (abc) and (def) 20:11:35 and keeping your own stack is likely to be the only option in some cases 20:11:45 because the original program may not be written in a tail-recursive way 20:11:48 but it won't even be fast 20:12:00 of course, when the original programmer runs out of stack space, you can then blame it on them 20:12:03 it'll be about as good as a c interpreter.. 20:12:22 I think it's possible without maintaining your own function stack in most cases 20:13:16 ais523: but don't you agree about the speed thiing? 20:13:25 speed is important 20:13:28 exactly 20:13:39 and I think ul_eval will run out of stack long after ul_copy does 20:13:43 keeping my own stack will be bsically the same speed as a c interp 20:13:50 OK then 20:13:52 and its ul_call 20:13:56 no eval happens! :) 20:14:33 if you have a pointer to the cdr of whatever you're calling, then you can append it to the thing you call rather than its original location and make ul_call tail-recursive that way 20:14:39 I think, it's a little hard to work out the details 20:15:05 append will just set cdr though 20:15:28 but you can't append to a program while it's running, so the problem never comes up 20:15:32 I think 20:15:48 i don't really understand 20:15:56 anyway, there's a problem ais523 20:16:01 what? 20:16:06 if i want to optimize tailcalls 20:16:09 i need to either: 20:16:11 1. do stack smashing 20:16:17 2. use goto labels and keep my own stack for non-tailcalls 20:16:19 neither is feasable 20:16:23 setjmp! 20:16:24 don't you love C for not having tailcalls? 20:16:30 sorry, I'm too much of a fan of setjmp 20:16:35 setjmp won't work for it 20:16:53 actually, the usual way to tail-recurse in C is to goto the start of the function rather than calling it 20:17:02 after setting all the args to the right values 20:17:17 so instead of return myself(a1,b1,c1); 20:17:25 ais523: tail calls don't have to be to the same functions 20:17:27 that's TAIL RECURSION 20:17:30 you do a=a1; b=b1; c=c1; goto myself_top 20:17:42 I was giving a description of tail-recursion 20:17:45 general tail-calls are harder 20:17:51 i have an idea, actually 20:17:58 have one dispatcher function, underload() 20:18:01 have it like this: 20:18:24 ok, il'l take an example program 20:18:27 (:^):^ 20:18:29 that's: 20:18:31 in underload(): 20:19:09 push(f1, ":^"); dup(); discard(); goto f1; 20:19:20 err 20:19:21 wait no 20:19:23 it's like this: 20:19:39 wait, wait 20:19:42 i'llw rite it in a file 20:19:43 then paste it. 20:20:05 my earlier idea for preventing recursive stack usage in ul_call was to check if fp was ul_call in the o->fp(); line; if it was, instead of calling ul_call, you append o->cdr to the end of TOS, and then set o to TOS, after popping the TOS 20:20:33 so that the return address is saved by the cdr pointer on the end of TOS, rather than on C's stack 20:20:37 it should be just as fast, or faster 20:22:37 ais523: http://rafb.net/p/VwMkyk23.html 20:22:52 and, for normal calls, you can just do basically underload(tmp->label) 20:22:58 clever/not clever? 20:23:55 that's the same technique C-INTERCAL uses, pretty much 20:24:04 except that it maintains its own stack for normal calls 20:24:16 MINE IS BETTER! It uses the highly efficient C stack. 20:24:19 :D 20:24:26 although I'm planning to make it use the real C stack for all calls at some point in the future 20:24:40 so you can intersperse code that wasn't compiled from INTERCAL 20:24:51 anyway, I should have gone half an hour ago 20:25:09 aww, bye then :) 20:25:10 but I'll see if I can work out non-stack-gobbling versions of your C utility functions when I'm at home 20:25:21 OK 20:25:22 bye :) 20:25:23 unless I have to do something else... 20:25:26 -!- ais523 has quit ("bye"). 20:37:22 -!- RedDak has joined. 20:38:27 so now my Underload (...)s are no longer functions 20:38:29 what should i call them? 20:38:31 subprograms? 20:40:58 blimps 20:41:06 oerjan: i like it 20:41:55 oerjan: it's a good thing gcc can optimizes heavily. 20:41:58 *optimize 20:42:05 it'll make these programs Really Damn Fast(TM) 20:42:19 probably better than if i compiled them to machine code 20:47:15 oerjan: still, it'll always get slower over time 20:47:26 eventually taking years to perform one duplication. 20:47:44 unlike, say, an interp, where you can easily just concat the code and it's constant 21:32:59 what should i call them? 21:33:07 Depends on what they actually /do/ if they're not functions :P 21:33:36 ((ab)cd)ef 21:33:38 gets unrolled. 21:33:52 i.e. the nesting is removed and each was previously made into a function but now they're made into "case"s in switches 21:33:57 they're called 'blimps' now. 21:40:59 GregorR: my new compiler appears to work, apart from output with stuff wrapped by a 21:41:18 and, of course, dup is still recursive and could die without warning 21:42:09 it produces neatly indented C and you can either have checks & nice error messages, or no checks and no error messages and SPEED 21:42:41 oh dear 21:42:45 i can has memleak in (:^):^? 21:42:54 need more free()ing in the prelude methinks 21:43:18 hm, no 21:43:20 nothing i can do 21:43:22 its perfect 21:45:44 -!- jix has quit ("CommandQ"). 21:46:05 ok, output works now 21:46:26 and it even does TCO! 21:47:57 actually, TCO of underload is trivial 21:48:07 since it'll ALWAYS be the last instruction in your () or program 21:48:20 Shit % ./quine 21:48:20 zsh: segmentation fault ./quine 21:48:30 err 21:48:32 actually a factorial 21:48:34 but i call it quine :P 21:48:42 o_O 21:48:55 oerjan: "runscheme unlambda.scm > quine.c" in history... 21:49:04 ah crap 21:49:18 another lovely mutuually-recursive functions 21:49:23 overloading the c stack 21:49:37 umm 21:49:42 over 85000 21:49:45 90000 21:49:47 stack frames.. 21:49:50 :| 21:50:16 Do I have a bug or does the factorial prog really curse tat much 21:50:37 * ehird` runs it in the JS interp and sees 21:50:43 well, there was an awful lot.. 21:51:24 Yep, most definately. 21:51:29 A bug. 21:51:46 oerjan: My C is indented now. You must read it! :P 21:52:05 * oerjan runs away screaming 21:53:31 oerjan: http://rafb.net/p/ubHcrP65.html Have fun! 21:53:39 :D 21:54:06 there should be a trivial infinite loop, actually... 21:54:14 it's 1 and 5 21:54:19 they call each other until the stack runs out 21:54:28 Wait, WTF? 21:54:32 How can that happen? 21:54:59 oh 21:55:01 0 and 5. 21:55:11 Weird, how can 5 call 0? 21:55:44 why is 6 afraid of 8? 21:55:49 er wait 21:55:55 of 7 21:56:12 groan 21:56:23 but seriously: 0 is the main program, and is never pushed to the stack 21:56:27 how does 5 call it? 21:58:09 oerjan: DOEST THOU KNOWEST? 21:58:17 oh duh 21:58:26 i totally don't handle one thing properly 21:58:27 cdr. 21:58:30 or inner. 22:01:04 -!- GreaseMonkey has joined. 22:03:00 yikes 22:03:05 i'll be inlining a lot of code with CALL 22:17:57 anyone know if 5a636f6c is some kind of magic number? 22:19:29 hmm 22:19:35 anyone alive? GregorR? oerjan? 22:19:39 oklokok? 22:19:59 could you run this: http://rafb.net/p/cpVqur31.html (just "gcc blah.c -o blah") and tell me if it segfaults or what? 22:20:05 and if it segfaults, the last number it prints out 22:22:39 anyone?! :P 22:22:41 GreaseMonkey?! 22:22:47 pikhq? 22:22:51 Slereah? 22:23:52 ehird`? 22:23:53 -!- RedDak has quit ("I'm quitting... Bye all"). 22:24:09 GreaseMonkey: see my previous message 22:24:15 just before "and if it segfaults," 22:25:27 No? 22:25:38 pikhq: No what 22:25:57 doesn't segfault here 22:26:19 ok 22:26:28 can you both copy the output, all of it, and paste that somewhere? 22:26:30 very curious.. 22:28:24 http://rafb.net/p/t6PgUx72.html 22:29:13 6044d0 22:29:21 No segfault. 22:29:36 ok, i run linux, i'm assuming pikhq runs windows 22:29:44 you can tell by the pointers 22:29:53 x86_64-pc-linux-gnu 22:29:58 wtf? 22:30:21 GreaseMonkey: hmm, but no actual output apart from that? 22:30:32 nope 22:30:39 no factorial output even? 22:30:40 hm 22:30:42 can you do: 22:30:45 compile it with -g 22:30:48 gdb it 22:30:51 start; cont 22:30:52 bt 22:30:57 and give me the first few lines of backtrace? 22:31:04 same output with g 22:31:12 actually, just a mo 22:31:24 -!- oerjan has quit ("Good night"). 22:32:42 #0 _copy (src=0x804b008, dest=0xbfa170d4) at poop.c:65 22:32:46 #1 0x080487b0 in dup () at poop.c:91 22:32:46 #2 0x08048c1e in dispatch (o=0x804b058) at poop.c:223 22:32:46 #3 0x08048bd0 in dispatch (o=0x0) at poop.c:207 22:32:46 #4 0x08048e38 in main () at poop.c:303 22:33:00 (on the second _copy) 22:33:44 the second _copy? 22:33:50 explain! :P 22:33:52 well, second time it breaks 22:34:09 (i set a breakpoint on _copy) 22:34:14 oh 22:34:15 don't :P 22:34:21 $ gdb poop 22:34:24 > start; cont; bt 22:35:55 Program exited normally. 22:35:56 (gdb) bt 22:35:56 No stack. 22:36:06 ah, this is a good point ;) 22:36:22 hmm 22:36:32 if only it would fail so i could see what its doing :P 22:37:58 hello, VERSIONer GreaseMonkey ;) 22:38:05 OSX, huh? 22:38:09 OS X indeed 22:38:25 pOSiX 22:39:51 hehe 22:39:59 it's certified UNIX now! 22:52:47 GreaseMonkey: pikhq ping2 22:52:51 http://rafb.net/p/1qEvhC25.html 22:52:53 what about this? 22:53:02 for me the last thing it prints is "16", then bus error 22:53:04 (segfault) 22:56:18 804cfc8 22:56:19 0 ERROR -- ~ on stack of less than 2 elements 22:56:19 Program exited with code 01. 22:56:43 :| Wtf. 22:56:52 (I'll certify YOU as UNIX) 22:57:38 OK, on another topic... 22:57:51 Someone implement CRTL and also suggest a way I could add arbitary output to it elegantly! 22:57:54 speaking of macs, what do people think of the Macbook Air? 22:58:11 timotiis: flimsy, plastic-looking, far too expensive, only one usb port, no ethernet, no optical drive, ... 22:58:22 Right now you can't output any arbitary string in your program 22:58:23 ehird`: oh yeah. But damn slick 22:58:29 since you need to include your state in it too and parse it back 22:58:30 So yeah. 22:58:33 4 hours battery life. 22:58:34 timotiis: No. It's kind of ugly. 22:58:50 wait, 5. 23:00:26 ehird`: I like the look, and I'm fairly impressed with the engineering. I was raised on macs though, so I probably have an ingrained bias 23:00:40 I'm a linux convert. 23:00:45 I've just ordered myself an Eee 23:00:52 For about a year now. 23:01:12 iMac, sept 06 model (I was obsoleted so quick! :P) 23:01:25 I've been linux only for myself for the last year or two (closer to two now), and macs before that 23:01:28 i probably don't take as much advantage of OS X as I could 23:01:40 but it's probably my first machine that wasn't behind when i bought it :-) 23:01:58 timotiis: from linux, not to 23:01:58 heh, this box here is hideously behind 23:02:17 ah, I went to linux from OS X 23:02:52 da, I just find it too inflexible, really. whaddya mean I can't totally change window managers in 10 minutes? 23:05:31 you can run X11 on OS X! 23:09:00 -!- tesseracter has quit ("Buh-Bye"). 23:09:08 awkward silence 23:09:40 -!- timotiis has quit ("leaving"). 23:21:08 I wonder if there's a window manager in 100 lines of C 23:33:19 anyone? ;) 23:34:35 take twm and strip all the newlines 23:34:50 (cheating, I know ;) 23:35:05 heh 23:35:11 xmonad is <500, but it's haskell 23:35:54 dwm is <2000... 23:36:59 oh yeah 9wm is pretty tiny too 23:37:57 ooh 23:38:04 there's a 58 lines-of-c one 23:38:39 I bet that's pretty minimal... 23:39:20 it has sloppy focus 23:39:50 its in debian 23:39:52 'tinywm' 23:40:07 http://incise.org/index.cgi/TinyWM 23:40:18 there's a port to python, and lisp 23:41:15 haha tinywm is just a main() 23:42:25 i do wish there was a way to write WMs for os x though 23:43:30 Windows Medias? 23:43:46 Window managers. 23:43:57 And there is. 23:44:07 X.org runs on OS X. ;) 23:44:23 You can even get it to replace Aqua. 23:45:08 Duh, I know that. 23:45:19 I meant integrated with Aqua 23:45:20 non-X11 23:45:24 I know what you *actually* mean, though. 23:46:04 The answer to that, of course, is, "don't use nonfree software." 23:47:05 pikhq: You know what's more annoying than Mac zealots? Anti-mac zealots. 23:47:17 ehird`: I'm just anti-nonfree-software. 23:47:54 * ehird` should really write a page on this sometime so he can just link people to it instead of debating with them 23:48:37 * pikhq should just get a copy of "Free Software, Free Society" so he can just hand it to people instead of debating with them 23:49:12 Why will I not use Mac OS? 23:49:24 Actually, I will. . . The minute I have a source tarball in my hands. 23:49:34 Which is, knowing Apple, never. 23:50:07 pikhq: I find it odd that you say 'knowing Apple' while apparently disliking them. 23:50:15 I'm sure if you hand over enough cash... 23:50:15 Presumably, you wouldn't go researching them to death. 23:50:35 Apple is not known for handing over source tarballs with the GPL attached. 23:50:45 pikhq: I like how you added the 'GPL' clause there. 23:51:08 You're either with us, or against us, obviously, so the mostly-BSD stuff you get here: http://www.opensource.apple.com/ (yes, I know it's not full OS X, obviously) doesn't count 23:51:12 (I'd accept any free license, actually. BSD works, the current version of the APL works, etc.) 23:51:21 but i'm not interested in a debate 23:52:00 They produce damned good software (usually), but it's not free, so I won't use it. 23:52:56 pikhq: The rabid lack of reason and dogmatic assertations that involve being a free software zealot make the term 'religious' be something other than an exaggeration, I find... 23:55:02 Whatever. 23:55:15 * pikhq shall go off to make his computer obey him for a bit. 23:55:47 Funny, my computer's doing t hat too. 23:56:14 Really? I thought you wanted it to have user-replacable WMs? 23:56:33 that was mostly a joke, actually. I like the WM. 23:56:46 How would you go about replacing it if you wanted to, though? 23:56:48 Besides, any WM-programming I would do would be just as a toy, so X11 would be fine. 23:56:57 pikhq: Ah. It's obeying me, see, because I haven't told it to do that. 23:57:06 But it won't obey if you tell it to do that. 23:57:16 But I haven't told it to do that. Therefore it's obeying me. QED! 23:57:25 For now, maybe. 23:57:34 Also, what if X11 didn't let you do that? Would you go and hack up the source for weeks to get that running? 23:57:37 No, I doubt it. 23:57:44 No, but I'd be free to. 23:57:54 And I'd be free to ask someone else to do so. 23:58:07 funny, the debates are like ones with religious fundamentalists too... 23:58:09 I'd even be free to hire someone else to do so, if I were willing to part with the money needed for that. 23:58:10 anyway, whatever 23:58:12 :) 23:58:21 I could hire apple to do it too actually. 23:58:26 I'd need an awful lot of money, but I could 23:58:37 Actually, I have enough free time, I could probably hack up the source for weeks. . . 23:58:44 Keep in mind, I wrote PEBBLE in my free time. :p 23:59:11 What's PEBBLE 23:59:24 The Practical Esoteric Brainfuck-Based Language, Eh? 23:59:37 http://pikhq.nonlogic.org/pebble.php