Re: [racket-users] Beautiful Racket v1.0

2017-03-16 Thread Alexis King
This is wonderful. I have not read through everything, but the bits that
I have read are well-written, insightful, and fun. I don’t know if a
book like this is enough to get people interested in building DSLs, but
if it isn’t, I’m not sure what is. I’m a tiny bit sad (or should I say
“bummed out”?) that BR eschews syntax-parse for the simpler syntax-case
patterns, but if that’s the only nit I can find to pick, it’s a good
sign.

Most of what I could say has already been said by Matthew Flatt in the
foreword, so I will not be redundant here, but I do want to thank you
for your efforts to provide a wonderful resource for Racketeers both old
and new.

> On Mar 15, 2017, at 17:28, Matthew Butterick  wrote:
> 
> I'm very pleased to announce that Beautiful Racket, my book about
> making languages with Racket (that I spoke about at the last
> RacketCon) is now officially released:
> 
> http://beautifulracket.com
> 
> Special thanks to chief amigo Matthew Flatt for writing a very kind
> foreword.
> 
> More broadly, thank you to everyone who has helped make Racket such a
> fantastic and amazing tool. It has absolutely changed my life for the
> better. The book is very much a tribute to all your wonderful work. By
> sharing my enthusiasm and experience, I hope that the book brings many
> more recruits into Team Racket.
> 
> Macros! Language extensibility! Let's rock!
> 
> (And of course, if you find problems, let me know.)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: minimal vs full racket performance issues

2017-03-16 Thread Jack Firth
On Thursday, March 16, 2017 at 3:25:34 PM UTC-7, Dan Liebgold wrote:
> Is there a way to do minimal installs of packages?  I imagine skipping any 
> gui elements would cut down the dependencies quite a bit.

You can install a package in binary form with `raco pkg install --binary foo`, 
which fetches pre-built bytecode and pre-rendered documentation from the 
package catalog build server. This requires you use the same Racket version the 
build server uses, which is usually the latest released version. This also 
completely skips installing dependencies only needed for build time (build-deps 
in a package's info.rkt). You can further omit installing pre-rendered 
documentation by using --binary-lib instead of --binary.

Side question for Racket package system folks: will the migration to Chez 
scheme affect binary installs of packages? I seem to recall discussion that 
bytecode might be going away as part of the Chez transition.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt wrote:
> Just installing rackunit-lib will avoid the docs and tests, which should 
> substantially reduce the footprint.
> 

That's a fix for rackunit... I'm also using Jay's awesome job-queue package, 
which pulls in scribble which seems to pull in gui stuff... but it doesn't not 
have a -lib version.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
On Thursday, March 16, 2017 at 3:48:34 PM UTC-7, Vincent St-Amour wrote:
> `raco pkg remove rackunit && raco pkg remove --auto` should do it.
> 

"raco pkg remove --auto -i"  did it.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Sam Tobin-Hochstadt
Ah, I didn't even know about --auto.

On Thu, Mar 16, 2017, 6:48 PM Vincent St-Amour <
stamo...@eecs.northwestern.edu> wrote:

> `raco pkg remove rackunit && raco pkg remove --auto` should do it.
>
> Vincent
>
>
> On Thu, 16 Mar 2017 17:42:23 -0500,
> Sam Tobin-Hochstadt wrote:
> >
> > Unfortunately, I don't think there's an analogue of apt autoremove, so
> you probably have to do it manually.
> >
> > On Thu, Mar 16, 2017, 6:37 PM Dan Liebgold 
> wrote:
> >
> >  On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt
> wrote:
> >  > Just installing rackunit-lib will avoid the docs and tests, which
> should substantially reduce the footprint.
> >  >
> >  > Sam
> >  >
> >
> >  Very cool now, say I've already gone and installed rackunit. How
> can I remove all those dependant packages it installed?
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Vincent St-Amour
`raco pkg remove rackunit && raco pkg remove --auto` should do it.

Vincent


On Thu, 16 Mar 2017 17:42:23 -0500,
Sam Tobin-Hochstadt wrote:
> 
> Unfortunately, I don't think there's an analogue of apt autoremove, so you 
> probably have to do it manually.
> 
> On Thu, Mar 16, 2017, 6:37 PM Dan Liebgold  
> wrote:
> 
>  On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt wrote:
>  > Just installing rackunit-lib will avoid the docs and tests, which should 
> substantially reduce the footprint.
>  >
>  > Sam
>  >
> 
>  Very cool now, say I've already gone and installed rackunit. How can I 
> remove all those dependant packages it installed? 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Ed Hirgelt
Won’t raco pkg remove and raco pkg empty-trash do the trick?

Ed

> On Mar 16, 2017, at 3:42 PM, Sam Tobin-Hochstadt  wrote:
> 
> Unfortunately, I don't think there's an analogue of apt autoremove, so you 
> probably have to do it manually.
> 
> 
> On Thu, Mar 16, 2017, 6:37 PM Dan Liebgold  > wrote:
> On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt wrote:
> > Just installing rackunit-lib will avoid the docs and tests, which should 
> > substantially reduce the footprint.
> >
> > Sam
> >
> 
> Very cool now, say I've already gone and installed rackunit. How can I 
> remove all those dependant packages it installed?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Sam Tobin-Hochstadt
Unfortunately, I don't think there's an analogue of apt autoremove, so you
probably have to do it manually.

On Thu, Mar 16, 2017, 6:37 PM Dan Liebgold 
wrote:

> On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt wrote:
> > Just installing rackunit-lib will avoid the docs and tests, which should
> substantially reduce the footprint.
> >
> > Sam
> >
>
> Very cool now, say I've already gone and installed rackunit. How can I
> remove all those dependant packages it installed?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt wrote:
> Just installing rackunit-lib will avoid the docs and tests, which should 
> substantially reduce the footprint.
> 
> Sam
> 

Very cool now, say I've already gone and installed rackunit. How can I 
remove all those dependant packages it installed? 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Sam Tobin-Hochstadt
Just installing rackunit-lib will avoid the docs and tests, which should
substantially reduce the footprint.

Sam

On Thu, Mar 16, 2017, 6:25 PM Dan Liebgold 
wrote:

> Hi -
>
> (This is a continuation of some discussions I've had on the dev list a
> couple years ago.)
>
> We continue to have performance issues stemming from Racket's runtime file
> system usage. Hopefully someone can shed some more light on the issues so
> we can adjust our usages...
>
> We use a minimal install of Racket because we see a significant increase
> in performance over the full installation. It seems like the large source
> of performance issues is that Racket will routinely (perhaps during
> requires?) grovel over all the files in the pkgs directory -- maybe looking
> at all the info.rkt files?  This is very slow (compared to everything else
> we're doing), even on a local SSD.
>
> First question: Is there a different way to do this? Perhaps freezing the
> package information in place so that file enumeration doesn't have to take
> place at runtime?
>
>
> Also, the minimal install of Racket is missing some features we'd like,
> for example "rackunit". But when I install rackunit, my pkgs directory goes
> from 15 or so packages up to about 120 packages!  So using rackunit at all
> requires us to sacrifice most of the performance gain we need...
>
> Is there a way to do minimal installs of packages?  I imagine skipping any
> gui elements would cut down the dependencies quite a bit.
>
> Thanks for any help,
> Dan
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
Hi -

(This is a continuation of some discussions I've had on the dev list a couple 
years ago.)

We continue to have performance issues stemming from Racket's runtime file 
system usage. Hopefully someone can shed some more light on the issues so we 
can adjust our usages...

We use a minimal install of Racket because we see a significant increase in 
performance over the full installation. It seems like the large source of 
performance issues is that Racket will routinely (perhaps during requires?) 
grovel over all the files in the pkgs directory -- maybe looking at all the 
info.rkt files?  This is very slow (compared to everything else we're doing), 
even on a local SSD.

First question: Is there a different way to do this? Perhaps freezing the 
package information in place so that file enumeration doesn't have to take 
place at runtime?


Also, the minimal install of Racket is missing some features we'd like, for 
example "rackunit". But when I install rackunit, my pkgs directory goes from 15 
or so packages up to about 120 packages!  So using rackunit at all requires us 
to sacrifice most of the performance gain we need...

Is there a way to do minimal installs of packages?  I imagine skipping any gui 
elements would cut down the dependencies quite a bit.

Thanks for any help,
Dan



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] How to use the REPL with #lang s-exp "expander.rkt"

2017-03-16 Thread NeverTooOldToCode
I'm playing around with SICP's Metacircular Scheme Evaluator, and thought it 
would be convenient to try and do that in a #lang setup in Racket, so I can use 
the Racket Definition Window and REPL. No Reader modification is needed, since 
Scheme code is already S-expressions. The expander just calls m-eval on each 
S-expression. This is my setup:

ME-test.rkt:

#lang s-exp "ME-expander.rkt"

(Scheme code ...)
---


ME-expander.rkt:

#lang racket/base

(require (for-syntax racket/base))

(define-syntax (ME-module-begin stx)
  (syntax-case stx ()
[(_ s-expressions ...)
 #'(#%module-begin (for-each
(lambda (expr) (displayln (m-eval expr)))
(list 's-expressions ...)))]))

(provide (rename-out (ME-module-begin #%module-begin))
 #%top-interaction)

(define (m-eval ... ; from here on the SICP Evaluator
---

This works fine in the ME-test.rkt Definition window, but not in the REPL which 
doesn't have bindings for anything. I would like anything typed into the 
ME-test.rkt REPL to be used as argument to the ME-module-begin macro in 
ME-expander.rkt.

When searching for this I found descriptions of REPL setups in a more complete 
#lang setup which I don't understand yet. Is it possible to make the REPL work 
in the setup above? Any other comments are also welcome.

Many thanks in advance, Jan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] How to build new formlets that allow passing default values (such as hidden)?

2017-03-16 Thread Marc Kaufmann
Thanks Philip. I checked out the links, but I fear that it's over my head, and 
that I would almost surely screw it up. For now I'll keep passing the 
parameters.

Cheers,
Marc 

On Tuesday, March 14, 2017 at 3:22:39 PM UTC-4, Philip McGrath wrote:
> If you want it to be part of the continuation without having to pass it 
> around as an argument, check out web cells 
> (http://docs.racket-lang.org/web-server/stateless.html?q=web-server%2Flang%2Fwe#%28mod-path._web-server%2Flang%2Fweb-cells%29)
>  or web parameters 
> (http://docs.racket-lang.org/web-server/stateless.html?q=web-server%2Flang%2Fwe#%28mod-path._web-server%2Flang%2Fweb-param%29).
> 
> 
> 
> -Philip
> 
> 
> 
> On Tue, Mar 14, 2017 at 1:48 PM, Marc Kaufmann  wrote:
> 
> 
> 
> Thanks for the detailed answer Philip! Some of it is definitely over my head. 
> The reason I don't pass around the id is that I use the html field exactly to 
> track the id and wanted to avoid having to pass around the argument left and 
> right - and the only ways to pass it on are via forms or by sticking it into 
> the requested URL or by using continuations. I will give the 
> continuation-style solution a shot though, it's probably cleaner to pass the 
> id around as an argument.
> 
> Cheers,
> Marc
> 
> 
> 
> 
> 
> On Tue, Mar 14, 2017 at 1:34 PM, Philip McGrath  
> wrote:
> 
> In this case it will work despite being a hack, because you know that your id 
> argument affects only the display stage, not the processing stage: however, 
> you can't know in general that this will work for dynamically generated 
> formlets, and personally I would therefore be reluctant to rely on this, both 
> because it is fragile in terms of changes to your implementation of 
> matrix-formlet that you might make later.
> 
> 
> If you are using native continuations (i.e. not the stateless #lang 
> web-server), you can use send/formlet or embed-formlet to deal with this 
> correctly and easily. (At a lower level, you could also do something 
> like(define-values (xexpr-forest bindings->result i)
>   ((matrix-formlet "3") 0))
> to access the low-level rendering, processing function, and next allowable 
> input integer directly.)
> 
> 
> It is a little more tricky in #lang web-server, because your formlet and it's 
> generated processing function are plain functions, and thus not serializable 
> (see this old thread for discussion: 
> https://groups.google.com/d/topic/racket-users/lMYWjodgpmo/discussion). The 
> easy work-around is to keep the arguments you need to reproduce your formlet 
> around as part of the closure, e.g. by rewriting your matrix-submission like 
> this:(define (matrix-submission req id)
>   (define-values (number-of-ones user-id)
>       (formlet-process (matrix-formlet id) req))
>   ...)
> The alternative is to either recompile the formlet library using #lang 
> web-server/base or to implement your formlet at a low level using 
> serial-lambda and not use any of the library tools.
> 
> 
> In this specific case, though, if you are using this hidden input field just 
> to remember the user id from one request to the next (i.e. you wouldn't ever 
> change it on the client side with JavaScript or something), the best solution 
> is not to put it in the form at all, but have it be part of the continuation. 
> This could also have security advantages, if you cryptographically sign your 
> continuations or store them on the server. If that works for your use case, 
> you could simply write:
> (define matrix-formlet
> 
>   input-string)
> display it with
> (matrix-submission
>  (send/suspend
>   (λ (k-url)
>     (response/xexpr
>      `(html (body (form
>                    ((action "/the-matrix-submitted")
>                     (method "post"))
>                    ,@(formlet-display matrix-formlet)
>                    (input ([type "submit"]
>  user-id)
> and then define matrix-submission as(define (matrix-submission req user-id)
>   (define number-of-ones
>       (formlet-process matrix-formlet req))
>   ...)
> 
> 
> 
> -Philip
> 
> 
> 
> 
> 
> On Tue, Mar 14, 2017 at 12:01 PM, Marc Kaufmann  wrote:
> 
> 
> Hi,
> 
> 
> 
> I have created a formlet like so:
> 
> 
> 
> (define (matrix-formlet id)
> 
>   (formlet
> 
>         (#%# ,{input-string . => . ones}
> 
>              ,{(to-string (required (hidden id))) . => . user-id}
> 
>                  )
> 
>         (values ones user-id)))
> 
> 
> 
> I display this as follows:
> 
> 
> 
> `(form
> 
>   ((action "/the-matrix-submitted")
> 
>    (method "post"))
> 
>  ,@(formlet-display (matrix-formlet user-id))
> 
>  (input ([type "submit"]
> 
> 
> 
> and process it like this:
> 
> 
> 
> (define (matrix-submission req)
> 
>   (define-values (number-of-ones user-id)
> 
>                  (formlet-process (matrix-formlet "3") req))
> 
>   ...)
> 
> 
> 
> While this works, the formlet I use to display and process are not really the 
> same, since they 

[racket-users] Re: Beautiful Racket v1.0

2017-03-16 Thread Vincent Nys
Congrats! I've gone through all the chapters and it has been the most 
entertaining programming book I have ever read. It's been practical, too, as I 
have already used bits of it in a medium-sized (first) Racket project. I would 
gladly buy it and will recommend it to many of my co-workers.

Regards,

Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.