gkostejko
2020-12-4 08:52:25

@gkostejko has joined the channel


mflatt
2020-12-4 11:20:57

No. BC just doesn’t generate code as well as CS.


spdegabrielle
2020-12-4 12:07:38

It’s a shame you can’t set up an affiliate link - I’m going to buy a m1 Mac at this rate…


laurent.orseau
2020-12-4 13:05:56

When reading the docs, sometimes I discover a useful ‘new’ definition that dates back from 6.0.0… I feel like I’m missing most new stuff. How about new releases are accompanied with a automatically-generated brief that describes, since the last release: • all new documented definitions (“Added in version…”) • all documentation modifications (“Changed in version…”) ?


laurent.orseau
2020-12-4 13:16:16

(unrelated) When dynamic-require attempts to read/visit a module, it raises an exception if the module compiled with a different version of racket. Why doesn’t it fall back to doing as if the module wasn’t compiled at all instead?


capfredf
2020-12-4 13:40:14

how long does a clean build of Racket take? like make CPUS=4


wanpeebaw
2020-12-4 13:43:26

@mflatt Why make the program functional instead of using set! can improve performance so drastically?


mflatt
2020-12-4 13:44:33

Roughly, set!ed variables do not get put in registers.


samth
2020-12-4 13:44:51

Based on Cameron’s comment, it seems like they want it to work on Rosetta out of the box


laurent.orseau
2020-12-4 14:02:24

samth
2020-12-4 14:14:42

The short answer is that it’s often too late to go back to that


laurent.orseau
2020-12-4 14:17:17

hm. Is there a way to tell dynamic-require to not use compiled version, apart from deleting .dep files? If so, one could use it first normally, and then if a corresponding exception is raised, try again in not-compiled mode, no?


samth
2020-12-4 14:17:54

@ryanc has a package that handles this more transparently


soegaard2
2020-12-4 14:20:25

Great idea!


mflatt
2020-12-4 14:25:26

Oh, I see about Rosetta. Still, I’ll ignore that for now.


mflatt
2020-12-4 14:25:45

I’ll time builds more carefully when everything is set up right.


mflatt
2020-12-4 14:30:09

For anyone who uses 64-bit Intel Mac snapshots on Catalina: the ones generated at the Utah site are now notarized (like release builds).


laurent.orseau
2020-12-4 14:31:27

Would be great if we could even scout the docs to generate these retrospectively


mflatt
2020-12-4 14:39:08

In case anyone knows something about signing on Big Sur / AArch64, here’s something that still puzzles me: If I sign a “.dylib”, then I can load and use it. If I sign the “.dylib” and then copy it, the copy does not works. I can’t figure out where that state resides. It’s not shown by xattr, but it seems connected to the filesystem inode, because I have to delete the bad copy (not just overwrite it) before I can use the same path for a working “.dylib”. Where is that state stored? Is there some way to copy a signed “.dylib” outside of a framework and make it ok?


mflatt
2020-12-4 14:44:05

Alternatively, for my purposes: Is there a way to have shared libraries used unsigned dependencies? I know about com.apple.security.cs.disable-library-validation, but that doesn’t seem to apply transitively, even if I open the dependency manually with dlopen first.


samth
2020-12-4 14:48:42

Could this be related to the caching of the libraries? Or is the only for system libraries?


mflatt
2020-12-4 14:49:19

I think that’s only system libraries.


ryanc
2020-12-4 15:04:47

The package is called custom-load.


343519265
2020-12-4 15:07:38

I am surprised that in racketcs locally defined structs are much slower just because schemify lifts my functions.


mflatt
2020-12-4 15:08:21

It’s not just transitive dependencies. Some libraries work as unsigned with disable-library-validation, and some don’t, so I’m still missing something there.


mflatt
2020-12-4 15:11:08

Ah, no… the library I thought worked is just falling back to the system-wide library.


laurent.orseau
2020-12-4 15:20:39

Thank you both. @ryanc i’m not clear on the details, but it seems you check the deps before doing any work (which is probably the good general solution). Am I correct that this can be non-negligibly slower?

I was thinking about something more aggressive, in a particular case: I always call dynamic-require in a namespace I just created. So I could call dyn-req, and if it fails with a link error, I could just recreate the namespace and call it again with ‘load-from-source’ (while informing the user about using the fallback mode).

Am I missing something?


ryanc
2020-12-4 16:43:00

Yes, it’s probably slower. I haven’t measured how much.


laurent.orseau
2020-12-4 16:48:52

If my module requires racket, is it going to check every single dep file in the racket tree?


mflatt
2020-12-4 17:47:49

I’m less confused now on another point: It’s ok to copy a signed “.dylib”. It’s just that I wasn’t signing correctly (left out --timestamp) in the experiments where I tried copying.

The way a bad state gets permanently attached to an inode is still mysterious and a persistent source of confusion, but it’s less relevant.


mflatt
2020-12-4 17:50:09

I think the problem is that cp0 doesn’t know how to drop the registrations of a constructor function as a constructor for procedure-struct-constructor?, etc.


mflatt
2020-12-4 17:50:39

Instead of a (weak) take that has all constructors, a better approach would be to attach a tag to the code object for a constructor.


mflatt
2020-12-4 17:52:39

And one way to do that is to encode it in the name. That’s the way that methodness (for error reporting) is attached to a procedure, but that’s ugly.


mflatt
2020-12-4 17:53:46

It would be nice if code objects had a way of storing and reporting flags.


343519265
2020-12-4 18:05:36

Though it would be nice to eliminate unused struct registration, the problem I met is that struct operations fail to be inlined:https://github.com/racket/racket/issues/3535


mflatt
2020-12-4 18:12:45

Oh, I see what you’re saying


mflatt
2020-12-4 18:15:04

Schemify is implementing the rule that a local function never creates a closure if it’s only used in application position, because some Racket code relies on that performance. I guess a better rule would be that allocating a closure is ok if allocation is happening anyway.


dvanhorn
2020-12-4 18:27:50

I’ve got a gh action that is trying to run scribble, but I get “Unable to init server: Could not connect: Connection refused Gtk initialization failed for display “:0"” Any ideas what I need to do to get this to work?


jaz
2020-12-4 18:29:18

Possibly run the process under xvfb-run


samth
2020-12-4 18:29:44

Yes, that’s what I do. Note that it’s your code that uses the GUI (probably redex)


samth
2020-12-4 18:30:02

If that’s accurate, you could instead require redex/reduction-semantics


dvanhorn
2020-12-4 18:31:34

thanks — I need the GUI stuff because I’m using redex/pict


samth
2020-12-4 18:32:08

redex/pict ought not to need the gui, but maybe it does anyway


dvanhorn
2020-12-4 18:34:06

yeah, I have other redex repos that didn’t need this, so maybe I missed a require redex somewhere. In any case, it worked with xvfb-run.


johangwbasson
2020-12-4 18:51:59

@johangwbasson has joined the channel


cris2000.espinoza677
2020-12-4 20:14:35

has anyone encountered this error before while using #lang brag ? Encountered parsing error near #f (token 'no-tokens) while parsing #<path:C:\path\my-file.rkt> [line=#f, column=#f, offset=#f]


ckipp
2020-12-4 20:17:25

@ckipp has joined the channel


lupino8211
2020-12-4 20:47:22

Maybe run xhost +local:? Or export DISPLAY=:0?


mflatt
2020-12-4 20:51:59

I’m now mostly clear on how signing works, and it starts to seem workable overall. The most surprising piece of the puzzle was reimplementing codesign -s - for ad hoc code signing (to create embedding executables that will run locally without requiring codesign to be installed).

… but I’m now I’m unclear on how requiring executables to be signed accomplishes anything when it’s so easy to add an ad hoc signature.


samth
2020-12-4 20:54:01

Maybe it closes loopholes when a more restrictive policy is in place? Or maybe it lets them find you if you write malware?


hoshom
2020-12-4 21:09:26

#lang racket/base (define -c- (make-channel)) (define t (thread (λ() (let loop () (displayln 'HERE) (sync (thread-receive-evt)) (channel-put -c- (thread-receive)) (loop))))) (define t2 (thread (λ() (let loop () (displayln (channel-get -c-)))))) (thread-send t 2) (thread-send t 2) (thread-send t 2) (thread-send t 2) The above program prints 2 just once.

It prints ’HERE twice.

Is this a bug?

Creating the event once only doesn’t make a difference.

Racket CS, 7.9, Windows 10 64 bit.


hoshom
2020-12-4 21:13:54

I don’t generally expect bugs in this part of racket, but this really looks like one. Should I make an issue?


mflatt
2020-12-4 21:15:34

Are you running the program in DrRacket or with plain racket?


hoshom
2020-12-4 21:15:42

DrRacket


mflatt
2020-12-4 21:16:27

Oh, I think you meant to call loop in t2.


hoshom
2020-12-4 21:17:24

oh


hoshom
2020-12-4 21:18:02

Oh right, false alarm


hoshom
2020-12-4 21:18:15

Eh, false alarm. I wasn’t looping in the second thread.


sorawee
2020-12-4 21:26:39

One thing that is still mysterious to me is when to use #' vs when to use syntax/loc. I see people doing (syntax/loc this-syntax ...) a lot. Can’t that be the default for #'?


sorawee
2020-12-4 21:34:49

IIUC, say I have (define-values () 1). This is valid syntactically, but will error at runtime, using the source location of (define-values ...). So in principle, we only need to use (syntax/loc ...) for macros that could generate error like this?


sorawee
2020-12-4 22:06:00

By that, I mean, perhaps #' should tag the syntax object with a placeholder value, and if it’s not specified, the macroexpander will fill these placeholder with the original syntax location.


notjack
2020-12-5 00:00:09

Man I remember that alert. That was a wild day.


notjack
2020-12-5 00:15:37

I think I just hit a case like that with fancy-app the other day


greg
2020-12-5 00:34:57

Speaking of #' a.k.a. syntax: > If id is not bound as a pattern variable, then id as a template produces (quote-syntax id). Just today I made a mistake where I was renaming a pattern variable and missed an occurrence referring to it with #'. I do this once in awhile. (Also sometimes just make a typo in the first place.) As a result, then it’s just “some random piece of syntax with srcloc in the macro”. Sometimes the consequence is immediately obvious; sometimes it isn’t until the bogus srcloc turns out to matter.

Does anyone else make this mistake?


greg
2020-12-5 00:35:58

Today I made the mistake when changing some pattern variable names to be uppercase, thinking it would help avoid problems like this. Ironically. :smile:


greg
2020-12-5 00:37:11

I guess I’m just wondering out loud if a “strict” version of this would make sense, that fails loudly if id is not a pattern variable.


greg
2020-12-5 00:37:40

Or if I’m overlooking something really obvious, how other people avoid making this mistake.


notjack
2020-12-5 00:47:44

I definitely want a strict version


notjack
2020-12-5 00:47:50

I make that mistake all the time too


notjack
2020-12-5 00:48:28

343519265
2020-12-5 01:30:58

I would think a better place for it is just before closure conversion in chez


samth
2020-12-5 01:38:02

That’s an appropriate default if you assume that errors pointing to the source of the macro are always bad, but I don’t think that’s true


samth
2020-12-5 01:38:29

When I visited Naughty Dog, they talked about doing something like that


samth
2020-12-5 01:39:08

Because they assumed their macros were always correct and pointing to the implementation would not ever be helpful to show to a user


ryanc
2020-12-5 03:45:51

I haven’t read much about this, but an “ad hoc signature” seems to just be a hash of the contents. So it will only protect against modifications to the contents after the hash was attached—as long as the attacker doesn’t update the hash too. I wonder if the hidden inode state that you saw is some mechanism that attempts to prevent an attacker from just modifying the hash.


ggeneraux
2020-12-5 05:39:07

@ggeneraux has joined the channel


racket192
2020-12-5 05:39:39

@mflatt Thanks for your hard (and fast) work. Racket compiled perfectly on my M1 Mac when cloned from GitHub. All the packages built and DrRacket CS is running very nicely. Thank you!


sorawee
2020-12-5 06:25:04

I think this is just Big Sur being weird, not about M1. My Big Sur (Macbook Pro 2017) also goes backward too.


samth
2020-12-5 07:26:52

That’s really fast


lupino8211
2020-12-5 07:54:53

Guys, im stuck with creating language and don’t know what should i change in code to make it work… If someone have free time, can you please review what am i doing wrong?… Thanks! https://github.com/readysloth/REPLify