soegaard2
2020-10-22 07:14:40

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.

https://pygments.org/docs/formatters/


jesse.alama
2020-10-22 07:44:54

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


yfangzhe
2020-10-22 07:48:58

I will give it a try




spdegabrielle
2020-10-22 07:58:41

_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.]_


spdegabrielle
2020-10-22 07:59:12

(Quoting the linked post)


jesse.alama
2020-10-22 08:02:13

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


spdegabrielle
2020-10-22 10:33:24

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


greg
2020-10-22 13:12:08

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.


gknauth
2020-10-22 13:39:38

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


plragde
2020-10-22 14:19:26

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.


gknauth
2020-10-22 14:36:04

Speaking of nearness…


jestarray
2020-10-22 14:49:14

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


jesse.alama
2020-10-22 14:49:35

yes!


jestarray
2020-10-22 14:49:45

:open_mouth:


jestarray
2020-10-22 14:50:18

do i have to uninstall my bc version?


jestarray
2020-10-22 14:53:19

why is the binary 100MB bigger than bc ?


ryanc
2020-10-22 14:54:36

@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.


soegaard2
2020-10-22 14:55:09

You can keep bc.


soegaard2
2020-10-22 14:55:31

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


jestarray
2020-10-22 15:04:26

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


laurent.orseau
2020-10-22 15:09:23

Ha, that’s one for me.


laurent.orseau
2020-10-22 15:10:02

Does the given string points to an existing directory?


jestarray
2020-10-22 15:11:22

nope, not a valid directory


laurent.orseau
2020-10-22 15:12:19

that’s strange. Is your username a?


jestarray
2020-10-22 15:14:39

yeppers


laurent.orseau
2020-10-22 15:16:09

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


jestarray
2020-10-22 15:17:49

oh sweet! that solved it, thanks


laurent.orseau
2020-10-22 15:19:10

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


jestarray
2020-10-22 15:19:44

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


laurent.orseau
2020-10-22 15:36:33

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


laurent.orseau
2020-10-22 15:37:47

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.


laurent.orseau
2020-10-22 15:37:57

Any other option?


mflatt
2020-10-22 15:38:39

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


laurent.orseau
2020-10-22 15:38:59

ok great, thanks


mflatt
2020-10-22 15:39:39

(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.)


samdphillips
2020-10-22 15:49:30

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?


mflatt
2020-10-22 16:18:47

Yes, break-thread is usually better for that.


mflatt
2020-10-22 16:19:40

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


mflatt
2020-10-22 16:20:13

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


mflatt
2020-10-22 16:22:05

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).


samdphillips
2020-10-22 16:24:26

Ok, I’ll investigate using a custodian.


samdphillips
2020-10-22 16:33:43

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.


mflatt
2020-10-22 16:59:28

Yes, especially things like open files.


laurent.orseau
2020-10-22 17:51:30

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?


samdphillips
2020-10-22 18:27:41

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


samth
2020-10-22 19:41:57

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.


kellysmith12.21
2020-10-22 19:48:08

@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.


camoy
2020-10-22 20:02:48

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/


samdphillips
2020-10-22 23:34:51

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


samth
2020-10-22 23:59:45

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


mflatt
2020-10-23 01:20:53

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


winny
2020-10-23 01:34:18

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.


samdphillips
2020-10-23 02:09:38

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


notjack
2020-10-23 06:24:32

where do plumbers fit into this?


samdphillips
2020-10-23 06:30:00

Just flush outstanding data I thought?