
@djholtby has joined the channel

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

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?

v8.1

does racket regexp support non-capture group?
In PCRE, x(?:abc)*y
matches xabcabcy
without reporting abc
separately.

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

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

ahh

thanks


np

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/

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?

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

- if some of them might have BC and some CS, then obviously you can’t have a variant-specific bytecode

- CS zo files are basically machine code and thus are not very portable

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

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


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.

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

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

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.

Thanks for the example!

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.

Great, thanks

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

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

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

I see it now!

@d.t.peters777 has joined the channel

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

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

thank you so much for taking the time to suggest these

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)

Sorry I meant to say slideshow

haha

no worries


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

You can certainly embed images in slideshow

I’m not sure exactly what your question is

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

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

For example, bitmap for embedding images

I’m not sure what embedding a link would mean

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

which is ….not important

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

You can make clickable elements in the slideshow

See the clickback function

so cool

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

fair enough

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