reading code

105 views
Skip to first unread message

Hendrik Boom

unread,
Oct 24, 2019, 11:46:15 AM10/24/19
to us...@racket-lang.org
What tools are there to help understand large Racket programs?

I'm trying to grok the innards of Pict3D, which is, I believe, typed
Racket.

But I have difficulty finding bindings of symbols across many complex
require's and provide's through many directories of source code.

I'm looking for tools that work on a Linux system. I know that in
principle I could install something like Microsoft's big fat
development environment (which may have a plugin for Racket)
but it would surpise me if there wasn't something relevant within the
Racket ecosystem.

If DrRacket already does this, I haven't found it. It does lovely
graphics do show bindings, but I don't see how to follow those lines
even to parts of the same file that happen to be out of the window
area, let alone to other files.

Does DrRacket also show the types of symbols or expressions in typed
Racket?

-- hendrik

Joel Dueck

unread,
Oct 24, 2019, 12:20:52 PM10/24/19
to Racket Users
On Thursday, October 24, 2019 at 10:46:15 AM UTC-5, Hendrik Boom wrote:
If DrRacket already does this, I haven't found it.  It does lovely
graphics do show bindings, but I don't see how to follow those lines
even to parts of the same file that happen to be out of the window
area, let alone to other files.

If the arrows/lines lead off the window area, I will often right-click→“Jump to
Binding Occurrence”. If that jump leads to a `require`, I right-click the module
name→“Open module.rkt”, maybe do a Ctrl+F in that file and continue from
there.

Niklas Larsson

unread,
Oct 25, 2019, 5:31:50 AM10/25/19
to Hendrik Boom, us...@racket-lang.org
Hi!

If you right click on an identifier in drracket you get “jump to binding occurrence” and “jump to definition” (if it’s defined in another file). Don’t those do what you want?

Regards,
Niklas

> 24 okt. 2019 kl. 17:46 skrev Hendrik Boom <hen...@topoi.pooq.com>:
>
> What tools are there to help understand large Racket programs?
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20191024154608.f3n3parggb2t5ckj%40topoi.pooq.com.

Hendrik Boom

unread,
Nov 11, 2019, 11:30:06 AM11/11/19
to Niklas Larsson, us...@racket-lang.org
On Fri, Oct 25, 2019 at 11:31:41AM +0200, Niklas Larsson wrote:
> Hi!
>
> If you right click on an identifier in drracket you get “jump to binding occurrence” and “jump to definition” (if it’s defined in another file). Don’t those do what you want?

Close.

Using "jump to binding occurrence" gets me to the require
line that provides me the symbol. I can then ask it to open
that file, but if the other file just imports a number of other
modules and provides all-from-out it still leaves me a bit lost.

I turn out not to have "jump to definition" but
"open defining file", which creates a new tab. Then I still
have to search for the name I was looking for. But at least
can find it.

-- hendrik
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/3B855EDE-EE87-4D96-A6F3-35C5BCFF2D0A%40gmail.com.

Robby Findler

unread,
Nov 11, 2019, 10:56:48 PM11/11/19
to Hendrik Boom, Niklas Larsson, us...@racket-lang.org
On Mon, Nov 11, 2019 at 10:30 AM Hendrik Boom <hen...@topoi.pooq.com> wrote:
>
> On Fri, Oct 25, 2019 at 11:31:41AM +0200, Niklas Larsson wrote:
> > Hi!
> >
> > If you right click on an identifier in drracket you get “jump to binding occurrence” and “jump to definition” (if it’s defined in another file). Don’t those do what you want?
>
> Close.
>
> Using "jump to binding occurrence" gets me to the require
> line that provides me the symbol. I can then ask it to open
> that file, but if the other file just imports a number of other
> modules and provides all-from-out it still leaves me a bit lost.
>
> I turn out not to have "jump to definition" but
> "open defining file", which creates a new tab. Then I still
> have to search for the name I was looking for. But at least
> can find it.

That menu item will become "jump to definition" if the file is already
open in another tab (and check syntax has had time to analyze that
tab's content).

Robby

Shu-Hung You

unread,
Nov 12, 2019, 5:58:40 AM11/12/19
to Hendrik Boom, Niklas Larsson, us...@racket-lang.org
On Mon, Nov 11, 2019 at 10:30 AM Hendrik Boom <hen...@topoi.pooq.com> wrote:
>
> On Fri, Oct 25, 2019 at 11:31:41AM +0200, Niklas Larsson wrote:
> > Hi!
> >
> > If you right click on an identifier in drracket you get “jump to binding occurrence” and “jump to definition” (if it’s defined in another file). Don’t those do what you want?
>
> Close.
>
> Using "jump to binding occurrence" gets me to the require
> line that provides me the symbol. I can then ask it to open
> that file, but if the other file just imports a number of other
> modules and provides all-from-out it still leaves me a bit lost.
>
> I turn out not to have "jump to definition" but
> "open defining file", which creates a new tab. Then I still
> have to search for the name I was looking for. But at least
> can find it.
>
> -- hendrik
>

After opening the defining file and after a little green dot shows up
at the bottom-right corner in DrRacket, the "Open Defining File" menu
item will become "Jump to Definition (in Other File)". That will let
you directly jump to the definition site.

(Sadly contract-out identifiers will still defeat Check Syntax.)

Shu-Hung
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20191111162958.ybiunmwlvj2hqj23%40topoi.pooq.com.
Reply all
Reply to author
Forward
0 new messages