Re: [racket-users] Path to file in dynamic-place

2018-01-22 Thread 'Royall Spence' via Racket Users
Bah, I spoke too soon. Setting the current-load-relative-directory has no 
effect on the file loading behavior of dynamic-place.

On Mon, Jan 22, 2018, at 12:02 PM, 'Royall Spence' via Racket Users wrote:
> Thanks, this makes more sense now. I'll just slap this at the type of my 
> place-creating modules for my own sanity:
> (current-load-relative-directory (current-directory))
> 
> On Mon, Jan 22, 2018, at 11:52 AM, Sam Tobin-Hochstadt wrote:
> > `dynamic-place` works like (I believe) `dynamic-require`, which starts
> > in `(current-load-relative-directory)`. If you want to use it in a
> > file and get consistent file-relative behavior, I suggest using
> > `define-runtime-path` or `quote-module-path`.
> > 
> > Sam
> > 
> > On Mon, Jan 22, 2018 at 11:48 AM, 'Royall Spence' via Racket Users
> > <racket-users@googlegroups.com> wrote:
> > > In the docs for places 
> > > (https://docs.racket-lang.org/reference/places.html),
> > > the example shows creating a place like so:
> > > (dynamic-place "place-worker.rkt" 'place-main)
> > >
> > > When I do this on LInux (haven't tried other systems yet), the search path
> > > starts at my home directory and fails to find the file. It's not a huge
> > > problem since I can invoke it with the full path:
> > > (dynamic-place (build-path (current-directory) "place-worker.rkt")
> > > 'place-main)
> > >
> > > but this does seem like either an error in the docs or in the behavior of
> > > the dynamic-place procedure. At first I was thinking our other 
> > > `path-spec?`
> > > procedures start with the current module's directory, but then I noticed 
> > > it
> > > actually uses a `module-spec?`. The only other time I really use that,
> > > though, is for `require`, which certainly does start in the current 
> > > module's
> > > directory.
> > >
> > > Should I submit a change in the docs? In the procedure? Am I barking up 
> > > the
> > > wrong tree?
> > >
> > > --
> > > 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] Path to file in dynamic-place

2018-01-22 Thread 'Royall Spence' via Racket Users
Thanks, this makes more sense now. I'll just slap this at the type of my 
place-creating modules for my own sanity:
(current-load-relative-directory (current-directory))

On Mon, Jan 22, 2018, at 11:52 AM, Sam Tobin-Hochstadt wrote:
> `dynamic-place` works like (I believe) `dynamic-require`, which starts
> in `(current-load-relative-directory)`. If you want to use it in a
> file and get consistent file-relative behavior, I suggest using
> `define-runtime-path` or `quote-module-path`.
> 
> Sam
> 
> On Mon, Jan 22, 2018 at 11:48 AM, 'Royall Spence' via Racket Users
> <racket-users@googlegroups.com> wrote:
> > In the docs for places (https://docs.racket-lang.org/reference/places.html),
> > the example shows creating a place like so:
> > (dynamic-place "place-worker.rkt" 'place-main)
> >
> > When I do this on LInux (haven't tried other systems yet), the search path
> > starts at my home directory and fails to find the file. It's not a huge
> > problem since I can invoke it with the full path:
> > (dynamic-place (build-path (current-directory) "place-worker.rkt")
> > 'place-main)
> >
> > but this does seem like either an error in the docs or in the behavior of
> > the dynamic-place procedure. At first I was thinking our other `path-spec?`
> > procedures start with the current module's directory, but then I noticed it
> > actually uses a `module-spec?`. The only other time I really use that,
> > though, is for `require`, which certainly does start in the current module's
> > directory.
> >
> > Should I submit a change in the docs? In the procedure? Am I barking up the
> > wrong tree?
> >
> > --
> > 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] Path to file in dynamic-place

2018-01-22 Thread 'Royall Spence' via Racket Users
In the docs for places 
(https://docs.racket-lang.org/reference/places.html), the example shows 
creating a place like so:
(dynamic-place 

 "place-worker.rkt" 'place-main)

When I do this on LInux (haven't tried other systems yet), the search path 
starts at my home directory and fails to find the file. It's not a huge 
problem since I can invoke it with the full path:
(dynamic-place (build-path (current-directory) "place-worker.rkt") 
'place-main)

but this does seem like either an error in the docs or in the behavior of 
the dynamic-place procedure. At first I was thinking our other `path-spec?` 
procedures start with the current module's directory, but then I noticed it 
actually uses a `module-spec?`. The only other time I really use that, 
though, is for `require`, which certainly does start in the current 
module's directory.

Should I submit a change in the docs? In the procedure? Am I barking up the 
wrong tree?

-- 
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] What is the right way to generate HTML from the web server?

2018-01-04 Thread 'Royall Spence' via Racket Users
I'd enjoy a #lang that parses Jinja templates. They've proliferated to
all the major web languages and work nicely, so a Racketized version
seems like an obvious upgrade.

On Thu, Jan 4, 2018, at 3:23 PM, Matthew Butterick wrote:
> 
>> On Jan 4, 2018, at 11:47 AM, Jay McCarthy
>>  wrote:>> 
>> FWIW, txexpr is essentially just `xexpr->string` but it sees when you>> put 
>> in a `script` or `style` and it puts the `make-cdata` for
>> you. (It>> also does a bit more checking to make sure the xexpr is 
>> well-formed.)> 
> 
> For anyone curious why — the HTML spec calls for `script` and `style`
> blocks to be treated as if they were CDATA but without actually
> requiring a CDATA wrapper. [1] So `xexpr->html` handles that
> housekeeping. `xexpr->string` doesn't (because it has XML, not HTML,
> in mind). See also: [2]> 
> If we were to dig down further there are probably certain tags that
> should be closed one way in XML and a different way in HTML but ...
> I've served zillions of HTML pages made with `xexpr->html`. No one has
> complained (I mean, about the level of spec compliance).> 
> 
> On Thu, Jan 4, 2018 at 8:48 AM, Matt Jadud  wrote:
>>> 
>> What is the best way to generate HTML from the webserver? I don't
>> care about XML vs. HTML; I just want the fastest path to writing a
>> small web application that solves a problem that I have,> 
> FWIW I've found that keeping the HTML template static, and populating
> it with data from AJAX requests back to the Racket web server, can
> help keep things clean.> 
> 
> [1] https://www.w3.org/TR/html4/types.html#h-6.2
> 
> [2] https://groups.google.com/d/topic/racket-users/g0NuR5KLH7k/discussion> 


> --
>  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] Open source projects

2017-10-29 Thread 'Royall Spence' via Racket Users
The docs are located in the main repository here:
https://github.com/racket/racket/tree/master/pkgs/racket-doc/scribblingsIt's 
not always easy to find the page you're looking for via the source
tree, so I recommend using a string search on Github to find the
sections of documentation you'd like to improve.

On Sun, Oct 29, 2017, at 05:35 PM, Guthrie Price wrote:
> It was recommended to me by a friend that while I am still learning
> Racket perhaps I can contribute to any documentation issues. This
> sounds like a good idea to me, but I am not sure how I can get
> started. Any help getting the ball rolling would be greatly
> appreciated.> 
> Thank you,
> Guthrie
> 
>  
> Virus-free. www.avast.com[1]
> 
> 
> On Tue, Oct 24, 2017 at 1:39 PM, Stephen De Gabrielle
>  wrote:>> I think the ‘doable exercise for a budding 
> Racket programmer‘ was
>> scoped to be an achievable, but important piece that someone else
>> could use to make a DrRacket plugin.(or more likely change
>> DrRacket core)>> 
>> Kind regards,
>> 
>> Stephen
>> 
>> On Tue, 24 Oct 2017 at 00:52, Guthrie Price
>>  wrote:>>> Thank you all so much for your comments 
>> (the resulting discussion
>>> was also entertaining and unexpected).>>> 
>>> If I were to implement path auto-completion, would it be useful if
>>> it wasn’t integrated into DrRacket? I am not precisely sure what I
>>> would be adding this functionality to if not DrRacket.>>> 
>>> 
>>> On Sunday, October 22, 2017, Neil Van Dyke 
>>> wrote: I could be missing something, but I think a filename completion
 procedure (not the DrRacket integration part) might be a doable
 exercise for a budding Racket programmer, so long as they already
 have a basic familiarity with using the filesystem and shell as a
 normal user. 
  Point them to the "Paths" and "Filesystem" sections of the Racket
  Reference, and tell them they just need a few procedures from each
  (probably including `split-path` and `directory-list`). 
  They might want to first make a procedure like this:
 
  (path-completions path-or-string?)
  ==> (listof completion-string)
 
  And then make a second procedure, which uses the first procedure,
  then adds an additional step, to let it return two values instead
  of one: 
  (path-completion-prefix-and-suffixes path-or-string?)
  ==> (values prefix-string-shared-by-all-completions
  (listof completion-remainder-after-any-shared-prefix-
  string)) 
  Then, when a user is interactively doing completion (like when
  they hit the Tab key in a shell), the first value returned by that
  second procedure is what would get added automatically to the
  path.  The second value is the list of possible completions
  following that shared prefix. 
  There are a few special cases to consider, but most should be easy
  to recognize and work through, just by thinking methodically about
  each point in your code.  For example, what do you do when the
  input path is relative, or when when there are no completions, or
  when the path is invalid or nonexistent or permissions-
  inaccessible, or when your path is already complete.  One case
  that's not obvious from the code: if the path is already complete
  and is a directory, a shell usually completes a directory
  separator, so consider whether you want to do that. 
  To make unit tests for these, they'll have to also look at more of
  the "Filesystem" section of the Racket Reference, to create and
  remove files and directories. 
  (I think wrapping a shell process, robustly, is much more
  difficult.) 
  -- 
 You received this message because you are subscribed to a topic in
 the Google Groups "Racket Users" group.  To unsubscribe from this 
 topic, visit
  
 https://groups.google.com/d/topic/racket-users/0sNHzZx3JPc/unsubscribe.
   To unsubscribe from this group and all its topics, send an email
  to racket-users+unsubscr...@googlegroups.com. 
 For more options, visithttps://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.>> 
>> -- 
>> Kind regards,
>> Stephen
>> --
>> Ealing (London), UK
>> 
> 
> 


> --
>  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.


Links:

  1. 

Re: [racket-users] Intro and projects inquiry

2017-10-13 Thread 'Royall Spence' via Racket Users
In this case, I'm thinking of the unfortunate JVM error messages from
Clojure. As far as I know, the main reason to suffer through Clojure's
attachment to the JVM is that no other Lisp has the same level of
support for web applications.

The second reason may be something about performance, but we can
probably close that gap with some different approaches. I'm specifically
thinking of taking a shot at a libev-based server like Common Lisp's Woo
for higher performance, although that would be a shot in the dark
because I don't understand the details affecting server performance
right now.

On Fri, Oct 13, 2017, at 11:55 AM, James wrote:
> 
> On Oct 13, 2017, at 9:44 AM, 'Royall Spence' via Racket Users wrote:
> 
> > Since we're bikeshedding here, I think we'd benefit from having a web
> > toolkit on par with Clojure's Luminus. We only need a few more packages,
> > a website documenting their interoperation, and a project skeleton to
> > create the same sort of experience with the benefit of better error
> > messages. I've already built one of the easy pieces (dotenv), and I'm
> > working on more more of them. Some of the things I'd like to include,
> > like server diagnostics, are a little over my head at the moment. I
> > intend to keep checking off the boxes, though, and have a
> > production-ready "framework" available sometime.
> 
> That's really good.  It's a pet peeve of mine that web sites and web
> tools often don't give, bury or suppress error messages.  My guess is
> that it started with the notion that you should suppress error messages
> to make SQL injection attacks harder.  I don't agree with that idea in
> the first place, much less in other areas besides opportunities for code
> injection.
> 
> -- 
> 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] Intro and projects inquiry

2017-10-13 Thread 'Royall Spence' via Racket Users
In my experience, it means two seemingly opposite things that unify to
create bad software. On the one hand, it's an extreme conservatism and
fear of attempting new things. Don't try a new language, just keep using
PHP. Don't install the new PHP version with better features, it could be
risky. Don't use automated library management and deployment, we don't
understand it. Don't use git, it sounds scary.

On the other hand, this same attitude of underconfidence and low
ambition drives the adoption of dubious tooling. We cannot possibly be
smart enough to write our own application, so use this slow and
confusing web framework. Google and Facebook use these heavy Javascript
tools, so we'd better do that, too, on every single project. Who are we
to defy the "experts" in our field?

At least, that's been my experience in 10 years of web development. It's
perfectly fine to make mistakes, but I can't stomach the repetition.
Enough of my complaining, though.

Since we're bikeshedding here, I think we'd benefit from having a web
toolkit on par with Clojure's Luminus. We only need a few more packages,
a website documenting their interoperation, and a project skeleton to
create the same sort of experience with the benefit of better error
messages. I've already built one of the easy pieces (dotenv), and I'm
working on more more of them. Some of the things I'd like to include,
like server diagnostics, are a little over my head at the moment. I
intend to keep checking off the boxes, though, and have a
production-ready "framework" available sometime.

On Fri, Oct 13, 2017, at 08:25 AM, David Storrs wrote:
> On Fri, Oct 13, 2017 at 2:27 AM, Eric Griffis  wrote:
> > On Thu, Oct 12, 2017 at 9:31 AM David Storrs  wrote:
> >>
> 
> > Web dev culture is a bigger issue.
> >
> > Eric
> 
> How so?
> 
> -- 
> 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] Intro and projects inquiry

2017-10-12 Thread 'Royall Spence' via Racket Users
Unfortunately, Whalesong's current fork requires an old version of
Racket and hasn't seen a commit to master in several months.
Racketscript is under active development, though, and provides a mostly-
complete implementation of Racket for Javascript. Seems comparable to
Clojurescript in its vision.
https://github.com/vishesh/racketscript


On Thu, Oct 12, 2017, at 12:43 PM, Thomas Lynch wrote:
> Apparently Whalesong is such an alterntiave.
> https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js
> A Lisp dialect, Clojure, has caused a lot of young folks to ask
> questions/to think about Lisp
> (https://m.oursky.com/why-i-chose-clojure-over-javascript-24f045daab7e)
> .> 
> On Thu, Oct 12, 2017 at 4:31 PM, David Storrs
>  wrote:>> My suggestion would be that the single 
> largest thing that would make>> Racket take off is if it could become a 
> replacement for Javascript.
>> The browser is the default GUI for most work these days, and doing
>> real-time interfaces in the browser requires Javascript.  If Racket
>> could run inside the browser and was more convenient to work
>> with than>> Javascript then it would start climbing the hockey stick.  That 
>> would>> be an enormous project and I don't even know how you would get the
>> popular browsers to adopt it; forking the browsers won't work and nor>> will 
>> making a plugin / addon -- it's got to run out of the box
>> so that>> developers can rely on the fact that visitors to their site will be
>> able to use it.
>> 
>> For now, something that made it trivial to compile Racket to
>> Javascript is probably the best option.  As it happens, I believe
>> there is some effort in that direction. :>
>> 
>> On Wed, Oct 11, 2017 at 10:37 PM, Neil Van Dyke
>>  wrote:>> > Eric Griffis wrote on 10/11/2017 07:44 PM:
>> >>
>> >> On Wed, Oct 11, 2017 at 2:58 PM Neil Van Dyke
>> >> > >> > wrote:
>> >>
>> >>
>> >> * Being there soon with a Web Assembly and HTML5 plus server
>> >> full-stack
>> >> story, in case developers respond favorably to that.
>> >>
>> >>
>> >> Web back-ends are my wheelhouse. It sure would make my
>> >> professional life>> >> easier... Not gonna lie, this isn't something I'd 
>> >> look forward to
>> >> banging>> >> out alone.
>> >
>> >
>> > There are some scalable HTTP protocol handling things I'd like
>> > to try,>> > including some hardcore systems-ish programming, and then 
>> > multiple
>> > parties>> > (including me) could layer independent framework-y things over 
>> > that>> > (server-side-only, and client-side-too).
>> >
>> > The WebAssembly part is what might be an emerging opportunity,
>> > but am>> > guessing the best way involves working with the tentative new 
>> > Chez
>> > backend>> > for Racket.  (Also, WebAssembly didn't look very simple nor 
>> > yet as>> > well-documented as you'd want, and looks still being hammered
>> > out.  So,>> > knowing how adopted Web standards tend to happen... you 
>> > might have
>> > to put in>> > considerable effort to catch up with and track it, buy a 
>> > gorilla
>> > suit, munch>> > some beetle grubs[1], and hopefully become accepted by the 
>> > pack,
>> > to be>> > confident that Racket will be a first-class citizen in
>> > WebAssembly.)>> >
>> >> * Push DSL-based programming, for which Racket might already
>> >>   have the>> >> best technology.  (The other day, I saw someone 
>> >> looking to
>> >> hire>> >> developers to use some DSL-based speculative methodology
>> >> thing...>> >> in Ruby.)
>> >>
>> >>
>> >> This might also be interesting. Any concrete demand out there to
>> >> drive the>> >> process?
>> >
>> >
>> > Chattering about DSLs now seems mainstream.  Also, Agile-esque
>> > upstart>> > methodologists are always clamoring to invent and brand
>> > approaches, now>> > including applications of DSLs. :)
>> >
>> > (DSLs can be little mini-languages used by programmers as part of
>> > any kind>> > of programming, they can be used by programmers mix 
>> > traditional
>> > language>> > paradigms in a code base, they can be used to support domain
>> > experts/specialists capturing and maintaining knowledge/behavior
>> > separate>> > from programmers.)
>> >
>> >>
>> >> The Godot game engine is kinda like this, but for Python. It has a
>> >> lot of>> >> rough edges, which could help design a good Racket 
>> >> alternative.
>> >> There may be>> >> a ton of reusable functionality in a project like that.
>> >
>> >
>> > Over a decade ago, someone was actually doing game engine-ish stuff
>> > using>> > PLT Scheme (earlier version of Racket), to, IIRC, develop a 3D
>> > training>> > simulator for first-responders in emergency scenarios.  It 
>> > might've
>> > used the>> > open-sourced Quake engine, or just built atop OpenGL; I forget
>> > whether I>> > heard.  At the time, I guess a Lisp was a big enough win for 
>> > that,
>> > and 

Re: [racket-users] using Racket web server behind Apache as proxied HTTPS app server

2017-09-26 Thread 'Royall Spence' via Racket Users
I use UFW to configure iptables on my server. It's much less error prone
than configuring iptables directly in my experience. SSH with key auth
and http(s) are the only ways in. https://help.ubuntu.com/community/UFW


On Tue, Sep 26, 2017, at 08:10 PM, 'Royall Spence' via Racket Users wrote:> 
Yeah, you'll want to allow connections only from the frontend
> webserver. That's probably 127.0.0.1, but it would be different if
> you're doing a frontend server with a pool of backends.> 
> On Tue, Sep 26, 2017, at 08:04 PM, Matthew Butterick wrote:
>> 
>>> On Sep 26, 2017, at 3:45 PM, Alexis King <lexi.lam...@gmail.com>
>>> wrote:>>> 
>>> When an HTTPS request reaches Apache, it will use the certificate
>>> that it knows about to perform SSL negotiation, then it will
>>> forward the>>> decrypted HTTP request to your Racket server over ordinary 
>>> HTTP.
>>> It will>>> subsequently encrypt the response it receives, then send it back
>>> to the>>> client. This means your Racket server doesn’t need to worry
>>> about SSL>> 
>> OK thanks. That works. It just seems like cheating — laundering HTTP
>> into HTTPS.>> 
>> What about the new HTTP port that the Racket web server has opened?
>> Should that be secured somehow (e.g., firewall)?>> 


>> --
>> 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] using Racket web server behind Apache as proxied HTTPS app server

2017-09-26 Thread 'Royall Spence' via Racket Users
Yeah, you'll want to allow connections only from the frontend webserver.
That's probably 127.0.0.1, but it would be different if you're doing a
frontend server with a pool of backends.
On Tue, Sep 26, 2017, at 08:04 PM, Matthew Butterick wrote:
> 
>> On Sep 26, 2017, at 3:45 PM, Alexis King
>>  wrote:>> 
>> When an HTTPS request reaches Apache, it will use the certificate
>> that it knows about to perform SSL negotiation, then it will
>> forward the>> decrypted HTTP request to your Racket server over ordinary 
>> HTTP.
>> It will>> subsequently encrypt the response it receives, then send it
>> back to the>> client. This means your Racket server doesn’t need to worry 
>> about SSL> 
> OK thanks. That works. It just seems like cheating — laundering HTTP
> into HTTPS.> 
> What about the new HTTP port that the Racket web server has opened?
> Should that be secured somehow (e.g., firewall)?> 


> --
>  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] Choose Language menu too Long when selecting Legacy languages

2017-09-02 Thread 'Royall Spence' via Racket Users
Looks like the resize handles on the edge of the window don't do
anything. Until that's corrected (if it can be), the X window system
allows you to hold  and click anywhere in a window to drag it
around the screen. Hopefully that'll allow you to drag the top portion
off the screen and click the buttons at the bottom.

On Sat, Sep 2, 2017, at 06:37 AM, Srinivas K wrote:
> I just installed DrRacket in Racket 6.10 in Manjaro Linux to work my way
> through SICP. When selecting a language through Choose Language if I
> click Other Languages the dialog box becomes too long to be accomadated
> in my monitor and so the Ok button disappears. Is it a bug with the GUI
> in DrRacket?
> 
> -- 
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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] Library function naming

2017-08-28 Thread 'Royall Spence' via Racket Users
Is there a convention on naming library functions? I'm thinking that
`library-function-name` is the right way to export functions, but I
haven't read enough Racket code to know what qualifies. For example, a
"money" library would export functions like "money-convert" and
"money-deposit".

Does that seem right? What's everyone else in Racket-land doing? What
about other Lisp languages?

-- 
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: Racket dotenv file loading

2017-08-28 Thread 'Royall Spence' via Racket Users
Thanks for the feedback. I should be able to apply all of these in the
next day or two.

Regarding the test module and rackunit, the raco package template
actually puts two test modules into main.rkt, with rackunit in one of
them. This smells like a mistake, right? I'm going to try to find the
relevant section in the Racket source and see if a PR is appropriate.

On Mon, Aug 28, 2017, at 12:41 AM, Jack Firth wrote:
> On Sunday, August 27, 2017 at 7:57:52 PM UTC-7, Royall Spence wrote:
> > And it's ready to consume:
> > https://pkgd.racket-lang.org/pkgn/package/dotenv
> > 
> > This is the first Lisp-family code I've published, so that's exciting.
> > Any feedback the list has to offer regarding style, approach, or
> > packaging would be welcome.
> 
> Looks great! I'll keep this in mind next time I'm working with env
> configs. Here are
> some comments:
> 
> - Using `for` expressions would make recursion unnecessary, and it
> cooperates well with in-lines.
> - Racket style generally prefers lists, first, and rest to raw pairs and
> the c*r functions.
> - You can put your test submodules anywhere, they don't have to be in
> main.rkt. So in dotenv/private/tests.rkt you don't need to define and
> export a suite, you can just use (module+ test ...). Running raco test -p
>  will run all test submodules found anywhere in the
> package.
> - It looks like the generated scribble files got included in your repo. I
> typically add html, js, and css files to my .gitignore to avoid that.
> - If you move your (require rackunit) expressions into your test
> submodules, rackunit will be a build dependency instead of a runtime
> dependency.
> - Using @defproc[] in your scribble docs will make the exports of dotenv
> searchable.
> - Contracts and contract-out make it easy to add argument checking to
> functions, I recommend using them.
> 
> -- 
> 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: Racket dotenv file loading

2017-08-27 Thread 'Royall Spence' via Racket Users
And it's ready to consume:
https://pkgd.racket-lang.org/pkgn/package/dotenv

This is the first Lisp-family code I've published, so that's exciting.
Any feedback the list has to offer regarding style, approach, or
packaging would be welcome.

On Sun, Aug 27, 2017, at 10:09 PM, 'Royall Spence' via Racket Users
wrote:
> Thanks, Jack. It sounds like a great Rackety solution and easy way to
> get into trying my own languages. I've already started work, though, and
> the 40 lines of code I've written looks like it'll do the job once I
> shake out the bugs.
> 
> On Sun, Aug 27, 2017, at 05:49 PM, Jack Firth wrote:
> > On Sunday, August 27, 2017 at 11:01:17 AM UTC-7, Royall Spence wrote:
> > > I'm starting work on a Racket library for loading .env files to override 
> > > environment variables. This is a common way of doing things for people 
> > > who want to run multiple web applications on a single server without 
> > > their environment variables competing for namespace. The classic example 
> > > is this Ruby library: https://github.com/bkeepers/dotenv
> > > 
> > > Just checking to make sure I haven't overlooked an already existing 
> > > library that provides this behavior. Should I keep going?
> > 
> > There is the Envy library for parsing environment variables, but there
> > doesn't seem to be anything for loading .env files. Personally, I think
> > this would be a great place to make a #lang that worked something like
> > this:
> > 
> > #lang dotenv
> > my-library-num-workers = 5
> > my-library-tmpdir = "/tmp/my_library"
> > 
> > ... and then if you `require` it, it sets the current environment. Or
> > maybe it gives you a function to execute a thunk with the new
> > environment. The advantage to using a #lang here instead of a file is
> > your dotenv file is you no longer need to do any parsing or file IO at
> > runtime and your env file is just a normal code module imported like any
> > other. Plus you could write a syntax highlighter to make it easy to edit
> > the env files in DrRacket.
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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: Racket dotenv file loading

2017-08-27 Thread 'Royall Spence' via Racket Users
Thanks, Jack. It sounds like a great Rackety solution and easy way to
get into trying my own languages. I've already started work, though, and
the 40 lines of code I've written looks like it'll do the job once I
shake out the bugs.

On Sun, Aug 27, 2017, at 05:49 PM, Jack Firth wrote:
> On Sunday, August 27, 2017 at 11:01:17 AM UTC-7, Royall Spence wrote:
> > I'm starting work on a Racket library for loading .env files to override 
> > environment variables. This is a common way of doing things for people who 
> > want to run multiple web applications on a single server without their 
> > environment variables competing for namespace. The classic example is this 
> > Ruby library: https://github.com/bkeepers/dotenv
> > 
> > Just checking to make sure I haven't overlooked an already existing library 
> > that provides this behavior. Should I keep going?
> 
> There is the Envy library for parsing environment variables, but there
> doesn't seem to be anything for loading .env files. Personally, I think
> this would be a great place to make a #lang that worked something like
> this:
> 
> #lang dotenv
> my-library-num-workers = 5
> my-library-tmpdir = "/tmp/my_library"
> 
> ... and then if you `require` it, it sets the current environment. Or
> maybe it gives you a function to execute a thunk with the new
> environment. The advantage to using a #lang here instead of a file is
> your dotenv file is you no longer need to do any parsing or file IO at
> runtime and your env file is just a normal code module imported like any
> other. Plus you could write a syntax highlighter to make it easy to edit
> the env files in DrRacket.
> 
> -- 
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 dotenv file loading

2017-08-27 Thread 'Royall Spence' via Racket Users
I'm starting work on a Racket library for loading .env files to override 
environment variables. This is a common way of doing things for people who want 
to run multiple web applications on a single server without their environment 
variables competing for namespace. The classic example is this Ruby library: 
https://github.com/bkeepers/dotenv

Just checking to make sure I haven't overlooked an already existing library 
that provides this behavior. Should I keep going?

-- 
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] Seeking expert opinion on how Racketeering tames web development chaos.

2017-08-02 Thread 'Royall Spence' via Racket Users
A Reddit user wrote an interesting post about their experience
programming a mobile roguelike with Lambdanative:
https://www.reddit.com/r/scheme/comments/6hng3q/i_developed_a_medium_sized_cross_platform/

On Tue, Aug 1, 2017, at 11:08 PM, Neil Van Dyke wrote:
> Eric MacAdie wrote on 08/01/2017 09:54 PM:
> > WRT mobile, maybe someone could port LambdaNative to Racket:
> > http://www.lambdanative.org/
> 
> Do you have experience with LambdaNative?  I looked at it briefly a year 
> or two ago, and it looked like they'd made reasonable and neat way to do 
> what they needed to for world health projects.  But unclear that they 
> were going to go any further with the underlying software platform.  
> (And, the Linux target for the first example/demo I tried crashed when 
> built and run on Debian Stable.) Git today shows that there is 
> maintenance going on, which is encouraging.  I'd be interested to hear 
> of experiences with it.
> 
> (I'm speaking of LambdaNative above; I've used Gambit a bit more over 
> the years, and Gambit is a separate thing with its own other merits.)
> 
> I'm hoping that the current Racket backend refactoring will make it 
> easier to target different mobile platforms (JS/WebAssembly for online 
> as well as either HTML5 Offline or Cordova, native for iOS and Android).
> 
> In any case -- whether one is considering porting LambdaNative to 
> Racket, or looking to do something different for mobile with Racket -- 
> it's worth taking a look at what LambdaNative did and how they did it 
> using Gambit.
> 
> -- 
> 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] Boot To Racket

2017-07-07 Thread 'Royall Spence' via Racket Users
How about a full suite of all the usual shell commands? I believe this
is the approach scsh takes. Come to think of it, I'm going to give that
a try now...

On Fri, Jul 7, 2017, at 08:16 PM, Lehi Toskin wrote:
> I have this idea, this vision. I wish to create a small system that would
> more or less only be to turn on the machine (probably an RPi) and then
> you'd immediately be inside a Racket REPL. Probably wouldn't be very
> interesting by itself, but that seems to be almost exactly what eLua and
> MicroPython are.
> 
> Say, for the sake of discussion, such a tiny system were created. What
> functionality would you expect to be available? Filesystem access?
> Networking? Or simply just the racket/base REPL and that's 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.

-- 
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] Random values in Typed Racket?

2017-07-05 Thread 'Royall Spence' via Racket Users
Sounds like two questions wrapped into one. When it comes to setting
names to values, Scheme programming encourages the use of a "let"
expression to bind values to names inside of a (usually narrow) scope
rather than assigning a value to a variable. See more here:
https://docs.racket-lang.org/guide/let.html

As for the typed random value, the Flonum from (random) should be fine
since a Flonum is also a Real. Can you provide a short example of
runnable code that exposes the problem you're having?

On Wed, Jul 5, 2017, at 08:39 PM, Alasdair McAndrew wrote:
> I'm doing a little programming which requires the use of some random
> numbers.  Basically I add a random value at one stage, and subtract it a
> bit later.  Something like this pseudo-code (where "x" is an existing
> variable):
> 
>set rand_value <- (random)
>set new_value <- x + rand_value
> 
>... do stuff ...
> 
>set new_value <- new_value  - rand_value
> 
> All values may be considered Reals.  I tried to do this in Typed Racket,
> where x was of type "Real" and got errors about mismatched types:
> "(random)" produces a "flonum".  I was also using "set!" for the
> assignment of the random value, which I understand to be poor practice:
> how would I do something like the above in a more "rackety" manner? 
> 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.
> 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] How do I offer suggestions for the docs?

2017-01-09 Thread 'Royall Spence' via Racket Users
I think this is what you're looking for:
https://github.com/racket/racket/blob/62f5b2c4e4cdefa18fa36275074ff9fe376ddaf3/pkgs/racket-doc/scribblings/reference/data.scrbl
I was only able to find it by searching a string in the racket/racket
repo on github.com.
As far as I know, you just submit a pull request with your
clarifications. I agree that contribution guidelines would be a useful
addition to README.md

On Mon, Jan 9, 2017, at 01:20 PM, David Storrs wrote:
> Sometimes I find places in the docs where things could be better --
> for example, I think it would make sense if the Keywords page
> (http://docs.racket-lang.org/reference/keywords.html?q=string-%3Edocs#%28def._%28%28quote._~23~25kernel%29._string-~3ekeyword%29%29)
> had a mention of keyword-apply, and an explanation of how
> string->keyword is not useful for what it sounds like it's useful for.
> 
> I asked this once before but I've forgotten the answer and can't find
> it:  how do I submit changes for the docs?
> 
> I know I can click on the title of a section to see a path like
> "@secref["keywords" #:doc '(lib
> "scribblings/reference/reference.scrbl")]" but that does me not a bit
> of good since after a couple  minutes of searching through two dozen
> repositories on Github I cannot find where the 'scribblings' directory
> is.
> 
> This would be a really good thing to put in the README file, or at
> least add a file named "CONTRIBUTING" at top level in the 'racket'
> repo where people could reference this information.
> 
> -- 
> 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] FFI Library Naming Conventions

2017-01-08 Thread 'Royall Spence' via Racket Users
I'm making some bindings for a C library. In the original library, the 
functions are named as "LIBNAME_do_stuff". Should I keep those the same in the 
FFI binding or define them as "libname-do-stuff"? Is there a convention for 
these things?

-- 
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] Futures Mandelbrot Example

2016-12-23 Thread 'Royall Spence' via Racket Users
Copying the code from the futures mandelbrot example doesn't seem to work in 
the way it's explained. The futures visualizer window shows the two threads 
switching back and forth with short intervals of work followed by a sync. This 
happens in DrRacket 6.7 on both OSX and Linux.

At first I thought there was a typo in the example code, as if (* 2.0 (->fl y)) 
might benefit from being converted to (fl* 2.0 (->fl y)). That didn't make any 
difference, though.

Has something important changed in futures since the guide was written? Is this 
evidence of a problem with my computers?

-- 
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] Futures Mandelbrot Example

2016-12-21 Thread 'Royall Spence' via Racket Users
In the parallelism section of the guide 
(https://docs.racket-lang.org/guide/parallelism.html), there's a Mandelbrot set 
example demonstrating parallel computation with futures. I've tried it on two 
different machines (with OSX and Linux) but I don't seem to get any parallel 
computation. The futures visualizer shows very short "squares" of work with a 
sync-and-switch to the other thread on both machines. This pattern continues 
all the way to the end of computation. Both machines are using DrRacket 6.7. 
The first example with the for/list iteration works as described.

Has something about futures changed since the example was written? Is the 
problem in the example code or in Racket itself? I'd be happy to submit a PR 
with a fixed example, but I don't understand what's happening well enough to 
figure it out on my own.

I tried to send this message with a screenshot of the futures visualizer a few 
minutes ago, but it was immediately deleted.

-- 
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: Newbie seeking advice

2016-12-20 Thread 'Royall Spence' via Racket Users
On Tuesday, December 20, 2016 at 4:47:59 AM UTC-5, steve.lett777 wrote:
> I really want to learn programming but I am a slow learner. How do I know if 
> I can achieve learning programming or not? Am I wasting my time trying?
> 
> And after that one is answered, Which language should I learn programming in, 
> Racket, Scheme, or Python?

It depends on what you want to do with your programming, but I believe Racket 
is a fine place to start and/or stay. Start with something simple and step your 
way through. A book like Realm Of Racket can show you through lots of example 
programs. The Little Schemer (Racket is a type of Scheme) will teach elements 
of functional programming, which is a crucial concept for well-organized, 
reliable code. Spend enough time programming and it becomes clear that the real 
trick (besides making something work) is writing software that is easy to 
modify down the road.

It's good that you do not expect the process to be quick. You won't be able to 
understand things at the pace you're able to read them. Expect to grasp little 
pieces at a time and to learn the same lessons over and over until they become 
habitual patterns of thought. Eventually, you'll start to form your own 
opinions and decide if Racket is what you want to continue using.

-- 
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.