pocmatos
2019-4-8 07:09:39

@samth let me know when you are around. I found a way for you to repro 2018 easily. :slightly_smiling_face:


jerome.martin.dev
2019-4-8 08:38:18

In fact, I don’t really want to backtrack, I’m just generating a macro, but some patterns of the macro should be ignored and match nothing. The best way would be to have a non-syntax value (say, #f) that means “don’t generate code here”, but handling syntax attributes with non-syntax values is hard and makes the macro difficult to read, because you need to add ~? calls everywhere to protect from those #f values. It becomes especially unhandy when you have ellipsis patterns. I have enough (~? (~@ . (element ...))) in my code already.


alexknauth
2019-4-8 11:32:04

Oh, right, the {~fail #:when #t} is unnecessary just {~fail} is fine


oldsin
2019-4-8 11:55:57

Thanks, I will test them out later


samth
2019-4-8 13:29:13

around now


pocmatos
2019-4-8 13:36:36

I haven’t gotten around to writing all the details of running 2018 under qemu (which is basically what’s done with the racket/.gitlab shell script - but for your specific environment). I have however managed to rent an aarch64 machine so I can run this on the real deal. If you want to reproduce it, I can give you access. I need to send you a key. One second.


samth
2019-4-8 13:38:04

I see it, but I may try on qemu first


lexi.lambda
2019-4-8 14:55:02

@jerome.martin.dev I’m a little confused. If you want a pattern that matches nothing successfully, you can use {~and}, {~do}, or {~bind}. If you want a pattern that matches nothing unsuccessfully, you can use {~fail}. Your solution, {~not _}, is of the latter type, so I would think you’d want something like {~fail}.


jerome.martin.dev
2019-4-8 14:57:07

I’m using (~alt pattern1 pattern2 (~not _) pattern3 (~not _) ...etc) which allows me to accept everything that matches the defined alternatives, and reject all the rest.


lexi.lambda
2019-4-8 14:58:47

You could just use {~fail} there, and it would do the same thing. Both of them will cause the parser to backtrack to the nearest choice point, which in this case will just try the next option in the ~alt.


jerome.martin.dev
2019-4-8 14:58:58

Ok, I see!


jerome.martin.dev
2019-4-8 14:59:28

I didn’t knew exactly how ~alt worked inside.


jerome.martin.dev
2019-4-8 14:59:57

Well (~fail) will allow to put an error message, so that’s better! Thanks!


lexi.lambda
2019-4-8 15:01:41

syntax/parse is fully backtracking unless you explicitly cut using ~!, so every parser that can match in multiple ways (i.e. anything that uses ~alt or ~or*) will exhaustively try every option before the parse fails.


lexi.lambda
2019-4-8 15:02:28

There isn’t any difference between two kinds of failure in syntax/parse, except for error reporting purposes if all branches fail.


jerome.martin.dev
2019-4-8 15:02:41

Wow, that clarifies a lot of assumptions I had about syntax/parse.


lexi.lambda
2019-4-8 15:04:21

The full backtracking by default is very useful, but often it isn’t really what you mean, so putting ~! and/or ~commit in the right places can dramatically improve your macro’s error messages.


jerome.martin.dev
2019-4-8 15:05:18

I didn’t get to use ~! yet, but I guess it’ll come handy when I start having explicit error messages everywhere in my macros.


lexi.lambda
2019-4-8 15:05:34

The #:commit option for syntax classes is also extremely useful, and I find it is usually what you want.


jerome.martin.dev
2019-4-8 15:10:44

I’ll check them out, thanks! Also, if you wonder what I’m working on to have such issues, the code is there: https://github.com/euhmeuh/rilouworld/blob/master/private/bundle/expander.rkt


jerome.martin.dev
2019-4-8 15:12:11

It’s only 200 lines long, with the tests, but it’s pretty dense, at least for me.


jerome.martin.dev
2019-4-8 15:24:52

@lexi.lambda There’s one thing I don’t quite get though: When using (~alt (~optional <foo>) <bar>) ..., the ellipsis is “eaten” by the ~optional clause. I can refer to <foo> without using the triple-dots, while <bar> requires them. Do you know how the ellipsis gets “assimilated” like that? I’m just being curious.


alexknauth
2019-4-8 15:36:53

A simpler example of this “eating ellipses” behavior also happens with ~once.


jerome.martin.dev
2019-4-8 15:42:36

I didn’t check the implementation code, but I suppose it eats up the depth of its arguments or something


alexknauth
2019-4-8 15:44:11

I would play around with using ({~alt {~once pat1} {~once pat2} etc.} ...) and use that for a list-no-order-like pattern


jerome.martin.dev
2019-4-8 15:47:18

Yeah that’s what I’m doing. I understand how it works and what it does. I just wonder what happens under the hood.


jerome.martin.dev
2019-4-8 15:47:49

I’d say a construction from primitives like ~or


jerome.martin.dev
2019-4-8 15:48:30

But I’m just to lazy to check the code :stuck_out_tongue:


lexi.lambda
2019-4-8 16:47:40

@jerome.martin.dev Ellipsis-head patterns are special. You should think of ~alt + ~optional/~once/~between as being sort of a single syntactic form, not two separate patterns nested inside one another.


lexi.lambda
2019-4-8 16:48:45

Essentially, ellipsis-head patterns are designed to handle common scenarios of parsing “options” in macros, where certain options may appear at most once, but can appear in any order.


lexi.lambda
2019-4-8 16:50:02

So when you use ~once, that is saying to syntax/parse “for this particular ~alt sequence, this particular pattern needs to parse exactly once, but it can appear anywhere in that sequence”.


lexi.lambda
2019-4-8 16:51:01

So ~once and ~alt cooperate with one another. They aren’t really separable.


lexi.lambda
2019-4-8 16:51:38

~optional is just like ~once, but it can also parse zero times.


lexi.lambda
2019-4-8 16:59:32

By the way, it is possible to make ~optional not “eat” the ellipsis by putting it into a context where it is parsed as a head pattern instead of an ellipsis-head pattern. So, for example, if you were to write {~alt {~seq {~optional <foo>}}} ..., then <foo> would be bound with ellipsis depth 1. But this parser is essentially guaranteed to be a bug, since {~seq {~optional <foo>}} is an ellipsis-head pattern that can match no terms. In theory, such a pattern could cause parsing to never terminate, in the same way that #px"()*" will never terminate because it will match the empty term forever. But syntax/parse helpfully makes it a runtime error for an ellipsis-head pattern to match nothing, so at least your program just crashes instead. :)


lexi.lambda
2019-4-8 17:00:24

(Though I think Racket actually makes #px"()*" an error, too, so similar idea.)


lexi.lambda
2019-4-8 17:01:39

In any case, the ~optional isn’t actually helpful there, since you could just write {~alt <foo>} ... and get the behavior you probably actually wanted, since the {~alt ....} already includes the notion that the match might not succeed, and it should try one of the other branches, instead.


jerome.martin.dev
2019-4-8 20:27:24

Thanks for that complete explanation! In fact, I need the (~optional) in my cases because I want the term to be present only once or never. But I get what you’re saying :slightly_smiling_face:


greg
2019-4-8 20:31:25

@samth @jeapostrophe Travis is stuck on a couple build jobs so I tried directly locally and https://mirror.racket-lang.org/ seems not able to connect (same w/o TLS)


samth
2019-4-8 20:31:53

@jbclements are you around?


jbclements
2019-4-8 20:59:07

I’m here, yes. I’m teaching in five minutes, though.


jbclements
2019-4-8 21:00:35

I’ve been waiting for all Hell to break loose on this part of the build process, so I won’t be surprised by things going wrong. I’m also unable to ssh to winooski right now, though I thought it might be a fail2ban issue.


jbclements
2019-4-8 21:02:43

@greg Greg, are you saying that you’re not able to connect to mirror.racket-lang? If so, I agree. @samth, is mirror hosted by winooski? Also, happy to take this to DM.


samth
2019-4-8 21:03:59

@jbclements yes, mirror is winooski


samth
2019-4-8 21:04:15

and I was assuming based on the date that the build process had crashed it


jbclements
2019-4-8 21:05:18

That seems likely to me. I ran the build process under a tmux session, which doesn’t seem likely to have crashed it, but it’s at least possible. Also, pinging @stamourv here. In fact, speaking of ping, winooski still responds fine to ping.


jbclements
2019-4-8 21:05:39

So: Is it uncommon for winooski to go down on a build? Independently, what’s involved in bringing it back up?


jbclements
2019-4-8 21:08:14

Sigh. Off to class, back in 2 hours.


samth
2019-4-8 21:11:00

@jbclements winooski should never go down — currently no one can download racket in the default way


samth
2019-4-8 21:11:14

so this is quite bad


stamourv
2019-4-8 21:26:34

FWIW, I cannot ssh to winooski.


stamourv
2019-4-8 21:26:56

Will ping Stephen + mgmt.


pocmatos
2019-4-8 21:39:20

Do we need another racket mirror? I would be happy to host a racket mirror in Europe - Germany.


stamourv
2019-4-8 21:56:07

@pocmatos: The other mirrors should be up.


leif
2019-4-8 21:56:33

@mflatt or @robby Do either of you know if there is any reason we couldn’t break off event% into something like racket/event, and have racket/gui/base re-export it? (Like with racket/draw)?


stamourv
2019-4-8 21:56:36

But in general, though, another mirror could maybe be useful, I don’t know.


stamourv
2019-4-8 21:56:49

@mflatt or @robby would know, though.


leif
2019-4-8 21:59:27

I ask because i seems like its mostly just a container class for…well mostly symbols. And it would be useful to use in places where you can’t initialize racket/gui/base (for the second time).


mflatt
2019-4-8 23:49:29

I don’t remember any particular obstacle.


greg
2019-4-8 23:54:08

http://mirror.racket-lang.org\|mirror.racket-lang.org seems to be back up again, thanks to whomever intervened!


greg
2019-4-8 23:56:31

A CDN that knew to try alternate origin servers — so the one URL still worked somehow — would be wonderful, but possibly not within PLT budget.


samdphillips
2019-4-9 00:16:26

I did a naive guesstimate for AWS cloudfront and got about $90/month


samdphillips
2019-4-9 00:20:50

although within AWS using S3 with cross-site replication is probably a simpler set up.


asumu
2019-4-9 00:50:31

Is there a standard technique for encoding eval contexts in redex with a specific nesting depth? (e.g., the kind of thing where E_k has k nesting levels of some pattern, say)


samth
2019-4-9 01:08:49

@greg the major problem is that CDNs mostly don’t like/charge a lot for the size of the downloads


samth
2019-4-9 01:09:16

That’s why they’re not just on S3 like everything else


samth
2019-4-9 01:14:50

Another way of putting it is that the free unmetered 10G Ethernet jack in my office is worth a lot of money


thegobinath
2019-4-9 05:34:17

What is the most popular racket based web framework?


thegobinath
2019-4-9 06:24:46

Something like Ruby on Rails?