nbw

nbw

How are you using AI with Elixir at work on production-ready apps?

This is an open discussion to anyone using AI to help them work with Elixir in production-ready apps.

I work on an Elixir app at work that’s mostly backend with no customer facing UI parts, but I haven’t found good ways to use AI in my workflow beyond the obvious things. I’ve talked with my coworkers there seems to a pattern of not trusting generated code that’s larger than a single function, generated tests are inconsistent unless they’re unit tests, etc.. Ultimately your ass is on the line when you ship it so you want to trust what you’ve written.

On a positive note, asking AI to explain something works nicely :+1:. But beyond talking to an LLM and having it clarify or refine things, I’m left wondering if I’m misunderstanding the hype.

There are lots of tools out there (Cursor IDE, Cursor PR review bot, Copilot, Claude, <%= insert your favorite LLM here %>), and apparently LLM’s work quite well with Elixir. The auto-complete from these tools can be really nice (but to me, it’s just nice).

We even have Elixir specific tools like:

Some of these are great if you’re starting a new project, if you want to prove an idea at the surface level, if you’re following Phoenix best practices to make a LiveView CRUD app, etc.. But if you’re working on an existing complicated code base, what tools/workflows are you finding make you more productive?

I’m genuinely looking interested in using AI in a net-positive way (for me and for the company I work for) and would love to hear what works for you beyond creating a new phoenix app.

#ai

Most Liked

martosaur

martosaur

I’m using chat panel in Zed for asking arbitrary questions but that’s about this. I tried agent mode couple of times and it’s not for me. Writing is thinking, and when I don’t write code by hand I find myself out of the feedback loop. Tests IMO is a great example of this. If testing your code is hard, you know something is not right with how you do things. But if you outsource tests to AI, you won’t feel this.

14
Post #2
odd

odd

I immediately thought of this tweet after reading this thread.

Anyway, we’ve been using Claude Code to swap deprecated dependencies, add documentation, write missing tests and even implement small features. It does a pretty good job, especially after adding project specific guidelines to CLAUDE.md.

I asked Claude itself to create the guidelines with a focus on code conventions and patterns, which it did surprisingly well. Then I went through the file, adding, removing and fixing things here and there. For example there’s a section dedicated to testing, explaining how we use our test factory, how we use PhoenixTest for UI tests and so forth. The tests it generates follow our conventions and besides some minor issues like naming, I rarely have to fix anything. The documentation it generates is usually way too verbose and focuses on minute details. Usually it either gets it right the first time, or I have to spend more time talking to it than it would take to do the thing myself. Interesting times, to say the least.

GitHub - ash-project/usage_rules: A tool for synchronizing LLM rules files with your dependencies. · GitHub is definitely worth a read.

eddy147

eddy147

Elixir dev, but 95% only backend, hardly any Phoenix code.
I am using AI mostly with the CLI: gemini or OpenAI’s codex. I use it mostly for analyzing bugs, and acutally never to generate any code. I did that once, and it became a enormous mess and I did not understand the generated code because it was not my own.
If I would generate any code, it would be very small fragments so I can keep control of the big picture.
I mix my editing by using vscode – (actually codium, because the copilot setup message, even though i did not have it installed and not want to, started to bother me) and lazyvim. Both options work good for me, having the windsurf plugin installed, and using that for code completion, not using the chat functionality (in neovim not installed).

Where Next?

Popular in AI / LLMs Top

sergio
Code agents work best in Elixir because it’s a functional language with minimal implicit configurations and conventions. The code you se...
#ai
New
Joser
Claude Code Plugin for Elixir: Custom Skills and Hooks for Better Code Quality I’ve been experimenting with Claude Code for Elixir devel...
New
mayel
You describe a function. An LLM hallucinates it. The BEAM compiles and runs it live in your runtime with no restart, no compile step, no ...
#ai
New
New
ken-kost
Agreed; I just want to add that IMO Ash amplifies this even further. Especially since the dawn of usage rules. :cowboy_hat_face:
New
evnp
How do you all feel about the use of AI tools for building Elixir/Phoenix projects, with respect to these topics? Longform context below....
New
AstonJ
Saw this and wondered what each stage could or might mean for Elixir - anyone given it any thought? What kind of impact do you think it ...
New
dogweather
First, the downsides. I periodically fire the AI. :smiling_face_with_tear: ^^ This was earlier today in Cursor AI, working with “Clau...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
ricksonoliveira
Hey folks, I have been looking for an alternative to good old VsCode for a while. Have tried some vim and emacs editors with their plugi...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43757 214
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement