| ▲ | simonw 3 days ago | |||||||||||||||||||||||||||||||
I'm using it to build things. Here's an example from the other day. I've always been curious about writing custom Python C extensions but I've never been brave enough to really try and do it. I decided it would be interesting to dig into that by having Codex build a C extension for Python that exposed simple SQLite queries with a timeout. It wrote me this: https://github.com/simonw/research/blob/main/sqlite-time-lim... - here's the shared transcript: https://chatgpt.com/s/cd_6958a2f131a081918ed810832f7437a2 I read the code it produced and ran it on my computer to see it work. What did I learn? - Codex can write, compile and test C extensions for Python now - The sqlite3_progress_handler mechanism I've been hooking into for SQLite time limits in my Python code works in C too, and appears to be the recommended way to solve this - How to use PyTuple_New(size) in C and then populate that tuple - What the SQLite C API for running a query and then iterating though the results looks like, including the various SQLITE_INTEGER style constants for column types - The "goto cleanup;" pattern for cleaning up on errors, including releasing resources and calling DECREF for the Python reference counter - That a simple Python extension can be done with ~150 lines of readable and surprisingly non-threatening C - How to use a setup.py and pyproject.toml function together to configure a Python package that compiles an extension Would I have learned more if I had spent realistically a couple of days figuring out enough C and CPython and SQLite and setup.py trivia to do this without LLM help? Yes. But I don't have two days to spend on this flight of curiosity, so actually I would have learned nothing. The LLM project took me ~1 minutes to prompt and then 15 minutes to consume the lessons at the end. And I can do dozens of this kind of thing a day, in between my other work! | ||||||||||||||||||||||||||||||||
| ▲ | llmslave2 3 days ago | parent [-] | |||||||||||||||||||||||||||||||
With all due respect you were reading, not learning. It's like when people watch educational YouTube videos as entertainment, it feels like they're learning but they aren't. It's fine to use the LLMs in the same way that people watch science YouTube content, but maybe don't frame it like it's for learning. It can be great entertainment tho. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||