Re: [racket-users] sxml vs xexpr frustrations

2019-01-30 Thread Konrad Hinsen

Am 30.01.19 um 19:27 schrieb Christopher Lemmer Webber:


One very frustrating thing for me is the inconsistency between which
sexp xml representation is the "right" one, sxml or xexpr.  Different
tools support different things, and thus don't interoperate when they
easily could have.


Sounds... familiar.


IMO, it makes more sense to have sxml be the "right" one, since it has
wider user outside of just Racket, and there are some much nicer tools
available for it:


On the xexpr side, there are some very nice tools as well, in particular 
Matthew Butterick's Pollen:


https://docs.racket-lang.org/pollen/

and its low-level foundation txexpr:

https://docs.racket-lang.org/txexpr/index.html

I actually migrated code from SXML to xexpr in order to be able to use 
Pollen.


Konrad.

--
You received this message because you are subscribed to the Google 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: updated Racket-on-Chez status

2019-01-30 Thread Robby Findler
Also I think that the size of the code generated by arrow contracts
(when keywords are involved and other situations that perhaps aren't
worth spelling out in detail in this email) is larger than we would
like, which also doesn't help.

Robby

On Wed, Jan 30, 2019 at 7:52 PM Sam Tobin-Hochstadt
 wrote:
>
> On Wed, Jan 30, 2019 at 8:23 PM Matthew Flatt  wrote:
> >
> > At Wed, 30 Jan 2019 16:31:52 -0800 (PST), Alex Harsanyi wrote:
> > > I always assumed that the contracts generated when TR code is used from
> > > untyped Racket would be the same as the ones written by hand if the module
> > > would be untyped and had contracts on the same exported functions.  Is 
> > > this
> > > not the case?
> >
> > That's pretty much the case, as far as I know.
>
> That is (mostly) the case, except that Typed Racket generates
> completely comprehensive contracts, which can mean they're much larger
> than what you might write idiomatically.
>
> > > Is there some documentation on how to measure the amount of code used by
> > > contracts (the 15% value you mention above)?
> >
> > No. Sam set up a branch of TR that skipped contract generation, and I
> > compared ".zo" sizes using that branch versus the normal one.
>
> That branch is at https://github.com/samth/typed-racket/tree/no-contracts
>
> > > I experimented with TR for a few things and left them in the code
> > > base, but if they create significant performance issues, I can
> > > convert them to untyped Racket easily.
> >
> > Although there are costs to TR in compile time and load time,
> > especially in a program that also has untyped components, I generally
> > would not recommend moving away from TR.
>
> Unlike Matthew, I can be sure not to offend the creator of Typed
> Racket by saying that in some cases, contract generation can take too
> much compile time or bytecode space, or result in too big a runtime
> overhead, to be acceptable. In those cases, I recommend either using
> the `typed/racket/unsafe` library to omit contracts (and protect
> things manually) or move away from Typed Racket entirely. The places I
> know where this has been an issue are very large OO hierarchies (as in
> the `racket/gui` library) and very large data types constructed from
> many unions of many distinct structs. I'm happy to take a look at your
> code if that would be helpful.
>
> Sam
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> 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] Re: updated Racket-on-Chez status

2019-01-30 Thread Sam Tobin-Hochstadt
On Wed, Jan 30, 2019 at 8:23 PM Matthew Flatt  wrote:
>
> At Wed, 30 Jan 2019 16:31:52 -0800 (PST), Alex Harsanyi wrote:
> > I always assumed that the contracts generated when TR code is used from
> > untyped Racket would be the same as the ones written by hand if the module
> > would be untyped and had contracts on the same exported functions.  Is this
> > not the case?
>
> That's pretty much the case, as far as I know.

That is (mostly) the case, except that Typed Racket generates
completely comprehensive contracts, which can mean they're much larger
than what you might write idiomatically.

> > Is there some documentation on how to measure the amount of code used by
> > contracts (the 15% value you mention above)?
>
> No. Sam set up a branch of TR that skipped contract generation, and I
> compared ".zo" sizes using that branch versus the normal one.

That branch is at https://github.com/samth/typed-racket/tree/no-contracts

> > I experimented with TR for a few things and left them in the code
> > base, but if they create significant performance issues, I can
> > convert them to untyped Racket easily.
>
> Although there are costs to TR in compile time and load time,
> especially in a program that also has untyped components, I generally
> would not recommend moving away from TR.

Unlike Matthew, I can be sure not to offend the creator of Typed
Racket by saying that in some cases, contract generation can take too
much compile time or bytecode space, or result in too big a runtime
overhead, to be acceptable. In those cases, I recommend either using
the `typed/racket/unsafe` library to omit contracts (and protect
things manually) or move away from Typed Racket entirely. The places I
know where this has been an issue are very large OO hierarchies (as in
the `racket/gui` library) and very large data types constructed from
many unions of many distinct structs. I'm happy to take a look at your
code if that would be helpful.

Sam

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


Re: [racket-users] Re: updated Racket-on-Chez status

2019-01-30 Thread Matthew Flatt
At Wed, 30 Jan 2019 16:31:52 -0800 (PST), Alex Harsanyi wrote:
> On Wednesday, January 30, 2019 at 10:53:21 PM UTC+8, Matthew Flatt wrote:
> >
> >  * A lot of code is generated from your source programs. 
> 
> 
> Do you mean (1) that the source code is large or (2) that the generated
> byte-code or machine code is unexpectedly large given the size of the
> sources?

(2)

> If (2), is there a way to structure it such that less code is generated from
> these sources?  Is there a "best practices" document for structuring Racket
> programs?

I don't think you should have to change your program, for now. Instead,
I think need to better understand how different layers of the language
implementation contribute to the code size. Maybe we find that
everything's really as it should be, or maybe not.

> I always assumed that the contracts generated when TR code is used from
> untyped Racket would be the same as the ones written by hand if the module
> would be untyped and had contracts on the same exported functions.  Is this
> not the case?

That's pretty much the case, as far as I know.

> Is there some documentation on how to measure the amount of code used by
> contracts (the 15% value you mention above)? 

No. Sam set up a branch of TR that skipped contract generation, and I
compared ".zo" sizes using that branch versus the normal one.

> I experimented with TR for a few things and left them in the code
> base, but if they create significant performance issues, I can
> convert them to untyped Racket easily.

Although there are costs to TR in compile time and load time,
especially in a program that also has untyped components, I generally
would not recommend moving away from TR.

> >  * The test suite involves significant I/O. As you mentioned, the test 
> >driving database operations, and those operations should be about 
> >the same. But the database is populated by parsing files, so slow 
> >I/O may be the bottleneck. 
>
> I am not sure what "significant" means, but the tests don't read and
> write a large amount of data:

I was probably wrong about this, because I didn't look before into
"fit-file.rkt". I see now that the data-parsing code there doesn't use
Racket's port API, so the I/O layer in Racket CS is probably not the
issue --- at least not in the way that I thought.

> I would be happy to help you identify where the performance degradation
> between Racket 7.1 and CS is when running these tests.

Small examples that illustrate slowness in a specific subsystem are
always helpful. I can't always make the subsystem go faster right away,
but sometimes.

-- 
You received this message because you are subscribed to the Google 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: updated Racket-on-Chez status

2019-01-30 Thread Alex Harsanyi


On Wednesday, January 30, 2019 at 10:53:21 PM UTC+8, Matthew Flatt wrote:
>
> At Tue, 29 Jan 2019 17:32:42 -0800 (PST), Alex Harsanyi wrote: 
> > I mention this because the report recommends making 
> > Racket CS the default, which I am very concerned about: 
> > 
> > > To maximize the maintenance benefits of Racket CS, it’s better to make 
> it 
> > > the default Racket variant sooner rather than later 
>
> I hope the context of this sentence is clear: The report is mostly 
> about performance, and it says explicitly that we won't switch until 
> performance is good enough (despite the maintenance benefits of 
> switching). 
>

Thanks for clarifying that.  My interpretation of the report was that, while
some performance problems exist, these are acceptable and RacketCS should
become Racket 7.3 (or 8.0)
 

>
> [...]
>
> To connect your specific results more to the blog post, here are some 
> things I took from looking at your program a few weeks ago: 
>
>  * A lot of code is generated from your source programs. 


Do you mean (1) that the source code is large or (2) that the generated
byte-code or machine code is unexpectedly large given the size of the
sources?

If (1), I don't consider it large, at least not when compared to the size of
the programs I write and develop at work.  Also, the program would be twice 
as
large if I had the time to add all the features I would like to :-)

If (2), is there a way to structure it such that less code is generated from
these sources?  Is there a "best practices" document for structuring Racket
programs?

 

> Some of that 
>seems to be Typed Racket; for example, 15% of the generated code is 
>contracts to be used if typed code is called from an untyped 
>context. (Thanks to Sam for helping with that experiment.) In any 
>case, lots of generated code means even slower loading. 
>

I always assumed that the contracts generated when TR code is used from
untyped Racket would be the same as the ones written by hand if the module
would be untyped and had contracts on the same exported functions.  Is this
not the case?

Is there some documentation on how to measure the amount of code used by
contracts (the 15% value you mention above)?  I experimented with TR for a 
few
things and left them in the code base, but if they create significant
performance issues, I can convert them to untyped Racket easily.

[...]
>
>  * The test suite involves significant I/O. As you mentioned, the test 
>driving database operations, and those operations should be about 
>the same. But the database is populated by parsing files, so slow 
>I/O may be the bottleneck. 
>
> I am not sure what "significant" means, but the tests don't read and write 
a
large amount of data:

* The total test data size is less than 10Mb: the largest file is 4Mb, the
  second largest is 1.3Mb and the third largest is 500Kb and the fourth is
  400Kb; The remaining files are less than 300Kb each, and half of them are
  under 100Kb. These are binary files, read in a byte vector in one go, 
using
  `file->bytes`.

* Some tests also read in a SQL schema file from disk, and this is 50Kb in
  size, plus a handful of small SQL files read in once only for each of the 
6
  test programs.

* For most tests, the database is created in memory, so, while there are a 
lot
  of SQL statements run, they don't create any disk IO.

* One test that uses on-disk databases reads in about 12 SQL files, less 
than
  5Kb each.  The database IO is done by the SQLite library, not by racket.

* Another test using on-disk databases does no IO apart from SQLite (i.e the
  Racket code just runs SQL statements).

* The third test using on-disk databases writes about 20 small files to disk
  and reads half of them back in.

I would be happy to help you identify where the performance degradation
between Racket 7.1 and CS is when running these tests.  If you have any
questions or want me to run other tests or modified ones, I can do that.

Alex.

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


[racket-users] Re: New syntax highlighting extension for VS Code

2019-01-30 Thread Greg Trzeciak
Thank you!

On Wednesday, January 30, 2019 at 9:57:46 PM UTC+1, Evžen Wybitul wrote:
>
> Hey,
>
> I've just uploaded a v0.1.0 of my syntax highlighting extension for 
> Racket, dubbed *Magic Racket* (I got inspired by the extension Magic 
> Python). It's originally built for VSCode, but it'll be fairly easy to port 
> it to other modern editors (Atom, Sublime Text) as well. 
>
> Repo link: repo 
> Marketplace link: marketplace 
> 
>
> The main highlights (pardon the pun):
>
>- Nearly complete support for all of Racket's syntax, including byte 
>strings, here strings, hex numbers... Basically, if it's in the docs, it's 
>getting highlighted (with a few notable exceptions, see repo for further 
>details).
>- No useless snippets, and the scoping is as detailed as I was able to 
>make it.
>
> There is a comparison of Magic Racket and the currently most popular 
> syntax highlighting package on the repo. Check it out, and let me know what 
> do you think! And of course, open issues if you find some mistake.
>
> Now, have a beautiful day!
>
>

-- 
You received this message because you are subscribed to the Google 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] sxml vs xexpr frustrations

2019-01-30 Thread Neil Van Dyke

Christopher Lemmer Webber wrote on 1/30/19 3:59 PM:

Yes, the xexprs and SXML stuff is mostly very old (perhaps most of it from so 
far back that Racket even had its own little Web browser),

This one? https://docs.racket-lang.org/browser/index.html


Yes, that looks like it.  Regarding using it, of course you understand 
the difference between modern CSS and DOM, and Mosaic-era (or early 
Netscape Navigator) HTML, *and* you'd also want to sanity-check the 
security of the implementation, since I don't recall that being looked 
at in ages.


The two security things that come to mind to look at are the Racket eval 
feature, and exactly how the browser overall was implemented (e.g., make 
sure it doesn't use old crusty bits of C or C++ code, such as from an 
old wxWidgets).  Much lower-priority, you could also look at limiting 
its resource consumption.  Even if you control all content, injection 
happens.  (It could be that Racket's old Windows-like Help viewer is a 
very rare old Web browser not littered with serious vulnerabilities, but 
that's something to check.)


--
You received this message because you are subscribed to the Google 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] Racket v7.2

2019-01-30 Thread Jos Koot
Very nice.
Runs fast for my programs.
Thanks, to all who contributed, Jos

On Wed, 30 Jan 2019 at 19:59, Vincent St-Amour <
stamo...@eecs.northwestern.edu> wrote:

> Racket version 7.2 is now available from
>
> http://racket-lang.org/
>
> Racket-on-Chez is done in a useful sense, but we'll wait until it gets
> better before making it the default Racket implementation. For more
> information, see
>
> http://blog.racket-lang.org/2019/01/racket-on-chez-status.html
>
> In addition, the Racket 7.2 release includes the following improvements,
> which apply to both implementations:
>
> - The contract system supports collapsible contracts, which avoid
>   repeated wrappers in certain pathological situations. Thanks to Daniel
>   Feltey.
>
> - Quickscript, a scripting tool for DrRacket, has become part of the
>   standard distribution. Thanks to Laurent Orseau.
>
> - The web server's built-in configuration for serving static files
>   recognizes the ".mjs" extension for JavaScript modules.
>
> - The `data/enumerate` library supports an additional form of
>   subtraction via `but-not/e`, following Yorgey and Foner's ICFP'18
>   paper. Thanks to Max New.
>
> - The `letrec.rkt` example model in Redex has been changed to more
>   closely match Racket, which led to some bug fixes in Racket's
>   implementation of `letrec` and `set!`.
>
> - The racklog library has seen a number of improvements, including fixes
>   to logic variable binding, logic variables containing predicates being
>   applicable, and the introduction of an `%andmap` higher-order predicate.
>
> The following people contributed to this release:
> Akihide Nano, Alex Feldman-Crough, Alexander McLin, Alexander Shopov,
> Alexis King, Alex Knauth, Andrew Kent, Asumu Takikawa, Ben Greenman,
> Bogdan Popa, Caner Derici, Chongkai Zhu, Dan Feltey, Darren Newton, Gan
> Shen, Greg Hendershott, Gustavo Massaccesi, Jay McCarthy, Jens Axel
> Søgaard, John Clements, Jordan Johnson, Kevin Robert Stravers, Leif
> Andersen, Leo Uino, Matt Kraai, Matthew Butterick, Matthew Flatt,
> Matthias Felleisen, Max New, Michael Burge, Mike Sperber, Paul
> C. Anagnostopoulos, Paulo Matos, Philip McGrath, Robby Findler, Ronald
> Garcia, Ryan Culpepper, Ryan Kramer, Sam Tobin-Hochstadt, Shu-Hung You,
> Sorawee Porncharoenwase, Spencer Florence, Stephen Chang, and Vincent
> St-Amour
>
> Feedback Welcome
>
> --
> You received this message because you are subscribed to the Google 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.
>

-- 
You received this message because you are subscribed to the Google 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] sxml vs xexpr frustrations

2019-01-30 Thread Christopher Lemmer Webber
Neil Van Dyke writes:

> 'John Clements' via Racket Users wrote on 1/30/19 1:46 PM:
>> Fundamentally, I think that what you’re proposing is sensible … and probably 
>> a lot of work that’s not currently at the top of anyone’s list.  :)
>
> Yes, the xexprs and SXML stuff is mostly very old (perhaps most of it
> from so far back that Racket even had its own little Web browser),

This one?

  https://docs.racket-lang.org/browser/index.html

Or is there another one I ought to know of? :)
Believe it or not, I may have good reason to make use of some of that
code, in my upcoming work...

  https://dustycloud.org/misc/mmose.pdf

-- 
You received this message because you are subscribed to the Google 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] New syntax highlighting extension for VS Code

2019-01-30 Thread Evžen Wybitul
Hey,

I've just uploaded a v0.1.0 of my syntax highlighting extension for Racket, 
dubbed *Magic Racket* (I got inspired by the extension Magic Python). It's 
originally built for VSCode, but it'll be fairly easy to port it to other 
modern editors (Atom, Sublime Text) as well. 

Repo link: repo 
Marketplace link: marketplace 


The main highlights (pardon the pun):

   - Nearly complete support for all of Racket's syntax, including byte 
   strings, here strings, hex numbers... Basically, if it's in the docs, it's 
   getting highlighted (with a few notable exceptions, see repo for further 
   details).
   - No useless snippets, and the scoping is as detailed as I was able to 
   make it.

There is a comparison of Magic Racket and the currently most popular syntax 
highlighting package on the repo. Check it out, and let me know what do you 
think! And of course, open issues if you find some mistake.

Now, have a beautiful day!

-- 
You received this message because you are subscribed to the Google 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] sxml vs xexpr frustrations

2019-01-30 Thread Neil Van Dyke

'John Clements' via Racket Users wrote on 1/30/19 1:46 PM:

Fundamentally, I think that what you’re proposing is sensible … and probably a 
lot of work that’s not currently at the top of anyone’s list.  :)


Yes, the xexprs and SXML stuff is mostly very old (perhaps most of it 
from so far back that Racket even had its own little Web browser), 
though most of the code has held up pretty well despite its age, but I'm 
not aware of much recent development.  (Held up well, thanks to John 
heroically preserving Oleg's code in the current Racket package system 
-- the biggest bit of bitrot was perhaps due to it not being written for 
a package system and doc system.)


The sparse recent development might be partly due to practitioners 
largely shifting away from HTML and XML, to JS-based frameworks and JSON.


There's also perhaps some "solved problem", such as when Oleg took a 
close look at XML, made his excellent parser, published about what he 
learned, and then moved on to other SXML/XML aspects, and to other areas.


That said, I speculate that there might be new boost of interest in 
HTML in Racket, if Racket gets a WASM backend, perhaps through the 
Chez work, and someone invests in pushing what that can do.


For now, I occasionally resist the urge to make a new representation 
(probably involving a mix of SXML and Racket syntax objects, and 
possibly also structs), and write new tools for it.  I've also wanted to 
do a few neat things with URI/URL, taking advantage of current Racket 
features, and based on what I learned with two earlier URI libraries in 
Scheme.  And to build upon my template work, and to do frameworky 
stuff.  Realistically, all that would have to be motivated and funded by 
paying work/research, like how some solid engineering work on Racket has 
and continues to be funded by goals of CS/PL systems research and CS 
education.



On Jan 30, 2019, at 10:27 AM, Christopher Lemmer Webber 
 wrote:

I wish the Racket community could collectively make a decision and "deprecate" 
one of them.


In case it comes up in discussion: one alternative to deprecating one of 
them in favor of the other won't work.  I previously tried to make a 
compromise unified representation, but it just didn't want to work 
without sacrificing the arbitrary nesting of SXML, which is one of 
SXML's performance strengths (for efficient splicing of potentially 
large chunks of SXML during transformation, especially now that Racket 
pairs are immutable).  I also tried to add splicing operators to the 
unified representation, then decided that Oleg had the more elegant idea 
from the start.


As a different approach to bridging xexpr and SXML worlds, I also 
started to try to make my SXML-ish template stuff also work with the 
Racket Web Server, but that work (along with my book and such) got 
interrupted in the middle of performance optimizing: 
https://www.neilvandyke.org/racket/rws-html-template/#%28part._.Known_.Issues%29


What I suspect will happen is that we'll continue to have our efforts 
divided between the  xexpr and SXML worlds until the Chosen One foretold 
by the prophets is born, to do all the PL work and human 
leadership needed to unite the two peoples.


BTW, to someone not very familiar with the XML and HTML stuff in Racket, 
I don't want to overstate the impression of a problem. There's a good 
chance that you'd just develop in one world, and find that the available 
libraries for that world do what you need.  I think it's only painful 
when you don't realize there's multiple worlds, and you take a while to 
realize that the library you're looking at is for a different world; or 
when your world happens to be missing functionality you need that the 
other world has.


--
You received this message because you are subscribed to the Google 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] Racket v7.2

2019-01-30 Thread Vincent St-Amour
Racket version 7.2 is now available from

http://racket-lang.org/

Racket-on-Chez is done in a useful sense, but we'll wait until it gets
better before making it the default Racket implementation. For more
information, see

http://blog.racket-lang.org/2019/01/racket-on-chez-status.html

In addition, the Racket 7.2 release includes the following improvements,
which apply to both implementations:

- The contract system supports collapsible contracts, which avoid
  repeated wrappers in certain pathological situations. Thanks to Daniel
  Feltey.

- Quickscript, a scripting tool for DrRacket, has become part of the
  standard distribution. Thanks to Laurent Orseau.

- The web server's built-in configuration for serving static files
  recognizes the ".mjs" extension for JavaScript modules.

- The `data/enumerate` library supports an additional form of
  subtraction via `but-not/e`, following Yorgey and Foner's ICFP'18
  paper. Thanks to Max New.

- The `letrec.rkt` example model in Redex has been changed to more
  closely match Racket, which led to some bug fixes in Racket's
  implementation of `letrec` and `set!`.

- The racklog library has seen a number of improvements, including fixes
  to logic variable binding, logic variables containing predicates being
  applicable, and the introduction of an `%andmap` higher-order predicate.

The following people contributed to this release:
Akihide Nano, Alex Feldman-Crough, Alexander McLin, Alexander Shopov,
Alexis King, Alex Knauth, Andrew Kent, Asumu Takikawa, Ben Greenman,
Bogdan Popa, Caner Derici, Chongkai Zhu, Dan Feltey, Darren Newton, Gan
Shen, Greg Hendershott, Gustavo Massaccesi, Jay McCarthy, Jens Axel
Søgaard, John Clements, Jordan Johnson, Kevin Robert Stravers, Leif
Andersen, Leo Uino, Matt Kraai, Matthew Butterick, Matthew Flatt,
Matthias Felleisen, Max New, Michael Burge, Mike Sperber, Paul
C. Anagnostopoulos, Paulo Matos, Philip McGrath, Robby Findler, Ronald
Garcia, Ryan Culpepper, Ryan Kramer, Sam Tobin-Hochstadt, Shu-Hung You,
Sorawee Porncharoenwase, Spencer Florence, Stephen Chang, and Vincent
St-Amour

Feedback Welcome

-- 
You received this message because you are subscribed to the Google 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] sxml vs xexpr frustrations

2019-01-30 Thread 'John Clements' via Racket Users
You probably already know this, but this is basically a case of parallel 
evolution. The sxml tools come ultimately from Oleg Kiselyov, and I believe 
he’s the one who formulated the data definition. Many people have worked with 
him on this, including many people on this mailing list. I think it’s fair to 
say that xexprs come originally from Paul Graunke and Matthias, although many 
many many people here have worked on infrastructure related to xexprs. 

Fundamentally, I think that what you’re proposing is sensible … and probably a 
lot of work that’s not currently at the top of anyone’s list.  :)

John


> On Jan 30, 2019, at 10:27 AM, Christopher Lemmer Webber 
>  wrote:
> 
> One very frustrating thing for me is the inconsistency between which
> sexp xml representation is the "right" one, sxml or xexpr.  Different
> tools support different things, and thus don't interoperate when they
> easily could have.  I wish the Racket community could collectively make
> a decision and "deprecate" one of them.
> 
> IMO, it makes more sense to have sxml be the "right" one, since it has
> wider user outside of just Racket, and there are some much nicer tools
> available for it:
> 
>  https://docs.racket-lang.org/sxml-intro/index.html#%28part._.Tools%29
> 
> (That, and I find the @ property syntax a bit easier to follow, but that
> barely matters.)
> 
> Possibly opening a can of bikeshed,
> - Chris
> 
> -- 
> You received this message because you are subscribed to the Google 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.



-- 
You received this message because you are subscribed to the Google 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] sxml vs xexpr frustrations

2019-01-30 Thread Christopher Lemmer Webber
One very frustrating thing for me is the inconsistency between which
sexp xml representation is the "right" one, sxml or xexpr.  Different
tools support different things, and thus don't interoperate when they
easily could have.  I wish the Racket community could collectively make
a decision and "deprecate" one of them.

IMO, it makes more sense to have sxml be the "right" one, since it has
wider user outside of just Racket, and there are some much nicer tools
available for it:

  https://docs.racket-lang.org/sxml-intro/index.html#%28part._.Tools%29

(That, and I find the @ property syntax a bit easier to follow, but that
barely matters.)

Possibly opening a can of bikeshed,
 - Chris

-- 
You received this message because you are subscribed to the Google 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] Serving my web application and some static files

2019-01-30 Thread Stephen De Gabrielle
I think you need your servlet regexp to not match /static/
Something like this?

   #:servlet-regexp #rx"^(?
wrote:

Thanks!  It's true that the #:extra-files-paths works fine if I'm happy
enough with its contents not being "mounted" under a separate path.  I
guess that's fine for now, though I really would like to figure out how
to compose servlets and dispatchers the "proper" way. :)

Stephen De Gabrielle writes:

Hi


The contine tutorial has a good bit on serving static files:


The bit on #:extra-files-paths:

https://docs.racket-lang.org/continue/index.html#%28part._.Leaving_.Dr.Racket%29



This is what I did

https://github.com/spdegabrielle/clash

main.rkt


Sorry bit of a rush- let me know if I’m making sense - I can do a smaller

example to your spec this evening.


Stephen



On Wed, 30 Jan 2019 at 16:42, Christopher Lemmer Webber <

cweb...@dustycloud.org> wrote:


It seems like it should be so simple, and like Racket has the tools

already, but I can't figure out how to do it.


I have the following:


 (serve/servlet start

#:servlet-regexp #rx""

#:launch-browser? #f)


I'd like to do something like the following:


 - Serve static files for urls matching /static/*

 - Serve those very files from the ./static/ directory


I'd expect I'd do something like combine that all with:


 (file-dispatch:make #:url->path (make-url->path

   (build-path cwd "static")))


But I'm lost.  I can figure out how to serve static files OR use the

controllers in my start function, but combining them???  I'd like to

serve some static files *in addition* to my the above code.  Between

dispatchers and servlets and even the file serving dispatchers, I

thought I could figure out something relatively easy out of the box.

But hours later I'm still scratching my head about how to combine

servlets or dispatchers or what have you.


I've read a bunch of things:

- https://www.greghendershott.com/2013/03/serve-static-files.html

- https://docs.racket-lang.org/web-server-internal/dispatch-files.html

-

https://docs.racket-lang.org/web-server-internal/dispatch-sequencer.html

- and pretty much everything under

https://docs.racket-lang.org/web-server/


... but I can't figure out how to do it without reinventing all the

machinery that appears to already exist in Racket.  There must be

something obvious and simple right in front of me.


--

You received this message because you are subscribed to the Google 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.



-- 


-- 
You received this message because you are subscribed to the Google 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] Serving my web application and some static files

2019-01-30 Thread Christopher Lemmer Webber
Thanks!  It's true that the #:extra-files-paths works fine if I'm happy
enough with its contents not being "mounted" under a separate path.  I
guess that's fine for now, though I really would like to figure out how
to compose servlets and dispatchers the "proper" way. :)

Stephen De Gabrielle writes:

> Hi
>
> The contine tutorial has a good bit on serving static files:
>
> The bit on #:extra-files-paths:
> https://docs.racket-lang.org/continue/index.html#%28part._.Leaving_.Dr.Racket%29
>
>
> This is what I did
> https://github.com/spdegabrielle/clash
> main.rkt
>
> Sorry bit of a rush- let me know if I’m making sense - I can do a smaller
> example to your spec this evening.
>
> Stephen
>
>
> On Wed, 30 Jan 2019 at 16:42, Christopher Lemmer Webber <
> cweb...@dustycloud.org> wrote:
>
>> It seems like it should be so simple, and like Racket has the tools
>> already, but I can't figure out how to do it.
>>
>> I have the following:
>>
>>   (serve/servlet start
>>  #:servlet-regexp #rx""
>>  #:launch-browser? #f)
>>
>> I'd like to do something like the following:
>>
>>   - Serve static files for urls matching /static/*
>>   - Serve those very files from the ./static/ directory
>>
>> I'd expect I'd do something like combine that all with:
>>
>>   (file-dispatch:make #:url->path (make-url->path
>> (build-path cwd "static")))
>>
>> But I'm lost.  I can figure out how to serve static files OR use the
>> controllers in my start function, but combining them???  I'd like to
>> serve some static files *in addition* to my the above code.  Between
>> dispatchers and servlets and even the file serving dispatchers, I
>> thought I could figure out something relatively easy out of the box.
>> But hours later I'm still scratching my head about how to combine
>> servlets or dispatchers or what have you.
>>
>> I've read a bunch of things:
>>  - https://www.greghendershott.com/2013/03/serve-static-files.html
>>  - https://docs.racket-lang.org/web-server-internal/dispatch-files.html
>>  -
>> https://docs.racket-lang.org/web-server-internal/dispatch-sequencer.html
>>  - and pretty much everything under
>> https://docs.racket-lang.org/web-server/
>>
>> ... but I can't figure out how to do it without reinventing all the
>> machinery that appears to already exist in Racket.  There must be
>> something obvious and simple right in front of me.
>>
>> --
>> You received this message because you are subscribed to the Google 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.
>>

-- 
You received this message because you are subscribed to the Google 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] Serving my web application and some static files

2019-01-30 Thread Stephen De Gabrielle
Hi

The contine tutorial has a good bit on serving static files:

The bit on #:extra-files-paths:
https://docs.racket-lang.org/continue/index.html#%28part._.Leaving_.Dr.Racket%29


This is what I did
https://github.com/spdegabrielle/clash
main.rkt

Sorry bit of a rush- let me know if I’m making sense - I can do a smaller
example to your spec this evening.

Stephen


On Wed, 30 Jan 2019 at 16:42, Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> It seems like it should be so simple, and like Racket has the tools
> already, but I can't figure out how to do it.
>
> I have the following:
>
>   (serve/servlet start
>  #:servlet-regexp #rx""
>  #:launch-browser? #f)
>
> I'd like to do something like the following:
>
>   - Serve static files for urls matching /static/*
>   - Serve those very files from the ./static/ directory
>
> I'd expect I'd do something like combine that all with:
>
>   (file-dispatch:make #:url->path (make-url->path
> (build-path cwd "static")))
>
> But I'm lost.  I can figure out how to serve static files OR use the
> controllers in my start function, but combining them???  I'd like to
> serve some static files *in addition* to my the above code.  Between
> dispatchers and servlets and even the file serving dispatchers, I
> thought I could figure out something relatively easy out of the box.
> But hours later I'm still scratching my head about how to combine
> servlets or dispatchers or what have you.
>
> I've read a bunch of things:
>  - https://www.greghendershott.com/2013/03/serve-static-files.html
>  - https://docs.racket-lang.org/web-server-internal/dispatch-files.html
>  -
> https://docs.racket-lang.org/web-server-internal/dispatch-sequencer.html
>  - and pretty much everything under
> https://docs.racket-lang.org/web-server/
>
> ... but I can't figure out how to do it without reinventing all the
> machinery that appears to already exist in Racket.  There must be
> something obvious and simple right in front of me.
>
> --
> You received this message because you are subscribed to the Google 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.
>
-- 


-- 
You received this message because you are subscribed to the Google 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] Serving my web application and some static files

2019-01-30 Thread Christopher Lemmer Webber
It seems like it should be so simple, and like Racket has the tools
already, but I can't figure out how to do it.

I have the following:

  (serve/servlet start
 #:servlet-regexp #rx""
 #:launch-browser? #f)

I'd like to do something like the following:

  - Serve static files for urls matching /static/*
  - Serve those very files from the ./static/ directory

I'd expect I'd do something like combine that all with:

  (file-dispatch:make #:url->path (make-url->path
(build-path cwd "static")))

But I'm lost.  I can figure out how to serve static files OR use the
controllers in my start function, but combining them???  I'd like to
serve some static files *in addition* to my the above code.  Between
dispatchers and servlets and even the file serving dispatchers, I
thought I could figure out something relatively easy out of the box.
But hours later I'm still scratching my head about how to combine
servlets or dispatchers or what have you.

I've read a bunch of things:
 - https://www.greghendershott.com/2013/03/serve-static-files.html
 - https://docs.racket-lang.org/web-server-internal/dispatch-files.html
 - https://docs.racket-lang.org/web-server-internal/dispatch-sequencer.html
 - and pretty much everything under https://docs.racket-lang.org/web-server/

... but I can't figure out how to do it without reinventing all the
machinery that appears to already exist in Racket.  There must be
something obvious and simple right in front of me.

-- 
You received this message because you are subscribed to the Google 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] side by side; scribble

2019-01-30 Thread Robby Findler
Thanks, Ben!

Instead of the ++style command line, consider using a property on the
`title` of the top-level section.

Robby


On Wed, Jan 30, 2019 at 10:02 AM Ben Greenman
 wrote:
>
> In case you have trouble navigating the docs, here's a related example.
>
> First, a Scribble function that generates output with a Scribble style
> named "TwoColumn":
> https://github.com/nuprl/tag-sound/blob/master/gf-icfp-2018/main.rkt#L326
>
> Second, a LaTeX macro named "TwoColumn" that formats the Scribble
> output for the "multicol" package:
> https://github.com/nuprl/tag-sound/blob/master/gf-icfp-2018/style.tex#L9
>
> Third, an example use of the Scribble function:
> https://github.com/nuprl/tag-sound/blob/master/gf-icfp-2018/design.scrbl#L273
>
>
> (I used the ++style command-line flag to put everything together.)
>
> --
> You received this message because you are subscribed to the Google 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.

-- 
You received this message because you are subscribed to the Google 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] side by side; scribble

2019-01-30 Thread Ben Greenman
In case you have trouble navigating the docs, here's a related example.

First, a Scribble function that generates output with a Scribble style
named "TwoColumn":
https://github.com/nuprl/tag-sound/blob/master/gf-icfp-2018/main.rkt#L326

Second, a LaTeX macro named "TwoColumn" that formats the Scribble
output for the "multicol" package:
https://github.com/nuprl/tag-sound/blob/master/gf-icfp-2018/style.tex#L9

Third, an example use of the Scribble function:
https://github.com/nuprl/tag-sound/blob/master/gf-icfp-2018/design.scrbl#L273


(I used the ++style command-line flag to put everything together.)

-- 
You received this message because you are subscribed to the Google 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] Multipart HTTP requests

2019-01-30 Thread Jon Zeppieri
On Wed, Jan 30, 2019 at 6:46 AM Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> Jon Zeppieri writes:
>
> > On Tue, Jan 29, 2019 at 4:17 AM Christopher Lemmer Webber <
> > cweb...@dustycloud.org> wrote:
> >
> >>
> >> Any thoughts on how I should move forward?
> >
> >
> > I think that using a `data-procedure/c` of a particular sort should allow
> > you to implement this without needing access to the struct internals or
> > needing to read everything into memory at once.
> >
> > (Though, it would be a bit nicer if the write proc allowed you to specify
> > an offset and length into the string/byte string.)
> >
> > Something like:
> > ===
> > #lang racket/base
> >
> > (require net/http-client
> >  file/sha1
> >  racket/random)
> >
> > (define (http-conn-send/multipart! hc uri multipart-body
> >#:version [version #"1.1"]
> >#:method [method #"POST"]
> >#:close? [close? #f]
> >#:headers [headers '()]
> >#:content-decode [decodes '(gzip)]
> >#:boundary [boundary
> (random-boundary)])
> >   (define content-type-header
> > (string-append
> >  "Content-Type: multipart/form-data; boundary="
> >  boundary))
> >
> >   (http-conn-send! hc uri
> >#:version version
> >#:method method
> >#:close? close?
> >#:headers (cons content-type-header headers)
> >#:content-decode decodes
> >#:data (multipart-body->data-proc boundary
> > multipart-body)))
> >
> > (define (mime-escape s)
> >   (regexp-replace* #rx"[\"\\]" s "\\0"))
> >
> > (define (make-string-part field-name field-value)
> >   (λ (write-chunk boundary)
> > (write-chunk
> >  (format
> >   (string-append "--~a\r\n"
> >  "Content-Disposition: form-data; name=\"~a\"\r\n"
> >   "Content-Type: text/plain; charset=utf-8\r\n"
> >   "\r\n"
> >   "~a\r\n")
> >   boundary
> >   (mime-escape field-name)
> >   field-value
> >
> >
> > (define (make-file-part field-name file-name content-type in)
> >   (λ (write-chunk boundary)
> > (write-chunk
> >  (format
> >   (string-append "--~a\r\n"
> >  "Content-Disposition: form-data; name=\"~a\";
> > filename=\"~a\"\r\n"
> >   "Content-Type: ~a\r\n"
> >   "\r\n")
> >   boundary
> >   (mime-escape field-name)
> >   (mime-escape file-name)
> >   content-type))
> >
> > (define buffer (make-bytes 4096))
> > (let loop ([n (read-bytes-avail! buffer in)])
> >   (cond
> > [(eof-object? n)
> >  n]
> > [else
> >  (write-chunk (subbytes buffer 0 n))
> >  (loop (read-bytes-avail! buffer in))]))
> >
> > (write-chunk "\r\n")))
> >
> > (define (multipart-body->data-proc boundary parts)
> >   (λ (write-chunk)
> > (for ([part parts])
> >   (part write-chunk boundary))
> > (write-chunk (format "--~a--\r\n" boundary
> >
> > (define (random-boundary)
> >   (string-append
> >"--"
> >(bytes->hex-string
> > (crypto-random-bytes 8
>
> Oh, this is useful!  I didn't see this when asking for data-procedure/c
> examples earlier on the list :)
>
> BTW do you mind specifying a license for your code above so I might
> incorporate parts of it into my work?  Maybe either LGPL or Apache v2?
>


Okay, this applies to the code above:

Copyright (c) 2019 Jon Zeppieri

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE
SOFTWARE.

-- 
You received this message because you are subscribed to the Google 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 

Re: [racket-users] side by side; scribble

2019-01-30 Thread Robby Findler
Yes, for sure. You need to get scribble to generate the `\usepackage`
declaration and then define a function in scribble to make an element
that generates the `\switchcolumn*`. The docs have examples on how to
do this; let us know if you get stuck.

Robby

On Wed, Jan 30, 2019 at 9:29 AM Miguel P. Silva  wrote:
>
> I have already my document in latex, side by side with syncing paragraphs. I 
> use the paracol package and the switchcolumn*. I was wondering if I could use 
> this system with scribble as you say.
>
> quarta-feira, 30 de Janeiro de 2019 às 15:08:34 UTC, Robby Findler escreveu:
>>
>> On Wed, Jan 30, 2019 at 8:47 AM Marc Kaufmann  wrote:
>> >
>> > Ah, I misunderstood the synchronization to be about synchronization in 
>> > time between source and typeset output, while the question was about 
>> > synchronizing two outputs that are typeset from the same source next to 
>> > each other. My bad. However, I couldn't find anything on one-vs-two 
>> > columns other than the SIGPLAN option @onecolumn. When you say that I need 
>> > to add those commands, you mean I should define them in scribble or pass 
>> > them as templates for a given output (say two-column output in HTML or 
>> > Latex)?
>>
>> You would have to investigate the various packages that are offered
>> that provide these features and decide on one that seems to work for
>> what you want to do (I would do this using ipsum lorem and some
>> simple-minded latex code but I spent far too long producing
>> latex). Once you settle on one, then you would use the docs in
>> scribble I linked to in order to get the important (new) latex
>> commands at the scribble level (and to load the package itself).
>>
>> > I had been wondering if there is something where, side-by-side, you have 
>> > the editor to enter scribble on the left, and on the right it updates as I 
>> > type (or once I complete a command) scribble's typesetting. Similar to the 
>> > (near-automatic) preview on Discourse 
>> > (https://blog.discourse.org/2016/12/discourse-new-user-tips-and-tricks/ go 
>> > down to "Reply"). I now realize that's not there, but I thought that was 
>> > what you meant with the two-columns thing -- and spent 30 minutes figuring 
>> > out where that is.
>>
>> That would be nice.
>>
>> Robby
>>
>> > On Wed, Jan 30, 2019 at 2:44 PM Robby Findler 
>> >  wrote:
>> >>
>> >> No it does not require that, if I am understanding you correctly. You 
>> >> just need to add the two-column specific commands and use them, as 
>> >> appropriate.
>> >>
>> >> Robby
>> >>
>> >> On Wed, Jan 30, 2019 at 1:57 AM Marc Kaufmann  
>> >> wrote:
>> >>>
>> >>> Since you say that it requires dropping to the latex level, does it mean 
>> >>> that doing a synchronization of scribble and other output (say, HTML or 
>> >>> something else that doesn't require anything from outside scribble and 
>> >>> racket) can be done directly? Essentially:
>> >>>
>> >>> ```
>> >>> @title{Synchronize this!}
>> >>>
>> >>> Can you synchronize this @racket[(range 5)]?
>> >>> ```
>> >>>
>> >>> would update to show
>> >>>
>> >>> ```
>> >>> # Synchronize this!
>> >>>
>> >>> Can you synchronize this '(0 1 2 3 4)?
>> >>> ```
>> >>>
>> >>> and it would update it quickly when I change (range 5) to (range 4)? I 
>> >>> may have misinterpreted what you said - but if I didn't, then I wasn't 
>> >>> aware this was easily doable.
>> >>>
>> >>> Cheers,
>> >>> Marc
>> >>>
>> >>> On Tuesday, January 29, 2019 at 2:01:37 PM UTC+1, Robby Findler wrote:
>> 
>>  In order to do that you'd need to drop down to the latex level and use
>>  a package there to help you. There is information about how to do that
>>  here: http://docs.racket-lang.org/scribble/config.html . Here is a
>>  post about packages you could use:
>>  https://tex.stackexchange.com/questions/308260/parallel-text-translation-including-the-same-double-parallel-heading-numbering
>> 
>>  hth,
>>  Robby
>> 
>>  On Tue, Jan 29, 2019 at 5:09 AM  wrote:
>>  >
>>  > Can I do a side by side pdf using racket scribble? Imagine you have 
>>  > an English text and want the Portuguese translation in the opposite 
>>  > column. If yes, it brings another question, which is, can it be done 
>>  > with synchronized paragraphs?
>>  >
>>  > --
>>  > You received this message because you are subscribed 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...@googlegroups.com.
>> >>> For more options, visit https://groups.google.com/d/optout.
>> >
>> > --

Re: [racket-users] bug in data/enumerate?

2019-01-30 Thread Robby Findler
Turns out this was an incomplete contract check; the algorithm used by
`but-not/e` doesn't work if some of the elements of `small` are not in
`big`.

Thanks to Max for figuring that out. It should be fixed now.

Robby

On Sun, Jan 13, 2019 at 11:35 PM 'John Clements' via Racket Users
 wrote:
>
> I’ve been having problems with but-not/e, and I’ve been bouncing between 
> strange things, but this one really looks ilke a bug. Unless it’s not.
>
> John
>
> #lang racket
>
> (require data/enumerate
>  data/enumerate/lib)
>
> (define (even-mod-10? x) (= 0 (modulo x 10)))
>
> (define tens/e
>   (map/e (λ (x) (* x 10))
>  (λ (x) (/ x 10))
>  natural/e
>  #:contract (and/c natural?
>even-mod-10?)))
>
>
> (define test/e (but-not/e tens/e (range/e 1000 2000)))
> (enum->list test/e 10)
>
> (to-nat test/e 10)
>
> ;; produces:
>
> map/e: broke its own contract
>   promised: even-mod-10?
>   produced: 1001
>   in: an and/c case of
>   the 1st argument of
>   the out argument of
>   (->i
>((in
>  (e es c)
>  (cond
>   ((null? es) (-> (enum-contract e) c))
>   (else
>(dynamic->*
> #:mandatory-domain-contracts
> (map enum-contract ...)
> #:range-contracts
> (list c)
> (out
>  (e es c)
>  (cond
>   ((null? es) (-> c (enum-contract e)))
>   (else
>(dynamic->*
> #:mandatory-domain-contracts
> (list c)
> #:range-contracts
> (map enum-contract ...)
> (e enum?)
> #:contract
> (c contract?))
>#:rest
>(es (listof enum?))
>#:pre/desc
>(in out e es)
>(appears-to-be-a-bijection?
> in
> out
> (cons e es))
>(result enum?))
>   contract from:
>   /data-enumerate-lib/data/enumerate.rkt
>   blaming: /data-enumerate-lib/data/enumerate.rkt
>(assuming the contract is correct)
>   at: /data-enumerate-lib/data/enumerate.rkt:45.3
>
> --
> You received this message because you are subscribed to the Google 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.

-- 
You received this message because you are subscribed to the Google 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] side by side; scribble

2019-01-30 Thread Miguel P. Silva
I have already my document in latex, side by side with syncing paragraphs. 
I use the paracol package and the switchcolumn*. I was wondering if I could 
use this system with scribble as you say.

quarta-feira, 30 de Janeiro de 2019 às 15:08:34 UTC, Robby Findler escreveu:
>
> On Wed, Jan 30, 2019 at 8:47 AM Marc Kaufmann  > wrote: 
> > 
> > Ah, I misunderstood the synchronization to be about synchronization in 
> time between source and typeset output, while the question was about 
> synchronizing two outputs that are typeset from the same source next to 
> each other. My bad. However, I couldn't find anything on one-vs-two columns 
> other than the SIGPLAN option @onecolumn. When you say that I need to add 
> those commands, you mean I should define them in scribble or pass them as 
> templates for a given output (say two-column output in HTML or Latex)? 
>
> You would have to investigate the various packages that are offered 
> that provide these features and decide on one that seems to work for 
> what you want to do (I would do this using ipsum lorem and some 
> simple-minded latex code but I spent far too long producing 
> latex). Once you settle on one, then you would use the docs in 
> scribble I linked to in order to get the important (new) latex 
> commands at the scribble level (and to load the package itself). 
>
> > I had been wondering if there is something where, side-by-side, you have 
> the editor to enter scribble on the left, and on the right it updates as I 
> type (or once I complete a command) scribble's typesetting. Similar to the 
> (near-automatic) preview on Discourse (
> https://blog.discourse.org/2016/12/discourse-new-user-tips-and-tricks/ go 
> down to "Reply"). I now realize that's not there, but I thought that was 
> what you meant with the two-columns thing -- and spent 30 minutes figuring 
> out where that is. 
>
> That would be nice. 
>
> Robby 
>
> > On Wed, Jan 30, 2019 at 2:44 PM Robby Findler <
> ro...@eecs.northwestern.edu > wrote: 
> >> 
> >> No it does not require that, if I am understanding you correctly. You 
> just need to add the two-column specific commands and use them, as 
> appropriate. 
> >> 
> >> Robby 
> >> 
> >> On Wed, Jan 30, 2019 at 1:57 AM Marc Kaufmann  > wrote: 
> >>> 
> >>> Since you say that it requires dropping to the latex level, does it 
> mean that doing a synchronization of scribble and other output (say, HTML 
> or something else that doesn't require anything from outside scribble and 
> racket) can be done directly? Essentially: 
> >>> 
> >>> ``` 
> >>> @title{Synchronize this!} 
> >>> 
> >>> Can you synchronize this @racket[(range 5)]? 
> >>> ``` 
> >>> 
> >>> would update to show 
> >>> 
> >>> ``` 
> >>> # Synchronize this! 
> >>> 
> >>> Can you synchronize this '(0 1 2 3 4)? 
> >>> ``` 
> >>> 
> >>> and it would update it quickly when I change (range 5) to (range 4)? I 
> may have misinterpreted what you said - but if I didn't, then I wasn't 
> aware this was easily doable. 
> >>> 
> >>> Cheers, 
> >>> Marc 
> >>> 
> >>> On Tuesday, January 29, 2019 at 2:01:37 PM UTC+1, Robby Findler wrote: 
>  
>  In order to do that you'd need to drop down to the latex level and 
> use 
>  a package there to help you. There is information about how to do 
> that 
>  here: http://docs.racket-lang.org/scribble/config.html . Here is a 
>  post about packages you could use: 
>  
> https://tex.stackexchange.com/questions/308260/parallel-text-translation-including-the-same-double-parallel-heading-numbering
>  
>  
>  hth, 
>  Robby 
>  
>  On Tue, Jan 29, 2019 at 5:09 AM  wrote: 
>  > 
>  > Can I do a side by side pdf using racket scribble? Imagine you have 
> an English text and want the Portuguese translation in the opposite column. 
> If yes, it brings another question, which is, can it be done with 
> synchronized paragraphs? 
>  > 
>  > -- 
>  > You received this message because you are subscribed 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...@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...@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 

Re: [racket-users] side by side; scribble

2019-01-30 Thread Robby Findler
On Wed, Jan 30, 2019 at 8:47 AM Marc Kaufmann  wrote:
>
> Ah, I misunderstood the synchronization to be about synchronization in time 
> between source and typeset output, while the question was about synchronizing 
> two outputs that are typeset from the same source next to each other. My bad. 
> However, I couldn't find anything on one-vs-two columns other than the 
> SIGPLAN option @onecolumn. When you say that I need to add those commands, 
> you mean I should define them in scribble or pass them as templates for a 
> given output (say two-column output in HTML or Latex)?

You would have to investigate the various packages that are offered
that provide these features and decide on one that seems to work for
what you want to do (I would do this using ipsum lorem and some
simple-minded latex code but I spent far too long producing
latex). Once you settle on one, then you would use the docs in
scribble I linked to in order to get the important (new) latex
commands at the scribble level (and to load the package itself).

> I had been wondering if there is something where, side-by-side, you have the 
> editor to enter scribble on the left, and on the right it updates as I type 
> (or once I complete a command) scribble's typesetting. Similar to the 
> (near-automatic) preview on Discourse 
> (https://blog.discourse.org/2016/12/discourse-new-user-tips-and-tricks/ go 
> down to "Reply"). I now realize that's not there, but I thought that was what 
> you meant with the two-columns thing -- and spent 30 minutes figuring out 
> where that is.

That would be nice.

Robby

> On Wed, Jan 30, 2019 at 2:44 PM Robby Findler  
> wrote:
>>
>> No it does not require that, if I am understanding you correctly. You just 
>> need to add the two-column specific commands and use them, as appropriate.
>>
>> Robby
>>
>> On Wed, Jan 30, 2019 at 1:57 AM Marc Kaufmann  
>> wrote:
>>>
>>> Since you say that it requires dropping to the latex level, does it mean 
>>> that doing a synchronization of scribble and other output (say, HTML or 
>>> something else that doesn't require anything from outside scribble and 
>>> racket) can be done directly? Essentially:
>>>
>>> ```
>>> @title{Synchronize this!}
>>>
>>> Can you synchronize this @racket[(range 5)]?
>>> ```
>>>
>>> would update to show
>>>
>>> ```
>>> # Synchronize this!
>>>
>>> Can you synchronize this '(0 1 2 3 4)?
>>> ```
>>>
>>> and it would update it quickly when I change (range 5) to (range 4)? I may 
>>> have misinterpreted what you said - but if I didn't, then I wasn't aware 
>>> this was easily doable.
>>>
>>> Cheers,
>>> Marc
>>>
>>> On Tuesday, January 29, 2019 at 2:01:37 PM UTC+1, Robby Findler wrote:

 In order to do that you'd need to drop down to the latex level and use
 a package there to help you. There is information about how to do that
 here: http://docs.racket-lang.org/scribble/config.html . Here is a
 post about packages you could use:
 https://tex.stackexchange.com/questions/308260/parallel-text-translation-including-the-same-double-parallel-heading-numbering

 hth,
 Robby

 On Tue, Jan 29, 2019 at 5:09 AM  wrote:
 >
 > Can I do a side by side pdf using racket scribble? Imagine you have an 
 > English text and want the Portuguese translation in the opposite column. 
 > If yes, it brings another question, which is, can it be done with 
 > synchronized paragraphs?
 >
 > --
 > You received this message because you are subscribed 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.
>
> --
> You received this message because you are subscribed to the Google 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.

-- 
You received this message because you are subscribed to the Google 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: updated Racket-on-Chez status

2019-01-30 Thread Matthew Flatt
At Tue, 29 Jan 2019 17:32:42 -0800 (PST), Alex Harsanyi wrote:
> I mention this because the report recommends making
> Racket CS the default, which I am very concerned about:
> 
> > To maximize the maintenance benefits of Racket CS, it’s better to make it
> > the default Racket variant sooner rather than later

I hope the context of this sentence is clear: The report is mostly
about performance, and it says explicitly that we won't switch until
performance is good enough (despite the maintenance benefits of
switching).

> As it stands now, the cases where RacketCS is slow have a significant impact
> on my application.  Do others see the same performance degradation in their
> applications?

I'm interested, too, but I expect others to report similar results.

To connect your specific results more to the blog post, here are some
things I took from looking at your program a few weeks ago:

 * A lot of code is generated from your source programs. Some of that
   seems to be Typed Racket; for example, 15% of the generated code is
   contracts to be used if typed code is called from an untyped
   context. (Thanks to Sam for helping with that experiment.) In any
   case, lots of generated code means even slower loading.

 * The plots for distribution builds show that TR-driven compilation
   gets slower in general. That by itself probably due to a combination
   of factors, but it certainly affects other programs that are written
   in TR.

 * The test suite involves significant I/O. As you mentioned, the test
   driving database operations, and those operations should be about
   the same. But the database is populated by parsing files, so slow
   I/O may be the bottleneck.

-- 
You received this message because you are subscribed to the Google 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] updated Racket-on-Chez status

2019-01-30 Thread Luke Whittlesey
This is really impressive work!

On Tue, Jan 29, 2019 at 9:49 AM Matthew Flatt  wrote:

> Here's a new status report on Racket CS:
>
>  http://blog.racket-lang.org/2019/01/racket-on-chez-status.html
>
> Short version: Racket CS is done in a useful sense, but we'll wait
> until it gets better before making it the default Racket
> implementation.
>
>
> Matthew
>
> --
> You received this message because you are subscribed to the Google 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.
>

-- 
You received this message because you are subscribed to the Google 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] side by side; scribble

2019-01-30 Thread Marc Kaufmann
Ah, I misunderstood the synchronization to be about synchronization in time
between source and typeset output, while the question was about
synchronizing two outputs that are typeset from the same source next to
each other. My bad. However, I couldn't find anything on one-vs-two columns
other than the SIGPLAN option @onecolumn. When you say that I need to add
those commands, you mean I should define them in scribble or pass them as
templates for a given output (say two-column output in HTML or Latex)?

I had been wondering if there is something where, side-by-side, you have
the editor to enter scribble on the left, and on the right it updates as I
type (or once I complete a command) scribble's typesetting. Similar to the
(near-automatic) preview on Discourse (
https://blog.discourse.org/2016/12/discourse-new-user-tips-and-tricks/ go
down to "Reply"). I now realize that's not there, but I thought that was
what you meant with the two-columns thing -- and spent 30 minutes figuring
out where that is.

On Wed, Jan 30, 2019 at 2:44 PM Robby Findler 
wrote:

> No it does not require that, if I am understanding you correctly. You just
> need to add the two-column specific commands and use them, as appropriate.
>
> Robby
>
> On Wed, Jan 30, 2019 at 1:57 AM Marc Kaufmann 
> wrote:
>
>> Since you say that it requires dropping to the latex level, does it mean
>> that doing a synchronization of scribble and other output (say, HTML or
>> something else that doesn't require anything from outside scribble and
>> racket) can be done directly? Essentially:
>>
>> ```
>> @title{Synchronize this!}
>>
>> Can you synchronize this @racket[(range 5)]?
>> ```
>>
>> would update to show
>>
>> ```
>> # Synchronize this!
>>
>> Can you synchronize this '(0 1 2 3 4)?
>> ```
>>
>> and it would update it quickly when I change (range 5) to (range 4)? I
>> may have misinterpreted what you said - but if I didn't, then I wasn't
>> aware this was easily doable.
>>
>> Cheers,
>> Marc
>>
>> On Tuesday, January 29, 2019 at 2:01:37 PM UTC+1, Robby Findler wrote:
>>>
>>> In order to do that you'd need to drop down to the latex level and use
>>> a package there to help you. There is information about how to do that
>>> here: http://docs.racket-lang.org/scribble/config.html . Here is a
>>> post about packages you could use:
>>>
>>> https://tex.stackexchange.com/questions/308260/parallel-text-translation-including-the-same-double-parallel-heading-numbering
>>>
>>> hth,
>>> Robby
>>>
>>> On Tue, Jan 29, 2019 at 5:09 AM  wrote:
>>> >
>>> > Can I do a side by side pdf using racket scribble? Imagine you have an
>>> English text and want the Portuguese translation in the opposite column. If
>>> yes, it brings another question, which is, can it be done with synchronized
>>> paragraphs?
>>> >
>>> > --
>>> > You received this message because you are subscribed 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.
>>
>

-- 
You received this message because you are subscribed to the Google 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] side by side; scribble

2019-01-30 Thread Robby Findler
No it does not require that, if I am understanding you correctly. You just
need to add the two-column specific commands and use them, as appropriate.

Robby

On Wed, Jan 30, 2019 at 1:57 AM Marc Kaufmann 
wrote:

> Since you say that it requires dropping to the latex level, does it mean
> that doing a synchronization of scribble and other output (say, HTML or
> something else that doesn't require anything from outside scribble and
> racket) can be done directly? Essentially:
>
> ```
> @title{Synchronize this!}
>
> Can you synchronize this @racket[(range 5)]?
> ```
>
> would update to show
>
> ```
> # Synchronize this!
>
> Can you synchronize this '(0 1 2 3 4)?
> ```
>
> and it would update it quickly when I change (range 5) to (range 4)? I may
> have misinterpreted what you said - but if I didn't, then I wasn't aware
> this was easily doable.
>
> Cheers,
> Marc
>
> On Tuesday, January 29, 2019 at 2:01:37 PM UTC+1, Robby Findler wrote:
>>
>> In order to do that you'd need to drop down to the latex level and use
>> a package there to help you. There is information about how to do that
>> here: http://docs.racket-lang.org/scribble/config.html . Here is a
>> post about packages you could use:
>>
>> https://tex.stackexchange.com/questions/308260/parallel-text-translation-including-the-same-double-parallel-heading-numbering
>>
>> hth,
>> Robby
>>
>> On Tue, Jan 29, 2019 at 5:09 AM  wrote:
>> >
>> > Can I do a side by side pdf using racket scribble? Imagine you have an
>> English text and want the Portuguese translation in the opposite column. If
>> yes, it brings another question, which is, can it be done with synchronized
>> paragraphs?
>> >
>> > --
>> > You received this message because you are subscribed 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.
>

-- 
You received this message because you are subscribed to the Google 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] Multipart HTTP requests

2019-01-30 Thread Christopher Lemmer Webber
Jon Zeppieri writes:

> On Tue, Jan 29, 2019 at 4:17 AM Christopher Lemmer Webber <
> cweb...@dustycloud.org> wrote:
>
>>
>> Any thoughts on how I should move forward?
>
>
> I think that using a `data-procedure/c` of a particular sort should allow
> you to implement this without needing access to the struct internals or
> needing to read everything into memory at once.
>
> (Though, it would be a bit nicer if the write proc allowed you to specify
> an offset and length into the string/byte string.)
>
> Something like:
> ===
> #lang racket/base
>
> (require net/http-client
>  file/sha1
>  racket/random)
>
> (define (http-conn-send/multipart! hc uri multipart-body
>#:version [version #"1.1"]
>#:method [method #"POST"]
>#:close? [close? #f]
>#:headers [headers '()]
>#:content-decode [decodes '(gzip)]
>#:boundary [boundary (random-boundary)])
>   (define content-type-header
> (string-append
>  "Content-Type: multipart/form-data; boundary="
>  boundary))
>
>   (http-conn-send! hc uri
>#:version version
>#:method method
>#:close? close?
>#:headers (cons content-type-header headers)
>#:content-decode decodes
>#:data (multipart-body->data-proc boundary
> multipart-body)))
>
> (define (mime-escape s)
>   (regexp-replace* #rx"[\"\\]" s "\\0"))
>
> (define (make-string-part field-name field-value)
>   (λ (write-chunk boundary)
> (write-chunk
>  (format
>   (string-append "--~a\r\n"
>  "Content-Disposition: form-data; name=\"~a\"\r\n"
>   "Content-Type: text/plain; charset=utf-8\r\n"
>   "\r\n"
>   "~a\r\n")
>   boundary
>   (mime-escape field-name)
>   field-value
>
>
> (define (make-file-part field-name file-name content-type in)
>   (λ (write-chunk boundary)
> (write-chunk
>  (format
>   (string-append "--~a\r\n"
>  "Content-Disposition: form-data; name=\"~a\";
> filename=\"~a\"\r\n"
>   "Content-Type: ~a\r\n"
>   "\r\n")
>   boundary
>   (mime-escape field-name)
>   (mime-escape file-name)
>   content-type))
>
> (define buffer (make-bytes 4096))
> (let loop ([n (read-bytes-avail! buffer in)])
>   (cond
> [(eof-object? n)
>  n]
> [else
>  (write-chunk (subbytes buffer 0 n))
>  (loop (read-bytes-avail! buffer in))]))
>
> (write-chunk "\r\n")))
>
> (define (multipart-body->data-proc boundary parts)
>   (λ (write-chunk)
> (for ([part parts])
>   (part write-chunk boundary))
> (write-chunk (format "--~a--\r\n" boundary
>
> (define (random-boundary)
>   (string-append
>"--"
>(bytes->hex-string
> (crypto-random-bytes 8

Oh, this is useful!  I didn't see this when asking for data-procedure/c
examples earlier on the list :)

BTW do you mind specifying a license for your code above so I might
incorporate parts of it into my work?  Maybe either LGPL or Apache v2?

-- 
You received this message because you are subscribed to the Google 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] Multipart HTTP requests

2019-01-30 Thread Christopher Lemmer Webber
Philip McGrath writes:

> I've put up the code I mentioned for email-sending and a proxy server at
> https://github.com/LiberalArtist/multipart-writing-examples As noted, these
> are not general-purpose solutions to either of those problems—I know of a
> bunch of cases I don't cover, and I basically only have to use these with
> trusted input—so caveat utor! But hopefully they're useful. I'd be very
> happy to contribute to this effort, as well: a proper multipart writing
> library would go a long way to getting some of the little bits of code I've
> produced into good enough shape to post as a package, enough so that I've
> thought about tackling it myself.

Thank you!  While not perfect, still probably helpful for my purpose :)

> Maybe you've already seen this, but most of the functions in this family
> support supplying post data as a `data-procedure/c
> `,
> which lets you stream using chunked content transfer encoding. I think the
> most explicit documentation for that is under `http-conn-send!
> `.

I have seen this but admittedly I do not understand how to use it.
Maybe it is a failure on my part to understand the contract
descriptions.

Could someone supply an example of use?  I'd really appreciate it.

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