Re: [racket-users] Re: Memory usage of (port->lines ...) is extreamly high

2020-09-24 Thread Sam Tobin-Hochstadt
port->lines produces a list with all the lines in it. That list is what
uses all the memory. Using in-lines avoids producing the whole list at
once.

Sam

On Thu, Sep 24, 2020, 8:53 AM Hong Yang  wrote:

> Thanks Laurent, I tried (in-lines...), and yes, it's memory-efficient, but
> I still curious and concern why (port->lines ...) takes so many memory.
>
> Best regards
> Hong
>
> On Thursday, September 24, 2020 at 6:55:10 PM UTC+8 laurent...@gmail.com
> wrote:
>
>> Quick comment: of you don't need to load the whole file but want to parse
>> it line by line, use `in-lines` which is memory-efficient.
>>
>> On Thu, Sep 24, 2020, 11:46 Hong Yang  wrote:
>>
>>> Update with memory dump log attached.
>>>
>>> 1. With out (set! input empty), call (collect-garbage) doesn't help
>>> 2. Call (set! input empty) and (collect-garbage), memory reduce
>>> dramaticly.
>>>
>>> ; 214M(VIRT)/101M(RSS) without open any file
>>> (let loop()
>>>   (sleep 5)  ; Waiting here so that I can check it via top/ps
>>>   (dump-memory-stats)
>>>   (collect-garbage)
>>>   (set! input empty)  ; Even not help with this line, it works after
>>> called (collect-garbage) explicity.
>>>   (loop))
>>>
>>> On Thursday, September 24, 2020 at 6:14:55 PM UTC+8 Hong Yang wrote:
>>>
 Hi Racketer

 I'm trying to load a log file which size is 600MB, then I found the
 program exhausted 3 GB resident memory just for load all the content of it
 via (port->lines...). I do have enough RAM but it looks like some thing
 went wrong here, and I do need to load them all into RAM for my use case so
 (read-line ...) doesn't help me.

 Any comment would be preciated.

 Here is may programe:

 #!/usr/bin/racket
 #lang racket

 ; Load input as list of lines
 (define (input-load-lines file-name)
   (if (file-exists? file-name)
   (let* ([input (open-input-file file-name)]
  [lines (port->lines input)])
 (close-input-port input)
 lines)
   empty))

 ; Racket 7.8, compile from source code, (none cs mode)
 ; 100M of log requires 0.5G runtime memory
 ; 300M of log requires 1.5G runtime memory
 ; 600M of log requires 3.0G runtime memory
 ;
 ; Reference
 ;   racket/collects/racket/port.rkt :106
 ;   racket/collects/racket/private/portlines.rkt :11

 (define input (input-load-lines "main.log"))

 ; 214M(VIRT)/101M(RSS) without open any file
 (let loop()
   (sleep 5) ; Waiting here so that I can check it via top/ps
   (set! input empty) ; event not help with this line
   (loop))

 Thanks
 Hong

>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/racket-users/07c41b96-87ba-473a-ad0e-0cec71dc4024n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/f761c588-da7e-43d4-9b05-b917f64f4b52n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bb1-goK4tz0Yh8axfZdvwq%3DzNCFfva8zu5Sj46%3Dri6Yjw%40mail.gmail.com.


Re: [racket-users] [racket users] describe variant issue?

2020-09-17 Thread Sam Tobin-Hochstadt
We may change Racket CS so that it produces the same results, but in
general the results of `struct->vector` on values that are opaque is
not something that should be relied on.

The describe library is, I believe, unmaintained, and hasn't been
updated in many years.

Sam

On Thu, Sep 17, 2020 at 1:17 PM Kevin Forchione  wrote:
>
>
>
> > On Sep 15, 2020, at 3:11 PM, Sam Tobin-Hochstadt  
> > wrote:
> >
> > This is a difference in behavior between Racket BC and Racket CS, and
> > not something in the describe library:
> >
> > [samth@homer:~/work/teaching/c211 (master) racket-7.8] racket
> > Welcome to Racket v7.8.
> >> (struct->vector 5)
> > '#(struct:fixnum-integer ...)
> >> ^D
> > [samth@homer:~/work/teaching/c211 (master) plt] racket
> > Welcome to Racket v7.8.0.9 [cs].
> >> (struct->vector 5)
> > '#(struct:simple …)
>
>
> Is this going to be the go-forward stance for Racket? Or is this still a work 
> in progress? Will it be left up to the code to determine types through 
> predicate checking?
>
> Thanks!
>
> Kevin
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/F42194F9-ADA3-4158-BCBA-3A65F2108AB4%40gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaiK06QrfOc2FLjTCFzvvo-cPpbSGChQ9yAnon_tp6wVw%40mail.gmail.com.


Re: [racket-users] [racket users] describe variant issue?

2020-09-15 Thread Sam Tobin-Hochstadt
This is a difference in behavior between Racket BC and Racket CS, and
not something in the describe library:

[samth@homer:~/work/teaching/c211 (master) racket-7.8] racket
Welcome to Racket v7.8.
> (struct->vector 5)
'#(struct:fixnum-integer ...)
> ^D
[samth@homer:~/work/teaching/c211 (master) plt] racket
Welcome to Racket v7.8.0.9 [cs].
> (struct->vector 5)
'#(struct:simple ...)

On Tue, Sep 15, 2020 at 5:47 PM Kevin Forchione  wrote:
>
> Hi guys,
> I’m not sure why the describe library’s variant is always returning ‘simple 
> regardless of numeric value. For instance, the docmentation says:
>
> (variant 1) -> fixnum-integer
>
> But when I run it under Dr Racket 7.8 [cs] it returns ‘simple for this, as 
> well as for 10.3  as well as pi, 2/3, and 0+1i.
>
> Any ideas why this is happening?
>
> Thanks!
>
> Kevin
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/367E5C0C-FA1C-4546-A586-54135D264C6B%40gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bbwvpu2FGsqTwRkBVJEg9%2B6%2Bb5f1RUzXwofKDjaHsjZNw%40mail.gmail.com.


Re: [racket-users] locally linked package name doesn't match info collection name

2020-09-09 Thread Sam Tobin-Hochstadt
For that, I recommend "Open require path" in the File menu in DrRacket.

Sam

On Wed, Sep 9, 2020, 9:09 PM Shriram Krishnamurthi 
wrote:

> I'm curious why the Package Manager doesn't also show the collection name
> (or plural)? Wouldn't I need that to trace backwards? "This program in
> #lang foo is behaving oddly, I wonder what foo's source is" — find the
> collection in the PM, trace back to the package, locate the source…?
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYGvMDEpVJjnJHztvkQM2L5Ft_CyYXvKCODSKKFsc_H5w%40mail.gmail.com.


Re: [racket-users] locally linked package name doesn't match info collection name

2020-09-09 Thread Sam Tobin-Hochstadt
This is all as expected. The package name is mystery-language-uploader, but
the collection name is mystery-language. The info.rkt entry controls the
latter but not the former [1]. If you're linking it on the command line,
you can use a command line option to specify the package name to use.

[1] This is necessary, since you need to know the package name in general
to find the info.rkt file in the first place.

Sam

On Wed, Sep 9, 2020, 9:03 AM Shriram Krishnamurthi 
wrote:

> This is almost certainly intended and/or I may have totally misunderstood
> the semantics of the info file, but this feels a bit confusing:
>
> I have a package on my filesystem in the directory
> mystery-languages-uploader. The "-uploader" part is a local name that's
> not intended for public consumption, so its info.rkt contains this:
>
> (define collection "mystery-languages")
>
> Sure enough, I am able to use the content of that directory using, e.g.,
>
> #lang mystery-languages/…
>
> However, the Package Manager only shows an entry (in the "Name" column)
> for "mystery-languages-uploader", not "mystery-languages". (The "Source"
> column shows the right folder, and the search box under "Currently
> Installed" does not show any other package of similar name.)
>
> I would have expected the collection setting to cause the Name showing in
> the Package Manager to be just "mystery-languages", which would also help
> me understand where that #lang is coming from.
>
> Shriram
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/f99c0426-cb6e-478b-a794-dec114f8cef7n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bb1%3Dwwp3w4uJbdfbqFWHt7W1DP-w-4oS06GeP6M1Wx4qA%40mail.gmail.com.


Re: [racket-users] Why is struct/contract so much faster than a guard?

2020-09-02 Thread Sam Tobin-Hochstadt
The issue is that `struct-guard/c` is slow. If you just write a
function as a guard it's faster than `struct/contract`.

Sam

On Wed, Sep 2, 2020 at 3:41 PM Christopher Lemmer Webber
 wrote:
>
> I tested the following:
>
>   (struct foo (bar baz)
> #:guard (struct-guard/c any/c list?))
>
> and:
>
>   (struct/contract foo ([bar any/c]
> [baz list?]))
>
> With the first:
>
>   test> (time
>  (for ([i 100])
>(foo 'yeah '(buddy
>   cpu time: 2601 real time: 2599 gc time: 7
>
> With the second:
>
>   test> (time
>  (for ([i 100])
>(foo 'yeah '(buddy
>   cpu time: 184 real time: 184 gc time: 13
>
> Wow, what the heck?  That's about a 10x difference.  What?!?!?
> Why would #:guard be so damn slow in comparison?  You'd think they'd be
> doing the same thing.
>
> Unfortunately I can't use #:methods with struct/contract so I'm stuck
> with the slow one if I want a contract on the struct?
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/873640arw7.fsf%40dustycloud.org.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BbX8B9vknFmzqsrnQDkyUmcfnDfio7-LoC1efwAuxSfqA%40mail.gmail.com.


Re: [racket-users] Can no longer interactively enter! module from the shell

2020-08-10 Thread Sam Tobin-Hochstadt
I tried a few more versions of Racket, and this broke between 6.12 and
7.0, probably due to the new expander at that time. I'm surprised that
it works on Racket CS, though.

Sam

On Mon, Aug 10, 2020 at 10:36 AM Greg Rosenblatt  wrote:
>
> Thanks, your output helped narrow down the issue.  It looks like the problem 
> is actually with the regular (non-Chez) variant.
>
>
> When running with Racket v7.8 [cs] I see the same (expected) behavior as you:
>
> > racket -ie '(enter! "example.rkt")'
> Welcome to Racket v7.8 [cs].
> loading example
> "example.rkt"> example
> 5
> "example.rkt">
>
>
> However, the regular variant of Racket v7.8 still has an issue:
>
> > racket -ie '(enter! "example.rkt")'
> Welcome to Racket v7.8.
> loading example
> > example
> ; example: undefined;
> ;  cannot reference an identifier before its definition
> ;   in module: top-level
> ; [,bt for context]
> > ,bt
> ; example: undefined;
> ;  cannot reference an identifier before its definition
> ;   in module: top-level
> ;   context...:
> ;eval-one-top
> ;/Applications/Racket v7.8/share/pkgs/xrepl-lib/xrepl/xrepl.rkt:1493:0
> ;/Applications/Racket v7.8/collects/racket/repl.rkt:11:26
>
>
> On Monday, August 10, 2020 at 11:09:09 AM UTC-4, Sam Tobin-Hochstadt wrote:
>>
>> This works for me the way you describe:
>>
>> ```
>> [samth@huor:/tmp cs-snap] r -ie '(enter! "x.rkt")'
>> Welcome to Racket v7.8.0.7 [cs].
>> loading example
>> "x.rkt"> example
>> 5
>> "x.rkt">
>> ```
>>
>> Perhaps there was a problem with 7.3 that you're running into? Can you
>> try with the 7.8 release?
>>
>> Sam
>>
>> On Sun, Aug 9, 2020 at 8:33 PM Greg Rosenblatt  wrote:
>> >
>> > Given a module defined in example.rkt:
>> > ```
>> > #lang racket/base
>> > (provide example)
>> >
>> > (displayln "loading example")
>> >
>> > (define example 5)
>> > ```
>> >
>> > I used to be able to enter example.rkt with an interactive session from 
>> > the shell like this:
>> >
>> > > racket -ie '(enter! "example.rkt")'
>> > Welcome to Racket v7.3.
>> > loading example
>> > > example
>> > ; example: undefined;
>> > ;  cannot reference an identifier before its definition
>> > ;   in module: top-level
>> > ; [,bt for context]
>> > > ,bt
>> > ; example: undefined;
>> > ;  cannot reference an identifier before its definition
>> > ;   in module: top-level
>> > ;   context...:
>> > ;eval-one-top12
>> > ;/Applications/Racket v7.3/share/pkgs/xrepl-lib/xrepl/xrepl.rkt:1477:0
>> > ;/Applications/Racket v7.3/collects/racket/repl.rkt:11:26
>> >
>> >
>> > The module still seems to be loading, but my interactive session hasn't 
>> > started in the module context.  Racket 6 used to start my interactive 
>> > session in the module context.
>> >
>> > Was this change in behavior intended?  Is there a new way to achieve what 
>> > I'm trying to do?
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/racket-users/bbaf1e21-52e8-4514-9b8c-20db6357fb40o%40googlegroups.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/8439126f-f8b8-4a3c-89f2-5973f9932308o%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BY_0tfjGxpQ%3DCHBmouo42kSwdue-VzyAKr-Kx5cZg-puQ%40mail.gmail.com.


Re: [racket-users] Can no longer interactively enter! module from the shell

2020-08-10 Thread Sam Tobin-Hochstadt
This works for me the way you describe:

```
[samth@huor:/tmp cs-snap] r -ie '(enter! "x.rkt")'
Welcome to Racket v7.8.0.7 [cs].
loading example
"x.rkt"> example
5
"x.rkt">
```

Perhaps there was a problem with 7.3 that you're running into? Can you
try with the 7.8 release?

Sam

On Sun, Aug 9, 2020 at 8:33 PM Greg Rosenblatt  wrote:
>
> Given a module defined in example.rkt:
> ```
> #lang racket/base
> (provide example)
>
> (displayln "loading example")
>
> (define example 5)
> ```
>
> I used to be able to enter example.rkt with an interactive session from the 
> shell like this:
>
> > racket -ie '(enter! "example.rkt")'
> Welcome to Racket v7.3.
> loading example
> > example
> ; example: undefined;
> ;  cannot reference an identifier before its definition
> ;   in module: top-level
> ; [,bt for context]
> > ,bt
> ; example: undefined;
> ;  cannot reference an identifier before its definition
> ;   in module: top-level
> ;   context...:
> ;eval-one-top12
> ;/Applications/Racket v7.3/share/pkgs/xrepl-lib/xrepl/xrepl.rkt:1477:0
> ;/Applications/Racket v7.3/collects/racket/repl.rkt:11:26
>
>
> The module still seems to be loading, but my interactive session hasn't 
> started in the module context.  Racket 6 used to start my interactive session 
> in the module context.
>
> Was this change in behavior intended?  Is there a new way to achieve what I'm 
> trying to do?
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/bbaf1e21-52e8-4514-9b8c-20db6357fb40o%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BbH482_nKrHMf2UVWhFnB_baDaC2zB3Y-_t653WuzwQHg%40mail.gmail.com.


Re: [racket-users] Proposal: GitHub Issue Triage Party

2020-08-06 Thread Sam Tobin-Hochstadt
That sounds great. I'm happy to help. I created the #triage channel on
slack, which is a good place to chat about this. I'm happy to help
people figure out issues that should be closed, or reassigned, as
you've started to do. And creating a specific time to work on this
would also be great.

A note on BC vs CS: we aim to continue providing support for Racket BC
for the foreseeable future, certainly for the next several years.

Sam


On Thu, Aug 6, 2020 at 9:29 PM jcmdln  wrote:
>
> Digging through some of the older Issues in 
> https://github.com/racket/racket/issues?q=is%3Aissue+is%3Aopen+sort%3Acreated-asc
>  there appear to be many stale issues that may no longer be applicable or 
> have been silently resolved in commits that were not cross-linked.  I've 
> started to respond to some such issues, though due to the low barrier of 
> entry for finding tickets it seems that there would be value in having some 
> sort of formal announcement asking for users to help identify and draw 
> attention such issues. Once idea might be the inclusion of a section in 
> "Racket News" that would list some arbitrary issues to highlight, categorized 
> or simply listed.  Another might be a (virtual) meetup akin to Google Summer 
> of Code where individuals or small groups can pair up with a mentor to 
> resolve non-trivial issues, reminiscent of the "Inside Racket" seminars.
>
> As Racket moves from BC to CS, depending on what level of support can be 
> expected for BC in the relatively near future (ie pre-v8.0) it may be 
> worthwhile to entice users and contributors to donate their time toward doing 
> some belated "spring cleaning".  Consider this my (uninformed) 2 cents as a 
> Racket-curious user and hopeful contributor looking to donate some of my own 
> time.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/0b36280f-7995-4974-83a3-bf4d87fd0e9fn%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYe3uVvs9uhKobnRXCa-k595aen52UKK9ohxG1LykHu4g%40mail.gmail.com.


Re: [racket-users] Strange performance behavior

2020-08-05 Thread Sam Tobin-Hochstadt
What's happening here is that your function takes effectively 0 time,
but when you ran the first version, there was a GC pause during it
(that's why there's the "gc time: 9" there). GC pauses can happen at
any time, basically, so it's not something about what your function is
doing.

Here's a benchmark of your two functions that takes long enough to run
that it avoids some of these issues, and also runs a GC before
benchmarking: https://gist.github.com/7cb4645308d8572e2250833ef7b90b7c

On my machine, I get 40 ms for version 1, and 100 ms for version 2, as
you expected.

Sam

On Wed, Aug 5, 2020 at 11:21 AM wanp...@gmail.com  wrote:
>
> I was working on a exercism problem named Raindrops.
>
> Problem description:
> Convert a number to a string, the contents of which depend on the number's 
> factors.
>
> If the number has 3 as a factor, output 'Pling'.
> If the number has 5 as a factor, output 'Plang'.
> If the number has 7 as a factor, output 'Plong'.
> If the number does not have 3, 5, or 7 as a factor, just pass the number's 
> digits straight through.
>
> I came out with two version.
>
> ; version 1
> (define (convert n)
>   (define pling (divides? 3 n))
>   (define plang (divides? 5 n))
>   (define plong (divides? 7 n))
>   (if (or pling plang plong)
>   (string-append (if pling "Pling" "")
>  (if plang "Plang" "")
>  (if plong "Plong" ""))
>   (number->string n)))
>
> ; version 2
> (define (convert n)
>   (define table '((3 . "Pling") (5 . "Plang") (7 . "Plong")))
>   (define result (for/list ([(k v) (in-dict table)] #:when (divides? k n)) v))
>   (if (empty? result) (number->string n)
>   (string-append* result)))
>
> (require math/number-theory)
>
> I thought version 1 would be faster, but it turned out to be wrong. Running 
> with raco test got following timing information.
>
> version 1
> cpu time: 9 real time: 9 gc time: 9
> version 2
> cpu time: 0 real time: 0 gc time: 0
>
> Then I ran both version in DrRacket, both output following result.
> cpu time: 0 real time: 0 gc time: 0
>
> It's strange, isn't 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/46592171-c357-4897-af1a-bea91c838cacn%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYN9USK2qU4WsoNhkeZtFn%2B5DfS4uNaZR0t%3DvjfZQ%2ByqQ%40mail.gmail.com.


Re: [racket-users] Advice wanted about new opengl binding

2020-08-04 Thread Sam Tobin-Hochstadt
On Mon, Aug 3, 2020, 7:27 PM Hendrik Boom  wrote:

> On Mon, Aug 03, 2020 at 02:01:16PM -0400, Philip McGrath wrote:
> > Is this what you're looking for?
> https://pkgs.racket-lang.org/package/sgl
> >
> > -Philip
>
> Yes, looks like it.  Is it messing from the index for some good reason?
>

By default, the front page of pkgs.racket-lang.org doesn't show packages
that are in the main-distribution, such as sgl.


> I'm not sure how the packaging works.
>
> I end up at https://github.com/racket/sgl/tree/master
> where I find multiple files, including main.rkt, sgl.rlt, and gl.rkt.
> Am I correct that main.rkt is what I get with (require sgl)
> and that gl.rkt is what I get with (require sgl/gl)?
>

That's correct.

Sam


-- hendrik
>
> >
> >
> > On Sun, Aug 2, 2020 at 5:51 PM Hendrik Boom 
> wrote:
> >
> > > Time to rethink everything before I go further.
> > >
> > > So far I've found several opengl bindings.
> > > There's opengl, documented here:
> > >https://docs.racket-lang.org/opengl/index.html
> > > There are sgl and sgl/gl, documented here:
> > >https://docs.racket-lang.org/sgl/index.html
> > > and there's a typed opengl hidden with in pict3.
> > >
> > > But I cannot find sgl and sgl/gl in the index of packages
> > > at https://pkgs.racket-lang.org/
> > >
> > > Shouldn't they be there?
> > > Are they there in disguise?
> > > Abd where should I look for current source code?
> > > The index is pretty good at identifying source code for other packages.
> > >
> > > -- hendrik
> > >
> > > --
> > > 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.
> > > To view this discussion on the web visit
> > >
> https://groups.google.com/d/msgid/racket-users/20200802215123.iiqik4wpfusarcw4%40topoi.pooq.com
> > > .
> > >
> >
> > --
> > 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.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAH3z3gYmn4_5sTUNWuZDcpjL5shJmU2quTtgx72%3DoycOXccp5A%40mail.gmail.com
> .
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/20200803232728.e4yv7khscvr7c2wl%40topoi.pooq.com
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Ba%3DubOLkjrgU1H5omQSO4p8h3rwiZKh4B7UJiQLtWKc%2Bg%40mail.gmail.com.


Re: [racket-users] Recommended workaround still the same?

2020-08-02 Thread Sam Tobin-Hochstadt
Yes, I think that's still the best approach.

Sam

On Sun, Aug 2, 2020 at 4:47 PM Nate Griswold  wrote:
>
> Hello. Ran into some problems with typed racket and define-cstruct when 
> adding typed racket layer on top of my ffi bindings.
>
> Is this (https://github.com/racket/typed-racket/issues/766) still the 
> recommended way of working around the issue?
>
> Nate
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAM-xLPoRnfw%3DEwLQjq2Qwqhc56Mx5bZ7wyeaXWD1GWeN3mwG5w%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZf5E0XSoAMCLoccef5dtG7%3DjXEPD%2BUvLjsaLgP_M1ArQ%40mail.gmail.com.


Re: [racket-users] Re: Racket CS release plan

2020-08-01 Thread Sam Tobin-Hochstadt
Note that Matthew's point was not about bytecode, but about the machine
code in the Racket BC executable vs the machine code in the Chez kernel
plus boot files. Especially if you look pre-7.0, there is very little
bytecode in the Racket BC executable.

Sam

On Sat, Aug 1, 2020, 3:46 PM Gustavo Massaccesi  wrote:

> The human friendly version of the bytecode is explained in
> https://docs.racket-lang.org/raco/decompile.html?q=decompile#%28mod-path._compiler%2Fdecompile%29
> . The human friendly version looks similar to the expanded version of a
> program that you get with the Macro Debugger (when the macros are not
> hidden), but without the syntax scopes and with a few additional quirks.
> (Note that the bytecode production has a few additional steps after
> expansion, for example inlining, constant propagation and folding.)
>
> The disk version is more compact, but IIRC it is not documented.
>
> Gustavo
>
>
> On Sat, Aug 1, 2020 at 3:50 PM George Neuner  wrote:
>
>> Hi Matthew,
>>
>> On 8/1/2020 2:01 PM, Matthew Flatt wrote:
>> > At Sat, 01 Aug 2020 03:56:36 -0400, George Neuner wrote:
>> > > On Fri, 31 Jul 2020 20:20:05 -0700 (PDT),
>> > > "wanp...@gmail.com"
>> > >  wrote:
>> > >
>> > > >I noticed that the size of the CS version is 244% compare to BS
>> > > >version. Wondering why it became so large. Does that mean Chez
>> Scheme
>> > > >runtime/vm 100 MB larger than the original one?
>> > > >
>> > > >Racket Mac OS X
>> > > >  64-bit Intel 116.7 MB SHA1:
>> 521b5a264afcfb3f390afacc682987268f650a25
>> > > >
>> > > >Racket CS Mac OS X
>> > > >  64-bit Intel 285.8 MB SHA1:
>> 060f311fc6621c5797a62f98b743499fa4277793
>> > > >
>> > > >https://pre-release.racket-lang.org/
>> > >
>> > >
>> > > The CS version compiles to native code rather than portable bytecode,
>> > > so pretty much everything in the distribution is somewhat larger.  It
>> > > adds up quickly.
>> >
>> > That's still the best explanation I have, but I also think there must
>> > be something more to it.
>> >
>> > For example, the Chez Scheme boot files in uncompressed form add up to
>> > about 8 times the size of compiled Racket BC executable, but Chez
>> > Scheme doesn't have 8 times the functionality of the Racket BC
>> > executable (so it should have 8 times as much machine code). The
>> > machine code generated by Chez Scheme for its boot files is less
>> > compact than machine code generated by GCC or LLVM for Racket BC's
>> > implementation --- but, again, I don't think it's a factor of 8. So,
>> > I'm optimistic that I've so far overlooked something that can make a
>> > big difference.
>> >
>> > I've concentrated more on understanding the difference in the run-time
>> > memory footprints, and the difference there is not nearly so large.
>> > Racket CS now sometimes has a smaller memory footprint than Racket BC
>> > (e.g., peak memory use for a distribution build).
>> >
>> > Matthew
>>
>> I don't know details of the Racket bytecode, but I'm assuming that it is
>> a mix of simpler operations that map directly to one or a few native
>> instructions, and more complex operations that compile to (the
>> equivalent of) a small function.  Probably some of these functions can
>> be inlined, but I expect there still would be some that can't.
>>
>> To understand the difference in code size, you would need to look at the
>> lengths of bytecode instructions vs their native code equivalents, and
>> account for instances of those operations that can be inlined and for
>> calls to the functions for operations that can't.
>>
>>
>> As I said above, I don't know details of Racket bytecode, but a lot of
>> virtual machines use 8 or 16 bit opcodes and (allowing for immediate
>> operands) have average instruction lengths of 3..4 bytes. Contrast this
>> with, e.g., x86-64 code in which the average instruction is 5..6 bytes
>> [larger if many instructions require length prefixes (e.g., 32-bit ops
>> in 64-bit code)].  The difference can add up very quickly.
>>
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/c3324f5f-19cd-1e0f-3d83-08787474bede%40comcast.net
>> .
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAPaha9My_paizR3P_XWLkRshPmj4hy0m%2B%3DZ0mrjt-p9uXTdtYQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you 

Re: [racket-users] Does Racket interpreter exist?

2020-07-27 Thread Sam Tobin-Hochstadt
A few thoughts on interpreters vs compilers:

- somewhere, there has to be an interpreter -- the x86 chip in my
laptop is interpreting the x86 code that Racket generates.
- there could certainly be a more direct AST-based interpreter for
(fully-expanded) Racket. My work on Pycket involved writing such an
interpreter, for example.

The best way to distinguish compilers from interpreters is that a
compiler takes a program and produces another program, whereas an
interpreter takes a program (along with some input) and produces an
answer.

Sam

On Mon, Jul 27, 2020 at 12:35 PM zeRusski  wrote:
>
> Thank you for this fantastic reply Sam! I now think I had a very naive model 
> of "interpreter" when I asked the question. My CS degree from the nowhere 
> university has it that language interpreters walk the tree and you know 
> "execute" be it in the host language or generating native code. I feel a bit 
> stupid now. Technically you're absolutely right - there is an interpreter for 
> the bytecode (or whatever), so duh. But there are also a bunch of compilation 
> steps in between. I am now completely lost as to what constitutes a compiler 
> and what makes an interpreter. I always thought of interpreters as something 
> I encountered in PLAI. I remember reading some old paper abound "fast 
> interpreters" and all of them implemented a virtual machine they "compiled" 
> to and I was lost then - how's that not a compiler - as I am lost now.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/b183ae65-524d-4e70-9bee-ce0531bf21feo%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ0G-iYDYAreU2qg1vC%3DDhT777%3DsE2kqT6QC0iQyD3JwQ%40mail.gmail.com.


Re: [racket-users] Does Racket interpreter exist?

2020-07-26 Thread Sam Tobin-Hochstadt
Hi,

Racket BC (the non-Chez version) does use an interpreter. The pipeline
in Racket BC is

   source code => expanded code => compiled bytecode => interpreter

or

   source code => expanded code => compiled bytecode => JIT compiler
=> machine code

You can turn off the JIT compiler with the `-j` flag, meaning that it
always uses the interpreter. There is also an interpreter for Racket
CS, but that is a little harder to control manually and less
efficient, so I'll ignore it for these purposes.

The compilation time for Racket is quite small, actually, and
typically pays for itself. The "start slow" effect that you see is
mostly 3 things, in varying proportions in different settings:

1. Time to run macro expansion.
2. Time to do IO to load the standard library (such as `racket/base`)
3. Time to execute the modules in the standard library

For example, if we look at the time to run the command `racket -l
racket/base`, which just loads `racket/base` and exits, provided that
you've fully compiled all of `racket/base`, that takes no time under
bullet 1. But it's still somewhat slow, about 70 ms on my machine.
Python, executing a single print command, is an order of magnitude
faster. That's because Python (a) loads many fewer python source files
on startup (`racket -l racket/base` looks at 234 files that are
actually there with `.rkt` in the name, Python looks at 96) and (b) I
believe the Python module loading semantics allows less work at load
time. Additionally, when Racket starts up, it executes the source of
the expander, which is stored as bytecode in the binary.

All these things add up to slower start time. For user programs, if
you time just expansion of the program (with `raco expand`) and also
compiling the program (with `raco make`) you'll see that most of the
time is expansion time. For the JIT compiler, turning it off
_increases_ startup time because JIT compilation is enough of a win
on, for example, the code in the macro expander.

To have a "start-fast" version of Racket, we would need to pursue some
of the following directions:
 1. ways of loading code using `mmap()` instead of doing IO and
parsing bytecode or compiled machine code
 2. ways to indicate that certain modules didn't need to do any real
execution, perhaps because they contain purely definitions
 3. ways to flatten all of a racket program into something that can be
compiled and loaded as a single file, avoiding IO (this accomplishes 2
as well)
 4. ways to make the macro expander substantially faster

Sam


On Sun, Jul 26, 2020 at 1:36 PM zeRusski  wrote:
>
> Hi all. I wonder if such a thing exist or even possible? Question triggered 
> by the trade off between "compile slowly now to run fast later" vs "start 
> fast". Racket like other modern(ish) Scheme derivatives appear to have 
> settled on being in the former camp. Is there anything in the language that 
> would make interpretation infeasible (semantics?) or unreasonably slow 
> (expansion?)? Chez sports an interpreter with some limitations. I think 
> Gambit ships one although I'm not sure how performant that one is. IIRC Guile 
> recently got something. What about Racket?
>
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/dd9dd201-5826-4453-8fbe-babc0c477dcdo%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYyjhB47L0YTxOCTDue%3DNscAef4MWGfHqSH7ZweRFukPg%40mail.gmail.com.


[racket-users] Re: Racket Survey 2020

2020-07-23 Thread Sam Tobin-Hochstadt
A reminder: there's one more week to take the 2020 Racket Survey.
We've had fantastic response so far, but we don't want to miss anyone.
Fill out the survey here: https://forms.gle/XeHdgv8R7o2VjBbF9

Sam

On Tue, Jun 23, 2020 at 12:22 PM Sam Tobin-Hochstadt
 wrote:
>
> We’re taking a survey! We want to better understand the Racket
> community, from people who have been contributing for decades to those
> who have just joined us, and from seasoned programmers to those just
> starting out.
>
> One of our goals is to help bring in new contributors and make it
> easier to become a part of the community.
>
> Fill out the survey here: https://forms.gle/XeHdgv8R7o2VjBbF9
>
> Completing the survey should take 10–15 minutes, and is anonymous
> (unless you decide to include your name). The survey will be open
> until July 31 and we will report on the results sometime after that.
>
> Please help us spread the word by sharing the survey link on your
> social network feeds, at conferences, around your office, and in other
> communities.
>
> If you have any questions, please let us know at sur...@racket-lang.org.
>
> Stephen De Gabrielle & Sam Tobin-Hochstadt

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZvZG837q1dSuMUpZksVjqa%2Bhc_f_hisy91zioFqix_rg%40mail.gmail.com.


Re: [racket-users] Re: Combining generators and typed racket

2020-07-22 Thread Sam Tobin-Hochstadt
To implement support for this, you would mostly need to add types for
the relevant functions -- but those functions are the ones that
generators (or streams) expand to. For generators, the key ones look
to be `create-generator` and `yield`. `create-generator` is not
exported, so you'd have to add the type in
`typed-racket/base-env/base-special-env`. `yield` can be given a type
in `typed-racket/base-env/base-env`. The tricky part will be figuring
out what those types should be.

I'm happy to answer more questions about adding this.

Sam

On Wed, Jul 22, 2020 at 3:22 PM Nate Griswold  wrote:
>
> Ok, thanks for the reply.
>
> I was trying to use this function:
>
> (define (iterate f)
>   (yield (f))
>   (iterate f))
>
> But it seems the only thing i can do is have a separate (calling it 
> "-untyped.rkt") module and putting anything that requires iterate in there.
>
> Are there any papers that would be helpful in trying to address this 
> implementation-wise?
>
> Nate
>
>
> On Wed, Jul 22, 2020 at 1:56 PM Sam Tobin-Hochstadt  
> wrote:
>>
>> Currently, neither `racket/stream` nor `racket/generator` are
>> supported by Typed Racket, unfortunately.
>>
>> Sam
>>
>> On Wed, Jul 22, 2020 at 12:15 AM Nate Griswold  
>> wrote:
>> >
>> > Actually, is there any way at all to use lazy lists of things (streams or 
>> > generators) in typed racket?
>> >
>> > Nate
>> >
>> >
>> > On Tue, Jul 21, 2020 at 8:45 PM Nate Griswold  
>> > wrote:
>> >>
>> >> Do generators and typed racket work together well? It seems (yield) 
>> >> doesn't have a type and i couldn't get my module to work.
>> >>
>> >> Is there a way to make some procedure untyped in the middle of a typed 
>> >> file? Is it just best to break these things into separate files?
>> >>
>> >> Thank you
>> >>
>> >> Nate
>> >
>> > --
>> > 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.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/racket-users/CAM-xLPo_c3LzL81Qv6bA2zzJMhQftQ46JR%3DWyZdSJjPJ9rYM5Q%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaUGsFS%2B5AdXB3ZGL759EaKqDLgehnpZ1HcTn0FNUvQ0g%40mail.gmail.com.


Re: [racket-users] Re: Combining generators and typed racket

2020-07-22 Thread Sam Tobin-Hochstadt
Currently, neither `racket/stream` nor `racket/generator` are
supported by Typed Racket, unfortunately.

Sam

On Wed, Jul 22, 2020 at 12:15 AM Nate Griswold  wrote:
>
> Actually, is there any way at all to use lazy lists of things (streams or 
> generators) in typed racket?
>
> Nate
>
>
> On Tue, Jul 21, 2020 at 8:45 PM Nate Griswold  wrote:
>>
>> Do generators and typed racket work together well? It seems (yield) doesn't 
>> have a type and i couldn't get my module to work.
>>
>> Is there a way to make some procedure untyped in the middle of a typed file? 
>> Is it just best to break these things into separate files?
>>
>> Thank you
>>
>> Nate
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAM-xLPo_c3LzL81Qv6bA2zzJMhQftQ46JR%3DWyZdSJjPJ9rYM5Q%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Ba0LPMHFsYmAws6pAvxEp32rD_vF9oNSLdWXZOJDJ-n1A%40mail.gmail.com.


Re: [racket-users] Replace pre-installed rackunit with git source

2020-07-22 Thread Sam Tobin-Hochstadt
To figure out where things are, I recommend the `raco fc` command,
which is in the `raco-find-collection` package.

Almost certainly what went wrong is that you installed the cloned
`rackunit` directory as a package. Instead, you need to install all
the individual sub-directories as packages. To fix that, first remove
the installed `rackunit` package, and then just re-install the regular
`rackunit`.

To accomplish your original goal, you should use `raco pkg update
--clone rackunit` in whatever directory you want to clone rackunit
(such as `extra-pkgs`). If that complains about `rackunit` not having
a git repository as source, then you should first do `racket pkg
update --lookup --catalog https://pkgs.racket-lang.org rackunit` to
switch from the 7.7 catalog to the pkgs.racket-lang.org one.

Sam

On Wed, Jul 22, 2020 at 9:03 AM zeRusski  wrote:
>
> Hi all. Latest commit to rackunit haven't made it into 7.7 so I attempted to 
> replace the rackunit installed as part of the distribution in 
> racket/share/pkgs by cloning the repo then:
>   cd rackunit
>   raco pkg update --force --type dir
>
>   raco pkg show
> would show the `rackunit` linked as expected, but the pre-installed looked 
> like any require would still go to share/pkgs. Not sure why. Btw is there 
> some API call to check which file was used to find a module?
>
> Tbh having read racket/build.md - section 3.2 I expected this to just work. 
> Perhaps I misunderstood it. I thought `extra-pkgs` dir wasn't anything 
> special.
>
> I then tried to remove the link, then remove the preinstalled 
> share/pkg/rackunit-*, then link from local checkout again
>   raco pkg remove --force rackunit-doc rackunit-test rackunit-typed 
> rackunit-gui etc
>   cd rackunit
>   raco pkg install
>
> Now any setup steps appear to fail complaining:
>   module path: rackunit
>   path: /Users/russki/Code/racket-cs/pkgs/racket-index/rackunit/main.rkt
>
> Is this some docs index missing rackunit deps?
>
> Is there a way to repair my racket installation and have rackunit linked from 
> source? Or should I just wipe racket and start over?
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/62196fc3-d2d6-4ac4-8d70-7b38d068027do%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BafqVx%2BR%3DWhtA-RqZd_Z%2ByWwuq-iPNtzJ%2B4TF4Os-ObhA%40mail.gmail.com.


Re: [racket-users] Embedded racket (cs) question

2020-07-13 Thread Sam Tobin-Hochstadt
My guess, not having looked further than your email, is that when you don't
include racket/promise, something is supplying a promise to something else
but there are two different instantiations of the promise library, causing
the force call from one not to recognize the promise from the other. Then
force just becomes the identity function, and passes through a promise to
somewhere that isn't expecting one.

Is it possible that some library you're using features promises?
Alternatively, it might be that the embedding code needs an explicit
dependency on promises.

Sam

On Mon, Jul 13, 2020, 10:18 AM Nate Griswold  wrote:

> Hello.
>
> I noticed something and was wondering what the list thinks:
>
> I am using an embedded racket Ics) and i noticed that if i embed a file
> and don't include any libraries (for a very bare bones c file) i have
> problems with a crash on a promise on any dynamic-require:
>
> build-path: contract violation
>   expected: (or/c path-string? path-for-some-system? 'up 'same)
>   given: #
>
> but if i do a (require racket/promise) in my rkt argument to --c-mods OR
> if i do a ++lib racket/promise i get no crash.
>
> So is this expected behavior? Should racket/promise always be included or
> no? And what exactly is going on under the hood here?
>
> Nate
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAM-xLPpg_0Ef8ByjS01Y1pKEeeFMVkFk3dvGcdpRaYo3ZqDb9A%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bb2oNwt5NmekZwJdSyENH0AczxAr%3DCUz8hYBjqykBtxmw%40mail.gmail.com.


Re: [racket-users] Recommended CS replacement for make-sized-byte-string

2020-07-12 Thread Sam Tobin-Hochstadt
Copying is probably the best option -- this is discussed some in the
following readme:
https://www.github.com/racket/racket/tree/master/racket%2Fsrc%2Fcs%2FREADME.txt

Sam

On Sun, Jul 12, 2020, 12:16 PM Nate Griswold  wrote:

> Maybe i have been up too long, but what is the best replacement for
> make-sized-byte-string in Racket CS? I am using a library that still calls
> it and is failing on me.
>
> I don't mind just copying the whole thing. I could write a function to do
> it i was just thinking there would be something there already...
>
> Thanks
>
> Nate
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAM-xLPrFbKkgR4nNb3qmzFaw%2BRReNr3z%3DiROqMof--x%3DeOjODA%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bb_6XhncCzrt9fJZdxYayPQnAOaVXMoLkR9C3NWRQGODw%40mail.gmail.com.


Re: [racket-users] Gtk initialization failed for display ":0"

2020-07-11 Thread Sam Tobin-Hochstadt
The usual solution to this problem is to use xvfb to create a virtual
display, which works great in this situation when the display is not really
needed anyway. This is how we run the handin server headless and how all
the racket CI works.

Sam

On Sat, Jul 11, 2020, 12:26 PM Shriram Krishnamurthi 
wrote:

> I'm running headless Racket from a Docker container for auto-grading
> assignments in Gradescope.
>
> The students are writing BSL programs with 2htdp/image. This does not
> cause any problems for most of them.
>
> Two students, however, get an error in file loading with the error message
> in the subject line («Gtk initialization failed for display ":0"»).
>
> I finally localized the problem: it's because they are using the universe
> Teachpack.
>
> I don't know what in universe is causing this, but it seems rather weird
> that *image*, which is fundamentally graphical, does not cause this
> problem but *universe*, which is it fundamentally not, does.
>
> Furthermore, this dependency means that any program that depends on
> universe would likely not be able to be auto-graded (at least in a
> Gradescope-like headless context), which seems a rather severe restriction.
> (And ironic, given that the design of universe is to enable testing, and
> hence also auto-grading.) I don't know how Northeastern does auto-grading
> of universe that gets around this, but it's clearly in a different setting.
>
> I don't have a "question" because I seem to have identified the base issue
> here. This is mostly here for future reference, since I saw some posts from
> looking for that string that didn't answer my need (but were still useful
> in indicating it might be a dependency), so I'm leaving this here for a
> future person who might be searching.
>
> However, it would also be nice if the universe Teachpack could avoid this
> dependency entirely or refactor it into parts that do and don't need it.
>
> Shriram
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/7e2da814-25e5-4547-b5d9-2c66c087f37eo%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bbac1M7NcL3RtGFdrC8G%2BsadT-J3mjXiWPe%3Do8t6pXDOQ%40mail.gmail.com.


Re: [racket-users] Re: Racket News - Issue 34

2020-07-07 Thread Sam Tobin-Hochstadt
It turns out it was a brief error by gitlab.

Sam

On Tue, Jul 7, 2020 at 11:42 AM Simon Schlee  wrote:
>
> yes it works again!
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/0673a1d4-5cf0-4969-97b6-9bb1dbb3c298o%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bae9%3DppHJBUFavH2TPLg639-q9nCMbFcz3mEx5aZt2rdQ%40mail.gmail.com.


Re: [racket-users] Re: Racket News - Issue 34

2020-07-07 Thread Sam Tobin-Hochstadt
Ah, it is now no longer working for me (it worked earlier this morning).

Sam

On Tue, Jul 7, 2020 at 11:03 AM Simon Schlee  wrote:
>
>
>> I think you probably went to www.racket-news.com, but you should go to
>> racket-news.com (without the www) instead.
>
>
> With or without www I get a certificate error, when I ignore the certificate 
> I get a 502 from gitlab.
> With different browsers and curl all give me the same responses.
> Does racket-news.com work for you? If so what could I check on my end?
>
> (I don't know how reliable this site is but) this also claims that 
> racket-news.com is down
> https://downforeveryoneorjustme.com/racket-news.com
>
> I think the site is hosted via gitlab and something there stopped working.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/b1ba1196-027e-4c00-8459-dcb6fc9a6480o%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaDyJ7YxJq_A5D3YLzZP6Zk6th%2B-DERg2pF_Dws9KB2iQ%40mail.gmail.com.


Re: [racket-users] Re: Racket News - Issue 34

2020-07-07 Thread Sam Tobin-Hochstadt
I think you probably went to www.racket-news.com, but you should go to
racket-news.com (without the www) instead.

Sam

On Tue, Jul 7, 2020 at 10:28 AM Simon Schlee  wrote:
>
> I am getting an error message for the https certificate:
>
>> Websites prove their identity via certificates. Firefox does not trust this 
>> site because it uses a certificate that is not valid for racket-news.com. 
>> The certificate is only valid for the following names: *.gitlab.io, gitlab.io
>
>
>
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/63e57ecc-63af-44fd-8730-5715b38f4097o%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaUZoe1eENJ4Z3vAf0fg3U7UiLUJZ0oXv5K%2BOGB-FzG4Q%40mail.gmail.com.


Re: [racket-users] FYI, build from HEAD fails in realloc()

2020-06-30 Thread Sam Tobin-Hochstadt
It should be fine to do both of those in the same directory.

Sam

On Tue, Jun 30, 2020 at 4:47 PM 'John Clements' via Racket Users
 wrote:
>
> D’oh!  Closing the loop on this one… it appears to me that this problem 
> occurred after running a “make” (that is, a BC make) in a directory in which 
> I’d been running “make cs”). I just did it again, which is how I figured it 
> out. It’s a silly mistake on my part. It seems that running “math.scrbl” 
> triggers the problem. Honestly, I have no idea if this is a bug or not.
>
> John
>
> > On Mar 23, 2020, at 04:34, Paulo Matos  wrote:
> >
> > Hi John,
> >
> > Has anyone already looked into this? I haven't seen this problem yet. If
> > it's not solved, can you please open an issue?
> >
> > Thanks,
> >
> > Paulo Matos
> >
> > 'John Clements' via Racket Users writes:
> >
> >> Bang! I was wrong. Here’s another similar trace:
> >>
> >> raco setup: 6 running: 
> >> /pfds/pfds/scribblings/functional-data-structures.scrbl
> >> raco setup: 4 running: /jbc-utils/gradeserver/gradeserver.scrbl
> >> raco setup: 3 running: 
> >> /htdp-doc/scribblings/htdp-langs/htdp-langs.scrbl
> >> raco setup: 2 running: /images-doc/images/scribblings/images.scrbl
> >> raco setup: 0 running: 
> >> /macro-debugger/macro-debugger/macro-debugger.scrbl
> >> raco setup: 7 running: /math-doc/math/scribblings/math.scrbl
> >> raco setup: 5 running: /net-doc/net/scribblings/net.scrbl
> >> raco setup: 1 running: 
> >> /compatibility-doc/mzlib/scribblings/mzlib.scrbl
> >> raco setup: 4 running: /racket-doc/openssl/openssl.scrbl
> >> raco setup: 4 running: 
> >> /optimization-coach/optimization-coach/scribblings/optimization-coach.scrbl
> >> raco setup: 4 running: 
> >> /option-contract-doc/scribblings/option-contract.scrbl
> >> raco setup: 4 running: /net-doc/net/scribblings/osx-ssl.scrbl
> >> raco setup: 5 running: /overeasy/overeasy.scrbl
> >> raco setup: 4 running: /parsack/parsack/parsack.scrbl
> >> raco setup: 1 running: 
> >> /parser-tools-doc/parser-tools/parser-tools.scrbl
> >> raco setup: 5 running: /pict-doc/pict/scribblings/pict.scrbl
> >> raco setup: 1 running: 
> >> /pict-snip-doc/scribblings/pict-snip/pict-snip.scrbl
> >> raco setup: 4 running: 
> >> /picturing-programs/picturing-programs/picturing-programs.scrbl
> >> raco setup: 1 running: /racket-doc/pkg/scribblings/pkg.scrbl
> >> raco setup: 4 running: /plai-doc/scribblings/plai.scrbl
> >> raco setup: 1 running: /planet-doc/planet/planet.scrbl
> >> raco setup: 4 running: /plot-doc/plot/scribblings/plot.scrbl
> >> racket(54631,0x762f) malloc: *** error for object 0x12f96cdc8: 
> >> pointer being realloc'd was not allocated
> >> racket(54631,0x762f) malloc: *** set a breakpoint in 
> >> malloc_error_break to debug
> >> make[2]: *** [in-place-setup] Abort trap: 6
> >> make[1]: *** [plain-in-place] Error 2
> >> make: *** [in-place] Error 2
> >> make  240.77s user 75.70s system 398% cpu 1:19.32 total
> >>
> >>
> >>> On Mar 20, 2020, at 3:11 PM, 'John Clements' via Racket Users 
> >>>  wrote:
> >>>
> >>> Here’s the tail of a build of racket HEAD that just failed during a call 
> >>> to realloc(). I went back far enough to be sure I had a full record of 
> >>> what was running on cores 0-7.
> >>>
> >>> I strongly suspect this is not reproducible, and I don’t think there’s 
> >>> any further information that would be useful here, alas.
> >>>
> >>> John
> >>>
> >>> raco setup: 1 running: 
> >>> /pfds/pfds/scribblings/functional-data-structures.scrbl
> >>> raco setup: 0 running: 
> >>> /future-visualizer/future-visualizer/scribblings/future-visualizer.scrbl
> >>> raco setup: 4 running: /games/scribblings/games.scrbl
> >>> raco setup: 6 running: 
> >>> /racket-doc/scribblings/getting-started/getting-started.scrbl
> >>> raco setup: 6 running: /games/gl-board-game/gl-board-game.scrbl
> >>> raco setup: 0 running: /GLPK/glpk/glpk.scrbl
> >>> raco setup: 5 running: /jbc-utils/gradeserver/gradeserver.scrbl
> >>> read-compiled-linklet: version mismatch  expected: "7.6.0.17"  found: 
> >>> "7.6"  in: 
> >>> /Users/clements/git-clements/pkgs/jbc-utils/gradeserver/compiled/gradeserver_scrbl.zo
> >>> context...:
> >>>  read-linklet-or-directory
> >>>  read-dispatch
> >>>  read-syntax
> >>>  default-load-handler
> >>>  standard-module-name-resolver
> >>>  module-path-index-resolve
> >>>  module-declared?
> >>>  /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1529:27
> >>>  /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:904:0: 
> >>> load-doc/ensure-prefix
> >>>  /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1162:13
> >>>  .../parallel-do.rkt:388:17
> >>>  
> >>> /Users/clements/racket/racket/collects/setup/../racket/private/more-scheme.rkt:261:28
> >>>  /Users/clements/racket/racket/collects/setup/parallel-do.rkt:441:20: loop
> >>>
> >>> context...:
> >>>  /Users/clements/racket/racket/collects/setup/parallel-do.rkt:332:4: 
> >>> work-done method in list-queue%
> >>>  

Re: [racket-users] racket-dev problem?

2020-06-26 Thread Sam Tobin-Hochstadt
There are no currently-pending messages for the racket-dev list, so
your email has not been caught in a spam filter. I have not seen
problems with the list recently.

Can you say more about what has happened?

Sam

On Fri, Jun 26, 2020 at 1:15 PM Jos Koot  wrote:
>
> Sending mail to racket -dev seems not to arrive correctly.
>
> Sending to other addresses does work.
>
> Therefore I try to report via racket-users.
>
> Jos
>
>
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/94D32D8C-D5A0-4B85-A326-CC3BCABED799%40hxcore.ol.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BbT_rjJZfd211bkrVSi9CRb4V5w8VGtnK4jrtbO9jt7dQ%40mail.gmail.com.


Re: [racket-users] trying to use futures for some calculations

2020-06-17 Thread Sam Tobin-Hochstadt
I tried this out, by adding 1.0 as the third argument in `in-range` in
all cases. The performance in Racket BC increased, but there's still
no parallelism. In Racket CS, it appears to have made things slower,
so I need to investigate more.

Sam

On Wed, Jun 17, 2020 at 10:36 AM Matthew Flatt  wrote:
>
> At Wed, 17 Jun 2020 10:24:37 -0400, Sam Tobin-Hochstadt wrote:
> > - on Racket BC, operations like `+` do indeed block
>
> ... which mixing, say, fixnum and flonum arguments, but not when
> operating on all fixnums or all flonums.
>
> In this case, it may be the `in-range` with flonum bounds that results
> in `+` with fixnum 1 and a flonum.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYoCf8O2aO90peZSSVFYybehgKg-iLqgtQcZBA0DU3WWw%40mail.gmail.com.


Re: [racket-users] trying to use futures for some calculations

2020-06-17 Thread Sam Tobin-Hochstadt
I have not yet done much investigating on this, but:

- on Racket BC, operations like `+` do indeed block, and effectively
you need to replace them with lower-level operations that don't (such
as `unsafe-fl+`). Typed Racket can help with this, or you can do it
all by hand. As you note, that makes the code more painful to read.
- on Racket CS, operations like `+` do not block, and I see much
better speedup. I changed the third range to 720-800 to get answers
quicker, and I got numbers like:

[samth@homer:/tmp/cp3-exeriments (master) plt] racketcs main.rkt
cp3-baseline:
cpu time: 1947 real time: 1947 gc time: 10
cp3-precomputed:
cpu time: 399 real time: 399 gc time: 4
cp3-precomputed-more:
cpu time: 475 real time: 475 gc time: 3
cp3-futures:
cpu time: 4285 real time: 740 gc time: 11
cp3-precomputed-futures:
cpu time: 785 real time: 138 gc time: 3
cp3-precomputed-more-futures:
cpu time: 876 real time: 153 gc time: 4

So a more than 2x increase in cpu time, but a more than 2x decrease in
wall-clock time.

Certainly more investigation is needed to figure out why things take
so much longer total, but this seems like a promising speedup.

- The futures-visualizer uses logging and a functional graphics
library, both of which will allocate a lot more. You can use
`trace-futures` and `show-visualizer` to separate out the gui display
from execution, which might help.

Sam

On Wed, Jun 17, 2020 at 4:50 AM Alex Harsanyi  wrote:
>
>
> I am trying to speed up an algorithm using futures, but I am getting some 
> unexpected results (and no real speed improvements), and I was wondering if 
> someone more experienced could have a look a the code and tell me what am I 
> doing wrong.
>
> I put up the code in this repository: 
> https://github.com/alex-hhh/cp3-exeriments, unfortunately it is the simplest 
> meaningful example that I can come up with.  Most of the functions, however 
> are just support functions and there are six implementation of the same 
> algorithm.
>
> Basically, the problem I am trying to solve is to fit a model to existing 
> data and this is done by evaluating 2.5 million combinations of parameters.  
> My best, non-futures based, algorithm can do this in about 3 seconds (8 
> seconds in DrRacket).
>
> Given that each of this 2.5 million combination is completely independent 
> from the others, they could all be done in parallel.  Given this, I "sliced" 
> the combinations into 30 groups and tried to perform each "slice" in its own 
> future and select the best among the 30 results produced by these futures.
>
> Unfortunately, while the futures versions of the algorithm produce the 
> correct result, the algorithm runs at the same speed as the non-futures 
> version.  My `processor-count` returns 8, so I would expect at least some 
> level of parallelism.
>
> As a first step, I tried using `would-be-future`, to see if it reported any 
> operations which might block, but nothing was printed out.
>
> I also tried using the futures visualized, and I found the following:
>
> * the code appears to be blocking on primitive operations, such as +, -, < 
> etc.
> * I suspect these operations are inside the code generated by the `for` 
> loops, so I am not sure how to remove them without making the code even more 
> difficult to read.
> * there seems to be a lot more time spent in the garbage collector when 
> running the futures visualizer than without it (DrRacket runs with unlimited 
> memory)
>
> So I am wondering if someone who is more familiar with futures can look at 
> the code and provide some hints about what can be done to make this code run 
> in parallel (or if it cannot, I would like to understand why).
>
> This is already a long message, so I will not add further details here, but 
> the repository at https://github.com/alex-hhh/cp3-exeriments has an 
> explanation of what every function does, and I am happy to provide further 
> clarifications if needed.
>
> Thanks,
> Alex.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/8bf6f7c4-3b2f-4b86-9a8a-be68e82d09cfo%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaKpxBhaRs64yfmats3j_V5kF7KTe3Mb4OsgUpaDvk_WQ%40mail.gmail.com.


[racket-users] Call for Tutorial Proposals: ICFP 2020

2020-06-16 Thread 'Sam Tobin-Hochstadt' via users-redirect
CALL FOR TUTORIAL, PANEL, AND DISCUSSION PROPOSALS
ICFP 2020
 25th ACM SIGPLAN International Conference on Functional Programming


   August 23 - 28, 2020
  Virtual
https://icfp20.sigplan.org/

The 25th ACM SIGPLAN International Conference on Functional Programming
will be held virtually on August 23-28, 2020.
ICFP provides a forum for researchers and developers to hear about the 
latest work on the design, implementations, principles, and uses of 
functional programming.

Proposals are invited for tutorials, lasting approximately 3 hours each,
to be presented during ICFP and its co-located workshops and other
events. These tutorials are the successor to the CUFP tutorials from
previous years, but we also welcome tutorials whose primary audience is
researchers rather than practitioners. Tutorials may focus either on a
concrete technology or on a theoretical or mathematical tool. Ideally,
tutorials will have a concrete result, such as "Learn to do X with Y"
rather than "Learn language Y". 

This year, following the success of the #ShutDownPL event, we are also 
inviting proposals for panels and discussions on topics of broader interest 
to the PL community.

Tutorials, panels, and discussions may occur before or after ICFP, 
co-located with the associated workshops, on August 23 or August 27-28.


--

Submission details
 Deadline for submission: July 17th, 2020
 Notification of acceptance:  July 22nd, 2020

Prospective organizers of tutorials are invited to submit a completed
tutorial proposal form in plain text format to the ICFP 2020 workshop
co-chairs (Jennifer Hackett and Leonidas Lampropoulos), via email to

 icfp-workshops-2...@googlegroups.com

by July 17th, 2020. Please note that this is a firm deadline.

Organizers will be notified if their event proposal is accepted by
July 22nd, 2020.

The proposal form is available at:

http://www.icfpconference.org/icfp2020-files/icfp20-panel-form.txt
http://www.icfpconference.org/icfp2020-files/icfp20-tutorials-form.txt

--

Selection committee

The proposals will be evaluated by a committee comprising the
following members of the ICFP 2020 organizing committee.

 Tutorials Co-Chair: Jennifer Hackett(University of Nottingham)
 Tutorials Co-Chair: Leonidas Lampropoulos (University of Maryland)
 General Chair:  Stephanie Weirich (University of Pennsylvania)
 Program Chair:  Adam Chlipala(MIT)


--

Further information

Any queries should be addressed to the tutorial co-chairs
(Jennifer Hackett and Leonidas Lampropoulos), via email to 
icfp-workshops-2...@googlegroups.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5ee961816bc99_223a22abfa25865c410440%40homer.mail.


Re: [racket-users] How to handle conflicts in packages?

2020-06-05 Thread Sam Tobin-Hochstadt
This most likely means that your documentation is in a file with a generic
name like manual.scrbl which those packages also use.

Sam

On Fri, Jun 5, 2020, 11:20 AM David Storrs  wrote:

> I uploaded a new module, 'thread-with-id', and the package server tells me
> that there are conflicts.  The message is:
>
> https://pkg-build.racket-lang.org/conflicts.txt
>
>  doc "main":
>   ekans lti-freq-domain-toolbox protobuf thread-with-id
>
> I'm not sure what this means -- I've looked through the ekans,
> lti-freq-domain, and protobuf modules and none of them have a
> thread-with-id function listed in the docs.
>
> Is there anything I can do to resolve this?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAE8gKofxWjWhHMs1EReWOxw3ZNXCsLi5WOWgHzKVrbbRXFwWPQ%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaUPUYCHOXGR03Bkz7uB5pPcGt7Wj3u%3D1_t1rPYXW8MJw%40mail.gmail.com.


Re: [racket-users] Poor documentation of List*

2020-06-03 Thread Sam Tobin-Hochstadt
`(List* T)` is just `T`. This follows the behavior of the `list*`
function, where `(list* 5)` produces 5.

You can explore this using the `:type` form at the REPL. For example,

```
> (:type (List* String))
String
> (:type (List* String String))
(Pairof String String)
> (:type (List* String (List String)))
(List String String)
```

I've pushed a clarification to the documentation.

On Wed, Jun 3, 2020 at 3:49 PM Hendrik Boom  wrote:
>
> On Wed, Jun 03, 2020 at 04:22:41PM +0100, Stephen De Gabrielle wrote:
> > Hi Hendrik,
> >
> > I can't see the example you mention in
> > https://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.List%2A%29%29
> >
> > i'm assuming (List* c) is shorthand for (Pair c null)? I don't know typed
> > racket so I've probably got that terribly wrong.
>
> It might be.  But that's normally said as (List c), not List* c)
> With your interpretation, List* qould be equivalent to List.
>
> >
> > So while I can't help you with this - I wanted to encourage you to make a
> > PR to the documentation if you come up with a fix.
>
> My problem is that I don't know what the documentation is supposed to say.
>
> -- hendrik
>
> > It *used* to be hard to find the file that needs the fix, good steps have
> > been made recently to make it easier to identify the documentation source
> > file so it is easier to find and make the corrections or additions.
> >
> > If you have any trouble let me know and I'll try help - I think I'm
> > getting the hang of it.
> >
> > Hope you are well
> >
> > Kind regards
> >
> > Stephen
> >
> > ps i use
> > https://blog.racket-lang.org/2017/09/tutorial-contributing-to-racket.html &
> > lots of kind guidance from other racketeers :0
> > pps: if you make a successful pr you get credit in the frankly wonderful
> > racket news https://racket-news.com/2020/06/racket-news-issue-32.html
> >
> > On Tue, Jun 2, 2020 at 3:13 PM Hendrik Boom  wrote:
> >
> > > In the Typed Racket Reference, List* is defined as follows:
> > >
> > > (List* t t1 ... s)
> > >
> > > is equivalent to (Pairof t (List* t1 ... s)).
> > >
> > > Following this definition down, we get
> > >
> > > (List* a b c)
> > >  -> (Pairof a (List* b c))
> > >  -> (Pairof a (Pairof b (List* c)))
> > >
> > > But what's (List* c) ?
> > >
> > > I see no explanatory examples.
> > >
> > > -- hendrik
> > >
> > > P.S.  I'm also unsure what 'bound' is supposed to do in
> > >
> > > (List t ... trest ... bound)
> > >
> > > It says "where bound must be an identifier denoting a type variable
> > > bound with ..." but I don't undestand what this is referring to.
> > >
> > > There are no examples of this in the document, just as there are no
> > > examples of List*.
> > >
> > > -- hendrik
> > >
> > > --
> > > 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.
> > > To view this discussion on the web visit
> > > https://groups.google.com/d/msgid/racket-users/20200602141347.3z7igvzbjyikhfn4%40topoi.pooq.com
> > > .
> > >
> >
> > --
> > 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.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/CAGHj7-LsML%2BeOnt_BUBWmRM5vU6GtovyaNr-JHOQPzoMCL2NTQ%40mail.gmail.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200603194902.27zjystdhecumoup%40topoi.pooq.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaadfxxY%2Bv1gngVPzegOCSU2qR_EPTavj3E9hutTJXJ3Q%40mail.gmail.com.


[racket-users] Call for Submissions: ICFP Student Research Competition

2020-06-02 Thread 'Sam Tobin-Hochstadt' via users-redirect
ICFP 2020 Student Research Competition
   Call for Submissions

ICFP invites students to participate in the Student Research
Competition, which will be held virtually alongside the main
conference, in order to present their research and receive
feedback from prominent members of the programming language
research community.

As usual, the SRC consists of three rounds:

* Extended abstract
* Poster session at ICFP 2020
* ICFP presentation

To make the virtual competition fruitful, we will make sure
that every student will have an "invited audience" during the
poster session.  We are also planning to organize a social event
for the students.  Please visit the SRC website for updates.

### Important Dates

Submissions due: 26 Jun 2020 (Friday)
   https://icfp20src.hotcrp.com
Notification: 10 July 2020 (Friday)
Conference: 23 August (Sunday) - 28 August (Friday)

### Submission Details

Each submission (referred to as "abstract" below) should include the
student author’s name and e-mail address; institutional affiliation;
research advisor’s name; ACM student member number; category
(undergraduate or graduate); research title; and an extended abstract
addressing the following:

* Problem and Motivation: Clearly state the problem being addressed and
explain the reasons for seeking a solution to this problem.

* Background and Related Work: Describe the specialized (but
pertinent) background necessary to appreciate the work in the
context of ICFP areas of interest. Include references to the
literature where appropriate, and briefly explain where your work
departs from that done by others.

* Approach and Uniqueness: Describe your approach in addressing the
problem and clearly state how your approach is novel.

* Results and Contributions: Clearly show how the results of your work
contribute to programming language design and implementation in
particular and to computer science in general; explain the
significance of those results.

* Submissions must be original research that is not already published
at ICFP or another conference or journal. One of the goals of the
SRC is to give students feedback on ongoing, unpublished
work. Furthermore, the abstract must be authored solely by the
student. If the work is collaborative with others and*or part of a
larger group project, the abstract should make clear what the
student’s role was and should focus on that portion of the work.

* Formatting: Submissions must be in PDF format, printable in black
and white on US Letter sized paper, and interpretable by common PDF
tools. All submissions must adhere to the "ACM Small" template that
is available (in both LaTeX and Word formats) from
https://www.acm.org/publications/authors/submissions. For authors
using LaTeX, a lighter-weight package, including only the essential
files, is available from
http://sigplan.org/Resources/Author/#acmart-format. The submission
must not exceed 3 pages in PDF format. Reference lists do not count
towards the 3-page limit.

Further information is available at the ICFP SRC website:
https://icfp20.sigplan.org/track/icfp-2020-Student-Research-Competition

Program Committee:
Chair: Youyou Cong (Tokyo Institute of Technology)
Stephen Chang (University of Massachusetts Boston)
Jesper Cockx (Delft University of Technology)
Hsiang-Shang Ko (Institute of Information Science, Academia Sinica)
Cyrus Omar (University of Michigan)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5ed65bdf27c94_bbe12b160d7105a428395%40homer.mail.


Re: [racket-users] Re: Racket News - Issue 32 is here!

2020-06-02 Thread Sam Tobin-Hochstadt
Sham is designed for very different use cases than Racket -- Racket is
general purpose and not easily mapped to a low level language.

Sam

On Tue, Jun 2, 2020, 2:00 AM Liwei Chou  wrote:

> Saw this cool paper Sham: A DSL for Fast DSLs
> . Can
> this be used to optimize Racket itself? :)
>
> Paulo Matos於 2020年6月2日星期二 UTC+8上午1時46分00秒寫道:
>>
>> Racket News - Issue 32 is here!
>>
>> No time to wait, go grab a coffee and enjoy!
>> https://racket-news.com/2020/06/racket-news-issue-32.html
>>
>> --
>> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/c947d01e-b0cd-459e-a4d9-81d4a7119d9c%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaAHDQ3jd9HatrGsnc2FOiUZwi%3D6PHZCh713zw2xr1SHA%40mail.gmail.com.


Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Sam Tobin-Hochstadt
The syntax looks like this:

(define (f [x : Number] . [y : String *]) : Number (+ x (length y)))

See the documentation for `define` in Typed Racket here:
https://docs.racket-lang.org/ts-reference/special-forms.html?q=define#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._define%29%29
in particular the `rst` production.

Sam

On Mon, Jun 1, 2020 at 3:09 PM Hendrik Boom  wrote:
>
> On Mon, Jun 01, 2020 at 10:58:09AM -0400, Sam Tobin-Hochstadt wrote:
> > Do you perhaps have some other binding shadowing the binding of `:`
> > from Typed Racket? That produces the error message you get when I try
> > it.
>
> Not intentionally.  I'll have to look carefully for possible candidates.
> Or ask DrRacket to jump to a binding occurrence.
>
> Did that:  It wouldn't find a bining instance while that colon was
> there, but complained about the syntax error I was sompaining about.
> But when I removed the type specification from the let-clause and
> introuced a colon elsewhere in the function as an extra parameter in
> another expression, it would find the binding.  It turned out that the
> binding occurrence was the colon in the tail-parameter [args : T-Size].
>
> So I have to ask, what *is* the proper way to indicate that the
> function can be called with many more parameters, which are to be
> made available as a list?
>
> Thank you for the hint.
>
> -- hendrik
>
> >
> > Sam
> >
> > On Sat, May 30, 2020 at 1:32 PM Hendrik Boom  wrote:
> > >
> > > I'm sorry to keep pestering this list, but I'm out of my depth with the
> > > detailed syntax (and semantics) of typed Racket.  But I'm doggedly
> > > ploughing on.
> > >
> > > I'm having trouble with the 'let' line in the 'pointer-to' function 
> > > listed later:
> > >
> > > (let ([vt : Ffi-type (cast ((inst hash-ref Ffi-type Ffi-type) 
> > > type-to-vector type #f) Ffi-type)])
> > >
> > > Yes, there's an unbalanced parenthesis because this sin't the end of the 
> > > let-expression.
> > >
> > > The error message is
> > >
> > >  let: expected type-annotated identifier
> > >   parsing context:
> > >while parsing annotated-binding
> > >while parsing optionally type-annotated binding in: (vt : Ffi-type 
> > > (cast ((inst hash-ref Ffi-type Ffi-type) type-to-vector type #f) 
> > > Ffi-type))
> > >
> > > I can't see the error.  'vt : Ffi-type' looks like a type-annotated
> > > identifier to me.  And it seems to have the right number of parentheses
> > > in front of it, followed by an expression whose vlue is to be bound to
> > > 'vt'.
> > >
> > > Here's the function it's part of:
> > >
> > >
> > > (define (pointer-to [type : T-Type] . [args : T-Size]) : T-Type ; TODO: 
> > > rename args to size-args
> > >   (if (and (equal? args '(1)) (not (eq? type '_void)))
> > > (mode-dependent-type
> > >   `(_ptr i ,type) `(_ptr o ,type))
> > > (case type
> > >   ((_void) '_pointer/intptr)
> > >   ((_byte _uint8) (mode-dependent-type
> > > '_string*/utf-8
> > > (if (null? args)
> > >   '_bytes
> > >   `(_bytes o ,@ args
> > >   (else
> > > (let ([vt : Ffi-type (cast ((inst hash-ref Ffi-type Ffi-type) 
> > > type-to-vector type #f) Ffi-type)])
> > >   (if vt
> > > (mode-dependent-type
> > >   `(,vt i)
> > >   (if (null? args)
> > > vt
> > > `(,vt o ,@ args)))
> > > (mode-dependent-type
> > >   `(_vector i ,type)
> > >   (if (null? args)
> > > '_pointer
> > > `(_vector o ,type ,@ args)
> > >
> > > --
> > > 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.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/racket-users/20200530173230.bsrp5skkc35ot34h%40topoi.pooq.com.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiv

Re: [racket-users] Re: [racket] Web Framework Benchmarks

2020-06-01 Thread Sam Tobin-Hochstadt
I'm skeptical both of the DB explanation and the multi-core
explanation. As you say, the difference between something like Django
and Racket is much too large to be explained by that. For example, on
the "plaintext" benchmark, Racket serves about 700 req/sec (I get
similar results on my machine). Many of the benchmarks in languages
like Python and Ruby do more than 1000x better, which means that even
if we had perfect speedup on 32 cores, we'd be nowhere close.
Additionally, the "plaintext" benchmark doesn't touch the DB at all. I
tried commenting out all of the DB code entirely, and it did not
change the results.

My guess is that the web server is just doing a lot of per-response
work that would need to be optimized.

Sam

On Mon, Jun 1, 2020 at 2:12 PM George Neuner  wrote:
>
>
> On 6/1/2020 1:40 PM, Bogdan Popa wrote:
> > I replied earlier today off of my Phone, but, for whatever reason
> > (caught in the moderation queue?), it's not showing up in this thread.
> >
> > Here's what it said:
> >
> > The reason for poor performance relative to the other
> > langs/frameworks is that there is currently no easy way to take
> > advantage of multiple cores using the web framework so that's being
> > benchmarked is single-core performance.
> >
> > This is mainly a problem for benchmarks such as this, but not really
> > an issue in the real world where you'd just run multiple processes
> > with a load balancer in front.
>
> Single core [by itself] doesn't explain the enormous performance
> difference between Racket and Django.
>
> I haven't looked at the Django submission - Python's (in)comprehensions
> give me a headache.  But Python's DB pool is threaded, and Python's
> threads are core limited by the GIL in all the major implementations
> (excepting Jython).
>
> There are a few things Python can do faster than Racket, but the VAST
> difference in performance shown in the techempower tests isn't explained
> by them.  My suspicion is that the Racket application is making too many
> database connections and not relying enough on its open connection
> pool.  Hundreds of trivial requests can be served in the time it takes
> to spin up a new backend process.
>
> YMMV,
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/9236dcff-81df-1db8-c2ef-06b20e4690ec%40comcast.net.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BauHeC6veH-867PuiihSbYmZB2hKyx5ZnBH%2B-1sXUKwxA%40mail.gmail.com.


Re: [racket-users] Re: [racket] Web Framework Benchmarks

2020-06-01 Thread Sam Tobin-Hochstadt
I think the biggest thing is that no one has looked at optimizing
these benchmarks in Racket. If you tried out running one of these
benchmarks and ran the profiler it would probably show something
interesting.

Sam

On Mon, Jun 1, 2020 at 6:43 AM hashim muqtadir
 wrote:
>
> A new version of these benchmarks was just published ("Round 19"): 
> https://www.techempower.com/benchmarks/#section=data-r19
>
> Racket scores rather poorly (0 errors is nice, though). Anybody has any 
> guesses as to why this is? Racket performs well enough as far as I'm 
> concerned, and while I don't use the web server much, sounds unlikely that it 
> should be so far below django, for example. Maybe they run it in a 
> handicapped configuration or something.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/2a1062a4-e4f1-484c-a8a2-f63c161959e8%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYJh96XAabvFRrW2HTFW9ECjKdnFOKomK0mdKeoA_4GNQ%40mail.gmail.com.


Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Sam Tobin-Hochstadt
Do you perhaps have some other binding shadowing the binding of `:`
from Typed Racket? That produces the error message you get when I try
it.

Sam

On Sat, May 30, 2020 at 1:32 PM Hendrik Boom  wrote:
>
> I'm sorry to keep pestering this list, but I'm out of my depth with the
> detailed syntax (and semantics) of typed Racket.  But I'm doggedly
> ploughing on.
>
> I'm having trouble with the 'let' line in the 'pointer-to' function listed 
> later:
>
> (let ([vt : Ffi-type (cast ((inst hash-ref Ffi-type Ffi-type) type-to-vector 
> type #f) Ffi-type)])
>
> Yes, there's an unbalanced parenthesis because this sin't the end of the 
> let-expression.
>
> The error message is
>
>  let: expected type-annotated identifier
>   parsing context:
>while parsing annotated-binding
>while parsing optionally type-annotated binding in: (vt : Ffi-type (cast 
> ((inst hash-ref Ffi-type Ffi-type) type-to-vector type #f) Ffi-type))
>
> I can't see the error.  'vt : Ffi-type' looks like a type-annotated
> identifier to me.  And it seems to have the right number of parentheses
> in front of it, followed by an expression whose vlue is to be bound to
> 'vt'.
>
> Here's the function it's part of:
>
>
> (define (pointer-to [type : T-Type] . [args : T-Size]) : T-Type ; TODO: 
> rename args to size-args
>   (if (and (equal? args '(1)) (not (eq? type '_void)))
> (mode-dependent-type
>   `(_ptr i ,type) `(_ptr o ,type))
> (case type
>   ((_void) '_pointer/intptr)
>   ((_byte _uint8) (mode-dependent-type
> '_string*/utf-8
> (if (null? args)
>   '_bytes
>   `(_bytes o ,@ args
>   (else
> (let ([vt : Ffi-type (cast ((inst hash-ref Ffi-type Ffi-type) 
> type-to-vector type #f) Ffi-type)])
>   (if vt
> (mode-dependent-type
>   `(,vt i)
>   (if (null? args)
> vt
> `(,vt o ,@ args)))
> (mode-dependent-type
>   `(_vector i ,type)
>   (if (null? args)
> '_pointer
> `(_vector o ,type ,@ args)
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200530173230.bsrp5skkc35ot34h%40topoi.pooq.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYkANXdevMc%3DiSTFaWnpzU-6ofNWF2qJtWyR-f6ES2gLg%40mail.gmail.com.


Re: [racket-users] Migrating from a "model-driven" language framework to Racket

2020-05-26 Thread Sam Tobin-Hochstadt
I think the best way to implement what you describe for a "better
version" is as follows:

Expand `(instance h1 half-adder-arch)` into something like

  (define-syntax h1 (half-adder-arch-info))

Where `half-adder-arch-info` is an expansion-time structure describing
half-adders.
Then the `assign` macro can use `syntax-local-value` to get out that
information, see that it's a half-adder, and then generate the code
you've written manually.

This paper: https://arxiv.org/abs/1106.2578 talks about this technique
in more detail, focused on the implementation of `match-expander`s,
which work this way, but it's a common Racket technique and used for
structs, syntax classes, `for` transformers, and more.

Sam

  (

On Tue, May 26, 2020 at 3:08 PM Guillaume Savaton
 wrote:
>
> Le mardi 26 mai 2020 03:59:59 UTC+2, johnbclements a écrit :
>>
>> > So far, I have made two attempts to work around these issues: (1) by 
>> > creating a metamodel-like data structure using Racket structs, and 
>> > transforming syntax objects into struct instances; or (2) using syntax 
>> > objects only and attaching context data to each of them as a syntax 
>> > property.
>> > Both have strengths and weaknesses, and I am still feeling that I am not 
>> > using Racket with the right mindset.
>>
>> I think your (2) sounds like a lighter-weight solution. However, it 
>> definitely does seem as though much of the difficulty here is related to the 
>> differences between a more imperative and a more functional style.
>
>
> I'm not sure that solution (2) is lighter. Maybe the weight is moved to 
> another part of the implementation :)
>
> I have set up an example at this address: 
> https://gist.github.com/senshu/c6db95615b4b2567f168d6bfbe61655e
>
> It is basically a very stripped-down hardware description language that 
> borrows from VHDL and Verilog.
> Like VHDL, the description of a circuit is split into an "entity" (the 
> interface of the circuit) and an "architecture" (the implementation).
> For the sake of simplicity, this example does not implement a complete model 
> of computation.
>
> The file "tiny-hdl-example-v1.rkt" implements a full adder and prints its 
> truth table.
> At this point, there is no name resolution, so I need to give redundant 
> information in the "port-ref" expressions.
> A better version of the language would allow to write:
>
> (assign (h1 a) a)
>
> instead of:
>
> (assign (port-ref half-adder h1 a) (port-ref full-adder a))
>
> because we know that
>
> h1 is an instance of half-adder-arch, that has the entity half-adder,
> the current architecture is full-adder-arch and its entity is full-adder
>
> I hope it clarifies my current concerns.
>
> Guillaume
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/a42ec2de-6441-483f-a05a-910c03c317e8%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYs2_w3JtDb5mDDWOtqswXjcGo34hVmHiucDUihnZbbWw%40mail.gmail.com.


Re: [racket-users] inconvenience in typed Racket

2020-05-22 Thread Sam Tobin-Hochstadt
The problem is almost certainly that `Any` is not allowed in
`Ffi-type`. What's the definition of `Ffi-type`, and why does `params`
have a type that involves `Any`?

Sam

On Fri, May 22, 2020 at 5:21 PM Hendrik Boom  wrote:
>
> Here's the code it's complaining about.
>
>  `(,@params -> ,rettype)
>
> And here's the message:
>
> Type Checker: Polymorphic function `qq-append' could not be applied to 
> arguments:
> Types: (Listof a) (Listof b) -> (Listof (U a b))
> Arguments: (Listof (List Any ': Any)) (List '-> Ffi-type)
> Expected result: Ffi-type
>  in: (quasiquote ((unquote-splicing params) -> (unquote rettype)))
>
> Now what I'm building is a piece of Racket code that is to be written
> out into a new source-code file.
>
> param is indeed of type (Listof (List Any ': Any)).
> rettype is indeed of type (List '-> Ffi-type)
>
> And or some reason the type-checker isn't able to realise that I can
> really build a valid s-expression out of these components.
>
> Now i could hand-expand the quasiquote in to a lot of cons operations,
> each presummably surrounded by 'inst' becausee cons is polymorphic,
> but this will just make the entire expression unreadable.
>
> I'm almost tempted to write this expression in untyped Racket.
>
> But separating this stuff into another module would significantly
> demodularize the code -- related code will no longer be together.
>
> Racket does have a compact mechanism to embed typed-Racket code in an
> untyped program (it's called with-type)
>
> But there seems to be no similar way to embed an expression of untyped
> code into a typed-racket program.
>
> How to get past this impasse?  The majority of my code needs to be in
> typed Racket to maintain my sanity while debugging, but the quasiquoted
> texts (there are a number of these) need to be readable, for the same
> reason.
>
> -- hendrik
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200522212056.m3x54f6dykgs4qyx%40topoi.pooq.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZah-zmPNKX%3DyttQoQFs7pY9PHc8hYGzkTeKm35YU3MLg%40mail.gmail.com.


Re: [racket-users] Re: Practical HTTP requests?

2020-05-17 Thread Sam Tobin-Hochstadt
I think you may want to use the lower-level 'net/http-client' library,
which supports connection reuse and gives more control over the details of
redirects.

Sam

On Sun, May 17, 2020, 11:52 AM fixpoint  wrote:

> I was under the incorrect impression that net/url did not support HTTP
> 1.1. I suspect I stumbled upon some out of date information on
> stackoverflow. Thanks for pointing me in the right direction. Using
> net/url, net/cookies, and json, I hacked the following code (please be
> gentle, it is literally the first lines of Racket I've ever written). There
> are two key problems with this code:
>
>1. Because cookies handling is not part of net/url, my use of
>get-pure-port/headers is not able to see cookies, and thus save them,
>in any of the 3xx redirect responses.
>2. I need a post-pure-port/headers equivalent, so I can post data and
>reuse the connection. It looks like you can only reuse connections in
>net/url with only get-pure-port/headers.
>
> Am I missing any other libraries out there?
>
> #lang racket
>
> (require json
>  net/head
>  net/url
>  net/cookies/user-agent)
>
>
> (define (get-json-request url #:connection conn)
>   (define req-headers
> (let ([cookies (cookie-header url)])
>   (cond [(false? cookies) '()]
> [else (list (format "Cookie: ~a" cookies))])))
>   (display (format "Headers sent were:\n ~a\n" req-headers))
>   (define-values
> (in-port resp-headers)
> (get-pure-port/headers url req-headers #:connection conn
> #:redirections 1))
>   (extract-and-save-cookies! (map string->bytes/utf-8 (string-split
> resp-headers "\r\n")) url)
>   (display (format "\nReceived headers were:\n ~a" resp-headers))
>   (read-json in-port))
>
>
> ;; Start a session
> (define conn (make-http-connection))
>
> ;; Make a request that will force server to set cookies
> (displayln (jsexpr->string
> (get-json-request
>  (string->url "
> https://postman-echo.com/cookies/set?foo1=bar1=bar2;)
>  #:connection conn)))
>
> ;; Make another request to see what cookies we sent server
> (displayln "\n--\n")
> (displayln (jsexpr->string
> (get-json-request
>  (string->url "https://postman-echo.com/cookies;)
>  #:connection conn)))
>
> ;; Close session
> (http-connection-close conn)
>
>
>
>
>
>
>
>
> On Sunday, May 17, 2020 at 4:44:32 AM UTC-5, evdubs wrote:
>>
>> Have you taken a look at net/url
>> ? From there, I
>> see:
>>
>>- make-http-connection
>>
>> ,
>>which can allow calls to get-pure-port/headers to stay connected if
>>the server allows it.
>>- current-proxy-servers
>>
>> 
>>and current-no-proxy-servers, which show they respect http_proxy,
>>https_proxy, and no_proxy.
>>
>> There are also get-pure-port
>> 
>> related functions that allow setting headers, which I think should let you
>> set your cookies? For JSON, you can take look at the json
>>  docs if you're
>> interested in converting the HTTP response bodies into a JSON expression.
>> These expressions can then be treated like any other expression where you
>> can map/filter/fold over lists and access map elements with hash table
>> functions.
>>
>> To find this stuff, I just searched for "http" and "json" using the ". .
>> . search manuals . . ." box at the top right of the docs. The search looks
>> through all of the Racket API as well as many user-contributed packages. It
>> makes it very easy to find whatever you might be interested in.
>>
>> Evan
>>
>> On Saturday, May 16, 2020 at 7:45:08 AM UTC-10, fixpoint wrote:
>>>
>>> I'm on the search for a new programming language to learn, so I thought
>>> I'd check out Racket, but I'm having a hard time trying to do a very common
>>> task that would make Racket practical for my use at work:
>>>
>>>- Make a series of HTTP requests to an API that returns JSON
>>>responses
>>>- Reuse the HTTP connection to avoid creating new TCP connections
>>>for each request
>>>- Honors the `http_proxy`, `https_proxy`, and `no_proxy` environment
>>>variables
>>>- Maintains a "session" where cookies set by the server are sent
>>>back in subsequent requests
>>>
>>> My daily driver is Python, so I'm used to its `requests` library. Go and
>>> Rust have similar libraries. While I don't mind piecing some of this
>>> together, I'm struggling as a new user to figure out what libraries are
>>> recommended and, more 

Re: [racket-users] Trouble shooting net/http-client

2020-05-15 Thread Sam Tobin-Hochstadt
The source code is here:
https://github.com/racket/racket/blob/master/racket/collects/net/http-client.rkt

Sam

On Fri, May 15, 2020 at 3:57 PM je back  wrote:
>
> I'm having trouble with formatting the #:data parameter to a http-sendrecv 
> request.  If I insert the string literal after #:data "my string" it works, 
> if I bind the string to a symbol (define my-string "my string") and call with 
> #:data my-string i get an error from the severs: HTTP/1.1 400 Bad Request .  
> Is there a way to echo or examine the request as sent?
>
> Also, I can't figure out where the source code for this library is located.
>
> Thanks,
> Jan Erik
>
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/b786e6fa-512b-4694-885a-afde1a011cf1%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BbYgz35ZN8ZSe8B_Njspet0n9kK%3DEtsvH-5ob_Y9YyQWg%40mail.gmail.com.


Re: [racket-users] SOLVED BUT needs documentation change: printing structures in typed Racket

2020-05-15 Thread Sam Tobin-Hochstadt
I've updated the docs.

On Fri, May 15, 2020 at 10:33 AM Hendrik Boom  wrote:
>
> On Fri, May 15, 2020 at 10:07:31AM -0400, Sam Tobin-Hochstadt wrote:
> > Generics are not supported yet; you need to use structure type
> > properties, like this:
> >
> > #lang typed/racket/base
> >
> > (: parameter-print : Any Output-Port Any -> Any)
> > (define (parameter-print v p b) (fprintf p "hi\n"))
> >
> > (struct parameter
> >   ([type : String] [name : Symbol] [len : (Option String)] [const? :
> > Boolean] [stars : Integer])
> >   #:property prop:custom-write  parameter-print)
>
> Thank you.  That worked.
>
> But according to section 2.5 of the typed Racket reference, #:property
> is not one of the allowed options in struct.
>
> Perhaps the documentation needs to be updated/
>
> -- hendrik
>
> >
> > On Fri, May 15, 2020 at 8:00 AM Hendrik Boom  wrote:
> > >
> > > How does one provide a method to print strutures in typed Racket?
> > >
> > > (struct parameter
> > >
> > >   ([type : XML] [name : Symbol] [len : (Option String)] [const? : 
> > > Boolean] [stars : Integer])
> > >   #:methods gen:custom-write [(define write-proc parameter-print)]
> > >   )
> > >
> > > seems not to work.  But something like this did work in untyped Racket.
> > > Is there some other way to do this?
> > >
> > > -- hendrik
> > >
> > > --
> > > 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.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/racket-users/20200515120026.ski2o43crgtnsnr3%40topoi.pooq.com.
> >
> > --
> > 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.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZFMR0evj%2B%3DcoeQaaQ602f7rGj76HtNc7N3bswipH7aEg%40mail.gmail.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200515143347.ceg34vkaelx6sdu2%40topoi.pooq.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BbxDsNAaDGHbEpaJj_%2BN9_v0ZO%3D3xgo8%2BMR6EE_1rKpTA%40mail.gmail.com.


Re: [racket-users] printing structures in typed Racket

2020-05-15 Thread Sam Tobin-Hochstadt
Generics are not supported yet; you need to use structure type
properties, like this:

#lang typed/racket/base

(: parameter-print : Any Output-Port Any -> Any)
(define (parameter-print v p b) (fprintf p "hi\n"))

(struct parameter
  ([type : String] [name : Symbol] [len : (Option String)] [const? :
Boolean] [stars : Integer])
  #:property prop:custom-write  parameter-print)

On Fri, May 15, 2020 at 8:00 AM Hendrik Boom  wrote:
>
> How does one provide a method to print strutures in typed Racket?
>
> (struct parameter
>
>   ([type : XML] [name : Symbol] [len : (Option String)] [const? : Boolean] 
> [stars : Integer])
>   #:methods gen:custom-write [(define write-proc parameter-print)]
>   )
>
> seems not to work.  But something like this did work in untyped Racket.
> Is there some other way to do this?
>
> -- hendrik
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200515120026.ski2o43crgtnsnr3%40topoi.pooq.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZFMR0evj%2B%3DcoeQaaQ602f7rGj76HtNc7N3bswipH7aEg%40mail.gmail.com.


Re: [racket-users] How to avoid all packages when building from source?

2020-05-08 Thread Sam Tobin-Hochstadt
For Racket CS, you'd want `make cs` or `make cs-base`.

`PKGS` is what gets built. The `racket/pkgs` directory is packages
that are part of the `racket/racket` repository; it includes things
like tests, the guide and reference, and a few other packages that
make sense to develop in the same repository as the core libraries and
runtime. Mostly that's an implementation detail. Note that some of
those packages (like `racket-doc`) depend on packages not in that
directory (like `scribble-lib`).

Sam


On Fri, May 8, 2020 at 10:11 AM zeRusski  wrote:
>
>
>> You can do "make base" instead, which installs no packages. Or you can do 
>> something like 'make PKGS=drracket' which just installs DrRacket and 
>> dependencies, or similar with other packages.
>
>
> I am installing in-place but racket cs, not racket bc, so IIUC `make base` 
> isn't what I want. PKGS confuses me a bit at least having read both the 
> build.md notes and your comment. From the build notes I understand it 
> controls what gets build (or linked in place) that's already in racket/pkgs 
> dir - that would be the packages that are being developed alongside racket in 
> the same repository. But then the notes say that PKGS defaults to the 
> main-distribution like you said and apparently that brings in stuff beyond 
> the racket/pkgs dir. I guess I can run with PKGS="" and see if indeed the 
> racket/pkgs are still being built and linked, cause I really want them to. 
> They are the ones I'd consider base.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/ca77a5fd-2718-4b11-9cb8-6ed00f719d2c%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYc%3DYg5L4xf8G3Z2cr4K_LUdouDN%2Br5y%3Dzv-7ciHhSqCw%40mail.gmail.com.


Re: [racket-users] Another futures-related bug hunt

2020-05-08 Thread Sam Tobin-Hochstadt
You will want to do `handle SIGSEGV nostop noprint` when you start
gdb.  Racket BC uses the SEGV handler to implement the GC write
barrier, so you'll want to skip those.

Sam

On Fri, May 8, 2020 at 9:36 AM Dominik Pantůček
 wrote:
>
> Hello,
>
> On 08. 05. 20 14:27, Matthew Flatt wrote:
> > At Fri, 8 May 2020 09:34:32 +0200, Dominik Pantůček wrote:
> >> Apart from obvious strace (after freeze) and gdb (before/after freeze)
> >> debugging to find possible sources of this bug, is there even a remote
> >> possibility of getting any clue how can this happen based on the
> >> information gathered so far? My thought go along the lines:
> >>
> >> * flonums are boxed - but for some operations they may be immediate
> >> * apparently it is a busy-wait loop in RTT, otherwise 100% CPU usage is
> >> impossible with this workload
> >> * unsafe ops are always suspicious, but again, the problem shows up even
> >> when I switch to the safe versions - it just takes longer time
> >> * which means, the most probable cause is a race condition
> >
> > The most useful information here is likely to be a stack trace from
> > each OS-level thread at the point where the application is stuck.
> >
> > That could potentially tell us, for example, that it's a problem with
> > synchronization for a GC (where one of the OS threads that run futures
> > doesn't cooperate for some reason) or a problem with a the main thread
> > performing some specific work on a future thread's behalf.
> >
>
> I am using the build from master branch with the patch for #3145 and
> cannot make it run under gdb:
>
> $ gdb ../racket-lang/racket/racket/bin/racket
> GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
> Copyright (C) 2019 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> .
> Find the GDB manual and other documentation resources online at:
>  .
>
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from ../racket-lang/racket/racket/bin/racket...
> (No debugging symbols found in ../racket-lang/racket/racket/bin/racket)
> (gdb) run
> Starting program:
> /home/joe/Projects/Programming/racket-lang/racket/racket/bin/racket
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Welcome to Racket v7.7.0.4.
> [New Thread 0x77fcb700 (LWP 6410)]
>
> Thread 1 "racket" received signal SIGSEGV, Segmentation fault.
> 0x555e14fe in scheme_gmp_tls_unload ()
> (gdb)
>
> The same happens for the binary with debug symbols:
>
>   gdb ../racket-lang/racket/racket/src/build/racket/racket3m
> GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
> Copyright (C) 2019 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> .
> Find the GDB manual and other documentation resources online at:
>  .
>
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from
> ../racket-lang/racket/racket/src/build/racket/racket3m...
> (gdb) run
> Starting program:
> /home/joe/Projects/Programming/racket-lang/racket/racket/src/build/racket/racket3m
>
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Welcome to Racket v7.7.0.4.
> [New Thread 0x77fcb700 (LWP 6422)]
>
> Thread 1 "racket3m" received signal SIGSEGV, Segmentation fault.
> scheme_gmp_tls_unload (s=0x76114480, data=0x0) at
> ../../../racket/gc2/../src/gmp/gmp.c:5822
> 5822  s[0] = 0;
> (gdb)
>
> I am running Ubuntu 19.10's default gdb:
>
> $ gdb --version
> GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
>
> I assume gmp is used for bignum implementation (didn't check yet), so it
> might be relevant as well:
>
> ii  libgmp-dev:amd64   2:6.1.2+dfsg-4
>amd64Multiprecision arithmetic library
> developers tools
> ii  libgmp10:amd64 2:6.1.2+dfsg-4
>amd64Multiprecision arithmetic library
> ii  libgmp10:i386  2:6.1.2+dfsg-4
>   

Re: [racket-users] How to avoid all packages when building from source?

2020-05-08 Thread Sam Tobin-Hochstadt
The default build installs "main-distribution", which is the same as what
you get for a regular (not minimal) Racket install. It does, as you
noticed, install a lot of packages.

You can do "make base" instead, which installs no packages. Or you can do
something like 'make PKGS=drracket' which just installs DrRacket and
dependencies, or similar with other packages.

Note that rerunning "make base" will make all your packages disappear if
you install them after running make base the first time.

Sam

On Fri, May 8, 2020, 6:10 AM zeRusski  wrote:

> I just rebuilt Racket from git repo checkout. It takes a while but most of
> that time is spent in `raco setup` which appears to be building all
> packages in existence. E.g. games, redex-examples, realm of Racket chapter
> 6 (really?), plai, algol, etc. Why do I end up with the entire jungle? Is
> there a way to avoid all these packages? Is there a way to figure where
> these dependencies are coming from?
>
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/869f4d10-eb3a-42c1-a239-d71cdbc10092%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaF%2B%3D7jBfZ9wyADEANM_aGCcF%2B_k7F%2BAqWsRCNpnw52_g%40mail.gmail.com.


Re: [racket-users] How to run multiple Racket installations?

2020-05-08 Thread Sam Tobin-Hochstadt
This is the tooling I use: https://github.com/takikawa/racket-dev-goodies/

Note that it works primarily with "in-place" installations.

Sam

On Fri, May 8, 2020, 4:55 AM zeRusski  wrote:

> I have two builds of Racket on my local machine. Racket CS resides in one
> directory and was built with `RACKETCS_SUFFIX=""` and stardard Racket also
> built from source in a separate directory. Normally I have my .bashrc setup
> PATH as needed to use e.g. Racket CS. I ran into a problem with an upstream
> package which maybe FFI related, so now I want to test it against standard
> Racket build so I switch over the PATH and run it with non-cs `raco` and
> `racket`.
>
> First, does that even work? I noticed that both of them install packages
> into ~/Library/Racket/development/ for me. Are both builds so compatible I
> don't need to worry about packages stepping on each others toes i.e.
> compiled with one but executed with the other? I think I'd rather have the
> two systems completely separated so I can actually compare oranges to
> oranges. Is there a way to guarantee that? I don't have a mental model of
> having two builds like this.
>
> How do you run and test multiple builds? Is there a good setup I can steal
> please?
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/195b0260-19f2-45b2-a36d-4edc344fef87%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bbx08tU1FfVpgCefk_i-_8RXKpqvim8HGtWxCfmanFYnQ%40mail.gmail.com.


Re: [racket-users] Futures + threads SIGSEGV

2020-05-02 Thread Sam Tobin-Hochstadt
I opened https://github.com/racket/racket/issues/3145 to avoid too
much mailing list traffic, and posted a stack trace there.

Sam


On Sat, May 2, 2020 at 8:31 AM Matthew Flatt  wrote:
>
> I wasn't able to produce a crash on my first try, but the Nth try
> worked, so this is very helpful!
>
> I'm investigating, too...
>
> At Sat, 2 May 2020 08:26:10 -0400, Sam Tobin-Hochstadt wrote:
> > I successfully reproduced this on the first try, which is good. Here's
> > my debugging advice (I'm also looking at it):
> >
> > 1. To use a binary with debugging symbols, use
> > `racket/src/build/racket/racket3m` from the checkout of the Racket
> > repository that you built.
> > 2. When running racket in GDB, there are lots of segfaults because of
> > the GC; you'll want to use `handle SIGSEGV nostop noprint`
> > 3. It may not work for this situation because of parallelism, but if
> > you can reproduce the bug using `rr` [1] it will be almost infinitely
> > easier to find and fix.
> >
> > I'm also curious about your experience with Racket CS and futures.
> > It's unlikely to have the _same_ bugs, but it would be good to find
> > the ones there are. :)
> >
> > [1] https://rr-project.org
> >
> > On Sat, May 2, 2020 at 7:56 AM Dominik Pantůček
> >  wrote:
> > >
> > > Hello fellow Racketeers,
> > >
> > > during my research into how Racket can be used as generic software
> > > rendering platform, I've hit some limits of Racket's (native) thread
> > > handling. Once I started getting SIGSEGVs, I strongly suspected I am
> > > doing too much unsafe operations - and to be honest, that was true.
> > > There was one off-by-one memory access :).
> > >
> > > But that was easy to resolve - I just switched to safe/contracted
> > > versions of everything and found and fixed the bug. But I still got
> > > occasional SIGSEGV. So I dug even deeper (during last two months I've
> > > read most of the JIT inlining code) than before and noticed that the
> > > crashes disappear when I refrain from calling bytes-set! in parallel
> > > using futures.
> > >
> > > So I started creating a minimal-crashing-example. At first, I failed
> > > miserably. Just filling a byte array over and over again, I was unable
> > > to reproduce the crash. But then I realized, that in my application,
> > > threads come to play and that might be the case. And suddenly, creating
> > > MCE was really easy:
> > >
> > > Create new eventspace using parameterize/make-eventspace, put the actual
> > > code in application thread (thread ...) and make the main thread wait
> > > for this application thread using thread-wait. Before starting the
> > > application thread, I create a simple window, bitmap and a canvas, that
> > > I keep redrawing using refresh-now after each iteration. Funny thing is,
> > > now it keeps crashing even without actually modifying the bitmap in
> > > question. All I need to do is to mess with some byte array in 8 threads.
> > > Sometimes it takes a minute on my computer before it crashes, sometimes
> > > it needs more, but it eventually crashes pretty consistently.
> > >
> > > And it is just 60 lines of code:
> > >
> > > #lang racket/gui
> > >
> > > (require racket/future racket/fixnum racket/cmdline)
> > >
> > > (define width 800)
> > > (define height 600)
> > >
> > > (define framebuffer (make-fxvector (* width height)))
> > > (define pixels (make-bytes (* width height 4)))
> > >
> > > (define max-depth 0)
> > >
> > > (command-line
> > >  #:once-each
> > >  (("-d" "--depth") d "Futures binary partitioning depth" (set! max-depth
> > > (string->number d
> > >
> > > (file-stream-buffer-mode (current-output-port) 'none)
> > >
> > > (parameterize ((current-eventspace (make-eventspace)))
> > >   (define win (new frame%
> > >(label "test")
> > >(width width)
> > >(height height)))
> > >   (define bmp (make-bitmap width height))
> > >   (define canvas (new canvas%
> > >   (parent win)
> > >   (paint-callback
> > >(λ (c dc)
> > >  (send dc draw-bitmap bmp 0 0)))
> > >   ))
> > >
> > >   (define (single-run)
> > &

Re: [racket-users] Futures + threads SIGSEGV

2020-05-02 Thread Sam Tobin-Hochstadt
I successfully reproduced this on the first try, which is good. Here's
my debugging advice (I'm also looking at it):

1. To use a binary with debugging symbols, use
`racket/src/build/racket/racket3m` from the checkout of the Racket
repository that you built.
2. When running racket in GDB, there are lots of segfaults because of
the GC; you'll want to use `handle SIGSEGV nostop noprint`
3. It may not work for this situation because of parallelism, but if
you can reproduce the bug using `rr` [1] it will be almost infinitely
easier to find and fix.

I'm also curious about your experience with Racket CS and futures.
It's unlikely to have the _same_ bugs, but it would be good to find
the ones there are. :)

[1] https://rr-project.org

On Sat, May 2, 2020 at 7:56 AM Dominik Pantůček
 wrote:
>
> Hello fellow Racketeers,
>
> during my research into how Racket can be used as generic software
> rendering platform, I've hit some limits of Racket's (native) thread
> handling. Once I started getting SIGSEGVs, I strongly suspected I am
> doing too much unsafe operations - and to be honest, that was true.
> There was one off-by-one memory access :).
>
> But that was easy to resolve - I just switched to safe/contracted
> versions of everything and found and fixed the bug. But I still got
> occasional SIGSEGV. So I dug even deeper (during last two months I've
> read most of the JIT inlining code) than before and noticed that the
> crashes disappear when I refrain from calling bytes-set! in parallel
> using futures.
>
> So I started creating a minimal-crashing-example. At first, I failed
> miserably. Just filling a byte array over and over again, I was unable
> to reproduce the crash. But then I realized, that in my application,
> threads come to play and that might be the case. And suddenly, creating
> MCE was really easy:
>
> Create new eventspace using parameterize/make-eventspace, put the actual
> code in application thread (thread ...) and make the main thread wait
> for this application thread using thread-wait. Before starting the
> application thread, I create a simple window, bitmap and a canvas, that
> I keep redrawing using refresh-now after each iteration. Funny thing is,
> now it keeps crashing even without actually modifying the bitmap in
> question. All I need to do is to mess with some byte array in 8 threads.
> Sometimes it takes a minute on my computer before it crashes, sometimes
> it needs more, but it eventually crashes pretty consistently.
>
> And it is just 60 lines of code:
>
> #lang racket/gui
>
> (require racket/future racket/fixnum racket/cmdline)
>
> (define width 800)
> (define height 600)
>
> (define framebuffer (make-fxvector (* width height)))
> (define pixels (make-bytes (* width height 4)))
>
> (define max-depth 0)
>
> (command-line
>  #:once-each
>  (("-d" "--depth") d "Futures binary partitioning depth" (set! max-depth
> (string->number d
>
> (file-stream-buffer-mode (current-output-port) 'none)
>
> (parameterize ((current-eventspace (make-eventspace)))
>   (define win (new frame%
>(label "test")
>(width width)
>(height height)))
>   (define bmp (make-bitmap width height))
>   (define canvas (new canvas%
>   (parent win)
>   (paint-callback
>(λ (c dc)
>  (send dc draw-bitmap bmp 0 0)))
>   ))
>
>   (define (single-run)
> (define (do-bflip start end (depth 0))
>   (cond ((fx< depth max-depth)
>  (define cnt (fx- end start))
>  (define cnt2 (fxrshift cnt 1))
>  (define mid (fx+ start cnt2))
>  (let ((f (future
>(λ ()
>  (do-bflip start mid (fx+ depth 1))
>(do-bflip mid end (fx+ depth 1))
>(touch f)))
> (else
>  (for ((i (in-range start end)))
>(define c (fxvector-ref framebuffer i))
>(bytes-set! pixels (+ (* i 4) 0) #xff)
>(bytes-set! pixels (+ (* i 4) 1) (fxand (fxrshift c 16)
> #xff))
>(bytes-set! pixels (+ (* i 4) 2) (fxand (fxrshift c 8) #xff))
>(bytes-set! pixels (+ (* i 4) 3) (fxand c #xff))
> (do-bflip 0 (* width height))
> (send canvas refresh-now))
> (send win show #t)
>
>   (define appthread
> (thread
>  (λ ()
>(let loop ()
>  (single-run)
>  (loop)
>   (thread-wait appthread))
>
> Note: the code is deliberately de-optimized to highlight the problem.
> Not even mentioning CPU cache coherence here
>
> Running this from command-line, I can adjust the number of threads.
> Running with 8 threads:
>
> $ time racket crash.rkt -d 3
> SIGSEGV MAPERR si_code 1 fault on addr (nil)
> Aborted (core dumped)
>
> real1m18,162s
> user7m11,936s
> sys 0m3,832s
> $ time racket crash.rkt -d 3
> SIGSEGV MAPERR si_code 1 fault on 

[racket-users] ICFP 2020 will be held ONLINE Aug 23-28

2020-05-01 Thread 'Sam Tobin-Hochstadt' via users-redirect


The ICFP 2020 organizers would like to announce that the conference
and co-located events, originally scheduled for August 23-28, in
Jersey City, New Jersey, will now be held online during the same
dates. Further information for presenters, authors, attendees,
sponsors, and the ICFP community will be provided as it becomes
available.

  The ICFP Organizing Committee

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5eac72f38c986_5b6e2b07d78345b4501e5%40homer.mail.


Re: [racket-users] Re: Should I stop sending packages to the catalog?

2020-05-01 Thread Sam Tobin-Hochstadt
This is very cool! One question -- for "main-distribution" packages,
are you snapshotting the most-recent release catalog? Or
pkgs.racket-lang.org? The latter is simpler, but the former is
probably needed to make the examples in the README work. Otherwise,
if, say, "typed-racket-lib" on May 1 depended on a newer-than-7.6
version of "base", using the snapshot first (or only the snapshot)
would get you a version of "typed-racket-lib" that didn't work on 7.6.
I think that if you snapshot pkgs.racket-lang.org, then just adding
the 7.6 catalog before the snapshot catalog would work the way you
want, but I haven't fully thought through everything.

Sam

On Fri, May 1, 2020 at 12:59 PM Bogdan Popa  wrote:
>
>
> Alex Harsanyi writes:
>
> > As an application writer, I am on the other side of this problem, by
> > depending on other packages. Having limited time to work on my project I
> > want to upgrade package dependencies at my own pace.
>
> I'm in a similar position since I operate a few Racket applications.
>
> I'd been mulling over the idea of a snapshotting service for the main
> package catalog to help automate some of this over the past couple of
> months, but this thread finally pushed me to get started on building it.
>
> More details here: https://github.com/bogdanp/racksnaps
>
> It's not quite ready for general use yet (the first snapshot is being
> built as we speak), but I should be able to iron out the kinks over the
> next couple of weeks.
>
> I'm curious what folks think about this approach.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/m2k11vmw0d.fsf%40192.168.0.142.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaxH7A0UaM6xrwiawjGif%2B%2B%2B7E_3_giVd4Z-ArmMFhO2A%40mail.gmail.com.


Re: [racket-users] Rhombus project plan

2020-04-30 Thread Sam Tobin-Hochstadt
On Thu, Apr 30, 2020 at 9:09 AM Ben Greenman
 wrote:
>
> On 4/29/20, Sorawee Porncharoenwase  wrote:
> > (Not directly related to Rhombus) Speaking of “how to contribute”, I find
> > that it is not friendly at all to setup stuff in order to contribute to
> > Racket core and main distribution. According to
> > https://blog.racket-lang.org/2017/09/tutorial-contributing-to-racket.html,
> > if I want to make a change to, say, https://github.com/racket/math, I
> > should start with:
> >
> > $ raco pkg update --no-setup --catalog https://pkgs.racket-lang.org math
> > $ raco pkg update --clone math
> >
> > The estimated time to run the above two commands is ONE HOUR! The second
> > command in particular seems to compile every Racket packages (why does it
> > need to do that?!?) which takes a lot of time.
>
> That second command recompiles only the packages that depend on math.
> Unfortunately there are a lot of them.

To follow up on that, here are some strategies for reducing that time:

1. Start with Minimal Racket, install "math", then follow the steps
above. That will just rebuild `math`, not everything that depends on
it, since they won't be installed.

2. (Dangerous) Do the following:
   $ raco pkg update --no-setup --clone math # fast
   $ raco setup math

This will only setup "math", and thus be faster, but will potentially
cause other parts of the installation to not work correctly until you
run "raco setup".

Making the original commands go faster would require one of three
things (in increasing order of difficulty): detecting that many zo
files can be re-used from the previous installation in some fashion,
making Typed Racket faster, or making Racket macro expansion more
incremental.

Sam

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ5k%2BFk2guk8sxe8gs-kQ9NcKJLkHGeWprrucFzqZ%2BABA%40mail.gmail.com.


Re: [racket-users] Rhombus project plan

2020-04-29 Thread Sam Tobin-Hochstadt
See the comment I just left in this PR:
https://github.com/racket/scribble/pull/223

Sam

On Wed, Apr 29, 2020 at 5:10 PM Dexter Lagan  wrote:
>
>   I’d like to help too, so if I understand this pull request correctly, 
> there’s demand for a guide on how to update the docs? I was about to ask 
> precisely that, how to contribute to the docs. If there’s JavaScript to make, 
> I can take a look. I don’t use Slack, is there an alternative?
>
> Cheers,
>
> Dex
>
> > On Apr 29, 2020, at 4:27 PM, Sam Tobin-Hochstadt  
> > wrote:
> >
> > Hi David,
> >
> > If you ping me on Slack, I'll be happy to walk you through how to make
> > changes to the docs. And maybe you can lend a hand to finally
> > completing https://github.com/racket/racket/pull/874 which I think is
> > mostly a matter of JavaScript programming now.
> >
> > Sam
> >
> >> On Wed, Apr 29, 2020 at 9:35 AM David Storrs  
> >> wrote:
> >>
> >>
> >>
> >>> On Wed, Apr 29, 2020 at 8:21 AM Matthew Flatt  wrote:
> >>>
> >>> At Wed, 29 Apr 2020 11:14:47 +0200, Dexter Lagan wrote:
> >>>>  To the point: what would make Racket2 the ultimate tool (for me):
> >>>> Performance. Faster startup times, shorter execution times in general.
> >>>> Optionally, a ‘lite’ version of Racket that compiles directly to no-deps
> >>>> binaries, bypassing the JIT altogether, would be a game-changer. As far 
> >>>> as
> >>>> high levels languages with functional concepts and metaprogramming 
> >>>> facilities
> >>>> that compiles to tiny, fast bins, Nim comes dangerously close, but it’s 
> >>>> not a
> >>>> Lisp, and it’s not Racket.
> >>>> Production-quality, modern and fast GUI facilities. I’ll take properly
> >>>> documented, complete Qt bindings. Racket/GUI is great for internal 
> >>>> tools, but
> >>>> it quickly becomes slow, tedious and limited for more complex 
> >>>> client-facing
> >>>> UIs.
> >>>> One complete, commercial-grade Web framework, inspired from Symphony or
> >>>> Laravel. Security and ease of use first, continuations later.
> >>>> Better documentation: Racket docs are aesthetically very pleasing, 
> >>>> complete
> >>>> and detailed. However some parts are still very obscure and lacking 
> >>>> simple
> >>>> examples (if only the part about Continuations included just one basic
> >>>> example, such as a ‘return’ implementation, on the very first page. If 
> >>>> only
> >>>> the Macros documentation started with define-simple-macro and a few very
> >>>> basic, practical examples. Instead we’re greeted with pattern-based 
> >>>> macros,
> >>>> which although very powerful, are very hard to comprehend for newcomers).
> >>>
> >>> Which of these things will you be working on?
> >>
> >>
> >> I'll step up.
> >>
> >> Matt, I need some help with Scribble and how to contribute to the Racket 
> >> docs.  I'd be willing to pay for a couple hours of your time (or whomever 
> >> else's has the skill/knowledge) to walk me through that.  After that I'll 
> >> be happy to pitch in by offering documentation patches.  This will be a 
> >> big help for me, since I'm finding myself having trouble writing docs for 
> >> my own code.
> >>
> >>>
> >>>
> >>>
> >>>>  I am well aware that what I’m wishing for isn’t necessarily compatible 
> >>>> with
> >>>> Racket’s intended public’s needs (comp-sci teachers and students? That’s 
> >>>> the
> >>>> impression I’m getting). But Racket is the most advanced general purpose
> >>>> programming tool I’ve ever seen. Wouldn’t it be a shame if it was 
> >>>> limited to
> >>>> academic use?
> >>>
> >>> https://www.youtube.com/watch?v=LN0qG-i1iT0=youtu.be
> >>>
> >>> --
> >>> 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.
> >>> To view this discussion on the web visit 
> >>> https://groups.google.com/d/msgid/racket-users/5ea97134.1c69fb81.8c167.2c68SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
> >>
> >> --
> >> 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.
> >> To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/racket-users/CAE8gKoe%3D5XYkfveAKUy2b6iq7pfNJsZVr%3Djhh7G-8rszHrwfbQ%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bb9MYd6Os09dH15TmNg3ij9_vPe%3D4C2BYdL1DMiGXUuxQ%40mail.gmail.com.


Re: [racket-users] Rhombus project plan

2020-04-29 Thread Sam Tobin-Hochstadt
Hi David,

If you ping me on Slack, I'll be happy to walk you through how to make
changes to the docs. And maybe you can lend a hand to finally
completing https://github.com/racket/racket/pull/874 which I think is
mostly a matter of JavaScript programming now.

Sam

On Wed, Apr 29, 2020 at 9:35 AM David Storrs  wrote:
>
>
>
> On Wed, Apr 29, 2020 at 8:21 AM Matthew Flatt  wrote:
>>
>> At Wed, 29 Apr 2020 11:14:47 +0200, Dexter Lagan wrote:
>> >   To the point: what would make Racket2 the ultimate tool (for me):
>> > Performance. Faster startup times, shorter execution times in general.
>> > Optionally, a ‘lite’ version of Racket that compiles directly to no-deps
>> > binaries, bypassing the JIT altogether, would be a game-changer. As far as
>> > high levels languages with functional concepts and metaprogramming 
>> > facilities
>> > that compiles to tiny, fast bins, Nim comes dangerously close, but it’s 
>> > not a
>> > Lisp, and it’s not Racket.
>> > Production-quality, modern and fast GUI facilities. I’ll take properly
>> > documented, complete Qt bindings. Racket/GUI is great for internal tools, 
>> > but
>> > it quickly becomes slow, tedious and limited for more complex client-facing
>> > UIs.
>> > One complete, commercial-grade Web framework, inspired from Symphony or
>> > Laravel. Security and ease of use first, continuations later.
>> > Better documentation: Racket docs are aesthetically very pleasing, complete
>> > and detailed. However some parts are still very obscure and lacking simple
>> > examples (if only the part about Continuations included just one basic
>> > example, such as a ‘return’ implementation, on the very first page. If only
>> > the Macros documentation started with define-simple-macro and a few very
>> > basic, practical examples. Instead we’re greeted with pattern-based macros,
>> > which although very powerful, are very hard to comprehend for newcomers).
>>
>> Which of these things will you be working on?
>
>
> I'll step up.
>
> Matt, I need some help with Scribble and how to contribute to the Racket 
> docs.  I'd be willing to pay for a couple hours of your time (or whomever 
> else's has the skill/knowledge) to walk me through that.  After that I'll be 
> happy to pitch in by offering documentation patches.  This will be a big help 
> for me, since I'm finding myself having trouble writing docs for my own code.
>
>>
>>
>>
>> >   I am well aware that what I’m wishing for isn’t necessarily compatible 
>> > with
>> > Racket’s intended public’s needs (comp-sci teachers and students? That’s 
>> > the
>> > impression I’m getting). But Racket is the most advanced general purpose
>> > programming tool I’ve ever seen. Wouldn’t it be a shame if it was limited 
>> > to
>> > academic use?
>>
>> https://www.youtube.com/watch?v=LN0qG-i1iT0=youtu.be
>>
>> --
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/5ea97134.1c69fb81.8c167.2c68SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAE8gKoe%3D5XYkfveAKUy2b6iq7pfNJsZVr%3Djhh7G-8rszHrwfbQ%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYbHQ0oSvb%2BbFshZMgvAEc4vmxt7usYPQQfbZPXyP6QnA%40mail.gmail.com.


Re: [racket-users] Functions not being linked in scribble

2020-04-28 Thread Sam Tobin-Hochstadt
I believe you're missing a `defmodule` inside test.scrbl.

Sam

On Tue, Apr 28, 2020 at 11:32 AM David Storrs  wrote:
>
> Here's my test code.  I get the test.html file out at the end and, as 
> expected, the explanation of bar says "Calls foo" with foo in blue with a red 
> line underneath.  What am I missing?
>
>
> ; test.rkt
> #lang racket
> (provide (all-defined-out))
> (define (foo) 7)
> (define (bar) (foo))
>
> --
>
> ; test.scrbl
> #lang scribble/manual
> @(require (for-label racket "test.rkt"))
> @title{My Library}
> @defproc[(foo) any]{Returns 7}
> @defproc[(bar) any]{Calls @racket[foo]}
>
> --
>
> ; command line
>
> $ racket
> Welcome to Racket v7.6.
> > (require "test.rkt")
> > (bar)
> 7
>
>
> $ scribble test.scrbl
>
> Output:
> test.scrbl:6:10: WARNING: no declared exporting libraries for definition
>   in: foo
> test.scrbl:8:10: WARNING: no declared exporting libraries for definition
>   in: bar
>  [Output to test.html]
> Warning: some cross references may be broken due to undefined tags:
>  (dep (# bar))
>  (dep ((lib "racket/contract/base.rkt") any))
>  (dep ((lib "racket/contract.rkt") any))
>  (dep ((lib "racket/contract/private/misc.rkt") any))
>  (dep (# foo))
>  (dep ((lib "racket/main.rkt") any))
>
>
> On Tue, Apr 28, 2020 at 11:00 AM Ben Greenman  
> wrote:
>>
>> On 4/28/20, David Storrs  wrote:
>> > According to what I see in Scribble, both actual examples and in the
>> > documentation, I had thought that if I did @defproc[func-name] then
>> > func-name would become a link target and later uses of @racket[func-name]
>> > would automatically link to that site.  I'm clearly missing something; my
>> > functions are being rendered in link style but they have red links under
>> > them and are not actually links.  Can someone point me in the right
>> > direction?
>>
>> Did you (require (for-label  func-name)) ?
>>
>> --
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/CAFUu9R5%3Dk-WHJ87FHFbLFj-XWy9%2BhMrsVGXcGfeA834s25EfVg%40mail.gmail.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAE8gKodfM9TON5T7hwjQ6XPUCKGHdv98Rx-cX%2BFDo6ALXLg36A%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaxqHQ7276t5m8RRh_kQT8pTse%2B9bZ2Moxcbvw4xxRD_A%40mail.gmail.com.


Re: [racket-users] Typed Racket: Generics and interfaces/subtyping

2020-04-25 Thread Sam Tobin-Hochstadt
Structure type properties are getting better support incrementally
thanks to Fred Fu, and that sentence needs to be revised. However,
there's been no work yet on generic interfaces. I'm happy to chat
about the issues there, but it's not simply a matter of doing some
programming -- there are a lot of hard design questions. Feel free to
ping me on Slack to discuss further.

Sam

On Sat, Apr 25, 2020 at 12:10 PM unlimitedscolobb
 wrote:
>
> Hello,
>
> The Typed Racket Guide states "Most structure type properties do not work in 
> Typed Racket, including support for generic interfaces." [0] Is that due to 
> some incompatibility between the design of Typed Racket and structure type 
> properties, or is it because somebody should just get around and implement 
> these?  I'm particularly interested in generics right now.
>
> How would you go about expressing something like an abstract interface in 
> Typed Racket?  Something similar to the collections library, possibly even 
> less featureful.  Should I be looking at class inheritance?
>
> As a lot of people here, I don't have very much time spare time, but I would 
> be happy to extend Typed Racket to handle more of the code I write.
>
> -
> Sergiu
>
> [0] 
> https://docs.racket-lang.org/ts-guide/caveats.html#%28part._.Unsupported_features%29
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/6e5f6bb0-4768-4f4d-86b0-0c0c08f64171%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Baq-XQJtkOWKwNqJN3fQfP7Zecf-T9zJTjaXWRgU6%3DLWw%40mail.gmail.com.


Re: [racket-users] hash-ref in typed Racket

2020-04-21 Thread Sam Tobin-Hochstadt
The problem here is with the optional third argument to `hash-ref`.
Typed Racket only allows `#f` or functions as the third argument.
Plain Racket allows any non-function value as a default, or a function
which is called to produce the default. Since "any non-function" is
not expressible in Typed Racket, it's more restricted here.

The best option is to wrap the third argument in a thunk: `(lambda () 'other)`.

As an aside, you probably don't want to use `cast` this extensively in
your program.

Sam

On Tue, Apr 21, 2020 at 10:35 AM Hendrik Boom  wrote:
>
> In typed Racket I define a hashtable:
>
> (: vector-to-contract (HashTable TType CContract))
>
> (define vector-to-contract
>   (make-hash
>(cast '(
>(_bytes . bytes?)
>(_s8vector . s8vector?)
>(_u16vector . u16vector?)
>(_s16vector . s16vector?)
>(_u32vector . u32vector?)
>(_s32vector . s32vector?)
>(_u64vector . u64vector?)
>(_s64vector . s64vector?)
>(_f32vector . f32vector?)
>(_f64vector . f64vector?))
>  (Listof (Pair TType CContract))
>  )
>))
>
> And then I try to look something up in it:
>
> ( hash-ref vector-to-contract (cast '_bytes TType) (cast 'other CContract))
>
> and I am informed that I cannot, it seems, look up a value of type
> TType in a hastable whose type indicates it looks up things of type
> TType:
>
> Type Checker: Polymorphic function `hash-ref' could not be applied to 
> arguments:
> Types: HashTableTop a (-> c) -> Any
>HashTableTop a False -> Any
>HashTableTop a -> Any
> Arguments: (HashTable TType CContract) TType CContract
> Expected result: AnyValues
>  in: (hash-ref vector-to-contract (cast (quote _bytes) TType) (cast
> (quote other) CContract))
>
>
> How *does* one use hashtables in typed Racket?
>
> -- hendrik
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200421143453.lauuqi3pb4fdgyhh%40topoi.pooq.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BY-pc3Jfg4RgRmAPMqSUxUj8rJsm3np2eq2%2B-J5PWTO4Q%40mail.gmail.com.


Re: [racket-users] What's the correct way to test a Racket build?

2020-04-19 Thread Sam Tobin-Hochstadt
The most basic test suite is run with `racket/bin/racket
pkgs/racket-test-core/tests/racket/test.rkt`.

There are a lot of other tests; a good guide is the CI suite here:
https://github.com/racket/racket/blob/master/.github/workflows/ci-push.yml#L283-L318

In general, and certainly for a release build, these tests should all
pass, although there's a possibility that a few might fail
intermittently due to test flakiness. If there's a consistent failure
not related to your changes, that's a bug.

Sam

On Sun, Apr 19, 2020 at 2:33 PM Yongming Shen  wrote:
>
> Hi,
>
> After an in-place build of Racket from source (from a git clone), what's the 
> correct way to test that Racket functions correctly? I can't find 
> documentation on this. Is it simply running "racket/bin/raco test 
> pkgs/racket-test" from the root of the repository? Also, for a release (say, 
> tag v7.6), it is normal for "racket/bin/raco test pkgs/racket-test" to report 
> a few test failures?
>
> Thanks,
> Yongming
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/465f8808-032e-4cc0-b13e-4618acfc1813%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bad1ZijMc2didTe-bog5MUx1JONxsPAXJ-s%2Bwb37SBa9A%40mail.gmail.com.


Re: [racket-users] typing variable length argument lists

2020-04-13 Thread Sam Tobin-Hochstadt
The change makes a difference because Typed Racket's type inference
for `cons` is producing a less-accurate answer than it could. When it
sees arguments of type `String` and `(Listof Any)`, it decides that
the result is a `(Listof Any)` instead of a `(Pairof String (Listof
Any))`.

If you add (excessive) annotation like this:

   (apply fprintf (ann (cons (current-output-port) (ann (cons
message messageargs) (Pairof String (Listof Any
   (Pairof Output-Port (Pairof String (Listof Any)

then the expression typechecks as written.

However, I think the use of `apply` without the extra `cons` calls is
clearer anyway, in addition to being easier for the type checker.

Sam

On Mon, Apr 13, 2020 at 3:22 PM K H  wrote:
>
> If I understand correctly, the difference to getting the code to type check 
> was:
> > (apply fprintf (cons anomaly (cons message messageargs)))
>
> becomes:
> >(apply fprintf anomaly message messageargs)
>
> Since the documentation explains that the arguments to fprintf are 
> effectively gathered in a list*, could someone explain why the change makes a 
> difference? Would it the answer depend on whether messagesargs was a list?.
>
> Also, the first version with the cons's looks strange to me. Is there a 
> reason why the statement was originally coded that way? Is it perhaps an 
> artifact from attempting to force the result of list* to produce a list? 
> regardless of what is the type of of the value passed in messageargs?
>
> Thanks in advance,
>
> Kieron
>
>
> On Sat, Apr 11, 2020 at 7:43 AM Hendrik Boom  wrote:
>>
>> On Fri, Apr 10, 2020 at 08:18:38PM -0400, Jon Zeppieri wrote:
>> > (define (unique [list : (Listof Any)] [message : String] .
>> > [messageargs : Any *])
>> >   ; return the only element of the list, or '() if there is none.
>> >   ; Produce message if not just one.
>> >   (if (equal? 1 (length list)) (car list)
>> >  (begin
>> >(apply fprintf anomaly message messageargs)
>> >(if (null? list) list (car list)
>>
>> Thank you.  That worked.
>> The change to the apply syntax surprised me.
>>
>> -- hendrik
>>
>> >
>> > On Fri, Apr 10, 2020 at 7:49 PM Hendrik Boom  
>> > wrote:
>> > >
>> > > Trying to convert the following to typed Racket:
>> > >
>> > > (define (unique list message . messageargs)
>> > >   ; return the only element of the list, or '() if there is none.
>> > >   ; Produce message if not just one.
>> > >   (if (equal? 1 (length list)) (car list)
>> > >  (begin
>> > >(apply fprintf (cons anomaly (cons message messageargs)))
>> > >(if (null? list) list (car list))
>> > >)
>> > >  )
>> > > )
>> > >
>> > > It's an error message function tat accepts a list to test.
>> > > If the test fails it uses fprintf to print a message with the
>> > > arguments for the ~s items.
>> > >
>> > > I got so far, but I don't know what to do with the . messageargs :
>> > >
>> > > (define (unique [list (Listof Any)] [message : String] . messageargs)
>> > >   ; return the only element of the list, or '() if there is none.
>> > >   ; Produce message if not just one.
>> > >   (if (equal? 1 (length list)) (car list)
>> > >  (begin
>> > >(apply fprintf (cons anomaly (cons message messageargs)))
>> > >(if (null? list) list (car list))
>> > >)
>> > >  )
>> > > )
>>
>> --
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/20200411134316.yff5tg7kwtglcs62%40topoi.pooq.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAEEP09AhmxLHeRdOpzpuG7qC9jOuPTrpog92G_3b6nJWwZDzbw%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYQWikBwmNC1uyCGGRYyir-Ty4x0TtWtUKybcgov386jQ%40mail.gmail.com.


Re: [racket-users] Are there interfaces for IP ports at least raw sockets?

2020-04-02 Thread Sam Tobin-Hochstadt
Here's some C source code which should point to the right functions:
https://www.geeksforgeeks.org/ping-in-c/

I think you can just use `#f` for the library -- all the functions
should be from libc.

Sam

On Thu, Apr 2, 2020 at 1:00 PM David Storrs  wrote:
>
> On Thu, Apr 2, 2020 at 12:37 PM George Neuner  wrote:
> >
> >
> > On 4/2/2020 11:13 AM, David Storrs wrote:
> > > The Reference lists TCP and UDP but nothing else.  I'd like to be able
> > > to implement ICMP, since there doesn't seem to be such a thing at the
> > > moment, and I'm trying to figure out how to do that.
> > >
> > > In an ideal world I'd have something like ip-in and ip-out ports as
> > > the complement to tcp-in and tcp-out ports and then I could simply
> > > hand the ip-out port some bytes that constitute an ICMP or etc packet
> > > and away it goes.  Failing that, if I can get a raw socket then I
> > > could do the IP stuff on top of it; with that in hand it would be
> > > (more) straightforward to implement other protocols.
> > >
> > > Is there a way to do this in Racket?
> >
> > Windows historically placed a lot of limitations on the use of raw sockets.
> > https://docs.microsoft.com/en-us/windows/win32/winsock/tcp-ip-raw-sockets-2
> >
> > There doesn't seem to be any updated information on Win10, so you might
> > conclude that it has the same limitations as Win7.
>
> Doesn't surprise me.  Fortunately, I don't need it for Windows, at
> least right now.
>
> > Re: ICMP, I think it should be possible to implement at least some of
> > the functions (not sure about all of them) ... but it will have to be
> > done via FFI.
>
> Cool thanks.  Do you happen to know what library I should be FFI'ing
> into, ideally for macOS?  Trying to find information on using ICMP
> programmatically tends to result in things like:  return
> subprocess("ping hostname")
>
> >
> > 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.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/bc77f87f-378c-6d5c-3875-3270cb25134b%40comcast.net.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAE8gKodjbeVWqdJRKKYEvYspg%3DDtDTk4GbWQeqHCk4kQ%2BPahZA%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYVnzqyyJCWRphJK%3DkCWHtDJ2kMpr4_0PZmro_zbSb%2BNQ%40mail.gmail.com.


Re: [racket-users] Issue with define-type and typed classes

2020-04-02 Thread Sam Tobin-Hochstadt
When this happens, it's usually a bug in Typed Racket caused by depending
on hash table ordering, so it would be great to find and fix it.

On Thu, Apr 2, 2020, 3:43 AM hashim muqtadir 
wrote:

>
> I am thinking its deeper because the code sometimes compiles.
>>
>
> Yes, this happens with me too. I haven't tried it using raco but in
> DrRacket, while I
> was fiddling around with these classes, it would sometimes fail to
> compile, but
> I just used to erase what I wrote, and then re-write, and it would work.
>
> Once compiled it seemed to work fine.
>
> But I believe they're separate problems.
>
> I'll try to be more diligent about reporting issues with typed classes
> next time. I used to run into
> problems similar to what I reported in this thread previously, too, on
> whatever version of Racket
> was out a year or two ago, but I was throwing away and rewriting code
> quickly and it
> was hard to come up with minimal examples at the time.
>
> This one reproduced very reliably and I wasn't really making big changes
> so I was able to
> report 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/b3199035-27c9-4549-890d-0a4aac48d924%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ_DaS2K8u5VGKtZ0WUP8784dFKOU0XfZG%2BETAAYGgPvw%40mail.gmail.com.


Re: [racket-users] How do I just run the type checker?

2020-02-21 Thread Sam Tobin-Hochstadt
If you compile the file with `raco make server.rkt` then it will run
the type checker as part of compilation. Furthermore, it will run
faster the next time since it won't have to re-compile.

Sam

On Fri, Feb 21, 2020 at 12:13 PM Marc Kaufmann
 wrote:
>
> Hi,
>
> the way I currently check my web server is by simply running `racket 
> server.rkt` on the command line. However, this also launches the server, 
> which I usually do want to, but not always. So is there a way to run just the 
> type checker -- plus all the compile-time stuff that needs to happen for this 
> -- without anything else? The best I have managed is to put the most 
> time-consuming commands that I run into `(module+ main ...)`, but that still 
> does more than than just run the type checker.
>
> Secondly, is it possible to somehow speed up subsequent type checks by 
> caching something before?
>
> Cheers,
> Marc
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/b8922e9a-524f-4c2d-b716-c857914e7107%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BapBjywcVuDQYqQgSdeYu2R%2BKR3nyGW8yp2ku-fLzGajA%40mail.gmail.com.


Re: [racket-users] Mixing different #lang in one application

2020-02-10 Thread Sam Tobin-Hochstadt
Yes, you can use Typed Racket together with racket/gui -- there's a
`typed/racket/gui` module that you can `require`, and also you can
simply write the handler functions in `#lang typed/racket` and
`require` them into your GUI application code.

Sam

On Mon, Feb 10, 2020 at 3:56 PM Alain De Vos  wrote:
>
> I want to create a gui app.
> But then I need:
> #lang racket/gui
> But when i click a button i want type control in the functions so i need :
> #lang typed/racket
> Are there solutions ?
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/4b579c9d-b9d0-4d8b-9d60-5be31d6449fd%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BbexxK868RuThfrseDusOoZKenur3%3DKSBoqL9aNUS5qbA%40mail.gmail.com.


[racket-users] Call for Papers: PACMPL issue ICFP 2020

2020-01-30 Thread 'Sam Tobin-Hochstadt' via users-redirect
roduce evidence to substantiate this claim. If
functional programming worked in this case in the same ways it has
worked for others, the paper need only summarize the results 
the main part of the paper should discuss how well it worked and in
what context. Most readers will not want to know all the details of
the project and its implementation, but the paper should characterize
the project and its context well enough so that readers can judge to
what degree this experience is relevant to their own projects. The
paper should take care to highlight any unusual aspects of the
project. Specifics about the project are more valuable than
generalities about functional programming; for example, it is more
valuable to say that the team delivered its software a month ahead of
schedule than it is to say that functional programming made the team
more productive.

If the paper not only describes experience but also presents new
technical results, or if the experience refutes cherished beliefs of
the functional-programming community, it may be better to submit it as
a full paper, which will be judged by the usual criteria of novelty,
originality, and relevance. The principal editor will be happy to
advise on any concerns about which category to submit to.



### ICFP Organizers

General Chair: Stephanie Weirich (University of Pennsylvania, USA)

Artifact Evaluation Co-Chairs: Ben Lippmeier (UNSW, Australia)
   Brent Yorgey (Hendrix College, USA)
Industrial Relations Chair: Alan Jeffrey (Mozilla Research, USA)
Programming Contest Organiser: Igor Lukanin (Kontur, Russia)
Publicity and Web Chair: Sam Tobin-Hochstadt (Indiana University, USA)
Student Research Competition Chair: Youyou Cong (Tokyo Institute of Technology, 
Japan)
Workshops Co-Chair: Leonidas Lampropoulos (University of Maryland, USA)
Jennifer Hackett (University of Nottingham, UK)
Conference Manager: Annabel Satin (P.C.K.)


### PACMPL Volume 4, Issue ICFP 2020

Principal Editor: Adam Chlipala (MIT, USA)

Review Committee:

Andreas Abel (Gothenburg University, Sweden)
Nada Amin (Harvard University, USA)
Edwin Brady (University of St. Andrews, UK)
William E. Byrd (University of Alabama at Birmingham, USA)
David Darais (University of Vermont)
Richard A. Eisenberg (Bryn Mawr College, USA)
Matthew Fluet (Rochester Institute of Technology, USA)
Makoto Hamana (Gunma University, Japan)
Fritz Henglein (Department of Computer Science, University of Copenhagen (DIKU) 
and Deon Digital, Denmark)
Jan Hoffmann (Carnegie Mellon University, USA)
Robbert Krebbers (Delft University of Technology, Netherlands)
Neel Krishnaswami (Computer Laboratory, University of Cambridge, UK)
Geoffrey Mainland (Drexel University, USA)
Magnus O. Myreen (Chalmers University of Technology, Sweden)
Atsushi Ohori (Tohoku University, Japan)
Frank Piessens (KU Leuven, Belgium)
Nadia Polikarpova (University of California San Diego, USA)
Jonathan Protzenko (Microsoft Research, USA)
Jerome Simeon (Clause, France)
KC Sivaramakrishnan (IIT Madras, India)

External Review Committee:

Danel Ahman (University of Ljubljana, Slovenia)
Aws Albarghouthi (University of Wisconsin-Madison, USA)
Kenichi Asai (Ochanomizu University, Japan)
Patrick Bahr (IT University of Copenhagen, Denmark)
Stephanie Balzer (Carnegie Mellon University, USA)
Jean-Philippe Bernardy (University of Gothenburg, Sweden)
Sandrine Blazy (Univ Rennes-IRISA, France)
Benjamin Canou (OCamlPro, France)
Giuseppe Castagna (CNRS - Université de Paris, France)
Jesper Cockx (TU Delft, Netherlands)
Youyou Cong (Tokyo Institute of Technology, Japan)
Leonardo De Moura (Microsoft Research, USA)
Sebastian Erdweg (JGU Mainz, Germany)
Ronald Garcia (University of British Columbia, Canada)
Jennifer Hackett (University of Nottingham, UK)
Troels Henriksen (University of Copenhagen, Denmark)
Gabriele Keller (Utrecht University, Netherlands)
Delia Kesner (IRIF, France / University of Paris Diderot, France)
Shriram Krishnamurthi (Brown University, United States)
Jan Midtgaard (University of Southern Denmark, Denmark)
Andrey Mokhov (Jane Street, USA)
J. Garrett Morris (University of Kansas, USA)
Stefan Muller (Carnegie Mellon University, USA)
Rasmus Ejlers Møgelberg (IT University of Copenhagen, Denmark)
Cyrus Omar (University of Chicago, USA)
Dominic Orchard (University of Kent, UK)
Ivan Perez (NIA / NASA Formal Methods)
Brigitte Pientka (McGill University, Canada)
Juan Pedro Bolívar Puente (Independent Consultant, Sinusoidal Engineering)
Norman Ramsey (Tufts University, USA)
Christine Rizkallah (UNSW Sydney, Australia)
Tiark Rompf (Purdue University, USA)
Guido Salvaneschi (Technische Universität Darmstadt, Germany)
Tom Schrijvers (KU Leuven, Belgium)
Chung-chieh Shan (Indiana University, USA)
Vincent St-Amour (Northwestern University, USA)
Aaron Stump (The University of Iowa, USA)
Nicolas Tabareau (Inria, France)
Ross Tate (Cornell University, USA)
Dimitrios Vytiniotis (DeepMind, UK)

Re: [racket-users] What's the point of make-continuation-mark-key?

2020-01-11 Thread Sam Tobin-Hochstadt
We created the continuation-mark-key data type in ~2011 to support Typed
Racket. At that point, Racket had continuation mark support for more than a
decade using other values as keys.

Sam

On Sat, Jan 11, 2020, 11:37 PM Jack Firth  wrote:

> That makes sense. I think the thing that seems most confusing to me is
> that using the continuation-mark-key data type is *optional*. Why bother
> allowing arbitrary kinds of keys?
>
> On Saturday, January 11, 2020 at 8:02:44 PM UTC-8, Matthew Flatt wrote:
>>
>> It would be reasonable to generalize `chaperone-continuation-mark-key`
>> to apply in cases where `chaperone-struct` could work, with similar
>> sorts of evidence that chaperoning is allowed provided by a caller of
>> `chaperone-continuation-mark-key`. I guess we just didn't think about
>> it that way when `chaperone-continuation-mark-key` was added, so it was
>> added in a way more like `chaperone-vector` and other chaperones that
>> apply to more specialized representations.
>>
>> Other kinds of keys, like symbols, can't be impersonated because their
>> representations don't accommodate chaperones. (In other words, they're
>> like structs declared with `#:authentic`.)
>>
>> At Sat, 11 Jan 2020 19:48:17 -0800 (PST), Jack Firth wrote:
>> > Based on my reading of Continuation Frames and Marks
>> > <
>> https://docs.racket-lang.org/reference/eval-model.html#(part._mark-model)>,
>>
>> > any value at all can be used as a key for a continuation mark. So why
>> does
>> > make-continuation-mark-key
>> > <
>> https://docs.racket-lang.org/reference/contmarks.html#%28def._%28%28quote._~23
>> > ~25kernel%29._make-continuation-mark-key%29%29>
>> > exist, and why is there a special continuation-mark-key
>> > <
>> https://docs.racket-lang.org/reference/contmarks.html#%28def._%28%28quote._~23
>> > ~25kernel%29._continuation-mark-key~3f%29%29>
>> > data type? Couldn't you use any arbitrary gensym, or a singleton
>> struct?
>> > The docs for make-continuation-mark-key mention that the returned key
>> can
>> > be impersonated and other kinds of keys can't, but they don't explain
>> why
>> > that would be the case.
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/racket-users/773a2caa-d6b3-48b8-becf-cc3105a6
>> > 60e0%40googlegroups.com.
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/9ac7e680-f32e-4a79-8cb7-4799ea5e953c%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYaGvX2ohTsK3snkaXR4t%3DJ4pHOD6E_KO33GmJBbJ%3DBqQ%40mail.gmail.com.


Re: [racket-users] ffi-lib and scribble/srcdoc

2019-12-23 Thread Sam Tobin-Hochstadt
What you're seeing is that `scribble/srcdoc` looks for the _binding_
of `->` from `racket/contract` which is being shadowed by the version
of `->` from `ffi/unsafe`. I would do something like this:

#lang racket
(require (rename-in ffi/unsafe [-> -->]) scribble/srcdoc)
(provide
  (proc-doc/names
a-struct?
(-> any/c boolean?)
(a)
("Returns true if a is a-struct")))
(struct a-struct (b))

and then use `-->` in ffi declarations.

Sam

On Mon, Dec 23, 2019 at 3:10 AM Dominik Pantůček
 wrote:
>
> Hello,
>
> apart from parallel sorting and working with unsafe ops, I stumbled upon
> a very strange behavior using ffi-lib:
>
> -->8--
> #lang racket
> (require scribble/srcdoc)
> (provide
>   (proc-doc/names
> a-struct?
> (-> any/c boolean?)
> (a)
> ("Returns true if a is a-struct")))
> (struct a-struct (b))
> ->8-
>
> Running this works without a glitch:
>
> $ racket test1.rkt
> $
>
> But if we require ffi/unsafe, something bad happens:
>
> -->8--
> #lang racket
> (require ffi/unsafe scribble/srcdoc)
> (provide
>   (proc-doc/names
> a-struct?
> (-> any/c boolean?)
> (a)
> ("Returns true if a is a-struct")))
> (struct a-struct (b))
> ->8-
>
> $ racket test2.rkt
> test2.rkt:8:4: proc-doc/names: unsupported procedure contract form (no
> argument names)
>   at: (-> any/c boolean?)
>   in: (proc-doc/names a-struct? (-> any/c boolean?) (a) ("Returns true
> if a is a-struct"))
>   location...:
>test2.rkt:8:4
>   context...:
>do-raise-syntax-error
>/usr/share/racket/pkgs/scribble-lib/scribble/srcdoc.rkt:342:2:
> proc-doc/names-transformer
>/usr/share/racket/pkgs/scribble-lib/scribble/srcdoc.rkt:127:24
>/usr/share/racket/pkgs/scribble-lib/scribble/srcdoc.rkt:124:0:
> do-provide/doc
>/usr/share/racket/collects/racket/provide-transform.rkt:63:2:
> pre-expand-export
>/usr/share/racket/collects/racket/private/reqprov.rkt:708:2: provide
>apply-transformer-in-context
>apply-transformer52
>dispatch-transformer41
>do-local-expand50
>/usr/share/racket/collects/syntax/wrap-modbeg.rkt:46:4:
> do-wrapping-module-begin
>apply-transformer-in-context
>apply-transformer52
>dispatch-transformer41
>loop
>finish
>...
> $
>
> I assume that ffi/unsafe somehow re-defines -> and it does it in a very
> srcdoc-incompatible way. Did anyone spot the same behavior? Can it be
> fixed? That is without rewriting the whole ffi/unsafe library.
>
> I am using a simple workaround to scribble my libraries with ffi/unsafe
> requires:
>
> ->8-
> #lang racket
> (require
>  ffi/unsafe
>  scribble/srcdoc)
> (provide
>   (proc-doc/names
> a-struct?
> (->* (any/c) () boolean?)
> ((a) ())
> ("Returns true if a is a-struct")))
> (struct a-struct (b))
> ->8-
>
> But it is kind of strange to use (-> any/c boolean?) contract for
> predicate in one module and (->* (any/c) () boolean?) in another one.
>
> It sort of feels like the problem with requiring unsafe-vector-ref
> without knowing. Although this is also "without knowing", it at least
> exhibits itself at the syntax stage (and not at run-time).
>
>
>
> Cheers,
> Dominik
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/2ac9a533-4325-53da-6855-01bd07da81a3%40trustica.cz.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Ba00bzG24AC%2BoxDqzJAWc%2BNFXUVOOAKuMbJcMcesOs8GA%40mail.gmail.com.


Re: [racket-users] Change error message of web server continuations from "Sorry, this page has expired. Please go back."

2019-12-23 Thread Sam Tobin-Hochstadt
The default is documented here:
https://docs.racket-lang.org/web-server/run.html?q=serve%2Fservlet#%28def._%28%28lib._web-server%2Fservlet-env..rkt%29._serve%2Fservlet%29%29
as the default value for the `#:manager` argument.

The default handler is `#f`, which produces the behavior you see. You
can provide a different `request? -> response?` function instead.

On Mon, Dec 23, 2019 at 6:55 AM Marc Kaufmann  wrote:
>
> In order to do everything as I do now - where I have been blissfully unaware 
> of the managers - I do
>
> ```
> (define the-manager-with-threshold (make-threshold-LRU-manager 
> what-is-this-instance-expiration-handler? (* 512 1024 1024)))
>
> (serve/servlet start ...  ... #:manager 
> the-manager-with-threshold)
> ```
> and this would set the threshold to roughly 512 MB, rather than 130MB? By the 
> way, where does it say that the default is 130MB?
>
> Can I set the instance-expiration-manager to #f and that is the place where 
> it generates the 'Sorry, this page link has expired' error? So I could 
> provide a more meaningful error message there? Or better not, since it does 
> more work behind the scenes?
>
> Cheers,
> Marc
>
> On Sun, Dec 22, 2019 at 9:58 PM Philip McGrath  
> wrote:
>>
>> You can probably use `make-threshold-LRU-manager` with a much higher memory 
>> threshold than the default from `serve/servlet`, which is about 130 MB. The 
>> manager will start expiring continuations at that threshold even if you have 
>> lots of RAM available.
>>
>> -Philip
>>
>> On Sat, Dec 21, 2019 at 3:31 PM George Neuner  wrote:
>>>
>>>
>>> On 12/21/2019 4:38 AM, Marc Kaufmann wrote:
>>>
>>>
 Did you perhaps change the continuation manager - or its setup?
 https://docs.racket-lang.org/web-server/servlet.html?q=ffi#%28part._managers%29

>>>
>>> No, not really. I simply import send/suspend/dispatch etc and use them 
>>> without doing anything in particular. I am requiring them within 
>>> typed/racket if that matters via require/typed. So I have no idea where to 
>>> configure the continuation manager - I don't even know where the current 
>>> one is.
>>>
>>>
>>> If you started from serve/servlet - and didn't specify differently - then 
>>> you are using the default LRU continuation manager.   If the load spikes, 
>>> it will drop saved continuations to get memory use back under control.
>>>
>>> https://docs.racket-lang.org/web-server/run.html?q=serve%2Fservlet#%28def._%28%28lib._web-server%2Fservlet-env..rkt%29._serve%2Fservlet%29%29
>>> https://docs.racket-lang.org/web-server/servlet.html#%28def._%28%28lib._web-server%2Fmanagers%2Flru..rkt%29._make-threshold-.L.R.U-manager%29%29
>>>
>>>
>>> You can specify to use a different manager (including a custom one) in the 
>>> call to serve/servlet.
>>>
>>>
>>> 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/f974666a-3e1a-3cd8-d371-09e9a283a157%40comcast.net.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAD7_NO7G%3DY_Q48_pfTYknpPCrfULRL3-yoCzqMVH0at372P0Uw%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYpQkYm%3Dd_tQ8oT9i9R3GdG%2B%3DxHj-_e9DpQSwyMiZzvMA%40mail.gmail.com.


Re: [racket-users] [Type Racket] Why doesn't this code type check?

2019-12-21 Thread Sam Tobin-Hochstadt
Typed Racket doesn't refine the type of mutable variables. Doing that
soundly would require an effect and escape analysis that seems like more
complexity than it's worth.

Sam

On Sat, Dec 21, 2019, 9:46 AM Weixi Ma  wrote:

> Hi guys, thanks for your attention. Here is the code.
>
> 1 (: n (U False Number))
> 2 (define n #f)
> 3 (when n
> 4   (set! n (sub1 n)))
>
> I suppose there should a refinement at line 3 that narrows down the type
> of n to be Number.
> However typed racket complains that n is expected to be Number and
> actually given (U Complex False).
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/bdd02c94-e1e4-40b2-b0ba-608281c75f5a%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZnsoabSbQoZ0rrwT%3DTEcP8fTh1jgi53uheQyVCX_8HHw%40mail.gmail.com.


Re: [racket-users] Typed Racket: 'Unable to protect opaque value passed as `Any`' with interesting behavior

2019-12-16 Thread Sam Tobin-Hochstadt
The best approach to this is to avoid using `Any` as the type you pass
to untyped code. Often you just need to be more specific about the
type; sometimes you need to use polymorphism.

Sam

On Mon, Dec 16, 2019 at 1:40 PM Marc Kaufmann  wrote:
>
> Follow up on this: Is there a way to resolve this type of issue when I import 
> typed code in a non-typed place? I did hit the same issue today, roughly as 
> follows: the typed code uses an opaque type for `Time` (using predicate 
> `time?`), and the function `my-function` has return type `Any`, and can 
> return various types, including opaque type `Time`.
>
> However when the non-typed code tries to display the time objects in a 
> response, it blows up with the "any-wrap/c: Unable to protect opaque value 
> passed as `Any`" error. I now think that I understand why this happens (the 
> untyped code can't look at the 'interesting' value of the time object, or the 
> contract can't in any case). Is there some way of getting this to work, given 
> that I have opaque types?
>
> I got it working after typing the whole previously untyped file, but I might 
> hit this issue again with another file that I really don't know how to type 
> (it has formlets in it). Do I have to change the return value of the 
> function? Write a wrapper function that does the type checking inside of the 
> typed module? Are there any best practices?
>
> Cheers,
> Marc
>
> On Wednesday, December 11, 2019 at 5:05:08 PM UTC+1, Marc Kaufmann wrote:
>>
>> Thanks. Yes, I realized that the two gave the same answer, but for debugging 
>> I tried to see if it was different. I think I now see where I am thinking 
>> about this in the wrong way. I thought `(U A B)` means 'it is either of type 
>> A or of type B', with the implication that it picks the more stringent one 
>> when possible. When there are two separate types A and B, this is innocuous 
>> enough, I think. What you are saying is that when typed racket sees `(U 
>> response Any)`, it transforms it (via some macro applied before doing type 
>> checking?) into `Any`. I thought it would leave `(U response Any)` around 
>> and always check against both, which is why I switched the order to see if 
>> that happened.
>>
>> A trivial and obvious answer to something that stumped me for quite a while. 
>> Good illustration of
>>
>> “It's not what we don't know that hurts. It's what we know that ain't so.”
>>
>>
>> Cheers,
>> Marc
>>
>> On Wednesday, December 11, 2019 at 4:27:03 PM UTC+1, Sam Tobin-Hochstadt 
>> wrote:
>>>
>>> First, (U Any response) is the same as (U response Any) which is the
>>> same as Any -- Any includes all other types and thus includes
>>> response.
>>>
>>> Second, f4 really is breaking the contract -- the contract Any turns
>>> into says: don't try to pass through any "interesting" values, or if
>>> you do, the other side isn't allowed to look at them. You passed a
>>> "response" which is an interesting value (not a number or suchlike)
>>> and the web server actually did something with it. The REPL doesn't
>>> give you this error because in a typed module the REPL is also typed.
>>>
>>> The problem is fundamentally that when you using Any in an annotation,
>>> you're explicitly asking Typed Racket to throw away information.
>>> Unfortunately, when you throw away that information for something that
>>> you provide to untyped parts of your program, you've thrown away the
>>> information Typed Racket needed to generate a more useful contract. So
>>> instead, Typed Racket generates the best contract it can, which is as
>>> described above.
>>>
>>> Sam
>>>
>>> On Wed, Dec 11, 2019 at 8:31 AM Marc Kaufmann  wrote:
>>> >
>>> > Hello,
>>> >
>>> > I have one file called `type-test.rkt` with the following (notice that I 
>>> > discovered that there is a typed version of the web-server/http module, 
>>> > which solves another of my issues):
>>> >
>>> > ```
>>> > #lang typed/racket
>>> >
>>> > (require (only-in typed/web-server/http response/xexpr response))
>>> >
>>> > (provide f1 f2 f3 f4)
>>> >
>>> > (: f1 (-> response))
>>> > (define (f1)
>>> >   (define x '(body (h1 "Try it")))
>>> >   (: resp response)
>>> >   (define resp (response/xexpr x))
>>> >   resp)
>>> >
>>> > (: f2 (-> (U response Any

Re: [racket-users] index-of + TR ... parametricity problem?

2019-12-15 Thread Sam Tobin-Hochstadt
Yes, this is because the contract enforces parametericity, which
doesn't allow `index-of` to work the way you'd want.

Instantiating things doesn't help because the contract is based on the
`require/typed`, not on the use site.

Here's a few suggestions:

1. Submit a pull-request to TR to add `index-of`
2. Import `index-of` at a concrete type
3. Use `unsafe-require/typed`
4. Use the third argument to `index-of?`

Sam

On Sun, Dec 15, 2019 at 9:28 PM 'John Clements' via Racket Users
 wrote:
>
> It looks like my quick attempt at importing index-of into TR is running into 
> a problem. Here’s the program I ran:
>
> #lang typed/racket
>
> (require/typed racket/list
>[index-of (All (T) ((Listof T) T -> (U False Natural)))])
>
> (index-of '(n s e w) 'n) ;; returns... #f?
>
> In typed/racket/no-check this returns 0, and also in racket (mutatis 
> mutandis).
>
> I thought this might be some kind of parametricity issue, but even when I 
> instantiate index-of at Symbol which should pretty much clear the way for 
> arbitrary equality checking, I still get False.
>
> Am I missing something obvious? Maybe I shouldn’t be running from the 
> November 14 git head any more?
>
> Welcome to DrRacket, version 7.5.0.7--2019-11-14(-/f) [3m].
>
> John
>
>
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/ef401a3d-9c41-44f9-ba61-93c09065755e%40mtasv.net.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaFwAPxwuf67_NxeqCeZQMfac%2BL8Vqf0fEbFDGxLPgmgg%40mail.gmail.com.


Re: [racket-users] Re: What’s everyone working on this week?

2019-12-12 Thread Sam Tobin-Hochstadt
Yes, basically. I'd say it's showing how to translate that Racket code
(taken from Shriram Krishnmurthi's JFP paper/LL1 talk) into Sham.

Sam

On Thu, Dec 12, 2019 at 10:32 PM Anthony Carrico  wrote:
>
> On 12/12/19 10:05 PM, Sam Tobin-Hochstadt wrote:
> > You might be interested in our project Sham
>
> So is this compiling a state machine (or, two actually) to llvm and
> running against a Racket oracle?
>https://github.com/rjnw/sham/blob/master/test/automata.rkt
>
> --
> Anthony Carrico
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/c619eae3-fac5-9a8f-a35a-dbf5a6921839%40memebeam.org.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZfZPRKHe0PXgSowJZZO%3DbgC1Ggn9Psk%3DXucikxpEJG8g%40mail.gmail.com.


Re: [racket-users] Re: What’s everyone working on this week?

2019-12-12 Thread Sam Tobin-Hochstadt
You might be interested in our project Sham:
https://github.com/rjnw/sham which is a Racket interface for easily
using LLVM.

Documentation coming soon, but you can see some examples here:
https://github.com/rjnw/sham/tree/master/test

Sam

On Thu, Dec 12, 2019 at 10:03 PM Nathaniel Griswold
 wrote:
>
> Racket to generate llvm
>
> > On Dec 12, 2019, at 3:35 PM, Hendrik Boom  wrote:
> >
> > On Thu, Dec 12, 2019 at 10:49:01AM -0800, Nathaniel Griswold wrote:
> >> I am almost done with chapter 5 of SICP which i have been working on in
> >> racket.
> >>
> >> My plan now is to write a scheme compiler/interpreter with garbage
> >> collection that runs in native language in racket. I think i will use llvm.
> >
> > So you'll be using LLVM directly? Or using Racket to generate LLVM code?
> >
> > -- hendrik
> >
> > --
> > 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.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/20191212213513.rqi6zplqs63vc4ty%40topoi.pooq.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/0F71B923-2FEA-49AB-BA66-B6E31A723A6A%40gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ0YXV1F5PedmdHAYYphPFmVwQdWPzA2UoEp%3DOfTNB6jg%40mail.gmail.com.


Re: [racket-users] Why is racklog so inefficient?

2019-12-11 Thread Sam Tobin-Hochstadt
Racklog is a port to more-idiomatic Racket of the Schelog system [1]
by Dorai Sitaram. The idea of Schelog was not to be a high-performance
implementation of Prolog, but to use continuations to allow smooth
integration between Prolog-style search and more conventional
computation, while maintaining a simple implementation. Maintaining
this integration (see
https://docs.racket-lang.org/racklog/racket-w-logic.html) with a
WAM-based system would be tricky. Additionally, since Racklog is not
widely used currently, I think there hasn't been much of a push to
optimize it.

Because Racklog uses continuations, I expect that it runs much faster
on Racket CS, which has a much more efficient implementation of
continuations than the traditional Racket VM.

Building a new and efficient Prolog implementation in Racket would be
a great thing to do, and I encourage you to do this, or even just to
start by porting the Common Lisp code you have.

Sam

On Wed, Dec 11, 2019 at 4:42 PM Eduardo Costa  wrote:
>
> From time to time, I test Racklog, in the hope that the Racket team replaced 
> it with something more efficient. After all, there are many good 
> implementations of Prolog like languages around. I simply cannot understand 
> why Racket must be packed with a ridiculously slow piece of software, such as 
> Racklog. Therefore, in order to discover how difficult would be the 
> implementation of an efficient version of Racklog, I decided to check what I 
> could do in Common Lisp. The reason for choosing Common Lisp is that there 
> are a few inference machines in Lisp, so I did not need to start from scratch.
>
> I found a book by Patrice Boizumalt that explained how to implement  Prolog; 
> the examples are in Common Lisp. I also found the material published in 
> Japanese by Daiki Matsunaga from the Kioto Institute of Technology. The 
> implementations of Boizumalt and Matsunaga are incomplete. For instance, they 
> did not implement floating point. It took me about one hour to complete their 
> implementations. Besides this, both implementations had bugs, which I fixed, 
> and raised an issue on the github pages of the authors. Finally, I tested the 
> programs with small grammars, puzzles and loops, just to check the tail call 
> optimization. Here is the comparison between Matsunaga's Prolog and cxprolog:
>
> ```
> %% File: again.pl
> › cat again.pl
>
> loop(0, Acc, Acc) :- !.
> loop(N, Acc, F) :- A1 is Acc + 0.1, N1 is N - 1, loop(N1, A1, F).
> ```
>
> Here is the execution in cxprolog:
>
> ```
> ~/wrkLisp/wam
> › ./cxp
> CxProlog version 0.98.2 [development]
>
> [main] ?- consult('again.pl').
> % File 'again.pl' consulted, 0.000106 sec 2768 bytes
> yes
>
> [main] ?- X1 is cputime, loop(200, 0.1, F), T is cputime - X1.
> X1 = 0.050186
> F = 20.1
> T = 133.843561
> ```
>
> So, cxprolog executed 2 millions of repetitions in about 130 seconds. By the 
> way, cxprolog is written in c. Now, here is the execution of Matsunaga's 
> Prolog, which is written in Lisp:
>
> ```
> ~/wrkLisp/wam› rlwrap ros run
> * (load "wam.lisp")
> T
> * (repl)
> * (repl)
> > ?- consult('again.pl').
>
> yes.
> > ?- cputime(X1), loop(200, 0.1, F), cputime(X2), T is X2 - X1.
> F = 197024.88
> X1 = 3804
> X2 = 11729
> T = 7925
>
> yes.
> > ?- cputime(X1), loop(200, 0.1, F), cputime(X2), T is X2 - X1.
> F = 197024.88
> X1 = 11730
> X2 = 19832
> T = 8102
>
> yes.
> > ?- cputime(X1), loop(200, 0.1, F), cputime(X2), T is X2 - X1.
> F = 197024.88
> X1 = 19833
> X2 = 28478
> T = 8645
>
> yes.
> ```
>
> I added floating point and the predicate cputime(X) to Matsunaga's code, and 
> corrected a few bugs. The modified program is about 16 times faster than 
> cxprolog. Matsunaga wrote an interpreter, in order to execute code for the 
> Warren Abstract Machine. Of course, the is very inefficient. Therefore, I 
> expanded each instruction that appear in the code into Lisp programs. 
> Consider the code below, that Matsunaga's interpreter executes. I created a 
> Lisp definition for the loop predicate, where I expanded each definition, 
> according to what appears in the interpreter. Thus, the Lisp code became 
> considerably faster than the cxprolog code.  I did this in about one day. 
> Here is my question: Since it is so easy to write an efficient Prolog in 
> Lisp, why the Racket community insists in using Racklog? I would like to 
> propose a project to implement an efficient version of Racklog, based in 
> Matsunaga's version of the Warren Abstract Machine. The first step is to fix 
> all bugs that still remain in the Lisp version, and expand the instructions 
> to eliminate the necessity of the interpreter. After obtaining a flawless 
> Lisp version, one can prepare a Scheme/Racket version.
>
> ```
> * (gethash (cons '|loop| 3) *dispatching-code-table*)
> ((TRY-ME-ELSE #:G525
>   ((TRUST-ME) (ALLOCATE) (GET-VARIABLE-PERMANENT 4 1)
>(GET-VARIABLE-PERMANENT 3 3) (PUT-VARIABLE-PERMANENT 2 1)
>(PUT-CONSTANT 0.1 3) (CALL 

Re: [racket-users] Typed Racket: 'Unable to protect opaque value passed as `Any`' with interesting behavior

2019-12-11 Thread Sam Tobin-Hochstadt
First, (U Any response) is the same as (U response Any) which is the
same as Any -- Any includes all other types and thus includes
response.

Second, f4 really is breaking the contract -- the contract Any turns
into says: don't try to pass through any "interesting" values, or if
you do, the other side isn't allowed to look at them. You passed a
"response" which is an interesting value (not a number or suchlike)
and the web server actually did something with it. The REPL doesn't
give you this error because in a typed module the REPL is also typed.

The problem is fundamentally that when you using Any in an annotation,
you're explicitly asking Typed Racket to throw away information.
Unfortunately, when you throw away that information for something that
you provide to untyped parts of your program, you've thrown away the
information Typed Racket needed to generate a more useful contract. So
instead, Typed Racket generates the best contract it can, which is as
described above.

Sam

On Wed, Dec 11, 2019 at 8:31 AM Marc Kaufmann  wrote:
>
> Hello,
>
> I have one file called `type-test.rkt` with the following (notice that I 
> discovered that there is a typed version of the web-server/http module, which 
> solves another of my issues):
>
> ```
> #lang typed/racket
>
> (require (only-in typed/web-server/http response/xexpr response))
>
> (provide f1 f2 f3 f4)
>
> (: f1 (-> response))
> (define (f1)
>   (define x '(body (h1 "Try it")))
>   (: resp response)
>   (define resp (response/xexpr x))
>   resp)
>
> (: f2 (-> (U response Any)))
> (define (f2)
>   (define x '(body (h1 "Try it")))
>   (: resp response)
>   (define resp (response/xexpr x))
>   resp)
>
> (: f3 (-> (U response Number)))
> (define (f3)
>   (define x '(body (h1 "Try it")))
>   (: resp response)
>   (define resp (response/xexpr x))
>   resp)
>
> (: f4 (-> (U Any response)))
> (define (f4)
>   (define x '(body (h1 "Try it")))
>   (: resp response)
>   (define resp (response/xexpr x))
>   resp)
> ```
>
> Then I have another *untyped* file for a servlet:
>
> ```
> #lang racket
>
> (require "type-test.rkt"
>  web-server/servlet
>  web-server/servlet-env)
>
> (define (start req)
>   (f1)
>   ; (f2)
>   ; (f3)
>   ; (f4)
>   )
>
> (serve/servlet start
>#:servlet-regexp #rx""
>#:launch-browser? #false
>#:port 8080)
> ```
>
> Notice that I am telling all the f* functions that `resp` is of type 
> `response`. Yet, when I run the server with `start` using `f1` through `f4` I 
> get the following results:
>
> (f1): All good
> (f2): Error, see below. Unable to protect opaque value passed as `Any`
> (f3): All good
> (f4): Error, see below.
>
> The error is:
>
> ```
>
> f4: broke its own contract
>   any-wrap/c: Unable to protect opaque value passed as `Any`
>   value: #
>   in: the range of
>   (-> Any)
>
> ```
>
> First, I couldn't figure out how to replicate this in the REPL, and had to 
> use the server to get the result. But I was able to figure out at the REPL 
> that (f2) and (f4) return something of type `Any`, for some unknown reason. 
> Clearly TR is smart enough to figure out that `resp` is not a Number, but a 
> response, but then when I allow it to return both a type `response` and 
> `Any`, it says that it's return value is `Any`. Why? Every function that can 
> take `Any` can take `response`, and every function that expects response is 
> now going to blow up (as now happens).
>
> At the REPL, I didn't manage to get this behavior, probably because 
> `serve/servlet` has contracts around it's arguments. Thus:
>
> - I pass all the typed racket tests
> - I nonetheless return something of type `Any` (which is really guaranteed to 
> be of type response, and I am already annotating, so this surprises me)
> - When this hits the contract, it complains and tells me that f4 broke its 
> own contract, which seems false, but this may be one of those 'Contract 
> blaming is hard' moments
>
> Long story short: Why do (f2) and (f4) return something of type `Any` rather 
> than `response`? What is the logic for doing this and what use case am I 
> missing where this is a feature (or maybe it's just hard to get right, but 
> this seems vastly easier than other things Typed Racket does).
>
> And yes, I should probably just use typed/web-server/servlet and friends (not 
> sure if everything is covered, but probably) - but I discovered the typed/** 
> modules only while trying to fix this. And the issue will come up with other 
> non-typed modules or when/if I try to created typed versions of some module.
>
> Cheers,
> Marc
>
> --
> 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.
> To view this discussion on the web visit 
> 

Re: [racket-users] futures-sort update

2019-12-08 Thread Sam Tobin-Hochstadt
On Sat, Dec 7, 2019 at 11:03 AM Dominik Pantůček
 wrote:
>
> Hello Racketeers,
>
> I am continuing my work on cleaning up our private source code and
> publishing it as a part of my futures-sort[1] package. Current state of
> the package is:
>
> - configurable parallelism depth
> - in-place parallel merge-sort of both vector and fxvector
> - parallel merge-sort with results going to a freshly allocated vector
> - support for calling a custom progress reporting function for all variants

Sounds awesome!

> Also I am curious about what is necessary to get the package to a higher
> ring. There will be no backwards-incompatible changes from now.

I don't know why your package is in ring 2, but then again I can't
tell why any particular package has Ring 1 or Ring 2. Maybe Jay can
answer?

Either way, I wouldn't worry about it -- rings are basically an
obsolete part of the pkg system.

Sam

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ9u4EAQcgc08ZC%2BcZLt%2B_VQ8Cg9G2R3CFdedU0WaF-MQ%40mail.gmail.com.


Re: [racket-users] Scribble output without navigation

2019-12-06 Thread Sam Tobin-Hochstadt
Is there a reason that not showing it is a problem, relative to not
having it in the HTML? The CSS approach is quite easy.

Sam

On Fri, Dec 6, 2019 at 5:18 AM 'Reuben Thomas' via Racket Users
 wrote:
>
> On Thu, 5 Dec 2019 at 14:47, Sam Tobin-Hochstadt  wrote:
>>
>> The usual way I've done this is with some custom CSS to set the
>> navigation to "display: none".
>
>
> Thanks. I would really prefer not to have the navigation apparatus, so I 
> guess post-processing the output is the only thing I can do without some 
> serious work on Scribble itself?
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAOnWdoiLGMFP_V%3Drh0myODK2Z9M%2BQLm6vHNZ4WML3qf_syO5Eg%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ18Bo%2BM68u_JvREXAh5u_Dd-%2BCGth-i0CDP5HJvfmkYw%40mail.gmail.com.


Re: [racket-users] Re: GUI (get-directory)

2019-12-05 Thread Sam Tobin-Hochstadt
First, one thing I would suggest is that you can create pull requests
for anything right from the GitHub UI, although that doesn't let you
test them. Especially for small documentation changes where there's no
chance you're breaking something, I find that to be very effective and
lightweight.

Second, here's how I would go about making a documentation change to
something in the "main" documentation
  - I go to the relevant directory (such as
racket/pkgs/racket-doc/scribblings/reference).
  - I look at the file name of the HTML page I want to change, such as
https://docs.racket-lang.org/reference/envvars.html
  - Edit envvars.scrbl. Sometimes the file name is less easy to find,
such as https://docs.racket-lang.org/reference/Manipulating_Paths.html
Then I use grep (it's in "paths.scrbl", which would be easy to see
from the larger section).
  - Create pull request.

For most other packages, I'd do the following:
  - `raco pkg update --clone the-pkg`
  - cd the-pkg # and then look around for the documentation
  - Other steps as above.

Sam

On Thu, Dec 5, 2019 at 7:56 PM Matt Jadud  wrote:
>
> It feels like much of the information needed to make some of the sign posts 
> for easy contribution are available either 1) automatically available at time 
> of documentation build, or 2) could be added to the info file.
>
> Would someone in the Racket team be able to recommend or suggest some 
> concrete ways the community might approach work that begins addressing the 
> task of making it easier to contribute to docs?
>
> Or, really, anyone with some insight into the tools. Some pointers would help 
> make it easier to contribute productively.
>
> Cheers,
> Matt
>
> On Thu, Dec 5, 2019, 18:29 wanderley.guimar...@gmail.com 
>  wrote:
>>
>> I think your point is totally valid, and I feel that I already saw such 
>> discussion in the mail list.
>>
>> You can simplify the process by searching a piece of the documentation in 
>> github.  For example, I search for a piece of the docs from rackjure (1) 
>> which is the second result in my search.
>>
>>
>> (1) 
>> https://github.com/search?l==macro+automatically+adds+the+parentheses+language%3ARacket=Code
>>
>>
>> On Thu, Dec 5, 2019 at 12:27 PM David Storrs  wrote:
>>>
>>> For the record, my big concern with the documentation is that it's 
>>> extremely hard to contribute to.  I would be delighted to contribute 
>>> documentation if the process was easy, but it's just not.  For a language 
>>> as amazing as Racket and a documentation set as high-quality as Racket's, 
>>> the difficulty of helping with it is surprising.
>>>
>>> tl;dr :  Using literate programming techniques(*) for documentation is a 
>>> bad idea.  So is having random tiny files scattered around instead of one 
>>> single .scrbl file in a location that maps to the URL of the page.
>>>
>>> (*) (i.e., having random tiny files with documentation on one particular 
>>> thing and then automating the process of assembling them)
>>>
>>>
>>> My understanding is that the sequence goes like this:
>>>
>>> 1) Notice a thing you would like to change (a typo fix, add an example, etc)
>>> 1a) Ask on the mailing list how to contribute changes since the Guide / 
>>> Reference / package does not have clear directions built in
>>> 2) Go to Github
>>> 3) Find which racket-related repository is the one that matters for this 
>>> documentation.  The Racket project itself has half a dozen repositories and 
>>> it's not obvious (to me, at least) which one is which.  Things on the 
>>> package server will have a direct link, which helps a lot.
>>> 4) git fork the appropriate repository, git clone it to your local machine
>>> 5) grep -r through the clone to find the document that you want to modify.  
>>> It will not be in a location apparent from the URL of the page you were 
>>> looking at, nor will it be named what that page was named, nor will it 
>>> contain all of the content from that page.  Also, it will be in Scribble, 
>>> which is a DSL that requires non-trivial effort to learn and is non-trivial 
>>> to read.  Still, it produces amazing output so that's probably worth it.  
>>> It's intimidating when you're just getting started, though.
>>> 6a) make your change
>>> 6b) google for how to rebuild scribble documentation
>>> 6c) rebuild (by default this will rebuild all documentation), verify you 
>>> made the change correctly
>>> 7) git commit, git push
>>> 8) go back to github and submit a pull request
>>> 9) (when (eq? (sync pr-msg-ch) 'Accepted) (exit))
>>> 10) make requested changes
>>> 11) git commit, git push, goto 9
>>>
>>> Compare that to what it looks like in, e.g., Perl
>>>
>>> 1) Notice a thing you would like to change (a typo fix, add an example, etc)
>>> 2) got to CPAN and search for the package / tutorial / etc.  clicking on 
>>> the name of the package gets you a listing of all files in the package (cf 
>>> https://metacpan.org/release/ETHER/Moose-2.2012)
>>> 3) click on the 'Package::Name::Contributing' file 

Re: [racket-users] Scribble output without navigation

2019-12-05 Thread Sam Tobin-Hochstadt
The usual way I've done this is with some custom CSS to set the
navigation to "display: none".

Sam

On Wed, Dec 4, 2019 at 5:12 PM 'Reuben Thomas' via Racket Users
 wrote:
>
> How can I get scribble/base to output HTML without the navigation elements? I 
> just want a plain HTML page, similar to the look of the LaTeX output.
>
> I can of course extract the "main" div from the standard output, but that 
> seems to be somewhat shutting the stable door after the horse has bolted.
>
> Grepping the package reveals mentions of "nonavigation" but that seems to be 
> to do with when links are omitted because you can go no further in one 
> direction or another.
>
> --
> https://rrt.sc3d.org
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAOnWdohXeROf75DQmdN75hZ8G_rMieT6-A-%3D8fYisJhptbgjiw%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaA8tp3AqP1APjmTQfVziva83t1YKD-zDzTmzS9sa_DgA%40mail.gmail.com.


Re: [racket-users] type-checking error with immutable vectors in for loop

2019-11-25 Thread Sam Tobin-Hochstadt
This is a situation where the problem is needing more annotations --
if you write:

(for/list : (Listof M)
  ([m : M s])
  m)

it type checks.

Sam

On Mon, Nov 25, 2019 at 3:27 AM bedeke  wrote:
>
> Hello,
>
> the following doesn't typecheck. Is it a bug? Should I avoid 
> Immutable-Vectors?
> #lang typed/racket/base
> ;DrRacket, version 7.5.0.3 [3m].
>
> (require racket/sequence)
>
> (define-type M (Immutable-Vectorof Number))
>
> (define s
>   (in-list (ann (list (vector-immutable 1 2 3)
>   (vector-immutable 2 3 4)
>   (vector-immutable 3 4 5))
> (Listof M
>
> (for/list : (Listof M)
>   ([m s])
>   m)
>
> Kr,
> Bert
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/1b1bc126-61d4-476f-bbfd-2bb7fce20aae%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bbsycv4o77sxq_fRtUNqpfmjPicEFNw8VuxRQCkyxzpOA%40mail.gmail.com.


Re: [racket-users] Newb question....About "How to Design Programs" book

2019-11-24 Thread Sam Tobin-Hochstadt
First, I strongly recommend the second edition, which is what you get
at htdp.org. In that case, you'll do many things differently with
respect to teachpacks, but the ideas will be very similar.

Second, when you choose "Add Teachpack" from the "Language" menu in
DrRacket, you should see three panes. The left one, labeled "HtDP" is
what you want for the edition you've been using, and indeed you want
to choose "convert.rkt".

After you add that teachpack, when you next hit "Run" the top of the
interactions window should list the installed teachpacks, with a line
like:

"Teachpack: convert.rkt"

Do you see that?

Sam

On Sun, Nov 24, 2019 at 10:47 PM Michael Burke  wrote:
>
> Thank you, Sam-
>
> I'm apparently reading a pdf version published in 2002 (Copyright 2001 Third 
> Printing). Of course, it still refers to DrScheme and Scheme. Is there a 
> newer one?
>
> I'm at Exercise 2.2.1, converting Fahrenheit to Celsius. The exercise calls 
> for installing the teachpack "convert.ss" but that isn't in the list of 
> teachpacks I see listed in DrRacket. I tried to install convert.rkt, but I 
> have no idea if it actually installed or not because I didn't get any 
> feedback telling me it was successful. I presumed that I should use the 
> "Beginner" student version of Racket, but that isn't clear either. So, when I 
> go to run my routine I get a "function is not defined" error, and I'm a 
> little confused about what I missed.
>
> Huh! I just checked my version against the online version, and they are NOT 
> the same! I prefer reading PDFs on my Android tablet, but I think I will need 
> to see what happens when I follow the web version.
>
> Thank you for your help,
>
> Mike
>
>
>
> On Sunday, November 24, 2019 at 8:35:18 PM UTC-6, Sam Tobin-Hochstadt wrote:
>>
>> Which edition of the book are you using? And can you point to where in
>> the book you ran into trouble, and what happened? The full book is
>> online, so a link to the section would be very helpful.
>>
>> Sam
>>
>> On Sun, Nov 24, 2019 at 9:28 PM Michael Burke  wrote:
>> >
>> > I'm sure this has been asked and answered, but are their any current 
>> > descriptions of how people are adjusting to the book, "How to Design 
>> > Programs"? I ran into a problem on the first little exercise that required 
>> > me to use a teachpack. Surely someone has a lit of work-around for this?
>> >
>> > Thanks,
>> >
>> > Mike
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/racket-users/d90212d3-b00b-43bb-9102-582df33461fa%40googlegroups.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/eafb1e0d-7f04-4c4e-bf7a-a4cd3faf8eda%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bbx_szKRVkmmy4o3QZPqTVmh-xMpFsmrJ3abx3_dFSMPA%40mail.gmail.com.


Re: [racket-users] Newb question....About "How to Design Programs" book

2019-11-24 Thread Sam Tobin-Hochstadt
Which edition of the book are you using? And can you point to where in
the book you ran into trouble, and what happened? The full book is
online, so a link to the section would be very helpful.

Sam

On Sun, Nov 24, 2019 at 9:28 PM Michael Burke  wrote:
>
> I'm sure this has been asked and answered, but are their any current 
> descriptions of how people are adjusting to the book, "How to Design 
> Programs"? I ran into a problem on the first little exercise that required me 
> to use a teachpack. Surely someone has a lit of work-around for this?
>
> Thanks,
>
> Mike
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/d90212d3-b00b-43bb-9102-582df33461fa%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYzzFd%3D6cGL_Y9U3JK3cjhhWFh7Z5AKNpuWfrGRq0wLoQ%40mail.gmail.com.


Re: [racket-users] polymorphic datastructures in typed/racket

2019-11-18 Thread Sam Tobin-Hochstadt
It is possible to get the contracts of values, (see `value-contract`)
but Typed Racket doesn't know how to do that, and it would be
problematic anyway since the value isn't around until runtime, but TR
runs at compile time.

Sam

On Mon, Nov 18, 2019 at 12:24 PM David Storrs  wrote:
>
>
>
> On Mon, Nov 18, 2019 at 12:23 PM David Storrs  wrote:
>>
>>
>>
>> On Mon, Nov 18, 2019 at 10:09 AM Sam Tobin-Hochstadt  
>> wrote:
>>>
>>>
>>> Third, your version with structs can't work because you can't tell
>>> what type a function expects -- that information is not there at
>>> runtime.
>>
>>
>> If there is a contract assigned to a function, is it possible to get that 
>> function and analyze it?
>
>
> Correction:  Get that *contract* and analyze it.
>
>>
>>>
>>> Sam
>>>
>>> On Wed, Nov 6, 2019 at 2:51 PM bedeke  wrote:
>>> >
>>> > Hello,
>>> >
>>> > I was trying to type some polymorphic classes but I got stuck early on 
>>> > making a polymorphic subclass
>>> >
>>> > #lang typed/racket/base
>>> >
>>> > ;*1*
>>> > (require typed/racket/class)
>>> >
>>> > (define-type (C-class A)(Class [init-field [x A]]))
>>> >
>>> > (define C1%
>>> >  (class object%
>>> >  #:∀ (A)
>>> >  (init-field [x : A])
>>> >  (super-new)))
>>> >
>>> > (define C2%
>>> >  (class (inst C1% A)
>>> >  #:∀ (A)
>>> >  (super-new)))
>>> >
>>> > (new (inst C2% Integer) [x 4])
>>> >
>>> > C1% is recognised as a C-class, but explicitly calling C1% a C-class 
>>> > (omitting the #:forall (A) ) doesn't work
>>> > In the next step I don't seem to find the right way to make C2% a 
>>> > polymorphic subclass of C1%
>>> >
>>> >
>>> >
>>> > Having failed that I went with structures. This I got mostly working, but 
>>> > I would like to have some niceties.
>>> > One was to parameterize a structure, but this lead to a problem of not 
>>> > being able to check some
>>> > types at runtime. I thought I got close, but I stranded on getting fields 
>>> > of structures without knowing the instantiation type
>>> > ;*2*
>>> > (struct (A) S ([f1 : (-> A A A)]
>>> >[f2 : (-> A Boolean : A)]))
>>> >
>>> > (: S-of-type? (-> (-> Any Boolean : A) Any Boolean
>>> >   : #:+ (implies #t (S A))
>>> > #:- (implies #f (! (S A)
>>> > (define (S-of-type? fct A)
>>> >   (and (S? A) (eq? fct (S-f2 A
>>> > ;  ^ how can I acces a field of this polymorfic struct
>>> >
>>> >
>>> >
>>> > And another thing I tried but failed to get working is to sub-type a 
>>> > structure based
>>> > on a narrower type for one of the fields.
>>> > ;*3*
>>> > (struct (A) B ([f1 : (Vectorof A)]
>>> >[f2 : Integer])
>>> >   #:transparent)
>>> >
>>> > (: B1? (All (A) (-> (B A) Boolean)))
>>> > (define (B1? b)(= (B-f2 b) 1))
>>> > (define b (B (vector 3) 1))
>>> > (assert b B1?)
>>> > b
>>> > (define-type B1 B1?)
>>> > ;(define-new-subtype B1 B1?)
>>> > ;(define-type B1 (All (A)(Struct (B (Vectorof A) 1
>>> >
>>> >
>>> > Are any of these things doable? Or are there better ways to tackle this 
>>> > problems?
>>> >
>>> >
>>> > What I got working is in
>>> > https://github.com/bdeket/polynomials/blob/alg-dic-pol/polynomials/math/private/polynomial/poly-struct.rkt
>>> >  (WIP)
>>> >
>>> > Kind regards,
>>> > Bert
>>> >
>>> > --
>>> > 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.
>>> > To view this discussion on the web visit 
>>> > https://groups.google.com/d/msgid/racket-users/3c4bcedd-5677-4972-97a3-04e33ca30816%40googlegroups.com.
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaE1h7tYT4nyRoAgUhVCWCNmJfvJ5V5QTzCcbwv_kvJhA%40mail.gmail.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAE8gKodq4Y_sFnCdTXtOP4OrZxckhajxejOOqwyN3j0wTe7_EQ%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYZNcRtiKhW3U7_HakgzhdZeKhEBA7nFhNz-ejKYNzy7Q%40mail.gmail.com.


[racket-users] Completing Racket's re-licensing process

2019-11-18 Thread Sam Tobin-Hochstadt
With the upcoming Racket 7.5 release, almost all of Racket, including
the core Racket CS binary, the standard library, and the packages
provided with the main distribution, are available under a permissive
license, either the Apache 2.0 License or the MIT License. You can
read the details of the new license here:
   https://github.com/racket/racket/blob/master/LICENSE

This has been a long process, beginning in 2017, and we're grateful to all
the contributors to Racket, including those from very long ago, who
gave permission for the re-licensing. More than 350 contributors to
Racket responded; many of the responses can be seen in here:
  https://github.com/racket/racket/issues/1570.

More information is available in the post on the Racket blog:
   
https://blog.racket-lang.org/2019/11/completing-racket-s-relicensing-effort.html

Thanks particularly to Joel Dueck, Sage Gerard, and Pamela Chestek at the SFC.

Sam, for the Racket core team

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BbsRC32L%3DDyJnJ2DUsUgcHy4XVkQ6-%3DD5va-rd3x5CArA%40mail.gmail.com.


Re: [racket-users] polymorphic datastructures in typed/racket

2019-11-18 Thread Sam Tobin-Hochstadt
A few thoughts on this:

First, polymorphic data structures are certainly supported in Typed
Racket. You might be interested in https://github.com/takikawa/tr-pfds
which is a library of them.

Second, it's not totally clear to me what you're trying to do in your
various code snippets. Here's a working version of your first code
snippet, but since I don't know what you're trying to do I'm not sure
if it works with the larger goals you have:

```
#lang typed/racket/base

;*1*
(require typed/racket/class)

(define-type (C-class A)
  (Class [init-field [x A]]))

(define C1%
  (class object%
#:∀ (A)
(init-field [x : A])
(super-new)))

(: C2% (All (A) (-> (C-class A
(define (C2%)
  (class (inst C1% A)
(super-new)))

(new ((inst C2% Integer)) [x 4])
```

Third, your version with structs can't work because you can't tell
what type a function expects -- that information is not there at
runtime.

Sam

On Wed, Nov 6, 2019 at 2:51 PM bedeke  wrote:
>
> Hello,
>
> I was trying to type some polymorphic classes but I got stuck early on making 
> a polymorphic subclass
>
> #lang typed/racket/base
>
> ;*1*
> (require typed/racket/class)
>
> (define-type (C-class A)(Class [init-field [x A]]))
>
> (define C1%
>  (class object%
>  #:∀ (A)
>  (init-field [x : A])
>  (super-new)))
>
> (define C2%
>  (class (inst C1% A)
>  #:∀ (A)
>  (super-new)))
>
> (new (inst C2% Integer) [x 4])
>
> C1% is recognised as a C-class, but explicitly calling C1% a C-class 
> (omitting the #:forall (A) ) doesn't work
> In the next step I don't seem to find the right way to make C2% a polymorphic 
> subclass of C1%
>
>
>
> Having failed that I went with structures. This I got mostly working, but I 
> would like to have some niceties.
> One was to parameterize a structure, but this lead to a problem of not being 
> able to check some
> types at runtime. I thought I got close, but I stranded on getting fields of 
> structures without knowing the instantiation type
> ;*2*
> (struct (A) S ([f1 : (-> A A A)]
>[f2 : (-> A Boolean : A)]))
>
> (: S-of-type? (-> (-> Any Boolean : A) Any Boolean
>   : #:+ (implies #t (S A))
> #:- (implies #f (! (S A)
> (define (S-of-type? fct A)
>   (and (S? A) (eq? fct (S-f2 A
> ;  ^ how can I acces a field of this polymorfic struct
>
>
>
> And another thing I tried but failed to get working is to sub-type a 
> structure based
> on a narrower type for one of the fields.
> ;*3*
> (struct (A) B ([f1 : (Vectorof A)]
>[f2 : Integer])
>   #:transparent)
>
> (: B1? (All (A) (-> (B A) Boolean)))
> (define (B1? b)(= (B-f2 b) 1))
> (define b (B (vector 3) 1))
> (assert b B1?)
> b
> (define-type B1 B1?)
> ;(define-new-subtype B1 B1?)
> ;(define-type B1 (All (A)(Struct (B (Vectorof A) 1
>
>
> Are any of these things doable? Or are there better ways to tackle this 
> problems?
>
>
> What I got working is in
> https://github.com/bdeket/polynomials/blob/alg-dic-pol/polynomials/math/private/polynomial/poly-struct.rkt
>  (WIP)
>
> Kind regards,
> Bert
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/3c4bcedd-5677-4972-97a3-04e33ca30816%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaE1h7tYT4nyRoAgUhVCWCNmJfvJ5V5QTzCcbwv_kvJhA%40mail.gmail.com.


Re: [racket-users] Re: How to install an updated version of an installation-wide package?

2019-11-07 Thread Sam Tobin-Hochstadt
You don't have to do that, there's just one extra step starting from a
pre-built distribution.

If you want to work on the "slatex" package for some reason, you'd do:

$ raco pkg update --lookup --catalog https://pkgs.racket-lang.org/ slatex
...
$ raco pkg update --clone slatex

And then you have the "slatex" package linked to a clone in the
`slatex/` directory where you ran the second command.

Here's a demo: https://asciinema.org/a/lOASUq2O1AT8JHhGyNJzvOcqE

Sam

On Thu, Nov 7, 2019 at 8:28 PM Alex Harsanyi  wrote:
>
> Hi Matthew,
>
> Thanks for clarifying this.
>
> The question was asked on this list several times in the past, and the 
> suggested approach was always to use `raco pkg update --clone`.  The 
> non-obvious part, at least to me, was that one has to clone and build Racket 
> before starting to work on any package that is shipped with the Racket 
> distribution, even if that package is in a separate repository.
>
> Alex.
>
> On Thursday, November 7, 2019 at 9:37:52 PM UTC+8, Matthew Flatt wrote:
>>
>> It's not technically ok to shadow a package in installation scope with
>> one in user scope, at least not if any package in installation scope
>> depends on the shadowed package. (That's why you have to use `--force`
>> to shadow in `--user` scope.) With that configuration, when the package
>> changes in user scope, then the installation-scope build is not
>> necessarily consistent with the changes. Things might work out anyway;
>> it depends on the nature of the dependency and the changes.
>>
>> The right answer may be a tool that starts with an existing
>> installation and more quickly clone it into another installation in a
>> user's space, and then a user can work on a package and rebuild
>> consistently. The configuration points and general tools to manage
>> packages are all there, but they need to be assembled and made
>> easy-to-use.
>>
>> Meanwhile, the current tools are better set up for starting with a
>> GitHub checkout and building there. In that setting, for example, it's
>> easier to use `raco pkg update --clone` to get started, as described at
>>
>> https://docs.racket-lang.org/racket-build-guide/contribute.html#%28part._pkg-contribute%29
>>
>>
>> Matthew
>>
>> At Tue, 5 Nov 2019 15:48:41 -0800 (PST), Alex Harsanyi wrote:
>> > I wrote some notes about how to do something similar, when I worked on the
>> > plot package:
>> >
>> >
>> > https://alex-hhh.github.io/2018/01/changing-built-in-racket-packages.html
>> >
>> > These instructions will work for the case where Racket is installed
>> > globally and your current user does not have permissions to modify any
>> > files in this global Racket installation.  They might not be the simplest
>> > ones however, as I am not a raco pkg package expert either.
>> >
>> > Hope this helps,
>> > Alex.
>> >
>> > On Wednesday, November 6, 2019 at 2:18:18 AM UTC+8, Reuben Thomas wrote:
>> > >
>> > > I'm trying to make a small improvement to the drracket package, and of
>> > > course I'd like to test it!
>> > >
>> > > I have racket 7.4 installed on my Ubuntu system from the PPA, so of 
>> > > course
>> > > drracket is installed as part of the installation.
>> > >
>> > > After reading the "raco pkg" docs, and searching the mailing list, I 
>> > > can't
>> > > figure out how to make a user installation of the drracket package so I 
>> > > can
>> > > test it. My best attempt so far is something like:
>> > >
>> > > raco pkg install ./drracket
>> > > raco pkg install: package is currently installed in a wider scope
>> > >   package: drracket
>> > >   installed scope: installation
>> > >   given scope: user
>> > >
>> > > Of course, I don't want to overwrite the installation's version of
>> > > drracket, I just want a user installation that takes precedence.
>> > >
>> > > I'm a total newbie with raco, so sorry if I've overlooked something
>> > > obvious.
>> > >
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/racket-users/3635bd1f-ccde-41eb-b9d4-05cc6c36
>> > 777b%40googlegroups.com.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/162bbd09-ed9e-4a33-853d-142e170cfc69%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 

Re: [racket-users] Typed Racket needs annotation to realize (Mutable-HashTable Symbol Symbol) is of a more general type

2019-11-05 Thread Sam Tobin-Hochstadt
The problem is that the `DB` type is _not_ a super-type of
`(Mutable-HashTable Symbol Symbol)`, because mutable data structures
are two way communications channels. If you used an immutable hash,
that's a one-way communication and you would have the expected result.

However, the change you made fixed the problem because it changes the
type that `make-hash` picks to create the hash table. The argument to
`make-hash` has the type `(Listof (Pairof Symbol Symbol))` which _is_
a sub-type of `(Listof (Pairof DBKey (U DB DBValue)))`.

Sam


On Tue, Nov 5, 2019 at 6:39 AM Marc Kaufmann  wrote:
>
> Hi,
>
> in order to put some discipline on my code (and formalize to myself what I'm 
> passing around), I started using typed racket. I have definitely hit my share 
> of gotchas that make me scratch my head, but I kind of start to understand 
> how things work and adding `(ann this-is ThatType)` annotations.
>
> However, I have the following piece of code:
>
> ```
> (: register-study-session! (-> Number Symbol Void))
> (define (register-study-session! sid study-type)
>   (unless (hash-has-key? (db-table 'studies) sid)
> (hash-set! (db-table 'studies)
>sid
>(make-hash (list (cons 'study-type study-type))
> ```
>
> then I get the following error:
>
> ```
> exploration.rkt:139:4: Type Checker: Polymorphic function `hash-set!' could 
> not be applied to arguments:
> Argument 1:
>   Expected: (HashTable a b)
>   Given:DB
> Argument 2:
>   Expected: a
>   Given:Number
> Argument 3:
>   Expected: b
>   Given:(Mutable-HashTable Symbol Symbol)
> ```
>
> The DB type is as follows:
>
> ```
> (define-type DBKey (U Symbol Number))
> (define-type DBValue (U Symbol Number Boolean Char))
> (define-type DB (HashTable DBKey (U DB DBValue)))
> ```
>
> However when I annotate this with an (ann ...) around the make-hash, it works:
>
> ```
> (: register-study-session! (-> Number Symbol Void))
> (define (register-study-session! sid study-type)
>   (unless (hash-has-key? (db-table 'studies) sid)
> (hash-set! (db-table 'studies)
>sid
>(ann (make-hash (list (cons 'study-type study-type))) DB 
> ;; ONLY THIS LINE CHANGED
> ```
>
> I don't understand why this leads to it passing, since it said that it 
> thought the DB earlier was a mutable hash of type Symbol to Symbol, which I 
> would have thought is of type DB (which is any hashtable). So why does the 
> type checker complain at first - or maybe why does it pass later?
>
> Cheers,
> Marc
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/6b08ac58-5c85-45ad-9fb7-dd367254e015%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bah1376yFXvkXTcOevBiAzCbTgQm%3DY9jPiY3jcVujFEmg%40mail.gmail.com.


[racket-users] Call for Workshop Proposals: ICFP 2020

2019-10-30 Thread 'Sam Tobin-Hochstadt' via users-redirect
CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS
ICFP 2020
 25th ACM SIGPLAN International Conference on Functional Programming


   August 23 - 28, 2020 
   Jersey City, NJ, US
https://icfp19.sigplan.org/

The 25th ACM SIGPLAN International Conference on Functional Programming
will be held in Jersey City, New Jersey on August 23-28, 2020.
ICFP provides a forum for researchers and developers to hear about the 
latest work on the design, implementations, principles, and uses of 
functional programming.

Proposals are invited for workshops (and other co-located events, such
as symposiums) to be affiliated with ICFP 2020 and sponsored by
SIGPLAN. These events should be less formal and more focused than ICFP
itself, include sessions that enable interaction among the attendees,
and foster the exchange of new ideas. The preference is for one-day
events, but other schedules can also be considered.

The workshops are scheduled to occur on August 23rd (the day
before ICFP) and 27-28th of August (the two days after ICFP).

--

Submission details
 Deadline for submission: November 15, 2019
 Notification of acceptance:  December 13, 2019

Prospective organizers of workshops or other co-located events are
invited to submit a completed workshop proposal form in plain text
format to the ICFP 2020 workshop co-chairs
(Jennifer Hackett and Leonidas Lampropoulos) via email to

   icfp-workshops-2...@googlegroups.com

by November 15, 2019. (For proposals of co-located events other than
workshops, please fill in the workshop proposal form and just leave
blank any sections that do not apply.) Please note that this is a firm
deadline.

Organizers will be notified if their event proposal is accepted by
December 13, 2019, and if successful, depending on the event, they
will be asked to produce a final report after the event has taken
place that is suitable for publication in SIGPLAN Notices.

The proposal form is available at:

http://www.icfpconference.org/icfp2020-files/icfp20-workshops-form.txt

Further information about SIGPLAN sponsorship is available at:

http://www.sigplan.org/Resources/Proposals/Sponsored/

--

Selection committee

The proposals will be evaluated by a committee comprising the
following members of the ICFP 2020 organizing committee, together with
the members of the SIGPLAN executive committee.

 Workshop Co-Chair: Jennifer Hackett(University of Nottingham)
 Workshop Co-Chair: Leonidas Lampropoulos (University of Maryland)
 General Chair: Stephanie Weirich (University of Pennsylvania)
 Program Chair: Adam Chlipala(MIT)


--

Further information

Any queries should be addressed to the workshop co-chairs (Jennifer
Hackett and Leonidas Lampropoulos), via email to
icfp-workshops-2...@googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5db994ee9af9d_2a3d2af7799bc5bc4592%40homer.mail.


Re: [racket-users] Does match against list traverse the whole list?

2019-10-29 Thread Sam Tobin-Hochstadt
Here are some quick numbers on the traditional Racket VM:

```
> (define v (build-list 1000 values))
> (time (list? v))
cpu time: 47 real time: 47 gc time: 0
#t
> (time (list? v))
cpu time: 31 real time: 31 gc time: 0
#t
> (time (list? v))
cpu time: 13 real time: 13 gc time: 0
#t
> (time (list? v))
cpu time: 15 real time: 16 gc time: 0
#t
> (time (list? v))
cpu time: 4 real time: 4 gc time: 0
#t
> (time (list? v))
cpu time: 1 real time: 1 gc time: 0
#t
> (time (list? v))
cpu time: 2 real time: 2 gc time: 0
#t
> (time (list? v))
cpu time: 1 real time: 1 gc time: 0
#t
> (time (list? v))
cpu time: 1 real time: 0 gc time: 0
#t
> (time (list? v))
cpu time: 1 real time: 0 gc time: 0
#t
> (time (list? v))
cpu time: 1 real time: 0 gc time: 0
#t
> (define v2 (drop v (/ 1000 2) ))
> (time (list? v2))
cpu time: 0 real time: 0 gc time: 0
#t
```
Here's some RacketCS numbers, which are a little different:

```
[samth@huor:~/.../extra-pkgs/typed-racket/typed-racket-test (master)
plt] racketcs
Welcome to Racket v7.5.0.4 [cs].
> (define v (build-list 1000 values))
> (time (list? v))
cpu time: 77 real time: 77 gc time: 0
#t
> (time (list? v))
cpu time: 73 real time: 73 gc time: 0
#t
> (time (list? v))
cpu time: 53 real time: 53 gc time: 0
#t
> (time (list? v))
cpu time: 37 real time: 37 gc time: 0
#t
> (time (list? v))
cpu time: 25 real time: 25 gc time: 0
#t
> (time (list? v))
cpu time: 12 real time: 13 gc time: 0
#t
> (time (list? v))
cpu time: 2 real time: 2 gc time: 0
#t
> (time (list? v))
cpu time: 3 real time: 3 gc time: 0
#t
> (time (list? v))
cpu time: 1 real time: 1 gc time: 0
#t
> (time (list? v))
cpu time: 0 real time: 0 gc time: 0
#t
> (define v2 (drop v (/ 1000 2) ))
> (time (list? v2))
cpu time: 61 real time: 61 gc time: 0
#t
> (time (list? v2))
cpu time: 50 real time: 50 gc time: 0
#t
> (time (list? v2))
cpu time: 15 real time: 15 gc time: 0
#t
> (time (list? v2))
cpu time: 25 real time: 25 gc time: 0
#t
> (time (list? v2))
cpu time: 22 real time: 22 gc time: 0
#t
> (time (list? v2))
cpu time: 3 real time: 3 gc time: 0
#t
> (time (list? v2))
cpu time: 0 real time: 0 gc time: 0
#t
```

If you want to make that match pattern faster, use `cons` or `list-rest`.

Sam

On Tue, Oct 29, 2019 at 2:18 PM Alexis King  wrote:
>
> > On Oct 29, 2019, at 12:41, Christopher Lemmer Webber 
> >  wrote:
> >
> > But the documentation says that the `list?` predicate is O(n).
>
> I’m not sure where you’re seeing that, but the documentation actually says 
> just the opposite. Specifically, it says this:
>
> > This procedure effectively takes constant time due to internal caching (so 
> > that any necessary traversals of pairs can in principle count as an extra 
> > cost of allocating the pairs).
>
> In other words, `list?` is amortized constant time.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/4E904F54-3605-4964-AC19-EB6617A5D9F7%40gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZsYFDbK3A8z74A0vd4bMcakDgSYUtXQvKhPm18SNHicg%40mail.gmail.com.


Re: [racket-users] Scribble examples performance

2019-10-19 Thread Sam Tobin-Hochstadt
One thing that's important that we've found improves performance is to
close the evaluator at the end of the module.

Sam

On Sat, Oct 19, 2019, 3:43 AM Jack Firth  wrote:

> The Scribble docs for my Rebellion
>  package take nearly two minutes
> to build. I have a hunch that most of the time is spent compiling,
> evaluating, and rendering example code. Every one of my Scribble modules is
> structured roughly like this:
>
> #lang scribble/manual
>
> (require ...)
>
> (define make-evaluator
>   (... build an evaluator factory using make-base-eval-factory ...))
>
> ...
>
> @defwhatever[...]{
>
>  @(examples
>#:eval (make-evaluator) #:once
>... example code here ...)}
>
> Does this pattern have any performance or memory usage problems? Is there
> more I can do to speed things up? How do I profile Scribble docs? Is it
> normal for `raco setup` to spend much more time building my documentation
> than it spends actually compiling my library's code?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/ecf4481e-601f-4883-92bd-0506b35957c5%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ0R5AyKK8khZgHDdxeANmw1WWAV-S88ipDpYA5FhLT6w%40mail.gmail.com.


Re: [racket-users] function dispatch in typed racket

2019-10-14 Thread Sam Tobin-Hochstadt
Typed Racket won't generate type-dispatching code for you
automatically. However, if you write such code the same way you'd
write it in regular Racket, Typed Racket will be ok with that. For
example,

#lang typed/racket

(: id : (case-> (One One -> Number)
((Immutable-Vectorof One) (Immutable-Vectorof One) ->
(Vectorof Number

(define id (lambda (x y)
 (if (number? x)
 (+ x y)
 (for/vector : (Vectorof Number) ([i x] [j y]) (+ i j)

(id 1 1)
(id #(1 1) #(1 1))

On Mon, Oct 14, 2019 at 9:13 AM Raoul Schorer  wrote:
>
> Hi,
>
> I am trying to write an APL compiler (a typed J implementation) with a typed 
> racket backend. APLs have first-class functions that apply to both scalars 
> and arrays, so there are 2 cases for functions of 2 arguments:
>
> the array -- array case
> the scalar -- scalar case
>
> Scalar -- array and array -- scalar cases get their scalar argument lifted to 
> arrays, and are therefore equivalent to the array -- array case.
> Now, with an interpreter if I assign a function to an identifier, it can use 
> just textual replacement to evaluate the function glyph in the runtime 
> context (that's the way J does it). For example:
>
> id =: +  ;;assign the 'add' function to 'id'
>
> 1 id 1   ;;evaluate to '2' using the scalar context on replacement with 
> '+'
>
> 1 1 id 1 1;;evaluates to '2 2' using the array context on replacement 
> with '+'
>
>
> But at compile-time I can't use that trick, can I? So I end up with something 
> like:
> #lang typed/racket
>
> (define id (case-lambda
>  [([x : One] [y : One]) (+ y)]
>  [([x : (Immutable-Vectorof One)] [y : (Immutable-Vectorof One)]) 
> (for/vector ([i x] [j y]) (+ i j))]))
>
> (id 1 1)
> (id #(1 1) #(1 1))
>
> Which fails although the case-lambda is actually legal typed racket, because 
> the second clause is considered dead code and one cannot dispatch on type.
> In my (hobbyist) understanding, the solution seems to require multiple 
> dispatch? Or is there another way to do that in typed racket?
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/63e5ec59-23f1-4fc7-8045-beb32409bbca%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYYYSUfnE2VVw-bhE45FZXpjNpJFTeXrJvfFOUMAumRNQ%40mail.gmail.com.


Re: [racket-users] Re: Structured Concurrency in Racket

2019-10-09 Thread Sam Tobin-Hochstadt
The Racket community, and even more so the design of Racket
concurrency APIs, is very strongly influenced by the academic side of
Racket. As far as I can tell, structured concurrency is fairly close
to what is traditionally called the fork/join model. Concurrency in
Racket is usually structured in a somewhat different way, around
first-class events and channels. First-class events were originally
created in Concurrent ML, and the basic idea is that you can package
up things that you might think of as concurrency operations (such as
`select` in Go) and turn them into _values_ which you can then further
synchronize on.

Here's how I would write the Happy Eyeballs program in Racket:

#lang racket/base

(define DELAY 300)
(require racket/tcp racket/match racket/set)

(define threads (mutable-set))

(define (connect hosts)
  (let loop ([hosts hosts] [chans null])
  (cond [(null? hosts)
 #f]
[else
 (define ch (make-channel))
 (define t (thread (lambda ()
 (with-handlers ([exn:fail? (λ _
(channel-put ch #f))])
   (define-values (in out) (tcp-connect
(car hosts) 80))
   (channel-put ch (cons in out))
 (set-add! threads t)
 (match (apply sync (alarm-evt (+ (current-milliseconds)
DELAY)) ch chans)
   [(cons in out) ;; success
(for ([t threads]) (kill-thread t))
(cons in out)]
   [#f ;; error
;; thread is dead, don't need to kill it
;; don't need to remember this channel
(loop (cdr hosts) chans)]
   [_ ;; timeout
;; ask the next iteration to sync on this channel too
(loop (cdr hosts) (cons ch chans))])])))

I think that this does the right thing, although it's not actually
using IP addresses and the IP-level operations, but hostnames and TCP
sockets.

One other thing I would note. This is simple, but even simpler would
be to package up `tcp-connect` as an event, the way `tcp-accept-evt`
works. Then you could write something like:

(apply sync (for/list ([(i h) hosts]) (replace-evt (alarm-evt (+
(current-milliseconds) (* DELAY i)))

(lambda _ (tcp-connect-evt h 80)

Sam

On Wed, Oct 9, 2019 at 1:43 PM jab  wrote:
>
> So far from this thread, it seems the idea of Structured Concurrency hasn’t 
> yet made it into the Racket world. I’ll be interested to see if it gets 
> adopted in Racket in the future (or at least better understood) as its 
> adoption grows elsewhere.
>
> In the meantime, in case it helps illustrate the idea to anyone else still 
> interested, check out the talk I linked to previously showing an 
> implementation of Happy Eyeballs using structured concurrency. Or just read 
> it directly from the Trio source once you understand what a nursery and a 
> cancel scope are:
> https://github.com/python-trio/trio/blob/master/trio/_highlevel_open_tcp_stream.py
>
> (RFC 6555 Happy Eyeballs is like a Hello World of the problem space that 
> structured concurrency is addressing, so this is an illustrative example.)
>
> If there is some blessed Racket implementation of Happy Eyeballs, it could be 
> useful to compare – for correctness, completeness, obviousness, and elegance.
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/ed325f57-d7e3-47dc-a2e7-76fc0af1ff50%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Baw3vS5k%2BM0qdNdrnazVxbTNkfqWE7-__E1Lx35TsUqjQ%40mail.gmail.com.


Re: [racket-users] Re: Parallel merge-sort leveraging futures

2019-10-08 Thread Sam Tobin-Hochstadt
On Tue, Oct 8, 2019 at 3:44 AM Dominik Pantůček
 wrote:
> Btw, is it necessary to bump the version on pkgd.racket-lang.org in
> order to get it updated? When I `raco install' the package from its
> directory, it works fine now. When I use the github repository using
> plain `raco pkg install futures-sort' it still uses the old version.
> Just removing and re-installing does not change anything.

It re-runs once an hour. You can also ask it to refresh your packages.

>
> >
> > One thing I notice is that it's substantially faster than
> > `vector-sort!` even when run in serial mode on traditional Racket (but
> > not on Racket CS), so perhaps this should be integrated (or there are
> > improvements that we can adopt).
>
> We mostly discussed that with Jens Axel on #racket - main advantage at
> the lowest level is the usage of fixnums for everything. This however
> means that the vector's size to be sorted must be `fixnum?'. Which I
> think is always the case on all supported architectures (addressable
> memory and such).

Yes, `vector-length` always produces a fixnum.

> Is there a package for these benchmarks? I created some benchmarks based
> on sorting vectors of varying size from 1 to 2^27 elements. It would be
> really nice to test this on a number of systems to get some empirical
> data here. The GC can sometimes surprise (me, at least). My benchmarks
> used (current-inexact-milliseconds) before and after each run which is
> not something very exact. I'll post some graphs on our company blog on
> Thursday probably.

My code is here: https://gist.github.com/2c84e31f602b9ad95331a7e29b075294

Sam

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZ11TreXm%3DyqO%3DFKtVej0RmKMgdJMNWE7MZURuDrNjE9Q%40mail.gmail.com.


Re: [racket-users] Re: Parallel merge-sort leveraging futures

2019-10-07 Thread Sam Tobin-Hochstadt
I've submitted a pull request fixing those errors and supporting
running in serial mode.

One thing I notice is that it's substantially faster than
`vector-sort!` even when run in serial mode on traditional Racket (but
not on Racket CS), so perhaps this should be integrated (or there are
improvements that we can adopt).

Alex, just to clarify a couple things about futures: they block when
performing operations that are either sensitive to the current
continuation or need single-threaded access to the runtime. Vector
operations, as you see in Dominik's code, are not in this category.
Mutable hash table operations are blocking. Here's some numbers with
performance on sorting a vector with random fixnums using this package
on a 4 core machine with hyperthreading, "classic" is `vector-sort!`.
Note that the futures-sort library creates 2^k futures.

k: 0
cpu time: 3402 real time: 3399 gc time: 45
k: 1
cpu time: 3487 real time: 1834 gc time: 46
k: 2
cpu time: 3581 real time: 1097 gc time: 69
k: 4
cpu time: 5745 real time: 1014 gc time: 69
k: 8
cpu time: 5742 real time: 992 gc time: 45
k: 16
cpu time: 8111 real time: 2189 gc time: 279
'classic
cpu time: 4390 real time: 4388 gc time: 98

Here are similar numbers for Racket CS:

k: 0
cpu time: 2960 real time: 2960 gc time: 33
k: 1
cpu time: 3021 real time: 1594 gc time: 33
k: 2
cpu time: 3462 real time: 1154 gc time: 36
k: 4
cpu time: 4381 real time: 929 gc time: 36
k: 8
cpu time: 4406 real time: 889 gc time: 34
k: 16
cpu time: 7124 real time: 1655 gc time: 440
'classic
cpu time: 2749 real time: 2749 gc time: 51

On Mon, Oct 7, 2019 at 8:17 PM Alex Harsanyi  wrote:
>
> Hi Dominik,
>
> I tried to use your package and you are missing a dependency for the 
> `scribble-math` package in your info.rkt file, this has to be installed 
> separately otherwise your package won't install.
>
> However, I tried to use the `vector-futures-sort!` function and got an error:
>
> > (vector-futures-sort! #(3 1 7 6 4) <)
> . . vector-futures-sort!: broke its own contract
>   promised: vector?
>   produced: #
>   in: the res result of
>   (->i
>((unsorted vector?))
>((compare procedure?))
>(res vector?))
>   contract from: /futures-sort/main.rkt
>   blaming: /futures-sort/main.rkt
>(assuming the contract is correct)
>   at: /futures-sort/main.rkt:40.2
> >
>
> I would also be interested to know what performance gains did you get by using
> futures.  I experimented with futures a few years ago and noticed that they
> will block when accessing shared data structures.  My understanding is that
> all the futures will wait for each other while trying to access and set
> elements in the vector and this the execution will be mostly serial with no
> performance gains.  I am curious if anything has changed with regards to this
> in the last few years.
>
> Alex.
>
> On Monday, October 7, 2019 at 9:01:25 PM UTC+8, Dominik Pantůček wrote:
>>
>> Hello,
>>
>> over the course of past few months I have been tasked with solving a
>> (real-world) problem of sorting the sums of all possible combinations of
>> numbers. Some boring accounting stuff revolving around invoices. As the
>> total number of combinations is 2^N where N is the number of source
>> numbers, this task got "interesting" once there were more than 24
>> numbers - that is on my laptop with:
>>
>> model name: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
>>
>> 4 cores, 8 hyper-threads and 16GB RAM.
>>
>> Long story short, I had to implement a custom merge-sort for fxvectors
>> and managed to leverage futures for fully parallel execution. Now in
>> some spare time, I slightly polished the code and released it as
>> "futures-sort" package.
>>
>> The source code is available on GitHub[1] and it is already in Racket
>> package index[2].
>>
>> The package provides four sorting functions - two for vector? and two
>> for fxvector?. There are two variants of each, one with progress
>> reporting and one without. For the original task I needed to show
>> progress using racket/gui gauge% and it might be helpful for others
>> (it's just a callback that gets current and total number of merges
>> performed regularly).
>>
>> I would really appreciate any feedback regarding the naming conventions,
>> code style and generally anything else.
>>
>> Yes, the tests are not there (yet).
>>
>> The same algorithm without futures runs on par with Racket's default
>> sorting routines (tested for sets upto 2^30 - only 16G of memory here)
>> and for fixnums it is even (very slightly but consistently) faster than
>> vector-sort alone. With parallelism using futures it runs roughly N
>> times faster where N is the number reported by (processor-count).
>>
>> I have already some benchmark results available and once I get more data
>> I am more than happy to share it as well.
>>
>> The parallelism is configurable as parameter.
>>
>> And yes, all of this can be seen in the documentation which is included
>> but I still have to look into 

Re: [racket-users] Mysterious issue with pict/code

2019-10-05 Thread Sam Tobin-Hochstadt
This definitely seems like a bug. Here's a smaller program that shows it:

#lang racket
(begin-for-syntax
  (dynamic-require 'pict/code #f))

Sam

On Sat, Oct 5, 2019 at 12:56 PM Stephen Foster  wrote:
>
> I spent a few hours tracking down a mysterious bug.  Although I've fixed it, 
> I still don't understand it. I would appreciate some insight from those who 
> understand these things better.
>
> Here's the simple reproduction:
>
> main.rkt:
>
> #lang racket
>
> (define-syntax (test stx)
>
>   (dynamic-require "./other.rkt" #f)
>
>   #'(displayln "HI"))
>
> ;This is fine
> (dynamic-require "./other.rkt" #f)
>
> ;This triggers the error
> (test)
>
>
> And other.rkt is simply:
>
> #lang racket
>
> (require pict/code)
>
> The error when running main.rkt is:
>
> no module instance found: # v7.4/collects/racket/private/list.rkt"> 0
>
>
>   context...:
>
>
>namespace->module-namespace82
>
>
>copy-namespace-value
>
>
>temp250
>
>
>for-loop
>
>
>[repeats 1 more time]
>
>
>perform-require!78
>
>
>/Applications/Racket 
> v7.4/share/pkgs/compatibility-lib/mzscheme/private/old-procs.rkt:47:4: 
> make-namespace
>
>
>.../racket/unit.rkt:996:20
>
>
>"/Applications/Racket v7.4/share/pkgs/pict-lib/pict/code.rkt": [running 
> body]
>
>
>temp37_0
>
>
>for-loop
>
>
>run-module-instance!125
>
>
>for-loop
>
>
>[repeats 1 more time]
>
>
>run-module-instance!125
>
>
>apply-transformer-in-context
>
>
>...
>
>
>
>
> It would appear that the dynamic-require of a module that requires pict/code 
> fails inside a macro, but not otherwise.  What's up with that?
>
> --Stephen
>
>
>
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/7acffe39-c491-4da6-b00b-2450e41f5008%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYGMeCVCO_h_NXErf1LQWzNWxmBXWTQNt%3DUt2iyyVv5Yw%40mail.gmail.com.


Re: [racket-users] Current state of racket2 planning?

2019-10-04 Thread Sam Tobin-Hochstadt
Matthew wrote a long email on Wednesday with about the current state,
although the subject was "Rhombus Project Plan" so that may have been why
you missed it.

Sam

On Fri, Oct 4, 2019, 8:42 AM David Storrs  wrote:

> The racket2 discussion dropped off my radar a while ago but I got some
> spoons back and thought I'd check in again. Where should I look to see the
> ongoing discussion / current state?
>
> Sidebar: I read the Honu paper... Is the current plan still "programmer
> writes C-ish code and then, behind the scenes,  Honu-ish enforestation
> expander turns it back into Lisp-ish code so that the engine can run 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAE8gKocEuSA%2B-zbcEtpw09ud6e6MPsN%2B4EP5gx_r-PDN9%2BDPfA%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bax%2BVd5JxSzxVLic9WX1BtBJeMbGQyOm%3DYYoQ_FeA3HTg%40mail.gmail.com.


Re: [racket-users] read-eval-print-loop, #%top-interaction, and define

2019-09-24 Thread Sam Tobin-Hochstadt
It's fine to have `#%top-interaction` around a `define`:

```
Welcome to Racket v7.4.0.10.
> (#%top-interaction . (define x 1))
> x
1
```

My guess is that your `#%top-interaction` is doing something that puts
it in an expression context.

Sam

On Tue, Sep 24, 2019 at 8:34 AM Jesse Alama  wrote:
>
> I'm working on a REPL for a #lang in which one can make definitions. One
> writes
>
>   $x := 5
>
> and this gets parsed into an S-expression like
>
>   (assignment "x" 5)
>
> The #lang is not based on S-expressions, but I believe that that's
> irrelevant (though I may be wrong). Naturally enough, I've set up the
> expander for my #lang so that S-expressions like the previous one get
> elaborated into a plain Racket define:
>
>   (define x 5)
>
> The #lang works in DrRacket, and at the command line, too. The
> difficulty is the REPL, which is based on the same expander but a
> slightly modified reader. The problem shows up when one writes
>
>   > $x := 5
>
> in the REPL. There, I get
>
>   define: not allowed in an expression context
>
> This makes sense to me because what's actually being evaluated in the
> REPL setting is
>
>   (#%top-interaction assignment "a" 1)
>
> The define to which the assignment S-expression elaborates does indeed
> seem to be in an expression context. (Or, at least, it's not toplevel;
> the #%top-interaction makes sure of that.)
>
> Is there any way around this? Not being able to assign values to
> variables in the REPL is a blocker for me. I see a few options on the
> table for this issue:
>
> * Tweak current-eval (used by read-eval-print-loop). Doing this might
>   open the door to bypassing #%top-interaction. What would that look
>   like? Would one just destructure the given form to eval, checking
>   whether it looks like a #%top-interaction, in which case throw it away
>   and hand the rest to the "real" eval?
>
> * Change what assignment means.  Thus, (assignment "a" 5) would no
>   longer expand to (define a 5), but to something else, e.g., a set! or
>   box-set! that modifies an environment that I maintain by hand.
>
> * Roll my own poor man's read-eval-print-loop. Of course, then I'd truly
>   be in the driver's seat, but that option would clearly be a
>   duplication of work the read-eval-print-loop is doing, and I really
>   don't want to do that.
>
> Perhaps I'm missing something here. Any suggestions?
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/7c946ee5-04e7-498f-8236-597d2d5ff39d%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bb4SuxdPo8gsRktVYA8n7RdsJmDR4iuPN7qB%3D7eV0AetQ%40mail.gmail.com.


Re: [racket-users] Is it possible to sell commercial use rights to an open source Racket package?

2019-08-29 Thread Sam Tobin-Hochstadt
Thanks for volunteering! I'll follow-up off-list.

Sam

On Thu, Aug 29, 2019 at 12:14 PM 'Joel Dueck' via Racket Users
 wrote:
>
> On Thursday, August 29, 2019 at 10:45:33 AM UTC-5, Matthew Flatt wrote:
>>
>>
>> A pulse and keyboard is a good start, but the task requires significant
>> initiative to work with the Conservancy to get guidance and make sure
>> things move along. The process may possibly involve contacting
>> individual contributors (again) and helping them figure out who needs
>> to be contacted at their respective institutions, and then making sure
>> that communication actually happens. It's not rocket science, but it's
>> actual work.
>>
>
> Understood. If you or someone can get me up to speed — perhaps some
> email introductions, a list of contributors, a rough indication of the current
> state, I can commit to pushing this cart consistently, say through the end
> of the year. Then we can review and go from there. If anyone else would
> rather do it, or would prefer it be someone else, that’s obviously fine too.
>
> (To clarify, I didn't mean by “pulse and keyboard” to imply anything
> derisive about the work that needs to be done or the people who
> had been doing it. I just wanted to know if any special domain
> expertise was needed or if a prole like me could do it. I'm pretty familiar
> with software licensing issues, but have only been in Racket’s orbit
> for the past few years or so.)
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/a42134cc-888b-48e3-a2b8-c6aef42933bf%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Bb0LTukPzF_hgg2-1s8_Lnj_dOHEzXu_Lo9sPSjnmoQGQ%40mail.gmail.com.


Re: [racket-users] Re: Gracket format

2019-08-28 Thread Sam Tobin-Hochstadt
The "Collapse S-expression" action is what leads to this result -- the
collapsed state is saved in the file using the wxme gracket format.

Sam

On Wed, Aug 28, 2019 at 1:29 PM Mark Bestley  wrote:
>
> Kieron Hardy  writes:
>
> > Hi Mark,
> >
> > How are you starting your program?
> >
>
> Not started it yet. Just using DrRacket and text editor for this issue.
>
> > Are you launching Racket from a command line or launching by e.g. 
> > double-clicking an icon in the Windows window manager?
> >
> Running DrRacket from the GUI. ie the equivalent of open DrRacket.app
>
> > What version of Windows?
> >
>
> MacOS 10.14.6 :)
>
> > Cheers,
> >
> > Kieron
> >
> >> On Aug 28, 2019, at 5:44 AM, Mark Bestley  wrote:
> >>
> >> I am just learning racket using the real of Racket book.
> >>
> >> However I am have problems wil file formats.
> >> My .rkt file has become gracket format but I have no images or any
> >> non ascii/unicode text in it. This messes up version control and use
> >> of other editors.
> >>
> >> How can I force DrRacket not to corrupt the text file? and only change if 
> >> I add images?
> >>
> >> The only odd thing I think I have done that might matter is Collapse 
> >> S-expression.
> >>
> >>
>  --
>  Mark
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/m1d0gpnqpp.fsf%40bestley.co.uk.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BYW8MYOVVr4P4R18BHHU7i5nbROTVeOS2E3%2BrvFD2SRAA%40mail.gmail.com.


Re: [racket-users] The future of current language Racket

2019-08-26 Thread Sam Tobin-Hochstadt
Racket as a project has both a strong commitment to keeping everything
running long into the future and to extensive documentation. `#lang racket`
will continue to be available, working, and will continue to have
documentation.

Sam

On Mon, Aug 26, 2019 at 4:45 AM Arie van Wingerden 
wrote:

> When Racket2 was announced, I got really upset, being afraid that all what
> I like about (the old) Racket would be at stake. Also it was mentioned that
> the docs would be based on Racket2 syntax, which probably would hamper
> using them for old school Racket.
>
> I really think that old school Racket should be saved for the future,
> because it is the Scheme to go for many reasons e.g. superb IDE + debugging
> and many good packages and of course the whole creative eco system.
>
> Question 1:
> Please can you explicitly guarantee that Racket (#lang racket) will be
> available for the future?
>
> Question 2:
> Can you explicitely guarantee that the documentation for #lang racket will
> be available in the future?
>
> Please know that I love DrRacket as a whole and that I am not against
> Racket2 at all. I just like my favorite old Racket language to be available
> forever
>
> Many thx for DrRacket and keep up the good work!
>
> Best wishes.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/db031d63-adc3-4217-aa54-e1a727d61a94%40googlegroups.com
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZDLkAnjJo2wNLBYbw3ap1y64zyxCb6epjXyHvsWi8NXQ%40mail.gmail.com.


  1   2   3   4   5   >