
Making a package for querying stuff about packages https://docs.racket-lang.org/package-analysis/index.html

@mflatt I’m wondering about error reporting convention in Racket. For instance, (file->string "this-file-does-not-exist.txt")
results in
; file-size: cannot get size
; path: /Users/sorawee/this-file-does-not-exist.txt
; system error: No such file or directory; errno=2
; [,bt for context]
Is this considered an acceptable error message? That is, is it OK to error in terms of file-size
rather than file->string
?

No, that’s a bug in file->string
(and probably my fault)

I disagree with @samth. While the use of file-size
could be avoided in file->string
, avoiding that function would just move the error to call-with-input-file*
. Actually, if the file disappears after file-size
right now, the error in file->string
can be from call-with-input-file*
. And errors from read-bytes
are possible, even though file->string
uses read-string
. As a general rule, it’s difficult to report the best name for exceptions that are not exn:fail:contract
. By the nature of those exceptions, the failure is not something that you can reliably guard against with a check in advance. So, the options are to catch and re-raise exceptions, which is painful and inefficient, or always pass through some function name to use in a potential error, which is even more painful. So, it’s sometimes necessary to a compromise on the function name in the error message for non-exn:fail:contract
exceptions.

@zitterbewegung has joined the channel

hi

@soegaard2 were you a part of the #scheme freenode channel? I am r2q2 from there

What do you think about returning a wrapper value like Rust’s Result
type?

Yes.

There is usually more talk here than on irc.

Hello Racketeers! I am a comp sci student at the University of Memphis. I just returned to school and have embarked on a startup company venture. My team and I have some ambitious goals and I have done a fair amount of research into advantages provided by languages. For almost all cases, I have found Racket to be the preferred solution, but the creator of Erlang, Dr. Joe Armostrong, has many talks about problems he’s noticed in the programming industry, which I also noticed, and he says the Erlang language has a unique property that other languages are missing, for parallel processing applications, which he believes gives it a future-proof programming advantage. @mflatt Have you seen his talks, and do you know if Racket intends to incorporate any of his ideas?