Re:I let LLMs write an Elixir NIF in C; it mostly worked
by cess11 on Friday August 15, 2025 @02:50PM
(#44916137)
Is there a reason why you're using 'when is_struct/2' instead of pattern matching here?
https://github.com/cpursley/livefilter/blob/main/lib/live_fi...
Re:I let LLMs write an Elixir NIF in C; it mostly worked
by napsterbr on Friday August 15, 2025 @04:20PM
(#44916890)
This is clearly low quality, non-idiomatic AI-generated Elixir code. So the likely answer is that "you" did not use this at all; AI did.
I review this kind of AI-generated Elixir code on a daily basis. And it makes me want to go back to ~2022, when code in pull requests actually made sense.
Apologies for the rant, this is just a burnt out developer tired of reviewing this kind of code.
PS: companies should definitely highlight "No low-quality AI code" in job listings as a valid perk.
Re:I let LLMs write an Elixir NIF in C; it mostly worked
by cpursley on Friday August 15, 2025 @04:47PM
(#44917076)
Fwiw, the date range part of this is the lowest quality, I even have an issue open: https://github.com/cpursley/livefilter/issues/2
In production code I'd do a couple passes and tell it to lean into more function head and guard matching, etc.
But it does compiles, and works: https://livefilter.fly.dev/todos?filters%5Bassigned_to%5D%5B...
I also "vibed" up this: https://livefilter.fly.dev/todos (https://github.com/cpursley/livefilter) and this: https://star-support-demo.vercel.app/en/getting-started (https://github.com/agoodway/star-support-demo)
I hand wrote very little of this code, but can read most of it - the SQL and Elixir at least ;)