spdegabrielle
2020-5-25 11:17:36

spdegabrielle
2020-5-25 11:17:48

I can have both!


sorawee
2020-5-25 11:18:46

spdegabrielle
2020-5-25 11:20:37

it only happens on the ‘all version’s’ page. https://download.racket-lang.org is fine


pocmatos
2020-5-25 12:36:59

Has anyone played with the experimental dependent types in Racket? I am lacking examples… (I can only see the ones here: https://docs.racket-lang.org/ts-reference/Experimental_Features.html Is it possible for example to create a natural value and type it using another natural that represents the number of bits used to represent it?


pocmatos
2020-5-25 12:37:13

Maybe @samth is the one to ask…


samth
2020-5-25 12:42:23

That could work but is not currently implemented


samth
2020-5-25 12:45:02

pocmatos
2020-5-25 12:46:49

Ah, I had forgotten that post, thanks. Is there anyone currently working on this?


samth
2020-5-25 12:47:44

No, but adding integer-length wouldn’t be hard.


samth
2020-5-25 12:47:55

it sort of depends on what you wanted to do with it


pocmatos
2020-5-25 12:50:10

Wanted to create a typed bitvector library from this one https://github.com/pmatos/racket-bv/blob/master/private/bv.rkt


pocmatos
2020-5-25 12:50:29

Where the type of a bitvector would include the bitwidth of the vector.


pocmatos
2020-5-25 12:51:36

For bvadd: bv? bv? -> bv? was hoping I could move the check that both arguments have the same bitwidth to compile time.


pocmatos
2020-5-25 12:52:06

of course, most functions are like this in bitvector arithmetic land so I thought there could be a lot to gain performance wise.


pocmatos
2020-5-25 12:52:27

In general, I also wanted to experiment with it. :slightly_smiling_face:


pocmatos
2020-5-25 12:54:49

and I thought this bitvector library was kind of a good application of dependent types.


pocmatos
2020-5-25 12:58:32

I reckon that if in the syntax if Refine , symbolic-object could be expt , then it would work because you would just have to say that a bitvector is a natural value v of bitwidth k and has refinement (< v (expt 2 k))


pocmatos
2020-5-25 12:59:06

sounds easy but the implementation might not be straightforward.


pocmatos
2020-5-25 12:59:30

How do the refinement proofs work? Is typed racket sending the proof to some external solver? SAT or SMT or something else?


samth
2020-5-25 14:03:19

the solver is internal right now


dbriemann
2020-5-25 18:15:50

@dbriemann has joined the channel


sorawee
2020-5-25 18:23:51

Continuation marks are really cool, but I feel it doesn’t quite work for error tracing (at least in the way it’s used in errortrace).

Consider:

(define (fact n) (cond [(zero? n) (1)] [else (* n (fact (sub1 n)))])) (define f fact) (define g fact) (f 3) (g 4) errortrace would output:

(1) (* n (fact (sub1 n))) (* n (fact (sub1 n))) (* n (fact (sub1 n))) But “regular” stacktrace probably should look like:

1 fact fact fact f Or its compressed form:

1 fact [x3] f From users’ perspective, it is very important to have f as a part of the entry, so that we can distinguish which call causes the problem (f or g?)

I understand the limitation (which might be good or bad, depending on how much space efficiency / accuracy you want) of with-continuation-mark on tail positions, so… idk.


sorawee
2020-5-25 18:27:12

Presenting users with continuation frames are probably not what users want. When I’m looking at a trace, I expect to see the function frames, but

(* n (fact (sub1 n))) (* n (fact (sub1 n))) (* n (fact (sub1 n))) ain’t it. If the expression is larger (e.g., has more arguments), it could be very confusing.


leif
2020-5-25 18:29:08

@mflatt Any reason the following Racket code returns different sizes on macos and linux?

#lang racket (require racket/draw) (define fnt (make-object font% 11 "Inconsolata" 'modern)) (define size-dc (new bitmap-dc% [bitmap (make-object bitmap% 1 1)])) (send size-dc get-text-extent "This is a test" fnt)


leif
2020-5-25 18:29:21

(Given that inconsolata is installed on both systems)



soegaard2
2020-5-25 18:31:24

If you see a factor k*0.25: “On Mac OS, when the main screen is in Retina mode (at the time that the bitmap is created), the bitmap is also internally scaled so that one drawing unit uses two pixels.”


leif
2020-5-25 18:33:14

I see. So basically racket/draw is unsutable for making papers, is that correct?


leif
2020-5-25 18:33:35

Given that there is no way to make building it consistent across platforms.


mflatt
2020-5-25 18:33:54

I don’t think it’s about the general scaling factor, but points-vs.-pixels is certainly an issue.


mflatt
2020-5-25 18:34:22

Asking for a font size in pixels instead of points should help.


leif
2020-5-25 18:35:44

get-text-extentdoesn’t seem to have a flag for that.


leif
2020-5-25 18:36:10

I guess there is get-size-in-pixels in the font object itself.


leif
2020-5-25 18:39:25

Nope, that didn’t help:


leif
2020-5-25 18:39:36

#lang racket (require racket/draw) (define fnt (make-object font% 11 "Inconsolata" 'modern 'normal 'normal #f 'smoothed #t)) (define size-dc (new bitmap-dc% [bitmap (make-object bitmap% 1 1)])) (send size-dc get-text-extent "This is a test" fnt)


leif
2020-5-25 18:39:40

Although its a lot closer


leif
2020-5-25 18:40:04

Width is now the same at least. The height is 13 on one and 12 on the other though.


leif
2020-5-25 18:40:36

Oh, and the ascent/decent is still completely different.


leif
2020-5-25 18:42:14

Ah, adding unaligned though does make them match.


leif
2020-5-25 18:42:29

(define fnt (make-object font% 11 "Inconsolata" 'modern 'normal 'normal #f 'smoothed #t 'unaligned)) (define size-dc (new bitmap-dc% [bitmap (make-object bitmap% 1 1)])) (send size-dc get-text-extent "This is a test" fnt)


bedeke
2020-5-25 18:54:14

During the past month I made a small gameserver that uses racket in the back and javascript in the front. It more ore less follows the universe approach (the same available functions for the servers) and already has a small chat service. If you’re interested I could push it to github.


soegaard2
2020-5-25 18:56:50

@joe ^


joe
2020-5-25 18:59:35

bdeket: yea I’m interested. Sounds good.


joe
2020-5-25 18:59:57

@bedeke


bedeke
2020-5-25 19:01:40

ok, I’ll clean it up. Some games I implement, I don’t have the right to share…


dbriemann
2020-5-25 19:06:32

@spdegabrielle I filed it here: https://github.com/racket/racket/issues/3216 . I hope the format is OK. Didn’t find a guideline for this.


joe
2020-5-25 19:06:33

@bedeke thanks. When you’re not busy. It’s no rush.


soegaard2
2020-5-25 20:41:07

@jcoo092 @laurent.orseau I have changed the loading of BLAS in the hope of getting Debian and Ubuntu to work at the same time. Will you let be know, if it works - or maybe even broke something? https://github.com/soegaard/flmatrix/commit/a9464cc39e6546dd9d37324251013a63058b4b64


spdegabrielle
2020-5-25 20:45:28

Thanks. I’m quite confused. There are many linux users on 7.7 cs - it doesn’t seem likely that none of them are using gracket


laurent.orseau
2020-5-25 20:49:45

I suppose you mean Fedora and Debian instead?


laurent.orseau
2020-5-25 20:49:57

I’ll take a look, maybe tomorrow


soegaard2
2020-5-25 20:50:13

I thought you had Debian and James had Ubuntu?


dbriemann
2020-5-25 20:53:05

I agree that is strange.. maybe they use some other distributions? I also tried this inside a vm on another (windows) machine with the same result..


laurent.orseau
2020-5-25 20:53:09

I have Ubuntu/Debian (Ubuntu is based on Debian) and I believe James has a Fedora


greg
2020-5-26 01:53:37

Although I’m not very familiar with quad (yet), its intro docs suggest the reason is more about Pango and PDFs?

> For the most part, neither Quad nor Quadwriter rely much on racket/draw. In particular, Quad completely ignores Racket’s PDF-drawing functions, which are provided by Pango, because of major shortcomings in the kind of PDFs it produces (for instance, it doesn’t support hyperlinks).


jcoo092
2020-5-26 03:08:09

Looks like it works out-of-the-box for me now :slightly_smiling_face: All I did was copy the flmatrix.rkt file into the same directory as the fllinalg.rkt file you supplied, modified the latter to look for the former in the same directory, then ran it with racket fllinalg.rkt and everything worked fine :+1::skin-tone–2:

I am consistently getting an exception on the second ‘mixed!’ example, but the first one runs fine, so I’m pretty sure that’s nothing to do with not finding CBLAS.

For your reference, I am indeed on Fedora 31. I have also installed basically every version of BLAS, LAPACK and ATLAS that I could find, though, so I have to admit I don’t know which one provided the required .so file.


jcoo092
2020-5-26 03:14:30

The output of the terminal regarding the above exception, if you’re interested: racket fllinalg.rkt "vector" vector completed successfully cpu time: 37 real time: 38 gc time: 27 vector completed successfully cpu time: 51 real time: 52 gc time: 0 vector completed successfully cpu time: 450 real time: 456 gc time: 0 "matrix" matrix completed successfully cpu time: 97 real time: 99 gc time: 0 matrix completed successfully cpu time: 873 real time: 887 gc time: 0 "mixed" mixed completed successfully cpu time: 64 real time: 66 gc time: 0 mixed completed successfully cpu time: 413 real time: 420 gc time: 1 "mixed!" mixed! completed successfully cpu time: 59 real time: 59 gc time: 0 remainder: contract violation expected: integer? given: +inf.0 argument position: 1st other arguments...: 256 context...: /home/jcooper/Documents/CML_benchmarks/Racket/fllinalg.rkt:15:19 /home/jcooper/Documents/CML_benchmarks/Racket/flmatrix.rkt:2075:2: for-loop [repeats 1 more time] /home/jcooper/Documents/CML_benchmarks/Racket/flmatrix.rkt:2073:0: flmatrix-map! /home/jcooper/Documents/CML_benchmarks/Racket/fllinalg.rkt:67:2: for-loop /home/jcooper/Documents/CML_benchmarks/Racket/fllinalg.rkt:74:0: main "/home/jcooper/Documents/CML_benchmarks/Racket/fllinalg.rkt": [running body] temp35_0 for-loop run-module-instance! perform-require! Looks like the issue occurs in the call to remainder in the remainder-or-random function - though I can’t quite work out precisely what’s causing it.


soegaard2
2020-5-26 05:27:45

@jcoo092 Thanks for testing. I think you are right about “mixed!”. I didn’t see it on my machine, but I’ll take a look later and see where the +inf.0 can come from.