
Hi All. I just discovered the tab “Projects” on Github. It can be used to create smart “To Do”-lists and more with notes and issues. I think it could be useful for #triage ? https://www.youtube.com/watch?v=ff5cBkPg-bQ

pardon the ignorance, but what is this triage thing? seems kinda exclusive

@cris2000.espinoza677 It’s a channel; feel free to join

is there a list of “quite-known” (js, rust, java, python, nim, etc) programming languages implemented on or racket implemented on other languages/frameworks? (rpython, llvm, etc)

I don’t think there’s a list; mostly what gets implemented in Racket is domain-specific languages. There are small implementations of parts of languages such as JavaScript, Python, OCaml, and even Algol 60, but none of them are enough to run normal programs written in those languages.

The two complete implementations of Racket are implemented on top of a home-grown VM and implemented on top of Chez Scheme. There are also less mature implementations on top of JavaScript (RacketScript and WhaleSong) and using RPython (Pycket).

thank you for responding

Is there a concise summary of why Racket gives these instantiate-linklet: mismatch;
errors any time I accidentally compile some code and then later edit it? What makes it hard to eliminate that error?



It’s “just” a matter of running raco make
more automatically, and Ryan’s custom-load
package sets hooks to do that.
There are all sorts of reason

… reasons that raco make
might not work in an arbitrary context. Maybe code is loaded in a sandbox with restructed write access. Maybe the current user doesn’t have the needed filesystem access. Maybe multiple racket
s are running, and raco make
can’t deal with concurrency at that level (i.e., it assumes that it’s the only one modifying “.dep” and “.zo” files).

ooh thank you soeegard!

I expect that the various problems can be dealt with, but it will take some effort. Ryan’s package is as much as I know anyone has worked on the problem.

I suppose I meant—why, upon hitting that error, does Racket not print a warning and fall back to the source file?

Unrelatedly, why does hash-update
only work on immutable hash tables? I’ve got a mutable hash table I’d like to make a non-destructive edit to…

The stack of configurable handlers (the kind of hooks that make custom-load
work) doesn’t really support that. Maybe it would be possible to tweak and/or add something to make that possible, but I’m not sure.

Got it. I’m working with undergrads who aren’t used to Racket so I’m seeing all these issues trip people up and that got me wondering

The implementation of mutable hash tables does not support constant-time non-destructive update. You can use hash-copy
, but that’s expensive enough that it probably shouldn’t be hidden in an operation like hash-update
that is otherwise constant-time.

Got it. So I should use hash-copy
and a destructive update on the copy?

If you want a destructive update, use hash-update!
(note the exclamation point).

Oh — sorry, you explicitly said you want to make a non-destructive edit.

I should learn to read…

Does anyone have a Catalina Mac that they could use to help me debug something?

edit: it’s a racket/base thing. ~hi, i have this~ ...

@samth sorry for the big chunk of text after you asking for help, i was writing this for some time already…

I have Catalina. Feel free to post stuff here. I might not be able to get back immediately, but will do as instruct when I’m available.

Try running that file (it should open in beginning student) and then try changing something small and re-running it. The student reports DrR freezing.

(preferably in 7.8 but anything is good)

CS or BC?

BC

hi, i have this (define-simple-macro (define/get id:id (~optional def:expr))
#:with hash (format-id #'id "hash")
(define id
(if (dict-has-key? hash 'id)
(vector-ref row (dict-ref hash 'id))
(~? (~@ . def) (~@ . #f)))))
i get an error that says function application is not allowed; no #%app syntax transformer is bound in the transformer phase
which is weird because i’m pretty sure syntax-parse does let you do this. anyways i opted out of a unhygienic macro for this (define-simple-macro (define/get id:id hash:id (~optional def:expr))
(define id
(if (dict-has-key? hash 'id)
(vector-ref row (dict-ref hash 'id))
(~? (~@ . def) (~@ . #f)))))
i thought the ~?
template tried to see if the first element existed otherwise it outputted the second… (i tried (~? def (~@ #f))
and other variations too…) def: attribute contains non-syntax value
value: #f in: def
ok, i get it, i know this error… but the template doesnt work…
i’ve reread stuff in syntax/parse
especially examples… but i dont get it :(

Can reproduce freezing in BC, but not CS

But also, my CS is the development version, so it is newer than BC.

woohoo!

thanks

I will report a bug, and suggest to the student that they try CS

Interestingly, 7.7 BC doesn’t have this problem

Awesome

But now I cannot produce the problem in 7.8 BC anymore too…

Oh, nvm, it just happened again

When I force quit, here’s the stack trace:
$ /Applications/Racket\ v7.8/bin/drracket lab1.rkt
terminate break
context...:
/Applications/Racket v7.8/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
/Applications/Racket v7.8/share/pkgs/gui-lib/mred/private/lock.rkt:43:38
/Applications/Racket v7.8/collects/racket/private/more-scheme.rkt:266:2: call-with-exception-handler
/Applications/Racket v7.8/share/pkgs/gui-lib/mred/private/wxwindow.rkt:219:21: on-set-focus method in make-window-glue%
/Applications/Racket v7.8/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:435:6
/Applications/Racket v7.8/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:486:32
/Applications/Racket v7.8/share/pkgs/gui-lib/mred/private/wx/common/dialog.rkt:58:4: show method in dialog-mixin
/Applications/Racket v7.8/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
/Applications/Racket v7.8/collects/racket/private/more-scheme.rkt:266:2: call-with-exception-handler
/Applications/Racket v7.8/share/pkgs/gui-lib/mred/private/messagebox.rkt:69:2: create-message-box/custom
/Applications/Racket v7.8/share/pkgs/drracket/drracket/private/rep.rkt:1544:6: can-close? method in text-mixin
/Applications/Racket v7.8/share/pkgs/drracket/drracket/private/unit.rkt:2853:6: can-close? method in frame-mixin
/Applications/Racket v7.8/share/pkgs/gui-lib/framework/private/frame.rkt:501:4: can-close? method in register-group-mixin
/Applications/Racket v7.8/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
/Applications/Racket v7.8/share/pkgs/gui-lib/mred/private/lock.rkt:43:38
/Applications/Racket v7.8/collects/racket/private/more-scheme.rkt:266:2: call-with-exception-handler

Looks like an error creating an error message box

Thanks so much

And I just got it to freeze in 7.7

So what I said was not true

BC or CS?

BC

I think I have more information, but let me play around a little bit more

When I force quit, this also appears:
UpdateRecents: about to call HIS_XPC_GetApplicationPolicyForURLs with seed 4172491891
UpdateRecents: received results from HIS_XPC_GetApplicationPolicyForURLs
UpdateRecents: about to parse results from HIS
UpdateRecents: about to update menu item state
UpdateRecents: disabling ScreenTime for item 2
UpdateRecents: disabling ScreenTime for item 3
UpdateRecents: disabling ScreenTime for item 4
UpdateRecents: disabling ScreenTime for item 5
UpdateRecents: disabling ScreenTime for item 6
UpdateRecents: disabling ScreenTime for item 7
UpdateRecents: disabling ScreenTime for item 8
UpdateRecents: disabling ScreenTime for item 9
UpdateRecents: disabling ScreenTime for item 10
UpdateRecents: disabling ScreenTime for item 11
UpdateRecents: disabling ScreenTime for item 12
UpdateRecents: disabling ScreenTime for item 13
UpdateRecents: disabling ScreenTime for item 14
UpdateRecents: disabling ScreenTime for item 15
UpdateRecents: disabling ScreenTime for item 16
UpdateRecents: disabling ScreenTime for item 17
UpdateRecents: disabling ScreenTime for item 18
UpdateRecents: disabling ScreenTime for item 19
UpdateRecents: disabling ScreenTime for item 20
UpdateRecents: disabling ScreenTime for item 21

And here’s another stack trace:
terminate break
context...:
/Applications/Racket v7.7/collects/ffi/unsafe/objc.rkt:293:0: lookup-send
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wx/cocoa/window.rkt:695:4: is-shown? method in window%
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wx/cocoa/window.rkt:698:4: is-shown-to-root? method in window%
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wxme/editor-canvas.rkt:1307:2: do-needs-update method in canvas-editor-admin%
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wxme/text.rkt:686:2: own-caret method in text%
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wxme/editor-canvas.rkt:366:2: on-focus method in editor-canvas%
/Applications/Racket v7.7/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
/Applications/Racket v7.7/collects/racket/private/more-scheme.rkt:265:2: call-with-exception-handler
/Applications/Racket v7.7/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/lock.rkt:43:38
/Applications/Racket v7.7/collects/racket/private/more-scheme.rkt:265:2: call-with-exception-handler
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wxwindow.rkt:219:21: on-set-focus method in make-window-glue%
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:435:6
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:486:32
/Applications/Racket v7.7/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:634:3

Can you post those on the issue?

Done

Thanks again

@sorawee When it’s frozen, do you sometimes see ghosts of windows — the drop shadow of the big-bang window without the actual window? Maybe even the ghost of a “really quit?” dialog when you click to bring the DrRacket window to the front and hit Cmd-Q?

I saw a ghost of “really quit”, but I didn’t see a ghost of big-bang

Here’s the “really quit” ghost.

Ok, good (in the sense that it’s consistent with a bug that has been fixed).

Ok, great. I suggested downloading the CS version to my student, I may also suggest downloading a snapshot.

@sorawee how did you record your video for https://github.com/sorawee/fishy-completion ?

It looks good and I was hoping to use for https://github.com/racket/racket-lang-org/issues/137


brew cask install licecap
if you use brew

Hi all, I’m trying to get ssl self-signed certification to work on my webapp. I followed Racket https://docs.racket-lang.org/continue/#%28part._.Using_.H.T.T.P.S%29\|documentation to generate the private key and certification. The server starts successfully, but when attempting to access the webapp the following error is raised: port->ssl-ports: accept failed (error:1408F09C:SSL routines:ssl3_get_record:http request)
My webapp.rkt file runs the following: (serve/servlet start
#:quit? #f
#:listen-ip #f
#:port port
#:server-root-path files-path
#:ssl? #t
#:ssl-key (build-path files-path "private-key.pem")
#:ssl-cert (build-path files-path "server-cert.pem")
#:extra-files-paths (list files-path)
#:servlet-path "/webapp.rkt")
Any advice/pointers are much appreciated!

This is now how it’s rendered in the snapshot

Hopefully it will help a little bit

i know there are many veterans in this channel, but i think i hit a milestone with racket and that is finding a use for continuations for myself for the first time… soooo… i wanted to share it! (define andcompose
(case-lambda
[() values]
[(f0) f0]
[frest
(make-keyword-procedure
(lambda (kw kwargs . args)
(let/cc k
(define (wrap f)
(make-keyword-procedure
(lambda (fkw fkwars . fargs)
(or
(keyword-apply f fkw fkwars fargs)
(k #f)))))
(let ([new-f (apply compose (map wrap frest))])
(keyword-apply new-f kw kwargs args)))))]))
am i convinced that it works as intended? i dont know. and it also might be bloated, maybe i can get rid of the case-lambda
oh well…

welp i just realized if there’s a function that returns multiple values, it just explodes huh edit: fixed(? in reply

fixed(???? (define andcompose
(case-lambda
[() values]
[(f0) f0]
[frest
(make-keyword-procedure
(lambda (kw kwargs . args)
(let/cc k
(define (wrap f)
(make-keyword-procedure
(lambda (fkw fkwars . fargs)
(define result
(call-with-values (lambda ()
(keyword-apply f fkw fkwars fargs))
list))
(define all-true?
(for/and ([e (in-list result)])
e))
(if all-true?
(apply values result)
(k #f)))))
(let ([new-f (apply compose (map wrap frest))])
(keyword-apply new-f kw kwargs args)))))]))

I am trying to use Typed Racket in a program, but I get an error on for/first
loop, where TR complains with the ambiguous message: “insufficient type information to typecheck. please add more type annotations”. I have annotated everything I could in the loop, and I am not sure what exactly the problem is. This is the minimal example (the error is in the for/first
loop. Can anyone provide some advice on how to get the TR properly annotated?
#lang typed/racket
(struct level-info ([mask : Integer] [sentinel : Integer]) #:transparent)
(define max-level 30)
(: level-information (Vectorof level-info))
(define level-information
(for/vector : (Vectorof level-info) #:length max-level
([id : Integer (in-range max-level)])
(define flag-bit (* 2 id))
(define sentinel (arithmetic-shift 1 flag-bit))
(define mask (cast (sub1 (arithmetic-shift sentinel 1)) Integer))
(level-info sentinel mask)))
(: d Integer)
(define d 1) ; encoded value to check
(: info (U #f level-info))
(define info
(for/first : (U #f level-info)
([info : level-info (in-vector level-information)]
#:when (let ([mask : Integer (level-info-mask info)]
[sentinel : Integer (level-info-sentinel info)])
(= (bitwise-and d mask) sentinel)))
info))

Actually it looks like for/first
is not supported by the type checker (according to the documentation). I replaced the code with for/or
for now.

It would be nice if TR would print out a “not supported” message in this case…

that’s awesome! congrats!