00:09 eli: Rakko: You're still doing the same mistake. 00:24 (join) black_13 00:55 Rakko: I know :( 00:55 Rakko: but I don't understand the way to use this 00:56 Rakko: does #lang always introduce a module? 01:00 eli: Rakko: yes 01:00 (quit) black_13: Ping timeout: 240 seconds 01:00 eli: And evaluating (module foo racket (printf "blah\n")) does *not* print anything. 01:03 Rakko: ok, it helps to know that... #lang racket is shorthand for (module foo racket (...)) ? 01:04 Rakko: and the (module foo racket (...)) is the ONE toplevel definition that DrRacket allows? 01:05 eli: Yes, `#lang racket' is (roughly) shorthand for (module foo racket ...); but that's irrelevant -- since whatever you know about modules you should know about files with "#lang". 01:05 Rakko: right 01:06 Rakko: I know next to nothing about modules, obviously, but I understand that evaluating them does not run them. So how do I "run" them? 01:06 eli: As fo the drracket question, I don't understand it. It allows many toplevel definitions, like (define x 3) for example. 01:06 eli: s/fo/for/ 01:06 eli: You run a module by requiring it. 01:07 eli: You can require a module from a file "foo.rkt" by running "racket foo.rkt". 01:07 Rakko: Oh. Using the name given to the module form (e.g. foo above)? 01:07 Rakko: Oh, so it can only be required from *another* file. 01:07 eli: Yes, but that's irrelevant for your uses, since if you start with a #lang, there is no way for you to enter another expression after the end of the module. 01:07 Rakko: Right 01:08 eli: No, in general, a module could be required from the same file it is defined at, 01:08 Rakko: (Incidental question: what name does Racket give to a module that starts with #lang?) 01:08 eli: provided that this whole file is itself not evaluated inside a module. 01:09 eli: (There's no specific name, "module" does fine. "Source file" is too, since people mostly expect files to start with a #lang line these days.) 01:09 Rakko: Oh, no -- I didn't mean that. I meant, what identifier does Racket assign to a *specific* module if the module starts with #lang? 01:10 Rakko: assuming the module is assigned a name using the (module ... ) form 01:10 eli: It's either a name based on the file name, or something like `anonymous-module' if it's not from a file. 01:11 eli: But you should most likely *not* care about that. 01:11 Rakko: Re the DrRacket question: 01:12 eli: If you do care about that name, and given that you "know next to nothing about modules", then you're almost guaranteed to be doing something wrong. 01:12 Rakko: right 01:13 Rakko: Re DrRacket question: I've loaded the Scheme file I've been trying to run in DrRacket. I have "determine language from source" set. When I try to run it in DrR, it says "Module Language: there can only be one expression in the definitions window in: (require srfi/13)". "(require srfi/13)" is the first non-comment expression in the file. There is no #lang line. 01:14 Rakko: *That* was the one-expression requirement I was referring to. 01:15 eli: You're confusing terms. 01:15 Rakko: Right, sorry; I said "definition" 01:16 eli: That context is not a toplevel context -- that's a term that is always referring to the repl. 01:16 Rakko: OK, so that too 01:16 eli: In any case, you should always use #lang, and forget about `eval', `load', and other old diseases. 01:17 Rakko: OK, that brings me back to my original (practical) question 01:18 Rakko: If I want to take a Scheme program that runs just fun on the command-line (racket -r file.scm), but add #lang to it, what else do I need to add so that it runs on the command line? 01:18 Rakko: Edit: on the command-line *and* in DrRacket. 01:19 eli: If it has no #lang line, then you can't use the "determine from source" langugae. 01:19 eli: You can try the legacy "pretty big" language. 01:20 eli: But I can only repeat what I said above -- it's a very bad idea to use `eval', and `load', etc. 01:20 eli: (Using the "-r" flag is essentially the same as `load', which is essentially the same as `eval'.) 01:20 Rakko sighs 01:21 Rakko: I know that... but then how do I run programs from the command line? 01:21 eli: See what I said above. 01:21 eli: Use a sane file (one with #lang) 01:21 eli: And run it with "racket some-file.rkt" 01:21 eli: Which you can easily turn to a script too, in a number of ways. 01:21 Rakko: ohhhh, so no command line option 01:22 eli: Yes. 01:22 eli: That should have been the obvious case, btw. 01:22 Rakko: so what I'm getting from this is that there are legacy ways and currently-approved ways, and I'm mixing them up horribly 01:22 eli: The legacy thing was always a very bad idea. 01:23 eli: It's still available though -- so it's "approved". 01:23 eli: Just that it can be very confusing to mix them -- which you did. 01:23 Rakko: Yeah, it should have been... all this time I've just been looking at the top of the file, where it says ":";exec mzscheme -r $0, and assuming that it must be run that way. 01:24 eli: IIRC, the minute you mentioned this (or when someone else did), I said that it's a bad line. 01:24 Rakko: Oh. 01:24 eli: http://docs.racket-lang.org/guide/scripts.html 01:25 Rakko: It actually isn't bad, *as long as* I don't include #lang. 01:25 Rakko: Or, I should say, it works fine. 01:25 Rakko: Not best practices, sure... 01:26 eli: Well, the main part there that is bad is "-r". 01:26 Rakko: ok 01:28 Rakko: Now, on languages... I tried running this with Pretty Big, but it's complaining: define-struct: bad syntax in: (define-struct lparen (spaces-before num-aligned-subforms (num-finished-subforms #:auto)) #:mutable #:auto-value 0) 01:29 Rakko: What language would I select in the GUI that would be equivalent to "#lang scheme"? 01:29 Rakko: I see R5RS and PrettyBig, but neither one runs this script (it does run with #lang scheme though) 01:29 eli: Like I said N-1 times, you should just use a #lang line. 01:30 Rakko: I should, yes, but I'd like to understand better what the manually-set languages are. I'm not ignoring you. 01:30 eli: The pretty big language is a legacy language -- it doesn't have things from the last 2-3 years. For example, it has a very simple `define-struct'. 01:30 eli: It is the one that you get if you use `#lang mzscheme'. 01:31 eli: But seriously -- there is no point in understanding all the subtle points about those things before you have a good grip on the basics. 01:31 Rakko: OK. How about "#lang scheme"? 01:32 eli: What about it? 01:32 Rakko: What lang would I choose in the GUI that would be the same as that? 01:33 eli: "Determine language from source". 01:34 Rakko: No, I mean -if- I don't supply #lang. (I'm sorry to keep repeating myself... I'm not trying to be obtuse) 01:35 Rakko: I've taken your message to heart and have put a proper #! line and #lang line at the top, so this program should be good to go. 01:36 eli: Well, if you don't have a #lang line, *and* you want a toplevel-like thing, but one that is initialized with the `scheme' language, *and* you want it in drracket, then you're out of luck... 01:37 Rakko: OK. 01:37 eli: It's possible to do that with racket, but that's kind of difficult to follow. 01:37 Rakko: Now when you say "toplevel-like", you are referring to the REPL? 01:37 eli: (And given the number of times I said the above, you can see why nobody bothered making such a thing...) 01:37 eli: No, I'm referring to the pretty big language. 01:37 Rakko: Oh. 01:38 eli: In there, the code in the definitions window is kindof loaded as with "-r". 01:38 eli: So the definitions themselves are evaluated in the same way as if they were entered on the repl. 01:39 eli: (And you can see that using a #lang in pretty big does nothing.) 01:39 Rakko: ok 01:39 Rakko: I'm starting to piece these things together. 01:41 Rakko: With your help, obviously :) 01:42 eli: Well, as a general rule of thumb you should see how using #lang consistently avoids problems. 01:42 Rakko: yeah 01:44 Rakko: DrRacket doesn't have breakpoints, does it? 01:46 eli: Thre's a "debug" button that you can use, and I think it allows setting breakpoints. 01:46 eli: I never use it though. 01:49 Rakko: Oh, cool. 01:49 Rakko: Someone else was asking 01:50 eli: ? 01:52 Rakko: Just before you started talking 01:53 Rakko: I don't see it in debug, but it might be there somewhere 01:53 Rakko: Debug is handy though :) 01:53 eli: Possibly. Not for me though. 02:06 Rakko: I used it to find a bug in this indenting program 02:12 (join) jonrafkind 02:13 Rakko: Hi jonrafkind 02:13 Rakko: Is there a way to make racket save bytecode upon running a file? 02:13 jonrafkind: yo dawg 02:14 jonrafkind: with drracket or racket? 02:14 jonrafkind: drracket is supposed to create zo files when you run a program 02:14 Rakko: plain racket 02:14 jonrafkind: theres probably a way to do with with racket but im not exactly sure how.. 02:14 jonrafkind: can you ask on the list? 02:14 Rakko: nah, not that important 02:14 jonrafkind: i guess you want the compilation manager to execute for you 02:14 jonrafkind: you can always just run mzc -k * 02:14 Rakko: I found raco make, which works nicely 02:14 jonrafkind: or whatever it is now, raco make * 02:14 Rakko: yup 02:14 jonrafkind: ok 02:15 jonrafkind: i think its a nice feature, ill see if i can find out how to do it 02:15 jonrafkind: tommorow 02:15 Rakko: I just thought it would make sense for the JIT to save bytecode, if it was going to generate it in the first place 02:15 Rakko: jonrafkind: don't bother... not important and I've bothered people on this chan enough for one night :) 02:15 jonrafkind: ah, well the JIT produces native code, the bytecode is a level above that 02:15 jonrafkind: source -> bytecode -> JIT 02:15 jonrafkind: the JIT'd code is never saved 02:15 Rakko: oh yeah 02:15 Rakko: I meant bytecode, not JIT 02:16 jonrafkind: i guess the current thinking is its a waste of time to save JIT output 02:16 Rakko: although that would be cool too, wouldn't it? 02:16 jonrafkind: i suppose in theory, i dont know what the costs are 02:16 jonrafkind: but no VM's that I know of save the JIT code 02:16 jonrafkind: do you know of any? 02:17 Rakko: no 02:17 Rakko: I know of one compiler that can take Java bytecode and compile it to native ahead of time, but no VM that does that 02:18 Rakko: Or... hmm, maybe some of the .NET ones? I seem to remember when installing a .NET assembly there is an optimization phase, but I don't know if that makes native code or not. 02:18 Rakko: But again, that doesn't qualify as JIT 02:19 jonrafkind: you would probably need a very large application for the cost to be worthwhile 02:19 jonrafkind: otherwise i guess its negligable 02:19 jonrafkind: im just guessing of course 02:20 Rakko: yeah 02:20 Rakko: or something that runs really often 02:29 (quit) jonrafkind: Read error: Operation timed out 02:35 (nick) rotty_ -> rotty 02:48 Rakko: night 02:56 (quit) Rakko: Quit: Rakko 04:00 (part) offby1: "ERC Version 5.3 (IRC client for Emacs)" 04:02 (quit) rbarraud_: Read error: Connection reset by peer 04:02 (quit) hanDerPeder: Quit: hanDerPeder 04:09 (quit) emma: Ping timeout: 265 seconds 05:02 (join) hanDerPeder 07:24 (join) rbarraud 07:40 (quit) rbarraud: Ping timeout: 276 seconds 08:23 (quit) hanDerPeder: Ping timeout: 260 seconds 09:55 (join) b-man_ 10:18 (join) sstrickl 10:52 (join) tonyg 10:59 (join) dzhus 10:59 (quit) b-man_: Remote host closed the connection 11:00 (join) adadglgmut_ 11:02 (quit) adadglgmut: Ping timeout: 272 seconds 11:12 (quit) adadglgmut_: Ping timeout: 265 seconds 11:21 (join) anRch 11:22 (join) emma 11:29 (quit) emma: Ping timeout: 264 seconds 11:29 (join) emma 11:45 (quit) emma: Remote host closed the connection 12:12 (join) jonrafkind 12:15 (join) hanDerPeder 12:23 (quit) anRch: Quit: anRch 12:29 (join) anRch 12:45 (join) emma 12:50 (quit) emma: Ping timeout: 260 seconds 12:54 (quit) anRch: Quit: anRch 13:10 (join) emma 13:48 (join) adadglgmut 13:55 (join) anRch 14:29 (join) fjl 14:42 (quit) jao: Ping timeout: 245 seconds 14:44 (join) carleastlund 15:12 (quit) anRch: Quit: anRch 15:27 (quit) adadglgmut: Quit: Leaving 15:30 (quit) Lajla: Read error: Connection reset by peer 15:32 (join) Lajla 15:49 (quit) fjl: Quit: Leaving. 15:55 (join) _ryanc_ 16:05 (join) jao 16:38 (join) rbarraud 16:38 (join) stamourv 16:53 tewk: I'm looking for some large modules I can require to exercise the reader, I' 16:54 tewk: m trying to benchmark symbol table performance with places. 16:54 tewk: Any suggestions of large modules? 16:54 jay-mccarthy: look at the parsers that use parser-tools 16:54 jay-mccarthy: like algol60 16:54 jonrafkind: did you find the largest modules in the collects tree already? 16:54 jay-mccarthy: it expands into something huge 16:55 jonrafkind: i would expect the class system to be quite large.. 16:55 jay-mccarthy: most scribble documentation is very large too 16:55 tewk: jay-mccarthy: thanks 17:08 (quit) tonyg: Quit: home time 17:46 (quit) dzhus: Read error: Operation timed out 18:27 (quit) sstrickl: Quit: sstrickl 18:49 (quit) _ryanc_: Quit: Leaving 18:50 (quit) rbarraud: Read error: Connection reset by peer 18:50 (join) rbarraud 19:30 (join) adadglgmut 19:55 (quit) jao: Ping timeout: 245 seconds 20:20 (quit) carleastlund: Quit: carleastlund 20:35 (join) b-man_ 20:39 (quit) jonrafkind: Ping timeout: 264 seconds 22:06 (quit) b-man_: Remote host closed the connection 22:35 (join) black_13 22:35 (quit) black_13: Client Quit