Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
On Thu, Jan 19, 2017 at 6:45 PM, Robby Findler
 wrote:
> In DrRacet, current-directory in initialized to the directory
> containing the file where you hit "Run" and in the shell it is
> initialized to the current directory as understood by the shell.
>
> Is that what you're asking?
>
> Robby

I think so, yes.  What is current-directory set to for the DrRacket repl?

On a related topic, Dr Racket does not seem to properly inherit the
environment from the shell.  (getenv "PATH") from the repl does not
return the same value as "echo $PATH" from the shell.  Does Dr Racket
have anything equivalent to a .bashrc file?

>
>
> On Thu, Jan 19, 2017 at 4:36 PM, David Storrs  wrote:
>> For the record, I know I can pass an absolute path (defined with
>> define-runtime-path) to load-initial-data.  My question is more about
>> "why is this different between the shell and Dr Racket?"
>>
>> On Thu, Jan 19, 2017 at 5:23 PM, David Storrs  wrote:
>>> define-runtime-path is based on the enclosing file, not the running file.
>>>
>>>
>>>
>>> ;; file:  app/lib/db/initial_test_data.sql
>>> ...various SQL commands...
>>>
>>>
>>> ;; file:  app/lib/t/testing_utils.rkt
>>> (define-runtime-path thisdir ".")
>>> (define cmd (string-append "psql -d biomantica < "
>>>  (path->string (build-path thisdir where
>>>   (say "shelling out in order to load initial data into DB. Command
>>> is: \n\t" cmd)
>>>   (system cmd)
>>> )
>>>
>>>
>>> ;;  file:  app/test_1.rkt
>>> (require "lib/t/testing_utils.rkt")
>>> (load-initial-data "lib/db/initial_test_data.sql")
>>>
>>>
>>> ;;  file:  app/lib/db/test_2.rkt
>>> (require "../t/testing_utils.rkt")
>>> (load-initial-data "./initial_test_data.sql")
>>>
>>>
>>> $ ./test_1.rkt
>>> shelling out in order to load initial data into DB. Command is:
>>> psql -d biomantica < ./lib/db/initial_test_data.sql
>>> INSERT 0 0
>>> ...lots of other SQL results...
>>>
>>> $  ./lib/db/test_2.rkt
>>> shelling out in order to load initial data into DB. Command is:
>>> psql -d biomantica < ././initial_test_data.sql
>>> /bin/sh: ././initial_test_data.sql: No such file or directory
>>> #f
>>>
>>>
>>> Note that both test_N.rkt files worked when I used the prior version.
>>>
>>> On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler
>>>  wrote:
 define-runtime-path is designed for this problem, IIUC. Let me know if
 the docs don't help.

 Robby

 On Thu, Jan 19, 2017 at 11:47 AM, David Storrs  
 wrote:
> Short form:  When using Dr Racket, how do I write something that says
> "Here is a path to a file that I care about.  The path is relative to
> you, the script that is running the code" ?
>
> Long form:
>
> I have a file, testing_utils.rkt, that includes the following snippet of 
> code:
>
> (define (load-initial-data where)
>   (define cmd (string-append "psql -d biomantica < "
>  (path->string
>   (path-only
>(path->complete-path
> (find-system-path 'run-file
>  where))
>   (say "shelling out in order to load initial data into DB. Command
> is: \n\t" cmd)
>
>   (void
>(with-output-to-string  ;; silence the output
>  (thunk
>   (system cmd)
>
>
> The way this gets used is that one of our test scripts (e.g.
> 'endpoints.t') will (require "path/to/testing_utils.rkt") and then
> call the load-initial-data function as follows:
>
> (load-initial-data "../initial_test_data.sql")
>
> I operate in Emacs via the shell, while my cofounder James uses Dr
> Racket.  The above sequence works for me but not for him.  When I run
> endpoints.t it locates the endpoints.t file, generates the path from
> there to the initial_test_data.sql file, and shells out to run that
> SQL through psql in order to load the database for testing.  When
> James tries it it fails.
>
> The failure seems to be that for me "the running script" is the
> endpoints.t file, while for him it's the Dr Racket executable.  I'm
> not sure where to even begin sorting this out, so I was hoping for
> some help.
>
> Any thoughts?
>
> Dave
>
>
> PS:  James had to step out for something else or he would be sending
> this himself.
>
> --
> 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 

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Philip McGrath
Assuming I understand it correctly, I think the problem in the original is
that, in Dr. Racket, (find-system-path 'run-file) returns the path of Dr.
Racket, whereas at the shell it returns the path of the file being run.

It's a hack, but I think you could make a quick and dirty solution to
finding the directory of the running module in either case by checking if
the program is running in Dr. Racket and, if it is, taking advantage of the
way Dr. Racket initializes current-directory. This seems to work, assuming
that your program isn't supposed to have "DrRacket" anywhere in its path
and that Dr. Racket does (it does on MacOS, at least):

(let ([run-file (path->complete-path (find-system-path 'run-file))])
  (cond
[(regexp-match? #rx"DrRacket" run-file)
 (path->complete-path
  (current-directory))]
[else
 (path-only run-file)]))


-Philip

On Thu, Jan 19, 2017 at 5:45 PM, Robby Findler 
wrote:

> In DrRacet, current-directory in initialized to the directory
> containing the file where you hit "Run" and in the shell it is
> initialized to the current directory as understood by the shell.
>
> Is that what you're asking?
>
> Robby
>
>
> On Thu, Jan 19, 2017 at 4:36 PM, David Storrs 
> wrote:
> > For the record, I know I can pass an absolute path (defined with
> > define-runtime-path) to load-initial-data.  My question is more about
> > "why is this different between the shell and Dr Racket?"
> >
> > On Thu, Jan 19, 2017 at 5:23 PM, David Storrs 
> wrote:
> >> define-runtime-path is based on the enclosing file, not the running
> file.
> >>
> >>
> >>
> >> ;; file:  app/lib/db/initial_test_data.sql
> >> ...various SQL commands...
> >>
> >>
> >> ;; file:  app/lib/t/testing_utils.rkt
> >> (define-runtime-path thisdir ".")
> >> (define cmd (string-append "psql -d biomantica < "
> >>  (path->string (build-path thisdir where
> >>   (say "shelling out in order to load initial data into DB. Command
> >> is: \n\t" cmd)
> >>   (system cmd)
> >> )
> >>
> >>
> >> ;;  file:  app/test_1.rkt
> >> (require "lib/t/testing_utils.rkt")
> >> (load-initial-data "lib/db/initial_test_data.sql")
> >>
> >>
> >> ;;  file:  app/lib/db/test_2.rkt
> >> (require "../t/testing_utils.rkt")
> >> (load-initial-data "./initial_test_data.sql")
> >>
> >>
> >> $ ./test_1.rkt
> >> shelling out in order to load initial data into DB. Command is:
> >> psql -d biomantica < ./lib/db/initial_test_data.sql
> >> INSERT 0 0
> >> ...lots of other SQL results...
> >>
> >> $  ./lib/db/test_2.rkt
> >> shelling out in order to load initial data into DB. Command is:
> >> psql -d biomantica < ././initial_test_data.sql
> >> /bin/sh: ././initial_test_data.sql: No such file or directory
> >> #f
> >>
> >>
> >> Note that both test_N.rkt files worked when I used the prior version.
> >>
> >> On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler
> >>  wrote:
> >>> define-runtime-path is designed for this problem, IIUC. Let me know if
> >>> the docs don't help.
> >>>
> >>> Robby
> >>>
> >>> On Thu, Jan 19, 2017 at 11:47 AM, David Storrs 
> wrote:
>  Short form:  When using Dr Racket, how do I write something that says
>  "Here is a path to a file that I care about.  The path is relative to
>  you, the script that is running the code" ?
> 
>  Long form:
> 
>  I have a file, testing_utils.rkt, that includes the following snippet
> of code:
> 
>  (define (load-initial-data where)
>    (define cmd (string-append "psql -d biomantica < "
>   (path->string
>    (path-only
> (path->complete-path
>  (find-system-path 'run-file
>   where))
>    (say "shelling out in order to load initial data into DB. Command
>  is: \n\t" cmd)
> 
>    (void
> (with-output-to-string  ;; silence the output
>   (thunk
>    (system cmd)
> 
> 
>  The way this gets used is that one of our test scripts (e.g.
>  'endpoints.t') will (require "path/to/testing_utils.rkt") and then
>  call the load-initial-data function as follows:
> 
>  (load-initial-data "../initial_test_data.sql")
> 
>  I operate in Emacs via the shell, while my cofounder James uses Dr
>  Racket.  The above sequence works for me but not for him.  When I run
>  endpoints.t it locates the endpoints.t file, generates the path from
>  there to the initial_test_data.sql file, and shells out to run that
>  SQL through psql in order to load the database for testing.  When
>  James tries it it fails.
> 
>  The failure seems to be that for me "the running script" is the
>  endpoints.t file, while for him it's the Dr Racket executable.  I'm
>  not 

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Robby Findler
In DrRacet, current-directory in initialized to the directory
containing the file where you hit "Run" and in the shell it is
initialized to the current directory as understood by the shell.

Is that what you're asking?

Robby


On Thu, Jan 19, 2017 at 4:36 PM, David Storrs  wrote:
> For the record, I know I can pass an absolute path (defined with
> define-runtime-path) to load-initial-data.  My question is more about
> "why is this different between the shell and Dr Racket?"
>
> On Thu, Jan 19, 2017 at 5:23 PM, David Storrs  wrote:
>> define-runtime-path is based on the enclosing file, not the running file.
>>
>>
>>
>> ;; file:  app/lib/db/initial_test_data.sql
>> ...various SQL commands...
>>
>>
>> ;; file:  app/lib/t/testing_utils.rkt
>> (define-runtime-path thisdir ".")
>> (define cmd (string-append "psql -d biomantica < "
>>  (path->string (build-path thisdir where
>>   (say "shelling out in order to load initial data into DB. Command
>> is: \n\t" cmd)
>>   (system cmd)
>> )
>>
>>
>> ;;  file:  app/test_1.rkt
>> (require "lib/t/testing_utils.rkt")
>> (load-initial-data "lib/db/initial_test_data.sql")
>>
>>
>> ;;  file:  app/lib/db/test_2.rkt
>> (require "../t/testing_utils.rkt")
>> (load-initial-data "./initial_test_data.sql")
>>
>>
>> $ ./test_1.rkt
>> shelling out in order to load initial data into DB. Command is:
>> psql -d biomantica < ./lib/db/initial_test_data.sql
>> INSERT 0 0
>> ...lots of other SQL results...
>>
>> $  ./lib/db/test_2.rkt
>> shelling out in order to load initial data into DB. Command is:
>> psql -d biomantica < ././initial_test_data.sql
>> /bin/sh: ././initial_test_data.sql: No such file or directory
>> #f
>>
>>
>> Note that both test_N.rkt files worked when I used the prior version.
>>
>> On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler
>>  wrote:
>>> define-runtime-path is designed for this problem, IIUC. Let me know if
>>> the docs don't help.
>>>
>>> Robby
>>>
>>> On Thu, Jan 19, 2017 at 11:47 AM, David Storrs  
>>> wrote:
 Short form:  When using Dr Racket, how do I write something that says
 "Here is a path to a file that I care about.  The path is relative to
 you, the script that is running the code" ?

 Long form:

 I have a file, testing_utils.rkt, that includes the following snippet of 
 code:

 (define (load-initial-data where)
   (define cmd (string-append "psql -d biomantica < "
  (path->string
   (path-only
(path->complete-path
 (find-system-path 'run-file
  where))
   (say "shelling out in order to load initial data into DB. Command
 is: \n\t" cmd)

   (void
(with-output-to-string  ;; silence the output
  (thunk
   (system cmd)


 The way this gets used is that one of our test scripts (e.g.
 'endpoints.t') will (require "path/to/testing_utils.rkt") and then
 call the load-initial-data function as follows:

 (load-initial-data "../initial_test_data.sql")

 I operate in Emacs via the shell, while my cofounder James uses Dr
 Racket.  The above sequence works for me but not for him.  When I run
 endpoints.t it locates the endpoints.t file, generates the path from
 there to the initial_test_data.sql file, and shells out to run that
 SQL through psql in order to load the database for testing.  When
 James tries it it fails.

 The failure seems to be that for me "the running script" is the
 endpoints.t file, while for him it's the Dr Racket executable.  I'm
 not sure where to even begin sorting this out, so I was hoping for
 some help.

 Any thoughts?

 Dave


 PS:  James had to step out for something else or he would be sending
 this himself.

 --
 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] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Philip McGrath
Not the question you asked, but instead of with-output-to-string, if you're
discarding the output, you might prefer:

(parameterize ([current-output-port (open-output-nowhere)])
  ...)


-Philip

On Thu, Jan 19, 2017 at 4:51 PM, Philip McGrath 
wrote:

> I haven't looked in detail, but two quick thoughts:
>
>- When I evaluate (find-system-path 'run-file) in Dr. Racket, either
>inside a module or in the REPL, I get #v6.7/DrRacket.app/Contents/MacOS/DrRacket>
>- Have you looked at (current-directory)? In Dr. Racket, if the file
>has been saved, that returns the path to the directory of the file being
>run, which might give you what you need. (Of course, if you manipulate
>current-directory, or run the program from the shell when your working
>directory is not the directory of the file being run, you will get
>different results.)
>- Greg Hendershott's "__FILE__ and __LINE__ in Racket" might be
>relevant, though I don't think it does exactly what you want (
>http://www.greghendershott.com/2014/06/-file-and-line-in-racket.html
>)
>
>
> -Philip
>
> On Thu, Jan 19, 2017 at 4:36 PM, David Storrs 
> wrote:
>
>> For the record, I know I can pass an absolute path (defined with
>> define-runtime-path) to load-initial-data.  My question is more about
>> "why is this different between the shell and Dr Racket?"
>>
>> On Thu, Jan 19, 2017 at 5:23 PM, David Storrs 
>> wrote:
>> > define-runtime-path is based on the enclosing file, not the running
>> file.
>> >
>> >
>> >
>> > ;; file:  app/lib/db/initial_test_data.sql
>> > ...various SQL commands...
>> >
>> >
>> > ;; file:  app/lib/t/testing_utils.rkt
>> > (define-runtime-path thisdir ".")
>> > (define cmd (string-append "psql -d biomantica < "
>> >  (path->string (build-path thisdir where
>> >   (say "shelling out in order to load initial data into DB. Command
>> > is: \n\t" cmd)
>> >   (system cmd)
>> > )
>> >
>> >
>> > ;;  file:  app/test_1.rkt
>> > (require "lib/t/testing_utils.rkt")
>> > (load-initial-data "lib/db/initial_test_data.sql")
>> >
>> >
>> > ;;  file:  app/lib/db/test_2.rkt
>> > (require "../t/testing_utils.rkt")
>> > (load-initial-data "./initial_test_data.sql")
>> >
>> >
>> > $ ./test_1.rkt
>> > shelling out in order to load initial data into DB. Command is:
>> > psql -d biomantica < ./lib/db/initial_test_data.sql
>> > INSERT 0 0
>> > ...lots of other SQL results...
>> >
>> > $  ./lib/db/test_2.rkt
>> > shelling out in order to load initial data into DB. Command is:
>> > psql -d biomantica < ././initial_test_data.sql
>> > /bin/sh: ././initial_test_data.sql: No such file or directory
>> > #f
>> >
>> >
>> > Note that both test_N.rkt files worked when I used the prior version.
>> >
>> > On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler
>> >  wrote:
>> >> define-runtime-path is designed for this problem, IIUC. Let me know if
>> >> the docs don't help.
>> >>
>> >> Robby
>> >>
>> >> On Thu, Jan 19, 2017 at 11:47 AM, David Storrs 
>> wrote:
>> >>> Short form:  When using Dr Racket, how do I write something that says
>> >>> "Here is a path to a file that I care about.  The path is relative to
>> >>> you, the script that is running the code" ?
>> >>>
>> >>> Long form:
>> >>>
>> >>> I have a file, testing_utils.rkt, that includes the following snippet
>> of code:
>> >>>
>> >>> (define (load-initial-data where)
>> >>>   (define cmd (string-append "psql -d biomantica < "
>> >>>  (path->string
>> >>>   (path-only
>> >>>(path->complete-path
>> >>> (find-system-path 'run-file
>> >>>  where))
>> >>>   (say "shelling out in order to load initial data into DB. Command
>> >>> is: \n\t" cmd)
>> >>>
>> >>>   (void
>> >>>(with-output-to-string  ;; silence the output
>> >>>  (thunk
>> >>>   (system cmd)
>> >>>
>> >>>
>> >>> The way this gets used is that one of our test scripts (e.g.
>> >>> 'endpoints.t') will (require "path/to/testing_utils.rkt") and then
>> >>> call the load-initial-data function as follows:
>> >>>
>> >>> (load-initial-data "../initial_test_data.sql")
>> >>>
>> >>> I operate in Emacs via the shell, while my cofounder James uses Dr
>> >>> Racket.  The above sequence works for me but not for him.  When I run
>> >>> endpoints.t it locates the endpoints.t file, generates the path from
>> >>> there to the initial_test_data.sql file, and shells out to run that
>> >>> SQL through psql in order to load the database for testing.  When
>> >>> James tries it it fails.
>> >>>
>> >>> The failure seems to be that for me "the running script" is the
>> >>> endpoints.t file, while for him it's the Dr Racket executable.  I'm
>> 

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Philip McGrath
I haven't looked in detail, but two quick thoughts:

   - When I evaluate (find-system-path 'run-file) in Dr. Racket, either
   inside a module or in the REPL, I get #
   - Have you looked at (current-directory)? In Dr. Racket, if the file has
   been saved, that returns the path to the directory of the file being run,
   which might give you what you need. (Of course, if you manipulate
   current-directory, or run the program from the shell when your working
   directory is not the directory of the file being run, you will get
   different results.)
   - Greg Hendershott's "__FILE__ and __LINE__ in Racket" might be
   relevant, though I don't think it does exactly what you want (
   http://www.greghendershott.com/2014/06/-file-and-line-in-racket.html)


-Philip

On Thu, Jan 19, 2017 at 4:36 PM, David Storrs 
wrote:

> For the record, I know I can pass an absolute path (defined with
> define-runtime-path) to load-initial-data.  My question is more about
> "why is this different between the shell and Dr Racket?"
>
> On Thu, Jan 19, 2017 at 5:23 PM, David Storrs 
> wrote:
> > define-runtime-path is based on the enclosing file, not the running file.
> >
> >
> >
> > ;; file:  app/lib/db/initial_test_data.sql
> > ...various SQL commands...
> >
> >
> > ;; file:  app/lib/t/testing_utils.rkt
> > (define-runtime-path thisdir ".")
> > (define cmd (string-append "psql -d biomantica < "
> >  (path->string (build-path thisdir where
> >   (say "shelling out in order to load initial data into DB. Command
> > is: \n\t" cmd)
> >   (system cmd)
> > )
> >
> >
> > ;;  file:  app/test_1.rkt
> > (require "lib/t/testing_utils.rkt")
> > (load-initial-data "lib/db/initial_test_data.sql")
> >
> >
> > ;;  file:  app/lib/db/test_2.rkt
> > (require "../t/testing_utils.rkt")
> > (load-initial-data "./initial_test_data.sql")
> >
> >
> > $ ./test_1.rkt
> > shelling out in order to load initial data into DB. Command is:
> > psql -d biomantica < ./lib/db/initial_test_data.sql
> > INSERT 0 0
> > ...lots of other SQL results...
> >
> > $  ./lib/db/test_2.rkt
> > shelling out in order to load initial data into DB. Command is:
> > psql -d biomantica < ././initial_test_data.sql
> > /bin/sh: ././initial_test_data.sql: No such file or directory
> > #f
> >
> >
> > Note that both test_N.rkt files worked when I used the prior version.
> >
> > On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler
> >  wrote:
> >> define-runtime-path is designed for this problem, IIUC. Let me know if
> >> the docs don't help.
> >>
> >> Robby
> >>
> >> On Thu, Jan 19, 2017 at 11:47 AM, David Storrs 
> wrote:
> >>> Short form:  When using Dr Racket, how do I write something that says
> >>> "Here is a path to a file that I care about.  The path is relative to
> >>> you, the script that is running the code" ?
> >>>
> >>> Long form:
> >>>
> >>> I have a file, testing_utils.rkt, that includes the following snippet
> of code:
> >>>
> >>> (define (load-initial-data where)
> >>>   (define cmd (string-append "psql -d biomantica < "
> >>>  (path->string
> >>>   (path-only
> >>>(path->complete-path
> >>> (find-system-path 'run-file
> >>>  where))
> >>>   (say "shelling out in order to load initial data into DB. Command
> >>> is: \n\t" cmd)
> >>>
> >>>   (void
> >>>(with-output-to-string  ;; silence the output
> >>>  (thunk
> >>>   (system cmd)
> >>>
> >>>
> >>> The way this gets used is that one of our test scripts (e.g.
> >>> 'endpoints.t') will (require "path/to/testing_utils.rkt") and then
> >>> call the load-initial-data function as follows:
> >>>
> >>> (load-initial-data "../initial_test_data.sql")
> >>>
> >>> I operate in Emacs via the shell, while my cofounder James uses Dr
> >>> Racket.  The above sequence works for me but not for him.  When I run
> >>> endpoints.t it locates the endpoints.t file, generates the path from
> >>> there to the initial_test_data.sql file, and shells out to run that
> >>> SQL through psql in order to load the database for testing.  When
> >>> James tries it it fails.
> >>>
> >>> The failure seems to be that for me "the running script" is the
> >>> endpoints.t file, while for him it's the Dr Racket executable.  I'm
> >>> not sure where to even begin sorting this out, so I was hoping for
> >>> some help.
> >>>
> >>> Any thoughts?
> >>>
> >>> Dave
> >>>
> >>>
> >>> PS:  James had to step out for something else or he would be sending
> >>> this himself.
> >>>
> >>> --
> >>> 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 

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
For the record, I know I can pass an absolute path (defined with
define-runtime-path) to load-initial-data.  My question is more about
"why is this different between the shell and Dr Racket?"

On Thu, Jan 19, 2017 at 5:23 PM, David Storrs  wrote:
> define-runtime-path is based on the enclosing file, not the running file.
>
>
>
> ;; file:  app/lib/db/initial_test_data.sql
> ...various SQL commands...
>
>
> ;; file:  app/lib/t/testing_utils.rkt
> (define-runtime-path thisdir ".")
> (define cmd (string-append "psql -d biomantica < "
>  (path->string (build-path thisdir where
>   (say "shelling out in order to load initial data into DB. Command
> is: \n\t" cmd)
>   (system cmd)
> )
>
>
> ;;  file:  app/test_1.rkt
> (require "lib/t/testing_utils.rkt")
> (load-initial-data "lib/db/initial_test_data.sql")
>
>
> ;;  file:  app/lib/db/test_2.rkt
> (require "../t/testing_utils.rkt")
> (load-initial-data "./initial_test_data.sql")
>
>
> $ ./test_1.rkt
> shelling out in order to load initial data into DB. Command is:
> psql -d biomantica < ./lib/db/initial_test_data.sql
> INSERT 0 0
> ...lots of other SQL results...
>
> $  ./lib/db/test_2.rkt
> shelling out in order to load initial data into DB. Command is:
> psql -d biomantica < ././initial_test_data.sql
> /bin/sh: ././initial_test_data.sql: No such file or directory
> #f
>
>
> Note that both test_N.rkt files worked when I used the prior version.
>
> On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler
>  wrote:
>> define-runtime-path is designed for this problem, IIUC. Let me know if
>> the docs don't help.
>>
>> Robby
>>
>> On Thu, Jan 19, 2017 at 11:47 AM, David Storrs  
>> wrote:
>>> Short form:  When using Dr Racket, how do I write something that says
>>> "Here is a path to a file that I care about.  The path is relative to
>>> you, the script that is running the code" ?
>>>
>>> Long form:
>>>
>>> I have a file, testing_utils.rkt, that includes the following snippet of 
>>> code:
>>>
>>> (define (load-initial-data where)
>>>   (define cmd (string-append "psql -d biomantica < "
>>>  (path->string
>>>   (path-only
>>>(path->complete-path
>>> (find-system-path 'run-file
>>>  where))
>>>   (say "shelling out in order to load initial data into DB. Command
>>> is: \n\t" cmd)
>>>
>>>   (void
>>>(with-output-to-string  ;; silence the output
>>>  (thunk
>>>   (system cmd)
>>>
>>>
>>> The way this gets used is that one of our test scripts (e.g.
>>> 'endpoints.t') will (require "path/to/testing_utils.rkt") and then
>>> call the load-initial-data function as follows:
>>>
>>> (load-initial-data "../initial_test_data.sql")
>>>
>>> I operate in Emacs via the shell, while my cofounder James uses Dr
>>> Racket.  The above sequence works for me but not for him.  When I run
>>> endpoints.t it locates the endpoints.t file, generates the path from
>>> there to the initial_test_data.sql file, and shells out to run that
>>> SQL through psql in order to load the database for testing.  When
>>> James tries it it fails.
>>>
>>> The failure seems to be that for me "the running script" is the
>>> endpoints.t file, while for him it's the Dr Racket executable.  I'm
>>> not sure where to even begin sorting this out, so I was hoping for
>>> some help.
>>>
>>> Any thoughts?
>>>
>>> Dave
>>>
>>>
>>> PS:  James had to step out for something else or he would be sending
>>> this himself.
>>>
>>> --
>>> 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] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
define-runtime-path is based on the enclosing file, not the running file.



;; file:  app/lib/db/initial_test_data.sql
...various SQL commands...


;; file:  app/lib/t/testing_utils.rkt
(define-runtime-path thisdir ".")
(define cmd (string-append "psql -d biomantica < "
 (path->string (build-path thisdir where
  (say "shelling out in order to load initial data into DB. Command
is: \n\t" cmd)
  (system cmd)
)


;;  file:  app/test_1.rkt
(require "lib/t/testing_utils.rkt")
(load-initial-data "lib/db/initial_test_data.sql")


;;  file:  app/lib/db/test_2.rkt
(require "../t/testing_utils.rkt")
(load-initial-data "./initial_test_data.sql")


$ ./test_1.rkt
shelling out in order to load initial data into DB. Command is:
psql -d biomantica < ./lib/db/initial_test_data.sql
INSERT 0 0
...lots of other SQL results...

$  ./lib/db/test_2.rkt
shelling out in order to load initial data into DB. Command is:
psql -d biomantica < ././initial_test_data.sql
/bin/sh: ././initial_test_data.sql: No such file or directory
#f


Note that both test_N.rkt files worked when I used the prior version.

On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler
 wrote:
> define-runtime-path is designed for this problem, IIUC. Let me know if
> the docs don't help.
>
> Robby
>
> On Thu, Jan 19, 2017 at 11:47 AM, David Storrs  wrote:
>> Short form:  When using Dr Racket, how do I write something that says
>> "Here is a path to a file that I care about.  The path is relative to
>> you, the script that is running the code" ?
>>
>> Long form:
>>
>> I have a file, testing_utils.rkt, that includes the following snippet of 
>> code:
>>
>> (define (load-initial-data where)
>>   (define cmd (string-append "psql -d biomantica < "
>>  (path->string
>>   (path-only
>>(path->complete-path
>> (find-system-path 'run-file
>>  where))
>>   (say "shelling out in order to load initial data into DB. Command
>> is: \n\t" cmd)
>>
>>   (void
>>(with-output-to-string  ;; silence the output
>>  (thunk
>>   (system cmd)
>>
>>
>> The way this gets used is that one of our test scripts (e.g.
>> 'endpoints.t') will (require "path/to/testing_utils.rkt") and then
>> call the load-initial-data function as follows:
>>
>> (load-initial-data "../initial_test_data.sql")
>>
>> I operate in Emacs via the shell, while my cofounder James uses Dr
>> Racket.  The above sequence works for me but not for him.  When I run
>> endpoints.t it locates the endpoints.t file, generates the path from
>> there to the initial_test_data.sql file, and shells out to run that
>> SQL through psql in order to load the database for testing.  When
>> James tries it it fails.
>>
>> The failure seems to be that for me "the running script" is the
>> endpoints.t file, while for him it's the Dr Racket executable.  I'm
>> not sure where to even begin sorting this out, so I was hoping for
>> some help.
>>
>> Any thoughts?
>>
>> Dave
>>
>>
>> PS:  James had to step out for something else or he would be sending
>> this himself.
>>
>> --
>> 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] How to watch the filesystem

2017-01-19 Thread Philip McGrath
Because you mentioned "the user moved the mouse", note that mouse-event%
and other things referred to as "events" in the GUI library are not
synchronizable events that can be used with sync.

-Philip

On Thu, Jan 19, 2017 at 2:58 PM, Neil Van Dyke  wrote:

> David Storrs wrote on 01/19/2017 03:08 PM:
>
>> of events but I still know nothing about detecting filesystem change
>> events.  I've looked through PLaneT and found nothing that seems like
>> an FS-monitoring package.  Can anyone suggest how to do this?
>>
>
> Here's a simple example, using `sync`:
>
> #lang racket
> (define my-fs-change-evt (filesystem-change-evt "/home/user"))
> (printf "sync...~n")
> (sync my-fs-change-evt)
> (printf "synced!~n")
>
> I ran this example on GNU/Linux, and then used the command `touch
> /home/user/x`, which caused the `sync` procedure to return.
>
> See the documentation in the vicinity of that for `sync`, for other other
> ways to use synchronizable objects.  They're essential for some kinds of
> I/O programming, not just GUI.
>
> Don't be scared away by the events (and ports documentation.  I've done a
> bunch of low-level programming in C, of I/O and such, and I still find some
> of the Racket documentation for related concepts to be intimidating.
> (Well, there is one big thing in there that's scared me off the few times
> I've wanted to use it, but each time, I was on the clock for a consulting
> client, so I did things in the known-quantity way instead.  Much of the
> primitives are simple, however, and the work is in building correct and
> efficient programs around the primitives.)
>
> BTW, You don't want "PLaneT", which was the old (and wise) package
> system.  Almost all current development has moved from PLaneT to "
> pkgs.racket-lang.org".
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> 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 to watch the filesystem

2017-01-19 Thread Neil Van Dyke

David Storrs wrote on 01/19/2017 03:08 PM:

of events but I still know nothing about detecting filesystem change
events.  I've looked through PLaneT and found nothing that seems like
an FS-monitoring package.  Can anyone suggest how to do this?


Here's a simple example, using `sync`:

#lang racket
(define my-fs-change-evt (filesystem-change-evt "/home/user"))
(printf "sync...~n")
(sync my-fs-change-evt)
(printf "synced!~n")

I ran this example on GNU/Linux, and then used the command `touch 
/home/user/x`, which caused the `sync` procedure to return.


See the documentation in the vicinity of that for `sync`, for other 
other ways to use synchronizable objects.  They're essential for some 
kinds of I/O programming, not just GUI.


Don't be scared away by the events (and ports documentation.  I've done 
a bunch of low-level programming in C, of I/O and such, and I still find 
some of the Racket documentation for related concepts to be 
intimidating.  (Well, there is one big thing in there that's scared me 
off the few times I've wanted to use it, but each time, I was on the 
clock for a consulting client, so I did things in the known-quantity way 
instead.  Much of the primitives are simple, however, and the work is in 
building correct and efficient programs around the primitives.)


BTW, You don't want "PLaneT", which was the old (and wise) package 
system.  Almost all current development has moved from PLaneT to 
"pkgs.racket-lang.org".


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


Re: [racket-users] Typed Racket & Higher Kinded Types

2017-01-19 Thread Vincent St-Amour
On Thu, 19 Jan 2017 10:42:17 -0600,
Robert Kuzelj wrote:
> 
> As far as I understand Haskell was breaking compatibility now then to
> add new languae features. This enabled the fast iteration (albeit a
> painful one).
> On the other hand F# is the exact opposite - not only looking to
> remain compatible to itself but also to the rest of the .NET eco
> system (and C#). All of that makes the progress of the language pretty
> slow (from my POV) and creates lots of warts that are not necessary if
> you are not into C#.

Unlike these, Racket has #lang, so you can have your cake and eat it too. :)

Vincent

-- 
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] How to watch the filesystem

2017-01-19 Thread David Storrs
I need to write something that will notice when a change happens in a
directory (file added, delete, modified, etc) and let me take action
based on that.  I was excited when I saw Racket's "Detecting
Filesystem Changes"
(https://docs.racket-lang.org/reference/Filesystem.html#%28part._filesystem-change%29)
section, but having read through it I am (a) confused and (b) not
sanguine about this being what I need.

I also saw this: http://benaiah.me/posts/watching-filesystem-racket/
but I'm hoping there's a way that does not involve installing extra
software on the customer's machine.

After reading through the DFC docs multiple times, this is what I
think it says; could someone please confirm this for me?


"Synchronizable event" is another name for "event".  The word
"synchronizable" is redundant.

An event is an object.

Some events are purpose built objects that exist only to be events
while some events are things that have other uses.  Example: a port is
always an event but it has functionality beyond its event-ness.

The purpose of events is to let threads work together without stepping
on each other.  In essence, an event is a message that one thread
sends to another.

Events are not used for inter-process communication, only inter-thread
communication.

An event is ultimately a notification about something -- the
filesystem changed, the user moved the mouse, etc.  When a thread
receives an event and acts upon it that is called "synchronizing" the
event.

Synchronizing an event always yields a result, logically enough called
the 'synchronization result'.  This result is often the event itself
but does not have to be.

Events are mutable.  Synchronizing may affect their state.

Events are typically generated either manually (e.g. ,
which produces an event object for later use) or semi-manually (e.g.
calling thread-send which sends the specified value as an event).



Hopefully all of the above is correct.  If so, I have an understanding
of events but I still know nothing about detecting filesystem change
events.  I've looked through PLaneT and found nothing that seems like
an FS-monitoring package.  Can anyone suggest how to do this?

-- 
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] Serializing macro transformer procedures

2017-01-19 Thread Philip McGrath
It might help if you could explain in more detail what you're trying to do:
I'm not sure I understand what you mean by "bring macro transformer
procedures down to run-time".

-Philip

On Wed, Jan 18, 2017 at 6:24 PM, Alex Knauth  wrote:

> I'm trying to use serial-lambda in macro transformer procedures so that I
> can serialize them and bring them down to run-time. However, serial-lambda
> isn't working within a define-syntax. It says:
>
> syntax-local-lift-provide: not expanding in a module run-time body
>
> This seems to be a lie; it works fine in a begin-for-syntax (as long as
> you don't try to deserialize). What's the real reason it doesn't work in a
> define-syntax? Is there another way to bring macro transformer procedures
> down to run-time?
>
> Alex Knauth
>
> --
> 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] ProWeb 2017: 1st International Workshop on Programming Technology for the Future Web

2017-01-19 Thread timmolderez
ProWeb 2017: 1st International Workshop on Programming Technology for the 
Future Web
http://2017.programming-conference.org/track/proweb-2017-papers
Co-located with the  conference 
April 4, Brussels, Belgium


Full-fledged web applications have become ubiquitous on desktop and mobile 
devices alike. Whereas “responsive” web applications already offered a more 
desktop-like experience, there is an increasing demand for “rich” web 
applications (RIAs) that offer collaborative and even off-line functionality 
—Google docs being the prototypical example. Long gone are the days that web 
servers merely had to answer incoming HTTP request with a block of static HTML. 
Today’s servers react to a continuous stream of events coming from JavaScript 
applications that have been pushed to clients. As a result, application logic 
and data is increasingly distributed. Traditional dichotomies such as “client 
vs. server” and “offline vs. online” are fading.

** Call for Papers **

The 1st International Workshop on Programming Technology for the Future Web, or 
ProWeb17, is a forum for researchers and practitioners to share and discuss new 
technology for programming these and future evolutions of the web. We welcome 
submissions introducing programming technology (i.e., frameworks, libraries, 
programming languages, program analyses and development tools) for implementing 
web applications and for maintaining their quality over time, as well as 
experience reports about the use of state-of-the-art programming technology. 

Relevant topics include, but are not limited to:
* Quality on the new web: 
static and dynamic program analyses; code, design test and process metrics; 
development and migration tools; automated testing and test generation; 
contract systems, type systems, and web service API conformance checking; ...
* Hosting languages on the web: 
new runtimes; transpilation or compilation to JavaScript, WebAssembly, asm.js, 
...
* Designing languages for the web: 
multi-tier (or tierless) programming; reactive programming; frameworks for 
multi-tier or reactive programming on the web; ...
* Distributed data sharing, replication and consistency: 
cloud types, CRDTs, eventual consistency, offline storage, peer-to-peer 
communication, ...
* Security on the web: 
client-side and server-side security policies; policy enforcement; proxies and 
membranes; vulnerability detection; dynamic patching, ...
* Surveys and case studies using state-of-the-art web technology 
* Ideas on and experience reports about: 
how to reconcile the need for quality with the need for agility on the web; how 
to master and combine the myriad of tier-specific technologies required to 
develop a web application, ..
* Position statements on what the future of the web should look like

We solicit three kinds of submissions via EasyChair:
https://easychair.org/conferences/?conf=proweb2017

- 6-page **technical papers** and **experience reports** that, when accepted, 
will be published in the workshop post-proceedings as part of of the ACM’s 
Digital Library.
- 3-page **position statements** that, when accepted, will be published in the 
workshop post-proceedings as part of of the ACM’s Digital Library.
- 1-page **presentation abstracts** that, when accepted, will be made available 
on the website.

Submissions must follow the ACM Master Article Template 
(http://www.acm.org/publications/proceedings-template, sigconf option, 9 point 
font, Times New Roman font family, numeric citation style). Each submission 
will be reviewed by at least three members of the program committee. We welcome 
submissions that identify new problems, or report on promising ideas in early 
stages of research. Submissions of the third kind are ideal to further 
disseminate existing ideas within the community, to demonstrate existing tools, 
or simply to instigate a discussion. 

More information: 
http://2017.programming-conference.org/track/proweb-2017-papers

** Important dates (AoE) **

- Submission deadline: Wed 15 Feb 2017
- Author notification: Wed 1 Mar 2017
- Camera-ready version: Wed 15 Mar 2017

** Organizers ** 

- Coen De Roover, Vrije Universiteit Brussel, Belgium
- Anders Møller, Aarhus University, Denmark
- Christophe Scholliers, Universiteit Gent, Belgium

** Program Committee **

- Vincent Balat, Université Paris Diderot, France
- Nataliia Bielova, Inria, France
- Avid Chaudhuri, Facebook, United States of America
- Tobias Distiler, Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany
- Jan Martin Jansen, Netherlands Defence Academy, The Netherlands
- Frank Piessens, iMinds, Belgium
- Rinus Plasmeijer, Radboud University Nijmegen, The Netherlands
- Michael Pradel, TU Darmstadt, Germany
- Andreas Rossberg, Google, Germany
- Sukyoung Ryu, KAIST, South Korea
- Manuel Serrano, Inria, France
- Mario Südholt, Inria, France
- Tom Van Cutsem, Nokia Bell Labs, Belgium
- Eelco Visser, Delft University of Technology, The Netherlands

-- 

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread Robby Findler
define-runtime-path is designed for this problem, IIUC. Let me know if
the docs don't help.

Robby

On Thu, Jan 19, 2017 at 11:47 AM, David Storrs  wrote:
> Short form:  When using Dr Racket, how do I write something that says
> "Here is a path to a file that I care about.  The path is relative to
> you, the script that is running the code" ?
>
> Long form:
>
> I have a file, testing_utils.rkt, that includes the following snippet of code:
>
> (define (load-initial-data where)
>   (define cmd (string-append "psql -d biomantica < "
>  (path->string
>   (path-only
>(path->complete-path
> (find-system-path 'run-file
>  where))
>   (say "shelling out in order to load initial data into DB. Command
> is: \n\t" cmd)
>
>   (void
>(with-output-to-string  ;; silence the output
>  (thunk
>   (system cmd)
>
>
> The way this gets used is that one of our test scripts (e.g.
> 'endpoints.t') will (require "path/to/testing_utils.rkt") and then
> call the load-initial-data function as follows:
>
> (load-initial-data "../initial_test_data.sql")
>
> I operate in Emacs via the shell, while my cofounder James uses Dr
> Racket.  The above sequence works for me but not for him.  When I run
> endpoints.t it locates the endpoints.t file, generates the path from
> there to the initial_test_data.sql file, and shells out to run that
> SQL through psql in order to load the database for testing.  When
> James tries it it fails.
>
> The failure seems to be that for me "the running script" is the
> endpoints.t file, while for him it's the Dr Racket executable.  I'm
> not sure where to even begin sorting this out, so I was hoping for
> some help.
>
> Any thoughts?
>
> Dave
>
>
> PS:  James had to step out for something else or he would be sending
> this himself.
>
> --
> 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] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
Short form:  When using Dr Racket, how do I write something that says
"Here is a path to a file that I care about.  The path is relative to
you, the script that is running the code" ?

Long form:

I have a file, testing_utils.rkt, that includes the following snippet of code:

(define (load-initial-data where)
  (define cmd (string-append "psql -d biomantica < "
 (path->string
  (path-only
   (path->complete-path
(find-system-path 'run-file
 where))
  (say "shelling out in order to load initial data into DB. Command
is: \n\t" cmd)

  (void
   (with-output-to-string  ;; silence the output
 (thunk
  (system cmd)


The way this gets used is that one of our test scripts (e.g.
'endpoints.t') will (require "path/to/testing_utils.rkt") and then
call the load-initial-data function as follows:

(load-initial-data "../initial_test_data.sql")

I operate in Emacs via the shell, while my cofounder James uses Dr
Racket.  The above sequence works for me but not for him.  When I run
endpoints.t it locates the endpoints.t file, generates the path from
there to the initial_test_data.sql file, and shells out to run that
SQL through psql in order to load the database for testing.  When
James tries it it fails.

The failure seems to be that for me "the running script" is the
endpoints.t file, while for him it's the Dr Racket executable.  I'm
not sure where to even begin sorting this out, so I was hoping for
some help.

Any thoughts?

Dave


PS:  James had to step out for something else or he would be sending
this himself.

-- 
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] Typed Racket & Higher Kinded Types

2017-01-19 Thread Robert Kuzelj
Am Donnerstag, 19. Januar 2017 17:17:18 UTC+1 schrieb Matthias Felleisen:
> In case my CPSing obscured the prose, here is what I said: 
> 
> What I am really saying is that I supplemented the proposal with a research 
> challenge that is common in the Racket world. If you are here and you see the 
> blueprints for paradise over there, don’t just build paradise. Also build the 
> bridge from here to there. 

Just as a lurker into Racket for now - Is that really sensible? Always? I 
understand that the Racket culture might strongly lean into that but then ...

As far as I understand Haskell was breaking compatibility now then to add new 
languae features. This enabled the fast iteration (albeit a painful one).
On the other hand F# is the exact opposite - not only looking to remain 
compatible to itself but also to the rest of the .NET eco system (and C#). All 
of that makes the progress of the language pretty slow (from my POV) and 
creates lots of warts that are not necessary if you are not into C#.

-- 
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] Typed Racket & Higher Kinded Types

2017-01-19 Thread Matthias Felleisen

In case my CPSing obscured the prose, here is what I said: 

What I am really saying is that I supplemented the proposal with a research 
challenge that is common in the Racket world. If you are here and you see the 
blueprints for paradise over there, don’t just build paradise. Also build the 
bridge from here to there. 




> On Jan 19, 2017, at 10:57 AM, Matthias Felleisen  wrote:
> 
> 
> You’re preaching to the choir. See Racket Manifesto. 
> 
> But you’re also preaching to the guy who got this project to
> where it is because "Types Suck” has been my slogan for decades. 
> (I will leave it to figure out what that slogan means.) 
> 
> Since I am not a good programmer (according to your classification), 
> I need time to learn this new stuff and I don’t want to leave everything 
> behind that I have coded in my miserable days of untyped hacking. I have
> moved some to TR, and it interoperates nicely with R. So if you want me 
> to accept the supreme gift of AC’s TR2, you need to allow me to migrate
> in the same incremental manner — unless your goal is to leave all miserable 
> programmers, such as myself, behind. Nothing prevents you from that. Go
> create TR-leave-eveeryone-else-behind. 
> 
> Glad you like Stephen’s work. — Matthias
> 
> 
> 
> 
>> On Jan 19, 2017, at 9:30 AM, Anthony Carrico  wrote:
>> 
>> On 01/18/2017 08:57 PM, Matthias Felleisen wrote:
>>> 
>>> And how would components in #lang typed/racket interact with components in 
>>> #lang kinded/racket interact? 
>> 
>> If this wasn't Matthias, I'd say whoever posted this missed the whole
>> point of Racket. Since it is Matthias, I'll take this as an invitation
>> to rant.
>> 
>> At its core, what is racket? Racket is an operating system with Scheme
>> values, rather than C values, as its foreign function interface. So the
>> simple answer to the question is that Typed Racket 2 uses Scheme values
>> as its FFI, just like everyone else does. Does this suck? Yes, but for
>> many cases it is better than using C values.
>> Any other vision of the module system is an illusion, I realized this as
>> soon as I tried Fathertime after the Scheme Workshop 10-20 years ago.
>> 
>> What do contemporary programmers want? They want some kind of static
>> proof that their interfaces are good. Why are so many programmers
>> sniffing around Racket these past few months? Because they noticed
>> Turnstile, and they recognize that Racket is the state of the art in
>> metaprogramming. The window is currently open, something like Racket +
>> Haskell/Idris/Purescript/Agda will emerge. Programmers will bleed from
>> both camps.  Recognize this, or lose all good Racket programmers. Anyone
>> who uses typed Racket discovers Haskell, and start to hate Racket
>> because it doesn't have typeclasses. It feels like programming with your
>> arms chopped off. They don't want to give up Matthew's great work, so
>> they will bring it with them one way or another.
>> 
>> Typed Racket was a fine experiment. It accomplished two things. It
>> showed dynamic programmers that static types and other proofs should be
>> employed when possible, and contracts should be employed otherwise.
>> Typed Racket killed Scheme. This is speaking as one of the few
>> programmers in the world who has been paid to program in typed racket.
>> 
>> -- 
>> Anthony Carrico
>> 
>> -- 
>> 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] Typed Racket & Higher Kinded Types

2017-01-19 Thread Matthias Felleisen

You’re preaching to the choir. See Racket Manifesto. 

But you’re also preaching to the guy who got this project to
where it is because "Types Suck” has been my slogan for decades. 
(I will leave it to figure out what that slogan means.) 

Since I am not a good programmer (according to your classification), 
I need time to learn this new stuff and I don’t want to leave everything 
behind that I have coded in my miserable days of untyped hacking. I have
moved some to TR, and it interoperates nicely with R. So if you want me 
to accept the supreme gift of AC’s TR2, you need to allow me to migrate
in the same incremental manner — unless your goal is to leave all miserable 
programmers, such as myself, behind. Nothing prevents you from that. Go
create TR-leave-eveeryone-else-behind. 

Glad you like Stephen’s work. — Matthias




> On Jan 19, 2017, at 9:30 AM, Anthony Carrico  wrote:
> 
> On 01/18/2017 08:57 PM, Matthias Felleisen wrote:
>> 
>> And how would components in #lang typed/racket interact with components in 
>> #lang kinded/racket interact? 
> 
> If this wasn't Matthias, I'd say whoever posted this missed the whole
> point of Racket. Since it is Matthias, I'll take this as an invitation
> to rant.
> 
> At its core, what is racket? Racket is an operating system with Scheme
> values, rather than C values, as its foreign function interface. So the
> simple answer to the question is that Typed Racket 2 uses Scheme values
> as its FFI, just like everyone else does. Does this suck? Yes, but for
> many cases it is better than using C values.
> Any other vision of the module system is an illusion, I realized this as
> soon as I tried Fathertime after the Scheme Workshop 10-20 years ago.
> 
> What do contemporary programmers want? They want some kind of static
> proof that their interfaces are good. Why are so many programmers
> sniffing around Racket these past few months? Because they noticed
> Turnstile, and they recognize that Racket is the state of the art in
> metaprogramming. The window is currently open, something like Racket +
> Haskell/Idris/Purescript/Agda will emerge. Programmers will bleed from
> both camps.  Recognize this, or lose all good Racket programmers. Anyone
> who uses typed Racket discovers Haskell, and start to hate Racket
> because it doesn't have typeclasses. It feels like programming with your
> arms chopped off. They don't want to give up Matthew's great work, so
> they will bring it with them one way or another.
> 
> Typed Racket was a fine experiment. It accomplished two things. It
> showed dynamic programmers that static types and other proofs should be
> employed when possible, and contracts should be employed otherwise.
> Typed Racket killed Scheme. This is speaking as one of the few
> programmers in the world who has been paid to program in typed racket.
> 
> -- 
> Anthony Carrico
> 
> -- 
> 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] New web page

2017-01-19 Thread Eli Barzilay
0. Warnings/disclaimers: as usual.

Things that *really* bug me with the new page:

1. The boxes on top.  Pretty much what Alexis originally said
   (https://github.com/racket/racket-lang-org/pull/28#issuecomment-267796721)

2. More concretely, in not-so-large screens (laptop/phone), I don't know
   what I'm looking at.  On a typical ADD-style web glance, it looks
   like yet another "language framework" -- the typical yawn inducing JS
   things, not what Racket really is.  This is from "make languages".

   But it really doesn't look like a language: from "solve problems"
   (way too generic; applies just as well to smart washing machines),
   through the rest of the titles that are visible on the top.  Perhaps
   the only real clue that it's a language is "The best of Scheme and
   Lisp" -- and IMO/E that's not a great motivation...

3. Even on a large screen, the pictures seem to go out of their way
   trying to make me think that this is something related to graphics.

4. The whole business with the boxes becomes *MUCH* worse when viewed in
   a text browser.  You get all the boxes text, and much later the blurb
   that says what it actually is.  It pretty much looks like a kind of a
   quasi-random word cloud, all the way to the latter part that looks
   more organized.

5. "Who cares about text browsers?"  -- Consider that they can reveal
   other problems, for example, the (oddly placed) main blurb text is
   shown as a list item with one of them.

   More severely, one of the very good points about trying a text
   browser is that you get to see the page as a search engine sees it.
   I initially thought that this must be bogus advice these days...
   Turns out it's not: when I search for "Racket" here's what google
   tells me about it:

 > Racket is a mature LGPL project that's actively developed and
 > maintained. Racket repositories. Main repository. The PLT Group.

   IMO, this is a *MAJOR* failure of the new layout.

   5a. Google also makes a mess in the quick links that it infers for
   the site.

   5b. For fun, I tried the other search engine.  It's similarly
   confused -- here's what it says:

 > Racket’s crown jewel is its macro system, which lets you
 > freely extend the language. Intro to macros; Macros in depth;
 > Racket syntax model; Making new languages

   5c. Yet another reason for using a text browser is accessibility.  I
   tried the chromevox thing, and it just reads out what's on the
   page, top to bottom.  It doesn't read the text hidden in the top
   boxes so it's not as bad as a text browser, but it's stil far,
   far from good.

6. Gray text.  [IMO the universal default of black text on white
   background was a colossal mistake propagated by the misguided idea of
   making computer screens look like printed text -- and for years I
   thought that this was so bad that there's no way it could be worse.
   Then came the style of gray-ish texts and proved me wrong.]

   AFAICT, the only black text in the whole thing is the first "Racket"
   word.  Section titles on the bottom part look like they should be
   black too but the font is thin enough that there are very few pixels
   that are actual black.

   Yes, I've seen some justification about gray being a common
   de-emphasizing tool, but in that case I look at the text that I would
   read if I ignore de-emphasized text, and that says "Racket, Software,
   Documentation & tutorials, ...".

   ObYoutube: https://www.youtube.com/watch?v=Excu14T7IxQ

7. "the world’s first ecosystem for developing and deploying new
   languages" -- This reads to me as a huge exaggeration.  Wouldn't
   Lex/Yacc fit this description?  Actually, an OS (Unix, specifically)
   could make this claim too.  On the flip side, "enterprise people"
   probably read this as something that better fits what Visual Studio,
   or some JS thing like Esprima is doing.

   To put this differently -- IMO the thing that makes Racket unique is
   exactly the *opposite*: I don't have to "develop" a language, I can
   just dig around through my back back for a paper clip and some used
   gum and slap up a language, and then I most certainly *don't* need to
   "deploy" it!  -- IMO, that's kind of the main sentiment whenever
   Matthias talks about making languages so easy that you can make a
   language for a single use -- again, the opposite of common thinking
   where a "language" is something so heavy that it doesn't make sense
   to not deploy it in some way.

8. Finally, phone rendering makes the above problems even worse.  But in
   addition, it is still broken (for me, on a Nexus 6p using chrome):

 http://tmp.barzilay.org/x1.png
 http://tmp.barzilay.org/x2.png

   Both have overlapping texts, and the first one has a strange newline
   before "dream language".

-- 
   ((x=>x(x))(x=>x(x)))  Eli Barzilay:
   http://barzilay.org/  

Re: [racket-users] Typed Racket & Higher Kinded Types

2017-01-19 Thread Anthony Carrico
On 01/19/2017 09:30 AM, Anthony Carrico wrote:
> What do contemporary programmers want? They want some kind of static
> proof that their interfaces are good.


I didn't put the following in my rant, because why muddy a good rant?
But to elaborate, they also want productivity, and that means
state-of-the-art polymorphism, and that also comes along with a good
type system.

-- 
Anthony Carrico

-- 
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] Typed Racket & Higher Kinded Types

2017-01-19 Thread Anthony Carrico
On 01/19/2017 09:50 AM, Robert Kuzelj wrote:
> Wow! My question seems to be pretty  upstirring. ;-)
> But you are completely right - I am sniffing around Racket (Typed) bc strong 
> typing + meta programming look like a killer combo.
> 
> And btw. yeah something will emerge ... or rather has already emerged
> https://github.com/LuxLang/lux
> https://luxlang.gitbooks.io/the-lux-programming-language/content/

See also Alexis King's:
https://lexi-lambda.github.io/blog/2017/01/05/rascal-is-now-hackett-plus-some-answers-to-questions/

-- 
Anthony Carrico

-- 
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] Typed Racket & Higher Kinded Types

2017-01-19 Thread Robert Kuzelj
Wow! My question seems to be pretty  upstirring. ;-)
But you are completely right - I am sniffing around Racket (Typed) bc strong 
typing + meta programming look like a killer combo.

And btw. yeah something will emerge ... or rather has already emerged
https://github.com/LuxLang/lux
https://luxlang.gitbooks.io/the-lux-programming-language/content/

Nevertheless I think Racket having somehow the bigger organisation/resources 
could be leading here

Am Donnerstag, 19. Januar 2017 15:31:01 UTC+1 schrieb Anthony Carrico:
> On 01/18/2017 08:57 PM, Matthias Felleisen wrote:
> > 
> > And how would components in #lang typed/racket interact with components in 
> > #lang kinded/racket interact? 
> 
> If this wasn't Matthias, I'd say whoever posted this missed the whole
> point of Racket. Since it is Matthias, I'll take this as an invitation
> to rant.
> 
> At its core, what is racket? Racket is an operating system with Scheme
> values, rather than C values, as its foreign function interface. So the
> simple answer to the question is that Typed Racket 2 uses Scheme values
> as its FFI, just like everyone else does. Does this suck? Yes, but for
> many cases it is better than using C values.
> Any other vision of the module system is an illusion, I realized this as
> soon as I tried Fathertime after the Scheme Workshop 10-20 years ago.
> 
> What do contemporary programmers want? They want some kind of static
> proof that their interfaces are good. Why are so many programmers
> sniffing around Racket these past few months? Because they noticed
> Turnstile, and they recognize that Racket is the state of the art in
> metaprogramming. The window is currently open, something like Racket +
> Haskell/Idris/Purescript/Agda will emerge. Programmers will bleed from
> both camps.  Recognize this, or lose all good Racket programmers. Anyone
> who uses typed Racket discovers Haskell, and start to hate Racket
> because it doesn't have typeclasses. It feels like programming with your
> arms chopped off. They don't want to give up Matthew's great work, so
> they will bring it with them one way or another.
> 
> Typed Racket was a fine experiment. It accomplished two things. It
> showed dynamic programmers that static types and other proofs should be
> employed when possible, and contracts should be employed otherwise.
> Typed Racket killed Scheme. This is speaking as one of the few
> programmers in the world who has been paid to program in typed racket.
> 
> -- 
> Anthony Carrico

-- 
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] Typed Racket & Higher Kinded Types

2017-01-19 Thread Anthony Carrico
On 01/18/2017 08:57 PM, Matthias Felleisen wrote:
> 
> And how would components in #lang typed/racket interact with components in 
> #lang kinded/racket interact? 

If this wasn't Matthias, I'd say whoever posted this missed the whole
point of Racket. Since it is Matthias, I'll take this as an invitation
to rant.

At its core, what is racket? Racket is an operating system with Scheme
values, rather than C values, as its foreign function interface. So the
simple answer to the question is that Typed Racket 2 uses Scheme values
as its FFI, just like everyone else does. Does this suck? Yes, but for
many cases it is better than using C values.
Any other vision of the module system is an illusion, I realized this as
soon as I tried Fathertime after the Scheme Workshop 10-20 years ago.

What do contemporary programmers want? They want some kind of static
proof that their interfaces are good. Why are so many programmers
sniffing around Racket these past few months? Because they noticed
Turnstile, and they recognize that Racket is the state of the art in
metaprogramming. The window is currently open, something like Racket +
Haskell/Idris/Purescript/Agda will emerge. Programmers will bleed from
both camps.  Recognize this, or lose all good Racket programmers. Anyone
who uses typed Racket discovers Haskell, and start to hate Racket
because it doesn't have typeclasses. It feels like programming with your
arms chopped off. They don't want to give up Matthew's great work, so
they will bring it with them one way or another.

Typed Racket was a fine experiment. It accomplished two things. It
showed dynamic programmers that static types and other proofs should be
employed when possible, and contracts should be employed otherwise.
Typed Racket killed Scheme. This is speaking as one of the few
programmers in the world who has been paid to program in typed racket.

-- 
Anthony Carrico

-- 
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] Typed Racket & Higher Kinded Types

2017-01-19 Thread Robert Kuzelj
> And how would components in #lang typed/racket interact with components in 
> #lang kinded/racket interact? 

maybe (if there is no other way) not at all and there would a breaking of 
compatibility?!

-- 
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] Call for Participation: BOB 2017 (February 24, Berlin) - early-bird ends Jan 23

2017-01-19 Thread Michael Sperber

BOB has a strong focus on functional programming.  Come and help our
Racket contingent grow!



   BOB 2017
  Conference

 "What happens if we simply use what's best?"
   February 24, 2017
Berlin
   http://bobkonf.de/2017/
   Program:
 http://bobkonf.de/2017/program.html
Registration:
   http://bobkonf.de/2017/registration.html



BOB is the conference for developers, architects and decision-makers
to explore technologies beyond the mainstream in software development,
and to find the best tools available to software developers today.
Our goal is for all participants of BOB to return home with new
insights that enable them to improve their own software development
experiences.

The program features 14 talks and 8 tutorials on current topics:

http://bobkonf.de/2017/program.html

The subject range of talks includes functional programming, advanced
front-end development, and sophisticated uses of types.

The tutorials feature introductions to Haskell, Swift, PureScript,
React, QuickCheck, Agda, CRDTs and Servant.

John Hughes will give the keynote talk.

Registration is open online:

http://bobkonf.de/2017/registration.html

NOTE: The early-bird rates expire on January 23, 2017!

BOB cooperates with the :clojured conference on the following day.
There is a registration discount available for participants of both events.

http://www.clojured.de/

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