githree
2017-9-1 07:02:19

@samth it has been reported on 2nd of August: https://github.com/racket/drracket/issues/131


toblux
2017-9-1 11:33:43

Could anyone with more experience using WebSockets and custodians take a look at this issue https://github.com/tonyg/racket-rfc6455/issues/7 and the corresponding pull request? Thanks. /cc @tonyg


samth
2017-9-1 13:54:53

@githree If that’s your report, more detail would be great


githree
2017-9-1 14:01:22

@samth is there a way to force the migration again (I have all packages migrated now) or do I need to reinstall Racket?


samth
2017-9-1 14:02:12

@githree I’m not sure


githree
2017-9-1 14:02:36

Ok, I will try reinstall


githree
2017-9-1 15:35:12

@samth it appears some individual package installation is sufficient to crash DrRacket - I just did it with installing racketscript from gui


githree
2017-9-1 15:35:29

more details on the github issue


samth
2017-9-1 15:35:35

great, thanks


samth
2017-9-1 15:35:53

what happens if you remove and then reinstall that pkg from the command line with raco pkg install?


githree
2017-9-1 15:40:59

command line install works with no problem/no errors


samth
2017-9-1 15:41:08

ok good to know


githree
2017-9-1 15:58:44

@samth I’ve just tried to install Racketscript from command line again this time with no administrative rights for cmd.exe - it resulted in access violation. If that’s the main issue then running DrRacket with administrative rights didn’t help to alleviate problem.


samth
2017-9-1 15:59:28

@githree I doubt that I can figure out further what’s going on — probably @mflatt or @robby would need to take a look, and I think they’re both traveling today


githree
2017-9-1 16:00:21

No worries - I am fine with my installation, just tried to narrow down the problem.


ryanc
2017-9-1 16:34:42

@notjack No, protect-out is for preventing untrusted/restricted code (eg in a sandbox) from importing things that would let them break out of the sandbox, crash the Racket process, etc. For example, ffi/unsafe and racket/unsafe/ops protect most of their exports (although it’s hard to tell from the source, since most of the exports are just re-provided from built-in modules). Were you thinking of syntax-protect instead?


notjack
2017-9-1 17:25:03

@ryanc ah yes that’s the one I was thinking of, I got the two mixed up


lexi.lambda
2017-9-1 18:28:03

I admit I don’t know the syntax arming system as well as I probably should. Hackett’s typeclass dictionary elaborator currently works by recursively taking syntax objects apart and putting them back together again, and I’m pretty sure that will break on code that refers to macros that use syntax-protect.


abmclin
2017-9-1 18:29:33

I’d be interested in any references explaining the motivating reasons for having a syntax arming system, I’ve browsed through the online documentation but don’t really understand the purpose of having such a feature.


abmclin
2017-9-1 18:30:28

It seems weird to me that syntax could be dangerous but then you have people hacking strange things people least expect to be a threat


lexi.lambda
2017-9-1 18:32:12

The purpose is so that macros can serve as safe abstraction barriers. For example, a macro can expand to some identifier that is not exported by a module, call it private-id. The module that defines the macro may expect that users will never be able to call private-id directly, since the macro enforces some invariants that could be broken if private-id were invoked on its own.

A naughty/malicious user could expand a use of the macro using local-expand, then break the syntax object apart and pull out the private-id syntax object. That identifier could then be placed within another syntax object, allowing the malicious user to use private-id without conforming to the invariants enforced by the macro.


lexi.lambda
2017-9-1 18:33:19

The syntax arming system prevents that from happening, since the macro author can protect the syntax object with a code inspector that a malicious user will not have access to. That way, breaking apart the syntax object will taint the resulting syntax, and the user will not be able to get access to private-id by cheating.


abmclin
2017-9-1 18:33:24

ahhh that finally makes sense to me


abmclin
2017-9-1 18:33:54

so that’s how macros are able to prevent users from abusing their own identifiers that are created at expand sites


abmclin
2017-9-1 18:34:55

I thought that was all due to module system being able to prevent private identifiers from being exported or otherwise used not as prescribed by macros but I’m now seeing that syntax arming has a role to play regarding that.


notjack
2017-9-1 18:35:40

imagine if you exported a function and someone was able to inspect it and get all internal helper functions it called, and then call those helpers directly while skipping contracts and the module system, and they could do that without reflection


lexi.lambda
2017-9-1 18:36:25

Yes. The tricky thing is that Hackett’s elaborator needs to walk an entire syntax object and replace certain bits of it. The current implementation is sort of a hack.


lexi.lambda
2017-9-1 18:36:41

I think I might be able to do something by explicitly disarming/rearming syntax, but I don’t know how to arrange to have the right code inspector.


notjack
2017-9-1 18:37:03

@lexi.lambda do you think defining typeclass methods as syntax parameters might get around that? so the elaborator could parameterize them to the expected types?


notjack
2017-9-1 18:37:13

or using a syntax parameter to communicate with the methods indirectly


abmclin
2017-9-1 18:37:42

ok then one would apply a syntax guard/armor or whatever it is, to those private internal identifiers that are inserted at expansion sites, to prevent users from being able to directly use those identifiers? The armor system automatically detects non-legal use or does macro has to inspect to verify identifiers are being properly used along with assistance of the armor system? I recall seeing something about syntax being tainted(able)


lexi.lambda
2017-9-1 18:38:29

@notjack The trouble is that the elaborator has to run after typechecking, and typechecking is expansion. The constraint solver looks at fully-solved types, which are only known after the typechecker finishes its primary pass.


lexi.lambda
2017-9-1 18:39:16

So what I really want is a delimited/multi-phase expansion process. I want to be able to tell local-expand to expand something recursively, but stop when it sees a certain identifier. Currently, that isn’t possible.


lexi.lambda
2017-9-1 18:40:03

The stop-list argument to local-expand sounds like what I want, but using the stop list prevents the macroexpander from recursively expanding things like definitions.


lexi.lambda
2017-9-1 18:40:29

This is one of the main things I want to discuss in-person with some people at RacketCon. :slightly_smiling_face:


notjack
2017-9-1 18:40:44

good idea :P


abmclin
2017-9-1 18:41:04

indeed, sounds like one of those that are best solved with in-person help


lexi.lambda
2017-9-1 18:41:55

@abmclin Yes, the macroexpander will “taint” armed syntax objects that are pulled apart (using syntax-e) without first being disarmed. Tainted syntax objects cannot be used in the expansion of a macro; the macroexpander will halt with an error.


lexi.lambda
2017-9-1 18:42:38

Using the cute dye pack analogy, opening a syntax object without disarming the dye packs first causes the dye packs to explode.


abmclin
2017-9-1 18:42:50

whoosh! Very cute


lexi.lambda
2017-9-1 18:42:54

notjack
2017-9-1 18:43:08

racket folks love their analogies


abmclin
2017-9-1 18:43:12

haha yes, pretty much the imagery that’s occupying my mind


abmclin
2017-9-1 18:44:00

I’m guessing there’s no way for malicious users to disarm syntax. The macroexpander somehow arranges for the original macros to only be allowed to disarm syntax they create?


lexi.lambda
2017-9-1 18:45:03

That’s the part I understand less well. There is a hierarchy of code inspectors that have privileges to arm/disarm syntax objects, but I don’t fully understand how they work at the moment.


notjack
2017-9-1 18:45:20

completely unrelated: the static information bound by struct is a struct-info value and the docs for struct-info say not all of the predicate, accessors, and mutators might be known. When can that happen? I can only construct situations with struct where they’re either all bound or the transformer binding itself isn’t created. Does it only apply to “custom” infos and not those created by struct?


lexi.lambda
2017-9-1 18:45:28

lexi.lambda
2017-9-1 18:46:35

@notjack IIRC, it can happen if you use #:super super-expr instead of super-id, since #:super provides the superclass structure type via a dynamic runtime expression.


notjack
2017-9-1 18:47:12

@lexi.lambda that makes sense, but the dynamic expression would fall into the category of things that make custom infos and not things that use infos created directly by struct right?


abmclin
2017-9-1 18:47:52

@lexi.lambda thanks for the link


lexi.lambda
2017-9-1 18:48:00

@notjack Not necessarily. You can get access to the struct info for a struct-defined structure as a runtime value by using the struct:struct-id identifier.


abmclin
2017-9-1 18:48:11

and for the clear explanation


lexi.lambda
2017-9-1 18:48:26

@notjack I think modern Rackets also make the struct id itself serve as a reflective struct-info object using the properties system, but I forget if that’s true or not.


notjack
2017-9-1 18:49:29

@lexi.lambda wait I think I just got it - the #:super option accepts the runtime reflective information (struct-type?) but the transformer binding has the static reflective stuff (struct-info?) and only the latter contains identifiers


lexi.lambda
2017-9-1 18:49:35

Right.


notjack
2017-9-1 18:49:42

those two categories of info should really be called out more in the docs


lexi.lambda
2017-9-1 18:50:10

The docs for structs are a little confusing. My guess is because the struct system has evolved a lot over the years. :)


notjack
2017-9-1 18:50:10

for one, it explains why you can’t get field names at runtime which I bet is surprising to a lot of racket folks the first time they find that out


lexi.lambda
2017-9-1 18:51:07

Structs, according to the Racket runtime, don’t have any notion of field names. If you look at make-struct-type, you will see it defines an accessor function that accesses fields by index.


notjack
2017-9-1 18:51:33

yes but lots of forms have the ability to do stuff with struct field names, they just do it at compile time with the reflective info


notjack
2017-9-1 18:51:47

it’s easy for people to not get that distinction, is my point


lexi.lambda
2017-9-1 18:51:49

Right. Struct accessors are a concept entirely defined by the struct macro, which adds a static information layer on top of the runtime values.


notjack
2017-9-1 18:52:49

and it’s even more confusing because the struct static info only uses “accessor” identifiers, the original “field” identifiers are not preserved, so forms like struct-copy will construct the accessors from the field names themselves


lexi.lambda
2017-9-1 18:53:06

Hmm, it looks like I was slightly wrong: modern Rackets do not make the constructor bound by struct a valid struct-type? value, only the struct:id identifier.


lexi.lambda
2017-9-1 18:53:33

And yes, struct-copy is totally broken.


lexi.lambda
2017-9-1 18:53:47

(Unfixably so.)


notjack
2017-9-1 18:54:10

I mean, there’s no way for struct to define accessors that don’t fit the struct id + field id pattern


notjack
2017-9-1 18:54:18

(I hope)



notjack
2017-9-1 18:55:13

yeah that


notjack
2017-9-1 18:56:09

I want to expose an api like struct copy in something though; guess that just means I need to provide an option to override the “inferred magic accessor binding” thing


notjack
2017-9-1 18:56:19

gross to use though


lexi.lambda
2017-9-1 18:57:42

I got deep into all this when I wrote syntax/parse/class/struct-id. :)


notjack
2017-9-1 18:58:13

which is exactly what I’m using right now that led to this :) thanks btw


notjack
2017-9-1 18:58:31

throwing some syntax classes in there for doing things with fields might be nice


notjack
2017-9-1 19:41:36

today is one of those days where I’m really grateful for syntax-parse :)


ben
2017-9-1 19:45:08

Leif and I sometimes talk about writing a Racket play


ben
2017-9-1 19:45:12

it wouldn’t be about Racket per-se


ben
2017-9-1 19:45:20

but all the characters would be from the Racket docs


ben
2017-9-1 19:45:44

plumbers, custodians, security guards, will executors


notjack
2017-9-1 19:50:29

it sounds like it would play out as a revolution by an under-appreciated working class


stamourv
2017-9-1 19:52:15

You need a breach of contract as a plot point.


notjack
2017-9-1 19:52:58

@stamourv slack needs a way to edit a message and make it point to the thread you meant to reply to :)


stamourv
2017-9-1 20:00:28

Threads?


notjack
2017-9-1 20:02:32

threads ;)


royall
2017-9-1 20:48:58

@royall has joined the channel


notjack
2017-9-1 21:13:03

@royall welcome!


abmclin
2017-9-1 21:17:24

In that case who would be the privileged class? Lambda, cond, struct, cons?


notjack
2017-9-1 21:19:16

clearly struct represents the existing social hierarchy


lexi.lambda
2017-9-1 22:14:43

I heard that some code inspectors were arming syntax objects. big if true


royall
2017-9-2 01:16:35

My employer has tasked me with giving a training presentation to my coworkers about 10 days from now. I think I’m going to build it with lang #slideshow


royall
2017-9-2 01:18:10

Hope this is a good idea