00:00 jeapostrophe: (define-syntax-rule (enum sym ...) (begin (define sym 'sym) ...))) 00:00 jeapostrophe: is another simpler definition that is close to what you want 00:00 lewis1711: oh so that's what the begin form is 00:01 jeapostrophe: macros can only expand into one thing 00:01 jeapostrophe: but you want a sequence of defines 00:01 offby1: men only want one thing 00:01 jeapostrophe: so you can put them in a begin 00:01 jeapostrophe: (also, the top-level will splice in begins it finds... they don't create a new scope) 00:06 lewis1711: would integers be quicker to check than symbols? because otherwise that snippet you posted before is just about right 00:06 (join) vkz 00:06 jeapostrophe: no, they wouldn't be faster 00:06 jeapostrophe: symbol comparisons are integer comparisons 00:07 jeapostrophe: because symbols are pointers... they are not compared textually 00:07 lewis1711: ah 00:11 lewis1711: jeapostrophe: I will have a look at that book when I next try and learn macros 00:11 jeapostrophe: word 00:12 (quit) nilyaK: Quit: Leaving. 00:13 (quit) Kaylin: Read error: Connection reset by peer 00:13 (quit) vkz: Quit: vkz 00:14 (join) zussitarze 00:20 (quit) zussitarze: Quit: Page closed 00:31 (join) veer 00:42 (join) vkz 00:51 (quit) jrslepak: Quit: This computer has gone to sleep 00:52 neilv: hm. the racket reference says that "let*" ``evaluates the val-exprs one by one'', but unclear to me whether it *guarantees* left-to-right order of evaluation 00:53 jonrafkind: you could look at the expansion of it 00:55 neilv: i have a good idea what it currently does. i mean to ask what's specified 01:01 (quit) vkz: Quit: vkz 01:09 asumu: neilv: R6RS requires left-to-right evaluation http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_idx_398 01:09 asumu: Racket isn't R6RS, but maybe it follows it. 01:11 neilv: aha, the racket reference specifies "let" as left-to-right, so "let*" specification inherits that 01:12 neilv: which is unfortunate, because every time i write a "let" of more than one val-expr, i fantasize about them being parallelized 01:13 neilv: well, my evening is ruined 01:15 (join) nilyaK 01:49 neilv: i wonder whether the contract overhead for the web-server response struct constructor is significant 01:52 (join) djcb` 01:52 jeapostrophe: neilv: i benchmarked it once 01:53 jeapostrophe: and so i optimized it 01:53 jeapostrophe: it is reasonable now 01:53 (quit) djcb: Ping timeout: 246 seconds 01:54 neilv: thanks, good to know 01:54 jeapostrophe: i'd still like a global contracts-off mode 01:54 neilv: absolutely 01:55 jeapostrophe: blake's ms work is designed to make that more possible 01:55 jeapostrophe: but his stuff is just the first step 02:05 (quit) jeapostrophe: Ping timeout: 252 seconds 02:07 (join) realitygrill 02:13 (quit) Diarmid: Quit: Leaving. 02:20 (quit) yoklov: Quit: computer sleeping 02:24 (join) Diarmid 02:27 (join) jao 02:28 (quit) djcb`: Remote host closed the connection 02:39 (join) cdidd 02:43 (quit) jonrafkind: Ping timeout: 272 seconds 02:48 (quit) veer: Quit: Leaving 02:56 (join) RacketCommitBot 02:56 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/xW_sNA 02:56 RacketCommitBot: [racket/master] Remove no-longer used net/cgi exceptions. - Eli Barzilay 02:56 RacketCommitBot: [racket/master] Add to/from bytes functions to the json library. - Eli Barzilay 02:56 (part) RacketCommitBot 02:56 (join) hkBst 02:56 (quit) hkBst: Changing host 02:56 (join) hkBst 03:41 (join) nilyaK1 03:43 (quit) nilyaK: Ping timeout: 252 seconds 03:46 (join) RacketCommitBot 03:46 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/bMRMHA 03:46 RacketCommitBot: [racket/master] Remove typed versions of the cgi exceptions. - Eli Barzilay 03:46 (part) RacketCommitBot 03:48 mrcarrot: how is it with racket, has it any way to automatically split the problem into threads? like in haskell where you pass the -threaded option to the compiler 03:51 neilv: racket has ways of using multiple CPUs, but i don't know of any current automatic parallelization. you could ask on the email list 03:59 (nick) nilyaK1 -> Kaylin 04:06 (quit) _AlbireoX: Ping timeout: 245 seconds 04:06 (join) AlbireoX 04:25 (join) kvda 04:34 (quit) kvda: Quit: x___x 04:41 (quit) jao: Ping timeout: 260 seconds 04:43 neilv: bummer. drracket seems to have hanged, when i was doing an identifier rename with the on-the-fly check-syntax running 04:55 (join) itasyno 05:05 (join) noelw_away 05:05 Kaylin: legit question, when one says a program hangs, where does this term come from? 05:07 neilv: i don't know the etymology 05:09 neilv: might be similar to "leave you hanging" 05:10 Kaylin: like when we say something is hung up, snagged maybe 05:10 Kaylin: idk 05:11 (join) bas_ 05:11 (nick) bas_ -> Skola 05:12 (join) untrusted 05:28 tim-brown: you can hang up a phone... that's a fairly physical description of 05:28 tim-brown: what happens when you put the receiver down. 05:28 tim-brown: (and the phone is mounted vertically -- or a candle-stick phone) 05:29 Kaylin: the call terminates gracefully =X 05:29 tim-brown: from there e.g. "I was talking to Jim and he hung up on me" 05:29 Kaylin: oh, depends which end you're on 05:29 Kaylin: I suppose 05:29 tim-brown: nah... nothing graceful about Jim... something I said annoyed him 05:29 tim-brown: and he hung up on me 05:30 (join) mceier 05:30 Kaylin: :( 05:31 tim-brown: that's how I see it, personally. the program is at the other side of a conversation on a terminal 05:31 tim-brown: and if i upset it, it hangs up on me 05:32 tim-brown: (although I *do* deal with a lot of real devices on the end of real phone lines, so I'm actually being quite literal sometimes) 05:33 tim-brown: it's a nice word, though... it has the "dangling" aspect to it too 05:33 neilv: if your program hangs up on you, it might just be smoking POTS? 05:37 (part) untrusted: "ERC Version 5.3 (IRC client for Emacs)" 05:38 neilv: tough crowd for telephony jokes 05:38 Kaylin: is that stop in reverse? 05:38 neilv: "plain old telephone service" 05:38 Kaylin: :P 05:39 Kaylin: so not quite as bad as SMTP 05:39 neilv: http://en.wikipedia.org/wiki/Plain_old_telephone_service 05:42 (quit) dous: Ping timeout: 246 seconds 05:45 (join) chezduck 05:47 neilv: i hope nobody ever needs to use html-template with any charset other than utf-8, because i've broken all that 05:49 (join) gciolli 06:07 (join) masm 06:18 noelw_away: utf-8 ftw 06:18 (nick) noelw_away -> noelw 06:21 noelw: Educational software makes me sad. 06:21 noelw: Has anyone ever used an online learning environment they like? 06:21 neilv: if they didn't want you to be sad, they would call it recreational, rather than educational 06:23 noelw: Recreation is supposed to be fun 06:24 (part) noelw 06:24 (join) noelw 06:26 (quit) Kaylin: Quit: Leaving. 06:32 (quit) rostayob: Ping timeout: 260 seconds 06:45 (join) rostayob 07:29 neilv: hm. drracket 5.2.1 got in an infinite loop on compiling, without hanging hard, no matter what i changed. i exited drracket and restarted, and it promptly gave me a correct compiler error 07:38 (quit) rostayob: Ping timeout: 246 seconds 07:39 lewis1711: is there anyway to do a (sequenceof number?) for contracts? typed racket has Sequenceof so I imagine there's *somethin* 07:42 (join) samth_ 07:53 lewis1711: rudybot: (define (sequenceof type?) (lambda (seq) (sequence-andmap type? seq))) 07:53 rudybot: lewis1711: Done. 07:53 lewis1711 wonders if that will do the right thing 07:56 lewis1711: "contract violation, expected: ...ewis/std1711.rkt:4:27" I remember reading about this problem somewhere 08:05 lewis1711: flatnamed contracts, that was it 08:10 (join) jrslepak 08:21 (quit) jrslepak: Quit: This computer has gone to sleep 08:21 (quit) bmp: Quit: Leaving... 08:23 neilv: if i have a utility procedure that's called from within syntax-case clauses, and i want this utility procedure to construct syntax with bindings from lexical context (or just toplevel) in which the utility procedure is defined... how do i do that? 08:23 neilv: it's too late at night to be reading reference/stxtrans.html 08:27 (join) RPR 08:28 RPR: samth_: Thx again for the assist on the typing. Typed Racket is just the way to go. 08:29 samth_: RPR, no problem 08:29 samth_: happy to help 08:30 samth_: neilv, probably something like this: (datum->syntax #'here '(foo bar)) 08:30 RPR: samth_: FWIW the 2 nits that I hit the most (bugwise) in TR 1) struct-copy not working. 2) providing struct: without itemizing every ctor,predicate and accessor etc. 08:31 samth_: RPR, ironically, i think those are the same bug 08:32 samth_: RPR, this works for me: (struct-copy Success (Success 3) [result 4]) 08:33 RPR: nice. I haven't tried it recently. 08:33 RPR: One down... 08:33 neilv: samth_: that's what i first tried, but #'here doesn't seem to come with lexical info in that context 08:34 samth_: neilv, do you want the *local* bindings from where you're creating the syntax? 08:34 samth_: RPR, this works too, in that file: (provide (struct-out Success)) 08:35 neilv: samth_: even just racket/base would be nice to start with 08:36 samth_: #'here should work fine, but your problem may be that you need `(require (for-template racket/base))' 08:37 neilv: aha. i was using for-label 08:37 neilv: thanks 08:46 RPR: samth_: struct-out is working. :) However struct-copy still only works for me in the defining module. :( 08:47 samth_: neilv, `for-label' is only for docs 08:47 samth_: RPR, even if both modules are typed? 08:47 RPR: yes 08:48 RPR: struct-copy: accessor name not associated with the given structure type at: Cell-x in: (struct-copy Cell (Cell "ray") (x "eve")) 08:48 RPR: Works fine in the module where struct: Cell is defined. 08:49 (quit) RPR: Quit: job thing ... 09:00 (join) bmp 09:10 (join) jeapostrophe 09:19 (join) rostayob 09:24 (quit) rostayob: Ping timeout: 246 seconds 09:37 (quit) kanak: Quit: Leaving. 09:41 (join) dnolen 09:47 (join) yoklov 09:52 (join) jrslepak 09:57 (quit) samth_: Ping timeout: 246 seconds 10:04 (join) rostayob 10:06 (join) dous 10:08 (quit) yoklov: Quit: computer sleeping 10:10 (quit) jrslepak: Quit: This computer has gone to sleep 10:16 (join) mye_ 10:17 (join) gridaphobe 10:29 (join) kvda 10:31 (join) RacketCommitBot 10:31 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/4j5K8A 10:31 RacketCommitBot: [racket/master] Fix sync/timeout hang due to place channels - Kevin Tew 10:31 (part) RacketCommitBot 10:32 (quit) kvda: Client Quit 10:33 (join) kvda 10:41 (join) RacketCommitBot 10:41 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/uFylZQ 10:41 RacketCommitBot: [racket/master] Fix sync/timeout hang due to place channels - forgot to git add - Kevin Tew 10:41 (part) RacketCommitBot 10:42 neilv: i think this is about as fast as i can make a static html-template work with web-server. http://paste.lisp.org/display/128380 10:43 noelw: Looks good 10:43 noelw: Back on to GMT, I see. ;-0 10:45 neilv: for html-templates that aren't completely static, there will be two at least two different forms, basically distinguished by whether you want the content-length header determined for you, or you want to be able to do things like flush the output in the middle or send a huge file 10:46 chandler: does the latter form use chunked encoding? 10:48 neilv: all response/html-template will care about is whether it builds a list of bytes and then sends them, or it does a series of writes for each static and dynamic step as it goes through the dynamic ones in order 10:49 neilv: chunked encoding is up to web-server 10:49 chandler: ah 10:49 neilv: noelw: back on gmt as of this morning, looks like 10:50 (quit) kvda: Quit: x___x 10:52 (join) yoklov 10:56 (quit) dnolen: Ping timeout: 260 seconds 11:01 tim-brown: tewk: thanks 11:02 tim-brown: is there a dialy build of windows (64) racket installer? 11:03 tim-brown: when is it built? (i want the places fix :-) 11:04 tim-brown: s'ok, I see the nightly installer page 11:05 (join) jrslepak 11:13 tim-brown: k 11:17 (nick) samth_away -> samth 11:18 samth: tim-brown: they're build around 4AM eastern time in the US 11:19 samth: mrcarrot: the -threaded option to GHC does not automatically parallelize your program 11:19 samth: mrcarrot: unless you've explicitly disabled places and futures at compile time (of the Racket runtime), Racket is always like GHC -threaded 11:19 (quit) cdidd: Remote host closed the connection 11:24 (join) kanak 11:28 neilv: my bad. i thought he was talking about a different feature of the haskell that i played with 11:29 (quit) hkBst: Quit: Konversation terminated! 11:29 (quit) jrslepak: Quit: This computer has gone to sleep 11:30 (join) asdfhjkl 11:36 tim-brown: samth: so about 9am GMT/UTC, I guess... looking forward to it! 11:37 (quit) gciolli: Ping timeout: 240 seconds 11:41 (quit) jeapostrophe: Ping timeout: 255 seconds 12:05 (join) nilyaK 12:18 (quit) Shviller: Ping timeout: 276 seconds 12:18 (join) Shviller 12:21 (quit) Skola: Ping timeout: 264 seconds 12:22 (join) vkz 12:25 mrcarrot: samth: really? take a look at http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=racket&lang2=ghc 12:25 rudybot: http://tinyurl.com/7heyv39 12:25 (nick) noelw -> noelw_away 12:25 mrcarrot: samth: take a look at the haskell source and you will see that there is no code for making concurency, and still it is using all cores 12:25 (quit) noelw_away: Quit: noelw_away 12:26 mrcarrot: samth: the only times racket is using several cores is when they do it in source 12:28 mrcarrot: haskell looks like it is all the time using some threading... 12:29 nilyaK has some sheets that have many threads. 12:29 bremner: well, for GC anyway 12:33 mrcarrot: what is GC? 12:33 bremner: garbage collection 12:33 (join) nilyaK1 12:33 bremner: since ghc, 6.x there is parallel gc 12:34 mrcarrot: ah, garbage collector 12:35 (quit) nilyaK: Ping timeout: 246 seconds 12:36 (nick) nilyaK1 -> Kaylin 12:37 (join) jonrafkind 12:37 (quit) Kaylin: Client Quit 12:38 mrcarrot: out of curiousity, is that something on the way to come to racket? 12:39 mrcarrot: the performance of racket seems to otherwise be really okay. not fully as good as haskell, but very much good enough 12:39 mrcarrot: (if microbenchmarks are to be trusted at all) 12:41 (join) zussitarze 12:44 samth: mrcarrot: that's not correct about haskell 12:45 samth: mrcarrot: if you look at http://shootout.alioth.debian.org/u64q/program.php?test=spectralnorm&lang=ghc&id=4 you can see the calls to `forkIO` 12:45 rudybot: http://tinyurl.com/7toeo5b 12:48 (join) MayDaniel 12:53 bremner: oh, C style parallelism ;) 12:54 tim-brown: mrcarrot and samth: where did this conversation about parallelism come from? 12:54 tim-brown: i can really follow it back to the start in my irc log 12:54 tim-brown: can't 13:02 mrcarrot: tim-brown: yes, some are doing that... but take a look at some of the other examples there and you can see that it is not always the case 13:02 mrcarrot: still the little gain it has over racket comes from threading 13:03 tim-brown: mrcarrot: ? 13:03 mrcarrot: fasta, for example 13:03 mrcarrot: http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=racket&lang2=ghc 13:03 rudybot: http://tinyurl.com/7y4fk7s 13:04 mrcarrot: tim-brown: fasta source is here: http://shootout.alioth.debian.org/u64q/program.php?test=fasta&lang=ghc&id=1 13:04 rudybot: http://tinyurl.com/7lj7pkf 13:05 mrcarrot: tim-brown: but you are right that they use many times similarities to futures in haskell 13:05 (quit) realitygrill: Quit: realitygrill 13:06 tim-brown: mrcarrot: pretty sure you're not talking to *me* 13:06 mrcarrot: in the fasta example, they pass the -threaded argument and get the load spread as 18% 69% 17% 2% 13:06 mrcarrot: ah, it was samth i mean all that too... sorry 13:07 tim-brown: np, just confused me... is all 13:08 mrcarrot: tim-brown: this discussion came because i asked if somebody knows if racket has something similar like -threaded in ghc to automatically create some concurency without doing anything in the source 13:08 mrcarrot: tim-brown: i just recently found out about racket and i am curious how it compares to haskell... that is why i am asking a lot of strange questions 13:09 tim-brown: ah... i'm playing with places myself, atm 13:09 bremner: last time I looked at parallelism in haskell, you still had to annotate with "par" to get parallelism, so it wasn't really automatic. 13:09 tim-brown: and anyway, racket raises a lot of strange questions! 13:10 tim-brown: from what i've seen, places seem quite heavy, for small units of work, and futures seem quite limiting in what work they'll handle 13:11 mrcarrot: bremner: not in that "fasta" code... it is doing some parallelism there automatically and winning racket (with allthough a small marginal) 13:11 tim-brown: although (once i've got a fix downloaded) i'm using a place farm for parallelism 13:11 tim-brown: which seems to do the trick as long as there's not too much inter-place communication 13:11 bremner: mrcarrot: ok, then I guess there was some progress in the last few years. I remember there were projects along those lines, but not integrated into ghc 13:12 mrcarrot: bremner: probably it got integrated since then 13:13 (quit) zussitarze: Quit: Page closed 13:14 mrcarrot: all i can conclude from my questions so far is that both racket and haskell are good languages 13:17 (join) jeapostrophe 13:18 mrcarrot: bremner: how much did you use haskell? 13:19 bremner: not much. I only wrote one non-toy program. 13:19 mrcarrot: ah, okay 13:20 mrcarrot: had you been using racket before you begun with haskell? 13:20 bremner: no 13:20 mrcarrot: okay, so what did get you to switch over to racket? 13:20 (join) gciolli 13:21 bremner: mrcarrot: I'm teaching and I find racket better for that. 13:21 mrcarrot: hmm, that was what i concluded too.. that if i am teaching programming, racket would be better for keeping the interest up 13:22 mrcarrot: at least from the material i have quickly been looking at 13:22 rostayob: bremner: "par" is a very restricted view of parallelism in Haskell 13:22 bremner: ok 13:22 (part) tim-brown: "Leaving" 13:23 bremner: all I know is what is in Real World Haskell ;) 13:23 bremner: oh, I guess I forgot STM 13:23 rostayob: well in general you have excellent support for concurrent programming in Haskell 13:23 asumu: mrcarrot: the teaching benefit is that full Haskell is too complex and has poor error messages. In theory a teaching subset of Haskell might be nice, but it's hard to implement such a thing. 13:23 asumu: (while Racket provides tools to do so) 13:24 bremner: rostayob: we were talking about automatic parallelism, or or least I was. 13:24 mrcarrot: yes 13:24 rostayob: asumu: "full" haskell is not big (haskell98) 13:24 rostayob: if with "full" haskell you meant GHC haskell... that's not haskell :P 13:24 mrcarrot: excuse me if i am asking very strange question. i am just trying to figure out in what situations racket is better and in what haskell... 13:25 mrcarrot: for teaching, i think racket is winning. 13:25 asumu: rostayob: It's bigger than Beginning Student Language. 13:25 rostayob: bremner: oh ok, even there there is a lot of interesting stuff recently (e.g. data parallell haskell) 13:25 asumu: (much bigger) 13:25 bremner: rostayob: right, it seems I lost touch 13:25 rostayob: asumu: what's your ideal "beginning student language"? I can agree that it'd be better without typeclasses 13:26 asumu: rostayob: I'm referring to the actual BSL language in Racket that you can use. I don't know what my ideal counterpart in Haskell would be, but probably it wouldn't involve using monads for I/O and graphics. 13:26 asumu: (that would come probably in an advanced student language) 13:27 mrcarrot: i have been hunting for some really easy to use graphic library for haskell... but not found any so far 13:27 rostayob: asumu: ah. I had no idea there was such a thing. 13:27 rostayob: mrcarrot: I already suggested gloss I think. that's dead easy. 13:27 rostayob: asumu: still my lecturer used haskell without ever mentioning typeclasses and things went really smoothly. 13:28 asumu: rostayob: http://docs.racket-lang.org/htdp-langs/beginner.html 13:28 jeapostrophe: rostayob: the problem is that students don't know what they should not use or that they are using it. 13:29 jeapostrophe: rostayob: a smaller language turns student's mistakes and typos into language errors 13:29 rostayob: I agree, I agree. haskell 98 is still a small language. 13:29 asumu: Yep, what jea said. Students will gleefully use state and mutation everywhere if they can find it. 13:29 asumu: Even in Racket student languages they will find it (require racket) 13:29 jeapostrophe: rostayob: a classic example is "price * quantity = total_cost" in C 13:30 jeapostrophe: rostayob: a natural thing for a student to write, but you get an incomprehensible message about pointer arithmetic 13:30 rostayob: that's not easy to do in Haskell either eh :) 13:30 (join) djcb 13:30 mrcarrot: rostayob: yes, gloss seems to be what i have been searching for for haskell 13:30 mrcarrot: rostayob: can gloss also handle mouse events? 13:30 mrcarrot: i mean to make small simple games 13:31 rostayob: mrcarrot: yes. 13:31 rostayob: mrcarrot: http://hackage.haskell.org/packages/archive/gloss/1.6.2.1/doc/html/Graphics-Gloss.html#v:play 13:31 rudybot: http://tinyurl.com/7jpo5r7 13:33 (quit) Fulax: Read error: Connection reset by peer 13:39 (join) dirKat 13:39 (quit) dirKat: Client Quit 13:42 (quit) rostayob: Read error: Operation timed out 13:42 (quit) neilv: Ping timeout: 246 seconds 13:45 (join) anRch 13:46 (quit) yoklov: Quit: computer sleeping 13:55 (join) RacketCommitBot 13:55 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/J7WQ5w 13:55 RacketCommitBot: [racket/master] Fixes PR12638 - Jay McCarthy 13:55 RacketCommitBot: [racket/master] Adding #lang web-server/base - Jay McCarthy 13:55 (part) RacketCommitBot 13:57 (join) yoklov 14:01 (quit) gridaphobe: Remote host closed the connection 14:12 samth: mrcarrot: that program does not use any of haskell's parallel facilities, and if you look at the timings, you can see that all the work on the smaller sizes is done on one core 14:12 (join) dzhus 14:12 samth: the largest input gets some use of other cores, which i believe is due to the GC 14:13 samth: mrcarrot: again, haskell does not automatically parallelize your program 14:13 (join) Skola 14:14 samth: mrcarrot: note that the one-core version of that benchmark (change u64q to u64 in the url) runs in the same amount of time 14:14 mrcarrot: i never checked that... 14:14 mrcarrot: interesting 14:16 (quit) yoklov: Quit: computer sleeping 14:21 (quit) gciolli: Ping timeout: 244 seconds 14:22 (quit) itasyno: Quit: To iterate is human, to recurse divine 14:37 (join) rostayob 14:40 (quit) Skola: Quit: Lost terminal 14:58 (part) bmp 14:59 (join) bmp 15:02 (join) yoklov 15:03 (quit) anRch: Quit: anRch 15:25 (quit) mye_: Ping timeout: 248 seconds 15:29 (quit) vkz: Quit: vkz 15:42 (join) vkz 15:45 (join) Gertm 16:04 (quit) vkz: Quit: vkz 16:22 (quit) Gertm: Ping timeout: 260 seconds 16:33 (quit) asdfhjkl: Quit: Leaving 16:35 (join) gridaphobe 16:48 (join) vkz 17:03 offby1: Idle question: is there a way to make compilation fail if the racket version isn't what I want? 17:03 offby1: i.e., (require racket/5.2.1) 17:03 offby1: perl has something like that. 17:07 chandler: rudybot: eval (define-syntax (check-version stx) (syntax-case stx () ((_ v1 ...) (member (version) (syntax->datum #'(v1 ...))) #'(void)))) 17:07 rudybot: chandler: your sandbox is ready 17:07 rudybot: chandler: Done. 17:07 chandler: rudybot: eval (check-version "5.2.1") 17:07 rudybot: chandler: Done. 17:07 chandler: rudybot: eval (check-version "5.2.0") 17:07 rudybot: chandler: error: #:1:0: check-version: bad syntax in: (check-version "5.2.0") 17:08 offby1 rubs chin 17:08 offby1: can't say I understand that. At all :-| 17:09 rapacity: just write a macro to check the version at compile time 17:10 chandler: rudybot: that's what the macro I wrote above does 17:10 rudybot: chandler: ACTION holds palm a foot above floor 17:10 chandler: gah. that was for rapacity 17:10 chandler: offby1: OK; are you familiar with `syntax-case'? 17:10 offby1: vaguely. 17:10 rapacity: yeah I know, I meant that for the person that wasn't able to understand that 17:11 offby1: it's the lowest-level way to make a macro, yes? 17:11 chandler: I'm not sure about "lowest"... but it's needed here, since the purpose is to check what (version) returns at compile time. 17:11 sid0: hm, given a symbol 'x, is there an easy way to use it in a macro (foo x) without using eval? 17:11 offby1: so your macro expands to (void) if (version) is a member of the required version ... and fails cryptically otherwise. 17:11 chandler: Yup. 17:11 offby1: which is pretty much what I want, modulo the cryptography :) 17:12 offby1 ponders 17:12 chandler: sid0: I'm afraid I don't really understand that question at all. 17:12 chandler: What are you trying to do? 17:12 sid0: chandler: sorry, let me elaborate 17:12 offby1: oh, I was thinking I'd force rudybot to fail compilation if the version is < 5.2.1, since there's a fix in that version that it requires. 17:13 chandler: offby1: that was for sid0, sorry 17:13 chandler: I figured you were trying to do something like that 17:13 sid0: chandler: I have a macro called foo which accepts syntaxes of the form (foo a b c) 17:14 (join) cdidd 17:14 sid0: chandler: and I have a symbol that's passed in to a function, and I'd like to apply that macro on the symbol without the ' 17:15 chandler: rudybot: eval (define-syntax (check-version stx) (syntax-case stx () ((_ v1 ...) (member (version) (syntax->datum #'(v1 ...))) #'(void)) ((_ v1 ...) (raise-syntax-error #f (format "racket version ~a is totally borken and unacceptable to me" (version)) stx))) 17:15 rudybot: chandler: error: #:1:0: read: expected a `)' to close `(' 17:15 chandler: Gah. 17:15 rapacity: (version) returns a string 17:15 sid0: so one way to do it would be something like (define (apply-foo x) (eval `(foo ,x ,x ,x))) 17:15 chandler: rudybot: eval (define-syntax (check-version stx) (syntax-case stx () ((_ v1 ...) (member (version) (syntax->datum #'(v1 ...))) #'(void)) ((_ v1 ...) (raise-syntax-error #f (format "racket version ~a is totally borken and unacceptable to me" (version)) stx)))) 17:15 rudybot: chandler: Done. 17:15 chandler: rudybot: eval (check-version "5.2.2") 17:15 rudybot: chandler: error: #:1:0: check-version: racket version 5.2.1 is totally borken and unacceptable to me in: (check-version "5.2.2") 17:16 offby1 lights up 17:16 offby1: now we're talking! 17:16 rapacity: rudybot: (version) 17:16 rudybot: rapacity: your sandbox is ready 17:16 rudybot: rapacity: ; Value: "5.2.1" 17:16 (quit) jonrafkind: Ping timeout: 264 seconds 17:16 sid0: chandler: so I was wondering if there's a way to do it without using eval 17:16 chandler: sid0: I'm afraid you're mixing phases here. The macro doesn't really exist by the time the function is called. 17:16 sid0: chandler: it does work inside eval, though. 17:17 chandler: Yes, you can construct a new evaluator to do that, but I'm curious as to whether the task at hand really requires that. 17:18 sid0: well, I guess I could dump the macros entirely and use expressions everywhere 17:18 chandler: What is it you're actually trying to do, if I could ask? 17:19 sid0: I'm working on integrating SMT-LIB2 with Racket 17:19 chandler: offby1: So, basically what you need to do now is replace that test using `member' with something that returns #t if the version is acceptable to you. 17:19 offby1: yep 17:19 offby1: which means figuring out if the version strings sort chronologically the same as they sort lexicographically. 17:19 offby1: eli: what say you? 17:19 chandler: You might also want to accept only one version argument to `check-version' in that case, and adjust the bit in `syntax->datum' appropriately. 17:20 sid0: chandler: so I was hoping I could use the standard SMT-LIB2 forms (assert (= a b)) etc, which is why I wrote everything as macros 17:20 offby1: sure sure 17:20 sid0: chandler: but I'd like to substitute runtime values at certain places 17:21 chandler: sid0: I'd have to do a lot more digging into this than I'm prepared to do right now to determine what the right way is to do this, sorry. 17:21 sid0: since I'd like the evaluation to be at least partially driven by runtime input 17:21 offby1: Oy Gott does "make install" take forever. 17:21 offby1 twiddles thumbs 17:21 sid0: chandler: fair enough 17:22 sid0: I guess I'll just use eval for now :) 17:22 chandler: You may want to look into namespaces, if you're working with symbols that represent top-level definitions. 17:23 sid0: I'm using namespaces already 17:23 sid0: the a b etc live in the example above live a separate namespace 17:23 sid0: er, live in 17:23 sid0: ugh, sigh 17:23 sid0: the a b etc in the example above live in a separate namespace 17:25 chandler: Oh, and you're using two-argument `eval' with that namespace? 17:25 sid0: chandler: inside the macro, effectively, yeah 17:26 chandler: Doesn't `namespace-variable-value' effectively substitute for eval in that case? 17:27 sid0: Sure, but that isn't the issue, though. That part works fine 17:27 chandler: OK. I guess I'm not following, and I'm afraid I don't really have the concentration to at the moment. 17:27 chandler leaves this one for someone else 17:28 sid0: What I'd like to do is be able to write (assert (= a x-which-is-determined-at-runtime)) 17:29 eli: offby1: ? 17:29 sid0 tries something 17:30 eli: is this about comparing versions? 17:31 (join) neilv 17:32 (quit) neilv: Changing host 17:32 (join) neilv 17:32 (quit) neilv: Client Quit 17:32 offby1: yes -- I'm not sure if they sort lexicographically the same as chronologically, if you see what I mean 17:32 offby1: in other words: if (string->=?(version) "5.2.1"), does that mean I'm sure to be running a version newer than 5.2.1 ? 17:33 rapacity: there are a few version checking functions in version/utils 17:33 samth: offby1: there's a whole lib for this 17:33 samth: or, what rapacity said 17:34 lewis1711: ohh people are here *rushes to paste problem* 17:34 eli: offby1: version/utils 17:34 offby1: thanks folks 17:34 eli: It's intended for that because they're don't sort lexicographically if you go back to the plt-scheme days. 17:35 lewis1711: rudybot: (define (sequenceof type?) (lambda (seq) (sequence-andmap type? seq))) 17:35 rudybot: lewis1711: your sandbox is ready 17:35 rudybot: lewis1711: Done. 17:35 sid0: chandler: Aha, got it working 17:35 lewis1711: this contract doesn't print nicely when it's broken, how can I fix that? flat-named-contract seems to rely on it ending in a question mark 17:36 sid0: quasiquote/unquote fwi 17:36 sid0: *ftw 17:36 sid0: eli: hi, what do you think of https://github.com/plt/racket/pull/87 ? 17:37 sid0: do you think that's reasonable? 17:38 eli: sid0: I get to that code yet... 17:38 sid0: sorry? 17:39 (quit) dzhus: Remote host closed the connection 17:40 eli: sid0: I didn't get to read the changes, yet. 17:41 sid0: eli: oh, all right 17:49 (join) DanBurton 17:50 DanBurton: does PLT stand for anything? 17:50 DanBurton: jeapostrophe is telling me that it doesn't stand for anything 17:50 DanBurton: I don't know if I believe him 17:54 (join) jrslepak 17:54 jeapostrophe: it doesn't 17:54 lewis1711: I thought it was Programming Language Theory 17:54 jeapostrophe: nor did it 17:54 jeapostrophe: lewis1711: nope 17:55 lewis1711: permuting lexical types 17:56 jeapostrophe: PLT = PLT Language Tower 17:56 jeapostrophe: It's a tower of languages with PLT all the way down 17:56 DanBurton: so it does stand for something 17:56 DanBurton: it's just recurive 17:56 DanBurton: *recursive 17:56 jeapostrophe: no 17:56 DanBurton: but you just said. PLT = PLT Language Tower 17:57 DanBurton: or did you just make that up? 17:57 lewis1711: jeapostrophe: http://secretgeek.net/lisp_truth.asp that reminds me of this :D 17:57 jeapostrophe: ya :) 17:57 DanBurton: jeapostrophe: that should be its backronym then 17:57 jeapostrophe: no way 17:58 jeapostrophe: it's a enigma 17:58 (join) kvda 17:58 DanBurton: but everyone will assume it's Programming Language Theory 17:58 jeapostrophe: and they are wrong 17:59 jeapostrophe: so it is a teaching opportunity 18:03 (quit) jeapostrophe: Ping timeout: 245 seconds 18:11 (quit) DanBurton: Quit: leaving 18:13 stamourv: sid0: Re SMT-LIB2: IIRC, ianj may have tried getting it to work with Racket. 18:14 (join) ShenIsBetter 18:15 ShenIsBetter: hello, dear community! What's up? 18:15 ozzloy: hola 18:18 ShenIsBetter: when the next version of (buggy) drracket will come out? 18:19 chandler: eli: This is getting tiring. 18:20 ShenIsBetter: hi eli! 18:20 ShenIsBetter: :) 18:20 samth: ShenIsBetter: new version of Racket are released every 4 months 18:21 ShenIsBetter: oh, so! 18:21 samth: ShenIsBetter: and you're close to being banned 18:21 samth: *versions 18:21 ShenIsBetter: samth, please don't be nazzy ragazzo 18:22 ozzloy: just fyi, there's a #shen about shen the programming language 18:22 ShenIsBetter: nice to know, ozzy 18:22 ShenIsBetter: i'm glad you check this out hehehe 18:24 ozzloy: me too! are you in that channel? i don't see you 18:24 ozzloy: by another name, perhaps? 18:24 ozzloy: has anyone written their resume in scribble? 18:25 ozzloy: anyone in here, reading this, that is 18:25 ShenIsBetter: it's not easy to be unloved, samth... :( 18:27 ozzloy: i have my resume written in LaTeX and every once in a while i think about rewriting it in something else 18:27 (quit) yoklov: Quit: computer sleeping 18:27 stamourv: ozzloy: I'm thinking about it. My website is in scribble, though. 18:27 ozzloy: oh cool 18:27 stamourv: It's really convenient. 18:27 ozzloy: at least one other person is crazy, or this idea isn't that crazy 18:28 stamourv: But it kinda looks like the Racket docs. I guess a bit of css could fix that. 18:28 ShenIsBetter: if you have your resume already written in Latex, then what's the point in conversion to scribble? 18:28 stamourv: jeapostrophe's is in sctibble to, IIRC. 18:28 ozzloy: ShenIsBetter, partially to learn scribble by way of project 18:28 ShenIsBetter: you mean: "ugly like Racket docs?" 18:28 ozzloy: ShenIsBetter, partially because i'm hoping it's easier to work with than LaTeX 18:28 samth: ozzloy: our course web pages are written in scribble: http://www.ccs.neu.edu/course/cs2510h/ 18:29 samth: but i still use tex for my cv 18:29 ShenIsBetter: oh, what a nice web page, samth! 18:29 samth: ShenIsBetter: glad you like it 18:29 stamourv: ozzloy: It certainly is nicer to work with. 18:29 asumu: lewis1711: BTW there is a sequence/c in unstable/contract. 18:30 ozzloy: samth, much difference between TeX and LaTeX? 18:30 stamourv: I write my research papers with scribble. 18:30 samth: no, and i meant latex anyway 18:30 ozzloy: ic 18:31 ozzloy: samth, do you make the page look that way entirely in scribble or do you use some external css too? 18:31 ShenIsBetter: I'm fantasizing about Taylor Swift... i think i'm in love... :) 18:31 samth: ozzloy: we wrote a custom css file 18:32 samth: but scribble is nice for including that sort of thing 18:32 ozzloy: samth, icic 18:32 samth: try view-source on it, and you can see all the hooks for css 18:33 (part) bmp 18:33 asumu has been planning to redo his website in scribble/html... 18:33 asumu: I just generate HTML right now out of sexpressions. 18:33 ozzloy: man, is there any way you people can do a udacity-style class? or team up with udacity? 18:35 samth: my website uses scribble/html (sadly still undocumented) 18:35 ozzloy: i'm a huge fan of the format and delivery of udacity. the content could be vastly improved though 18:35 samth 's website is at http://www.ccs.neu.edu/home/samth/ 18:35 ozzloy: well maybe *vastly* is overstating 18:36 asumu: Well, I saw their PL course seems kinda iffy. 18:36 ozzloy: so you have a stylesheet link to 2510H.css, i'm guessing that's the external css you used? 18:36 asumu: In that it covers something about HTML. 18:36 samth: ozzloy: yes 18:36 samth: but all the classes are natively created by scribble 18:37 ShenIsBetter: samth, please, persuade PLT-friends to make racket's logo change to Taylor Swift picture on her birthday! 18:37 asumu: ozzloy: how does udacity recruit teachers anyway? 18:37 samth: ShenIsBetter: seriously -- behave yourself 18:37 ShenIsBetter: :( 18:37 ozzloy: asumu, i'm guessing it's people sebastian knows personally 18:37 asumu: ozzloy: I like the idea of udacity, but maybe they are expanding too quickly to courses where they don't have the expertise... 18:38 asumu: I mean, it's great for robots where Sebastian has tons of experience, presumably. 18:38 ozzloy: indeed 18:38 ozzloy: he does. he has google cars and darpa grand challenge under his belt 18:39 ShenIsBetter: A few days ago eli criticized udacity 18:39 ozzloy: i've started watching the mit lectures on SICP 18:39 ozzloy: but they're an hour long each lecture 18:39 ozzloy: and there's no feedback 18:39 ShenIsBetter: it's time that PLT-team offer something better hehehe 18:40 ozzloy: is realm-of-racket supposed to be like that? 18:40 ozzloy: anyone in here know? 18:40 ShenIsBetter: realm-of-racket is a clone of Land of Lisp 18:41 ozzloy: land of lisp is a book, realm of racket is a website, isn't it? 18:41 ShenIsBetter: realm of racket is soon to be published book 18:41 ShenIsBetter: clone of LoL 18:41 ShenIsBetter: made by felleisen's students 18:42 ozzloy: but then there's http://realmofracket.com/videos.html 18:42 ozzloy: which makes me think something in addition to book 18:42 ShenIsBetter: oh, it's just commercials 18:43 ozzloy: so you've seen the unreleased videos? 18:43 ShenIsBetter: yeah 18:43 ozzloy: is it taylor swift videos? 18:43 ozzloy: like her latest single about racket or something? 18:44 ShenIsBetter: http://stackoverflow.com/questions/9344564/commercials-for-a-new-racket-still-unpublished-book 18:44 rudybot: http://tinyurl.com/7ltvbvg 18:44 ShenIsBetter: im deeply in love 18:45 ozzloy: "this video is private" T_T 18:45 ozzloy: for both 18:45 ozzloy: mirror? 18:45 ShenIsBetter: few day ago it worked 18:45 ShenIsBetter: i've seen those videos 18:45 lewis1711: asumu: why is it unstable? :/ 18:45 ShenIsBetter: notimg special 18:45 ShenIsBetter: just a bunch of geek 18:46 ozzloy: ShenIsBetter, ololo, good one 18:46 (join) jeapostrophe 18:47 ShenIsBetter: ?? 18:47 asumu: lewis1711: Well, it's there because it hasn't been used/tested as much probably. 18:47 offby1: I'm doing some stuff with sqlite, and have gotten "commit-transaction: the database file is locked". Is this the exception referred to in the docs for sqlite-connect? 18:49 ShenIsBetter: ozzloy, do you like Taylor? 18:49 ozzloy: "just a bunch of geek" doesn't add any information. we're already in the context of discussing upcoming books on programming. 18:50 ShenIsBetter: you have read LoL, do you? 18:50 samth: ShenIsBetter: come back tomorrow if you can behave better 18:51 ShenIsBetter: pleaseee 18:52 (join) samthYoureTheOne 18:53 chandler: samth: You have a lot more patience than I do. 18:53 samthYoureTheOne: but i didn't do anything wrong.... 18:54 samth: chandler: MINSWAN 18:56 samth hopes that his web server doesn't go down 18:56 chandler: Heh. I had to google that. 19:00 (nick) samth -> samth_away 19:10 (quit) MayDaniel: 19:18 Diarmid: I'm hoping Realm of Racket will go over some of the more typically-unfamiliar things, like macros, call/cc, and maybe some Racket-specific stuff like the contracts. 19:24 lewis1711: ohh there's a racket book coming out? 19:24 Diarmid: Yes. 19:24 Diarmid: http://realmofracket.com/ 19:24 lewis1711: Diarmid: yeah I hope so too. I mean I can figure out the stuff that's like other languages except with brackets 19:24 Diarmid: Sadly there's no real information about it up. 19:24 (join) MarkSoric 19:25 MarkSoric: Hello! Just wondering if someone could help me out… I have a function that contains a (read) and recurses until EOF. Is there a way to supply a file to the function so I don't have to constantly type in umpteen integers? 19:25 lewis1711: LOL why is the logo a depressed looking teenaged boy 19:25 Diarmid: lewis1711: From screwing around with EMACS in the past I managed to pick up more than that, but the way macros are handled in Scheme isn't the same as other Lisps, and frankly, some of that stuff is a bit hard to get a handle on for me. 19:26 Diarmid: lewis1711: Got me. :P 19:26 MarkSoric: I guess what I mean is: is it possible to (read) from some kind of input file? 19:27 Diarmid: lewis1711: I quite like Design by Contract, so will probably end up using that. Given Python makes you addicted to lots of itty namespaces I may end up using that a lot too. 19:27 chandler: MarkSoric: You can either open the file as a port with `open-input-file', then read until EOF and close the port, or you can perahps just use `file->list'. 19:27 chandler: `file->list' reads all of the expressions from a given file and returns them as a list. 19:27 MarkSoric: So would I still call (read) then ? 19:27 MarkSoric: And would I get rid of the recursion? 19:27 lewis1711: Diarmid: like rackets contracts? Yeah i Like them too. though I wonder if they're slow 19:28 chandler: MarkSoric: If `file->list' works for you, then you wouldn't call `read' yourself. It recurses through the file automatically for you. 19:28 MarkSoric: chandler: Hmmm… I'll give it a shot. 19:28 MarkSoric: Thanks 19:29 Diarmid: MarkSoric: http://docs.racket-lang.org/guide/ports.html <-- if I understand what I read from Land of Lisp right, you probably want to use call-with-input-file to make sure file handles are released and whatnot 19:29 lewis1711: it'd be really handy if you could do type annotations where needed and they could function as contracts. I know there's typed rackets but that's very typed 19:30 Diarmid: At least that seems to be the equivalent to Common Lisp's with-open-file. 19:30 chandler: Yes, that'd be the direct equivalent, but my spidey sense is telling me that `file->list' is actually the right tool in this case. 19:31 MarkSoric: Diarmid: and chandler: Awesome - thanks guys 19:31 Diarmid: lewis1711: I use Python for a lot of stuff. Racket won't seem slow to me after that. ;) Also, I have more patience for waiting on the computer than I do fighting hard to find bugs. Further, I suspect there's a way to 'compile them out' if you really want to. Most contract support lets you, though the wisdom of doing so is questionable. 19:32 lewis1711: oh a compile them out option would be great 19:33 lewis1711: Diarmid: I use ruby mostly on a computer with less than a gig of ram and 1.8hhz process from almost a decade ago. fun times :D 19:34 Diarmid: lewis1711: The typed Racket stuff shouldn't be scary if you have familiarity with C or something similar (Java or C# for you younguns :P ). It apparently does type inference so you don't even have to expend much effort, and if you're overly concerned about speed, I suspect it helps lots. 19:34 Diarmid: lewis1711: At least it doesn't bear much resemblance to ML/Haskell type systems to me. I had no trouble understanding what little reading I did on it. 19:34 lewis1711: I find the error messages very confusing 19:34 lewis1711: It works ok on little functions 19:36 lewis1711: http://rosettacode.org/wiki/Power_set#Racket if anyone can typed/racket this I'd be curious (though the code itself may be garbage) 19:36 Diarmid: lewis1711: I haven't messed with it much, but it looks like the errors amount to stuff like "expected Integer, got String" and a location, which didn't seem too bad. It might be using the "arg1 * arg2 -> result" notation in places, which can be confusing at first unless you tried to blunder through Haskell for a while. Maybe it gets scarier. 19:37 (quit) kvda: Quit: -___- 19:38 Diarmid: I'm not sure how you type the dog staring at the gramophone symbol (lambda). :P 19:40 jamessan: there's a shortcut for it in DrRacket, but I forget what it is 19:40 lewis1711: ctrl-\ ? 19:41 lewis1711: yeah that's it 19:41 lewis1711: in vim it's ctr-k, l, * 19:41 lewis1711: I have a macro that renames it to "fn" for the repl 19:42 Diarmid: I must be the only person that doesn't type APL any more. ;_; 19:42 Diarmid: Does it actually work the same as if you'd typed "lambda"? 19:42 (quit) MarkSoric: Quit: MarkSoric 19:43 lewis1711: yes 19:44 lewis1711: Diarmid: http://pastebin.com/4iGDS3Rm that as a type error makes no sense to me, for example 19:44 lewis1711: For one thing there isn't even a make-sequence in there 19:46 Diarmid: It's from a macro expansion, most likely. 19:47 Diarmid: I'm not sure, but my *guess* at the problem is it wanted two things like lists or vectors, and one of them is a set. A set doesn't have a order, at least in most languages I'm aware of. 19:48 Diarmid: lewis1711: Have you looked at it in DrRacket's macro debugger? 19:51 (join) Gertm 19:53 (quit) gridaphobe: Remote host closed the connection 20:04 (quit) m4burns: *.net *.split 20:04 (quit) dsp_: *.net *.split 20:05 (join) dsp_ 20:05 Diarmid: lewis1711: This gives some tips on how to use Racket's contracts, including compiling them out: http://stackoverflow.com/questions/5671662/ 20:06 (join) m4burns 20:07 (join) dnolen 20:14 Diarmid: I probably shouldn't ask, but what's the deal with the Shen troll? Is it the developer of Shen, or some famous programming troll like Xah Lee, or somebody else? 20:29 asumu: Diarmid: Nobody knows. 20:29 asumu: I wouldn't expect Shen's developer to be that immature, so I doubt that. 20:32 Diarmid: asumu: Thanks for answering. Well, they seem to have just shown up in the last week or so. Maybe they'll get bored and go away. 20:32 Diarmid: For what it's worth I appreciate Racket, and this channel has been nicer to me than most. 20:32 asumu: Diarmid: They go back a bit longer. A few months ago he/she was trolling on the mailing list. 20:33 asumu: Also, good to hear. I think it's great that Racket is perceived as a nice community. 20:33 Diarmid: asumu: Someone mentioned the mailing list earlier. How is the signal to noise ratio on that, and is there a searchable archive somewhere, in case I can dredge a answer I need off it? 20:35 asumu: Diarmid: I find the signal to noise ratio is decent, in that most of the posts are actually about Racket. You can browse it here: http://dir.gmane.org/gmane.comp.lang.racket.user 20:35 asumu: (I find the gmane interface nice, but there are others listed on the website) 20:37 asumu: lewis1711: It shouldn't be too hard to convert that to TR, I think. There are typed versions of the for macros. 20:37 lewis1711: Diarmid: yeah I am sure I could solve it by going through the macro stepper thing. but to be honest if that's the price of static typing in racket it's not really worth it 20:38 lewis1711: (for me) 20:38 (quit) gf3: Excess Flood 20:38 (join) gf3 20:39 Diarmid: lewis1711: It's probably nice for high performance, but Python has convinced me that when your code is slow, you usually need to do things a different way. Unfortunately, there are corner cases where sometimes it's just plain old slow or ugly. That's how I ended up here. 20:40 lewis1711: I mainly prefer types for contract reasons. which racket contracts provides and for less effort. though ideally I would just like types at top level, even within modules. I think that can be done 20:40 Diarmid: lewis1711: Luckily they are exceedingly rare. I just ran into a patch of code where I really wanted deep (non-tail) recursion, and lambdas, which is sort of a odd experience given I haven't ever had that happen before and had messed with it for ages. 20:41 lewis1711: asumu: I will have a look for the typed for macros 20:41 Diarmid: lewis1711: I think they're fairly different notions. Types can either be so the computer can figure out what kind of storage and instructions to use for good speed, or as a form of error checking for passing the wrong 'kind of thing' to a function. 20:42 lewis1711: both function as a form of error checking which is mainly what I'm after 20:43 (quit) mceier: Quit: leaving 20:43 Diarmid: lewis1711: Contracts seem to be all about values, instead of kinds of things. While you can try to bludgeon value restrictions into a 'kind of thing' mold, it doesn't work very well. You'll end up doing a lot of nonsense 'conversions', and it's hard to say "I need the variable to have this property at (only) this point in the program", like a assert would give you. 20:44 Diarmid: asumu: Thanks. 20:44 lewis1711: I don't understand the distinction you are drawing between kind of thing and values 20:47 (join) realitygrill 20:51 (quit) dnolen: Ping timeout: 272 seconds 20:54 Diarmid: lewis1711: While I could conceivably make types for every possible combination of traits I want, working with them would be unpleasant. "non-zero" isn't so bad. "power of 2", by itself isn't so bad either. But when we get into "non-zero power of 2 less than or equal to 1024" (e.g. a dimension for a texture in a game system) things are getting a bit silly. 20:54 lewis1711: oh right 20:55 lewis1711: I guess maybe contracts fit more into my style of thinking then 20:55 lewis1711: because to me "values" are more important 20:55 lewis1711: and flexible 20:55 Diarmid: lewis1711: I already mentioned that you can force everything into a type system, but I find having preconditions, postconditions, (and in OO) inherited invariants (lets you know if the object got corrupted, and why), (in imperative code) loop variants/invariants (lets you know if the loop 'hung' and why), and assertions (lets you say you want a trait at just a particular point, like checking for zero before division) to be more 20:56 jamessan: Diarmid: you were cut off at "to be more" 20:56 Diarmid: "to be more natural" 20:57 lewis1711: also Diarmid: I saw that stackoverflow about compiling out contracts. seems irritating though, I'll just leave them in there for now, and maybe unit test instead if a contracted function proves too slow 20:58 Diarmid: lewis1711: Yes, I feel the same way, which is why I'd like something that does some of the things 'fancy' type systems do (e.g. I think CQual is really jiffy http://www.cs.umd.edu/~jfoster/cqual/ ), I think most of them have gone about it the wrong way. But that's just an opinion. Plenty of people like ML (and its variants), Haskell, and the various dependent-typed languages. 20:59 lewis1711: haskell is by far the best static type system I've used 20:59 lewis1711: it really makes other static type systems seem irritating in comparison 21:02 Diarmid: lewis1711: It wasn't for me I guess. 21:04 lewis1711: oh? what sort of static typing do you like? 21:04 Diarmid: lewis1711: BTW, if contracts and unit testing interest you, you might want to consider using both. The Cobra language encourages that. The idea is to use the unit tests to 'perturb' the code, and the contracts to isolate the bugs where they originate, so you don't spend as much time in the debugger. 21:05 lewis1711: call me close minded but I can't really be bothered with "pragmatic" scripting languages. I like them to have a theme, like pure OOP (ruby, smalltalk) or everythings a list (racket) 21:05 Diarmid: lewis1711: I haven't liked anything that went beyond what was necessary for generating decent assembly. I do think C/C++ could be improved upon some there, but it'd take doing it in a different language since it would break things. For instance, things old Fortran 77 couldn't do (like aliasing via pointers) allow it to be more heavily optimized. Heavy annotation could let something /like/ C do a better job. 21:05 lewis1711: I always thought if you're going to abstract that much why bother reimplementing BASIC or some kind of dynamic BASIC 21:06 lewis1711: sorry not dynamic Basic, dynamic... uh 21:06 lewis1711: Algol 21:06 lewis1711: so you're just not a fan of static typing in general? 21:07 Diarmid: lewis1711: I used to think that. I do think there are too many Fortran + call stack + classes /but with new syntax!/ in the world. Some 'genres' of programming are basically dead (e.g. dataflow), despite being rather nice for certain tasks. 21:07 asumu: lewis1711: I think there's a bug in TR that makes it hard to type-check your powerset code... so let me investigate that. 21:08 lewis1711: asumu: woohoo, inadvetently discovering bugs with my noobishness 21:09 Diarmid: lewis1711: In any case I've found that 'purity' doesn't work out so well. Sometimes (notably when working with math) what you really need *is* a function, not a class. I also like being able to write most of my code in a ... well, peculiar, style. I won't call it functional, because it's not, but I rather like operations on aggregates, and method chaining. 21:09 asumu: (namely (Setof x) is not a (Sequenceof x) for some reason) 21:10 lewis1711: Diarmid: my sweet spot is generally close to an ideal, but with some compromises. like ruby, where *almost* everything is an object 21:10 Diarmid: lewis1711: So I like being able to use very imperative code for I/O, and have the functional-oid, or whatever you want to call it, code separate, but I don't want to deal with multiple languages for that. Looks like Lisp and it's macros will let me do that without much pain. Lisp records and set give you OO. Most of the rest is functional. You can build the rest on as you want it. 21:10 lewis1711: but I have really gone off sort of "wish-washy" multiple paradigm stuff. I 21:10 asumu: lewis1711: BTW, Racket is definitely trying to shake off Lisp's "everything is a list" which is probably a flaw and not a feature. 21:11 lewis1711: asumu: what!? how will racket even be racket if the whole code isn't a big a list? 21:11 asumu: Racketeers frequently use structs, hashtable, etc. The syntax itself is represnted as syntax objects. 21:11 asumu: Which technically aren't lists (though they wrap them). 21:12 lewis1711: ohh, no Id on't mean list is the only data structure. I just mean the homoiconity 21:12 lewis1711: and everythign being inside of it 21:12 lewis1711: I am a big fan of sets, as you may have guessed :) 21:12 asumu: Well, I've never thought homoiconicity is a well-defined term. I mean, does Racket have that? After all, the syntax is not equal to quoted s-expressions. 21:12 lewis1711: Diarmid: racket has an OOP system 21:12 asumu: You have to use datum->syntax to get that. 21:13 asumu: But I get your point. 21:13 lewis1711: I think this stuff is over my head. tbh I just like the uniform syntax, it's a big feature for me 21:13 Diarmid: asumu: I hope it doesn't lose too much in the way of Lisp syntax and semantics. The only syntax I like better is assembly and Forth, because it's all I can think of with less syntax. :P Blame dealing with C++ too long. I hate complex syntax. I also like what Lisp's syntax lets you do with macros and the like, so they aren't just a way to obfuscate your code like they tend to be with cute preprocessor macros and template meta 21:13 Diarmid probably got cut off there somewhere. 21:14 lewis1711: template meta... (programming I guess) 21:14 asumu: Diarmid: I don't think you need to worry about that. I was really just talking about representation, not so much how macros look/syntax. 21:14 lewis1711: ah 21:14 Diarmid: Yeah "metaprogramming." 21:15 Diarmid: asumu: That's a relief. I suppose by having a more complex internal representation you could do better static checking or something, which is always nice. 21:17 lewis1711: speaking of brackets, is there a way to get brackets to match in xrepl or the like? like when you type a closing ), it briefly goes to its corresponding ( then back 21:17 asumu: Diarmid: syntax objects let you correlate your syntax with locations in your original program. They're also how the macro system internally tracks marks for hygiene and such. AFAIK anyway. 21:17 (join) dnolen 21:18 Diarmid: lewis1711: I assume Racket's OO system is inspired by CLOS. Most are. But even without it apparently doing similar things with Common Lisp and Scheme records isn't that hard. I brought it up because it lets you just do I/O imperatively, without any suffering, unlike 'pure' (no such thing, if you have I/O) declarative languages, and do the rest in whatever style pleases you (that you can build on the imperative or functional p 21:18 Diarmid: (that you can build on the imperative or functional parts). 21:19 lewis1711: the CLOS one was called swindle and is now considered deprecated (I think). 21:19 lewis1711: the current one is single dispatch 21:20 Diarmid: It'd be interesting to see how hard it would be to embed something like Lucid in Racket. I/O is already done with streams, so it seems natural for certain kinds of tasks, like audio/video processing, and maybe certain kinds of networking tasks. 21:21 (quit) dous: Remote host closed the connection 21:21 lewis1711: I remember reading this paper on some Self or smalltalk derivative... which had prototype based double dispatch. it bent my fragile undergraduate mind. 21:22 Diarmid: That would have been Self, yes. It was, I think, the first 'prototype based' language, like JavaScript (EMCA-Script, or whatever, now). Basically you don't have a class, instead you 'copy' objects from the few the system starts with. 21:23 Diarmid: I'm not all that thrilled with changing the semantics of stuff at run-time (which may make me bad company :P I know that's popular with Lisp and Ruby folks). The main thing I was impressed with it was the incredible performance they got out of their VM. 21:25 lewis1711: Diarmid: it was Slate, not Self. Self is single dispatch 21:26 Diarmid: I'm more fascinated by new string mauling techniques (e.g. SNOBOL, Icon, Scsh's SRE's) since I do that a lot, and weird evaluation methods (e.g. Forth, Pure (not sure what the first language of this type was), Lucid, Prolog, Refal...). 21:28 Diarmid: There doesn't seem to be much interest or appreciation of oddball evaluation methods any more. It can make certain tasks easier to describe in those languages, usually while making others very painful. I think it's odd that algorithms get so much focus when they only solve one problem, but programming languages which can theoretically solve any problem get much less. 21:30 Diarmid: Formal verification is pretty neat to me, as are object-capability security (mostly at the OS, rather than language level; i.e. installation endowments and powerboxes, not unforgable references), but I'm guessing those won't go anywhere due to lack of cooperation/demand. 21:31 lewis1711: I don't even know what an evaluation method is :( 21:31 Diarmid: Imperative code is like a list of instructions from a manual. It's sequences with branches and loops. 21:32 Diarmid: A lot of the time functional programming isn't that different. Lazy evaluation can change that. In that case stuff only gets executed if the results are actually *used*. 21:33 Diarmid: Beyond that, we get into stuff most people don't bother studying any more. Like with dataflow-style evaluation you can do something called speculative evaluation, which is where things are calculated as soon as all inputs are (re)defined. It's essentially the opposite of lazy evaluation. 21:34 Diarmid: As for why you might want to do that, the processor is idle most of the time on modern systems. If a lengthy computation can be run before the user asks for the results, then the results can often be given instantly. 21:34 lewis1711: haha, that's quite amusing 21:35 Diarmid: And then their's weirder stuff, like Prolog, which is pretty hard to explain... it's easier to just mess with it. 21:35 lewis1711: computers have stopped getting faster as quickly though haven't they? 21:35 lewis1711: ohh prolog. I did a bit of that for university. It never quite clicked with me 21:36 Diarmid: Forth is stack based, and not hard to explain, so you write things like "2 2 +", which shoves a 2 and a 2 onto the stack, which can be viewed as 'functions' that return themselves, and then the + is a function that pops 2 arguments and pushes the result. That's yet another kind of evaluation... 21:36 lewis1711: Forth has been on the list to learn for a while 21:36 lewis1711: that or Factor 21:36 Diarmid: Pure works by solving equations, algebra-style. Refal chops strings into trees and transforms them... All weird evaluation methods, but handy for certain things. 21:37 Diarmid: Yes, Moore's law broke down somewhere around the early 'zeros' (2000 and thereabouts) for normal processors. It has not broken down for video cards, which have actually exceeded it, if memory serves. 21:39 lewis1711: I wonder if that's a good or bad thing for computing 21:39 lewis1711: maybe good, because it will force efficiency 21:39 lewis1711: but bad, because it delays abstraction 21:39 Diarmid: That said, I don't think it's that big a deal. We have far more processing power than we *need* for even really good looking 3-D games. The only reason things are slow are due to implementations being inefficient. There's no way a chat client like the one I'm using needs 200 to 300MB of RAM (what mine uses after a day or two). 21:40 Diarmid: I had a IRC client on my Pentium 1, and that system only had 16MB. :P The client was fancier too. 21:40 lewis1711: yeah but what would you do, write everything in highly optimised C? 21:41 Diarmid: I think there's a lot of alternatives. First, we know only about 3% of the code 'matters' performance wise (I can point you at the paper if you care). Just fixing the algorithms there will drastically improve things. 21:41 lewis1711: also don't most operating systems allocate far more ram then they need to, because ideal ram is pointless? 21:41 lewis1711: *idle 21:42 Diarmid: I think there's a misunderstanding about how high level programming languages effect code generation. You hear a lot of stuff like "because X and Y is implementation defined, and you don't specify how everything is done, it can be optimized much more heavily!", or better yet "there are no slow programming languages, only slow implementations!" 21:44 Diarmid: Well, sorry, no, there are slow programming languages. They're inherently slow because of things the compiler /just can't know/, so it can't perform a optimization for you. This is why (pure; no cheating using C/assembly modules) Python will always get spanked by Fortran. There's aliasing. You can redefine *everything* at run time. 21:46 Diarmid: As for OS's, I guess 'that depends'. It depends on the OS and architecture. There are things to think about like whether the processor will tolerate things that aren't aligned by some amount (as opposed to crash the kernel or app outright). There's questions of page size, because the finest grain you can allocate memory to a process is at the page level, at least on most hardware with memory protection boundaries. 21:46 Diarmid: The OS isn't to blame for most bloat though. 21:47 Diarmid: You can't even blame garbage collection. Early Lisps often did useful things in 64 to 256kB of RAM. You can still dredge up copies of Micro-Lisp and VLISP 8 and whatnot for things like the Commodore 64. Also, OCamel often ties with C and C++ in benchmarks, despite garbage collection. 21:49 Diarmid: Though the love of lazy garbage collection probably isn't doing anybody any performance (grinds the disk and trashes the cash) and memory efficiency (wait to free the memory whenever you feel like it) favors. OCaml's 'trick' is trying to eliminate GC where it can do so safely. 21:50 Diarmid: Anyway, what we could do is start writing the 3% our code 'that matters' efficiency wise in some restricted language (e.g. no aliasing) with heavy annotations to help the optimizer, then let it spew out the assembly, and link it to our comfy high level languages, and maybe tweak the garbage collectors some. 21:54 lewis1711: I always thought the C + high level approach was good. though I dunno, people like the CLR/JVM approach 21:56 Diarmid: There's some very good things about the CLR (and to a lesser extent, the JVM). The CLR has been made very friendly to 'weird' languages. It makes it possible to use everybody else's stuff from your pet language, and people using common things like C# to use yours (if your implementation was designed with this in mind, and it should be). This never existed before. 21:57 (quit) wtetzner: Remote host closed the connection 21:57 Diarmid: The JVM doesn't seem to be very friendly to weird languages, which is why I guess things like Clojure are missing some typical Lisp features, but you can get kinda close. 21:58 Diarmid: And BTW, both can call native code, so there's nothing saying you can't compile to CLR or JVM and do what I said. 21:58 Diarmid: You're stuck with the garbage collector behaving less than ideally though. 21:59 lewis1711: oh they *can* call native code 21:59 lewis1711: sure 21:59 lewis1711: but in practice it's so much easier in racket or ruby or lua 22:00 Diarmid: Well, none of those things use the CLR or JVM (though I think there might be JRuby). 22:00 Diarmid: But all of those can also call native code, so can still potentially perform really fast. :P 22:01 Diarmid: Ruby may suffer from some of the issues Python has. I know monkey patching is highly encourage there, and that does pretty much doom your performance. 22:01 lewis1711: huh? that's not what I said 22:01 Diarmid: But I guess you could write anything memory wasting or slow in the native code. 22:02 lewis1711: I said it's much easier to call native code in those 3 languages, than it is in a JVM or CLR language 22:03 (quit) Nisstyre: Remote host closed the connection 22:03 Diarmid: Oh, I dunno about that. What I saw in Java and C# didn't look all that awful. 22:03 Diarmid: Not that I've tried to do it mind you. :P 22:04 lewis1711: haha. racket isn't too bad 22:04 lewis1711: the languages I've successfully done this with are racket, lua, ruby, gambit scheme (completely trivial as it compiles to C). I failed with java and python 22:05 Diarmid: I've basically given up on 'the world' though. I'm satisfied with writing inefficient but pretty stuff (design wise) for myself. Stuff I've done for other people has mostly been code that will probably have to be changed completely in 6 to 12 months, since it's all glue anyway. 22:07 (join) Nisstyre 22:09 Diarmid: Well, if you need a Scheme that's great for speed, I seem to remember Stalin was pretty impressive. It also compiles to C. 22:09 Diarmid: Python is known to be... difficult. 22:09 lewis1711: meh racket is plenty fast enough 22:09 Diarmid: Stackless Python is supposed to be easier to link to native code than CPython. 22:10 Diarmid: Python also has some restrictions that can be frustrating for embedding, namely that it's necessarily single-threaded. The closest you can get to real multithreading is processes and pipes, which arguably isn't so bad, but doesn't sit well with a lot of people.. 22:13 (quit) rostayob: Ping timeout: 244 seconds 22:20 Diarmid: lewis1711: On the 'idle ram' comment, I like how Linux does things. Any RAM that isn't allocated to a process is used for disk caching. If you have a bunch to spare, this can be great. You generally don't want to set your drives up to have a long weight before flushing (since you could lose data if the power goes out or something), but it's really great for read-caching. 22:22 (quit) vkz: Quit: vkz 22:31 (join) dous 22:32 (join) asdfhjkl 22:40 (quit) masm: Quit: Leaving. 22:46 (join) yoklov 22:57 (join) vkz 23:06 (quit) derrida: Ping timeout: 260 seconds 23:11 (join) derrida 23:18 (join) mithos28 23:26 (join) neilv 23:30 (part) lewis1711 23:40 (join) MarkSoric 23:40 neilv: editing a few planet packages at once, having most of the files named main.rkt or info.rkt is not the greatest 23:41 (part) MarkSoric 23:47 (join) mye_ 23:48 (quit) dnolen: Ping timeout: 252 seconds 23:55 neilv: this is how response/html-template expands when you have dynamic parts and you don't care about ordering, flushing, or size. http://paste.lisp.org/display/128388 23:56 neilv: when the template is all static, it will always do this: http://paste.lisp.org/display/128380