Guidelines on structuring large racket project

There is a Racket style guide called How to Program Racket that will ship in the documentation of a future version of Racket. You can read it at the link I posted or in the bundled docs if you build the git version of Racket.


Your question is about structuring large Racket projects, however your example link How to Write Go Code seems mainly to be about how to create a package. These aren't necessarily the same thing (although you might divide a large Racket program into different source directories, which could be "collections" or "packages"). Anyway, to address both parts:

  1. How to structure a large Racket project: Asumu's answer provides a good link: How to Program Racket. In particular see section 3, "Units of Code", which discusses modules. Also, one technique you will see in the source code of Racket itself, is that a module may exist solely to require functions from others and provide them -- to "re-provide". In other words you can use modules like this to chunk up other modules and selectively expose them as a "layer" in your structure. Furthermore, Racket has a class system if that fits your problem domain, and generics if you have some sort of "interface" or "protocol" strategy. And more. Really, there a many, many techniques available in Racket to structure a large project.

  2. How to make Racket packages: This is an interesting time to ask. Historically Racket has used something called Planet as a package manager. More recently, it has a new package system. Although not yet officially out of beta, many people are already using it for real work. The current documentation for that, although in a different style than the Go doc, is Package Management in Racket Beta).

You asked for general guidelines, which is a bit open-ended. If you have any specific choices you're weighing for how to structure a large project, perhaps you could ask about those one by one to get crisper answers?

Tags:

Racket