AI for writing documentation

anyway, if the OP is interested, we have a challenge. We'll provide an undocumented, nontrivial program, and you can slop out all the documentation you want.

Then i'll post the documentation we wrote, and the public can compare results.

Amenable?
 
Don't learn/use troff (roff, groff, whatever). mdoc is the way to go.
I write my notes, docs, etc in markdown first; this allows me to keep my notes in plain text and I can view them with my text editor with fancy syntax highlights.
 
you asserted that it's good at documenting your trivial shell script, which we assume is not known software. if it can only document known software that seems kind of useless.

but ok, i guess you don't want to demonstrate.
 
Now I challenge you. Read the script and tell me what it does and how much time you spend guessing.

Later you can throw into an AI machine, it will tell you what is does.

Code:
#!/usr/opt/bin/tclsh

proc txl_strf {char str i} {
while {[set j [string first $char $str $i]] >= 0} {
 set i [expr $j+1]
 if {[string index $str [expr $j-1]] eq "\\"} {continue}
 return $j}
return -1}

proc txl_procln {ln} {
set n 0
set i 0
while {[set j [txl_strf % $ln $i]] >= 0} {
 puts -nonewline [string range $ln $i [expr $j-1]]
 set i [expr $j+1]
 set k [txl_strf / $ln $i]
 if {$k < 0 || $k==$i} {incr i -1; break}
 set c [string range $ln [expr $i+1] [expr $k-1]]
 switch [string index $ln $i] {
  \$ {incr n; uplevel #0 "puts -nonewline \[set \"$c\"\]"}
  \\ {incr n; uplevel #0 $c}
  default {incr i -1; break}}
 set i [expr $k+1]}
puts [string range $ln $i end]
return $n}

proc txl_proctxt {file} {
global argv
set chan [open $file r]
set cod ""
set mod 0
while {[gets $chan ln] >= 0} {
 if {[string range $ln 0 1] eq "%%"} {
  set mod 1; append cod [string range $ln 2 end] \n
 } else {
  if {$mod} {set mod 0; uplevel #0 $cod; set cod ""}
  txl_procln $ln}}
close $chan}

set txl_file [lindex $argv 0]
set txl_fileroot [file rootname $txl_file] ;# may be needed for creating files
txl_proctxt $txl_file
 
looks like it splits files on %% delimiters and does some simple parsing for double-quoted string substitutions while also emitting some Tcl code with set commands. not that hard, and we're not going to put it into the slop machine to check; if it mattered to us, we'd debug it. spent 0 time guessing, took me less than 2 minutes. hth hand
 
there's also a confounding factor in this experiment: the quality of that tcl suggests that you also prompted it out of chatgpt, whereas our documentation and code, none of which you have even seen, is all handwritten, but ok, go off.
 
well, we rose to your challenge (reading your tcl, on an empty stomach, on a monday morning), but instead of demonstrating that your system is able to produce good documentation for something nontrivial, you chose to insult us. i think that pretty much says it all.
 
1771273628389.png
 
but instead of demonstrating that your system is able to produce good documentation for something nontrivial
I do not need to demonstrate it to you. I used it also for writing README files of SQL schemata and other tcl scripts, and it is a nice tool when one does not want to invest much time on such things. I can later improve the documentation manually.
 
I do not need to demonstrate it to you. I used it also for writing README files of SQL schemata and other tcl scripts, and it is a nice tool when one does not want to invest much time on such things. I can later improve the documentation manually.
the point of the thread, your entire thesis, is that it's good at writing documentation. yet you won't demonstrate this? wild.
 
Mine want's to play woith the humans.
the point of the thread, your entire thesis, is that it's good at writing documentation. yet you won't demonstrate this? wild.

Now that I am awake, would you care to compete against my ai in writing a doc system for c++? Because you won't win, in fact I am fairly confident its going to embarrass you.
 
Does it do something I can't use sed to change text? Not sure what it does, but I can read puts -nonewline :p
Put it in an AI engine, it will get immediately what it does, perhaps with some imperfection, but it gets it.

Then ask it if sed is not better.

What it does not get, is, that it is designed for TeX. Then enter that it is for TeX and ask the AI engine for its opinion again.

I deleted the comments above from the code, but you can see them in the original file I link in the first posting. With comments AI is better.

All the work of writing documentations reduces itself to a dialog with the AI engine. For the man page you see was more or less long dialog, but ask the AI to write a man page and see what it first proposes.
 
i wanted to learn whether or not this thing can, as claimed, be good at documentation.
Just try it with the script above. With grok, with google, with claude or any other AI engine. Try it as I wrote above before discussing, try it with your own programs. Try it! It is not difficult, only copy and paste, ask for a man page or a README.
 
we posted a clear and actionable challenge above, but, as mentioned, the response appears to be flames and insults. adios

You’re the only one making this personal. I offered a clear challenge, but now you’re backing out. If you’re going to criticize code "human or AI" it’s fair to show your repositories.
 
ok...this is getting annoying , is there some how of block words in the forum? like AI???????
or just block the user,more easy
another AI futurist boy, for god sick
 
Back
Top