soegaard2
2020-5-27 11:42:21

What is the correct incantation for “raco scribble” to produce links to documentation on http://docs.racket-lang.org\|docs.racket-lang.org. In “flmatrix.scrbl” I have used @other-manual['math/matrix] to refer to the math/matrix manual and @tech{flonums} to refer to “flonums” (like [+]) does.

The following attempt is not enough:

raco scribble +m --redirect <http://docs.racket-lang.org/> flmatrix.scrbl &amp;&amp; open flmatrix.html

[+] https://docs.racket-lang.org/reference/flonums.html?q=double#%28def._%28%28lib._racket%2Fflonum..rkt%29._flvector%29%29


mflatt
2020-5-27 11:46:03

If you leave out --redirect, do you get local links? I ask because your raco scribble call looks ok, but other-manual needs a module path for the document “.scrbl” file, not the documented module, and tech will need a #:doc argument to reference another manual.


soegaard2
2020-5-27 11:50:33

No local links either - and local links would be fine while I work on the manual.

I’ll try the path to the scribble document instead.


soegaard2
2020-5-27 12:17:07

Now the reference to flonums works. It confused me that it was defined in “numbers.scrbl” but I needed to refer to “reference.scrbl”. In hind sight it makes sense.


vzaigrin
2020-5-27 12:20:06

@vzaigrin has joined the channel


soegaard2
2020-5-27 12:30:11

Spoke too soon. The link looks fine, but clicking it I end up at: https://docs.racket-lang.org/?doc=reference&amp;rel=numbers.html%23%2528tech._flonum%2529


soegaard2
2020-5-27 12:32:55

Ah! Simply had to remove --redirect <http://docs.racket-lang.org/> and now I end up the correct place.


mflatt
2020-5-27 12:46:45

I think you’ll want --redirect-main instead of --redirect. If you use --redirect, you need a longer URL: <https://docs.racket-lang.org/local-redirect/index.html>


soegaard2
2020-5-27 14:10:23

That worked. Thanks.


greg
2020-5-27 14:45:19

Although I haven’t thought about this super hard: A syntax-property for indent could be useful! However IIUC you’d need to fully-expand a module to discover that reliably? That means 1. You need a “fancy” editor like DrRacket or racket-xp-mode or a LSP server — i.e. you need to run Racket. That doesn’t help with simple text editors, where people might expect to be able to edit a language file and indent properly. 2. Even if you have a fancy editor/server, fully-expanding can be slow, and, syntax is often imported (and fully-expanding all imports can be slow, which is why we have e.g. bytecode).

All this makes me wonder if there ought to be some sort of concept of a “database” with information about imports. Such as indent. Definition site. Definition usages across some scope. Stuff like that.

Would it be stored in bytecode or bytecode-like separate files? Or in a sqlite db like doc xref (IIUC)? idk.


greg
2020-5-27 14:48:32

It might be both. Definition usages feels more like xref and sqlite? Whereas metadata about a definition like syntax indent feels “bytecode-y”?


greg
2020-5-27 14:48:59

/me is super hand-wavy


spdegabrielle
2020-5-27 15:14:52

Yes! we need a 2020 Standard Fish Summer Picture Competition. - Need to work out some deets; Dates:

• Liberal rules; it just needs to be racket or racket language related in some way - doesn’t have to use pict or racket/draw. Can be moving picture(gif/video). Can be Sound or music (pictures for the ears) • categories there will be a range of categories to cover the variety, but will include generative techniques, waffle themed art, visualisations, inventive use of the plot package and ascii art. • submissions method; ? Some advice appreciated. (I was thinking a package or a PR but maybe that is too much?) • End date? • Announcement of winners (maybe at Racket con?) feedback appreciated


soegaard2
2020-5-27 18:06:46

Are there any Linux that can confirm this?


michaelmmacleod
2020-5-27 18:18:12

Can confirm. There is a noticeable lag when using PLT_DISPLAY_BACKING_SCALE=1.5, but not when using PLT_DISPLAY_BACKING_SCALE=2. Linux version 5.6.13-arch1–1. Racket versions 7.7 BC and CS.


notjack
2020-5-27 19:51:55

Maybe animations? Since I spent all that work making animated snips and all. I could put that into a package.


spdegabrielle
2020-5-27 19:52:30

Yes


notjack
2020-5-27 19:54:53

I think expansion is okay if it doesn’t have to happen every time. So after expansion, the indentation information could be “compiled” (serialized) into some sort of cache (either on disk or in memory).


notjack
2020-5-27 19:55:25

I definitely lean more towards attaching metadata to definitions than to usages.


notjack
2020-5-27 19:55:52

The latter seems unscalable and it won’t work with usages that don’t compile.


spdegabrielle
2020-5-27 19:57:39

Yes! we need a 2020 Standard Fish Summer Picture Competition. - Need to work out some details;

Dates:???

Liberal rules it just needs to be racket or racket language related in some way • doesn’t have to use pict or racket/draw.

Can be ; • moving picture(gif/video), • animation or interactive animations. • Can be Sound or music (pictures for the ears)

categories there will be a range of categories to cover the variety, but will include • generative techniques, • waffle themed art, • visualisations, • inventive use of the plot package • ascii art. • submissions method; ? Some advice appreciated. (I was thinking a package or a PR but maybe that is too much?) • End date? • Announcement of winners (maybe at Racket con?)


spdegabrielle
2020-5-27 19:58:00

@notjack better?


notjack
2020-5-27 20:09:21

Can only skim it right now but I like it


notjack
2020-5-27 20:10:32

What do you think about timing it for after the 7.8 release? Then the Scribble gif changes would probably be in, and I could send a pull request to add a pict/movie module to the main distribution that provides the animation snip implementation.


notjack
2020-5-27 20:11:37

(when is the next release anyway)



greg
2020-5-28 00:30:15

I agree about attaching metadata to definitions not usages. [I probably confused things by mentioning usages. The only connection is, “If we used a database for feature X, that reminds me, another feature Y could use that.” For now please forget I mentioned them. :simple_smile:]


greg
2020-5-28 00:35:19

To take back something else I said: A data specification for indent can work fine for langs using s-expressions. But I don’t see how that could support languages generally. The only API I can imagine for that, is the one where the lang — or now also syntax provided by a non-lang module — can supply a function and the tools must call it. Right?


notjack
2020-5-28 01:34:33

I was thinking of something similar to the Rectangle Rule, which is what Google uses in their Java autoformatter https://github.com/google/google-java-format/wiki/The-Rectangle-Rule\|https://github.com/google/google-java-format/wiki/The-Rectangle-Rule


notjack
2020-5-28 01:50:27

I think you’re right that the lang needs to be involved somehow. Maybe an autoformatter submodule similar to the reader submodule?


sorawee
2020-5-28 01:54:47

These are all good questions! I am quite busy right now, but there are a couple of points that I can quickly reply:

> As a possible alternative, what if indentation information were handled more like documentation — i.e. extracted as part of building, and stored in a “database”? So that tools and editors could access it without needing to instantiate, or even fully-expand, a module that defines it? IIUC, Racket’s documentation needs module to be fully expanded. Otherwise, the for-label mechanism wouldn’t work.


sorawee
2020-5-28 02:10:09

One possible way to specify the indentation configuration without expanding code is to write it in a comment. This is an approach that is used by non S-exp languages’s linters/type checkers to suppress errors.

Why comment? Well, if we use S-exp, then it could be the case that someone writes:

(define x (quote (indent 3))) and it would not be possible until expansion to know that the indent is meant to be quoted as a data rather than a description.


greg
2020-5-28 02:21:04

As a starting point, what if non-lang syntax could provide the same function that a lang could: https://docs.racket-lang.org/tools/lang-languages-customization.html#(part._.Indentation)


greg
2020-5-28 02:22:51

One thing about that I don’t love, assuming I understand it correctly, is that racket:text&lt;%&gt; is from the GUI framework. That feels too “heavy” for a little bit of syntax to require that just to specify some indent. (Also, honestly, it feels a bit heavy for tools like Emacs Racket Mode to need to require that.)


greg
2020-5-28 02:24:13

Also, although I don’t understand it very well, intuitively it seems that would also (a) need a 'color-lexer https://docs.racket-lang.org/tools/lang-languages-customization.html#%28part._.Syntax_.Coloring%29 — and (b) need that lexer to have run before the indenter is called? I think?


greg
2020-5-28 02:25:34

Maybe it would be possible to “tease out” some API that doesn’t presume the GUI framework, and that is more clear about how a lexer fits into the picture. And use that both for langs and for non-lang syntax indent.


greg
2020-5-28 02:25:43

(Is my latest fuzzy, hand-wavy idea.)


tgbugs
2020-5-28 03:46:09

Also confirming on 7.6 running on gentoo.


notjack
2020-5-28 06:44:33

Made my planning library’s block world example prettier by replacing it with an actual Sokoban level (https://en.wikipedia.org/wiki/Sokoban)


notjack
2020-5-28 06:52:27

Yeah I think any autoformatting needs to be decoupled from the racket GUI framework. There’s lots of non-editor use cases for autoformatting. For instance, I’d really like to be able to run an autoformatter in a headless Docker container as part of a github action.