News for hackers. Stuff that matters.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by bcardarella on Friday August 15, 2025 @12:37PM (#44914489)
I tried to do this a few weeks ago, I tried to build a NIF around an existing C lib. I was using Claude Opus and burned over $300 (I didn't have Pro) on tokens with no usable results.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by cpursley on Friday August 15, 2025 @12:42PM (#44914560)
Get Pro, 4 is quite good at Elixir now but you have to stay on it. 3.5 was not, so I imagine next version of Claude will be able to handle the more esoteric things like NIFs, etc.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by bcardarella on Friday August 15, 2025 @03:07PM (#44916306)
The issue in this case was Opus was pretty crap at C. It kept introducing segfaults.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by ipaddr on Friday August 15, 2025 @12:53PM (#44914676)
Get Pro 5.. it will work I promise
Re:I let LLMs write an Elixir NIF in C; it mostly worked by cpursley on Friday August 15, 2025 @01:04PM (#44914823)
I've completely refactored my Elixir codebase with Claude 4, expanded the test suite by 1,000 more tests, and released a few more features faster than I ever have to actual paying customers. Tidewave MCP is helpful as are some custom commands and a well tunded CLAUDE.md But you do you.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by jtbayly on Friday August 15, 2025 @01:49PM (#44915372)
Would you be willing to share your CLAUDE.md file contents? I’m vibe coding in Elixir.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by cpursley on Friday August 15, 2025 @02:11PM (#44915657)
I somewhat followed this:

https://elixirforum.com/t/coding-with-llms-conventions-md-fo...

It's not perfect - you often have to remind it not to write imperative style code and to lean on Elixir conventions like "with" statements, function head matching, not reassigning vars, etc.

Re:I let LLMs write an Elixir NIF in C; it mostly worked by cschep on Friday August 15, 2025 @01:21PM (#44915034)
So hard to tell if this is parody or not.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by cpursley on Friday August 15, 2025 @02:02PM (#44915538)
Here's one Claude-vibed project that makes me money that I run in addition to my saas, which is Elixir. I'm not strong in TypeScript and this is an Astro static site, so Claude has been really helpful. Backend is Supabase (postgres) and a few background jobs via https://pgflow.dev (pgmq) that fetch and populate job openings and uses some AI steps to filter then classify into the correct categories (among other things, there's also an job application flow and automated email newsletter): https://jobsinappraisal.com

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 ;)

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...

Re:I let LLMs write an Elixir NIF in C; it mostly worked by Sinidir on Friday August 15, 2025 @02:01PM (#44915529)
Its not really hard to tell.
Re:I let LLMs write an Elixir NIF in C; it mostly worked by cschep on Saturday August 16, 2025 @12:00PM (#44924576)
1,000 more tests!? That reads coherent to you?