
The docs of scribble-minted
says, that the “LaTeX, PDF, and HTML backends” are supported.
One option is to produce a pdf then convert it to a pict or a bitmap and the use it in the Slideshow. The package racket-poppler
has an page->pict
which turns a pdf page into a pict or a bitmap. Alternative you can call out to an external converter program.
Hmm. Looking at the docs of Pygments I see it can output images directly. The simplest might be to write your own library that calls out to Pygments in order to produce a png.

@kellysmith12.21 sounds cool! Can you share a link?

I will give it a try



_We also explain the derivative again (with less academic prose), and release our latest implementations in Racket, Scala and Haskell.
[The Racket implementation minimizes the use of laziness, and it abstracts away the impure parts (caching and computing fixed points) behind a purely functional interface: define/memoize and define/fix.]_

(Quoting the linked post)

wow, in the blog post Matt makes the reviews of the rejected paper available.

you should check out the rest of the blog. Lots of good stuff. Probably needs to be posted on racket-stories

I got a chance to meet Matt once, and told him I enjoyed the concise but clear writing style of his articles. IIRC he told me it’s because they originate as lecture notes.

What would the true value of pi
look like, except maybe π ?

Well, π does not really exist, it’s just a convenient fiction. Usefully? Perhaps a function that consumes a “nearness” parameter (for some definition of “nearness”) and produces a rational number.

Speaking of nearness…

if i download racketcs, is drracket also built in it?

yes!

:open_mouth:

do i have to uninstall my bc version?

why is the binary 100MB bigger than bc ?

@kellysmith12.21 I have a repository with a cleaned-up version of the original parsing-with-derivatives code here: https://github.com/rmculpepper/racket-derp/. (The only official code I could find was buggy and incomplete.) The repo also contains alternative versions with explicit promises (xp) and explicit rec nodes (xr), which I created to help demystify the magic of memoize, fix, and laziness.

You can keep bc.

I think CS contains machine code which is larger than bytecode.

ahh ok. i keep getting this error on startup now with cs

Ha, that’s one for me.

Does the given string points to an existing directory?

nope, not a valid directory

that’s strange. Is your username a
?

yeppers

Can you try creating this directory and see if the error message still comes up?

oh sweet! that solved it, thanks

excellent. If you see any more problem with quickscript, please do notify me :slightly_smiling_face:

is Shallow Typed Racket part of typed racket ? or is it a different language entirely? im not sure where to get it and use it

What’s the best way to register a procedure to be executed when Racket exits, even if it crashes?

I could use with-handlers, but I need to make sure I catch all exceptions, and it doesn’t seem to be the right approach. There’s also register-custodian-shutdown
, but the fact that it comes from ffi/unsafe
is a bit scary.

Any other option?

No, that’s the only way to register something that is run on exit.

ok great, thanks

(By “even if it crashes”, I assume you mean “even if the program exits due to an unhandled exception”. If there’s a crash at the runtime level or a SIGKILL
, then there’s no way to recover.)

Similar question that I’ve been mulling over, if I have a thread that runs some library code and potentially needs to do some sort of cleanup, should I prefer break-thread
over kill-thread
since the former will run exit winders etc?

Yes, break-thread
is usually better for that.

On second thought, probably using a custodian and custodian-shutdown-all
is better.

In other words, I went from recommending break-thread
to right past kill-thread
to something even stronger.

Not coincidentally, that reflects Racket implementation history: We invested a lot into making break-thread
work well, but it turns out to be difficult to write library functions that play nicely with break-thread
. The advantage of kill-thread
is that it doesn’t need cooperation (and, in a useful sense, doesn’t even allow cooperation).

Ok, I’ll investigate using a custodian.

So using custodian-shutdown-all
would be like using kill-thread
but the managed code should register with the custodian any resources that need to be properly freed.

Yes, especially things like open files.

Would it be worth automatically assigning a custodian to a new thread, and provide a kill-thread/clean function that basically calls custodian-shutdown-all on the thread’s custodian?

I’m thinking about how you may handle a “remote” resource that needs some sort of explicit “deallocation call” now.

It’s not 100% clear exactly where all the extra space goes, but much of it is for optimized machine code which takes up more space than (less-optimized) byte code.

@ryanc Thank-you. It’s the interaction of memoize, fix, and laziness that left me confused; being able to read the alternative implementations will help.

You might also be interested in recent follow up work that improves the performance of PwD significantly: https://michaeldadams.org/papers/parsing-with-zippers/\|https://michaeldadams.org/papers/parsing-with-zippers/

Is there anything like raco run-submod file.rkt submodule-name args ...
?

@samdphillips no but it would be nice to have (or a command line option to racket
)

You can use raco test
for that, although it’s not the most convenient interface

Hi! Can anyone recommend some Racket codebases that use event-driven loops? I’m writing a publish/subscribe or observer pattern event system (or find one) to use in an IRC/Discord/whatever bot.

Ok this was a few minutes of work. https://github.com/samdphillips/raco-run

where do plumbers fit into this?

Just flush outstanding data I thought?