Hacker News new | ask | show | jobs
by notjack 3435 days ago
Hi, Racket community member here. Thanks for the in-depth comment about your experience, and thanks for writing about your work with the webserver library! A couple follow up questions if you've got the time:

1. Could you elaborate on the stacktrace issues you encountered?

2. The Gregor package [0] is currently a bit of a community standard for date and time functionality. There's a general desire to merge this into the Racket stdlib. Would this package suit your needs?

3. For string templates, a lot of folks use Scribble "at expressions" via the `at-exp` meta-language combined with format specifiers from `racket/format` to write code that looks very similar to python string interpolation and other language-integrated string formatting systems. You can see an example of that on Greg Hendershott's blog [1]. Would this work for your use cases or were you looking for something a bit more involved?

[0] http://docs.racket-lang.org/gregor/

[1] http://www.greghendershott.com/2015/08/at-expressions.html

2 comments

Hello! I cannot say for sure that I am not imposing the issues on myself but writing in a bad manner.

In particular, syntax errors are reported well. The issue is that runtime errors only seem to report the function in which an error occurred and not even a line number. This makes debugging slow and tedious.

The web-server template library has similarly poor stack traces in both runtime and syntax errors. And while I better understand the complexity here, I still feel uncomfortable asking a coworker to contribute with the state of template debug messages.

Certainly, compared to the Python standard time library, Racket does well. And between SRFI-19 and Gregor, 3rd-party time libraries are not bad. The biggest thing the standard time library and SRFI-19 misses are some default formatting and parsing constants for the most common formats (like ISO8601). This way users don't need to look up the ISO8601 format every time and and the SRFI-19 format keywords. Furthermore, documentation for and examples of SRFI-19 and the standard time library are lacking. This makes it difficult to get started.

The at-exp language may have its use-cases. But I really don't enjoy hacking together HTML templates with it right now. Furthermore, HTML templates are especially a cross-team piece of a project. I think the only suitable tool for it is a simple DSL that (e.g.) doesn't require interpolating Racket to loop over data.

Are you running the programs in DrRacket or at the command line?

By default, DrRacket has "errortrace" enabled. With "errortrace" the errors get a better stack trace [1], but it indirectly disable some optimizations, so the programs are slower.

But the command line version doesn't have "errortrace" enabled by default, so it's faster but with less useful stack traces.

[1] Actually, they are fake stack traces. The compiler may inline the function but use continuation marks to keep track of what the stack trace would have been.

Can you give an example where you don't get the stack trace you expect? For example, when I run simple programs at the command line I get the stack trace I'd expect, and I get more if I run it in DrRacket (with and without errortrace).
Hey, I'm a racket beginner and I'm wondering where the best places are to ask questions. I'm asking in general, but also specifically I'm trying to do more complex terminal input/output, and I'm having trouble getting the charterm package running.
There are some very helpful folks on Stack Overflow, but the racket-users mailing list is definitely the authoritative resource. Also, Neil Van Dyke (the package's author) is helpful and responsive.
I've always gotten great feedback quickly on the #racket channel on freenode.