
@blerner If that will become a pull-request to Racket, a suggestion: Make the new parameter not just string?
but something like (or/c string? (-> bytes? string?))
. In other words, can supply a function that, given the file bytes, returns the file name to use.
Why: As a caching strategy, sometimes people want the name of an HTTP resource (like an image or style) to include a “fingerprint” (e.g. SHA). (See last diagram here https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching for one explanation.)
OTOH If this is just your local change, never mind. :slightly_smiling_face:

for now it’s all local. I’ve hacked up a scribble run.rkt with several changes by this point, and I haven’t had time to make a proper, clean PR out of any of them

@mflatt Are VM parameters supposed to be cross phase/namespace? For example, if I set the current-logger
parameter, it stays set in other threads/namesapces.

(And if that is the desired behavior, is this going to change in Racket on Chez?)

@mflatt For example, the logger in this program seems to get preserved: (define-syntax (foo stx)
(define logger (make-logger))
(current-logger logger)
#`#,logger)
(define x (foo))
(equal? x (current-logger))

But this one (as expected), does not preserve the value across phase boundaries:
(module param racket
(struct unit ())
(define current-param (make-parameter (unit)))
(provide current-param))
(require 'param
(for-syntax 'param))
(begin-for-syntax
(current-param 42))
(current-param)

And while current-logger
appears to be defined as part of '#%kernel
in Racket6, it looks like you’ve reimplemented it with racket/base
in racket7, which makes me wonder if the behavior will change.

wow, didn’t know that current-logger
is implemented as part of racket/base
in racket7

If the logger is reimplemented in racket/base
, will it lose its ability to smuggle messages between phases? (Cover relies on this right now)

I searched a bit in the code base. It looks like current-logger
is not really implemented in racket/base

it’s a special thing that the new expander and the underlying racket-to-chez layer knows about @leif when I’m implementing a annotator, I also found that current-compile
is cross-phase and cross-namespace

@shu—hung @florence Ya, that seems to be the case.

Like, while it is ‘written’ in racket/base, its compiled into part of ’#%kernel during the bootstrapping process.

And since ’#%kernel is cross phase, the parameter still can be used to smuggle values.

Which is…actually its probably really bad, since this means you can pass any value that has a logger struct info type across phases.

@shu—hung @florence But while we’re talking about smuggling values around, @michael.ballantyne helped me make this gem: https://gist.github.com/LeifAndersen/01bed2a4b6fd933a94286abce2b6d941


WHich is just…ew…

it’s 3D syntax plus the hopeless top-level tho

I just used the top level to make the example nicer to look atl.

Its actually 3d syntax combined with a parametrizable module load path.

@mflatt, I was wondering if you could point me to where in the Racket codebase the two log receivers are created during Racket start-up as explained in the third paragraph at https://docs.racket-lang.org/reference/logging.html

@leif Yes, primitive parameters span phases and namespace. And, yes, it’s a hole in the enforcement of phase separation.

@abmclin In the current Racket implementation, those log receivers are not created explicitly. Instead, logging to stdout and syslog is built into log-message
. See https://github.com/racket/racket/blob/master/racket/src/racket/src/error.c#L3925 where scheme_log_name_pfx_message
is the most primitive layer of `log-message. In Racket-on-Chez, the stderr receiver is an explicit receiver created at https://github.com/racket/racket7/blob/master/racket/src/cs/main.sps#L448 , but with a primitive implementation at https://github.com/racket/racket7/blob/master/racket/src/io/logger/receiver.rkt#L91 . (I think I haven’t filled in the syslog receiver, yet.)

@leif do you remember if scirbble/acmart
ever supported include-abstract
? https://github.com/racket/scribble/issues/159

(seems like something that might have gotten lost when 'pretitle
was added)