anton.holmberg93
2018-4-5 14:23:46

@anton.holmberg93 has joined the channel


leif
2018-4-5 14:37:23

@mflatt @ryan So, I think I figured out why a recent commit killed nanopass.


leif
2018-4-5 14:38:05

Older versions of syntax/loc seemed to (sometimes) work when the source location given wasn’t a syntax object directly.


leif
2018-4-5 14:38:28

(But rather a list or somethhing that syntax-case/parse can match on.)


leif
2018-4-5 14:39:15

No there seems to be a check for syntax/loc that errors when its not given a syntax? object.


githree
2018-4-5 15:15:04

@leif you probably meant to mention @ryanc in your message above


ryanc
2018-4-5 15:39:26

@leif Indeed, that is something that changed. But IIRC if it didn’t error before, it was because it was throwing away the loc argument entirely, because the template was just a single pattern variable. For example: (syntax/loc loc-expr x) where x is a pattern variable or (quasisyntax/loc loc-expr #,expr).


ben
2018-4-5 15:41:08

@leif that’s the same reason trivial wasn’t building yesterday — bad argument to syntax/loc. I’m happy with this error because it found a bug in my code


githree
2018-4-5 15:46:25

mentioning @leafac as his css-expr also fails on new syntax/loc behaviour


leif
2018-4-5 15:50:37

Ya. @ryanc, given the amount of packages this broke, it should at least be announced.


leif
2018-4-5 15:51:20

Also, it would be good to explicitly document that the srcloc argument for syntax/loc must be a syntax? and thus not every value syntax-parse can match on is valid there.


ryanc
2018-4-5 15:55:06

@leif the docs for syntax/loc already say that. The announcement sounds like it might be a good idea, though.


leafac
2018-4-5 16:06:32

@githree Thanks for the mention.


leif
2018-4-5 16:24:00

@ryanc, Interesting, my build says:

“Like syntax, except that the immediate resulting syntax object takes its source-location information from the result of stx-expr (which must produce a syntax object), unless the template is just a pattern variable, or both the source and position of stx-expr are #f.”


leif
2018-4-5 16:24:29

Which is now broken. And so it ‘might’ make sense to change that and add a history note.


leif
2018-4-5 16:24:35

(Which I’d be happy to do for the record.)


samth
2018-4-5 16:35:01

@ryanc breaking a bunch of packages sounds bad


pocmatos
2018-4-5 16:36:22

Does anybody know if there’s a way to force racket to simulate places using threads, even if places are available?


leif
2018-4-5 16:38:40

@samth I agree. Although it is at least only a handful (somewhere between 5 and 10).


pocmatos
2018-4-5 16:46:10

@mflatt Do you know what’s going on here? https://github.com/racket/racket/issues/2019


leif
2018-4-5 18:40:29

@ryanc It also looks like the reason your push killed rosette was because Rosette already used ?? as an identifier.


leif
2018-4-5 18:46:32

(Thanks to @ben for finding that.)


ben
2018-4-5 18:48:00

greg
2018-4-5 18:48:30

To be fair, if that were the only reason: My impression is that provide-ing a new definition is one of the few ways it’s acceptable to break backward-compatibility? The idea being, well users could defend themselves by using only-in with require. I’m not arguing that’s the right norm (idk) but I think that’s the de facto norm, until/unless someone wants to advocate otherwise?


greg
2018-4-5 18:51:07

I’m not sure there’s an ideal choice. - Using only-in everywhere might be tedious. - Providing whole-new-module-just-for-one-function might be icky.


leif
2018-4-5 18:58:30

pocmatos
2018-4-5 19:04:46

Does anyone here know where the scripts to create the nightly snapshots live?


notjack
2018-4-5 19:09:19

I’d like to understand this breakage more but I’m confused on the details, what went wrong exactly?


lexi.lambda
2018-4-5 19:11:17

as far as I can tell, it’s mostly just a standard “exporting a new identifier from #lang racket/base that other people already used” issue


jerome.martin.dev
2018-4-5 19:11:52

Hello everybody! I’m pondering whether I should make a small package in which I provide my web helpers (creating html content and instantiating a racket web-server to serve them) or just use something already existing. Is there any racket “web framework”? I saw frog and plt-web, but they generate static content. My helpers mostly consists of basic elements (links, dates, images…) and a way to create new ones with a define-renderer macro. Then I have a define-response macro that handles serving a specific page. I want to make the inner workings of racket’s web-server disappear. Are there already packages doing that, or should I create some? (if so, I’ll need your help to come up with a catchy name)


notjack
2018-4-5 19:13:33

as I understand it:

  • things imported by #lang can be shadowed by require imports and by definitions
  • things imported by require can be shadowed by definitions

so does exporting from #lang racket vs a require form mean anything special here?


lexi.lambda
2018-4-5 19:13:37

@jerome.martin.dev I think a newer, nicer, more consistent layer on top of web-server would be appreciated.


lexi.lambda
2018-4-5 19:14:19

The problem is that people often do (require racket/base) (often for-syntax or for-label, but that still suffers from the same potential pitfalls).


lexi.lambda
2018-4-5 19:15:19

If it was only used as #lang racket/base, you’d be right in that it probably wouldn’t be a problem. But it isn’t only used that way.


leif
2018-4-5 19:15:27

Yup. Especially when making the sort of, front end, so to speak, for DSLs.


jerome.martin.dev
2018-4-5 19:15:42

Cool, I’ll extract what I came up with from working on my websites, and put it on github, so that you can give me some feedback :slightly_smiling_face:


notjack
2018-4-5 19:17:56

@jerome.martin.dev I like racket web stuff a lot so looking forward to it


notjack
2018-4-5 19:19:16

Wait is ?? part of racket/base now?


lexi.lambda
2018-4-5 19:23:19

Yes, on HEAD (but not in any releases yet). IIUC, syntax is now essentially template from syntax/parse/experimental/template, but I’m not completely sure if all the features from template were ported to syntax.


leif
2018-4-5 19:26:37

I thought they were. Although you know them better than me.


notjack
2018-4-5 19:28:49

Okay I’m less confused now I think


notjack
2018-4-5 19:30:19

I’m assuming template recognizes ?? as a bound literal instead of a datum, is that right?


lexi.lambda
2018-4-5 19:31:17

Yes, that’s right.


githree
2018-4-5 19:38:09

@jerome.martin.dev even if there would be packages like this already I still think it would be a good idea to publish yours. Seeing how others deal with similar problems is an eye opening experience that creates synergistic effect that can ultimately lead to great results (ever-greater packages)


leif
2018-4-5 19:48:59

@leafac @githree I have pushed a fix to nanopass.


leif
2018-4-5 19:49:05

So it should now (hopefully) work on head.


githree
2018-4-5 19:53:05

thanks @leif!


leif
2018-4-5 20:00:52

I think the most annoying bit is that you can’t just say (except-in racket/base ??), because then it won’t build on 6.12 because ?? isn’t provided.


leif
2018-4-5 20:01:22

Like, it would be nice if there was an except-in/maybe-doesnt-exist form. Or something like it.


ben
2018-4-5 20:27:37

dear past Ben I think you should see this: https://github.com/racket/racket/issues/2031


samth
2018-4-5 22:35:15

There’s some code in @alama’s book that would be nice to have as a package too


lexi.lambda
2018-4-5 22:47:08

@stchang @alexknauth @ben I think I might be throwing in the towel (for now) on using prefab structures


lexi.lambda
2018-4-5 22:47:33

time to convert a lot of uses of racket/match to uses of syntax/parse


notjack
2018-4-5 22:48:06

@lexi.lambda I’m also curious about how that journey worked out


stamourv
2018-4-5 22:49:07

s


lexi.lambda
2018-4-5 22:49:48

essentially, I want to be able to embed expanded types back into syntax objects, and I can do that with prefab structures, but that wraps them in syntax objects anyway, so there’s not really any advantage to doing so


lexi.lambda
2018-4-5 22:50:12

trying to go half way is more trouble than it’s worth


lexi.lambda
2018-4-5 22:50:52

I guess it’d be possible to use syntax-wrapped prefab structures, but I’m not sure there’s much of a point to doing so


lexi.lambda
2018-4-5 22:51:21

(versus just using the usual lists and symbols)


plotnus
2018-4-6 00:00:31

Is there a way to force an expression to evaluate at compile time without defining a macro?


notjack
2018-4-6 00:01:55

@plotnus you could use begin-for-syntax I think, but it depends what you want to do


alexknauth
2018-4-6 01:20:06

I’ve thought that prefab structures were the better idea ever since hearing about it.


alexknauth
2018-4-6 01:21:20

And since then I’ve made an alternate version of Turnstile that allows prefab structs as types…


alexknauth
2018-4-6 01:25:11

What’s the problem with prefab? Possible marshaling/unmarshalling cost? Not having syntax-parse’s error messages? Interaction between modules?


alexknauth
2018-4-6 01:28:05

Macros expanding to syntax that contains types?


alexknauth
2018-4-6 01:30:23

I just saw this btw


lexi.lambda
2018-4-6 01:30:28

@alexknauth the last one is the main problem. you can devise a way to turn the prefab structures back into syntax, but I find that somewhat unsatisfying. do you disagree?


alexknauth
2018-4-6 01:30:41

So I haven’t tried out the gist yet


alexknauth
2018-4-6 01:33:34

Expanding to dummy syntax with the type in a property isn’t an option?


alexknauth
2018-4-6 01:38:31
(define-syntax stop/error
  (λ (stx)
    (raise-syntax-error #f “bad” stx)))

... (local-expand ... (list #’stop/error)) ...

... (syntax-property #’(stop/error) ‘is-type ...prefab-struct...) ...

?


lexi.lambda
2018-4-6 01:51:21

@alexknauth I think that’s feasible, but I think it’s a confusing interface for users.


alexknauth
2018-4-6 02:25:40

What do you mean? The interface for users wouldn’t be this, it would be an Int or -> macro that expands into (syntax-property #'(stop/error) 'is-type ...), and something like an expand-type function that does the (local-expand ... (list #'stop/error)) and gets out the syntax property.


alexknauth
2018-4-6 02:26:48

But importantly, that expand-type function wouldn’t have to traverse the same syntax twice, because of the stop/error identifier in the stop-list.


alexknauth
2018-4-6 02:28:57

And if users really need it, you would provide a type->syntax function that’s just (syntax-property #'(stop/error) 'is-type ty)


alexknauth
2018-4-6 02:33:50
expand-type : Syntax -> Type
type->syntax : Type -> Syntax

plotnus
2018-4-6 02:35:16

@notjack thank you, I’ll give it a try. what I’m doing is setting an integer through a bitwise-ior of several bits. & want that computed at compile time so the binary would just have the results of evaluation.


lexi.lambda
2018-4-6 02:47:45

@alexknauth Perhaps you’re right. That would be a less destructive change than ripping out half my code and replacing it. Maybe I’ll give that a shot to start.


lexi.lambda
2018-4-6 02:48:19

(I was originally considering something like that, but after thinking about it again, I realized I had rejected it for a reason that is no longer relevant. So I should give it another try.)


alexknauth
2018-4-6 02:50:52

Okay.


notjack
2018-4-6 03:09:44

One module can require another at compile time with for-syntax, so you can define a regular variable containing the result of the thing you want to compute and use that variable in compile-time macros of another module