Re: [racket-users] Github collection for making a language

2019-01-25 Thread Stephen De Gabrielle
Maybe replace with *raco* *make*[1] or or the *make* package?[2]

[1] http://docs.racket-lang.org/raco/make.html
[2] https://pkgs.racket-lang.org/package/make
http://docs.racket-lang.org/make/overview.html


On Fri, 25 Jan 2019 at 00:34, George Neuner  wrote:

>
> On 1/24/2019 3:39 PM, Stephen De Gabrielle wrote:
> >  (does windows include `make` ?)
>
> No.  Windows provides no development tools aside from scripting [cmd or
> powershell].
>
> Couple alternatives [there may be more]:  Cygwin provides a Unix/Linux
> like environment [bash, utilities] for Windows based on a (required)
> compatibility runtime.  The GnuWin32 project provides native Windows
> ports of many Unix utilities (including bash and make).
>
> Unless you work with Cygwin [which has issues], or start with a Windows
> environment like VisualStudio, Eclipse or Netbeans, the bottom line is
> that Windows requires a lot more work to set up for development.
> [General development - Racket works fine :-)]
>
> George
>
-- 


-- 
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] handin server stress testing

2019-01-25 Thread 'John Clements' via Racket Users
As I think I mentioned to some of you earlier, I’ve been having real trouble 
holding together a handin server for a class of 100 students all writing typed 
racket code. In order to dig deeper, I set up a test machine and a repeatable 
test harness, and I discovered some things that really surprised me; perhaps 
there are easy fixes for some of these, perhaps not.

I’m running the handin server on a 2-core, 4 GB linode server. There’s nothing 
else running on the machine, but I’m running only a single racket process, so I 
don’t expect it to use the other core at all.

Under ideal circumstances (a totally un-loaded server), it looks like a correct 
submission should run in about 10-12 seconds end-to-end.

My peak loads are around 200 submissions per hour. To model an interval on the 
high end, I modeled a 500-submissions-per-hour rate by randomly selecting 25 
delays in a 3-minute period, and starting (on a different, remote machine) a 
thread for each of these that waits the appropriate time and then tries to log 
in and submit the code. Each thread logs in as a different user. The server is 
configured with a two-minute timeout. Every submission is of my sample 
solution, which passes all of the tests.

My basic metric is “successes per minute”; that is, ignoring all of the 
timeouts, how many can we get through in each minute. At 8 submissions per 
minute, there’s absolutely no way for the server to keep up with the test load, 
so some failures are inevitable.

As I think I may have mentioned before, the base results are discouraging; the 
handin server successfully checks 3.16 per minute, but (okay, I do have other 
metrics) at the end, nearly all of them are skating on the edge of the timeout, 
so that many students are waiting for fully two minutes and then being told 
that their program might have a bug that makes it loop forever.

The first thing I did was just to put a single semaphore in place with an 
initial value of 1 and a fail-thunk that tells the user that there are too many 
submissions being processed. So: at most one at a time, with fast fail. 
Surprisingly, this did about as well as the base model, and the response times 
were, unsurprisingly, much much shorter. Of course, 15 of the 25 submissions 
were rejected. Also, students here aren’t being told that their code might be 
bad, they’re just being told that the server is busy, arguably better. On the 
other hand, failed submissions aren’t even stored by the server; I could 
perhaps tighten the code protected by the semaphore to solve this.

The next thing I did was to change the call-with-semaphore to comment out the 
fail-thunk, so that later submissions would just wait politely until the 
earlier ones were done.

Surprisingly, this did *terribly*. The server only processed 1.9 submissions 
per minute, and only successfully got through 9 submissions. The rest, as in 
the initial scenario, were put on ice for longer and longer periods of time. It 
didn’t even start out well; the very first ones were already horribly slow. 

I thought about this for a while, and it appears somehow that the delayed 
submissions—the ones waiting for the semaphore—are somehow consuming a huge 
amount of some resource, and I’d have to guess it’s memory. I can’t really see 
why this would be the case; each one has an open SSL connection and a 20k file 
to process. In fact, I can see that the log is periodically dumping a chunk of 
30 lines corresponding to waiting procedures, where one is of size (say) 30 
megabytes and all of the other waiting ones are tiny (20k, 22k, something like 
that). What I’m trying to figure out is why having waiting processes would be 
so, so expensive.

Very strange (to me).

It looks like the best setting for me right now is to set a limit of no more 
than two simultaneous submissions, and to definitely definitely use a 
fail-thunk to drop them above this limit. This brings me up to almost 5 
processed per minute, with mostly reasonable response times.

The *real* solution, of course, is to actually shorten the processing times, 
either by multi-threading or by hastening compilation of TR, which consumes 
something like 80-85% of the testing time.

In case you want to see the 10-line change I actually made to the server, the 
diff is here:

https://github.com/jbclements/handin/commit/efb0e860e0fc675310229b333bc77ddd0bbe171b

Thanks for reading. Any suggestions appreciated!

Best,

John Clements

-- 
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] snake game

2019-01-25 Thread Matthias Felleisen

DrRacket -> File -> Open Require Path -> enter test- -> use mouse 


> On Jan 24, 2019, at 11:11 PM, orenpa11  wrote:
> 
> Hi
> where can I find the  test-engine ?
> I would like to copy the code  and  "play" with it.
> So I can understand it better .
> just copying the code is not helpful because I need to understand it.
> 
> Thanks,
> Or
> 
> On Thursday, January 24, 2019 at 11:54:34 PM UTC+2, Matthias Felleisen wrote:
> 
> Yes there is. Use (require test-engine/racket-tests) 
> at the top and (test) at the bottom. 
> 
> But it sounds like you’re copying and pasting homework 
> solutions. Hmph. 
> 
> 
> 
> 
> > On Jan 24, 2019, at 3:44 PM, orenpa11 gmail.com 
> > > wrote: 
> > 
> > Hi Matthias , 
> > Unfortunately I need to write the project in pretty big language. 
> > The game is not written in pretty big language as far as I know. 
> > I thought that can copy andycode that was written in any language in racket 
> > to pretty big. 
> > Is there a way to transfer code that was written in  "Beginning Student 
> > with List Abbreviations" to pretty big ? 
> > 
> > Thanks, 
> > Or 
> > 
> > 
> > 
> > 
> > On Thursday, January 24, 2019 at 9:19:14 PM UTC+2, Matthias Felleisen 
> > wrote: 
> > 
> > 
> > Where did you find the snake game? 
> > Where did it say it’s written in Pretty Big? 
> > 
> > We have not used Pretty Big in over a decade in education, 
> > neither does anyone in the Racket edu community proper. 
> > 
> > This community supports people readily wth answers, but 
> > we need to know what you know. 
> > 
> > — Matthias 
> > 
> > 
> > 
> > 
> > > On Jan 24, 2019, at 12:56 PM, orenpa11 > wrote: 
> > > 
> > > Hi 
> > > I need to create a project in pertty big . 
> > > why this code is not been supported ? 
> > > 
> > > Thanks, 
> > > Or 
> > > 
> > > On Thursday, January 24, 2019 at 3:29:11 PM UTC+2, Kieron Hardy wrote: 
> > > The language you should be using is "Beginning Student with List 
> > > Abbreviations". 
> > > 
> > > On Jan 24, 2019, at 4:33 AM, orenpa11 gmail.com 
> > > > wrote: 
> > > 
> > >> Hi, 
> > >> when I removed the line 
> > >> #reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname snake-full) 
> > >> (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor 
> > >> repeating-decimal #f #t none #f ( 
> > >> 
> > >> And changed the  language to pretty big. 
> > >> I recived this error: 
> > >> Welcome to DrRacket, version 7.1 [3m]. 
> > >> Language: Pretty Big; memory limit: 128 MB. 
> > >> . . check-expect: undefined; 
> > >>  cannot reference an identifier before its definition 
> > >> 
> > >> Any idea ? 
> > >> 
> > >> Thanks, 
> > >> Or 
> > >> 
> > >> 
> > >> 
> > >> 
> > >> 
> > >> On Wednesday, January 23, 2019 at 10:49:01 PM UTC+2, Kieron Hardy wrote: 
> > >> It seems the metadata lines added by DrRacket (mentioned by John) are 
> > >> processed when the a source file is loaded into DrRacket (via the menu 
> > >> option File/Open), but are not processed if the source code is directly 
> > >> copied (e.g. from a browser window) into a DrRacket window and then 
> > >> executed with the 'Run' button. 
> > >> 
> > >> The metadata includes a #reader directive, e.g.: 
> > >> (#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname snake-full) 
> > >> ...) 
> > >> 
> > >> This reader directive appears to be silently ignored by DrRacket when 
> > >> the source is 'Run', even though DrRacket shows "#reader" in red (as 
> > >> when an error is detected). The actions taken by DrRacket when 'Run' is 
> > >> pressed seem to depend on the settings in effect when the code is 
> > >> executed, which could be nothing, or throwing a confusing error. 
> > >> 
> > >> The solution for the original poster's issue is as John directs; remove 
> > >> the metadata (i.e. #reader directive) and manually set the language. 
> > >> 
> > >> However, I feel that DrRacket should recognize and act on (and perhaps 
> > >> also remove/hide from view) the metadata if the metadata occurs as from 
> > >> a copy/paste directly into a DrRacket window (e.g. as from a URL). The 
> > >> current behaviour is, I think, a bug and a trap (perhaps showstopping) 
> > >> for a new user experimenting with Racket. 
> > >> 
> > >> Note that the Racket executable seems to process the metadata properly, 
> > >> understanding the language to use, etc.. so that the code behaves as 
> > >> intended. 
> > >> 
> > >> On Wed, Jan 23, 2019 at 12:32 PM K H gmail.com 
> > >> > wrote: 
> > >> Hello Or, 
> > >> 
> > >> The language is not "Pretty Big". 
> > >> 
> > >> You should be using "Beginning Student with List Abbreviations". 
> > >> 
> > >> The DrRacket metadata lines referred to by John set the correct 
> > >> language. In your case you must have changed the language somehow. Or 
> > >> perhaps the file needs to be saved before the metadata is acted upon. 
> > >> 
> > >> HTH, 
> > >> 
> > >> Kieron. 
> > >> 
> > >> 
> > >> On Wed, Jan 23, 2019 

Re: [racket-users] snake game

2019-01-25 Thread orenpa11
Hi,
Sorry but I did not get it.
should I add the path to the rkt file or add the code ?

Thanks,
Or

On Friday, January 25, 2019 at 1:39:12 PM UTC+2, Matthias Felleisen wrote:
>
>
> DrRacket -> File -> Open Require Path -> enter test- -> use mouse 
>
>
> On Jan 24, 2019, at 11:11 PM, orenpa11 > 
> wrote:
>
> Hi
> where can I find the  test-engine ?
> I would like to copy the code  and  "play" with it.
> So I can understand it better .
> just copying the code is not helpful because I need to understand it.
>
> Thanks,
> Or
>
> On Thursday, January 24, 2019 at 11:54:34 PM UTC+2, Matthias Felleisen 
> wrote:
>>
>>
>> Yes there is. Use (require test-engine/racket-tests) 
>> at the top and (test) at the bottom. 
>>
>> But it sounds like you’re copying and pasting homework 
>> solutions. Hmph. 
>>
>>
>>
>>
>> > On Jan 24, 2019, at 3:44 PM, orenpa11  wrote: 
>> > 
>> > Hi Matthias , 
>> > Unfortunately I need to write the project in pretty big language. 
>> > The game is not written in pretty big language as far as I know. 
>> > I thought that can copy andycode that was written in any language in 
>> racket to pretty big. 
>> > Is there a way to transfer code that was written in  "Beginning Student 
>> with List Abbreviations" to pretty big ? 
>> > 
>> > Thanks, 
>> > Or 
>> > 
>> > 
>> > 
>> > 
>> > On Thursday, January 24, 2019 at 9:19:14 PM UTC+2, Matthias Felleisen 
>> wrote: 
>> > 
>> > 
>> > Where did you find the snake game? 
>> > Where did it say it’s written in Pretty Big? 
>> > 
>> > We have not used Pretty Big in over a decade in education, 
>> > neither does anyone in the Racket edu community proper. 
>> > 
>> > This community supports people readily wth answers, but 
>> > we need to know what you know. 
>> > 
>> > — Matthias 
>> > 
>> > 
>> > 
>> > 
>> > > On Jan 24, 2019, at 12:56 PM, orenpa11  wrote: 
>> > > 
>> > > Hi 
>> > > I need to create a project in pertty big . 
>> > > why this code is not been supported ? 
>> > > 
>> > > Thanks, 
>> > > Or 
>> > > 
>> > > On Thursday, January 24, 2019 at 3:29:11 PM UTC+2, Kieron Hardy wrote:
>>  
>> > > The language you should be using is "Beginning Student with List 
>> Abbreviations". 
>> > > 
>> > > On Jan 24, 2019, at 4:33 AM, orenpa11  wrote: 
>> > > 
>> > >> Hi, 
>> > >> when I removed the line 
>> > >> #reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname 
>> snake-full) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t 
>> constructor repeating-decimal #f #t none #f ( 
>> > >> 
>> > >> And changed the  language to pretty big. 
>> > >> I recived this error: 
>> > >> Welcome to DrRacket, version 7.1 [3m]. 
>> > >> Language: Pretty Big; memory limit: 128 MB. 
>> > >> . . check-expect: undefined; 
>> > >>  cannot reference an identifier before its definition 
>> > >> 
>> > >> Any idea ? 
>> > >> 
>> > >> Thanks, 
>> > >> Or 
>> > >> 
>> > >> 
>> > >> 
>> > >> 
>> > >> 
>> > >> On Wednesday, January 23, 2019 at 10:49:01 PM UTC+2, Kieron Hardy 
>> wrote: 
>> > >> It seems the metadata lines added by DrRacket (mentioned by John) 
>> are processed when the a source file is loaded into DrRacket (via the menu 
>> option File/Open), but are not processed if the source code is directly 
>> copied (e.g. from a browser window) into a DrRacket window and then 
>> executed with the 'Run' button. 
>> > >> 
>> > >> The metadata includes a #reader directive, e.g.: 
>> > >> (#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname 
>> snake-full) ...) 
>> > >> 
>> > >> This reader directive appears to be silently ignored by DrRacket 
>> when the source is 'Run', even though DrRacket shows "#reader" in red (as 
>> when an error is detected). The actions taken by DrRacket when 'Run' is 
>> pressed seem to depend on the settings in effect when the code is executed, 
>> which could be nothing, or throwing a confusing error. 
>> > >> 
>> > >> The solution for the original poster's issue is as John directs; 
>> remove the metadata (i.e. #reader directive) and manually set the language.
>>  
>> > >> 
>> > >> However, I feel that DrRacket should recognize and act on (and 
>> perhaps also remove/hide from view) the metadata if the metadata occurs as 
>> from a copy/paste directly into a DrRacket window (e.g. as from a URL). The 
>> current behaviour is, I think, a bug and a trap (perhaps showstopping) for 
>> a new user experimenting with Racket. 
>> > >> 
>> > >> Note that the Racket executable seems to process the metadata 
>> properly, understanding the language to use, etc.. so that the code behaves 
>> as intended. 
>> > >> 
>> > >> On Wed, Jan 23, 2019 at 12:32 PM K H  wrote: 
>> > >> Hello Or, 
>> > >> 
>> > >> The language is not "Pretty Big". 
>> > >> 
>> > >> You should be using "Beginning Student with List Abbreviations". 
>> > >> 
>> > >> The DrRacket metadata lines referred to by John set the correct 
>> language. In your case you must have changed the language somehow. Or 
>> perhaps the file needs to be saved before the metadata is acted 

Re: [racket-users] snake game

2019-01-25 Thread Robby Findler
You've opened the right dialog. Now type "test-" into it. You should
see the file appear. Click on it.

Robby

On Fri, Jan 25, 2019 at 7:53 AM orenpa11  wrote:
>
> Hi,
> Sorry but I did not get it.
> should I add the path to the rkt file or add the code ?
>
> Thanks,
> Or
>
> On Friday, January 25, 2019 at 1:39:12 PM UTC+2, Matthias Felleisen wrote:
>>
>>
>> DrRacket -> File -> Open Require Path -> enter test- -> use mouse
>>
>>
>> On Jan 24, 2019, at 11:11 PM, orenpa11  wrote:
>>
>> Hi
>> where can I find the  test-engine ?
>> I would like to copy the code  and  "play" with it.
>> So I can understand it better .
>> just copying the code is not helpful because I need to understand it.
>>
>> Thanks,
>> Or
>>
>> On Thursday, January 24, 2019 at 11:54:34 PM UTC+2, Matthias Felleisen wrote:
>>>
>>>
>>> Yes there is. Use (require test-engine/racket-tests)
>>> at the top and (test) at the bottom.
>>>
>>> But it sounds like you’re copying and pasting homework
>>> solutions. Hmph.
>>>
>>>
>>>
>>>
>>> > On Jan 24, 2019, at 3:44 PM, orenpa11  wrote:
>>> >
>>> > Hi Matthias ,
>>> > Unfortunately I need to write the project in pretty big language.
>>> > The game is not written in pretty big language as far as I know.
>>> > I thought that can copy andycode that was written in any language in 
>>> > racket to pretty big.
>>> > Is there a way to transfer code that was written in  "Beginning Student 
>>> > with List Abbreviations" to pretty big ?
>>> >
>>> > Thanks,
>>> > Or
>>> >
>>> >
>>> >
>>> >
>>> > On Thursday, January 24, 2019 at 9:19:14 PM UTC+2, Matthias Felleisen 
>>> > wrote:
>>> >
>>> >
>>> > Where did you find the snake game?
>>> > Where did it say it’s written in Pretty Big?
>>> >
>>> > We have not used Pretty Big in over a decade in education,
>>> > neither does anyone in the Racket edu community proper.
>>> >
>>> > This community supports people readily wth answers, but
>>> > we need to know what you know.
>>> >
>>> > — Matthias
>>> >
>>> >
>>> >
>>> >
>>> > > On Jan 24, 2019, at 12:56 PM, orenpa11  wrote:
>>> > >
>>> > > Hi
>>> > > I need to create a project in pertty big .
>>> > > why this code is not been supported ?
>>> > >
>>> > > Thanks,
>>> > > Or
>>> > >
>>> > > On Thursday, January 24, 2019 at 3:29:11 PM UTC+2, Kieron Hardy wrote:
>>> > > The language you should be using is "Beginning Student with List 
>>> > > Abbreviations".
>>> > >
>>> > > On Jan 24, 2019, at 4:33 AM, orenpa11  wrote:
>>> > >
>>> > >> Hi,
>>> > >> when I removed the line
>>> > >> #reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname 
>>> > >> snake-full) (read-case-sensitive #t) (teachpacks ()) (htdp-settings 
>>> > >> #(#t constructor repeating-decimal #f #t none #f (
>>> > >>
>>> > >> And changed the  language to pretty big.
>>> > >> I recived this error:
>>> > >> Welcome to DrRacket, version 7.1 [3m].
>>> > >> Language: Pretty Big; memory limit: 128 MB.
>>> > >> . . check-expect: undefined;
>>> > >>  cannot reference an identifier before its definition
>>> > >>
>>> > >> Any idea ?
>>> > >>
>>> > >> Thanks,
>>> > >> Or
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >> On Wednesday, January 23, 2019 at 10:49:01 PM UTC+2, Kieron Hardy 
>>> > >> wrote:
>>> > >> It seems the metadata lines added by DrRacket (mentioned by John) are 
>>> > >> processed when the a source file is loaded into DrRacket (via the menu 
>>> > >> option File/Open), but are not processed if the source code is 
>>> > >> directly copied (e.g. from a browser window) into a DrRacket window 
>>> > >> and then executed with the 'Run' button.
>>> > >>
>>> > >> The metadata includes a #reader directive, e.g.:
>>> > >> (#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname 
>>> > >> snake-full) ...)
>>> > >>
>>> > >> This reader directive appears to be silently ignored by DrRacket when 
>>> > >> the source is 'Run', even though DrRacket shows "#reader" in red (as 
>>> > >> when an error is detected). The actions taken by DrRacket when 'Run' 
>>> > >> is pressed seem to depend on the settings in effect when the code is 
>>> > >> executed, which could be nothing, or throwing a confusing error.
>>> > >>
>>> > >> The solution for the original poster's issue is as John directs; 
>>> > >> remove the metadata (i.e. #reader directive) and manually set the 
>>> > >> language.
>>> > >>
>>> > >> However, I feel that DrRacket should recognize and act on (and perhaps 
>>> > >> also remove/hide from view) the metadata if the metadata occurs as 
>>> > >> from a copy/paste directly into a DrRacket window (e.g. as from a 
>>> > >> URL). The current behaviour is, I think, a bug and a trap (perhaps 
>>> > >> showstopping) for a new user experimenting with Racket.
>>> > >>
>>> > >> Note that the Racket executable seems to process the metadata 
>>> > >> properly, understanding the language to use, etc.. so that the code 
>>> > >> behaves as intended.
>>> > >>
>>> > >> On Wed, Jan 23, 2019 at 12:32 PM K H  wrote:
>>> > >> Hello Or,
>>> > >>
>>> > >> The language is no

Re: [racket-users] snake game

2019-01-25 Thread Matthias Felleisen


See below. I gave precise instructions. 


> On Jan 25, 2019, at 10:27 AM, orenpa11  wrote:
> 
> OK,
> Got it , but how can I import the code of the snake program that was written 
> in "Beginning Student with List Abbreviations"  and chnage it to  pretty big ?
>  
> 
> On Friday, January 25, 2019 at 4:08:40 PM UTC+2, Robby Findler wrote:
> You've opened the right dialog. Now type "test-" into it. You should 
> see the file appear. Click on it. 
> 
> Robby 
> 
> On Fri, Jan 25, 2019 at 7:53 AM orenpa11  wrote: 
> > 
> > Hi, 
> > Sorry but I did not get it. 
> > should I add the path to the rkt file or add the code ? 
> > 
> > Thanks, 
> > Or 
> > 
> > On Friday, January 25, 2019 at 1:39:12 PM UTC+2, Matthias Felleisen wrote: 
> >> 
> >> 
> >> DrRacket -> File -> Open Require Path -> enter test- -> use mouse 
> >> 
> >> 
> >> On Jan 24, 2019, at 11:11 PM, orenpa11  wrote: 
> >> 
> >> Hi 
> >> where can I find the  test-engine ? 
> >> I would like to copy the code  and  "play" with it. 
> >> So I can understand it better . 
> >> just copying the code is not helpful because I need to understand it. 
> >> 
> >> Thanks, 
> >> Or 
> >> 
> >> On Thursday, January 24, 2019 at 11:54:34 PM UTC+2, Matthias Felleisen 
> >> wrote: 
> >>> 
> >>> 
> >>> Yes there is. Use (require test-engine/racket-tests) 
> >>> at the top and (test) at the bottom. 
> >>> 
> >>> But it sounds like you’re copying and pasting homework 
> >>> solutions. Hmph. 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> > On Jan 24, 2019, at 3:44 PM, orenpa11  wrote: 
> >>> > 
> >>> > Hi Matthias , 
> >>> > Unfortunately I need to write the project in pretty big language. 
> >>> > The game is not written in pretty big language as far as I know. 
> >>> > I thought that can copy andycode that was written in any language in 
> >>> > racket to pretty big. 
> >>> > Is there a way to transfer code that was written in  "Beginning Student 
> >>> > with List Abbreviations" to pretty big ? 
> >>> > 
> >>> > Thanks, 
> >>> > Or 
> >>> > 
> >>> > 
> >>> > 
> >>> > 
> >>> > On Thursday, January 24, 2019 at 9:19:14 PM UTC+2, Matthias Felleisen 
> >>> > wrote: 
> >>> > 
> >>> > 
> >>> > Where did you find the snake game? 
> >>> > Where did it say it’s written in Pretty Big? 
> >>> > 
> >>> > We have not used Pretty Big in over a decade in education, 
> >>> > neither does anyone in the Racket edu community proper. 
> >>> > 
> >>> > This community supports people readily wth answers, but 
> >>> > we need to know what you know. 
> >>> > 
> >>> > — Matthias 
> >>> > 
> >>> > 
> >>> > 
> >>> > 
> >>> > > On Jan 24, 2019, at 12:56 PM, orenpa11  wrote: 
> >>> > > 
> >>> > > Hi 
> >>> > > I need to create a project in pertty big . 
> >>> > > why this code is not been supported ? 
> >>> > > 
> >>> > > Thanks, 
> >>> > > Or 
> >>> > > 
> >>> > > On Thursday, January 24, 2019 at 3:29:11 PM UTC+2, Kieron Hardy 
> >>> > > wrote: 
> >>> > > The language you should be using is "Beginning Student with List 
> >>> > > Abbreviations". 
> >>> > > 
> >>> > > On Jan 24, 2019, at 4:33 AM, orenpa11  wrote: 
> >>> > > 
> >>> > >> Hi, 
> >>> > >> when I removed the line 
> >>> > >> #reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname 
> >>> > >> snake-full) (read-case-sensitive #t) (teachpacks ()) (htdp-settings 
> >>> > >> #(#t constructor repeating-decimal #f #t none #f ( 
> >>> > >> 
> >>> > >> And changed the  language to pretty big. 
> >>> > >> I recived this error: 
> >>> > >> Welcome to DrRacket, version 7.1 [3m]. 
> >>> > >> Language: Pretty Big; memory limit: 128 MB. 
> >>> > >> . . check-expect: undefined; 
> >>> > >>  cannot reference an identifier before its definition 
> >>> > >> 
> >>> > >> Any idea ? 
> >>> > >> 
> >>> > >> Thanks, 
> >>> > >> Or 
> >>> > >> 
> >>> > >> 
> >>> > >> 
> >>> > >> 
> >>> > >> 
> >>> > >> On Wednesday, January 23, 2019 at 10:49:01 PM UTC+2, Kieron Hardy 
> >>> > >> wrote: 
> >>> > >> It seems the metadata lines added by DrRacket (mentioned by John) 
> >>> > >> are processed when the a source file is loaded into DrRacket (via 
> >>> > >> the menu option File/Open), but are not processed if the source code 
> >>> > >> is directly copied (e.g. from a browser window) into a DrRacket 
> >>> > >> window and then executed with the 'Run' button. 
> >>> > >> 
> >>> > >> The metadata includes a #reader directive, e.g.: 
> >>> > >> (#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname 
> >>> > >> snake-full) ...) 
> >>> > >> 
> >>> > >> This reader directive appears to be silently ignored by DrRacket 
> >>> > >> when the source is 'Run', even though DrRacket shows "#reader" in 
> >>> > >> red (as when an error is detected). The actions taken by DrRacket 
> >>> > >> when 'Run' is pressed seem to depend on the settings in effect when 
> >>> > >> the code is executed, which could be nothing, or throwing a 
> >>> > >> confusing error. 
> >>> > >> 
> >>> > >> The solution for the original poster's issue is as John directs; 
> >>> > >> remove the metadata (i.e

Re: [racket-users] handin server stress testing

2019-01-25 Thread David Storrs
I don't know if this fits your use case, but one solution would be to
break the app into a submission server and a handin server.  The
students log in to the submission server with an email and password;
it does nothing except persist the code to disk in a temp file, then
move it to a 'waiting' folder.  The handin server watches the
'waiting' folder for new arrivals, does whatever it does on each new
arrival (sounds like that means run it and then verify the results?),
and sends an email to the appropriate user with their results.  It
would allow you to accept an essentially unlimited number of
simultaneous submissions and to provide a fairly good estimate of when
the response should be expected.  ("There are currently 10 programs in
the queue ahead of you")

It sounds like the handin server is already running user-submitted
code, so I don't think this gives you any  attack vectors that you
didn't already have.

On Fri, Jan 25, 2019 at 3:55 AM 'John Clements' via Racket Users
 wrote:
>
> As I think I mentioned to some of you earlier, I’ve been having real trouble 
> holding together a handin server for a class of 100 students all writing 
> typed racket code. In order to dig deeper, I set up a test machine and a 
> repeatable test harness, and I discovered some things that really surprised 
> me; perhaps there are easy fixes for some of these, perhaps not.
>
> I’m running the handin server on a 2-core, 4 GB linode server. There’s 
> nothing else running on the machine, but I’m running only a single racket 
> process, so I don’t expect it to use the other core at all.
>
> Under ideal circumstances (a totally un-loaded server), it looks like a 
> correct submission should run in about 10-12 seconds end-to-end.
>
> My peak loads are around 200 submissions per hour. To model an interval on 
> the high end, I modeled a 500-submissions-per-hour rate by randomly selecting 
> 25 delays in a 3-minute period, and starting (on a different, remote machine) 
> a thread for each of these that waits the appropriate time and then tries to 
> log in and submit the code. Each thread logs in as a different user. The 
> server is configured with a two-minute timeout. Every submission is of my 
> sample solution, which passes all of the tests.
>
> My basic metric is “successes per minute”; that is, ignoring all of the 
> timeouts, how many can we get through in each minute. At 8 submissions per 
> minute, there’s absolutely no way for the server to keep up with the test 
> load, so some failures are inevitable.
>
> As I think I may have mentioned before, the base results are discouraging; 
> the handin server successfully checks 3.16 per minute, but (okay, I do have 
> other metrics) at the end, nearly all of them are skating on the edge of the 
> timeout, so that many students are waiting for fully two minutes and then 
> being told that their program might have a bug that makes it loop forever.
>
> The first thing I did was just to put a single semaphore in place with an 
> initial value of 1 and a fail-thunk that tells the user that there are too 
> many submissions being processed. So: at most one at a time, with fast fail. 
> Surprisingly, this did about as well as the base model, and the response 
> times were, unsurprisingly, much much shorter. Of course, 15 of the 25 
> submissions were rejected. Also, students here aren’t being told that their 
> code might be bad, they’re just being told that the server is busy, arguably 
> better. On the other hand, failed submissions aren’t even stored by the 
> server; I could perhaps tighten the code protected by the semaphore to solve 
> this.
>
> The next thing I did was to change the call-with-semaphore to comment out the 
> fail-thunk, so that later submissions would just wait politely until the 
> earlier ones were done.
>
> Surprisingly, this did *terribly*. The server only processed 1.9 submissions 
> per minute, and only successfully got through 9 submissions. The rest, as in 
> the initial scenario, were put on ice for longer and longer periods of time. 
> It didn’t even start out well; the very first ones were already horribly slow.
>
> I thought about this for a while, and it appears somehow that the delayed 
> submissions—the ones waiting for the semaphore—are somehow consuming a huge 
> amount of some resource, and I’d have to guess it’s memory. I can’t really 
> see why this would be the case; each one has an open SSL connection and a 20k 
> file to process. In fact, I can see that the log is periodically dumping a 
> chunk of 30 lines corresponding to waiting procedures, where one is of size 
> (say) 30 megabytes and all of the other waiting ones are tiny (20k, 22k, 
> something like that). What I’m trying to figure out is why having waiting 
> processes would be so, so expensive.
>
> Very strange (to me).
>
> It looks like the best setting for me right now is to set a limit of no more 
> than two simultaneous submissions, and to definitely definitely use a 
> 

Re: [racket-users] Scribble examples for languages other than Racket

2019-01-25 Thread Ryan Kramer
On Thursday, January 24, 2019 at 9:45:39 PM UTC-6, Alex Knauth wrote:
>
> Would the `scribble-code-examples` package work for you? 
> https://docs.racket-lang.org/scribble-code-examples/index.html
>
> Looks like yes, it will! Thanks.

-- 
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] Collections and data structures wishlist?

2019-01-25 Thread Jack Firth
>
> Maybe you'll need to clarify what Racket2 is? I am not familiar.


Racket2 is the (unofficial) name of what Racket could hypothetically be if
we made lots of breaking changes to the existing APIs. It's named that
because it would likely mean creating a `#lang racket2` language with all
of the new APIs instead of breaking existing code that uses `#lang racket`.

(define tuple/c list/c)
> The key to list/c and listof is that the code inside of
> functions contracted with either of them can use map
> and filter and everything else to process the arguments.


Due to the kind of data that would go in tuples - namely, a fixed-sized
heterogeneous collection of values - a function probably *shouldn't* use
map and filter to process tuples. A program that calls filter on an x-y-z
coordinate tuple is likely incorrect and not what the programmer intended.
The same is true for a function that calls map on a tuple containing many
wildly different kinds of data.

Well also, I thought `list/c` already means "tuple"?
>
> (listof number?) is a list of many numbers.
> (list/c number?) is a list of one number.
>

And this has tripped me up numerous times. I often forget which is the one
I meant to use and have to look it up in the docs, assuming I even notice I
used the wrong one. With distinct list and tuple types, these two contracts
could be named `list/c` and `tuple/c` and we wouldn't need this strange
"foo-collection/c vs foo-collectionof" distinction in our contract
combinators.

Tables are pretty cool!
> https://www.pyret.org/docs/latest/tables.html


I love this idea.

On Thu, Jan 24, 2019 at 11:20 AM Matthias Felleisen 
wrote:

>
> (define tuple/c list/c)
>
> The key to list/c and listof is that the code inside of
> functions contracted with either of them can use map
> and filter and everything else to process the arguments.
>
>
>
> > On Jan 24, 2019, at 8:33 AM, Gustavo Massaccesi 
> wrote:
> >
> > I also like the idea of a contract like "tuple/c", perhaps with a more
> rackety name.
> >
> > Gustavo
> >
> > On Wed, Jan 23, 2019 at 12:02 PM Greg Hendershott <
> greghendersh...@gmail.com> wrote:
> > >> - A separation between using lists as homogeneous collections and
> using lists as fixed-size tuples. So there'd be a separate `tuple?` data
> type that's structurally equivalent to a list but meant to be used
> differently. For example, `(list/c number?)` would mean a list of many
> numbers, but `(tuple/c number?)` would mean a tuple of size 1 containing a
> number.
> > >
> > > "It is better to have 100 functions operate on one data structure than
> 10 functions on 10 data structures.”
> http://www.cs.yale.edu/homes/perlis-alan/quotes.html
> > > "It is better to have 100 transducers operate on one data structure
> interface than 10 functions on 10 data structures.” Rich Hickey, History of
> Clojure
> >
> > Well also, I thought `list/c` already means "tuple"?
> >
> > (listof number?) is a list of many numbers.
> > (list/c number?) is a list of one number.
> >
> >
> > I think it's within the Racket spirit to make a little #lang for
> > certain audiences or projects. At some org, "tuple/c" might be a
> > helpful alias. Or, for some other team, it's not, and in fact even
> > "list/c" is redefined to raise an error, "Please use structs instead
> > of ad hoc tuples."
> >
> > --
> > 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] Collections and data structures wishlist?

2019-01-25 Thread Thomas F. Burdick



On January 25, 2019 8:33:09 PM GMT+01:00, Jack Firth  
wrote:
>
>Due to the kind of data that would go in tuples - namely, a fixed-sized
>heterogeneous collection of values - a function probably *shouldn't*
>use
>map and filter to process tuples. A program that calls filter on an
>x-y-z
>coordinate tuple is likely incorrect and not what the programmer
>intended.

Funny you should pick that as an example. I work in a CAD environment where 
points are two-item lists, and polygon outlines are lists of points. You'd be 
surprised how often it's useful to use ordinary list functions on points.

-- 
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] Collections and data structures wishlist?

2019-01-25 Thread Matthias Felleisen


> On Jan 25, 2019, at 3:46 PM, Thomas F. Burdick  wrote:
> 
> 
> 
> On January 25, 2019 8:33:09 PM GMT+01:00, Jack Firth  
> wrote:
>> 
>> Due to the kind of data that would go in tuples - namely, a fixed-sized
>> heterogeneous collection of values - a function probably *shouldn't*
>> use
>> map and filter to process tuples. A program that calls filter on an
>> x-y-z
>> coordinate tuple is likely incorrect and not what the programmer
>> intended.
> 
> Funny you should pick that as an example. I work in a CAD environment where 
> points are two-item lists, and polygon outlines are lists of points. You'd be 
> surprised how often it's useful to use ordinary list functions on points.


That’s precisely the kind of programming I had in mind. Racket is one of the 
few languages where you can eat your cake and have it anyways. Why take away 
that strength? 

-- 
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] Collections and data structures wishlist?

2019-01-25 Thread Jack Firth
I don't intend to make these operations impossible or even difficult. One
of the other things on my wishlist is a transducers library, which would
IMO be a good fit for a lot of the logic that Racket currently provides as
list-processing functions. So if you want to process tuples as generalized
streams of values, you'd use transducers on them. But if you want to
process tuples as *tuples*, you'd use tuple-processing functions. I think
mapping and filtering fit the first category more than the second. This
kind of divide makes it much easier to support a wide array of data
structures without copying the entire list processing API for each one.

On Fri, Jan 25, 2019 at 12:51 PM Matthias Felleisen 
wrote:

>
> > On Jan 25, 2019, at 3:46 PM, Thomas F. Burdick 
> wrote:
> >
> >
> >
> > On January 25, 2019 8:33:09 PM GMT+01:00, Jack Firth <
> jackhfi...@gmail.com> wrote:
> >>
> >> Due to the kind of data that would go in tuples - namely, a fixed-sized
> >> heterogeneous collection of values - a function probably *shouldn't*
> >> use
> >> map and filter to process tuples. A program that calls filter on an
> >> x-y-z
> >> coordinate tuple is likely incorrect and not what the programmer
> >> intended.
> >
> > Funny you should pick that as an example. I work in a CAD environment
> where points are two-item lists, and polygon outlines are lists of points.
> You'd be surprised how often it's useful to use ordinary list functions on
> points.
>
>
> That’s precisely the kind of programming I had in mind. Racket is one of
> the few languages where you can eat your cake and have it anyways. Why take
> away that strength?

-- 
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] Beginning of the end for googlegroups?

2019-01-25 Thread 'Paulo Matos' via Racket Users
Apologies for message unrelated to racket, but it might affect us.

Just read this:
https://groups.google.com/a/isocpp.org/forum/m/#!msg/sg14/FZEWCOSyFlk/MFUXyq1YDAAJ

Not sure of the size of the mailing list but I wonder if this is the beginning 
of the end and we should have instead a plan B.

--
Paulo Matos 

-- 
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] Beginning of the end for googlegroups?

2019-01-25 Thread Jack Rosenthal
On Fri, 25 Jan 2019 at 23:59 +0100, 'Paulo Matos' via Racket Users wrote:
> Not sure of the size of the mailing list but I wonder if this is the
> beginning of the end and we should have instead a plan B.

We could always go back to Mailman...

Or, if someone started working on a Racket-based alternative to Mailman,
I'm certain people around here would be very excited to use it.

-- 
Jack M. Rosenthal
http://jack.rosenth.al

If Java had true garbage collection, most programs would
delete themselves upon execution.
-- Robert Sewell

-- 
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.


signature.asc
Description: PGP signature


Re: [racket-users] Collections and data structures wishlist?

2019-01-25 Thread Matthias Felleisen

Yes. See Clojure history. — Matthias



> On Jan 25, 2019, at 4:21 PM, Jack Firth  wrote:
> 
> I don't intend to make these operations impossible or even difficult. One of 
> the other things on my wishlist is a transducers library, which would IMO be 
> a good fit for a lot of the logic that Racket currently provides as 
> list-processing functions. So if you want to process tuples as generalized 
> streams of values, you'd use transducers on them. But if you want to process 
> tuples as tuples, you'd use tuple-processing functions. I think mapping and 
> filtering fit the first category more than the second. This kind of divide 
> makes it much easier to support a wide array of data structures without 
> copying the entire list processing API for each one.
> 
> On Fri, Jan 25, 2019 at 12:51 PM Matthias Felleisen  > wrote:
> 
> > On Jan 25, 2019, at 3:46 PM, Thomas F. Burdick  > > wrote:
> > 
> > 
> > 
> > On January 25, 2019 8:33:09 PM GMT+01:00, Jack Firth  > > wrote:
> >> 
> >> Due to the kind of data that would go in tuples - namely, a fixed-sized
> >> heterogeneous collection of values - a function probably *shouldn't*
> >> use
> >> map and filter to process tuples. A program that calls filter on an
> >> x-y-z
> >> coordinate tuple is likely incorrect and not what the programmer
> >> intended.
> > 
> > Funny you should pick that as an example. I work in a CAD environment where 
> > points are two-item lists, and polygon outlines are lists of points. You'd 
> > be surprised how often it's useful to use ordinary list functions on points.
> 
> 
> That’s precisely the kind of programming I had in mind. Racket is one of the 
> few languages where you can eat your cake and have it anyways. Why take away 
> that strength?

-- 
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] Beginning of the end for googlegroups?

2019-01-25 Thread Neil Van Dyke
Google has shut down many services, including some surprising ones. 
Without getting alarmed, I think it's reassuring that we could handle an 
end-of-life of Google Groups on fairly short notice, if that ever 
happened...


Regarding hosting of the email list server... worst case, were Google 
Groups to shut down with no good migration offering... if we can't find 
a turn-key email list service we like, we could always run the 
time-honored MailMan on either one of the affiliated universities' 
in-house systems (if the non-owned .org domain name isn't a problem for 
that .edu), or on Linode/AWS/etc.


That part doesn't have to be much work (click a few buttons with a 
turn-key hoster, copy&paste the user list, point a DNS MX record at the 
new server), *unless* we have to set up a new MailMan install (which 
implies a lot more sys-admin tasks, immediate and then ongoing maintenance).


The tricky parts of moving are not with the email list server itself, 
but preserving the archive and citation links:


* Reconstructing a past email list archive, which, unless Google offers 
list managers a complete data dump, might mean either scraping the raw 
emails from Google Groups while it's still around (or from one of those 
email list mirror services that hopefully caught everything and didn't 
mangle it), or taking it from someone's personal saved emails (and 
carefully weeding out any messages that weren't actually to the list, 
like discussions taken offline).


* Were Google Groups shut down in such a way that citation links (for 
messages and threads) were broken (no read-only version, no configurable 
redirects), we'd partly have to accept that there will be broken links.  
Were we to scrape the archive, we might be able to preserve the info 
about the old links, and then put up a Web page that makes it easier for 
people to reconstruct a link on demand, but that's significant work for 
perhaps little benefit.



(Actually, if we *knew* Google Groups was going to be shut down in a 
cold and uncaring way, it might be a business opportunity for someone: 
not only offer alternative hosting for email lists and Web forums, but 
also automate the migration of people's data, maybe including some way 
of patching broken links.  Your link-patching might work among all lists 
you host, even those managed by different parties, which could motivate 
referrals for other lists to move to you.  This is a big job, not 
because implementing a email list or Web forum service is difficult 
beyond engineering for robustness, but because Google Groups is more 
complicated than it looks, and you have to wade through all that, and 
triage and map features.  Then maybe FB would try to buy you, to 
eliminate you as competition as you segue into additional social media 
services, as well as to grab ownership of all your users and their 
communications.  Though, the clear, refreshing taste of Racket could 
make this messy business go more easily.  :)


--
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.