Sure thing, Leif.  Thanks for the offer!

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


On Fri, Apr 27, 2018 at 12:33 PM Leif Andersen <l...@leifandersen.net>
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 <step...@thoughtstem.com>
> 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.

Reply via email to