notjack
2019-10-12 20:06:26

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


sorawee
2019-10-13 00:24:54

@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?


samth
2019-10-13 01:25:50

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


mflatt
2019-10-13 01:41:03

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
2019-10-13 02:26:06

@zitterbewegung has joined the channel


zitterbewegung
2019-10-13 02:26:47

hi


zitterbewegung
2019-10-13 02:27:46

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


notjack
2019-10-13 03:03:06

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


soegaard2
2019-10-13 05:27:42

Yes.


soegaard2
2019-10-13 05:29:14

There is usually more talk here than on irc.


rj.amdphreak
2019-10-13 06:19:51

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?