<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">Hello,<br><br>I'm working with a student on creating a super high resolution image using racket (limited only by imagemagick's ability to paste images together). To do this we are breaking the rendering process into many smaller images that will be rendered individually by separate machines and reassembled by a server. Each image is processed individually as a byte string and saved to a file. We started to use the universe package and built a server to "serve" individual zooms to clients which would then respond with a byte string which the server saved to an image file to be compiled later by imagemagick. The problem we ran into was that the server displays the messages passed back and forth and displaying the byte strings is too slow. Is there a way to depress the
display of information in messages? I had trouble finding it in the documentation.<br><br>Thanks in advance for your help!<br><br>Best,<br>Dan Anderson<br><br><br><div><span><br></span></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Tuesday, February 11, 2014 7:14 AM, "users-request@racket-lang.org" <users-request@racket-lang.org> wrote:<br> </font> </div> <div class="y_msg_container">Send users mailing list submissions to<br> <a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> <a
href="http://lists.racket-lang.org/users/listinfo" target="_blank">http://lists.racket-lang.org/users/listinfo</a><br>or, via email, send a message with subject or body 'help' to<br> <a ymailto="mailto:users-request@racket-lang.org" href="mailto:users-request@racket-lang.org">users-request@racket-lang.org</a><br><br>You can reach the person managing the list at<br> <a ymailto="mailto:users-owner@racket-lang.org" href="mailto:users-owner@racket-lang.org">users-owner@racket-lang.org</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of users digest..."<br><br><br>[Racket Users list:<br> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users </a>]<br><br><br>Today's Topics:<br><br> 1. Re: Y combinator (Matthias Felleisen)<br> 2. Re: Y combinator (Matthias Felleisen)<br> 3. Re: Y combinator (Matthew
Johnson)<br> 4. Re: Y combinator (Matthias Felleisen)<br> 5. Re: Is racket suitable for such a project? (Neil Van Dyke)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 11 Feb 2014 09:37:40 -0500<br>From: Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>><br>To: Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>><br>Cc: "<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a>" <<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a>>,<br> "<a ymailto="mailto:plragde@uwaterloo.ca" href="mailto:plragde@uwaterloo.ca">plragde@uwaterloo.ca</a>" <<a ymailto="mailto:plragde@uwaterloo.ca"
href="mailto:plragde@uwaterloo.ca">plragde@uwaterloo.ca</a>><br>Subject: Re: [racket] Y combinator<br>Message-ID: <<a ymailto="mailto:FD7CBBE3-7B10-438E-A983-BB1E2CD1DB95@ccs.neu.edu" href="mailto:FD7CBBE3-7B10-438E-A983-BB1E2CD1DB95@ccs.neu.edu">FD7CBBE3-7B10-438E-A983-BB1E2CD1DB95@ccs.neu.edu</a>><br>Content-Type: text/plain; charset=iso-8859-1<br><br><br>On Feb 11, 2014, at 12:48 AM, Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br><br>> I am still a little unclear. Is this a logical result, or a result of the evaluator's rules? Or are they the same thing? <br><br><br>They are the same thing. To calculate with the Racket that you see in the book/derivation, use this rule: <br><br> ( (lambda (x) e) V ) ~ e with all [free] occurrences of x replaced by V<br><br>[This is the rule you learn in pre-algebra, with the 'free' needed here because
<br>variables can occur at more places than in pre-algebra.] Using this rule, plus <br>simple car/cdr/cons/+1 rules, you can confirm every step in the derivation. As it <br>turns out, the compiler implements this rule totally faithfully BUT instead of <br>copying actual code it "copies" references to code by moving things from registers<br>to registers. Because the two are equivalent, a programmer can use the above<br>rule to think about code and the compiler writer (one among 10,000s of language<br>users) is the only one who has to keep references, registers, and replication <br>in mind (kind of). <br><br>-- Matthias<br><br><br><br><br>------------------------------<br><br>Message: 2<br>Date: Tue, 11 Feb 2014 10:01:43 -0500<br>From: Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>><br>To: Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com"
href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>><br>Cc: "<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a> Users" <<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a>><br>Subject: Re: [racket] Y combinator<br>Message-ID: <<a ymailto="mailto:15E77E00-DE15-451B-8A3E-19F2A4F5BB73@ccs.neu.edu" href="mailto:15E77E00-DE15-451B-8A3E-19F2A4F5BB73@ccs.neu.edu">15E77E00-DE15-451B-8A3E-19F2A4F5BB73@ccs.neu.edu</a>><br>Content-Type: text/plain; charset=iso-8859-1<br><br><br><br>Ouch, I forgot to explain V. NO, you canNOT replace x with arbitrary expressions. You may use ONLY VALUES (V for Value). In this context a value is one of: #t/#f, number, or a lambda expression. -- Matthias<br><br><br><br><br><br>On Feb 11, 2014, at 9:50 AM, Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com"
href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br><br>> The general form: ( (lambda (x) e) V) ~ e with all [free] x replaced by V<br>> <br>> In concrete terms means: ( (lambda (x) (* x y) 2) ~ (* 2 y) ?<br>> <br>> I figure best to be sure now.<br>> <br>> Thanks and best regards<br>> <br>> matt johnson<br>> <br>> <br>> On 11/02/2014, at 3:35 PM, Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>> <br>>> <br>>> On Feb 11, 2014, at 12:48 AM, Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br>>> <br>>>> I am still a little unclear. Is this a logical result, or a result of the evaluator's rules? Or are they the same thing?<br>>> <br>>> <br>>> They are the same thing. To
calculate with the Racket that you see in the book/derivation, use this rule:<br>>> <br>>> ( (lambda (x) e) V ) ~ e with all [free] occurrences of x replaced by V<br>>> <br>>> [This is the rule you learn in pre-algebra, with the 'free' needed here because<br>>> variables can occur at more places than in pre-algebra.] Using this rule, plus<br>>> simple car/cdr/cons/+1 rules, you can confirm every step in the derivation. As it<br>>> turns out, the compiler implements this rule totally faithfully BUT instead of<br>>> copying actual code it "copies" references to code by moving things from registers<br>>> to registers. Because the two are equivalent, a programmer can use the above<br>>> rule to think about code and the compiler writer (one among 10,000s of language<br>>> users) is the only one who has to keep references, registers, and replication<br>>> in mind (kind
of).<br>>> <br>>> -- Matthias<br>>> <br><br><br><br><br>------------------------------<br><br>Message: 3<br>Date: Tue, 11 Feb 2014 16:06:03 +0100<br>From: Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>><br>To: Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>><br>Cc: "<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a> Users" <<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a>><br>Subject: Re: [racket] Y combinator<br>Message-ID: <<a ymailto="mailto:3538474613101379763@unknownmsgid" href="mailto:3538474613101379763@unknownmsgid">3538474613101379763@unknownmsgid</a>><br>Content-Type: text/plain; charset=ISO-8859-1<br><br>So in terms of my example:<br><br>We have the general
form: ( (lambda (x) e) V) ~ e with all [free] x<br>replaced by V<br><br>And for V <-- 2 :: ( (lambda (x) (* x y) 2) ~ (* 2 y) ?<br><br>But for V <-- z^2 :: error and NOT ~ (* (* z z) y) ?<br><br>Thanks<br><br>On 11/02/2014, at 3:59 PM, Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br><br>><br>><br>> Ouch, I forgot to explain V. NO, you canNOT replace x with arbitrary expressions. You may use ONLY VALUES (V for Value). In this context a value is one of: #t/#f, number, or a lambda expression. -- Matthias<br>><br>><br>><br>><br>><br>> On Feb 11, 2014, at 9:50 AM, Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br>><br>>> The general form: ( (lambda (x) e) V) ~ e with all [free] x replaced by V<br>>><br>>> In concrete terms
means: ( (lambda (x) (* x y) 2) ~ (* 2 y) ?<br>>><br>>> I figure best to be sure now.<br>>><br>>> Thanks and best regards<br>>><br>>> matt johnson<br>>><br>>><br>>> On 11/02/2014, at 3:35 PM, Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>>><br>>>><br>>>> On Feb 11, 2014, at 12:48 AM, Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br>>>><br>>>>> I am still a little unclear. Is this a logical result, or a result of the evaluator's rules? Or are they the same thing?<br>>>><br>>>><br>>>> They are the same thing. To calculate with the Racket that you see in the book/derivation, use this rule:<br>>>><br>>>> ( (lambda (x) e) V ) ~ e
with all [free] occurrences of x replaced by V<br>>>><br>>>> [This is the rule you learn in pre-algebra, with the 'free' needed here because<br>>>> variables can occur at more places than in pre-algebra.] Using this rule, plus<br>>>> simple car/cdr/cons/+1 rules, you can confirm every step in the derivation. As it<br>>>> turns out, the compiler implements this rule totally faithfully BUT instead of<br>>>> copying actual code it "copies" references to code by moving things from registers<br>>>> to registers. Because the two are equivalent, a programmer can use the above<br>>>> rule to think about code and the compiler writer (one among 10,000s of language<br>>>> users) is the only one who has to keep references, registers, and replication<br>>>> in mind (kind of).<br>>>><br>>>> --
Matthias<br>><br><br><br>------------------------------<br><br>Message: 4<br>Date: Tue, 11 Feb 2014 10:09:44 -0500<br>From: Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>><br>To: Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>><br>Cc: "<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a> Users" <<a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a>><br>Subject: Re: [racket] Y combinator<br>Message-ID: <<a ymailto="mailto:EC4AB567-A8E4-4520-A924-5E2647AF6FCA@ccs.neu.edu" href="mailto:EC4AB567-A8E4-4520-A924-5E2647AF6FCA@ccs.neu.edu">EC4AB567-A8E4-4520-A924-5E2647AF6FCA@ccs.neu.edu</a>><br>Content-Type: text/plain; charset=iso-8859-1<br><br><br>On Feb 11, 2014, at 10:06 AM, Matthew Johnson
<<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br><br>> So in terms of my example:<br>> <br>> We have the general form: ( (lambda (x) e) V) ~ e with all [free] x<br>> replaced by V<br>> <br>> And for V <-- 2 :: ( (lambda (x) (* x y) 2) ~ (* 2 y) ?<br>> <br>> But for V <-- z^2 :: error and NOT ~ (* (* z z) y) ?<br><br>Not error. It just doesn't reduce. But usually this doesn't happen, z will have been replaced with a value. <br><br><br><br>> <br>> Thanks<br>> <br>> On 11/02/2014, at 3:59 PM, Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>> <br>>> <br>>> <br>>> Ouch, I forgot to explain V. NO, you canNOT replace x with arbitrary expressions. You may use ONLY VALUES (V for Value). In this context a value is one of: #t/#f, number,
or a lambda expression. -- Matthias<br>>> <br>>> <br>>> <br>>> <br>>> <br>>> On Feb 11, 2014, at 9:50 AM, Matthew Johnson <<a ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br>>> <br>>>> The general form: ( (lambda (x) e) V) ~ e with all [free] x replaced by V<br>>>> <br>>>> In concrete terms means: ( (lambda (x) (* x y) 2) ~ (* 2 y) ?<br>>>> <br>>>> I figure best to be sure now.<br>>>> <br>>>> Thanks and best regards<br>>>> <br>>>> matt johnson<br>>>> <br>>>> <br>>>> On 11/02/2014, at 3:35 PM, Matthias Felleisen <<a ymailto="mailto:matthias@ccs.neu.edu" href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>>>> <br>>>>> <br>>>>> On Feb 11, 2014, at 12:48 AM, Matthew Johnson <<a
ymailto="mailto:mcooganj@gmail.com" href="mailto:mcooganj@gmail.com">mcooganj@gmail.com</a>> wrote:<br>>>>> <br>>>>>> I am still a little unclear. Is this a logical result, or a result of the evaluator's rules? Or are they the same thing?<br>>>>> <br>>>>> <br>>>>> They are the same thing. To calculate with the Racket that you see in the book/derivation, use this rule:<br>>>>> <br>>>>> ( (lambda (x) e) V ) ~ e with all [free] occurrences of x replaced by V<br>>>>> <br>>>>> [This is the rule you learn in pre-algebra, with the 'free' needed here because<br>>>>> variables can occur at more places than in pre-algebra.] Using this rule, plus<br>>>>> simple car/cdr/cons/+1 rules, you can confirm every step in the derivation. As it<br>>>>> turns out, the compiler implements this rule totally
faithfully BUT instead of<br>>>>> copying actual code it "copies" references to code by moving things from registers<br>>>>> to registers. Because the two are equivalent, a programmer can use the above<br>>>>> rule to think about code and the compiler writer (one among 10,000s of language<br>>>>> users) is the only one who has to keep references, registers, and replication<br>>>>> in mind (kind of).<br>>>>> <br>>>>> -- Matthias<br>>> <br><br><br><br><br>------------------------------<br><br>Message: 5<br>Date: Tue, 11 Feb 2014 10:11:59 -0500<br>From: Neil Van Dyke <<a ymailto="mailto:neil@neilvandyke.org" href="mailto:neil@neilvandyke.org">neil@neilvandyke.org</a>><br>To: Yuhao Dong <<a ymailto="mailto:ithisa@outlook.com" href="mailto:ithisa@outlook.com">ithisa@outlook.com</a>><br>Cc: <a ymailto="mailto:users@lists.racket-lang.org"
href="mailto:users@lists.racket-lang.org">users@lists.racket-lang.org</a><br>Subject: Re: [racket] Is racket suitable for such a project?<br>Message-ID: <<a ymailto="mailto:52FA3DBF.6000405@neilvandyke.org" href="mailto:52FA3DBF.6000405@neilvandyke.org">52FA3DBF.6000405@neilvandyke.org</a>><br>Content-Type: text/plain; charset=UTF-8; format=flowed<br><br>I can't answer the question in the Subject header off-the-cuff, but I <br>can comment on some of the details...<br><br>For an onion router that has to handle lots of traffic at high speed, my <br>first guess would be C or maybe C++ (not Go or Java), though I can <br>appreciate wanting a higher-level language for this task.<br><br>I might also look at Erlang.<br><br>I would consider Python only if the project involves huge numbers of <br>people running onion nodes, and you want them to be able to inspect the <br>software themselves. Python is far from perfect for this task, but it <br>would
be good in that large numbers of people can read it, and a better <br>overall fit than JS.<br><br>If you want to do it in Racket, also take a look at Gambit C, which is <br>my Scheme-y backup if I ever need lots of threads.<br><br>If you want to get creative, you might see whether you build this from <br>domain-specific languages in Racket, but have Racket target C code. <br>Like Pre-Scheme with DSLs. (Also, going to a hardware description <br>language from DSLs.)<br><br>"#lang racket" is for demos, IMHO; I *always* use "#lang racket/base" <br>for any code that's not a demo.<br><br>A tree-shaker like you suggest might still be appropriate even with <br>"racket/base", mainly if one wants to put this on a low-space device <br>like OpenWRT hardware. (Just last night, I was trying to decide whether <br>I wanted to fit the Linux kernel plus Racket and an app in the 256MB RAM <br>of the Kindle 3.)<br><br>If you want to spread your Racket
threads across CPUs/cores, then, yes, <br>I would look at Racket places as well as homebrew worker threads.<br><br>The Racket VM startup time is longer than it used to be, and I no longer <br>use it often as a quick command-line calculator. (If filesystem and <br>libraries aren't in Linux caches, it's almost 4 seconds before REPL <br>prompt on my workstation.) That might not have to be a problem for an <br>onion-router, however, even if you're starting up lots of processes <br>(since you might be able to start worker processes before they're needed).<br><br>If you're finding Racket run time (not startup time) sometimes slower <br>than Python, it's possible, but I'm wondering whether the respective <br>implementations of your code have been hand-optimized.<br><br>Good luck with your project.<br><br>Neil V,<br><br>Yuhao Dong wrote at 02/10/2014 06:49 PM:<br>> Hi,<br>><br>> I'm trying to decide between Racket and Go on writing my
onion-routing<br>> system inspired by Tor. Basically, a network server, involving lots of<br>> long-lived connections that often pass large amounts of data. The thing<br>> needs to be super scalable; I often find that these servers, although<br>> network servers, often become CPU-bound doing encryption and<br>> encapsulation of protocols, so I do have experience that this is not<br>> "premature optimization"!<br>><br>> Go seems to be the go-to (pun intended) for scalable network things. It<br>> has super cheap threads, is statically compiled (easy to deploy to lots<br>> of machines), and apparently uses little memory and runs fast. However,<br>> after writing some low-level transports in Go, I found a few things I<br>> gripe about but seem to be unsolvable:<br>><br>> - Go doesn't have exceptions. This means checking errors over and over.<br>> - Go uses lightweight user threads like Racket
("goroutines"), but<br>> isn't fully non-blocking under the hood for I/O. Thus some I/O<br>> operations actually spawn a kernel thread, and then kill it when the<br>> operation is done. This is unacceptable for my use case.<br>> - Go isn't as fast as I imagined. My program is still CPU-bound at<br>> around 40 MB/s, and that's just counting pushing zeroes through the<br>> lowest-level transport protocol.<br>> - Go's garbage collector is naive stop-the-world mark-and-sweep. My<br>> program keeps a large amount of state, and constantly pushes data and<br>> accepts connections. The mark-and-sweep process can take as much as 20<br>> seconds on large heaps, severly impacting user experience. Since the GC<br>> is nonmoving, heap fragmentation is also an issue. I searched around a<br>> bit, and it seems that "buffer reuse" is a thing in Go. Ugh.<br>><br>> So I decided to take Racket, namely Typed Racket, a
spin. I like it a<br>> lot, it's my favorite language after all, and especially I like the fact<br>> that I can use macros to simplify verbose patterns of code. DrRacket's<br>> REPL is also very helpful. I also find that Racket is much more<br>> performant than I imagined (I used to think of it as a Python-type slow<br>> scripting language). However, there are a few gripes I have, but seeing<br>> how flexible Racket is, I think they might be solvable:<br>><br>> - Racket threads don't seem to be able to utilize multiple CPU cores.<br>> Is there an idiomatic way to, say, form a pool of places and push<br>> threads to them? I imagine sharing data is very messy?<br>> - The Racket VM is huuuuuuge, both on disk and in memory.<br>> Infuriatingly, using #lang racket seems to import every single #lang<br>> racket library into the memory space, and when I raco dist my program,<br>> every single library gets
packaged. I know this sounds like whining, but<br>> why can't some sort of analysis phase be applied where only the<br>> libraries actually required for the program to run are loaded?<br>> - Racket doesn't seem to be able to call raw C code or machine code in<br>> static libraries, instead requiring the code be compiled into a library.<br>> Is this related to the fact that Racket is run in a VM rather than<br>> compiled to machine code?<br>> - Some things in racket are pathologically slow. As an example, try<br>> implementing a cipher with loops and array indices and bytestrings. It<br>> will end up orders of magnitude slower than, say, C or Go or Java, or<br>> sometimes even Python.<br>><br>> Are there solutions to these problems? These aren't showstoppers by any<br>> means, but could finally end my endless dilemma between the two langs :)<br>><br>> Thanks!<br>> Yuhao Dong<br>>
<br>> <br><br><br>End of users Digest, Vol 102, Issue 31<br>**************************************<br><br><br></div> </div> </div> </div> </div></body></html>