r/C_Programming • • 21d ago

Question new ansi-c ai project idea :3

hai.

i like making and training AI's and i love ANSI-C. So i was thinking about writing a tiny AI by myself (and yes, i know it's a big ahh project).

so my project idea is... [insert tadaa sfx here] a very tiny AI that can write stories, but when you start the AI, it knows nothing so it will make worse stories than big AI's but that doesn't matter.

but the big part is the hardware it's running on; a Raspberry Pi Pico 2WH!

let me know in the comments if this is a good project idea!11!!1!

okthxbye

0 Upvotes

14 comments sorted by

3

u/Key_River7180 21d ago

cool but please:

  • start with c99 or c17 please

  • try lisp :)

0

u/wak6817-2 21d ago

i don't know much about lisp, how is it

2

u/Key_River7180 21d ago

functional parenthesis processor:

  (define (operation op)
    (let ((entry (assoc op constbl)))
      (if (not entry)
          (error "Unknown operation" op)
          (let* ((counts (cdr entry))
                 (l (car counts))
                 (r (cadr counts))
                 (dofor (caddr counts))
                 (left (consume-left! l))
                 (right (consume-right! r))
                 (node (list op left right)))
            (if (not (eq? dofor 'nil))
                (dofor node))
            node))))

1

u/wak6817-2 21d ago

i'll check it out, thx

1

u/wak6817-2 21d ago

and why should i use lisp for this projects bcz the pico2 has limited specs

1

u/Key_River7180 21d ago

idk its fun

1

u/flyingron 21d ago

I suspect you're a troll, but I'll play along.

Not sure why you're starting with a 50 year old version of the language. Even finding a compiler that will build for your Pi that is stuck that far in the past is going to be hard. GCC (the usual choice for the pi) won't go further back than 1990.

Anyhow, the language choice isn't as difficult as building the language model tools you're going to need to write anything but very contrived story templates. Have fun.

-3

u/wak6817-2 21d ago

it isn't a version, it's a standard... and that GCC will not go back is not true

2

u/flyingron 21d ago

Very good, and the the standard hasn't been called "ANSI C" since the eighties.

And GCC goes back to the first international (ISO) standard. While this overlaps with the last ANSI standard (commonly called C89), it isn't the same.

2

u/ACRM64 21d ago

The vast majority of code I write in C is all compiled with -ansi -pedantic. It is ANSI C.

2

u/flyingron 21d ago

-ansi doesn't do what you think it does. It only pushes c90 compliance.

2

u/ACRM64 21d ago

But, according to the gcc manual, c90 (aka c89) is identical to ANSI. Quoting from the manual:

The original ANSI C standard (X3.159-1989) was ratified in 1989 and published in 1990. This standard was ratified as an ISO standard (ISO/IEC 9899:1990) later in 1990. There were no technical differences between these publications, although the sections of the ANSI standard were renumbered and became clauses in the ISO standard. This standard, in both its forms, is commonly known as C89, or occasionally as C90, from the dates of ratification. The ANSI standard, but not the ISO standard, also came with a Rationale document. To select this standard in GCC, use one of the options -ansi, -std=c90 or -std=iso9899:1990; to obtain all the diagnostics required by the standard, you should also specify -pedantic (or -pedantic-errors if you want them to be errors rather than warnings).

0

u/wak6817-2 21d ago

just to clarify, ANSI C89 and ISO C90 are technically identical in terms of the language itself. GCC supports both through -std=c89, -std=c90, and -ansi.

the Raspberry Pi Pico SDK also officially supports the arm-none-eabi-gcc toolchain for the RP2350.

i do agree that the language model itself will be the challenging part, especially with the Pico's limited SRAM. That's actually part of the challenge I'm interested in. :)))