
:wave::skin-tone–3:, has anyone played with places, I’m finding that (place-channel-put
does send strings char-by-char and not as a whole single message. The documentation seems to imply this should be feasible https://docs.racket-lang.org/reference/places.html?q=place-channel-put#%28def._%28%28lib._racket%2Fplace..rkt%29._place-message-allowed~3f%29%29

It works by sending a hash and receiving two items when doing place-channel-get
, still

I use places to send strings around here:
The strings are sent as a whole, not char-by-char.

Made a neat macro for turning code-that-raises-exceptions into code-that-returns-results

I am reading up on database connection pools. The idea is to reuse database connections by keeping them in a pool. Keeping the database connection in a pool avoids repeated authorization.

But … what happens with the connections in the pool, if the database, say, goes off-line.

The only operation available on a connection-pool
is connection-pool-lease
, which obtains a connection from the pool (or creates a new one, if the pool is empty).

So let’s say I get a connection from the pool and discover that the connection is dead. How can I remove it from the pool?

Is the idea to create a new pool (and let the old pool become garbage collected)?


If a single underlying connection is dead, it should automatically get removed from the pool. But if there’s a persistent failure—that is, the pool’s new-connection-maker will never again succeed in producing a connection—there’s no way for the pool to discover that. I don’t remember what happens in that case; I’ll have to look at the code later.

When I run raco
on MacOS or GNU/Linux, everything’s fine, but on Win10 at work, I run into permissions problems. I have a project I’m working on, I’ll call NocAssist because it helps me diagnose problems when our NOC (network operations center) tells me something’s wrong. I have a bunch of tools I run using Racket that work great. That is, until I decided “Hey, I should write some Scribble documentation for all this stuff.” I created a .scrbl
file just to test the waters, typed raco setup
to see if it would build my local documentation, and then I got a lot of error messages having to do with lack of access. What puzzles me (see the log) is why my simple raco setup
would be trying to delete DrRacket.exe, mzc.exe, scribble.exe, …

@joshua.e.cottrell has joined the channel

The situation I am facing with Racket Stories is this:
Originally I created a single connection, stored it in a variable and kept using it. Worked fine with low traffic until the database for some reason was unavailable for a while. After a restart everything works again. But I would be better to avoid manual restarts.
Now I have introduced a connection pool from which the request dispatcher gets a connection. (I can’t use virtual connections since the database abstraction deta
uses prepare
and virtual connections doesn’t work with prepare). So I am wondering what happens if the database is temporarily unavailable. The request will get to the dispatcher, which will lease a connection from the pool (is there a way to test if the connection is live at this point?) and then at some point one of the database operations will raise an exception. This exception I can catch and then … produce an error page - but maybe also remove the connection from the pool?

When I was first working on matchacha, I tested some of these scenarios by listening for debug logs from the db library and manually killing the database and such.

db-lib
checks if the connection is live before it puts it back in the pool so in your scenario, the connection would never be returned to the pool and a new one would be made in its place when you try to acquire it.
https://github.com/racket/db/blob/master/db-lib/db/private/generic/connect-util.rkt#L284-L301

Thanks. That gives peace of mind.

This 2013 paper by Philip Guo (http://pgbovine.net/publications/Online-Python-Tutor-web-based-program-visualization_SIGCSE-2013.pdf) about http://pythontutor.com\|pythontutor.com mentions efforts underway to port the idea to other languages, including Racket. While some other languages currently appear on the linked page, Racket does not. Anyone know what happened?

(The model of computation, at least for the student languages, is different enough that I can see that it wouldn’t be a simple adaptation.)

But I better do some experiments too.

I have taught first-year courses using Racket (both regular and “advanced” versions), and a second-year logic and computation course where we use Racket to build a small proof assistant. I also cover Racket in fourth-year PL and I’ve used it in grad courses.

In the first-year advanced course, I do some algorithms/DS work. For example, I show them AA trees, implemented in Racket using pattern-matching.

I think they just haven’t added the necessary support yet, and it’s not totally clear whether racket would make this possible / easy.

I looked into adding ocaml a while back and it seemed pretty nonobvious, you need a way to mark each expression and then observe it’s entry / exit, iirc

the proof assistant thing sounds cool for sure.

Here’s the execution trace format—this is what you really need to add if you wanted to support Racket


thanks, looking!

I think this is passing a list
, and not a string directly