Re: [racket-dev] [racket] getting symbol documentation URL quickly within Emacs

2011-06-28 Thread Matthias Felleisen

On Jun 28, 2011, at 3:00 AM, Eli Barzilay wrote:

 I feel lucky thing is not going to be a useful feature.
 It can work nicely in cases where bindings are relatively unique (for
 example, `get-impure-port'), but getting it to do the right thing for
 common names (like `cons') will be challenging, since you don't want
 someone who works in the r6rs language to keep being frustrated by
 getting the wrong docs.


I guess one of the language properties should be 

 (1) constrain the doc search process so that forms are only found in this 
language and in libraries 
 (2) things from libraries can be excluded from specific languages because we 
know they won't run 



_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] getting symbol documentation URL quickly within Emacs

2011-06-28 Thread Sam Tobin-Hochstadt
On Tue, Jun 28, 2011 at 9:58 AM, Matthias Felleisen
matth...@ccs.neu.edu wrote:

 On Jun 28, 2011, at 9:55 AM, Eli Barzilay wrote:

 (2) things from libraries can be excluded from specific languages
     because we know they won't run

 That won't work right too...  Should I list a whole bunch of modules
 for my language?  What happens when one of these modules becomes
 compatible when I or the module's author change something?


 So you're working in #lang racket as a naive Racket beginner, and you find 
 some r6rs library that uses set-car!. Hey what a great idea! That enables me 
 to do all the things I dutifully learned in a data structure course on linked 
 lists. So I require it and it fails ...

 Yes I think we should be able to specify the list of 'good' xor 'bad' 
 libraries, whichever is shorter.

This should work fine:

#lang racket
(require my-r6rs-lib)
(my-r6-fun (mlist 1 2 3))

I can't think of any non-trivial language with `require' where you can
divide libraries sensibly into good and bad.

-- 
sam th
sa...@ccs.neu.edu

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] getting symbol documentation URL quickly within Emacs

2011-06-28 Thread Eli Barzilay
Four minutes ago, Matthias Felleisen wrote:
 
 On Jun 28, 2011, at 9:55 AM, Eli Barzilay wrote:
 
  (2) things from libraries can be excluded from specific languages
  because we know they won't run
  
  That won't work right too...  Should I list a whole bunch of
  modules for my language?  What happens when one of these modules
  becomes compatible when I or the module's author change something?
 
 So you're working in #lang racket as a naive Racket beginner, and
 you find some r6rs library that uses set-car!. Hey what a great
 idea! That enables me to do all the things I dutifully learned in a
 data structure course on linked lists. So I require it and it fails
 ...

Regardless of this, you're missing the main problem.  If you're in
drracket (or in a racket repl), you won't get to `set-car!', unless
you explicitly search everything.  But the problem is when the neabies
just points their browsers to doc.racket-lang.org/search/ and look for
stuff -- then, in that case, no context is possible.

-- 
  ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
http://barzilay.org/   Maze is Life!
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] getting symbol documentation URL quickly within Emacs

2011-06-28 Thread Matthias Felleisen

On Jun 28, 2011, at 10:04 AM, Eli Barzilay wrote:

 Regardless of this, you're missing the main problem.  If you're in
 drracket (or in a racket repl), you won't get to `set-car!', unless
 you explicitly search everything.  But the problem is when the neabies
 just points their browsers to doc.racket-lang.org/search/ and look for
 stuff -- then, in that case, no context is possible.


Good argument. 

But when you create the docs from our code base you could 
show which languages don't collaborate with which libraries. 


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] getting symbol documentation URL quickly within Emacs

2011-06-28 Thread Eli Barzilay
10 minutes ago, Matthias Felleisen wrote:
 
 On Jun 28, 2011, at 10:04 AM, Eli Barzilay wrote:
 
  Regardless of this, you're missing the main problem.  If you're in
  drracket (or in a racket repl), you won't get to `set-car!', unless
  you explicitly search everything.  But the problem is when the neabies
  just points their browsers to doc.racket-lang.org/search/ and look for
  stuff -- then, in that case, no context is possible.
 
 
 Good argument. 
 
 But when you create the docs from our code base you could 
 show which languages don't collaborate with which libraries. 

Yeah, that's doable -- as well as some search operator for which
language you want to use as your context.  There's something very
similar there now -- and I think that in practice nobody uses it.

-- 
  ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
http://barzilay.org/   Maze is Life!
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] getting symbol documentation URL quickly within Emacs

2011-06-28 Thread Matthias Felleisen

On Jun 28, 2011, at 11:23 AM, Eli Barzilay wrote:

 10 minutes ago, Matthias Felleisen wrote:
 
 On Jun 28, 2011, at 10:04 AM, Eli Barzilay wrote:
 
 Regardless of this, you're missing the main problem.  If you're in
 drracket (or in a racket repl), you won't get to `set-car!', unless
 you explicitly search everything.  But the problem is when the neabies
 just points their browsers to doc.racket-lang.org/search/ and look for
 stuff -- then, in that case, no context is possible.
 
 
 Good argument. 
 
 But when you create the docs from our code base you could 
 show which languages don't collaborate with which libraries. 
 
 Yeah, that's doable -- as well as some search operator for which
 language you want to use as your context.  There's something very
 similar there now -- and I think that in practice nobody uses it.


Perhaps it's too complicated. 
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] getting symbol documentation URL quickly within Emacs

2011-06-25 Thread Matthias Felleisen

We can improve the documentation system. 

This kind of objection has been raised time and again (not the very same 
objection but dependence on racket or assumptions about running in drracket). 
We cannot and will never convince all people to use DrRacket or even Emacs. 
Some lost souls will continue to use vi. (I have used it for 25 years at least 
once a year and I will admit it, on rare occasions I have edited Scheme/Racket 
files in it.) 

So, since Eli has invested a tremendous amount of time in the JS part, I am 
sure he can figure out how to render it for other info systems. 

We may just have to make Emacsers happy first to see how to create an entirely 
general doc system for interfacing from all kinds of worlds. 

Eli? 

-- Matthias





On Jun 25, 2011, at 4:27 AM, Robby Findler wrote:

 You can improve the documentation system. :)
 
 Robby
 
 On Sat, Jun 25, 2011 at 4:20 PM, Neil Van Dyke n...@neilvandyke.org wrote:
 Forgot to mention: I could also use quick-reference information of
 procedure/macro syntax/args in Emacs, for displaying in echo area or tooltip
 as you're editing a use of the procedure/macro.
 
 So, how the quick-reference gets implemented might influence how getting the
 URL for more documentation gets implemented.
 
 Neil Van Dyke wrote at 06/25/2011 04:13 AM:
 
 If I'm in Emacs, and I have a symbol for some Racket standard library
 procedure or syntax, and I want to get the URL (or open the URL in browser)
 for the documentation for that symbol... what is a good and fast way to do
 that?
 
 Ideas I've considered so far:
 
 1. Use racket/help.  I don't want to do this, since I'd really prefer
 not to keep a racket process open for this purpose, and invoking racket
 each time is uncomfortably slow.  (As the below timings show, the help
 macro is not very fast: on my 2GHz dual-core (with no swap), when the
 pertinent files *are* cached by Linux, getting the URL takes about 2.6
 seconds.  When caches are empty except for what is needed to start the
 racket process, getting the URL takes about 15.6 seconds.  Looking up
 *subsequent* symbols in the same racket process takes only around 0.2
 seconds, however.)
 
 2. Keep a racket process open and use some lookup of my own design.  I'm
 guessing this is the same as racket/help, and so I have the same
 objections.
 
 3. Have Emacs find the appropriate index.html on the filesystem or on
 racket-lang.org, and then send a URL to that with the q query parameter
 for my symbol, letting the JS look up the documentation, and waiting for the
 JS the first time.  This will at least get me a list of search hits, but
 won't jump to the documentation for the exact symbol.
 
 4. Have Emacs load the documentation indexes (perhaps in the background
 when idle, at startup, and when we notice they change) and do the lookup in
 Emacs.  This is what Quack did for older PLT documentation, and it stopped
 working when the documentation format changed and I didn't have time to
 rewrite.  I could also be sensitive about things like which #lang we were
 in (like I could with an external process, if I passed it the  #lang
 information).
 
 Any more ideas/thoughts?  (Other than pressing me on why I'd rather not
 keep a racket process open for this purpose.  Eventually the new Emacs
 mode, Meow, will probably do that for things like Check Syntax, but I don't
 want to go there yet if I don't have to.)
 
 Note that all these require some notion of *from which Racket install tree
 or which Racket version on the Web do you want this documentation*, and
 that's some HCI and coding work that has to be done in any case.
 
  BEGIN 
 ~  echo 3 | sudo tee /proc/sys/vm/drop_caches
 3
 ~  echo '(display hello, world!\n)' | racket
 Welcome to Racket v5.1.1.
 hello, world!
 
 ~  time echo (help begin) | racket
 Welcome to Racket v5.1.1.
 Loading help index...
 Sending to web browser...
  file: /usr/local/racket-5.1.1/share/racket/doc/reference/begin.html
  anchor: (form._((quote._~23~25kernel)._begin))
 Starting Firefox...
 
 
 real0m15.584s
 user0m2.472s
 sys0m0.180s
 ~  time echo (help begin) | racket
 Welcome to Racket v5.1.1.
 Loading help index...
 Sending to web browser...
  file: /usr/local/racket-5.1.1/share/racket/doc/reference/begin.html
  anchor: (form._((quote._~23~25kernel)._begin))
 Starting Firefox...
 
 
 real0m2.622s
 user0m2.240s
 sys0m0.124s
 ~ time echo (begin (help and) (help or)) | racket
 Welcome to Racket v5.1.1.
 Loading help index...
 Sending to web browser...
  file: /usr/local/racket-5.1.1/share/racket/doc/reference/if.html
  anchor: (form._((lib._racket/private/letstx-scheme..rkt)._and))
 Starting Firefox...
 Sending to web browser...
  file: /usr/local/racket-5.1.1/share/racket/doc/reference/if.html
  anchor: (form._((lib._racket/private/letstx-scheme..rkt)._or))
 Starting Firefox...
 
 
 real0m2.858s
 user0m2.216s
 sys0m0.116s
 ~  END 
 
 _