samth
2021-10-3 12:48:58

@sorawee congrats on the POPL paper



laurent.orseau
2021-10-3 13:10:16

“This paper presents the first formal framework for reasoning about the behavior of reusable symbolic evaluators.” “Rosette* replaces the semantic core of Rosette but keeps its optimized symbolic factory. Our results show that Rosette* matches the performance of Rosette across a wide range of benchmarks, while providing a cleaner interface that simplifies the implementation of client tools.”


laurent.orseau
2021-10-3 13:10:35

I don’t understand it all, but that sounds impressive :slightly_smiling_face:


ben.knoble
2021-10-3 13:29:49

Ooh :eyes: I need to take a look. Read a lot about rosette during my ms


sorawee
2021-10-3 17:30:53

Thank you very much :smile:


cperivol
2021-10-3 17:37:04

congrats! which one is it?


shu--hung
2021-10-3 18:04:21

@sorawee congrats and this is a great framework to have!!


chansey97
2021-10-3 18:34:18

I once watched Emina’s talk about rosette, its symbolic evaluators has a very clever approach which can avoid path explosion and generate compact encodings by properly merging states.


wjb
2021-10-3 18:40:24

I’m trying to run sandboxes in places, but when the sandboxes need access to racket/gui (such as through 2htdp/universe), they get cannot instantiate racket/gui/base' a second time. I’ve tried initing racket/gui once in the server that starts the places, but this doesn’t seem to work. (gui-available?) is still false in started places, and they still raise the exception when the sandbox tries to load the gui module. Any thoughts?


soegaard2
2021-10-3 18:42:39

It would be great to have an answer for this on the mailing list.

Is it time the “cannot instantiate racket/gui/base’ a second time” error got its own wiki-page?

@spdegabrielle


spdegabrielle
2021-10-3 18:43:57

I thought that was something you could do with units?


wjb
2021-10-3 18:49:14

Not really sure how units come into this.


spdegabrielle
2021-10-3 18:51:02

I’ll be honest I’m out of my depth- I thought I remembered someone using units to instantiate gui a second time for tricksy testing.


wjb
2021-10-3 18:52:30

I don’t really WANT to instantiate gui a second time, I just want it available to sandboxes in N different places.


spdegabrielle
2021-10-3 18:52:30

I’m guessing you have a hand in server that needs to run student submissions that call gui


wjb
2021-10-3 18:53:06

Yeah. and we have a lot of students hammering it so we’re trying to parallelize to increase throughput.


spdegabrielle
2021-10-3 18:54:03

I’ll try find the mention I saw


shu--hung
2021-10-3 19:08:47

Maybe others have better answers — but places have separate Racket VM instances, so I guess it is not possible to share the instantiations of racket/gui across places


spdegabrielle
2021-10-3 19:12:13

I’m assuming it does have a virtual display xvfb-run racket -l handin-server


wjb
2021-10-3 19:14:02

yes


spdegabrielle
2021-10-3 19:14:07

And I think it dynamic-require‘s in each student program.


wjb
2021-10-3 19:14:39

Just runs a sandbox evaluator on it, whatever that does.


wjb
2021-10-3 19:24:22

Hm it looks like there’s some difference in behaviour between macOS and other platforms… “on Mac OS, the sole instantiation of https://docs.racket-lang.org/gui/index.html\|racket/gui/base must be in the process’s original https://docs.racket-lang.org/reference/places.html#%28tech._place%29\|place.” https://docs.racket-lang.org/gui/Startup_Actions.html


wjb
2021-10-3 19:24:26

Not sure what this means exactly


shu--hung
2021-10-3 19:26:35

I think that’s because Mac’s event loop has to be from the main thread, while other platforms don’t have this constraint


shu--hung
2021-10-3 19:32:47

These three don’t seem to work together: • Places can’t share module instantiations (my guess) • racket/gui can be instantiated exactly once per process • Places by default run in the same process


wjb
2021-10-3 19:35:27

Is there a way to make a place run in a different process?


spdegabrielle
2021-10-3 19:39:04

I don’t think so: “A place is a parallel task that is effectively a separate instance of the Racket virtual machine, although all places run within a single operating-system process. “ https://docs.racket-lang.org/reference/places.html\|https://docs.racket-lang.org/reference/places.html


spdegabrielle
2021-10-3 19:43:27

wjb
2021-10-3 19:44:10

Hm, so I don’t seem to have the same issue on linux, only on macos. places executes the sandbox just fine.


spdegabrielle
2021-10-3 19:44:39

Sounds like good news?


wjb
2021-10-3 19:45:02

.. maybe .. unless I’ve just masked the error somehow…


wjb
2021-10-3 19:46:36

Yeah nevermind, I didn’t set things up right.


spdegabrielle
2021-10-3 19:46:37

I’d like to make a Handin server page on the wiki. With advice like ‘avoid macOS for 2htdp/universe’ (if true) and ‘start a virtual display with xvfb-run racket -l handin-server


shu--hung
2021-10-3 19:47:28

Nice! I’m trying places and racket/gui on Linux but it doesn’t work. Didn’t thought about sandboxes.


shu--hung
2021-10-3 19:48:06

And I’ve heard of distributed places but that’s all I know :disappointed:


wjb
2021-10-3 19:48:17

No it still doesn’t work on linux; something else in the server wasn’t setup correctly and it masked the gui error.


shu--hung
2021-10-3 19:49:37

I copied something from the Racket Guide #lang racket/base (require racket/place racket/place/distributed) (define rems '()) (for ([i (in-range 3)]) (define rem (spawn-remote-racket-node "127.0.0.1" #:listen-port (+ 1234 i))) (set! rems (cons rem rems)) (displayln rem) (define pl (supervise-place-at rem "get-gui.rkt" 'go)) (sleep 2)) and this produces logs ~$ cat get-gui.rkt #lang racket/base (require racket/gui racket/place racket/os racket/system) (provide go) (define (go chan) (with-output-to-file "get-gui-txt.log" #:exists 'append (lambda () (printf "in go ~s!\n~s\n\n" (getpid) chan))) "go!")


wjb
2021-10-3 19:54:33

ugh. that would require a lot of additional rewriting…


wjb
2021-10-3 19:55:12

Might be easier to provide a fake gui or universe library to the sandbox.


spdegabrielle
2021-10-3 19:58:37

You gotta ask this on racket users- there must be more educators who use handin with 2htdp/universe programs


spdegabrielle
2021-10-3 19:58:47

Sorry I was no help


wjb
2021-10-3 20:02:57

No worries, thanks for the support


spdegabrielle
2021-10-3 20:04:11

Please let me know when you solve it so I can add a handin server page to the wiki


wjb
2021-10-3 22:46:53

Well we’ve deployed and it seems to be working. Adding a 2htdp/universe override to the overridden collections seems to be the way to go. It would be nice if handin came with that in its overridden-collects.


joel638
2021-10-4 01:44:39

@joel638 has joined the channel


greg
2021-10-4 01:58:35

I’ve struggled with this in Racket Mode over the years.


greg
2021-10-4 02:00:01

One approach, which I did for a long time, was to use a custom module name resolver to catch the first such attempt to use racket/gui/base when the user runs a program, stop, require it in Racket Mode’s main namespace, then restart the user’s program. So a “lazy” approach.


greg
2021-10-4 02:01:52

More recently, I’ve been eagerly requiring it on startup, then, using namespace-attach-module to attach it to the namespace initially used for a REPL or a module->namespace.


greg
2021-10-4 02:02:09

There are pros and cons, different edge cases, each way.


greg
2021-10-4 02:04:20

The gist of the latter approach is here: https://github.com/greghendershott/racket-mode/blob/master/racket/gui.rkt (although some of the edge cases are handled in repl.rkt and interactions.rkt).


greg
2021-10-4 02:05:41

Oh, sorry, I think I overlooked the wrinkle that you’re using places.


greg
2021-10-4 02:08:10

So, places count as “a single Racket process”, but as @spdegabrielle already pointed out distributed places could work… but as @wjb already said that would be a bigger change. So, never mind me, sorry. :disappointed:


samth
2021-10-4 02:22:10

Was there a resolution here? Is it something anyone else needs to worry about?


wjb
2021-10-4 02:28:31

No worries. For what it’s worth, I had already looked at racket mode and tried to see if a similar approach would work with places. That answer seems to be no. I think I’d need namespaces to be serializable and allowed over place channels, which.. doesn’t sound like a sensible thing.


wjb
2021-10-4 02:30:48

It seems the issue has resolved itself (locally that seems to have happened on my machine), or @mflatt was able to fix the pkg-build server by modifying the trust store as discussed above (the package server seems to be able to access the offending servers again).


wjb
2021-10-4 02:31:25

So I don’t see an urgent reason that anyone else needs to worry about this for now.