HenkPoley / chatgcc

A bash script to use ChatGPT as your C compiler

Repository from Github https://github.comHenkPoley/chatgccRepository from Github https://github.comHenkPoley/chatgcc

chatgcc

A cursed C compiler

Usage

export OPENAI_API_KEY="sk-..."
chatgcc test.c

The program will call OpenAI and save its x86_64 assembly program to test.asm. The program will also attempt to assemble that file, and link it.

If assembly and linking succeed, the program should produce an executable: test

Modifying

The top of chatgcc.sh includes a number of variables you can tune, including the prompt sent to OpenAI, and the model.

About

A bash script to use ChatGPT as your C compiler


Languages

Language:Shell 98.2%Language:C 1.8%