jbaldwin / libcoro

C++20 coroutine library
Apache License 2.0
559 stars 57 forks source link

AI-Generated Documentation Experiment for libcoro #269

Open plops opened 2 months ago

plops commented 2 months ago

Hi @jbaldwin,

I'm quite intrigued by libcoro and wanted to experiment with using a large language model (Gemini 1.5 Pro) to generate documentation for it.

The project seemed like a good fit for this experiment because:

My process was simple: I fed Gemini the entirety of the libcoro source code, examples, and tests (about 170k tokens). Then, I prompted it with instructions like "propose an outline" or "write section 4.1" and let it generate content. It took about an hour of copy and paste. The requests typically finished in 1 or 2 minutes. I assembled the results into markdown files in the doc/ folder of my fork: https://github.com/plops/libcoro/tree/main/doc

My primary goal wasn't to produce production-ready documentation. Instead, I was curious to see what the AI would come up with when given access to the entire codebase.

Here are some observations:

I haven't thoroughly vetted the output, but I'm sharing it in case you find it interesting or potentially useful as a starting point for more formal documentation.

Let me know if you have any thoughts or questions about this experiment!

jbaldwin commented 2 months ago

Hey @plops this is a really cool idea! Thanks for sharing. I will definitely dig in and see how it turned out when I get some time.

Curious to see how it compares to the hand written readme examples too.

jbaldwin commented 2 months ago

I've got some time to try and read through some of these, I'll write up some notes / thoughts as I go through the generated docs.

jbaldwin commented 2 months ago

31_tasks

32_executors

33_syncprimitives

... more to come, this is really cool though, I'm enjoying reading through what its generated...