moraga86
2017-10-20 16:21:07

@moraga86 has joined the channel


lexi.lambda
2017-10-20 18:46:20

I think I am very close to getting multiple namespaces working semi-smoothly in Hackett. The only significant remaining obstacle is documenting Hackett’s base types and type-level forms, like forall. I use defform and defidform to document them, but frustratingly, it seems impossible to get defform to document an identifier with any other name than how it is exported from the module. I am, however, reluctant to reimplement half of defform in Hackett.


lexi.lambda
2017-10-20 18:48:49

I guess I could just copy scribble/private/manual-form into Hackett’s codebase and tweak it slightly, but that seems like the option of last resort. Maybe it will be necessary, though.


apg
2017-10-20 18:56:17

all the software i’ve ever worked on / written professionally is exactly this. :disappointed:


drdeeglaze
2017-10-20 20:48:47

Is there not an introducer you can use on an identifier to assert which namespace it’s in?


lexi.lambda
2017-10-20 20:52:03

The trouble is that Scribble’s binding documentation forms don’t really pay any attention to hygiene. (But shhh, don’t tell anyone.)


drdeeglaze
2017-10-20 21:26:09

Oh that’s a pity


ben
2017-10-20 21:28:29

time for a “Scribble: closing the book on unhygienic documentation tools” ?


lexi.lambda
2017-10-20 21:28:50

#lang scribble/manual2


lexi.lambda
2017-10-20 21:30:23

I’m not even sure if respecting hygiene would actually solve this problem, though, sadly. There’s a variety of moving parts at play.


notjack
2017-10-20 23:09:48

can a module provide the same symbol with two different bindings?


notjack
2017-10-20 23:10:08

if not I’m not sure how hygiene applies to scribble


michael.ballantyne
2017-10-20 23:11:02

Can anyone remind me why syntax parameters can’t be just be implemented with parameterize at phase 1 + syntax-local-expand-expression? The Scheme Workshop paper includes a comment that this wouldn’t work because compile-time state is ephemeral, but I can’t figure how to construct an example where it would matter given local-expand’s refusal to look under let-syntax anyway. The solution in the racket 7 expander doesn’t feel appreciably different than using a phase 1 parameter, as there it’s using the current expand context parameter.


notjack
2017-10-20 23:12:22

@michael.ballantyne not sure, but since parameters are intrinsically related to thread cells and the like it seems like a strange choice in general. Macro expansion isn’t performed in a multi-threaded way (at least within a module)


notjack
2017-10-20 23:12:55

so why add the complexity of thread cells at all if there’s no concurrency involved?


michael.ballantyne
2017-10-20 23:13:42

Isn’t that just an argument to use fluid-let instead of parameterize?


michael.ballantyne
2017-10-20 23:14:58

I guess my impression from the seeming deprecation of fluid-let is that parameterize is just as efficient for Racket, or at least efficient enough, but I don’t really know.


michael.ballantyne
2017-10-20 23:16:19

Parameters also have a nicer API where you explicitly call out your dynamically bound values as parameters up-front, which is another reason to like them regardless of whether you care about the threading behavior.


notjack
2017-10-20 23:21:58

I’m guessing the compile time state part of the paper is referring to how using state and side effects during macro expansion can cause differences to arise based on whether modules are compiled ahead of time or compiled and run interactively


notjack
2017-10-20 23:23:47

I don’t know the details well enough to think of a specific example and demonstrate how it goes wrong, but reading The Separate Compilation Guarantee in the racket reference and reading the Composable and Compilable Macros paper are probably good places to go hunting for details


lexi.lambda
2017-10-21 00:18:07

not at the same phase.


lexi.lambda
2017-10-21 00:19:31

@michael.ballantyne I don’t know, but using syntax-local-expand-expression would force a specific expansion order, whereas syntax parameters don’t.


mflatt
2017-10-21 03:35:23

@michael.ballantyne I think the paper’s explanation was probably intended to address wrapping a local-expand with parameterize, and probably we agree that such an implementation wouldn’t work. I don’t quite see what you have in mind with let-syntax. In any case, the current implementation also supports splicing-syntax-parameterize in a way that I think parameters can’t. (I forget where splicing parameterize is used, but it seemed important at some point.)


lexi.lambda
2017-10-21 03:36:53

I’m getting good milage out of it :)