greg
2018-1-29 14:52:22

@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:


blerner
2018-1-29 14:56:13

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


leif
2018-1-29 18:21:29

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


leif
2018-1-29 18:21:49

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


leif
2018-1-29 18:39:13

@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))


leif
2018-1-29 18:41:57

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)

leif
2018-1-29 18:58:29

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.


shu--hung
2018-1-29 21:19:54

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


florence
2018-1-29 21:20:48

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


shu--hung
2018-1-29 21:25:52

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


shu--hung
2018-1-29 21:30:03

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


leif
2018-1-29 21:37:09

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


leif
2018-1-29 21:37:41

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


leif
2018-1-29 21:38:16

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


leif
2018-1-29 21:38:48

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


leif
2018-1-29 21:59:09

@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


leif
2018-1-29 21:59:10

leif
2018-1-29 21:59:13

WHich is just…ew…


shu--hung
2018-1-29 22:17:42

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


leif
2018-1-29 22:25:49

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


leif
2018-1-29 22:26:08

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


abmclin
2018-1-29 23:19:49

@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


mflatt
2018-1-30 00:59:11

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


mflatt
2018-1-30 01:05:52

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


ben
2018-1-30 05:21:31

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


ben
2018-1-30 05:22:47

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