pierre
2020-1-9 10:12:39

: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


pierre
2020-1-9 10:15:48

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


popa.bogdanp
2020-1-9 10:35:20

notjack
2020-1-9 10:47:33

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


soegaard2
2020-1-9 15:01:33

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.


soegaard2
2020-1-9 15:02:33

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


soegaard2
2020-1-9 15:03:56

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


soegaard2
2020-1-9 15:05:02

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?


soegaard2
2020-1-9 15:06:27

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



ryanc
2020-1-9 16:16:23

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.


gknauth
2020-1-9 17:11:18

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
2020-1-9 17:59:06

@joshua.e.cottrell has joined the channel


soegaard2
2020-1-9 19:44:35

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?


popa.bogdanp
2020-1-9 19:59:04

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.


popa.bogdanp
2020-1-9 20:01:19

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


soegaard2
2020-1-9 20:12:13

Thanks. That gives peace of mind.


plragde
2020-1-9 20:27:00

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?


plragde
2020-1-9 20:28:30

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


soegaard2
2020-1-9 20:28:39

But I better do some experiments too.


plragde
2020-1-9 20:30:34

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.


plragde
2020-1-9 20:32:02

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.


krismicinski
2020-1-9 20:32:03

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


krismicinski
2020-1-9 20:32:30

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


krismicinski
2020-1-9 20:33:28

the proof assistant thing sounds cool for sure.


krismicinski
2020-1-9 20:36:50

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



pierre
2020-1-9 22:25:13

thanks, looking!


pierre
2020-1-9 22:27:09

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