djholtby
2021-7-13 13:19:50

@djholtby has joined the channel


djholtby
2021-7-13 13:55:35

I’m having an issue with the rfc6455 package. When a client drops (user loses internet, closes tab, etc) it sometimes brings down Racket itself with a “attempted to reschedule a dead thread” error in atomic mode. The line number given is a break-thread call. Looking at the package code, it seems pointless (there is a will attached to the connection that breaks the connection’s thread when the connection is garbage collected, BUT the thread holds a reference to its owner strongly, so from what I understand it should be impossible for the connection to be collected unless the thread is dead).

The documentation doesn’t say one way or the other whether it’s OK to try to break a dead thread (though it feels like it should be ignored, like killing one that’s already dead? Or if not, raise an exception that can be recovered from, which should be mentioned in the docs) I tried myself by creating a thread, killing it, then breaking it, and I get an infinite loop of

exception raised by error display handler: internal error: tried to deschedule a descheduled thread; original exception raised: internal error: attempt to deschedule the current thread in atomic mode


mflatt
2021-7-13 14:13:57

That bug sounds familiar, and I think it has been fixed, but I’m having trouble remembering the details. Are you running v8.0 or v8.1?


djholtby
2021-7-13 14:24:51

v8.1


sorawee
2021-7-13 15:08:08

does racket regexp support non-capture group?

In PCRE, x(?:abc)*y matches xabcabcy without reporting abc separately.


laurent.orseau
2021-7-13 15:14:34

I think you can use (?:...) too


laurent.orseau
2021-7-13 15:16:27

with pregexp: https://docs.racket-lang.org/reference/regexp.html?q=pregexp#%28part._regexp-syntax%29 since <mode> can be empty according to the grammar


sorawee
2021-7-13 15:16:33

ahh


sorawee
2021-7-13 15:17:06

thanks



laurent.orseau
2021-7-13 15:17:23

np


mflatt
2021-7-13 15:36:49

I still can point to a specific fix, but it’s worth trying the pre-release v8.2 candidate at https://pre-release.racket-lang.org/


krismicinski
2021-7-13 16:01:48

Hi all, I’m looking to distribute some racket bytecode to my class for some projects where I don’t want to give them sources. I vaguely recall this (compiling to bytecode, handing it to students to drop in their dirs and use) being possible before cs, but is that still the case?


samth
2021-7-13 16:04:43

This is mostly still possible. There are a few complexities.


samth
2021-7-13 16:05:10
  1. if some of them might have BC and some CS, then obviously you can’t have a variant-specific bytecode

samth
2021-7-13 16:05:28
  1. CS zo files are basically machine code and thus are not very portable

samth
2021-7-13 16:05:56

what you want is to use “machine-independent bytecode”, which is effectively just the results of expansion


krismicinski
2021-7-13 16:07:24

Nice. Okay, yeah, when I saw “bytecode” I assumed it was some abstraction like JVM bytecode, didn’t realize it was not machine portable by design, but :ok_hand: :ok_hand: . I suppose giving the term post-expansion is probably a reasonble solution given that the class is very small and probably students won’t actively reverse engineer it



samth
2021-7-13 16:09:49

I think that running raco make with the env var mentioned there set will generate the zo file you want, but you may also want/need the --no-deps flag, or that might not work and you have to come back and ask more questions.


djholtby
2021-7-13 16:29:51

Same results: Welcome to Racket v8.1.900.1 [cs]. > (define t (thread (lambda () (thread-receive)))) > (kill-thread t) > (break-thread t) internal error: tried to reschedule a dead thread context...: body of top-level /home/djholtby/racket/8.2-test/racket/collects/racket/repl.rkt:11:26 > internal error: attempt to deschedule the current thread in atomic mode context...: /home/djholtby/racket/8.2-test/racket/collects/racket/repl.rkt:11:26


djholtby
2021-7-13 16:47:22

It seems specific to kill-thread, if the thread completes then no errors.


mflatt
2021-7-13 16:53:56

To create machine-independent bytecode, I recommend using raco cross with --compile-any.

If you run raco make with PLT_COMPILE_ANY set and you forget --no-deps, then bad things will probably happen to your installation.


mflatt
2021-7-13 16:55:37

Thanks for the example!


mflatt
2021-7-13 17:17:15

I’ve pushed a repair: https://github.com/racket/racket/commit/9f2cbab85b2757bc4a440a767a2e22c5dab9d0a4

I’m not sure whether this repair will make it into v8.2, but I’ll raise the issue with the release managers.


djholtby
2021-7-13 17:31:15

Great, thanks


soegaard2
2021-7-13 20:31:32

I got the error below on the build server. Is this an error in <pkgs>/racket-index/scribblings/main/private/manuals.rkt ?

raco setup: --- building documentation --- [16:12:07] raco setup: WARNING: bad 'scribblings info: '(("manual-flomat.scrbl") () ("Math and Science")) from: #<path:/home/root/user/.local/share/racket/8.1/pkgs/sci/flomat-doc> raco setup: running: <pkgs>/racket-index/scribblings/main/user/local-redirect.scrbl raco setup: running: <pkgs>/racket-index/scribblings/main/user/release.scrbl raco setup: syncing: <pkgs>/scribble-math/doc/scribble-math raco setup: running: <pkgs>/racket-index/scribblings/main/user/search.scrbl raco setup: running: <pkgs>/racket-index/scribblings/main/user/start.scrbl other-doc: contract violation expected: module-path? given: '(lib "Math and Science" "flomat-doc") in: the 1st argument of (->* (module-path?) (#:indirect (or/c #f content?) #:underline? any/c) element?) contract from: <pkgs>/scribble-lib/scribble/base.rkt blaming: <pkgs>/racket-index/scribblings/main/private/manuals.rkt (assuming the contract is correct) at: <pkgs>/scribble-lib/scribble/base.rkt:583.3 The build server log. https://pkg-build.racket-lang.org/server/built/fail/sci.txt The change that provoked the error: https://github.com/soegaard/sci/commit/489c8b013b999a12e4a80d18551915b1526e1ea7


mflatt
2021-7-13 20:38:36

I think you probably meant a different grouping, something like (("manual-flomat.scrbl" () ("Math and Science")))


samth
2021-7-13 20:40:23

But I agree that there’s probably some argument checking that manuals.rkt should do given the error message


soegaard2
2021-7-13 20:40:37

I see it now!


d.t.peters777
2021-7-14 00:33:44

@d.t.peters777 has joined the channel


d.t.peters777
2021-7-14 00:36:30

I know its late, but I can try again tomorrow, I’m doing a presentation in slideshow, and I’m curious if anyone can point me to the easy way to format math in a slide? pretty simple math, just logic, prop and FOL


samth
2021-7-14 00:53:13

I’ve done two different things. 1. Just use Unicode math symbols and regular text (or tt text) 2. Use latex and one of the packages for integrating scribble and latex


d.t.peters777
2021-7-14 00:55:21

thank you so much for taking the time to suggest these


d.t.peters777
2021-7-14 00:56:40

i’m guessing scribble is how to do more what I want to do, i was searching the docs trying to figure out how to embed links, pictures that weren’t generated, etc, and was coming away scratching my head. (as well as the logic formatting)


samth
2021-7-14 00:56:58

Sorry I meant to say slideshow


d.t.peters777
2021-7-14 00:57:41

haha


d.t.peters777
2021-7-14 00:57:45

no worries



d.t.peters777
2021-7-14 01:01:07

do you know if web links and external images are embedable as is in slideshow? or is everything generated


samth
2021-7-14 01:02:43

You can certainly embed images in slideshow


samth
2021-7-14 01:03:01

I’m not sure exactly what your question is


d.t.peters777
2021-7-14 01:04:12

sorry if that wasn’t clear, the question was in fact can I embed images/links in slideshow, I’m reading the docs and not seeing how exactly that’s supposed to happen


samth
2021-7-14 01:06:57

In general you just use whatever functions to construct picts that you want


samth
2021-7-14 01:07:08

For example, bitmap for embedding images


samth
2021-7-14 01:07:31

I’m not sure what embedding a link would mean


d.t.peters777
2021-7-14 01:07:58

ahh, fair enough, i meant a clickable link in the pdf output


d.t.peters777
2021-7-14 01:08:06

which is ….not important


d.t.peters777
2021-7-14 01:08:40

i also just realized that i never finished the tutorial, where a number of my questions will in all likelihood be answered


samth
2021-7-14 01:08:47

You can make clickable elements in the slideshow


samth
2021-7-14 01:08:55

See the clickback function


d.t.peters777
2021-7-14 01:09:04

so cool


samth
2021-7-14 01:09:14

But I don’t think there’s a way to produce links in pdf printed slides


d.t.peters777
2021-7-14 01:09:28

fair enough


d.t.peters777
2021-7-14 01:09:52

as long as I can embed my images, do my bullet points and make it through this talk, I’ll be fine