mbelkin
2018-2-19 09:37:37

@mbelkin has joined the channel


pnwamk
2018-2-19 15:01:29

has anyone else had the experience that DrRacket usage is very “broken” on newer Ubuntu versions (i.e. those using Wayland) and had to switch back to the X Window system to make it tolerable?



mflatt
2018-2-19 16:12:46

It makes sense that racket/gui still has problems with Wayland. It just needs more work. (Ubuntu 18.04 is switching back to Xorg, though.)


mflatt
2018-2-19 16:16:37

@samth, @pnwamk and others: How much does TR depend on the internal protocol for optional arguments, as exposed by expansion? I’d like to switch from a pair of arguments for optionals – the value and a boolean indicating whether the value is meaningful – to a single argument with unsafe-undefined to mean that argument wasn’t supplied. In common cases where the default expression is an immediate, the immediate can be used instead of unsafe-undefined, and then a callee-side test can be removed.


pnwamk
2018-2-19 16:18:23

@mflatt w.r.t. Wayland/Xorg — I had not noticed Ubuntu had decided to use Xorg for the next LTS release. That greatly lowers the priority if the issue for me :smiley: Thanks for the info!


pnwamk
2018-2-19 16:25:55

@mflatt I’m not intimately familiar with the code that handles optional args (and I didn’t deal with having to write it the first time), but I’ve poked around in there some and my sense is we’d have to rewrite most/all of it to support the new protocol. From your description, it doesn’t sound like it would be too difficult to cope with the new approach… it’s just one or two modules.


pnwamk
2018-2-19 16:26:16

(only 400 LOC in kw-types, for example)


mflatt
2018-2-19 16:36:27

Can you point me to the right module?


mflatt
2018-2-19 16:38:17

I’m looking at “tc-lambda-unit.rkt”, but maybe that’s not the right place.


pnwamk
2018-2-19 16:39:45

yah it’s tucked away…


pnwamk
2018-2-19 16:40:00

in kw-types.rkt:



pnwamk
2018-2-19 16:40:42

there’s code that converts types from what a user would see (i.e. an arrow with an optional argument) into what the actual expanded definition would have (i.e. an arg-flag and the arg itself)


pnwamk
2018-2-19 16:41:17

(there’s a few helper functions in there that would have to be updated to reason about Undefined, etc)


pnwamk
2018-2-19 16:43:08

Yes and I think you’re right, there would need to be tweaks in tc-lambda-unit.rkt probably, e.g. this code is explicitly reasoning about the flags that currently exist:



samth
2018-2-19 16:44:33

@mflatt I agree with @pnwamk — the code would have to change, but it sounds like it would be reasonably easy to adapt


samth
2018-2-19 16:45:40

Actually, thinking about it more, we would have to think about what the semantics of unsafe-undefined are in TR


samth
2018-2-19 16:46:02

IE, is it included in the Any type


samth
2018-2-19 16:46:25

So there might be a bit of complication


samth
2018-2-19 16:46:41

But it ought to be doable


pnwamk
2018-2-19 16:47:32

Is this a fundamentally different “undefined” than the one we’re already reasoning about here: https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/rep/base-types.rkt#L191


pnwamk
2018-2-19 16:48:36

@samth ^


samth
2018-2-19 16:53:27

Yes, those are different values


mflatt
2018-2-19 16:54:52

I’ve pushed the revised protocol to the newopt6 branch of <http://github.com:mflatt/racket\|github.com:mflatt/racket> Do you have time to look at adapting TR? I imagine we’d have to sync Racket and TR changes.


mflatt
2018-2-19 16:55:50

As you may expect, this is motivated by racket7 and looking that things that provide even a tiny improvement in the hope that the tiny improvements add up


samth
2018-2-19 16:56:48

I will try to look this evening, not sure about @pnwamk


samth
2018-2-19 16:57:45

If you can just post a snippet demonstrating the protocol, especially if you make a stab at typing it in TR, that would be very helpful


mflatt
2018-2-19 17:05:17

mflatt
2018-2-19 17:10:51

If I define unsafe-undefined as 'unsafe-undefined, then TR is happy with (: f7 (Integer (U 'unsafe-undefined (Boxof Integer)) Integer Integer -&gt; (List Integer Integer Integer (Boxof Integer))))


mflatt
2018-2-19 17:13:20

I guess TR and the implementation of optional arguments may need to agree on which default-argument expressions mean that unsafe-undefined won’t happen. That’s currently defined by immediate-default? in “collects/racket/private/kw.rkt”