calyxir / calyx

Intermediate Language (IL) for Hardware Accelerator Generators
https://calyxir.org
MIT License
453 stars 45 forks source link

Docs: refresh the page about the eDSL #1908

Closed anshumanmohan closed 3 weeks ago

anshumanmohan commented 3 months ago

After #1894 has landed, I'd like to take locks and revise the eDSL docs. Here is a non-exhaustive list:

sampsyo commented 3 months ago

All these proposals sound great.

anshumanmohan commented 1 month ago

I am finally getting back to this, and am planning a bigger overhaul than previously outlined. There are actually two pages of documentation:

  1. Emitting Calyx from Python, which walks through builder_example.py and also discusses a tiny made-up code snippet to show parallelism in the control section.
  2. Builder Library Reference, which presents a multi-component design as an example and then covers a number of topics.

Let us say that the things that these two pages cover are our "syllabus", and we won't drop anything from the syllabus without talking about it. As I mentioned above, neither of these pages discusses static stuff or the new higher-level constructors, so that stuff goes into the syllabus too.

I propose to overhaul/extend builder_example.py, such that the documentation of the builder library can mostly "just" be a discussion of the example program, and such that that discussion covers the syllabus.

I want to teach people using a runnable example because many of the builder's features (especially the "modern" higher-level constructors) can only be understood via code generation: a single line of Python generates quite a few lines of Calyx in different parts of the Calyx program. This is why just showing snippets of Python/Calyx is ineffective.

I want the example program to show most features, but I don't want to overwhelm the user with too much info at once. To this end, I'm going to split the builder example into a number of components. A component will have a small number of self-contained lessons.

Here's the syllabus:

anshumanmohan commented 1 month ago

I have pushed the beginnings of this new example. So far I have the following components:

anshumanmohan commented 1 month ago

I have now pushed two further components:

anshumanmohan commented 1 month ago

I am close to done when it comes to new code, so I welcome your feedback on that! Please see #2002 for the code that I've been writing. In some cases I have annotated the syllabus above to ask for help or guidance.