jlw
2020-12-16 14:28:19

@jlw has joined the channel


camoy
2020-12-16 14:45:44

Another possible solution, that doesn’t make use of dynamic-wind, would be a computational contract that prohibits calls to control operators: https://www.sciencedirect.com/science/article/pii/S0167642313002347\|https://www.sciencedirect.com/science/article/pii/S0167642313002347


camoy
2020-12-16 14:46:28

Racket doesn’t have an implementation of computational contracts, but it’s on my TODO list for next year :grinning:


kellysmith12.21
2020-12-16 14:52:04

I once made a very crude contract, in the same vein as a computational contract, that could be used to prevent a procedure from being called except in certain special forms.


kellysmith12.21
2020-12-16 14:53:44

But it sounds like computational contracts are what I need.


yilin.wei10
2020-12-16 15:50:10

Hello, does anyone have access to the code-listings for all the PoC’s talked about in http://mballantyne.net/publications/extdsls-oopsla2020.pdf? I tried sleuthing on Michael’s github and was able to find ee-lib , and a few others but was wondering whether there was anything else?


samth
2020-12-16 15:55:01

yilin.wei10
2020-12-16 15:56:28

Fantastic! I’ve never seen Zenodo before.


samth
2020-12-16 18:42:14

jxonas
2020-12-16 19:06:19

Hi there! Is it possible to have parallel queries in SQLite? For instance, in the snippet bellow I’m querying in a thread and it takes 45s seconds to complete. #:use-place #t ensures this thread does not block and I’m able to immediately issue another query, but this second one waits for the completion of the first…

Thanks in advance!

(define conn (virtual-connection (lambda () (sqlite3-connect #:database "/my/database/file.db" #:use-place #t)))) ;; takes 45 seconds to return a value (void (thread (lambda () (query-value conn "select count(*) from my_expensive_view")))) ;; connects immediately, but returns a value after 45s (query-value conn "select sqlite_version()")


laurent.orseau
2020-12-16 19:37:23

Did you start estimating of how many coder×weeks this should take to upgrade Racket/gui?


samth
2020-12-16 19:37:54

My initial estimate is “a lot”


laurent.orseau
2020-12-16 19:38:42

yeah, sounds like it… :confused:


laurent.orseau
2020-12-16 19:39:46

Reading the list quickly, what gets printed on my retina is “Stop using Gtk…”


samth
2020-12-16 19:41:47

Well, GTK2, which is just now EOL, is 18 years old, which would suggest that we have at least 7 more years of support for GTK3.


laurent.orseau
2020-12-16 19:51:20

Hopefully, in the meantime those who have transited will provide useful feedback on how to make this process less painful


capfredf
2020-12-16 20:36:31

Good afternoon, my macro fellows, is it possible to match at least 1 - using syntax-case? (foo-macro 10 --------- 20)


samth
2020-12-16 20:38:24

You can write arbitrary code, so yes.


samth
2020-12-16 20:41:38

#lang racket (define-syntax foo-macro (lambda (stx) (syntax-case stx () [(_ n1 dash n2) (and (identifier? #'dash) (regexp-match "^-+$" (symbol->string (syntax-e #'dash)))) #'(list n1 n2)] [_ #'#f]))) (foo-macro 10 --- 20) (foo-macro 10 +++ 20)


capfredf
2020-12-16 20:45:20

Ah, I see. Thanks! I am spoiled by syntax-parse


badkins
2020-12-17 00:20:58

Is it normal for raco pkg install graph to take 30+ minutes of CPU time ? I think all of the other packages I’ve installed have been relatively quick. I’m on Racket v7.9 [cs] if it matters.


sorawee
2020-12-17 00:22:35

Mine finished in 26s, on Macbook Pro M1


soegaard2
2020-12-17 00:23:04

soegaard@mbp2 ~ % raco pkg install graph raco pkg install: package is already installed package: graph Was instantaneous here :wink:


sorawee
2020-12-17 00:23:09

lol


badkins
2020-12-17 00:23:09

Ok, it must be stuck then :(


badkins
2020-12-17 00:23:40

raco setup: 7 making: <pkgs>/collections-lib/data raco setup: 7 making: <pkgs>/collections-lib/data/collection raco setup: 6 making: <pkgs>/functional-lib/data raco setup: 5 making: <pkgs>/gen-queue-lib/data raco setup: 5 making: <pkgs>/gen-queue-lib/data/gen-queue raco setup: 4 making: <pkgs>/graph-doc/graph raco setup: 3 making: <pkgs>/graph-lib/graph raco setup: 2 making: <pkgs>/graph-test/tests raco setup: 1 making: <pkgs>/syntax-macro-lang/tests raco setup: 1 making: <pkgs>/syntax-macro-lang/tests/syntax raco setup: 1 making: <pkgs>/syntax-macro-lang/tests/syntax/macro-lang raco setup: 4 making: <pkgs>/graph-doc/graph/scribblings raco setup: 7 making: <pkgs>/collections-lib/data/collection/experimental raco setup: 7 making: <pkgs>/collections-lib/data/collection/private


soegaard2
2020-12-17 00:23:43

(7.5 here !?!)


badkins
2020-12-17 00:26:10

Hmm… I killed the process and re-ran it, now it says “already installed”; I’m skeptical.


sorawee
2020-12-17 00:27:00

Oh, yeah, if you raco pkg install already, you can’t run it again


sorawee
2020-12-17 00:27:12

I think you should do raco setup --pkgs graph


badkins
2020-12-17 00:27:46

I just used undirected-graph, and it worked, but maybe part of the package didn’t get installed? I’ll try setup


sorawee
2020-12-17 00:28:56

Well, for one thing, I think the documentation has not been built yet. And some files might not have been compiled, so it might take long compilation when you use it in your program


badkins
2020-12-17 00:29:29

Could it possibly be building from source instead of pre-built stuff?


sorawee
2020-12-17 00:29:56

I don’t think so. My Racket is built from source too


badkins
2020-12-17 00:30:48

raco setup --pkgs graph appears to be making everything


sorawee
2020-12-17 00:31:02

rip


benj.calderon
2020-12-17 00:34:36

@benj.calderon has joined the channel


badkins
2020-12-17 00:37:01

@sorawee do you know why it would make everything instead of just graph and its dependencies?


badkins
2020-12-17 00:37:27

I probably should’ve just uninstalled and reinstalled.


sorawee
2020-12-17 00:37:30

When that happens to me, it’s because I change the core Racket source code


badkins
2020-12-17 00:38:43

@stchang thoughts?


mflatt
2020-12-17 00:39:08

@badkins Are you running CS (as opposed to BC)?


badkins
2020-12-17 00:39:18

Yes 7.9 CS


mflatt
2020-12-17 00:39:26

As far as I know, graph is broken for CS.


badkins
2020-12-17 00:39:42

That’s a pity.


mflatt
2020-12-17 00:40:22

It uses make-sized-byte-string - shouldn’t be difficult to fix, and I think the problem has been reported, but I’m not sure.


badkins
2020-12-17 00:41:31

I was able to use (maximum-bipartite-matching (undirected-graph '( ... ))) , and it gave a result. Not the result I was expecting, but I probably gave it incorrect input.


badkins
2020-12-17 01:19:52

Maybe I haven’t exercised the part that uses make-sized-byte-string, but the following worked fine on 7.9 CS: #lang racket (require graph) (define g (undirected-graph '((2 "c") (3 "c") (1 "r") (2 "r") (3 "r") (3 "s")))) (maximum-bipartite-matching g) ;; => '((1 "r") (3 "s") (2 "c"))


badkins
2020-12-17 01:20:48

“rip” indeed. 52 minutes and counting! :) Fortunately, I was able to use teh graph module while it’s running


kellysmith12.21
2020-12-17 02:30:39

I’ve been reading about <https://docs.racket-lang.org/rebellion/Streaming_Computations.html?q=rebellion|Rebellion’s Streaming Computations> and the <https://docs.racket-lang.org/collections/index.html?q=generic%20collection|Generic Collections library> and I’m wondering, has there been any interest/discussion about integrating them?


notjack
2020-12-17 02:32:05

I would like to, but that would probably look more like designing a new generic collections API than integrating with that existing one, since that library isn’t maintained by the author anymore


notjack
2020-12-17 02:33:54

You could write a generic collection reducer yourself like this:

(define (into-collection collection) (make-fold-reducer conj collection))


notjack
2020-12-17 02:37:10

And then you’d get this:

(into-collection '()) == into-list (into-collection (set)) == into-set ... etc.


kellysmith12.21
2020-12-17 02:45:22

Ah, that’s too bad that it’s no longer maintained, I was hoping to use it to implement sequences in my lang.


sorawee
2020-12-17 02:55:02

Not maintained, but Alexis still accepts PRs I think.


kellysmith12.21
2020-12-17 04:00:20

On an unrelated note… I’ve read about them in a few places, but I don’t really understand “disappeared uses” / “disappeared bindings” and what syntax-parse is doing with the related #:track-literals option.


sorawee
2020-12-17 04:38:17

Here’s a simple example


sorawee
2020-12-17 04:38:31

#lang racket (require (for-syntax syntax/parse)) (define &gt;&gt; #f) (define-syntax (foo stx) (syntax-parse stx #:literals (&gt;&gt;) [(_ a &gt;&gt; b) #'(define a b)] [(_ a b c) #'(a b c)])) (foo y &gt;&gt; 2) (foo + 2 3) y


sorawee
2020-12-17 04:38:57

The macro foo is supposed to be either function application or define, depending on the presence of &gt;&gt;


sorawee
2020-12-17 04:39:45

Now, in DrRacket, try to hover over &gt;&gt; in (foo y &gt;&gt; 2). You will notice that nothing happens


sorawee
2020-12-17 04:40:00

But when you add #:track-literals, there will be an arrow from &gt;&gt; to (define &gt;&gt; #f)


notjack
2020-12-17 04:45:13

It’s called “disappeared” because as (foo y &gt;&gt; 2) expands to (define y 2), the &gt;&gt; disappears


notjack
2020-12-17 04:47:15

DrRacket figures out how to draw the arrows by looking at your program after it’s been expanded. So it can’t see anything that disappears during expansion. But it can see syntax properties, so it looks for a disappeared-uses syntax property which macros can shove stuff into to tell DrRacket about the ghosts of departed bindings.


sorawee
2020-12-17 04:49:22

And #:track-literals option of syntax-parse simply adds these syntax properties so that you don’t need to add them yourself.


notjack
2020-12-17 04:59:06

(It should have been the default but it wasn’t implemented at first and there wasn’t a backwards compatible way to make it happen automatically)


kellysmith12.21
2020-12-17 05:26:12

Thank-you for the clarification.


kellysmith12.21
2020-12-17 05:36:11

Does anyone run into bugs by forgetting to use ~@ to splice in a pattern variable bound to a splicing syntax class? I keep forgetting that splicing classes are implicitly wrapped in a list.


wanpeebaw
2020-12-17 06:22:32

There is a benchmark against Brainfuck-Mandelbrot translates to different languages. Found some interesting results there.

RPython-JIT is roughly equal to our Racket FP version. “Translated to C (-O0)” is roughly equal to our Racket-imperative version. “Translated to C (-O1)” only takes 1.3s. https://github.com/pablojorge/brainfuck#benchmark