-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web-server/servlet/web seems to inhibit stateless operation #126
Comments
In contrast, |
I agree that the documentation is as you state. However, I also think that if we're okay with flummoxing Shriram and everyone less racket- and technically minded than him (including me, I think... I tried once to use stateless servets and failed), we're probably not providing something that's as useful as it could be. I'm wondering how hard it would be to actually signal an error here. My ham-fisted idea is to simply set a global parameter that causes these primitives to signal an error. Or are there situations in which you'd want to use the stateful primitives in the stateless server? |
It is not an error. You may want to mix them when you need to capture a continuation in code that is not transformed by |
Ah well, I tried. |
@jeapostrophe you answered the second part of @jbclements's post and completely ignored the important part, which is the first part. |
I don't understand what a reply to the first part would look like. I read it as, "Yes, the documentation is accurate, but it is hard to use, huh?" I don't what problem John had using it, but I guess the solution can't be "add more writing", because I assume documentation in Racket is too subtle already. (You search for It would be possible to rename It would be possible to add a warning through some runtime stuff in So... what do you want? I feel like John is inviting me to think of ideas but I don't have any. I am cursed with the knowledge of how to actually use it. |
One concrete idea: I had almost suggested to @shriram Some other thoughts:
|
(Well, that's the default for |
These are all good ideas @LiberalArtist. Practically, I think it would be nice to do at least these three things:
|
Even better, perhaps libraries that are known to be problematic with stateful or stateless can explicitly check and error? Is that too hard? |
This issue has been mentioned on Racket Discourse. There might be relevant details there: https://racket.discourse.group/t/do-not-understand-stateful-vs-stateless-servlets/2220/2 |
OMG this is amazing!!! |
The conversation here and some references to Discourse suggest that this is a problem of the developer's "state of mind" (paraphrasing @shriram here, w/o saying that these people are in a "confused" mode of thought). So how about using "teaching libraries" (the analogue of teaching languages)? With Since the docs are written in Scribble, we can abstract over the content and produce a "beginner" version where every function name is prefixed. There is no question which function belongs where. Advanced developers -- with tons of paged-in experience -- can ignore the prefixed variants and simply use the plain ones. They can switch from one mode to another with the change of a couple of lines for debugging. They can mix and match. They can read the non-prefixed docs and, when their modes of thoughts become confused, they can go back to the prefixed docs. (Perhaps the two should be interlinked with margin notes.) (In general, I think *SL could benefit from teaching levels for packages but in this context, prefixing is too hard.) |
So now if you want to switch briefly between the two — eg, stateless is not working, so you want to confirm that at least in stateful it works okay so the error isn't with your application logic — you have to find and change every |
No, see variant -- assuming you're an experienced developer. |
I had a rough time getting stateless servers to work. The culprit appears to be
web-server/servlet/web
. Include it and stateless does not work, exclude it and it works quite seamlessly on a non-trivial system. Seehttps://discord.com/channels/571040468092321801/1128483815787077692
for a small, illustrative example, reproduced below.
However, I don't see anything in the documentation for either stateless or
web-server/servlet/web
that indicate this. It should be documented in both places.Sample program:
The text was updated successfully, but these errors were encountered: