Re: [racket-users] Could Racket be used as a "frontend" for a non-Racket language?

2021-06-07 Thread Stephen Foster
This is one of the main ways I use Racket -- but as a front-end for 
JavaScript, not C#.

On Sunday, June 6, 2021 at 9:47:38 PM UTC-7 Philip McGrath wrote:

> I haven't done much with this personally, but a few pointers in Racket:
>
>- Urlang uses Racket's macro system as a front-end for JavaScript (in 
>the way you discuss with C#, not compiling Racket to JavaScript): 
>https://github.com/soegaard/urlang
>- Alexis King's Hackett is an experimental Haskell-like `#lang`: 
>https://lexi-lambda.github.io/hackett/ While it currently only runs on 
>the Racket runtime system, Alexis' blog post, "Reimplementing Hackett’s 
>type language: expanding to custom core forms in Racket", discusses the 
>possibility of an alternate backend targeting GHC and goes into extremely 
>useful detail about implementation techniques that can help: 
>
> https://lexi-lambda.github.io/blog/2018/04/15/reimplementing-hackett-s-type-language-expanding-to-custom-core-forms-in-racket/
>- The recent paper "Macros for Domain-Specific Languages" (
>https://dl.acm.org/doi/pdf/10.1145/3428297) presents a high-level API 
>for doing many of the things the aforementioned blog post implements by 
>hand. (Alexis is a co-author on the paper.)  The `ee-lib` library provides 
>the API discussed in the paper: 
>https://docs.racket-lang.org/ee-lib/index.html (I have done the 
>by-hand approach to custom core forms, and I'm excited to try the new 
>library.)
>
> -Philip
>
>
> On Sun, Jun 6, 2021 at 11:35 PM Robert Calco  wrote:
>
>> Check out IronScheme ... it 
>> may be just what you're looking for.
>>
>> - Bob
>>
>> On Sun, Jun 6, 2021 at 10:02 PM Ryan Kramer  wrote:
>>
>>> I have no plans to work on this, but I am curious if this has been 
>>> discussed or attempted...
>>>
>>> Motivation: My job has been C# for many years and while C# is very 
>>> appropriate for most of the problems I encounter at work, sometimes a 
>>> problem comes along that makes me want more power. In those situations, I 
>>> think the language I want is "C# except now it's S-expressions and it has 
>>> Racket's macro system."
>>>
>>> And then I wonder if an alternate version of C# could be implemented 
>>> this way:
>>> 1) Create a new grammar for what a fully-expanded C# AST is. This will 
>>> be in terms of Racket syntax objects, just like Racket's definition of a 
>>> Fully Expanded Program.
>>> 2) Write a compiler that generates CIL (the bytecode) given a 
>>> fully-expanded C# AST.
>>> 3) Use Racket's #lang mechanism and macro system to implement the 
>>> surface language.
>>>
>>> Now this new C# could borrow a lot of power from Racket, right? For 
>>> example, I could make all of Racket available during expansion! Even if I 
>>> don't want C#-the-surface-language to have macros at all, why shouldn't I 
>>> keep the Racket-powered backdoor open? As long as you generate a valid C# 
>>> AST, I should be able to compile it for you.
>>>
>>> The #lang mechanism and Scribble are two other nice things that could 
>>> probably be adapted into the new C# if desired.
>>>
>>> I can understand why Microsoft wouldn't do this. But I've seen enough 
>>> hobby languages, and I'm surprised that none of them do this. Reusing a 
>>> backend (like dotnet or the JVM) is common, reusing a "frontend" is 
>>> something I've never seen. Is Racket's macro system too specific to 
>>> Racket's definition of a fully-expanded program? (The little bit I've done 
>>> with local-expand and stop-ids makes me think it would work fine.) Is there 
>>> something else that would make this approach more trouble than it's worth?
>>>
>>> -- 
>>> 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/cc7c1792-ba59-400f-856a-3bb02a6096fbn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> *Bob Calco*
>>
>> bobc...@gmail.com
>> 813-997-3583 <(813)%20997-3583> (work mobile)
>> 813-523-3751 <(813)%20523-3751> (personal mobile)
>>
>> *"But you can catch yourself entertaining habitually certain ideas and 
>> setting others aside; and this, I think, is where our personal destinies 
>> are largely decided." *-- *Alfred North Whitehead*
>>
>> *"And now I see with eye serene the very pulse of the machine." *--* William 
>> Wordsworth*
>>
>> -- 
>> 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 

Re: [racket-users] Polished 3D package for some simulations

2021-04-12 Thread Stephen Foster
Hehe.  Yeah, we were discussing resyntax.

On Mon, Apr 12, 2021, 11:01 AM Dominik Pantůček <
dominik.pantu...@trustica.cz wrote:

> One clicks on your Twitch and the first thing coming from the speakers
> is "Do you remember Jack? Jack Firth?"
>
> Everyone does, of course ;-)
>
> On 12. 04. 21 17:31, Stephen Foster wrote:
> > In the CodeSpells project, we are using Racket + Unreal Engine.  This
> > combo would be my recommendation for doing "3D stuff" and also anything
> > with physics.  As you can see from the first few seconds of this video,
> > we are spawning in Twitch users as 3D physical objects:
> >
> > https://www.youtube.com/watch?v=wq8aau-fHbs
> >
> > On Monday, April 12, 2021 at 4:46:56 AM UTC-7 hen...@topoi.pooq.com
> wrote:
> >
> > On Sun, Apr 11, 2021 at 09:25:48PM -0500, Nathaniel W Griswold wrote:
> > > Thanks all, i’m just going to see if Pict3D works out. I didn’t
> > know about it before. I don’t really need textures for this project
> > as i am starting with just particles moving around and wave
> > superposition.
> >
> > It might work for you then. It didn't for me. And I spent a while
> > trying to
> > figure out how to attach textures, but the internals of Pict3d were
> too
> > much for me. Not enough internal documentation. It was easier to use
> > sgl
> > directly, but I may someday have to go to serious solid modelling.
> >
> > -- hendrik
> >
> > >
> > > Nate
> > >
> > > > On Apr 8, 2021, at 2:59 PM, Hendrik Boom 
> > wrote:
> > > >
> > > > On Thu, Apr 08, 2021 at 11:22:10AM -0700, kamist...@gmail.com
> > wrote:
> > > >> Have you tried out Pict3D [1]?
> > > >
> > > > Two significant flaws with Pict3D:
> > > >
> > > > * It does not have a mechanism for attaching a texture to an
> > object.
> > > >
> > > > * It does not allow one to cut one #D object out of another.
> > > > (such as using a cylinder to drill a round hole in a block of
> wood)
> > > >
> > > > Otherwise it's an impressive peve of work.
> > > >
> > > >> There is also a library from Matthew Flatt that can create 3D
> > Text /
> > > >> extruded pathes: [2]
> > > >>
> > > >> Personally I currently use opengl [3], these bindings support
> > higher opengl
> > > >> versions than the [4]
> > > >> (which only support opengl 1.5 according to its documentation)
> > > >>
> > > >> I can't say exactly up to which opengl version [3] has working
> > bindings,
> > > >> these bindings were automatically generated, but that stopped
> > working at
> > > >> some point.
> > > >> (Apparantly the input that was used for the generation isn't
> > provided for
> > > >> recent opengl versions anymore, so the generator has to be
> > fixed or
> > > >> replaced to work with a different input/description)
> > > >
> > > > Exactly. I've been struggling with this last year, and I sort of
> > gave up.
> > > > I'm thinking of looking at it again.
> > > >
> > > > What happened to the spec is that the entire thing has been
> > recoded from a
> > > > completely ad-hoc formalism to a slightly less ad-hoc XML-based
> > formalism.
> > > > Everything is different. And the new one is somewhat
> > inconsistent about
> > > > the placement of asterisks in the XML phrases that form function
> > prototypes.
> > > >
> > > > I've been using sgl for my own work. I suspect it to be largely
> > > > hand-coded, but it seems to work.
> > > >
> > > > There's also a binding for Vulkan, which I don't think has been
> > used vary
> > > > much, and so may still pose surprises.
> > > >
> > > > https://docs.racket-lang.org/vulkan/index.html
> > <https://docs.racket-lang.org/vulkan/index.html>
> > > >
> > > > I don't know how well any of this works on a Mac, which I gather
> > is going
> > > > its own way for graphic

Re: [racket-users] Polished 3D package for some simulations

2021-04-12 Thread Stephen Foster
In the CodeSpells project, we are using Racket + Unreal Engine.  This combo 
would be my recommendation for doing "3D stuff" and also anything with 
physics.  As you can see from the first few seconds of this video, we are 
spawning in Twitch users as 3D physical objects:

https://www.youtube.com/watch?v=wq8aau-fHbs

On Monday, April 12, 2021 at 4:46:56 AM UTC-7 hen...@topoi.pooq.com wrote:

> On Sun, Apr 11, 2021 at 09:25:48PM -0500, Nathaniel W Griswold wrote:
> > Thanks all, i’m just going to see if Pict3D works out. I didn’t know 
> about it before. I don’t really need textures for this project as i am 
> starting with just particles moving around and wave superposition.
>
> It might work for you then. It didn't for me. And I spent a while trying 
> to 
> figure out how to attach textures, but the internals of Pict3d were too 
> much for me. Not enough internal documentation. It was easier to use sgl 
> directly, but I may someday have to go to serious solid modelling.
>
> -- hendrik
>
> > 
> > Nate
> > 
> > > On Apr 8, 2021, at 2:59 PM, Hendrik Boom  
> wrote:
> > > 
> > > On Thu, Apr 08, 2021 at 11:22:10AM -0700, kamist...@gmail.com wrote:
> > >> Have you tried out Pict3D [1]?
> > > 
> > > Two significant flaws with Pict3D:
> > > 
> > > * It does not have a mechanism for attaching a texture to an object.
> > > 
> > > * It does not allow one to cut one #D object out of another.
> > > (such as using a cylinder to drill a round hole in a block of wood)
> > > 
> > > Otherwise it's an impressive peve of work.
> > > 
> > >> There is also a library from Matthew Flatt that can create 3D Text / 
> > >> extruded pathes: [2]
> > >> 
> > >> Personally I currently use opengl [3], these bindings support higher 
> opengl 
> > >> versions than the [4]
> > >> (which only support opengl 1.5 according to its documentation)
> > >> 
> > >> I can't say exactly up to which opengl version [3] has working 
> bindings, 
> > >> these bindings were automatically generated, but that stopped working 
> at 
> > >> some point.
> > >> (Apparantly the input that was used for the generation isn't provided 
> for 
> > >> recent opengl versions anymore, so the generator has to be fixed or 
> > >> replaced to work with a different input/description)
> > > 
> > > Exactly. I've been struggling with this last year, and I sort of gave 
> up.
> > > I'm thinking of looking at it again.
> > > 
> > > What happened to the spec is that the entire thing has been recoded 
> from a 
> > > completely ad-hoc formalism to a slightly less ad-hoc XML-based 
> formalism.
> > > Everything is different. And the new one is somewhat inconsistent 
> about 
> > > the placement of asterisks in the XML phrases that form function 
> prototypes.
> > > 
> > > I've been using sgl for my own work. I suspect it to be largely 
> > > hand-coded, but it seems to work.
> > > 
> > > There's also a binding for Vulkan, which I don't think has been used 
> vary 
> > > much, and so may still pose surprises.
> > > 
> > > https://docs.racket-lang.org/vulkan/index.html
> > > 
> > > I don't know how well any of this works on a Mac, which I gather is 
> going 
> > > its own way for graphics, perhaps in the cause of incompatibility.
> > > 
> > > -- hendrik
> > > 
> > >> 
> > >> [1] https://docs.racket-lang.org/pict3d/index.html
> > >> [2] https://docs.racket-lang.org/pict3d-die-cut/index.html
> > >> [3] https://docs.racket-lang.org/opengl/index.html
> > >> [4] 
> > >> 
> https://docs.racket-lang.org/sgl/index.html?q=opengl#%28idx._%28gentag._0._%28lib._sgl%2Fscribblings%2Fsgl..scrbl%29%29%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...@googlegroups.com.
> > >> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/67072c79-aac7-40a1-8774-2d684c7476d1n%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...@googlegroups.com.
> > > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20210408195922.zdq5ruhr4ufvqgc4%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/0d79ce2f-433d-4fff-9e06-8025963fb45fn%40googlegroups.com.


Re: [racket-users] Why is get-impure-port* slower than a system call to curl?

2020-09-16 Thread Stephen Foster
Thanks everyone.  We resolved the issue over on the http-easy package:
https://github.com/Bogdanp/racket-http-easy/issues/6

I'll summarize for the curious:

Turns out it's largely a "my system thing": requests to "localhost" are
slow, but 127.0.0.1 are fast.  On Chrome and curl, both were fast, which is
why I assumed the slowdown was in some Racket package.  It's more likely a
DNS issue.  (I have to use an unfamiliar Windows machine for game
development; there's probably something misconfigured about the DNS.)

In any event, my original problem is solved: I can use Racket's packages
and send requests to 127.0.0.1, and the spellcasting experience in
CodeSpells is super-snappy now.

Thanks again, everyone!  And thanks Bogdan -- both for the help, and for
the http-easy package.  :)

On Mon, Sep 14, 2020 at 3:42 PM Sam Phillips  wrote:

> Hi Stephen,
>
> I ran this small benchmark against a remote web server, and was
> definitely getting better response using the http-easy module.
>
> https://gist.github.com/samdphillips/32763ebd0d938678c2972b1dd8ee5778
>
> $ racket -e '(require (submod "http-perf.rkt" curl))'
> cpu time: 768 real time: 35299 gc time: 0
>
> $ racket -e '(require (submod "http-perf.rkt" http-easy))'
> cpu time: 1810 real time: 17316 gc time: 70
>
> On Mon, Sep 14, 2020 at 12:57 PM Stephen Foster 
> wrote:
> >
> > Finally circling back to this issue.  I've disabled debugging in
> DrRacket and also done a test outside of DrRacket.  It's still slow. :(
> >
> > I also tried the newer HTTP client:
> https://docs.racket-lang.org/http-easy/index.html.  Like the others, it
> is also slow.
> >
> > I'll do some more digging.  I'm currently trying to figure out if this
> is a "just me" / "just my system" problem.  So... I'd be grateful if anyone
> who has written code that sends HTTP requests from Racket could chime in
> with: 1) I can confirm that sending HTTP requests from Racket has always
> been fast for me, or 2) I too have noticed Racket HTTP requests are slow.
> >
> > (Note that by "slow", I mean: takes noticeably longer than curl.)
> >
> >
> >
> > On Tue, Jul 7, 2020 at 12:21 PM Jon Zeppieri  wrote:
> >>
> >> Hi Stephen,
> >>
> >> Your video shows you running this code in DrRacket with debugging
> >> enabled. That usually affects performance. Have you made measurements
> >> when running this code outside of DrRacket?
> >>
> >> - Jon
> >>
> >>
> >> On Tue, Jul 7, 2020 at 2:13 PM Stephen Foster 
> wrote:
> >> >
> >> > I'm considering using Racket to remake my 3D game CodeSpells.  I'm
> using http requests to have Unreal Engine and Racket talk to each other.
> >> >
> >> > When I use the http/request library, Racket fires off its GET request
> much slower than if it were to do a system call to curl.  (Same is true if
> I use simple-http, which makes me think the problem might be a deep one.)
> >> >
> >> > Here's a video to demo the issue.  Notice how, with curl, the
> experience is playable, whereas with the Racket function, there's way too
> much time between the spell landing and the effect occurring:
> >> >
> >> > https://youtu.be/jTqUFVlfBFA
> >> >
> >> > Obviously, I'd like to do things in a Rackety way.  But I'm not above
> doing things the silly way.  I'd just be grumpy about it.
> >> >
> >> > Any ideas?
> >> >
> >> >
> >> >
> >> > --
> >> > 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/997693d6-b94a-4f69-85cf-aa475c807b20n%40googlegroups.com
> .
> >
> >
> >
> > --
> >
> >
> > Stephen Foster
> > ThoughtSTEM Co-Founder
> > 318-792-2035
> >
> > --
> > 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/CA%2BzSu2_%2BTKVTe--OZRU_BE_LyofFkA869c-2v%2BRJ76HjDQt4_w%40mail.gmail.com
> .
>


-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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/CA%2BzSu2_1TNmiycyM9L_uTrpAoAQR%3DUX%2BJsm80uOFDNLO%3Du7Y1g%40mail.gmail.com.


Re: [racket-users] Why is get-impure-port* slower than a system call to curl?

2020-09-14 Thread Stephen Foster
Finally circling back to this issue.  I've disabled debugging in DrRacket
and also done a test outside of DrRacket.  It's still slow. :(

I also tried the newer HTTP client:
https://docs.racket-lang.org/http-easy/index.html.  Like the others, it is
also slow.

I'll do some more digging.  I'm currently trying to figure out if this is a
"just me" / "just my system" problem.  So... I'd be grateful if anyone who
has written code that sends HTTP requests from Racket could chime in with:
1) I can confirm that sending HTTP requests from Racket has always been
fast for me, or 2) I too have noticed Racket HTTP requests are slow.

(Note that by "slow", I mean: takes noticeably longer than curl.)



On Tue, Jul 7, 2020 at 12:21 PM Jon Zeppieri  wrote:

> Hi Stephen,
>
> Your video shows you running this code in DrRacket with debugging
> enabled. That usually affects performance. Have you made measurements
> when running this code outside of DrRacket?
>
> - Jon
>
>
> On Tue, Jul 7, 2020 at 2:13 PM Stephen Foster 
> wrote:
> >
> > I'm considering using Racket to remake my 3D game CodeSpells.  I'm using
> http requests to have Unreal Engine and Racket talk to each other.
> >
> > When I use the http/request library, Racket fires off its GET request
> much slower than if it were to do a system call to curl.  (Same is true if
> I use simple-http, which makes me think the problem might be a deep one.)
> >
> > Here's a video to demo the issue.  Notice how, with curl, the experience
> is playable, whereas with the Racket function, there's way too much time
> between the spell landing and the effect occurring:
> >
> > https://youtu.be/jTqUFVlfBFA
> >
> > Obviously, I'd like to do things in a Rackety way.  But I'm not above
> doing things the silly way.  I'd just be grumpy about it.
> >
> > Any ideas?
> >
> >
> >
> > --
> > 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/997693d6-b94a-4f69-85cf-aa475c807b20n%40googlegroups.com
> .
>


-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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/CA%2BzSu2_%2BTKVTe--OZRU_BE_LyofFkA869c-2v%2BRJ76HjDQt4_w%40mail.gmail.com.


[racket-users] Why is get-impure-port* slower than a system call to curl?

2020-07-07 Thread Stephen Foster
I'm considering using Racket to remake my 3D game CodeSpells.  I'm using 
http requests to have Unreal Engine and Racket talk to each other.  

When I use the http/request library, Racket fires off its GET request much 
slower than if it were to do a system call to curl.  (Same is true if I use 
simple-http, which makes me think the problem might be a deep one.)

Here's a video to demo the issue.  Notice how, with curl, the experience is 
playable, whereas with the Racket function, there's way too much time 
between the spell landing and the effect occurring:

https://youtu.be/jTqUFVlfBFA

Obviously, I'd like to do things in a Rackety way.  But I'm not above doing 
things the silly way.  I'd just be grumpy about it.

Any ideas?



-- 
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/997693d6-b94a-4f69-85cf-aa475c807b20n%40googlegroups.com.


[racket-users] Why is get-pure-port* slower than a system call to curl?

2020-07-07 Thread Stephen Foster
Compared to using curl, the Racket function gives me unacceptably slow 
performance in the context of a 3D game I'm making (in which the Racket and 
Unreal Engine runtimes are communicating via HTTP requests).

Below is a video to demonstrate the difference.  Notice that when the spell 
lands, it's fine if I use curl but has major lag when using get-pure-port*. 

https://www.youtube.com/watch?v=jTqUFVlfBFA  

Any idea why one is slower than the other?

P.S. I thought I sent this message yesterday -- but I don't see it now -- 
so maybe I didn't send it.  Sorry it somehow gets double posted though.

P.P.S. Potentially related:  
https://groups.google.com/g/racket-users/c/_G1ubundOzQ/m/h4FZg1AaCgAJ

-- 
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/11c5de76-6e4b-4b3c-95b1-dbdf8c864d8dn%40googlegroups.com.


Re: [racket-users] Sandbox + 2htdp/image

2020-05-28 Thread Stephen Foster
Ooooh, okay.  That explanation helps a lot.  Both of these paths seem
workable.  I'll see what I can do.

Thanks, Robby!

On Thu, May 28, 2020 at 3:17 PM Robby Findler 
wrote:

> Just in case, the general phenomenon happening here is that you've got two
> instantiations of the image library (I believe that mrlib/image-core is the
> essential one that's getting duplicated in this case) so there are two
> different sets of structs for the representation of images and the one
> doesn't recognize the other.
>
> There are two basic approaches, I guess: you could run everything
> image-related inside the sandbox (including, I suppose, turning it into a
> bitmap or svg or something) and then getting it out of the sandbox, or you
> could share the implementation of the image library between the inside and
> outside of the sandbox. The former approach is more secure but maybe less
> convenient; the latter is the other way around.
>
> If you wanted to share the implementation you'd have to set up the sandbox
> not with a fresh namespace, but with a namespace that already has the same
> instantiation of mrlib/image-core as the one you want to use outside the
> sandbox.
>
> Robby
>
>
> On Thu, May 28, 2020 at 5:03 PM Stephen Foster 
> wrote:
>
>> I was using the image? predicate as an arbitrary example of something
>> you might want to do with an image after extracting it from the sandbox.
>> What if I wanted to pass the result along to beside or overlay?
>>
>> In all cases, these functions don't recognize the result as an image:
>>
>> beside: expects an image as first argument, given (object:image% #f #f #f
>> #f 1 0 (object:image-snipclass% #f "((lib \"image-core.ss\" \"mrlib\") (lib
>> \"image-core-wxme.rkt\" \"mrlib\"))" 1) #0=(object:style% (object:color% 0
>> 0 0 1.0 #f) (object:color% 255 255 255 1.0 #f) (object:font% #f 'aligned
>> '#(12...
>>
>> On Tue, May 26, 2020 at 4:58 PM Robby Findler 
>> wrote:
>>
>>> It might be easiest to just use the `image?` predicate from inside the
>>> sandbox. Get it out the same way you got the image itself out.
>>>
>>> Robby
>>>
>>>
>>> On Tue, May 26, 2020 at 6:22 PM Stephen Foster 
>>> wrote:
>>>
>>>> The following returns #f and #t.  How can I get it to return #t and #t?
>>>>
>>>> Context: I want to allow students to run Racket code on my server. But
>>>> when I sandbox their code, I am getting back something that doesn't behave
>>>> like a 2htdp/image object.  I'm not exactly sure what it is.
>>>>
>>>> #lang racket
>>>>
>>>> (require racket/sandbox 2htdp/image)
>>>>
>>>> (sandbox-path-permissions
>>>>   (list
>>>> '(exists
>>>>"/usr/lib/ssl/cert.pem")
>>>> '(exists
>>>>"/usr/lib/ssl/certs")))
>>>>
>>>> (define user-code '(circle 40 'solid 'red))
>>>>
>>>> (define circle1
>>>>   ((make-evaluator 'racket
>>>>`(define f
>>>>   (let ()
>>>> ,user-code))
>>>>#:requires
>>>>'(2htdp/image))
>>>>'f))
>>>>
>>>> (define circle2
>>>>   (circle 40 'solid 'red))
>>>>
>>>> (image? circle1) ;#f but I want it to be #t
>>>> (image? circle2) ;#t
>>>>
>>>>
>>>> If it helps, when I print out the above values with ~a, I get:
>>>>
>>>> "#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse
>>>> 80 80 0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"
>>>>
>>>> "#(struct:object:image% ...)"
>>>>
>>>> --
>>>> 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/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/racket-users/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com?utm_medium=email&utm_s

Re: [racket-users] Sandbox + 2htdp/image

2020-05-28 Thread Stephen Foster
I was using the image? predicate as an arbitrary example of something you
might want to do with an image after extracting it from the sandbox.  What
if I wanted to pass the result along to beside or overlay?

In all cases, these functions don't recognize the result as an image:

beside: expects an image as first argument, given (object:image% #f #f #f
#f 1 0 (object:image-snipclass% #f "((lib \"image-core.ss\" \"mrlib\") (lib
\"image-core-wxme.rkt\" \"mrlib\"))" 1) #0=(object:style% (object:color% 0
0 0 1.0 #f) (object:color% 255 255 255 1.0 #f) (object:font% #f 'aligned
'#(12...

On Tue, May 26, 2020 at 4:58 PM Robby Findler 
wrote:

> It might be easiest to just use the `image?` predicate from inside the
> sandbox. Get it out the same way you got the image itself out.
>
> Robby
>
>
> On Tue, May 26, 2020 at 6:22 PM Stephen Foster 
> wrote:
>
>> The following returns #f and #t.  How can I get it to return #t and #t?
>>
>> Context: I want to allow students to run Racket code on my server. But
>> when I sandbox their code, I am getting back something that doesn't behave
>> like a 2htdp/image object.  I'm not exactly sure what it is.
>>
>> #lang racket
>>
>> (require racket/sandbox 2htdp/image)
>>
>> (sandbox-path-permissions
>>   (list
>> '(exists
>>"/usr/lib/ssl/cert.pem")
>> '(exists
>>"/usr/lib/ssl/certs")))
>>
>> (define user-code '(circle 40 'solid 'red))
>>
>> (define circle1
>>   ((make-evaluator 'racket
>>`(define f
>>   (let ()
>> ,user-code))
>>#:requires
>>'(2htdp/image))
>>'f))
>>
>> (define circle2
>>   (circle 40 'solid 'red))
>>
>> (image? circle1) ;#f but I want it to be #t
>> (image? circle2) ;#t
>>
>>
>> If it helps, when I print out the above values with ~a, I get:
>>
>> "#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse 80
>> 80 0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"
>>
>> "#(struct:object:image% ...)"
>>
>> --
>> 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/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com
>> <https://groups.google.com/d/msgid/racket-users/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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/CA%2BzSu29untSJzX0yuyzbOuCiz_xewsgkXBkYHZVnLeHBkwT1mg%40mail.gmail.com.


[racket-users] Sandbox + 2htdp/image

2020-05-26 Thread Stephen Foster
The following returns #f and #t.  How can I get it to return #t and #t?

Context: I want to allow students to run Racket code on my server. But when 
I sandbox their code, I am getting back something that doesn't behave like 
a 2htdp/image object.  I'm not exactly sure what it is. 

#lang racket

(require racket/sandbox 2htdp/image)

(sandbox-path-permissions
  (list
'(exists
   "/usr/lib/ssl/cert.pem")
'(exists
   "/usr/lib/ssl/certs")))

(define user-code '(circle 40 'solid 'red))

(define circle1
  ((make-evaluator 'racket
   `(define f
  (let ()
,user-code))
   #:requires
   '(2htdp/image))
   'f))

(define circle2
  (circle 40 'solid 'red))

(image? circle1) ;#f but I want it to be #t
(image? circle2) ;#t


If it helps, when I print out the above values with ~a, I get:

"#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse 80 80 
0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"

"#(struct:object:image% ...)"

-- 
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/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com.


Re: [racket-users] cover package?

2020-02-26 Thread Stephen Foster
On further investigation, cover just seems to be broken, older versions
install without errors.  I'll open a ticket on that repo.

On Wed, Feb 26, 2020 at 1:14 PM Stephen Foster 
wrote:

> I have a Dockerized racket app that has (today, I think) started failing
> with errors related to the "cover" package.  I don't use cover -- though I
> assume one of my dependencies does.  Adding "cover" explicitly to my
> info.rkt file doesn't fix the issue.
>
> What might be going wrong here?  And how can I track down what depends on
> this?
>
> open-input-file: cannot open module file
>   module path: cover
>   path: /root/.racket/7.5/pkgs/cover/main.rkt
>   system error: no such file or directory; rktio_err=3
>   compilation context...:
>/root/.racket/7.5/pkgs/cover/cover-lib/cover/raco.rkt
>   context...:
>maybe-raise-missing-module
>default-load-handler
>standard-module-name-resolver
>module-path-index-resolve
>perform-require!78
>for-loop
>finish
>[repeats 10 more times]
>pass-1-and-2-loop
>module-begin-k
>expand-module16
>expand-capturing-lifts
>temp118_0
>temp91_0
>compile15
>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0:
> compile-zo*66
>...
>
>
> standard-module-name-resolver: collection not found
>   for module path: cover/private/shared
>   collection: "cover/private"
>   in collection directories:
>/root/.racket/7.5/collects
>/usr/share/racket/collects
>... [217 additional linked and package directories]
>sub-collection: "private"
>   in parent directories:
>/root/.racket/7.5/pkgs/cover
>   compilation context...:
>/root/.racket/7.5/pkgs/cover/cover-test/format-utils.rkt
>   context...:
>show-collection-err
>standard-module-name-resolver
>module-path-index-resolve
>perform-require!78
>for-loop
>finish
>[repeats 13 more times]
>pass-1-and-2-loop
>module-begin-k
>expand-module16
>expand-capturing-lifts
>temp118_0
>temp91_0
>compile15
>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0:
> compile-zo*66
>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:731:15
>...
>
>
> standard-module-name-resolver: collection not found
>   for module path: cover/private/shared
>   collection: "cover/private"
>   in collection directories:
>/root/.racket/7.5/collects
>/usr/share/racket/collects
>... [217 additional linked and package directories]
>sub-collection: "private"
>   in parent directories:
>/root/.racket/7.5/pkgs/cover
>   compilation context...:
>/root/.racket/7.5/pkgs/cover/cover-test/format-utils.rkt
>   context...:
>show-collection-err
>standard-module-name-resolver
>module-path-index-resolve
>perform-require!78
>for-loop
>finish
>[repeats 13 more times]
>pass-1-and-2-loop
>module-begin-k
>expand-module16
>expand-capturing-lifts
>temp118_0
>temp91_0
>compile15
>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0:
> compile-zo*66
>/usr/share/racket/collects/compiler/private/cm-minimal.rkt:731:15
>...
>
>
> etc.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/X7O4bUAnqxU/unsubscribe.
> To unsubscribe from this group and all its topics, 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/5b09c421-621c-4485-91eb-81a2ab6249d4%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/5b09c421-621c-4485-91eb-81a2ab6249d4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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/CA%2BzSu29hL3BOa7Ez-Om29RNr9B-E19M%3Dr1TX3KV-MMB8AL%3DV%2Bg%40mail.gmail.com.


[racket-users] cover package?

2020-02-26 Thread Stephen Foster
I have a Dockerized racket app that has (today, I think) started failing 
with errors related to the "cover" package.  I don't use cover -- though I 
assume one of my dependencies does.  Adding "cover" explicitly to my 
info.rkt file doesn't fix the issue.  

What might be going wrong here?  And how can I track down what depends on 
this?  

open-input-file: cannot open module file
  module path: cover
  path: /root/.racket/7.5/pkgs/cover/main.rkt
  system error: no such file or directory; rktio_err=3
  compilation context...:
   /root/.racket/7.5/pkgs/cover/cover-lib/cover/raco.rkt
  context...:
   maybe-raise-missing-module
   default-load-handler
   standard-module-name-resolver
   module-path-index-resolve
   perform-require!78
   for-loop
   finish
   [repeats 10 more times]
   pass-1-and-2-loop
   module-begin-k
   expand-module16
   expand-capturing-lifts
   temp118_0
   temp91_0
   compile15
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0: 
compile-zo*66
   ...


standard-module-name-resolver: collection not found
  for module path: cover/private/shared
  collection: "cover/private"
  in collection directories:
   /root/.racket/7.5/collects
   /usr/share/racket/collects
   ... [217 additional linked and package directories]
   sub-collection: "private"
  in parent directories:
   /root/.racket/7.5/pkgs/cover
  compilation context...:
   /root/.racket/7.5/pkgs/cover/cover-test/format-utils.rkt
  context...:
   show-collection-err
   standard-module-name-resolver
   module-path-index-resolve
   perform-require!78
   for-loop
   finish
   [repeats 13 more times]
   pass-1-and-2-loop
   module-begin-k
   expand-module16
   expand-capturing-lifts
   temp118_0
   temp91_0
   compile15
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0: 
compile-zo*66
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:731:15
   ...


standard-module-name-resolver: collection not found
  for module path: cover/private/shared
  collection: "cover/private"
  in collection directories:
   /root/.racket/7.5/collects
   /usr/share/racket/collects
   ... [217 additional linked and package directories]
   sub-collection: "private"
  in parent directories:
   /root/.racket/7.5/pkgs/cover
  compilation context...:
   /root/.racket/7.5/pkgs/cover/cover-test/format-utils.rkt
  context...:
   show-collection-err
   standard-module-name-resolver
   module-path-index-resolve
   perform-require!78
   for-loop
   finish
   [repeats 13 more times]
   pass-1-and-2-loop
   module-begin-k
   expand-module16
   expand-capturing-lifts
   temp118_0
   temp91_0
   compile15
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:428:0: 
compile-zo*66
   /usr/share/racket/collects/compiler/private/cm-minimal.rkt:731:15
   ...


etc.

-- 
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/5b09c421-621c-4485-91eb-81a2ab6249d4%40googlegroups.com.


[racket-users] My bug or Racket's? Macro + srcdoc = confusion

2020-01-23 Thread Stephen Foster
I ran into a series of confusing Racket things today.  Although I've fixed 
my code, I'm looking for insight.  Clearly there are things I don't 
understand about scribble/srcdoc, and maybe macros in general.

I have a macro called define/contract/doc.  It lets me do things like this:

(define/contract/doc (test #:number [number 75.2])

  (->i ()

   (#:number [number number?])

   [returns any/c])


  @{Returns what you pass in for #:number.  Defaults to 75.2}


  number)


It has worked fine for almost a year.  But today, I discovered that when I 
define a function with a default parameter value that happens to include a 
decimal number (i.e. 75.2 above), I get a cryptic error when requiring in 
the srcdoc submodule.

I'll post the macro definition in a moment, but first let me mention that 
on the Windows machine where my co-worker first discovered this bug, the 
error was presented without a stacktrace.  This was it:

-: contract violation

  expected: number?

  given: #f

  argument position: 1st

  other arguments...:

   2

  context...:

*Puzzle #1.  *I don't usually develop on Windows, so can someone tell me if 
there's something special I'm supposed to do to get more context to print 
out?  Note: Even in the Racket REPL, I couldn't get a backtrace.  Using 
errortrace changed nothing.  I'm on Racket 7.4, btw.

It was only after poking, prodding, and simplifying for an hour that we 
extracted a minimal reproduction of the bug and figured out that the 
decimal number was causing the problem.  The lack of stacktrace led to a 
lot of guesswork.

I would have been at a loss, but I happened to switch to my Mac, where 
(luckily!) the error printed with a better stacktrace:

-: contract violation

  expected: number?

  given: #f

  argument position: 1st

  other arguments...:

   2

  context...:

   /Applications/Racket 
v7.4/share/pkgs/scribble-lib/scribble/racket.rkt:227:2: typeset-atom

   /Applications/Racket 
v7.4/share/pkgs/scribble-lib/scribble/racket.rkt:471:8

   /Applications/Racket 
v7.4/share/pkgs/scribble-lib/scribble/racket.rkt:322:2: gen-typeset

   /Applications/Racket 
v7.4/share/pkgs/scribble-lib/scribble/private/manual-proc.rkt:549:6

   /Applications/Racket v7.4/collects/racket/private/map.rkt:259:4: loop

   /Applications/Racket v7.4/collects/racket/list.rkt:586:2: append-map

   /Applications/Racket 
v7.4/share/pkgs/scribble-lib/scribble/private/manual-proc.rkt:316:2: do-one

   /Applications/Racket v7.4/collects/racket/private/map.rkt:259:4: loop

   /Applications/Racket v7.4/collects/racket/list.rkt:586:2: append-map

   /Applications/Racket 
v7.4/share/pkgs/scribble-lib/scribble/private/manual-proc.rkt:212:0: 
*defproc13

   (submod "/Users/thoughtstem/Dev/test/test.rkt" srcdoc): [running body]

   temp37_0

   for-loop

   run-module-instance!125

   perform-require!78

   for-loop

   ...

This informed me that the problem was related to typeset-atom, which in 
turn helped me to make slightly more educated guesses about how to fix the 
problem.

*Puzzle #2*.  If you save the snippet below into a file called test.rkt, you 
can reproduce the error and/or my fixes with something like racket -e 
"(require (submod \"./test.rkt\" srcdoc))".  Why does the datum->syntax fix 
the problem?  After skimming the srcdoc code, I suspect some line-number 
information needs to be present on the syntax being typeset  Why this 
only matters for numbers with decimals is still a mystery.

#lang at-exp racket


(require (for-syntax syntax/parse))


(define-syntax (define/contract/doc stx)

  (define defaults 

'(75) ;Works

#;

'(75.2) ;Breaks


#;

(datum->syntax stx '(75.2) stx) ;Works, and is essentially the way we 
fixed it.


#;

(datum->syntax stx '(75.2)) ;Breaks, and is roughly what we had in 
production -- without the hardcoded 75.2, obviously.

)


  (define ret

(syntax-parse stx

  ([_ (f-name args ... ) contract doc body ...]

   #`(begin

   (require scribble/srcdoc)

   (provide (proc-doc

  f-name

  contract

  #,defaults 

  doc)) 

   (define (f-name args ...)

 body ...)


  ret)


(define/contract/doc (test #:number [number 75.2])

  (->i ()

   (#:number [number number?])

   [returns any/c])


  @{Returns what you pass in for #:number.  Defaults to 75.2}


  number)


*Puzzle #3*.  What's the appropriate code to "blame" here?  Is this some 
kind of noob mistake on my part (i.e. advanced Racket macrologists would 
have known to use datum->syntax appropriately and never would have run into 
the problem in the first place)?  Is this a bug in srcdoc?  Is it both?

*(Bonus) **Puzzle #4.*  How would you have debugged this?  Was there 
anything I could have done to localize the problem more quickly? 



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" g

Re: [racket-users] Web server + authentication

2020-01-23 Thread Stephen Foster
Philip -- My general thinking is: the more Racket examples in the world, 
the better.  I'd certainly be interested to see how you used continuations 
to do your one-time-use links.

Bogdan --  Lack of examples is also my main blocker when it comes to Koyo.  
The API docs are good, but I'm one of those developers who needs to see 
examples either in the docs or in a repo somewhere.  I ended up rolling my 
own session management system yesterday instead of using Koyo.  (I'll note, 
however, that I've fully embraced your Deta package because the docs are 
filled with examples.  Great stuff!)


On Wednesday, January 22, 2020 at 5:57:07 PM UTC-8, Philip McGrath wrote:
>
> I configure Postfix to send external mail via Amazon's "Simple Email 
> Service," then use `net/sendmail`. Having a working mail-transfer agent 
> means you can easily send yourself mail from other tools on the system, 
> too, like a cron job to renew the TLS certificates. (I haven't looked at 
> Postmark, so I can't compare.)
>
> As far as managing users generally, the website code for 
> digitalricoeur.org isn't (yet!) public, but I could provide access if it 
> would be useful as an example. We use a passwordless approach based on 
> emailing one-time-use links, which continuations make especially pleasant.
>
> -Philip
>
> On Wed, Jan 22, 2020 at 7:47 PM Matthew Butterick  > wrote:
>
>> I concur on Postmark. For 2+ yrs I've used it with the Racket web server 
>> for mbtype.com. I pass the server settings to `smtp-send-message` from `
>> net/smtp`.
>>
>>
>> On 22 Jan 20, at 3:00 AM, Bogdan Popa > 
>> wrote:
>>
>> I like using Postmark[0] for this.  Their free plan lets you send up to
>> 100 e-mails a month, their paid plans come at a reasonable price and
>> they have helpful docs and validators to help you set up SPF, DMARC and
>> DKIM.
>>
>>
>> -- 
>> 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/9CBD358C-6A8A-4203-A395-61AF69D44C65%40mbtype.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/958d1098-d29e-4dcd-93f6-5e346913954a%40googlegroups.com.


[racket-users] Web server + authentication

2020-01-21 Thread Stephen Foster
Ruby on Rails has a nice package called Devise, which handles things like: 
letting users log into your webapp, letting them reset their passwords, 
etc.  In the Racket ecosystem, I'm struggling even to find examples of 
managing users.

I'm about to start digging here: https://github.com/tonyg/racket-pkg-website

Are there other places I could look?


-- 
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/93a77b99-f238-4315-9f10-0b1aa6929262%40googlegroups.com.


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

2019-10-08 Thread Stephen Foster
Thanks!

On Mon, Oct 7, 2019 at 9:53 AM Matthew Flatt  wrote:

> Yes, that one (combined with the previous commit).
>
> At Mon, 7 Oct 2019 09:23:49 -0700, Stephen Foster wrote:
> > Awesome!  Thanks. :)
> >
> > Just for my own curiosity, is it this commit or a different one?
> >
> >
> https://github.com/racket/racket/commit/9bb5bc935251e25490dec82f824e1d8e9cd202c
> > 9
> >
> >
> >
> > On Sat, Oct 5, 2019 at 6:42 PM Matthew Flatt  wrote:
> >
> > > Thanks for the report and simplification! I've pushed a repair.
> > >
> > > At Sat, 5 Oct 2019 15:33:31 -0400, Sam Tobin-Hochstadt wrote:
> > > > 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 <
> step...@thoughtstem.com>
> > > 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
> > > > >

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

2019-10-07 Thread Stephen Foster
Awesome!  Thanks. :)

Just for my own curiosity, is it this commit or a different one?

https://github.com/racket/racket/commit/9bb5bc935251e25490dec82f824e1d8e9cd202c9



On Sat, Oct 5, 2019 at 6:42 PM Matthew Flatt  wrote:

> Thanks for the report and simplification! I've pushed a repair.
>
> At Sat, 5 Oct 2019 15:33:31 -0400, Sam Tobin-Hochstadt wrote:
> > 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-2450e41f
> > 5008%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_NXErf1LQWz
> > NWxmBXWTQNt%3DUt2iyyVv5Yw%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/ouNaokcNdpo/unsubscribe.
> To unsubscribe from this group and all its topics, 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/5d994668.1c69fb81.28e90.27b3SMTPIN_ADDED_MISSING%40gmr-mx.google.com
> .
>


-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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/CA%2BzSu29PCzOtjZSjHegoJ%3D3KM-%3DCB1mOnvQOCTR-dsvkjzsCpg%40mail.gmail.com.


[racket-users] Mysterious issue with pict/code

2019-10-05 Thread Stephen Foster
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: # 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.


[racket-users] Re: Amazon Mechanical Turk library/package in racket

2019-09-12 Thread Stephen Foster
+1

This has been on my Racket wish-list for a while.  I just haven't had a 
chance to put something together.

But I've done a lot of work with Turk and its APIs in the past, so if 
someone were to start a project, I'd be happy to help out with it...

On Wednesday, September 11, 2019 at 12:32:53 PM UTC-7, Marc Kaufmann wrote:
>
> Hi all,
>
> I was wondering if there is a Racket library that makes it easy to 
> interface with Amazon's Mechanical Turk interface (
> https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/Welcome.html) 
> and if anyone has some code lying around on how to do so? I know that there 
> is the aws package by Greg, but I couldn't figure out if it also makes it 
> easier to do the MTurk stuff or not. Since this involves payments, I don't 
> want to do much experimentation to see if it works.
>
> If not, no worries - I think that I solved it by doing it in R the last 
> time round, which was not too painful. 
>
> 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/b2d99223-b9cf-4707-8c48-9afdae4537ad%40googlegroups.com.


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

2019-08-22 Thread Stephen Foster
By the way, Paulo: I'm happy to help with this (if you want).  I can either
put in some person-hours to get/install the certificate; and/or help
purchase a new one.

On a related note, a meta question for the community: Do we have any
infrastructures in place to help financially support community-driven
initiatives like this newsletter?  For example: certs and hosting costs.
Or does it just come out of individual pockets?



On Wed, Aug 21, 2019 at 11:43 AM Annaia Berry  wrote:

> the SSL cert seems to have expired the other day.
>
> On Wed, Aug 21, 2019 at 8:37 PM Stephen Foster 
> wrote:
>
>> My browser is telling me that the SSL certificate for racket-news.com is
>> invalid.
>> Is it just me?
>>
>> On Monday, August 19, 2019 at 7:54:54 AM UTC-7, Stephen De Gabrielle
>> wrote:
>>>
>>> Thank you Paulo!
>>> Another awesome issue of Racket News.
>>>
>>> S.
>>>
>>>
>>>
>>>
>>> On Fri, Aug 16, 2019 at 9:49 PM Paulo Matos  wrote:
>>>
>>>> Racket News issue 14 is here.
>>>> https://racket-news.com/2019/08/racket-news-issue-14.html
>>>>
>>>> Enjoy!
>>>>
>>>> --
>>>> 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...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/racket-users/05377b52-dc75-09ce-97b6-5c9734bbaec3%40linki.tools
>>>> .
>>>>
>>> --
>> 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/9586f6ed-f0b3-4889-abf7-77e3a436537e%40googlegroups.com
>> <https://groups.google.com/d/msgid/racket-users/9586f6ed-f0b3-4889-abf7-77e3a436537e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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/CA%2BzSu2_mdxK22FYCQYd1k0odBJpM0nS_tSLNxtjmY6qSd0C-qw%40mail.gmail.com.


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

2019-08-21 Thread Stephen Foster
My browser is telling me that the SSL certificate for racket-news.com is 
invalid.
Is it just me?

On Monday, August 19, 2019 at 7:54:54 AM UTC-7, Stephen De Gabrielle wrote:
>
> Thank you Paulo! 
> Another awesome issue of Racket News.
>
> S.
>
>
>  
>
> On Fri, Aug 16, 2019 at 9:49 PM Paulo Matos  wrote:
>
>> Racket News issue 14 is here.
>> https://racket-news.com/2019/08/racket-news-issue-14.html
>>
>> Enjoy!
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/05377b52-dc75-09ce-97b6-5c9734bbaec3%40linki.tools
>> .
>>
>

-- 
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/9586f6ed-f0b3-4889-abf7-77e3a436537e%40googlegroups.com.


[racket-users] Re: on-boarding new racketeers

2019-08-13 Thread Stephen Foster
+1

Thanks for thinking about this.  I'll start moving some of my repos in this 
direction.

On Monday, August 12, 2019 at 7:52:37 AM UTC-7, Stephen De Gabrielle wrote:
>
> Hi,
>
> I've been thinking about small things that can be done to lower the 
> barriers to entry to the racket community, and I've come up with some 
> ideas! 
>
> 1. Adopts the standard GitHub set of issue labels* for all active 
> repositories, only deviating where necessary. 
> Benefit - This would allow potential contributors to easily identify 
> issues by their labels or the GitHub 'contribute link: 
> e.g. https://github.com/standard-fish/summer-competititon-2019/contribute 
> Downside - needs to be done manually through the labels page  
> https://github.com/[owner]/[repository]/labels 
> e.g. https://github.com/standard-fish/summer-competititon-2019/labels
>
> 2. Adopt standard issue templates for 'good first issue', 'documentation' 
> & 'enhancement'
> e.g. I've created some examples at but they are not ready for use in that 
> the are incomplete and/or wrong: 
> https://github.com/standard-fish/summer-competititon-2019/tree/master/.github/ISSUE_TEMPLATE/
>  
>  
> Benefits:
>   a) would allow the quick logging of issues with the correct labels
>   b) would guide contributors to log issues with relevant issues so the 
> respective owners can triage them quickly
> NB as these are files that are easy to add via a pull request - no 'owner 
> only' ui like (1).
>
> 3. if you are a repository owner please apply labels to existing issues 
> (especially 'good first issue') - even if the descriptions are not great. 
>
> 4. if you have a 'good first issue', but don't have time to action it - 
> just log it and leave it. that was it is not forgotten and someone can find 
> it.
>
> 5. Put the location of the scribble source file at the beginning of every 
> scribble file because it is really hard to find the location of scribble 
> source; 
> 'Quick: An Introduction to Racket with Pictures' is in the slideshow repo: 
> https://github.com/racket/slideshow/blob/master/slideshow-doc/scribblings/quick/quick.scrbl
>  
>  it is worse when one scribble file inlines  another.
>
> I think this are small steps will make it easier for new racketeers to get 
> started and existing contributors not to get fatigued.
>
> Please let me know what you think
>
> Kind regards, 
> Stephen
>
>
> ---
>
> * standard GitHub set of issue labels: 
> -   bug - Something isn't working
> -   documentation - Improvements or additions to documentation
> -   duplicate - This issue or pull request already exists
> -   enhancement - New feature or request
> -   good first issue - Good for newcomers
> -   help wanted - Extra attention is needed
> -   invalid - This doesn't seem right
> -   question - Further information is requested
> -   wontfix - This will not be worked on
>
>

-- 
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/52a7c2a2-af65-452f-8dac-01658a20115f%40googlegroups.com.


[racket-users] Re: [standard-fish] Lightsabers!

2019-07-31 Thread Stephen Foster
Wow!  Nice.  I'll show this to the students taking my "Coding for Star Wars 
Fans" summer camp :)

Thanks for doing this!

On Tuesday, July 30, 2019 at 1:06:25 PM UTC-7, Justin Zamora wrote:
>
> Stephen De Gabrielle announced this a few days ago on racket-dev, so I 
> spent my weekend embracing my inner Star Wars nerd and made 
> lightsabers in Racket. I had never used the pict library before, so it 
> was also an interesting learning experience. 
>
> I created a lightsaber function that produces a pict of a lightsaber. 
> The only required argument is a color, which can be either a color 
> name or a color% object. A length can be provided as an optional 
> argument, as well as a style for the lightsaber hilt. The default hilt 
> is Luke Skywalker's (#:style 'luke), but you can also select Darth 
> Vader's (#:style 'vader), Kylo Ren's (#:style 'kylo), or Darth Maul's 
> (#:style 'maul). See the attached picture for examples of each. 
>
> The code is available at https://github.com/zamora/lightsaber 
>
> Thanks to Stephen De Gabrielle for providing the incentive to learn 
> about pict and have some fun! 
>
> Justin 
>

-- 
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/4b919267-db74-492d-a70b-b2fb930329bc%40googlegroups.com.


Re: [racket-users] FFI bug?

2019-05-28 Thread Stephen Foster
Matthew Flatt, thanks for popping in and saving the day.  :)

On Mon, May 27, 2019 at 4:34 PM Stephen Foster 
wrote:

> In putting together the Racket bindings for the latest Chipmunk 7 physics
> engine, I think I may have found a bug in the FFI libs.
>
> I had originally thought it was a problem with Chipmunk, so I posted about
> it over there:
>
> https://github.com/slembcke/Chipmunk2D/issues/183
>
> But as I did more digging, it started to look more like a Racket bug.
> Either that, or I'm using it wrong.  Could someone who knows how these FFI
> things work take a look at the above issue and comment on what might be
> going on?
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/k0Umn7U2NMc/unsubscribe.
> To unsubscribe from this group and all its topics, 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/42bd1f7d-690a-4892-bee3-c3704c93dad9%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/42bd1f7d-690a-4892-bee3-c3704c93dad9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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/CA%2BzSu2-bRW2hh1uO93XtXzb2U-mWn1ooDEtobf4b455HSxggbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] FFI bug?

2019-05-27 Thread Stephen Foster
In putting together the Racket bindings for the latest Chipmunk 7 physics 
engine, I think I may have found a bug in the FFI libs. 

I had originally thought it was a problem with Chipmunk, so I posted about 
it over there:

https://github.com/slembcke/Chipmunk2D/issues/183

But as I did more digging, it started to look more like a Racket bug.  
Either that, or I'm using it wrong.  Could someone who knows how these FFI 
things work take a look at the above issue and comment on what might be 
going on?


-- 
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/42bd1f7d-690a-4892-bee3-c3704c93dad9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Online IDE’s for Racket ?

2019-05-24 Thread Stephen Foster
I came across some old posts on compiling Racket for the web, but I was 
wondering if there was any recent activity on this.  Has anyone ever 
compiled Racket (including DrRacket) for the web -- i.e. with Emscripten?  
(I know about things like Whalesong and RacketScript.  But I don't think 
these are applicable here.)

If not, I was wondering if someone who knows more about these things could 
comment on whether such a thing is worth trying and what the challenges 
might be.  The last posts on this topic seemed like they were from 2012 
(https://lists.racket-lang.org/dev/archive/2012-May/009472.html).  Are 
things the same today?

--Stephen



On Wednesday, May 1, 2019 at 7:03:34 AM UTC-7, Sam Tobin-Hochstadt wrote:
>
> Ooh, that's very cool. 
>
> On Wed, May 1, 2019 at 8:02 AM Annaia Berry  > wrote: 
> > 
> > I set up a Racket web project on Glitch here: 
> https://glitch.com/~rantstack 
> > 
> > With this you can get live reloading and hosting of a Racket web server. 
> > 
> > On Wed, May 1, 2019 at 1:58 PM Laurent  > wrote: 
> >> 
> >> Rollapp looks interesting, but when I want to sign in with my gmail 
> account it requires to get information about all my linked email addresses. 
> That really seems unnecessary to me, so I didn't try it. 
> >> 
> >> On Fri, Apr 26, 2019 at 9:59 PM Stephen De Gabrielle <
> spdega...@gmail.com > wrote: 
> >>> 
> >>> Yes - WeScheme is awesome - and so is 
> >>> http://pasterack.org 
> >>> 
> >>> Suggestion: upvote racket on repl.it so you can run it from 
> everywhere: 
> >>> 
> >>> https://repl.it/language-requests/p/racket 
> >>> 
> >>> (I know it is unlikely to be as good as the full DrRacket or 
> racket-mode experience) 
> >>> 
> >>> 
> >>> S. 
> >>> 
> >>> On Wed, 24 Apr 2019 at 19:58, Stephen Foster  > wrote: 
> >>>> 
> >>>> Wow!  This is is cool. 
> >>>> 
> >>>> Also +1 -- since I'm interested in this very topic and curious to 
> know what's out there. 
> >>>> 
> >>>> P.S. You probably already know about wescheme.org, right? 
> >>>> 
> >>>> 
> >>>> On Tuesday, April 23, 2019 at 5:17:40 AM UTC-7, Stephen De Gabrielle 
> wrote: 
> >>>>> 
> >>>>> Hi 
> >>>>> 
> >>>>> I found that you can run DrRacket on rollApp virtualisation 
> platform[1]. 
> >>>>> 
> >>>>> Are there any other online IDE’s for Racket? I’m interested in both 
> in-browser repl/editor combinations or virtualised DrRacket. 
> >>>>> 
> >>>>> Stephen 
> >>>>> 
> >>>>> [1] rollApp DrRacket free version does not permit saving. Signup 
> required. https://www.rollapp.com/app/drracket 
> >>>>> 
> >>>>> -- 
> >>>>>  
> >>>> 
> >>>> -- 
> >>>> 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 . 
> >>>> For more options, visit https://groups.google.com/d/optout. 
> >>> 
> >>> -- 
> >>>  
> >>> 
> >>> -- 
> >>> You received this message because you are subscribed to the Google 
> Groups "Racket Users" group. 
> >>> To unsubscribe from this group and stop receiving emails from it, send 
> an email to racket...@googlegroups.com . 
> >>> For more options, visit https://groups.google.com/d/optout. 
> >> 
> >> -- 
> >> You received this message because you are subscribed to the Google 
> Groups "Racket Users" group. 
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an email to racket...@googlegroups.com . 
> >> For more options, visit https://groups.google.com/d/optout. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Racket Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to racket...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/26435074-f685-483b-b93a-c2689db17f59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-05-02 Thread Stephen Foster
Yes!  Years ago, "Automata via Macros" was the paper that helped me see 
that macros are cool. :)  Thanks for including that.

I've been enjoying these Racket News issues!

On Wednesday, May 1, 2019 at 7:21:56 AM UTC-7, Paulo Matos wrote:
>
> Issue 7 is here. 
>
> http://racket-news.com/2019/05/racket-news-issue-7.html 
>
> Americano time, enjoy! 
> -- 
> Paulo Matos 
>

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


[racket-users] Re: Online IDE’s for Racket ?

2019-04-24 Thread Stephen Foster
Wow!  This is is cool.

Also +1 -- since I'm interested in this very topic and curious to know 
what's out there.

P.S. You probably already know about wescheme.org, right? 

On Tuesday, April 23, 2019 at 5:17:40 AM UTC-7, Stephen De Gabrielle wrote:
>
> Hi
>
> I found that you can run DrRacket on rollApp virtualisation platform[1].
>
> Are there any other online IDE’s for Racket? I’m interested in both 
> in-browser repl/editor combinations or virtualised DrRacket.
>
> Stephen
>
> [1] rollApp DrRacket free version does not permit saving. Signup required. 
> https://www.rollapp.com/app/drracket
>
> -- 
> 
>

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


Re: [racket-users] Re: raco setup conflicting with slideshow

2019-04-09 Thread Stephen Foster
P.S. I guess it's mainly just the para, item, and subitem functions.  The
rest of the text functions (e.g. (tt ...)) seem pretty straightforward to
get pict to do -- and in many cases the pict translation is specified in
the docs.

On Tue, Apr 9, 2019 at 2:57 PM Stephen Foster 
wrote:

> Thanks, Matthew.  That does help me understand what's going on a bit
> better.
>
> I do want to point out that, as far as I know, there are some pict
> functions that are only provided through slideshow.  For example, the (para
> ...) function -- which was what I was using when I ran into the
> aforementioned error.  This function is also provided by scribble/base.
> But doing (require scribble/base) does not fix the raco setup error.
>
> Is the best path forward to move such functions into pict?
>
> A lot of the functions on this page that return picts are really quite
> nice: https://docs.racket-lang.org/slideshow/Primary_Slide_Functions.html
> None of them seem to be provided by pict.
>
>
>
>
>
> On Tue, Apr 9, 2019 at 12:55 PM Matthew Flatt  wrote:
>
>> At Tue, 9 Apr 2019 14:50:15 -0400, Matt Jadud wrote:
>> > On Tue, Apr 9, 2019 at 2:44 PM Stephen Foster 
>> > wrote:
>> >
>> > >
>> > > I've always assumed that any correct Racket code can be run during
>> setup's
>> > > documentation-building time.  If this isn't true, how can I know which
>> > > Racket code can be used in this way and which can't?
>> > >
>> > >
>> > I just wanted to +1 this thread; as I've been working on documentation
>> > where I'd like to either 1) procedurally generate images as part of the
>> > docs, or 2) have parts of the library that generate graphical output, I
>> run
>> > into import issues at setup time that cause the build to fail.
>>
>> The `pict` library should not have that problem.
>>
>> The `plot` library does that have problem, but `plot/no-gui` avoids it.
>>
>> > I've been considering moving to a two-phase documentation build process,
>> > where I have a Makefile to run Racket code to generate static images,
>> and
>> > then drive Scribble to generate the documentation. This way, the
>> > documentation build process will succeed. In the end, that might be more
>> > portable/easier for distribution anyway...
>>
>> Are you running into problems where you really need GUI functionality
>> to create the image? Or it is just a library is bundled with GUI
>> functionality --- like `plot`, and maybe the `plot/no-gui` analog is
>> missing? Or is it more a question of keeping track of which libraries
>> imply a GUI and which do not?
>>
>>
>
> --
>
>
> Stephen Foster
> ThoughtSTEM Co-Founder
> 318-792-2035
>


-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

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


Re: [racket-users] Re: raco setup conflicting with slideshow

2019-04-09 Thread Stephen Foster
Thanks, Matthew.  That does help me understand what's going on a bit better.

I do want to point out that, as far as I know, there are some pict
functions that are only provided through slideshow.  For example, the (para
...) function -- which was what I was using when I ran into the
aforementioned error.  This function is also provided by scribble/base.
But doing (require scribble/base) does not fix the raco setup error.

Is the best path forward to move such functions into pict?

A lot of the functions on this page that return picts are really quite
nice: https://docs.racket-lang.org/slideshow/Primary_Slide_Functions.html
None of them seem to be provided by pict.





On Tue, Apr 9, 2019 at 12:55 PM Matthew Flatt  wrote:

> At Tue, 9 Apr 2019 14:50:15 -0400, Matt Jadud wrote:
> > On Tue, Apr 9, 2019 at 2:44 PM Stephen Foster 
> > wrote:
> >
> > >
> > > I've always assumed that any correct Racket code can be run during
> setup's
> > > documentation-building time.  If this isn't true, how can I know which
> > > Racket code can be used in this way and which can't?
> > >
> > >
> > I just wanted to +1 this thread; as I've been working on documentation
> > where I'd like to either 1) procedurally generate images as part of the
> > docs, or 2) have parts of the library that generate graphical output, I
> run
> > into import issues at setup time that cause the build to fail.
>
> The `pict` library should not have that problem.
>
> The `plot` library does that have problem, but `plot/no-gui` avoids it.
>
> > I've been considering moving to a two-phase documentation build process,
> > where I have a Makefile to run Racket code to generate static images, and
> > then drive Scribble to generate the documentation. This way, the
> > documentation build process will succeed. In the end, that might be more
> > portable/easier for distribution anyway...
>
> Are you running into problems where you really need GUI functionality
> to create the image? Or it is just a library is bundled with GUI
> functionality --- like `plot`, and maybe the `plot/no-gui` analog is
> missing? Or is it more a question of keeping track of which libraries
> imply a GUI and which do not?
>
>

-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

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


Re: [racket-users] Re: raco setup conflicting with slideshow

2019-04-09 Thread Stephen Foster
Thanks, Ben.

The weird thing is that (require slideshow) doesn't cause problems when I 
run that file in Racket, or when I the docs with scribble. It's only a 
problem when I use raco setup.

My assumption is that raco setup is supposed to build my docs in the same 
way I could have done myself (e.g. by running scribble).  Is that the wrong 
mental model on my part?   It always surprises me when my code seems to be 
working fine until I do a raco setup.  This doesn't happen often, but when 
it does, it makes me feel like it must be a Racket bug.  

I guess I'd like to know if I'm looking at things the right way in that 
regard.

More specifically... is this slideshow thing a Racket bug or my own?  If 
it's my own bug, how should I adjust my mental model?

I've always assumed that any correct Racket code can be run during setup's 
documentation-building time.  If this isn't true, how can I know which 
Racket code can be used in this way and which can't?








On Monday, April 8, 2019 at 7:32:36 PM UTC-7, Ben Greenman wrote:
>
> On 4/8/19, Ben Greenman > wrote: 
> > I think you want to require slideshow/base instead 
> > 
>
> Nevermind, that's not right --- at least not on Mac OS where its not 
> possible to instantiate racket/gui in a non-main place. 
>
> The problem is that requiring slideshow ends up starting the GUI and 
> (I think) a slideshow. 
>
> If you can require what you need from pict, do that instead. If not, 
> maybe there's a more specific module in slideshow that's safe to 
> require. 
>

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


[racket-users] Re: raco setup conflicting with slideshow

2019-04-08 Thread Stephen Foster
P.S. Sorry about the formatting there.  Part of my brain must have thought 
I was writing markdown.

On Monday, April 8, 2019 at 3:49:55 PM UTC-7, Stephen Foster wrote:
>
> I ran into the following bewildering error from `raco setup` and I was 
> wondering if anyone knows what's going.
>
> Here's a simple way to reproduce:
>
> ```
> my-project
>   scribblings/my-project.scrbl
>   util.rkt
> ```
>
> In the scribble file:
>
> ```
> #lang scribble/manual
> @require["../util.rkt"]
> ```
>
> And in `util.rkt`:
>
> ```
> #lang racket/base
> (require slideshow)
> ```
>
> Now when I run `raco setup my-project`, I get:
>
> ```
>
> slideshow: expects [] on the command line, given 2 
> arguments: setup my-project
>
>   context...:
>/usr/share/racket/collects/setup/parallel-do.rkt:334:4: work-done 
> method in list-queue%
>/usr/share/racket/collects/setup/parallel-do.rkt:284:17
>/usr/share/racket/collects/setup/parallel-do.rkt:238:4
>/usr/share/racket/pkgs/racket-index/setup/scribble.rkt:138:0: 
> setup-scribblings
>/usr/share/racket/collects/setup/setup-core.rkt:71:0: setup-core
>"/usr/share/racket/collects/setup/main.rkt": [running body]
>for-loop
>run-module-instance!125
>"/usr/share/racket/collects/raco/main.rkt": [running body]
>for-loop
>run-module-instance!125
>perform-require!78
>
>
> ```
>
> The error makes me think that `raco` is under the impression that I ran 
> `slideshow setup my-project` -- or that it tried to run that on my behalf.  
> What's odd is that I get no such problem when I use the `scribble` command 
> directly on my scribble file.
>
> I've reproduced this on Racket 7.0 and 7.1.  Any idea, what's going on?
>
>
>

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


[racket-users] raco setup conflicting with slideshow

2019-04-08 Thread Stephen Foster
I ran into the following bewildering error from `raco setup` and I was 
wondering if anyone knows what's going.

Here's a simple way to reproduce:

```
my-project
  scribblings/my-project.scrbl
  util.rkt
```

In the scribble file:

```
#lang scribble/manual
@require["../util.rkt"]
```

And in `util.rkt`:

```
#lang racket/base
(require slideshow)
```

Now when I run `raco setup my-project`, I get:

```

slideshow: expects [] on the command line, given 2 
arguments: setup my-project

  context...:
   /usr/share/racket/collects/setup/parallel-do.rkt:334:4: work-done method 
in list-queue%
   /usr/share/racket/collects/setup/parallel-do.rkt:284:17
   /usr/share/racket/collects/setup/parallel-do.rkt:238:4
   /usr/share/racket/pkgs/racket-index/setup/scribble.rkt:138:0: 
setup-scribblings
   /usr/share/racket/collects/setup/setup-core.rkt:71:0: setup-core
   "/usr/share/racket/collects/setup/main.rkt": [running body]
   for-loop
   run-module-instance!125
   "/usr/share/racket/collects/raco/main.rkt": [running body]
   for-loop
   run-module-instance!125
   perform-require!78


```

The error makes me think that `raco` is under the impression that I ran 
`slideshow setup my-project` -- or that it tried to run that on my behalf.  
What's odd is that I get no such problem when I use the `scribble` command 
directly on my scribble file.

I've reproduced this on Racket 7.0 and 7.1.  Any idea, what's going on?


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


Re: [racket-users] Help with pretty printing

2019-04-04 Thread Stephen Foster
Thanks, John.  Actually, when you distinguished between the line breaks and
the indentation, that helped me come up with the following algorithm.  It
basically, 1) lets pretty-print do its thing (inserting more line breaks
than I need), 2) uses a regex to scrub out all line breaks after a
keywords, and 3) fixes up the indentation after the fact.

(define (idiomatic-pretty-format d)
  (define too-many-line-breaks (pretty-format d 0))

  (define (fix-line-breaks s)
(regexp-replace* #px"(#:\\S*)\\s*" s "\\1 "))

  (define (fix-indentation s)
(local-require framework)

(define t (new racket:text%))
(send t insert s)
(send t tabify-all)
(send t get-text))

  (fix-indentation (fix-line-breaks too-many-line-breaks)) )


I wasn't able to see anything in the pretty-print hooks documentation that
seemed to promise a more elegant solution.  However, perhaps I can build my
own printer with this pretty printing library:
https://docs.racket-lang.org/pprint/index.html

NOTE: The above function does have the drawback that it relies on
racket:text% -- which seems both a little excessive and also will trigger
the "Cannot require racket/gui/base a second time" error if you try to call
it from a Scribble doc.

Still on the hunt for a better way...

On Tue, Apr 2, 2019 at 4:47 PM John Clements 
wrote:

> One note about this: it’s not really a question about indentation, which
> isn’t ludicrously hard, it’s a question about inserting linebreaks, which
> IMHO is much harder. Specifically, you’re asking for a pretty-printer that
> treats keywords differently from other items. Have you looked through all
> of the pretty-print hooks at
>
>
> https://docs.racket-lang.org/reference/pretty-print.html?q=pretty-print#%28def._%28%28lib._racket%2Fpretty..rkt%29._pretty-print%29%29
>
> ?
>
> I’m pretty sure that what you want is not in there, but you should take a
> look anyway.
>
> John
>
>
> > On Apr 2, 2019, at 3:47 PM, Stephen Foster 
> wrote:
> >
> > Hi all,
> >
> > Suppose, I have a datum that represents valid racket code, like '(test
> #:a a #:b b #: c).  I'd love to render (arbitrarily deeply nested) datums
> like this to a string that displays like this:
> >
> > (test
> >   #:a a
> >   #:b b
> >   #:c c)
> >
> > Pretty printing almost works:
> >
> > (displayln
> >(pretty-format
> > '(test #:a a #:b b #:c c)
> >24))
> >
> > '(test
> >   #:a
> >   a
> >   #:b
> >   b
> >   #:c
> >   c)
> >
> > I thought that fiddling with the columns parameter would help, but it
> doesn't:
> >
> > (displayln
> >(pretty-format
> > '(test #:a a #:b b #:c c)
> >25))
> >
> > (test #:a a #:b b #:c c)
> >
> > Maybe there's some way can get racket/pretty to do what I want -- though
> I didn't see anything jump out at me in docs.
> >
> > I was about to write my own pretty printer, but I figured that with so
> much stuff out there for typesetting Racket code (e.g in Scribble), I
> should at least ask if someone knows of something that does what I want:
> Basically, magically formats datums according to Rackety indentation
> idioms.
> >
> > Thanks,
> > 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.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
>

-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

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


[racket-users] Help with pretty printing

2019-04-02 Thread Stephen Foster
Hi all,

Suppose, I have a datum that represents valid racket code, like '(test #:a 
a #:b b #: c).  I'd love to render (arbitrarily deeply nested) datums like 
this to a string that displays like this:

(test
  #:a a
  #:b b
  #:c c)

Pretty printing almost works:

(displayln
   (pretty-format
'(test #:a a #:b b #:c c)
   24))

'(test
  #:a
  a
  #:b
  b
  #:c
  c)

I thought that fiddling with the columns parameter would help, but it 
doesn't:

(displayln
   (pretty-format
'(test #:a a #:b b #:c c)
   25))

(test #:a a #:b b #:c c)

Maybe there's some way can get racket/pretty to do what I want -- though I 
didn't see anything jump out at me in docs.

I was about to write my own pretty printer, but I figured that with so much 
stuff out there for typesetting Racket code (e.g in Scribble), I should at 
least ask if someone knows of something that does what I want: Basically, 
magically formats datums according to Rackety indentation idioms.  

Thanks,
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Can someone help me solve a raco mystery?

2019-03-25 Thread Stephen Foster
Thanks Gustavo,

That was a cool idea.  I enjoyed the opportunity to hack on some of the pkg
files.

Unfortunately, I wasn't able to reproduce the error today -- even on my
quarantined machine.  I'm not sure if that's because the error pattern
somewhat random or because I've been updating the repos for the
dependencies in question since I first noticed the error.

Anyway, I will definitely keep this in mind the next time I see this
error.  And I'll post if I figure out what's going on.  Thanks again!

--Stephen




On Sat, Mar 23, 2019 at 7:08 AM Gustavo Massaccesi 
wrote:

> > 2) The error seems to happen on computers where I am switching some
> package
> > in the dependency graph from a catalog installation to a github repo
> installation.
> >  I'm not sure if this could contribute to raco deciding that two
> packages with the
> > same name are actually different and, for some reason, trying to update
> them both.
>
>
> I have no clue about what is happening here, but this part sounds
> promising. For debugging, you can modify the in the file
> pkg/private/install.rkt the function format-deps near
> https://github.com/racket/racket/blob/master/racket/collects/pkg/private/install.rkt#L128
> so it shows all the fields of the pkg-desc instead of showing only the name.
>
> The definition is
> (struct pkg-desc (source type name checksum auto? extra-path))
>
> Gustavo
>
>
>

-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

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


[racket-users] Can someone help me solve a raco mystery?

2019-03-21 Thread Stephen Foster
Hi,

I'm running into weird, intermittent behavior with raco update.  
Occasionally, I will run:

raco pkg update --deps search-auto --update-deps PACKAGE-A

Near the beginning of the log, I see something like this:

The following out-of-date packages are listed as dependencies of PACKAGE-A 
and they will be automatically updated:
   PACKAGE-B
   PACKAGE-C
   PACKAGE-B
   PACKAGE-D
   etc.
   etc.

Note that PACKAGE-B appears twice.  After this, there is a bunch of normal 
raco logging, all of which ends with the following failure:

Uninstalling to prepare re-install of PACKAGE-B
Moving PACKAGE-B to trash: /path/to/trash
Uninstalling to prepare re-install of PACKAGE-B
raco pkg install: package not currently installed
   package: PACKAGE-B
   current scope: user

It fails because it tries to uninstall PACKAGE-B twice in a row.  The next 
time I run raco update everything works fine -- because the first failure 
left the machine in a state where PACKAGE-B is no longer installed.  

Now of course my PACKAGE-A doesn't explicitly list PACKAGE-B twice as a 
dependency.  Yet, somehow, raco does pick it up twice.  I'm trying to 
figure out why this would happen.

Note that this doesn't *usually* happen.  And I have *not* been able to 
reproduce it reliably on a single machine.

Oddly enough, though, it does happen to me relatively frequently because I 
maintaining a few hundred machines with Racket on them.  Lately I've been 
killing the raco update whenever there are duplicates in the list of 
packages; and I've quarantined a few of these machines to try to figure out 
if something is misconfigured about them.  I haven't found anything yet, 
but if someone can suggest something to check, I would be appreciative.

The only clues I do have are:


1) The packages that are listed as duplicates tend to be involved in some 
kind of diamond shape in the larger dependency graph: e.g.


PACKAGE-A depends on LEFT and RIGHT.

And LEFT and RIGHT both depend on PACKAGE-B.


Obviously, that should work.  And it usually does. Still, whenever the 
error does happen, the diamond structure always seems to be there.


2) The error seems to happen on computers where I am switching some package 
in the dependency graph from a catalog installation to a github repo 
installation.  I'm not sure if this could contribute to raco deciding that 
two packages with the same name are actually different and, for some 
reason, trying to update them both.


I was hoping that someone with a deeper understanding of Racket 
dependencies might be able to suggest a theory or some kind of test I can 
run to help build a theory.  Obviously, I am missing something.

Thanks in advance,
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Cannot instantiate `racket/gui/base' a second time in the same process

2019-02-11 Thread Stephen Foster
I totally get it.  Thanks, Robby! :)

On Mon, Feb 11, 2019 at 3:13 PM Robby Findler 
wrote:

> Well, I don't have the cycles to try it myself right now, and I don't
> mean to presume on others' time! :)
>
> Robby
>
> On Mon, Feb 11, 2019 at 5:00 PM Stephen Foster 
> wrote:
> >
> > Thanks, Robby.  That does make sense.
> >
> > Meta question: Are you saying that I should attempt this racket/gui
> refactoring myself?  Or is this something I should expect would happen
> without my help?
> >
> > Either is cool.  I just wasn't sure which you were suggesting.
> >
> >
> >
> > On Mon, Feb 11, 2019 at 2:46 PM Robby Findler <
> ro...@eecs.northwestern.edu> wrote:
> >>
> >> Probably the best thing would be to adjust racket/gui so that the
> >> text% (and perhaps a few smaller other things) was available without
> >> racket/gui/base having to be required. I believe that Sam did that to
> >> make racket/draw for a reason that was probably like this one.
> >>
> >> Robby
> >>
> >>
> >> On Mon, Feb 11, 2019 at 4:43 PM Stephen Foster 
> wrote:
> >> >
> >> > I've gotten this error many times when building docs.  Some google
> searching gives me the impression that it's a known issue.  Usually, I just
> refactor my code so that racket/gui doesn't get required, and everything is
> fine.  Is there another workaround, though?
> >> >
> >> > There was some functionality that I'd really like to use in
> racket:text% (for automatically tabifying code snippets).  It works great
> in all contexts except for when I build documentation.
> >> >
> >> > I suppose I could require racket:text% in a separate process and
> communicate with that process.  I was hoping for something a bit less icky,
> though.
> >> >
> >> > Any ideas?
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> >> > To unsubscribe from this group and stop receiving emails from it,
> send an email to racket-users+unsubscr...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > Stephen R. Foster, Ph.D., CEO
> > stephenfoster.us
> > multidimensionalgames.com
> > learntomod.com
> > vox-l.com
> > thoughtstem.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.
> > For more options, visit https://groups.google.com/d/optout.
>
-- 
Stephen R. Foster, Ph.D., CEO
stephenfoster.us
multidimensionalgames.com
learntomod.com
vox-l.com
thoughtstem.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Cannot instantiate `racket/gui/base' a second time in the same process

2019-02-11 Thread Stephen Foster
Thanks, Robby.  That does make sense.

Meta question: Are you saying that I should attempt this racket/gui
refactoring myself?  Or is this something I should expect would happen
without my help?

Either is cool.  I just wasn't sure which you were suggesting.



On Mon, Feb 11, 2019 at 2:46 PM Robby Findler 
wrote:

> Probably the best thing would be to adjust racket/gui so that the
> text% (and perhaps a few smaller other things) was available without
> racket/gui/base having to be required. I believe that Sam did that to
> make racket/draw for a reason that was probably like this one.
>
> Robby
>
>
> On Mon, Feb 11, 2019 at 4:43 PM Stephen Foster 
> wrote:
> >
> > I've gotten this error many times when building docs.  Some google
> searching gives me the impression that it's a known issue.  Usually, I just
> refactor my code so that racket/gui doesn't get required, and everything is
> fine.  Is there another workaround, though?
> >
> > There was some functionality that I'd really like to use in racket:text%
> (for automatically tabifying code snippets).  It works great in all
> contexts except for when I build documentation.
> >
> > I suppose I could require racket:text% in a separate process and
> communicate with that process.  I was hoping for something a bit less icky,
> though.
> >
> > Any ideas?
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
-- 
Stephen R. Foster, Ph.D., CEO
stephenfoster.us
multidimensionalgames.com
learntomod.com
vox-l.com
thoughtstem.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Cannot instantiate `racket/gui/base' a second time in the same process

2019-02-11 Thread Stephen Foster
I've gotten this error many times when building docs.  Some google 
searching gives me the impression that it's a known issue.  Usually, I just 
refactor my code so that racket/gui doesn't get required, and everything is 
fine.  Is there another workaround, though?

There was some functionality that I'd really like to use in racket:text% 
(for automatically tabifying code snippets).  It works great in all 
contexts except for when I build documentation.

I suppose I could require racket:text% in a separate process and 
communicate with that process.  I was hoping for something a bit less icky, 
though.

Any ideas?

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


[racket-users] Need Help with "Poisonous Chipmunks"

2018-12-06 Thread Stephen Foster
Dear Racket community, I need your help.

Once upon a time, I was looking for a Racket physics engine.  I looked 
around and found a few different bindings from Racket to the Chipmunk 
physics engine.  However, none of these repositories appeared to be 
maintained.  None of them used the latest version of Chipmunk.  And they 
didn't work (for me) out of the box.

So... in my hubris, I decided to learn the Racket FFI and make my own 
Racket/Chipmunk bindings.  Hence... this repo was born:

https://github.com/thoughtstem/racket-chipmunk

Still confident, I integrated my racket-chipmunk library into my 
Racket-based game-engine (https://github.com/thoughtstem/game-engine).

I THOUGHT all was well.  It worked great.  For a time, I was happy.

But then...  Three bad things happened:

1) First, I tried (and failed) to integrate the Rsound library into 
game-engine.  I thought (at the time) this was a problem in Rsound -- since 
the stack trace pointed me to the RSound code.  Here's the issue I 
opened: https://github.com/jbclements/RSound/issues/38

2) Then, later, when I saw the same error pop up with the Lux library, I 
started to think that maybe something in game-engine was at fault.  I did 
some digging and discovered racket-chipmunk to be the culprit.  Here's the 
issue where I came to that 
discovery: https://github.com/jeapostrophe/lux/issues/9

3) Now, a few days ago, I began to see a similar issue when I tried to 
integrate Mode Lambda into game-engine.  Once again, racket-chipmunk seems 
to be interfering with another library.  There's no explicit error message 
this time.  But the rendering is broken.  Here's the issue I opened about 
that: https://github.com/jeapostrophe/mode-lambda/issues/19

Feel free to follow those links to the issues for further information if 
you wish, but to save you some time, I'll try to sketch out the high level 
idea here.

Basically, in my racket-chipmunk library (in this file 
https://github.com/thoughtstem/racket-chipmunk/blob/master/lang/chipmunk-ffi.rkt),
 
I have these two lines:

(require ffi/unsafe)
(define chipmunk (ffi-lib "./binaries/libchipmunk"))



These two lines seem to subtly "poison" the Racket process (until I 
restart).  What I mean is that if I run those lines in ANY DrRacket tab, I 
immediately start to get subtle errors with programs launched from ANY 
other tabs -- whether or not those programs are even related to each 
other.  

1) With RSound and Lux the subtle error is that when those libraries (require 
math/flonum) it triggers a puzzling error inside of math/flonum.
2) With Mode Lambda, the subtle error is that all Mode Lambda programs, 
including the Mode Lambda examples, render just solid black.  

The idea that something that gets run in one tab will poison things I run 
in other tabs makes this bug uncharted territory (for me).  I've personally 
never seen that in DrRacket.  So I don't even have a clear hypothesis about 
what might be going wrong under the hood.  I also don't have any skills for 
debugging stuff that is going wrong under the hood in Racket.

To make matters MUCH worse, I only see the above phenomenon on certain 
Linux machines.  (But I have a few hundred of those machines -- so it's 
still very important for me to fix this issue).

Basically, I need the community's help here.  Has anyone seen a bug with a 
similar "feel"?  Has anyone seen this exact phenomenon?  Can someone tell 
me if I'm doing something obviously wrong with my FFI code?  Can someone 
tell me if there is something special I needed to have done when compiling 
the Chipmunk C libraries?  Can anyone give me a way to seek out more 
information to narrow down the issue?

I would genuinely appreciate any help. 

Thanks,
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Fun with Physics: Racket FFI Question (Bug?)

2018-09-18 Thread Stephen Foster
Thanks, this is super helpful. :)

On Monday, September 17, 2018 at 9:58:06 AM UTC-7, Matthew Flatt wrote:
>
> At Mon, 17 Sep 2018 09:34:46 -0700 (PDT), Stephen Foster wrote: 
> > But when I have two bodies that share the same velocity_func, I get a 
> > segfault: 
>
> The problem is that a callback is retained (by default) as long as the 
> function that it wraps is retained, but only a single callback is 
> retained for a given function. So, creating a second callback loses the 
> link between the function and the first callback, and the first 
> callback can be is reclaimed by the GC. 
>
> This is often a difficult problem to solve. 
>
> > *Things that didn't work* 
> > 
> > 1) Wrapping the function f in separate lambdas still gives a segfault: 
> > 
> > (set-cpBody-velocity_func! (chipmunk-body body1) 
> >(lambda(b g d dt) 
> >  (f b d g dt))) 
> > 
> > (set-cpBody-velocity_func! (chipmunk-body body2) 
> >(lambda(b g d dt) 
> >  (f b d g dt))) 
>
> This change makes things slightly worse, because nothing retains either 
> of those individual lambdas. 
>
> > 2) Storing a reference to the function f in a stab-in-the-dark attempt 
> to 
> > "trick the system" or "prevent some kind of mysterious garbage 
> collection" 
> > still segfaults: 
> > 
> > (define probably-silly 
> >   (list 
> > (lambda(b g d dt) 
> >   (f b d g dt)) 
> > (lambda(b g d dt) 
> >   (f b d g dt 
> > 
> > (set-cpBody-velocity_func! (chipmunk-body body1) 
> >(list-ref probably-silly 0)) 
> > 
> > (set-cpBody-velocity_func! (chipmunk-body body2) 
> >(list-ref probably-silly 1)) 
>
> Honestly, I'm not clear on why this fails. The `probably-silly` list 
> should be retained via the module's namespace, and so both of those 
> `lambda`s should be preserved, and so both callbacks should be 
> preserved. I'm stumped. 
>
>
> > 3) Storing the function f in two separate variables also segfaults: 
> > 
> > (define (f body gravity damping dt) 
> >   (ffi:cpointer-push-tag! body 'cpBody) 
> >   (cpBodySetVelocity body (cpv 0 -10)) 
> > 
> >   ffi:_void) 
> > 
> > (define f2 f) 
>
> This does nothing, since `f` and `f2` refer to the same value. 
>
>
> > *Things that do work but feel dumb* 
> > 
> > 1) Explicitly duplicating the function verbatim: 
> > 
> > (define (f body gravity damping dt) 
> >   (ffi:cpointer-push-tag! body 'cpBody) 
> >   (cpBodySetVelocity body (cpv 0 -10)) 
> > 
> >   ffi:_void) 
> > 
> > (define (f2 body gravity damping dt) 
> >   (ffi:cpointer-push-tag! body 'cpBody) 
> >   (cpBodySetVelocity body (cpv 0 -10)) 
> > 
> >   ffi:_void) 
> > 
> > (set-cpBody-velocity_func! (chipmunk-body body1) 
> >f) 
> > 
> > (set-cpBody-velocity_func! (chipmunk-body body2) 
> >f2) 
>
> This works because each callbacks is associated to a separate function, 
> and the separate functions are retained through the module's namespace. 
>
> > 2) Duplicating the function with a macro lets me generalize the above 
> > workaround for more than two bodies, but it still feels gross. 
>
> Yes. 
>
>
> > If someone has an explanation or a better workaround, that would be 
> great.   
>
> Use `#:keep` in the `_fun` for the velocity callback. 
>
> To tie the callback's lifetime to the enclosing record, you can 
> probably use a weak hashtable mapping `cpBody` pointers to callbacks: 
>
>   (define callbacks (make-weak-hasheq)) 
>   (define current-cpBody (make-parameter #f)) 
>
>   (define _cpBodyVelocityFunc 
>  (_fun #:keep (lambda (cb) (hash-set! callbacks (current-cpBody) cb)) 
>_pointer _cpVect _cpFloat _cpFloat -> _void)) 
>   
> where `current-cpBody` is a way of communicating the record where the 
> pointer is being stored: 
>
>   (let ([body (chipmunk-body body1)]) 
> (parameterize ([current-cpBody body])) 
>   (set-cpBody-velocity_func! body 
>   f)) 
>
> Beware that `callbacks` ties the callback to a cpointer record, not to 
> the actual pointer value. Since `chipmunk-body` returns the same 
> Cpointer every time for a given `chipmunk` Racket structure, I think 
> that's ok --- but it won't be ok if you get the same body pointer from 
> Chipmunk (via the FFI) multiple times. 
>
>

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


[racket-users] Fun with Physics: Racket FFI Question (Bug?)

2018-09-17 Thread Stephen Foster
I'm trying to get the Chipmunk Physics library integrated with Racket.  
I've made some progress (https://www.youtube.com/watch?v=GjvLaP7I0gg), but 
I need to ask for some input on an issue.

The Chipmunk C library provides a primitive called a "cpBody" (i.e. a 
moving thing).  A cpBody struct has a velocity_func pointer which allows 
customization of how the body's velocity is updated during the simulation.

I have noticed odd behavior with these function pointers.  Perhaps this is 
a bug with the FFI?  Perhaps it's perfectly normal and I just don't 
understand something about the FFI?

In any event, when I have one body, this works:

(define body1
  (box 25 5 (cpv 25.0 80.0)
   #:mass 10
   #:meta 'green))

(define (f body gravity damping dt)
  (ffi:cpointer-push-tag! body 'cpBody)
  (cpBodySetVelocity body (cpv 0 -10))

  ffi:_void)

(set-cpBody-velocity_func! (chipmunk-body body1)
   f)


But when I have two bodies that share the same velocity_func, I get a 
segfault:

(define body1
  (box 25 5 (cpv 25.0 80.0)
   #:mass 10
   #:meta 'green))

(define body2
  (box 25 5 (cpv 50.0 80.0)
   #:mass 10
   #:meta 'blue))


(define (f body gravity damping dt)
  (ffi:cpointer-push-tag! body 'cpBody)
  (cpBodySetVelocity body (cpv 0 -10))

  ffi:_void)

(set-cpBody-velocity_func! (chipmunk-body body1)
   f)

(set-cpBody-velocity_func! (chipmunk-body body2)
   f)


I've tried various ways to work around this issue.  But all of them either 
didn't work or feel dumb.


*Things that didn't work*

1) Wrapping the function f in separate lambdas still gives a segfault:

(set-cpBody-velocity_func! (chipmunk-body body1)
   (lambda(b g d dt)
 (f b d g dt)))

(set-cpBody-velocity_func! (chipmunk-body body2)
   (lambda(b g d dt)
 (f b d g dt)))


2) Storing a reference to the function f in a stab-in-the-dark attempt to 
"trick the system" or "prevent some kind of mysterious garbage collection" 
still segfaults:

(define probably-silly
  (list
(lambda(b g d dt)
  (f b d g dt))
(lambda(b g d dt)
  (f b d g dt

(set-cpBody-velocity_func! (chipmunk-body body1)
   (list-ref probably-silly 0))

(set-cpBody-velocity_func! (chipmunk-body body2)
   (list-ref probably-silly 1))

3) Storing the function f in two separate variables also segfaults:

(define (f body gravity damping dt)
  (ffi:cpointer-push-tag! body 'cpBody)
  (cpBodySetVelocity body (cpv 0 -10))

  ffi:_void)

(define f2 f)

(set-cpBody-velocity_func! (chipmunk-body body1)
   f)

(set-cpBody-velocity_func! (chipmunk-body body2)
   f2)



*Things that do work but feel dumb*

1) Explicitly duplicating the function verbatim:

(define (f body gravity damping dt)
  (ffi:cpointer-push-tag! body 'cpBody)
  (cpBodySetVelocity body (cpv 0 -10))

  ffi:_void)

(define (f2 body gravity damping dt)
  (ffi:cpointer-push-tag! body 'cpBody)
  (cpBodySetVelocity body (cpv 0 -10))

  ffi:_void)

(set-cpBody-velocity_func! (chipmunk-body body1)
   f)

(set-cpBody-velocity_func! (chipmunk-body body2)
   f2)

2) Duplicating the function with a macro lets me generalize the above 
workaround for more than two bodies, but it still feels gross.  I know the 
macro could be improved, but that isn't really the point.  The fact that I 
have to know how many  functions to make at compile time is gross.

;The stupid macro
(define-syntax-rule (dumb-duplicate id body)
  (define id
(list
 body
 body
 body
 body
 body)))

(dumb-duplicate fs
(lambda (body gravity damping dt)
  (f body gravity damping dt)))

(set-cpBody-velocity_func! (chipmunk-body body1)
   (list-ref fs 0))

(set-cpBody-velocity_func! (chipmunk-body body2)
   (list-ref fs 1))


That's all I have.  To sum up, sharing the same function pointer across two 
cpBodies seems to segfault to matter what clever tricks I try.  Using 
functions with distinct compile-time source locations does work, but it 
makes me feel icky.  I would prefer to construct the functions I need 
dynamically rather than statically.  In simulations where objects are 
created at runtime, it feels sillier and sillier to have to know beforehand 
how many objects there will be at runtime.

If someone has an explanation or a better workaround, that would be great.  
I'm assuming there's something about the Racket FFI that I haven't learned 
yet.  However, if others are as mystified as I am, I'll assume it's a 
Chipmunk issue, and I'll ask about it over on the Chipmunk forums.  


*Appendix A*

Below is a full program with some rendering, just for context.

It uses this newborn git repo for th

[racket-users] Chipmunk physics

2018-09-10 Thread Stephen Foster
Physics engines are cool!

...which is why I'm super excited about the fact that there are (or were) 
bindings for the Chipmunk physics library.

The only issues are:

1) I can't get it to work,
2) I don't know a lot about C,
3) I don't know a lot about Racket's FFI.  

I've posted an issue on the relevant Github project.  However, it doesn't 
look like that project is being maintained.  Here's a link to the issue:

https://github.com/samvv/ramunk/issues/6

To sum up, I've compiled Chipmunk for Ubuntu.  And the Racket FFI seems to 
be finding the appropriate .so file.  But I'm getting an error.

I don't know enough to even pinpoint where to look next.  Did I compile it 
wrong?  Am I using the FFI incorrectly?  Is there something about AutoFFI 
that I need to know?  

The github repo does say that only OSX is supported.  But I assumed that if 
I could get Chipmunk to compile on Ubuntu, everything would be fine.  
Perhaps that was a wrong assumption.

Any pointers or course corrections would be appreciated.




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


[racket-users] Redex: custom rendering of metafunctions

2018-08-05 Thread Stephen Foster
I see metafunction->pict.  It's basically what I want for a game I'm 
designing.  It renders metafunction like this:



However, I was wondering if there's a way to heavily customize the 
rendering -- or better yet, to access the underlying data structure for 
metafunctions, so I can make my own render function.  Something like this 
silly example:




If there's not a provided way to do this, that's fine.  My Plan B was to 
write a macro that both defines the metafunction and additionally stores 
the relevant info for rendering later.

I figured I'd ask, though. I didn't see anything in the API, and I poked 
around in the source code a bit too.  



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


Re: [racket-users] DrRacket prefs?

2018-05-24 Thread Stephen Foster
Wow! This is great, thanks!

On Thu, May 24, 2018 at 11:47 AM Robby Findler 
wrote:

> It may be easier to use the higher-level library, calling
> preferences:set-default and preferences:set. Using that approach has
> the advantage you don't need to know all of the prefs (that are
> machine config and OS specific, generally), but it has the
> disadvantage that you need to figure out what the right values are at
> that level. But these files have some useful information:
>
>
> https://github.com/racket/drracket/blob/master/drracket/drracket/private/main.rkt
>
>
> https://github.com/racket/gui/blob/master/gui-lib/framework/private/main.rkt
>
> Here's a program that sets that particular preference (note that this
> is user-specific):
>
> #lang racket
> (require framework/preferences)
> (preferences:set-default 'drracket:show-line-numbers? #t boolean?)
> (preferences:set 'drracket:show-line-numbers? #t)
>
> Robby
>
>
> On Thu, May 24, 2018 at 1:35 PM, Stephen Foster 
> wrote:
> > Nice!  I'll try that!
> >
> > On Thu, May 24, 2018 at 11:34 AM Shu-Hung You
> >  wrote:
> >>
> >> Hi Stephen,
> >>
> >> Running (find-system-path 'pref-file) in the REPL shows the path to
> >> the preference file. Inside the file there's one line like:
> >>
> >> (plt:framework-pref:framework:display-line-numbers #t)
> >>
> >> I don't know if directly copying the pref file to another computer
> >> would work but perhaps worth a try.
> >>
> >>
> >> On Thu, May 24, 2018 at 12:28 PM, Stephen Foster
> >>  wrote:
> >> > Hi,
> >> >
> >> > I know how to hide/show line numbers from within DrRacket's GUI.  But
> is
> >> > there a way to toggle this from the command line?  I have a few
> hundred
> >> > computers with DrRacket installed, and I want to make them all show
> line
> >> > numbers by default.  (I'd rather not do it by hand.)
> >> >
> >> > Is there a command I can run or a preferences file I could edit with a
> >> > script?  Does anyone know where DrRacket stores user preferences like
> >> > this?
> >> >
> >> > --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.
> >> > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > Stephen R. Foster, Ph.D., CEO
> > stephenfoster.us
> > multidimensionalgames.com
> > learntomod.com
> > vox-l.com
> > thoughtstem.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.
> > For more options, visit https://groups.google.com/d/optout.
>
-- 
Stephen R. Foster, Ph.D., CEO
stephenfoster.us
multidimensionalgames.com
learntomod.com
vox-l.com
thoughtstem.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket prefs?

2018-05-24 Thread Stephen Foster
Nice!  I'll try that!

On Thu, May 24, 2018 at 11:34 AM Shu-Hung You <
shu-hung@eecs.northwestern.edu> wrote:

> Hi Stephen,
>
> Running (find-system-path 'pref-file) in the REPL shows the path to
> the preference file. Inside the file there's one line like:
>
> (plt:framework-pref:framework:display-line-numbers #t)
>
> I don't know if directly copying the pref file to another computer
> would work but perhaps worth a try.
>
>
> On Thu, May 24, 2018 at 12:28 PM, Stephen Foster
>  wrote:
> > Hi,
> >
> > I know how to hide/show line numbers from within DrRacket's GUI.  But is
> > there a way to toggle this from the command line?  I have a few hundred
> > computers with DrRacket installed, and I want to make them all show line
> > numbers by default.  (I'd rather not do it by hand.)
> >
> > Is there a command I can run or a preferences file I could edit with a
> > script?  Does anyone know where DrRacket stores user preferences like
> this?
> >
> > --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.
> > For more options, visit https://groups.google.com/d/optout.
>
-- 
Stephen R. Foster, Ph.D., CEO
stephenfoster.us
multidimensionalgames.com
learntomod.com
vox-l.com
thoughtstem.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] DrRacket prefs?

2018-05-24 Thread Stephen Foster
Hi,

I know how to hide/show line numbers from within DrRacket's GUI.  But is 
there a way to toggle this from the command line?  I have a few hundred 
computers with DrRacket installed, and I want to make them all show line 
numbers by default.  (I'd rather not do it by hand.)

Is there a command I can run or a preferences file I could edit with a 
script?  Does anyone know where DrRacket stores user preferences like this?

--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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Edmond's Blossom Algorithm

2018-05-24 Thread Stephen Foster
Sounds like a variation on the Stable Roommate problem?

https://en.m.wikipedia.org/wiki/Stable_roommates_problem?wprov=sfla1

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


[racket-users] Student code metrics

2018-05-13 Thread Stephen Foster
Hi!

I was about to start building a tool for statically analyzing student 
code.  But I first want to ask if there's related work out there.

I'm interested in relatively simple stuff -- e.g. How many functions did 
the student write?  How many expressions?  What's the average nesting depth 
of expressions?  Etc.  Basically, I want to start quantifying things about 
students' coding styles -- both to identify potential problems and also to 
help students set goals (e.g. "Today, you wrote 2 functions.  Tomorrow, I 
want you to try to write 3!").

Before I start writing this myself, is there anything that I should know 
about?  Has someone already done exactly this?  Or is there some library 
for static analysis or code metrics that I should be building upon?  I 
searched a bit and couldn't find a lot.  Maybe I'm using the wrong keywords.

--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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Blockly-Like Interface in DrRacket

2018-05-01 Thread Stephen Foster
Sure thing, Leif.  Thanks for the offer!

https://github.com/thoughtstem/racket-blocks


On Fri, Apr 27, 2018 at 12:33 PM Leif Andersen 
wrote:

> Stephen,
>
> Do you have a link to your current source code? If so I'd be happy to
> take a look at it and give you general feedback.
>
> Also yes, your solution is (very sadly) the current state of the art I
> have in #lang editor. (https://github.com/videolang/idmt). In the
> future I hope to improve DrRacket with proper projectional editing
> capabilities. But yes, at the moment its only really doable by
> scraping and replacing raw text.
>
> ~Leif Andersen
>
>
> On Fri, Apr 27, 2018 at 3:03 PM, Stephen Foster 
> wrote:
> > Actually, I figured it out myself.  For the curious:
> >
> > What I ended up doing was implementing a custom language "#lang
> > racket-bricks".  I used syntax/module-reader's #:wrapper1 to intercept
> the
> > code prior to execution.  It scrapes out all of the brick-snip%s and
> > replaces them with their associated S-expressions.
> >
> > From the user's perspective, both B-expressions and S-expressions can
> share
> > variable bindings.  Also, one can nest B-expressions inside
> S-expressions.
> >
> >
> > I'm planning to use this at ThoughtSTEM to help transition novices
> smoothly
> > from block-based coding to traditional coding.
> >
> >
> >
> > On Thursday, April 26, 2018 at 2:33:35 PM UTC-7, Stephen Foster wrote:
> >>
> >> I finally had some time to revisit this.  I'm hoping someone can help me
> >> out a bit more.
> >>
> >>
> >> I made a basic renderer that takes arbitrary S-expressions and renders
> >> them as bricks.  I've made an interface for editing the bricks (and thus
> >> editing the S-expressions underneath).
> >>
> >>
> >> What I would like to do now is seamlessly integrate these
> >> brick-expressions (B-expressions?) into arbitrary Racket files using
> some
> >> kind of custom snip%.
> >>
> >>
> >> Here's a not-working prototype of what it should look like:
> >>
> >>
> >>
> >>
> >> Notice that line #9 has the B-expression.  Line #7 has a comment showing
> >> the equivalent S-expression.  Also notice that the B-expression
> contains a
> >> reference to the constant defined in an S-expression on line #5.  And
> vice
> >> versa, notice that the S-expression on line #11 references the constant
> >> defined in the B-expression.  This two-way interoperability between
> >> B-expressions and S-expressions within the same file is something I
> think
> >> would be pedagogically valuable.
> >>
> >>
> >> I'd love to implement this, but I'm looking for suggestions.
> >>
> >>
> >> Let's just suppose I've implemented a special b-expression-snip% class.
> >> (I haven't, but I think I could).
> >>
> >>
> >> How might I go about getting the above to work.  Here are some random,
> >> vague, probably-misguided musings about implementations -- meant to
> >> stimulate discussion:
> >>
> >> Get DrRacket to render the b-expression-snip% as an image but otherwise
> >> treat it as a normal S-expression, just as if it had been written as
> such.
> >> Get the b-expression-snip%'s associated S-expression to be "evaled" in
> the
> >> context of the module -- without having to wrap the snip in a helper
> >> S-expression, e.g. (my-eval ...).
> >> Get the b-expression-snip%'s presence to somehow "inject" its
> S-expression
> >> into the module/file/etc.
> >> Implement some kind of special #lang racket-with-bricks that intercepts
> >> the code before execution and swaps all B-expressions for their
> associated
> >> S-expressions.
> >>
> >> Any ideas, pointers, references, etc. would all be appreciated.  Thanks
> in
> >> advance!
> >>
> >>
> >> On Wednesday, December 27, 2017 at 8:30:16 PM UTC-8, Stephen Foster
> wrote:
> >>>
> >>> If I wanted to build a drag-and-drop, visual programming interface for
> >>> programming in DrRacket, is there any prior work I can build on?
> Ideally,
> >>> I'd like to implement this as a DrRacket "snip", so that my students
> can
> >>> make programs that are partially text-based and partially visual.  Any
> >>> suggestions?  Has anyone done something in the ballpark?
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
-- 
Stephen R. Foster, Ph.D., CEO
stephenfoster.us
multidimensionalgames.com
learntomod.com
vox-l.com
thoughtstem.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Blockly-Like Interface in DrRacket

2018-04-27 Thread Stephen Foster
Actually, I figured it out myself.  For the curious:

What I ended up doing was implementing a custom language "#lang 
racket-bricks".  I used syntax/module-reader's #:wrapper1 to intercept the 
code prior to execution.  It scrapes out all of the brick-snip%s and 
replaces them with their associated S-expressions.

>From the user's perspective, both B-expressions and S-expressions can share 
variable bindings.  Also, one can nest B-expressions inside S-expressions.

<https://lh3.googleusercontent.com/-CBFxGIhYoIo/WuNydU9CrhI/DMA/l6R5ClVV_OYPF3ySIJEL5w8-ZjFQBfidgCLcBGAs/s1600/Screen%2BShot%2B2018-04-27%2Bat%2B11.52.09%2BAM.png>

I'm planning to use this at ThoughtSTEM to help transition novices smoothly 
from block-based coding to traditional coding.



On Thursday, April 26, 2018 at 2:33:35 PM UTC-7, Stephen Foster wrote:
>
> I finally had some time to revisit this.  I'm hoping someone can help me 
> out a bit more.
>
>
> I made a basic renderer that takes arbitrary S-expressions and renders 
> them as bricks.  I've made an interface for editing the bricks (and thus 
> editing the S-expressions underneath).
>
>
> What I would like to do now is seamlessly integrate these 
> brick-expressions (B-expressions?) into arbitrary Racket files using some 
> kind of custom snip%.
>
>
> Here's a not-working prototype of what it should look like:
>
>
>
> <https://lh3.googleusercontent.com/-kdfl-pNWFFo/WuI_Ke1hfDI/DLc/2TZNVfty_vET2wOvZtAhZ504RDKogaTbACLcBGAs/s1600/Screen%2BShot%2B2018-04-26%2Bat%2B2.03.40%2BPM.png>
>
>
> Notice that line #9 has the B-expression.  Line #7 has a comment showing 
> the equivalent S-expression.  Also notice that the B-expression contains a 
> reference to the constant defined in an S-expression on line #5.  And vice 
> versa, notice that the S-expression on line #11 references the constant 
> defined in the B-expression.  This two-way interoperability between 
> B-expressions and S-expressions within the same file is something I think 
> would be pedagogically valuable.
>
>
> I'd love to implement this, but I'm looking for suggestions.
>
>
> Let's just suppose I've implemented a special b-expression-snip% class.  
> (I haven't, but I think I could).
>
>
> How might I go about getting the above to work.  Here are some random, 
> vague, probably-misguided musings about implementations -- meant to 
> stimulate discussion:
>
>
>- Get DrRacket to render the b-expression-snip% as an image but 
>otherwise treat it as a normal S-expression, just as if it had been 
> written 
>as such.
>- Get the b-expression-snip%'s associated S-expression to be "evaled" 
>in the context of the module -- without having to wrap the snip in a 
> helper 
>S-expression, e.g. (my-eval ...).
>- Get the b-expression-snip%'s presence to somehow "inject" its 
>S-expression into the module/file/etc.
>- Implement some kind of special *#lang racket-with-bricks* that 
>intercepts the code before execution and swaps all B-expressions for their 
>associated S-expressions.
>
> Any ideas, pointers, references, etc. would all be appreciated.  Thanks in 
> advance!
>
>
> On Wednesday, December 27, 2017 at 8:30:16 PM UTC-8, Stephen Foster wrote:
>>
>> If I wanted to build a drag-and-drop, visual programming interface for 
>> programming in DrRacket, is there any prior work I can build on?  Ideally, 
>> I'd like to implement this as a DrRacket "snip", so that my students can 
>> make programs that are partially text-based and partially visual.  Any 
>> suggestions?  Has anyone done something in the ballpark?  
>>
>

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


[racket-users] Re: Blockly-Like Interface in DrRacket

2018-04-26 Thread Stephen Foster


I finally had some time to revisit this.  I'm hoping someone can help me 
out a bit more.


I made a basic renderer that takes arbitrary S-expressions and renders them 
as bricks.  I've made an interface for editing the bricks (and thus editing 
the S-expressions underneath).


What I would like to do now is seamlessly integrate these brick-expressions 
(B-expressions?) into arbitrary Racket files using some kind of custom 
snip%.


Here's a not-working prototype of what it should look like:


<https://lh3.googleusercontent.com/-kdfl-pNWFFo/WuI_Ke1hfDI/DLc/2TZNVfty_vET2wOvZtAhZ504RDKogaTbACLcBGAs/s1600/Screen%2BShot%2B2018-04-26%2Bat%2B2.03.40%2BPM.png>


Notice that line #9 has the B-expression.  Line #7 has a comment showing 
the equivalent S-expression.  Also notice that the B-expression contains a 
reference to the constant defined in an S-expression on line #5.  And vice 
versa, notice that the S-expression on line #11 references the constant 
defined in the B-expression.  This two-way interoperability between 
B-expressions and S-expressions within the same file is something I think 
would be pedagogically valuable.


I'd love to implement this, but I'm looking for suggestions.


Let's just suppose I've implemented a special b-expression-snip% class.  (I 
haven't, but I think I could).


How might I go about getting the above to work.  Here are some random, 
vague, probably-misguided musings about implementations -- meant to 
stimulate discussion:


   - Get DrRacket to render the b-expression-snip% as an image but 
   otherwise treat it as a normal S-expression, just as if it had been written 
   as such.
   - Get the b-expression-snip%'s associated S-expression to be "evaled" in 
   the context of the module -- without having to wrap the snip in a helper 
   S-expression, e.g. (my-eval ...).
   - Get the b-expression-snip%'s presence to somehow "inject" its 
   S-expression into the module/file/etc.
   - Implement some kind of special *#lang racket-with-bricks* that 
   intercepts the code before execution and swaps all B-expressions for their 
   associated S-expressions.

Any ideas, pointers, references, etc. would all be appreciated.  Thanks in 
advance!


On Wednesday, December 27, 2017 at 8:30:16 PM UTC-8, Stephen Foster wrote:
>
> If I wanted to build a drag-and-drop, visual programming interface for 
> programming in DrRacket, is there any prior work I can build on?  Ideally, 
> I'd like to implement this as a DrRacket "snip", so that my students can 
> make programs that are partially text-based and partially visual.  Any 
> suggestions?  Has anyone done something in the ballpark?  
>

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


Re: [racket-users] big-bang + right click?

2018-02-18 Thread Stephen Foster
Cool!  I was able to get it working with Lux.  Thanks!

On Saturday, February 17, 2018 at 9:34:19 AM UTC-8, Jay McCarthy wrote:
>
> FWIW Stephen, I have another package called `lux` that tries to be a 
> "professional" big-bang and it supports stuff like this. 
>
> The documentation is here: http://docs.racket-lang.org/lux/index.html 
>
> But I suggest checking out the two examples first. 
>
> val-demo --- 
> https://github.com/jeapostrophe/lux/blob/master/examples/val-demo.rkt 
> --- Shows how you can use 2htdp/image or pict to make your scenes and 
> it shows how the generic event-handler receives key events from 
> racket/gui. 
>
> spin --- https://github.com/jeapostrophe/lux/blob/master/examples/spin.rkt 
> --- is a little more complicated and shows how you get mouse event 
> structures as well as demonstrating that lux can be used recursively. 
> [For comparison, if you call big-bang inside a big-bang handler, then 
> a new window opens up. In lux, the same window is taken over and the 
> result from the inner call is returned to the call site. This can be 
> used to make things like pause screens, menus, and so on fairly 
> nicely.] 
>
> Jay 
>
> -- 
> -=[ Jay McCarthy   http://jeapostrophe.github.io]=- 
> -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=- 
> -=[ Moses 1:33: And worlds without number have I created; ]=- 
>

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


Re: [racket-users] big-bang + right click?

2018-02-16 Thread Stephen Foster
Okay, cool. Thanks!

On Thursday, February 15, 2018 at 4:28:44 PM UTC-8, Matthias Felleisen 
wrote:
>
>
> No.
>
> I checked the code and providing the extra information easily would be 
> backwards incompatible. 
> I may introduce another mouse handler that also delivers the mouse event 
> as an fourth argument. 
>
> If you need this today, you will need to use Racket’s GUI toolbox 
> directly. 
>
>
>
> On Feb 15, 2018, at 6:54 PM, Stephen Foster  > wrote:
>
> Is there a way to differentiate between left and right click with a 
> big-bang on-mouse handler?  Or if not, is there some workaround I can use 
> to detect right clicks?
>
> -- 
> 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 .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

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


[racket-users] big-bang + right click?

2018-02-15 Thread Stephen Foster
Is there a way to differentiate between left and right click with a 
big-bang on-mouse handler?  Or if not, is there some workaround I can use 
to detect right clicks?

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


Re: [racket-users] Blockly-Like Interface in DrRacket

2018-01-03 Thread Stephen Foster
Thanks Leif!

I was actually looking at your embeddable video editor a few days ago for 
inspiration.  Incidentally, I've also been playing around with #lang video 
a bit.  It's all really great stuff.  I'll definitely use these as 
inspiration.

--Stephen

On Tuesday, January 2, 2018 at 2:39:53 PM UTC-8, Leif Andersen wrote:
>
> Hello Stephens (this is going to be fun...I just know it.)
>
> As Stephen D pointed out, there was a push to add traditional gui elements 
> to DrScheme (now DrRacket), which currently lives in the `embedded-gui`[1] 
> collection. Although honestly, that library is old and hasn't been 
> maintained for years.
>
> Another alternative is my editor collection which is still in VERY early 
> stages of development[2], but it also lets you build editors in DrRacket. 
> I'm still making a cleaner interface for it, and ultimately I would like to 
> be able to make a nice graphical video editor with it. (Powered by #lang 
> video[3]). But for now, you can see an example of doing a similar thing 
> (making a video editor that is embedded directly in code) on github[4].
>
> Good luck Stephen F. and feel free to ping me if you have any questions.
>
> [1]: https://docs.racket-lang.org/embedded-gui/index.html
> [2]: https://github.com/videolang/idmt
> [3]: https://lang.video
> [4]: 
> https://github.com/videolang/video/blob/master/video/private/editor.rkt
>
> ~Leif Andersen
>
> On Monday, January 1, 2018 at 12:39:10 PM UTC-5, Stephen Foster wrote:
>>
>> Yes, exactly -- Like Snap! except I don't need the runtime, just the code 
>> editing paradigm.
>>
>> I googled for insert-gui and the closest thing I found was this:
>>
>> https://github.com/mflatt/guibuilder 
>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fmflatt%2Fguibuilder&sa=D&sntz=1&usg=AFQjCNHnbO_aZsxDE5ECeocU8Sf2_YYFYA>
>>
>> This seems really promising.
>>
>> Also, I didn't know about the plot library and its interactive snips.  So 
>> I'll look more deeply at that too.
>>
>> Thanks!
>>
>> --Stephen
>>
>> On Saturday, December 30, 2017 at 5:31:28 PM UTC-8, spdegabrielle wrote:
>>>
>>> Hi Stephen, 
>>>
>>> I'm assuming you meant something like Snap (http://snap.berkeley.edu) 
>>> in Dr Racket? 
>>>  
>>> Snips are powerful; they can inserted in text and pasteboard editors; 
>>> they can be dynamic(e.g. plot), and they can contain other editors(text or 
>>> pasteboard).
>>>
>>> The only possibly related prior work I’m aware of was an insert-gui 
>>> functionality in DrRacket (maybe even DrScheme?) which allowed you to 
>>> insert GUI elements into program text.
>>>
>>> There was a query about 'Extending DrRacket with non-text tabs' that 
>>> might be helpful (see 
>>> https://groups.google.com/d/msg/racket-users/Iu2XtxNX_Kk/SiavnnkYDEoJ)
>>>
>>> The DrRacket plugins documentation has a example of extending DrRacket 
>>> https://docs.racket-lang.org/tools/implementing-tools.html
>>>
>>> Kind regards, 
>>> Stephen D
>>>
>>> some documentation links:
>>>  * DrRacket Plugins: http://docs.racket-lang.org/tools/index.html
>>>
>>>  * Graphical Interface Toolkit: http://docs.racket-lang.org/gui/ 
>>> * Pasteboard(editor): 
>>> http://docs.racket-lang.org/gui/pasteboard_.html
>>>
>>>
>>> On Thu, 28 Dec 2017 at 04:30, Stephen Foster  
>>> wrote:
>>>
>>>> If I wanted to build a drag-and-drop, visual programming interface for 
>>>> programming in DrRacket, is there any prior work I can build on?  Ideally, 
>>>> I'd like to implement this as a DrRacket "snip", so that my students can 
>>>> make programs that are partially text-based and partially visual.  Any 
>>>> suggestions?  Has anyone done something in the ballpark?  
>>>>
>>>> -- 
>>>> 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.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>

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


Re: [racket-users] Blockly-Like Interface in DrRacket

2018-01-01 Thread Stephen Foster
Yes, exactly -- Like Snap! except I don't need the runtime, just the code 
editing paradigm.

I googled for insert-gui and the closest thing I found was this:

https://github.com/mflatt/guibuilder

This seems really promising.

Also, I didn't know about the plot library and its interactive snips.  So 
I'll look more deeply at that too.

Thanks!

--Stephen

On Saturday, December 30, 2017 at 5:31:28 PM UTC-8, spdegabrielle wrote:
>
> Hi Stephen, 
>
> I'm assuming you meant something like Snap (http://snap.berkeley.edu) in 
> Dr Racket? 
>  
> Snips are powerful; they can inserted in text and pasteboard editors; they 
> can be dynamic(e.g. plot), and they can contain other editors(text or 
> pasteboard).
>
> The only possibly related prior work I’m aware of was an insert-gui 
> functionality in DrRacket (maybe even DrScheme?) which allowed you to 
> insert GUI elements into program text.
>
> There was a query about 'Extending DrRacket with non-text tabs' that might 
> be helpful (see 
> https://groups.google.com/d/msg/racket-users/Iu2XtxNX_Kk/SiavnnkYDEoJ)
>
> The DrRacket plugins documentation has a example of extending DrRacket 
> https://docs.racket-lang.org/tools/implementing-tools.html
>
> Kind regards, 
> Stephen D
>
> some documentation links:
>  * DrRacket Plugins: http://docs.racket-lang.org/tools/index.html
>
>  * Graphical Interface Toolkit: http://docs.racket-lang.org/gui/ 
>     * Pasteboard(editor): http://docs.racket-lang.org/gui/pasteboard_.html
>
>
> On Thu, 28 Dec 2017 at 04:30, Stephen Foster  > wrote:
>
>> If I wanted to build a drag-and-drop, visual programming interface for 
>> programming in DrRacket, is there any prior work I can build on?  Ideally, 
>> I'd like to implement this as a DrRacket "snip", so that my students can 
>> make programs that are partially text-based and partially visual.  Any 
>> suggestions?  Has anyone done something in the ballpark?  
>>
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


[racket-users] Blockly-Like Interface in DrRacket

2017-12-27 Thread Stephen Foster
If I wanted to build a drag-and-drop, visual programming interface for 
programming in DrRacket, is there any prior work I can build on?  Ideally, 
I'd like to implement this as a DrRacket "snip", so that my students can 
make programs that are partially text-based and partially visual.  Any 
suggestions?  Has anyone done something in the ballpark?  

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