Re: [racket-users] An Apology

2021-06-22 Thread Yury Bulka
Thank you, Siddhartha Kasivajhula, for expressing this.

I am an "ordinary" Racket user - I don't hack on Racket itself, I don't
even create DSLs (yet). But I care about Racket a lot, I tell people about
it, I write software in it, and I even contributed a small feature to a
racket package.

I was glad to see the Apology email on the list. I think this is a good
first step. And I very much understand this is a difficult situation.

But I agree there is a crucial next element that is needed: a clear strategy
on handling these issues in the future, a commitment to addressing the
problem in addition accepting it exists.

There are two links I would like to share:

The Racket Friendly Environment Policy:
https://racket-lang.org/friendly.html

It says:

> Unacceptable behavior will not be tolerated.

(Where unacceptable behavior is defined it a page linked from the Policy.)

And a blog post I saw the other day on Software Freedom Conservancy's blog:
https://sfconservancy.org/blog/2021/apr/20/how-to-apologize/

I think it has many constructive points.

Best,
--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Siddhartha Kasivajhula  writes:

> I just want to add my words on behalf of the silent majority. I think it is
> important to look for ways to empower people like Matthew Butterick who have
> contributed significantly to the community and done much to raise the
> profile
> of the Racket language. While his code contributions are evident, we should
> also bear in mind that there is much of value that cannot be parsed by the
> reader, and is not easy to evaluate. It takes a special sagacity to do the
> kind
> of community building that he has done, and I know I've been grateful to
> read
> some of his - relatively infrequent now - posts on this list in the past.
> It's
> heartening to see apologies from those involved. We all make mistakes, and
> apologies are not easy. I hope that those familiar will also, based on an
> honest appraisal of the facts and sincere reflection, take necessary steps
> to
> ensure that this kind of thing doesn't happen in the future. I hope and
> believe
> we can do more to help people feel welcome and encouraged, and in
> particular, I
> am sure I speak for many when I say that I hope that we can make it right
> with
> Matthew.
>
>
> On Fri, Jun 18, 2021 at 7:07 PM Sam Tobin-Hochstadt 
> wrote:
>
>> We were saddened to read [Matthew Butterick's recent post]. Matthias
>> has written his own [apology] in response.
>>
>> For our part, some of us were present for the interaction between
>> Matthew Butterick and Matthias Felleisen and some of us learned about
>> it later. We did not intervene in the way that we should have, and we
>> are sorry.
>>
>> If you wish to offer your thoughts to the people named below, the
>> email address feedb...@racket-lang.org will reach us directly.
>>
>> Jay McCarthy
>> John Clements
>> Matthew Flatt
>> Robby Findler
>> Sam Tobin-Hochstadt
>>
>> [Matthew Butterick's recent post]:
>>
>> https://beautifulracket.com/appendix/why-i-no-longer-contribute-to-racket.html
>> [his own apology]: https://felleisen.org/matthias/Thoughts/Apology.html
>>
>> --
>> You received this message because you are subscribed to the Google 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%2BZrg1dw%3Ds1HnO17hBU55x%2B%3D9XkEonLxNjwyi-gu1jrfcw%40mail.gmail.com
>> .
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87eecuwdtv.fsf%40privacyrequired.com.


Re: [racket-users] Registered on irc.libera.chat

2021-05-25 Thread Yury Bulka
#haskell seems to have been taken over:

https://www.reddit.com/r/haskell/comments/nl74hc/freenode_has_unilaterally_taken_over_haskell/


--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



David Bremner  writes:

> Hendrik Boom  writes:
>
>>
>> Experience in other channels indicates that saying you are moving to 
>> libera.chat will get the quick response of having your administrator 
>> privileges revoked and having that message deleted.
>>
>
> For what it is worth, that has not been my experience. I have moved
> several channels to libera.chat (either just by setting /topic, or
> taking more extreme measures that effectively lock the freenode
> channel), and nobody has cared/responded so far. Of course there is now
> a policy such channels can officially be taken over on freenode, but in
> the long term I don't expect to control what happens on freenode in my
> absence.
>
> d

-- 
You received this message because you are subscribed to the Google 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/87tumq58qm.fsf%40privacyrequired.com.


Re: [racket-users] Freenode -> libera.chat

2021-05-22 Thread Yury Bulka
A more general remank on the governance of these channels (freenode /
libera, but also other non-IRC venues like Discord or Slack).

I think it is important that there is no ambiguisty as to whether the
Racket project has meaningful control over a given communication
channel.

For instance, if there are a Friendly Environment Policy violation or
other issue, there is (or isn't) a way to handle that.

Or simply when there is a need to establish a process for making a
qpolicy decision regarding a particular channel (like migration or
non-migration from freenode to libera).

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Nathaniel W Griswold  writes:

> There is some strangeness with the freenode situation. Andrew Lee posted a 
> pdf publicly and is talking about it right now on this thread if you haven't 
> seen it: https://news.ycombinator.com/item?id=27234542
>
> Nate
>
>> On May 20, 2021, at 2:30 PM, Stephen De Gabrielle  
>> wrote:
>> 
>> I don’t use IRC much/ever - but in the event the irc links need to change 
>> from freenode, links are present in the following places:
>> 
>> 1. Homepage
>> 2. https://racket-lang.org/irc-chat.html
>> 3. Wiki - github
>> 4. Reddit - mod access required
>> 
>> Current text: #racket IRC on freenode.net
>> Replacement text: #racket IRC on irc.libera.chat
>> 
>> Current link: https://webchat.freenode.net/#racket
>> Replacement link: https://kiwiirc.com/nextclient/irc.libera.chat/#racket 
>> (Thanks to Tony Garnock-Jones )
>> 
>> 
>> S.
>> 
>> 
>> On Thu, 20 May 2021 at 14:16, Tony Garnock-Jones  
>> wrote:
>> https://web.archive.org/web/20210520002957/http://kline.sh/ is a good 
>> starting point.
>> 
>> On 20 May 2021, 15:12, at 15:12, David Storrs  wrote:
>> >What happened with Freenode?
>> >
>> >On Thu, May 20, 2021 at 8:12 AM Tony Garnock-Jones <
>> >to...@leastfixedpoint.com> wrote:
>> >
>> >> On 5/20/21 1:28 PM, Paulo Matos wrote:
>> >> > Tony Garnock-Jones writes:
>> >> >> With the recent damage to the Freenode IRC network, a new
>> >`#racket` has
>> >> >> been founded on irc.libera.chat.
>> >> >
>> >> > Is this to become the canonical IRC chat room for Racket?
>> >>
>> >> ¯\_(ツ)_/¯
>> >>
>> >> I'd be in favour of moving off Freenode, myself.
>> >>
>> >> What would need updating? Presumably little more than the following:
>> >>
>> >>- https://racket-lang.org/irc-chat.html
>> >>
>> >> ? Is freenode mentioned anywhere else?
>> >>
>> >> Cheers,
>> >>Tony
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >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/4956afef-9ef6-cf9d-d2ce-61d83d3780ec%40leastfixedpoint.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/1fe52f10-762a-483c-b4fc-ea35e3cb0aa8%40leastfixedpoint.com.
>> -- 
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/CAGHj7-%2B180mERTwmRAroKKepSnWMVOxPHcm0-X2EvXK0v6eAMA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87pmxj6rb9.fsf%40privacyrequired.com.


Re: [racket-users] Add Link to the racket Discord to the racket website?

2021-04-29 Thread Yury Bulka
>From within matrix one can join any freenode IRC channel by joining a
room by the name #freenode_:matrix.org

The racket IRC channel is accessible on matrix as

#freenode_#racket:matrix.org

Using the element web client I can access the room at this URL:
https://app.element.io/#/room/#freenode_#racket:matrix.org

AFAICT this creates an syncronized matrix room for the channel behind
the scenes; also it has message history, so acts similarly to an IRC
bouncer in this regard.

Since the Racket IRC channel requires that your nick is registered,
before accessing it from matrix, you should authenticate with NickServ:
https://matrix-org.github.io/matrix-appservice-irc/latest/usage.html#customising-your-experience

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Paulo Matos  writes:

> Yury Bulka writes:
>
>> I would just clarify that in the case of Racket, the IRC channel and the 
>> matrix room are the same room (they are joined together via a bridge).
>>
>
> Which matrix room are we talking about here? First time I hear about a
> matrix room.
>
> -- 
> Paulo Matos

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87eeetgkyh.fsf%40privacyrequired.com.


Re: [racket-users] Add Link to the racket Discord to the racket website?

2021-04-29 Thread Yury Bulka
I would just clarify that in the case of Racket, the IRC channel and the matrix 
room are the same room (they are joined together via a bridge).

23 квітня 2021 р. 03:22:33 GMT+03:00, John Clements  
написав:
>This is the second time I’ve heard of matrix.org this week. Time to
>check it out.
>
>John
>
>> On Apr 20, 2021, at 1:45 AM, Yury Bulka
> wrote:
>> 
>> Just my 5 cents...
>> 
>> Recently I had to register on a discord "server" to ask a question
>> within another community - and the experience was of a high barrier
>of
>> entry. I needed to provide my age, confirm my email, then (that might
>be
>> an issue of that particular "server" - I'm not sure) I was forced to
>> wait 5 minutes before I could interact. Also I notice now that
>discord
>> sends me email notifications that contain third-party tracking.
>> 
>> Another walled garden trying to make me an addict of their service.
>> 
>> The only thing I want to do now is delete any of my presence on
>discord.
>> 
>> The IRC + Matrix combination is much more open and inclusive I think.
>> 
>> And there is a question of transparency of governance and moderation
>of
>> course.
>> 
>> --
>> Yury Bulka
>> https://mamot.fr/@setthemfree
>> #NotOnFacebook
>> 
>> 
>> 
>> Adam Golding  writes:
>> 
>>> I'm not so sure now:
>https://groups.google.com/g/racket-users/c/SkJAKkQhlgw
>>> 
>>> 
>>> On Mon, 19 Apr 2021 at 03:39, Adam Golding 
>wrote:
>>> 
>>>> seconded
>>>> 
>>>> On Sun, 18 Apr 2021 at 14:56, schle...@gmail.com
>
>>>> wrote:
>>>> 
>>>>> 
>>>>> The racket discord is managed quite well, I think it should be
>added to
>>>>> the racket website so that newcomers can find it easier, just a
>thought.
>>>>> 
>>>>> Maybe below the link to slack?
>>>>> 
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>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/a8e865db-f585-477d-b397-fceaa7cb3131n%40googlegroups.com
>>>>>
><https://groups.google.com/d/msgid/racket-users/a8e865db-f585-477d-b397-fceaa7cb3131n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> 
>>>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google
>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/87pmyp1gzf.fsf%40privacyrequired.com.

-- 
Sent from my PDP-11.

-- 
You received this message because you are subscribed to the Google 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/F9D0EE1F-EC99-4821-9FB1-2556843A3F8E%40privacyrequired.com.


Re: [racket-users] Add Link to the racket Discord to the racket website?

2021-04-20 Thread Yury Bulka
Just my 5 cents...

Recently I had to register on a discord "server" to ask a question
within another community - and the experience was of a high barrier of
entry. I needed to provide my age, confirm my email, then (that might be
an issue of that particular "server" - I'm not sure) I was forced to
wait 5 minutes before I could interact. Also I notice now that discord
sends me email notifications that contain third-party tracking.

Another walled garden trying to make me an addict of their service.

The only thing I want to do now is delete any of my presence on discord.

The IRC + Matrix combination is much more open and inclusive I think.

And there is a question of transparency of governance and moderation of
course.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Adam Golding  writes:

> I'm not so sure now: https://groups.google.com/g/racket-users/c/SkJAKkQhlgw
>
>
> On Mon, 19 Apr 2021 at 03:39, Adam Golding  wrote:
>
>> seconded
>>
>> On Sun, 18 Apr 2021 at 14:56, schle...@gmail.com 
>> wrote:
>>
>>>
>>> The racket discord is managed quite well, I think it should be added to
>>> the racket website so that newcomers can find it easier, just a thought.
>>>
>>> Maybe below the link to slack?
>>>
>>> --
>>> You received this message because you are subscribed to the Google 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/a8e865db-f585-477d-b397-fceaa7cb3131n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/racket-users/a8e865db-f585-477d-b397-fceaa7cb3131n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google 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/87pmyp1gzf.fsf%40privacyrequired.com.


Re: [racket-users] Racket Dev Sessions Streamed on Twitch

2021-03-26 Thread Yury Bulka
Thank you for sharing! Looking forward to watching :)

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Lindsey Handley  writes:

> Shameless plug here...
>
> For the past several months, Stephen Foster <https://github.com/srfoster/> 
> and I have been live streaming our game development in Racket on Twitch:
> https://www.twitch.tv/codespells
>
> We'd love to see some Racketeers! Feel free to stop by anytime and say hi, 
> or just hangout and watch some Racket programming! We generally stream from 
> ~9:30am-12pm M-F. You can follow us on Twitch for notifications when we go 
> live.
>
> If you'd like to learn more about the project, you can find information and 
> our blog on our website: https://codespells.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/875z1dy2dt.fsf%40privacyrequired.com.


Re: [racket-users] Method gen:custom-write of a struct not working within lists

2021-03-04 Thread Yury Bulka
Wow, so great to hear the a SuperCollider client in Racket is on the horizon:)

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Dimaugh Silvestris  writes:

> I have a struct defined as:
> (struct ugen sc.unit (name rate inputs) 
>   #:methods gen:custom-write
>   [(define write-proc
>  (make-constructor-style-printer
>   [λ (x) (let [(rate (ugen-rate x))
>(name (symbol-append (ugen-name x) ':))]
>(cond [(eq? rate 'ar) name]
>  [else (symbol-append
> name rate)]))]
>   [λ (x) (ugen-inputs x)]))] #:transparent)
>
> So that (ugen 'sinosc 'ar (1 2)) prints as (sinosc: 1 2), which 
> incidentally it's the same as the function call that creates that value, 
> that is: (sinosc: 3 4) creates the struct instance (ugen 'sinosc 'ar (3 
> 4)). *
>
> The problem is, within a list it prints like '(#), which is 
> quite ugly.
>
> * I don't know if this is a smart choice. I'm building a SuperCollider 
> client, and in SuperCollider there's hundreds of ugens (unit generators, 
> such as oscillators, filters, etc).
> Because there's hundreds of them, I thought it might be heavy on memory or 
> cpu to declare a specific struct for each one of them; so I choose instead 
> to declare only constructors that build different instances of the ugen 
> struct.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87tupqelxo.fsf%40privacyrequired.com.


Re: [racket-users] A dict? question

2021-02-27 Thread Yury Bulka
Indeed,

> (dict-keys '('yay))
'(quote)
> (dict-values '('yay))
'((yay))
> (dict-ref '('yay) 'quote)
'(yay)

So... this boils down to:

> (equal? '('yay) '((quote yay)))
#t

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



William J. Bowman  writes:

> try (dict-ref ‘(‘yay) ‘quote)

-- 
You received this message because you are subscribed to the Google 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/87k0qtf51n.fsf%40privacyrequired.com.


[racket-users] A dict? question

2021-02-27 Thread Yury Bulka
Dear Racketeers,

I have noticed something I don't understand:

> (dict? '(yay))
#f
> (dict? '('yay))
#t
> (dict-ref '('yay) 'yay)
; dict-ref: no value for key: 'yay in: '('yay)

I'm puzzled - what makes '('yay) a dict compared to '(yay)?

(Running Racket 7.8 on Linux).

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook


-- 
You received this message because you are subscribed to the Google 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/87mtvpf5pa.fsf%40privacyrequired.com.


Re: [racket-users] Sticky scrollable nav bar in docs

2021-02-18 Thread Yury Bulka
I agree this is a useful improvement. I would consider using "position:
sticky" instead of "position: fixed" as that is generally less
"intrusive" to the layout and doesn't create a need for a second scroll
bar (the element would scroll as needed with the main scrollbar, but
still be sticky in the sense that it would keep itself within the
viewport).

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Sam Tobin-Hochstadt  writes:

> This seems like it would be a nice addition. I think starting with a
> PR is the right place to begin.
>
> Sam
>
> On Wed, Feb 17, 2021 at 7:01 PM 'William J. Bowman' via Racket Users
>  wrote:
>>
>> One of my students asked about making the Racket docs navbar sticky and 
>> scrollable, to help when navigating very long docs pages. I made a quick 
>> hack and deployed it here:
>>   https://www.students.cs.ubc.ca/~cs-411/docs/reference/sets.html
>>
>> Personally I've found it very useful. Would this change make sense for the 
>> Racket docs generally? (With some polish by someone who is better at UX than 
>> me?)
>>
>> To implement it, I just replaced `doc-site.css` with the following
>>
>> .navsettop {
>> position: fixed;
>> z-index: 1;
>> background: #a7b0be;
>> height: auto;
>> }
>>
>>
>> .tocset {
>> position: fixed;
>> overflow-y: scroll;
>> height: 88%;
>> }
>>
>> --
>> William J. Bowman
>>
>> --
>> You received this message because you are subscribed to the Google 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/YC2uQ3BJIsMJTsMP%40williamjbowman.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/87zh01ht4j.fsf%40privacyrequired.com.


Re: [racket-users] Racket / [B]SL / HTDP in a workshop context

2020-12-13 Thread Yury Bulka
John Clements  writes:
>> Do you mean as opposed to a more popular language like Python or
>> JavaScript? Or in some other regard (like building GUI apps)?
>
> The former, yes. Not saying you can’t handle this, but it’s something
> to be aware of. Especially because you’re using a language called
> “Beginning Student Language.” That name is clear and transparent and
> honest, and maybe the world has moved past this kind of ignorance, but
> I think a bit of planning might not go amiss.
>
Thanks for bringing this up. I was thinking about this before; all I can
think of at the momemnt is to do my best to communicate in advance the
intent of the workshop? To emphasize the fact that this is not going to
be about Python or JavaScript specifically (and not Scratch either).

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook

-- 
You received this message because you are subscribed to the Google 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/87mtyhb9kp.fsf%40privacyrequired.com.


Re: [racket-users] Racket / [B]SL / HTDP in a workshop context

2020-12-12 Thread Yury Bulka
> 1) “authenticity”; will the participants feel that programming in
> Racket is “real” programming?
Do you mean as opposed to a more popular language like Python or
JavaScript? Or in some other regard (like building GUI apps)?

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



John Clements  writes:

> In that case, I would think carefully about 
>
> 1) “authenticity”; will the participants feel that programming in Racket is 
> “real” programming?
> 2) How you’d like the participants to engage with the material after the 
> workshop. Their motivation and time availability are both likely to be low 
> (well, maybe that’s just my own experience :))
>
> John
>
>> On Dec 12, 2020, at 11:39, Yury Bulka  
>> wrote:
>> 
>> Thanks for the feedback. In my case, most likely, the participants will
>> be around 16-22 years old, no particular specialisation but curious
>> about programming.
>> 
>> --
>> Yury Bulka
>> https://mamot.fr/@setthemfree
>> #NotOnFacebook
>> 
>> 
>> 
>> John Clements  writes:
>> 
>>> My opinion: it depends on lots of things, but I think the biggest one is 
>>> the makeup of your audience. If they’re (say) a bunch of retired 
>>> accountants that are passionate about understanding how programs work and 
>>> have lots of time to follow up after your sessions and possibly some 
>>> “office hours” after the fact, I think you might “click” with ten to twenty 
>>> percent of them.
>>> 
>>> This probably goes without saying, but in three sessions, you’re not going 
>>> to be building expertise; you’re (hopefully) going to be building the 
>>> excitement and laying the foundation for them to learn on their own.
>>> 
>>> All just my opinions, of course!
>>> 
>>> John
>>> 
>>>> On Dec 12, 2020, at 04:15, Yury Bulka  
>>>> wrote:
>>>> 
>>>> Dear Racket community,
>>>> 
>>>> I'm wondering whether any guidelines / methodology exist out there on
>>>> using Racket and/or the student languages as a learning environment in a
>>>> workshop context (specifically aimed at introducing non-programmers to
>>>> programming and problem solving in a HTDP spirit).
>>>> 
>>>> The idea of such a hypothetical workshop is to have two or three
>>>> sessions with a small group (5-7 participants), and to reach a point in
>>>> the end where they are comfortable with reasoning about the how a
>>>> program evaluates and how to use functions to encapsulate simple
>>>> problems and solutions, possibly in this 5-step process:
>>>> http://htdp.org/2020-8-1/Book/part_preface.html#%28counter._%28figure._fig~3athe-design-recipe%29%29
>>>> 
>>>> Is this too ambitious plan at all? Does it require _way_ more time or is
>>>> it doable?
>>>> 
>>>> Thank you for any thoughts,
>>>> --
>>>> Yury Bulka
>>>> https://mamot.fr/@setthemfree
>>>> #NotOnFacebook
>>>> 
>>>> 
>>>> -- 
>>>> You received this message because you are subscribed to the Google 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/878sa3cj9q.fsf%40privacyrequired.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/87tusqbuc6.fsf%40privacyrequired.com.


Re: [racket-users] Racket / [B]SL / HTDP in a workshop context

2020-12-12 Thread Yury Bulka
Thanks for the feedback. In my case, most likely, the participants will
be around 16-22 years old, no particular specialisation but curious
about programming.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



John Clements  writes:

> My opinion: it depends on lots of things, but I think the biggest one is the 
> makeup of your audience. If they’re (say) a bunch of retired accountants that 
> are passionate about understanding how programs work and have lots of time to 
> follow up after your sessions and possibly some “office hours” after the 
> fact, I think you might “click” with ten to twenty percent of them.
>
> This probably goes without saying, but in three sessions, you’re not going to 
> be building expertise; you’re (hopefully) going to be building the excitement 
> and laying the foundation for them to learn on their own.
>
> All just my opinions, of course!
>
> John
>
>> On Dec 12, 2020, at 04:15, Yury Bulka  
>> wrote:
>> 
>> Dear Racket community,
>> 
>> I'm wondering whether any guidelines / methodology exist out there on
>> using Racket and/or the student languages as a learning environment in a
>> workshop context (specifically aimed at introducing non-programmers to
>> programming and problem solving in a HTDP spirit).
>> 
>> The idea of such a hypothetical workshop is to have two or three
>> sessions with a small group (5-7 participants), and to reach a point in
>> the end where they are comfortable with reasoning about the how a
>> program evaluates and how to use functions to encapsulate simple
>> problems and solutions, possibly in this 5-step process:
>> http://htdp.org/2020-8-1/Book/part_preface.html#%28counter._%28figure._fig~3athe-design-recipe%29%29
>> 
>> Is this too ambitious plan at all? Does it require _way_ more time or is
>> it doable?
>> 
>> Thank you for any thoughts,
>> --
>> Yury Bulka
>> https://mamot.fr/@setthemfree
>> #NotOnFacebook
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google 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/878sa3cj9q.fsf%40privacyrequired.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/87y2i2byqi.fsf%40privacyrequired.com.


[racket-users] Racket / [B]SL / HTDP in a workshop context

2020-12-12 Thread Yury Bulka
Dear Racket community,

I'm wondering whether any guidelines / methodology exist out there on
using Racket and/or the student languages as a learning environment in a
workshop context (specifically aimed at introducing non-programmers to
programming and problem solving in a HTDP spirit).

The idea of such a hypothetical workshop is to have two or three
sessions with a small group (5-7 participants), and to reach a point in
the end where they are comfortable with reasoning about the how a
program evaluates and how to use functions to encapsulate simple
problems and solutions, possibly in this 5-step process:
http://htdp.org/2020-8-1/Book/part_preface.html#%28counter._%28figure._fig~3athe-design-recipe%29%29

Is this too ambitious plan at all? Does it require _way_ more time or is
it doable?

Thank you for any thoughts,
--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook


-- 
You received this message because you are subscribed to the Google 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/878sa3cj9q.fsf%40privacyrequired.com.


Re: [racket-users] Is there a way to open (and just view) a Racket file (e. g. .rkt or .scrbl extensions) from Google Drive?

2020-07-07 Thread Yury Bulka
> maybe the racket-away paste(bin) will be handy?
that should have been racket-*aware*, sorry for the typo.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook

-- 
You received this message because you are subscribed to the Google 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/87a70b2ejg.fsf%40privacyrequired.com.


Re: [racket-users] Is there a way to open (and just view) a Racket file (e. g. .rkt or .scrbl extensions) from Google Drive?

2020-07-07 Thread Yury Bulka
Sorry if it's slightly offtopic, but if you want to share a read-only snippet of
racket code, maybe the racket-away paste(bin) will be handy?

http://pasterack.org/

It can also run the code:)

Otherwise, recently I have started using https://cryptpad.fr as a casual
alternative to Google Drive, and it has a "Code" document type that has
Scheme syntax highligthing (and end-to-end encryption).

Best,
--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Sorawee Porncharoenwase  writes:

> A quick Google returns this site:
> https://superuser.com/questions/659666/how-do-i-get-google-drive-to-open-text-files-with-arbitrary-extensions-as-text-f
>
> So it looks like there's no way if you are not willing to rename files or
> use a third-party text editor in Google Drive.
>
> On Tue, Jul 7, 2020 at 1:12 PM E Comer  wrote:
>
>> Dear Racket users:
>>
>> Is there a way to* open* (and just *view*) a Racket file (in particular,
>> with extensions *.rkt *or *.scrbl*) from *Google Drive*? (in my case is
>> not necessary even to edit the file, just to verify content).
>>
>> Thank you very much for any pointer to reach that purpose.
>>
>> Please Keep Safe.
>> E. Comer
>> (P.S. Thank you for the outstanding Racket related tools: DrRacket is
>> great, particularly in conjunction with Scribble).
>>
>> --
>> You received this message because you are subscribed to the Google 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/d229a4d9-96a7-4ae3-86bc-8aded49aa99co%40googlegroups.com
>> <https://groups.google.com/d/msgid/racket-users/d229a4d9-96a7-4ae3-86bc-8aded49aa99co%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>

-- 
You received this message because you are subscribed to the Google 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/87d0572eqp.fsf%40privacyrequired.com.


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

2020-06-08 Thread Yury Bulka
Wow, from 695 requests per second to 49,516 is a huge improvement!

Since we were comparing to django previously, it's now much closer with
django (which does 78,132 rps.)

Django also does run multiple worker processes (3 per cpu):
https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Python/django/gunicorn_conf.py#L8

The other tests are also doing much better.

So do I undestand correctly that the factors that contribute to the
improvement are:

1. running multiple worker processes behind nginx
2. adding content-length to all responses
3. using CS variant of Racket
4. using Racket 7.7
5. tuning nginx config (enabling http 1.1 especially)

I'm curious what was the individual contribution of these factors. In
the PR regarding #5 you already stated that it gives a 4-5x improvement.

#1 and #5 are the things one would normally do anyway in a production
setup I guess. As is #4 most likely.

#2 is something that seems to require manual work in the client code,
but maybe that can be made easier on web-server-lib side somehow.

Curious how much do #3 contribute.

Big thanks again for everyone investing time in investigating this.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook


Bogdan Popa  writes:

> Small update on this: I've updated the benchmarks to run multiple Racket
> processes with an Nginx load balancer in front.  After some tuning[1], here
> is what the results look like on my 12 core AMD Ryzen 9 3900 server:
>
> https://www.techempower.com/benchmarks/#section=test&shareid=669bfab7-9242-4c26-8921-a4fe9ccd8530&hw=ph&test=composite&a=2
>
> 50k/s is a respectable number for the plaintext benchmark IMO and we
> could get it to go higher if we could ditch Nginx or spend more time
> improving the server's internals, as Sam suggested.
>
> The `racket-perf' benchmark is for a branch[2] that I have where I've made
> some small improvements to the server's internals.
>
> [0]: https://github.com/TechEmpower/FrameworkBenchmarks/pull/5727
> [1]: https://github.com/TechEmpower/FrameworkBenchmarks/pull/5737
> [2]: https://github.com/racket/web-server/pull/94

-- 
You received this message because you are subscribed to the Google 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/87y2oxq33h.fsf%40privacyrequired.com.


Re: [racket-users] for/stream and values

2020-05-03 Thread Yury Bulka
Sorawee Porncharoenwase  writes:

>>
>> Thank you for the package! So, do I understand correcty that it is
>> impossible to produce multi-valued streams with for/stream? If so, maybe
>> it's worth adding a note about it to the documentation of for/stream?
>>
>
> That is correct. Feel free to submit a PR to improve the documentation. You
> will need to edit this file:
> https://github.com/racket/racket/blob/master/pkgs/racket-doc/scribblings/reference/sequences.scrbl#L1186

I have created a draft pull request:
https://github.com/racket/racket/pull/3147

>> Also, I notice in the manual of your package that you mention that
>> generators are inefficient in the default implementation of
>> Racket. Since I'm using generators too, I'm curious about the
>> performance implications - where can I read more about it?
>>
>
> I don't think it's written anywhere explicitly, but you can take a look at
> https://blog.racket-lang.org/2020/02/racket-on-chez-status.html in the
> section "Run-Time Performance Redux", which compares the performance of
> generators in Racket 3m vs Racket CS.

Oh, that's useful. Thank you!

-- 
You received this message because you are subscribed to the Google 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/877dxsopth.fsf%40privacyrequired.com.


Re: [racket-users] for/stream and values

2020-05-03 Thread Yury Bulka
Thank you for the package! So, do I understand correcty that it is
impossible to produce multi-valued streams with for/stream? If so, maybe
it's worth adding a note about it to the documentation of for/stream?

Also, I notice in the manual of your package that you mention that
generators are inefficient in the default implementation of
Racket. Since I'm using generators too, I'm curious about the
performance implications - where can I read more about it?

Best,
--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Sorawee Porncharoenwase  writes:

> I just created a package that helps creating a stream of multiple values a
> couple of weeks ago. You might find it useful:
> https://docs.racket-lang.org/stream-values/
>
> On Sat, May 2, 2020 at 3:38 PM Yury Bulka 
> wrote:
>
>> (sorry for the typos - obviously, it should be racket/stream)
>>
>> --
>> Yury Bulka
>> https://mamot.fr/@setthemfree
>> #NotOnFacebook
>>
>>
>>
>> Yury Bulka  writes:
>>
>> > Hello everyone,
>> >
>> > I have a question about creating a steam that yields multiple values on
>> > each iteration. Given something like:
>> >
>> > (require racket/strema)
>> >
>> > (define my-stream (for/stream ([i (in-range 1 10)])
>> > (values "hi" i)))
>> >
>> > When I'm trying to:
>> >
>> > (let-values ([(a b) (stream-ref my-stream 0)])
>> > (printf "~v: ~v" a b))
>> >
>> > I'm getting:
>> >
>> > ; result arity mismatch;
>> > ;  expected number of values not received
>> > ;   expected: 1
>> > ;   received: 2
>> > ;   values...:
>> > ;"hi"
>> > ;2
>> > ; Context:
>> > ;
>> /nix/store/z4mpvw1p6whq454lmjshbdr6472sdbr3-racket-7.6/share/racket/collects/racket/repl.rkt:11:26
>> >
>> > Similarly:
>> >
>> > (for ([(a b) my-stream])
>> > (printf "~v: ~v" a b))
>> >
>> > leads to:
>> >
>> > ; result arity mismatch;
>> > ;  expected number of values not received
>> > ;   expected: 1
>> > ;   received: 2
>> > ;   values...:
>> > ;"hi"
>> > ;1
>> > ; Context:
>> > ;  tcp-accepted:1:1 for-loop
>> > ;  top-level:1:1 [running body]
>> > ;
>> /nix/store/z4mpvw1p6whq454lmjshbdr6472sdbr3-racket-7.6/share/racket/collects/racket/repl.rkt:11:26
>> >
>> > Documentation on stream-ref specifically mentions that it can have
>> > multiple values:
>> >
>> https://docs.racket-lang.org/reference/streams.html?q=stream-ref#%28def._%28%28lib._racket%2Fstream..rkt%29._stream-ref%29%29
>> >
>> > What am I doing wrong here?
>> >
>> > P.S. The context is that I'm trying to create a function that would
>> > return results from an API as a stream that can be iterated with the for
>> > family of forms, and would yield multiple values per iteration.
>> >
>> > --
>> > Yury Bulka
>> > https://mamot.fr/@setthemfree
>> > #NotOnFacebook
>>
>> --
>> You received this message because you are subscribed to the Google 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/87ees2nerz.fsf%40privacyrequired.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/87d07lo0ax.fsf%40privacyrequired.com.


Re: [racket-users] for/stream and values

2020-05-02 Thread Yury Bulka
(sorry for the typos - obviously, it should be racket/stream)

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Yury Bulka  writes:

> Hello everyone,
>
> I have a question about creating a steam that yields multiple values on
> each iteration. Given something like:
>
> (require racket/strema)
>
> (define my-stream (for/stream ([i (in-range 1 10)])
> (values "hi" i)))
>
> When I'm trying to:
>
> (let-values ([(a b) (stream-ref my-stream 0)])
> (printf "~v: ~v" a b))
>
> I'm getting:
>
> ; result arity mismatch;
> ;  expected number of values not received
> ;   expected: 1
> ;   received: 2
> ;   values...:
> ;"hi"
> ;2
> ; Context:
> ;  
> /nix/store/z4mpvw1p6whq454lmjshbdr6472sdbr3-racket-7.6/share/racket/collects/racket/repl.rkt:11:26
>
> Similarly:
>
> (for ([(a b) my-stream])
> (printf "~v: ~v" a b))
>
> leads to:
>
> ; result arity mismatch;
> ;  expected number of values not received
> ;   expected: 1
> ;   received: 2
> ;   values...:
> ;"hi"
> ;1
> ; Context:
> ;  tcp-accepted:1:1 for-loop
> ;  top-level:1:1 [running body]
> ;  
> /nix/store/z4mpvw1p6whq454lmjshbdr6472sdbr3-racket-7.6/share/racket/collects/racket/repl.rkt:11:26
>
> Documentation on stream-ref specifically mentions that it can have
> multiple values:
> https://docs.racket-lang.org/reference/streams.html?q=stream-ref#%28def._%28%28lib._racket%2Fstream..rkt%29._stream-ref%29%29
>
> What am I doing wrong here?
>
> P.S. The context is that I'm trying to create a function that would
> return results from an API as a stream that can be iterated with the for
> family of forms, and would yield multiple values per iteration.
>
> --
> Yury Bulka
> https://mamot.fr/@setthemfree
> #NotOnFacebook

-- 
You received this message because you are subscribed to the Google 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/87ees2nerz.fsf%40privacyrequired.com.


[racket-users] for/stream and values

2020-05-02 Thread Yury Bulka
Hello everyone,

I have a question about creating a steam that yields multiple values on
each iteration. Given something like:

(require racket/strema)

(define my-stream (for/stream ([i (in-range 1 10)])
(values "hi" i)))

When I'm trying to:

(let-values ([(a b) (stream-ref my-stream 0)])
(printf "~v: ~v" a b))

I'm getting:

; result arity mismatch;
;  expected number of values not received
;   expected: 1
;   received: 2
;   values...:
;"hi"
;2
; Context:
;  
/nix/store/z4mpvw1p6whq454lmjshbdr6472sdbr3-racket-7.6/share/racket/collects/racket/repl.rkt:11:26

Similarly:

(for ([(a b) my-stream])
(printf "~v: ~v" a b))

leads to:

; result arity mismatch;
;  expected number of values not received
;   expected: 1
;   received: 2
;   values...:
;"hi"
;1
; Context:
;  tcp-accepted:1:1 for-loop
;  top-level:1:1 [running body]
;  
/nix/store/z4mpvw1p6whq454lmjshbdr6472sdbr3-racket-7.6/share/racket/collects/racket/repl.rkt:11:26

Documentation on stream-ref specifically mentions that it can have
multiple values:
https://docs.racket-lang.org/reference/streams.html?q=stream-ref#%28def._%28%28lib._racket%2Fstream..rkt%29._stream-ref%29%29

What am I doing wrong here?

P.S. The context is that I'm trying to create a function that would
return results from an API as a stream that can be iterated with the for
family of forms, and would yield multiple values per iteration.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook

-- 
You received this message because you are subscribed to the Google 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/87ftcineuk.fsf%40privacyrequired.com.


Re: [racket-users] Re: Question about generating urls with dispatch-rules from imported modules

2020-04-29 Thread Yury Bulka


Greg Hendershott  writes:

> Although I haven't tried to use it hands-on, the description of the
> imperative flavor makes me think it might be intended to help with this?
>
> https://docs.racket-lang.org/web-server/dispatch.html#%28part._.Imperative_.Dispatch_.Containers%29
Hm, that's interesting - it seems to allow modifying a set of already
defined urls; but there might be a usage pattern for my use case that
I'm failing to see.

> p.s. In general you *can* do mutual requires with lazy-require. However you
> defer some errors to runtime, and, you need to list explicitly each
> definition you want to import. IMHO it's better for when the motivation to
> be lazy is about deferring loading and initializing a module, than it is
> for mutual imports. For the latter I tend to just try to move the shared
> definitions to some new module that the others require.
Thank you for commenting on that. Good to know.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87sggmgio1.fsf%40privacyrequired.com.


Re: [racket-users] Question about generating urls with dispatch-rules from imported modules

2020-04-26 Thread Yury Bulka
Meanwhile here's my attempt at doing a koyo-like url generation with a
wrapper around web-server/dispatch's url-generating function:

(define-values (app-dispatch app-url)
  (dispatch-rules  ; the standard one
   [...]))

(define (app-url/names route-name . args)
  ;; define a mapping between symbolic names and handlers
  (define route-names
(hash 'item-list item-list-view
  'item-detail item-detail-view))
  (apply app-url (hash-ref route-names route-name) args))

And then I can store the function in a parameter that is used by the
templates.

It is of course not a general solution (for instance, the rules in
dispatch-rules and the route-names can go out of sync if one forgets to
update either of them) and they are not dynamic.

But for an ultra-minimalistic application this might do when you don't
feel like adding a new external dependency.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Yury Bulka  writes:

> Thank you for sharing this!
>
> I'm wondering, if this is a common use case, maybe it is worth adding to
> web-server/dispatch in some form?
>
> Or, if not, maybe we can extend the documentation to include some hints
> on how to approach this otherwise?
>
> It is great to have powerful libraries outside the main distribution,
> but the main distribution is the place where newcomers like me are going
> to look first.

-- 
You received this message because you are subscribed to the Google 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/87o8rei7yx.fsf%40privacyrequired.com.


Re: [racket-users] Question about generating urls with dispatch-rules from imported modules

2020-04-26 Thread Yury Bulka
Thank you for sharing this!

I'm wondering, if this is a common use case, maybe it is worth adding to
web-server/dispatch in some form?

Or, if not, maybe we can extend the documentation to include some hints
on how to approach this otherwise?

It is great to have powerful libraries outside the main distribution,
but the main distribution is the place where newcomers like me are going
to look first.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Bogdan Popa  writes:

> I solved this in koyo by defining an alternate version[1] of
> `dispatch-rules' whose generated `reverse-uri' functions take route
> names rather than functions as arguments:
>
> https://koyoweb.org/dispatch/index.html#%28form._%28%28lib._koyo%2Fdispatch..rkt%29._dispatch-rules%2Broles%29%29
>
> The generated function is installed into a parameter on app init and
> another function[2] knows how to look it up and apply it when called:
>
> https://koyoweb.org/url/index.html#%28def._%28%28lib._koyo%2Furl..rkt%29._current-reverse-uri-fn%29%29
>
> I hope that helps!
>
> [1]: 
> https://github.com/Bogdanp/koyo/blob/331701e9e8d7f553955ea5a950df424ee13ce9d4/koyo-lib/koyo/dispatch.rkt
> [2]: 
> https://github.com/Bogdanp/koyo/blob/331701e9e8d7f553955ea5a950df424ee13ce9d4/koyo-lib/koyo/url.rkt#L60
>
> Yury Bulka writes:
>
>> Oops, small correction:
>>
>>> The x-expressions need to include hyperlinks to urls
>>> defined via dispatch-rules in main.rkt, i.e., call the url-generating
>>> function.
>>
>> Should be `routing.rkt` instead of `main.rkt`.
>>
>> --
>> Yury Bulka
>> https://mamot.fr/@setthemfree
>> #NotOnFacebook
>>
>>
>>
>> Yury Bulka  writes:
>>
>>> Dear Racket community,
>>>
>>> First of all I want to say hello since this is my first post here.
>>>
>>> I have a question about using the url dispatch library:
>>> https://docs.racket-lang.org/web-server/dispatch.html
>>>
>>> More specifically about the url-generation function in the context of
>>> inter-module dependencies.
>>>
>>> Let's say in `routing.rkt` I define some request handlers and then map
>>> them to urls using dispatch-rules.
>>>
>>> The request handlers call functions from another module that are
>>> responsible for generating the x-expressions (let's call this module
>>> `templates.rkt`). The x-expressions need to include hyperlinks to urls
>>> defined via dispatch-rules in main.rkt, i.e., call the url-generating
>>> function.
>>>
>>> The url-generating function, in turn, needs to be provided the request
>>> handler as the first argument.
>>>
>>> That means that the xexpr-generating function needs to have access to
>>> the url-generating function and all the request handlers it might
>>> need to include hyperlinks to, or it may need to be provided with all
>>> the generated urls in advance.
>>>
>>> Something like this wouldn't work if render-post needed to generate a url:
>>>
>>> ;; A request handler associated with a url
>>> (define (single-post-view request post-id)
>>>   (response/xexpr (render-post (post-id))) ;; render-post is in another 
>>> file/module
>>>
>>> I wouldn't want to make templates.rkt require routing.rkt (I'm not sure
>>> this is technically possible to have modules depend on each other like
>>> that), nor would I want to provide all the request handlers as arguments
>>> to `render-post`. I also thought about putting the url-generating
>>> function into a parameter, but `render-post` also needs access to the
>>> request handlers.
>>>
>>> What approach should I take?
>>>
>>> --
>>> Yury Bulka
>>> https://mamot.fr/@setthemfree
>>> #NotOnFacebook

-- 
You received this message because you are subscribed to the Google 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/87r1waip4b.fsf%40privacyrequired.com.


Re: [racket-users] Question about generating urls with dispatch-rules from imported modules

2020-04-25 Thread Yury Bulka
Oops, small correction:

> The x-expressions need to include hyperlinks to urls
> defined via dispatch-rules in main.rkt, i.e., call the url-generating
> function.

Should be `routing.rkt` instead of `main.rkt`.

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook



Yury Bulka  writes:

> Dear Racket community,
>
> First of all I want to say hello since this is my first post here.
>
> I have a question about using the url dispatch library:
> https://docs.racket-lang.org/web-server/dispatch.html
>
> More specifically about the url-generation function in the context of
> inter-module dependencies.
>
> Let's say in `routing.rkt` I define some request handlers and then map
> them to urls using dispatch-rules.
>
> The request handlers call functions from another module that are
> responsible for generating the x-expressions (let's call this module
> `templates.rkt`). The x-expressions need to include hyperlinks to urls
> defined via dispatch-rules in main.rkt, i.e., call the url-generating
> function.
>
> The url-generating function, in turn, needs to be provided the request
> handler as the first argument.
>
> That means that the xexpr-generating function needs to have access to
> the url-generating function and all the request handlers it might
> need to include hyperlinks to, or it may need to be provided with all
> the generated urls in advance.
>
> Something like this wouldn't work if render-post needed to generate a url:
>
> ;; A request handler associated with a url
> (define (single-post-view request post-id)
>   (response/xexpr (render-post (post-id))) ;; render-post is in another 
> file/module
>
> I wouldn't want to make templates.rkt require routing.rkt (I'm not sure
> this is technically possible to have modules depend on each other like
> that), nor would I want to provide all the request handlers as arguments
> to `render-post`. I also thought about putting the url-generating
> function into a parameter, but `render-post` also needs access to the
> request handlers.
>
> What approach should I take?
>
> --
> Yury Bulka
> https://mamot.fr/@setthemfree
> #NotOnFacebook

-- 
You received this message because you are subscribed to the Google 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/87tv17iaq8.fsf%40privacyrequired.com.


[racket-users] Question about generating urls with dispatch-rules from imported modules

2020-04-25 Thread Yury Bulka
Dear Racket community,

First of all I want to say hello since this is my first post here.

I have a question about using the url dispatch library:
https://docs.racket-lang.org/web-server/dispatch.html

More specifically about the url-generation function in the context of
inter-module dependencies.

Let's say in `routing.rkt` I define some request handlers and then map
them to urls using dispatch-rules.

The request handlers call functions from another module that are
responsible for generating the x-expressions (let's call this module
`templates.rkt`). The x-expressions need to include hyperlinks to urls
defined via dispatch-rules in main.rkt, i.e., call the url-generating
function.

The url-generating function, in turn, needs to be provided the request
handler as the first argument.

That means that the xexpr-generating function needs to have access to
the url-generating function and all the request handlers it might
need to include hyperlinks to, or it may need to be provided with all
the generated urls in advance.

Something like this wouldn't work if render-post needed to generate a url:

;; A request handler associated with a url
(define (single-post-view request post-id)
  (response/xexpr (render-post (post-id))) ;; render-post is in another 
file/module

I wouldn't want to make templates.rkt require routing.rkt (I'm not sure
this is technically possible to have modules depend on each other like
that), nor would I want to provide all the request handlers as arguments
to `render-post`. I also thought about putting the url-generating
function into a parameter, but `render-post` also needs access to the
request handlers.

What approach should I take?

--
Yury Bulka
https://mamot.fr/@setthemfree
#NotOnFacebook

-- 
You received this message because you are subscribed to the Google 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/87v9lnib0e.fsf%40privacyrequired.com.