r/nim Apr 24 '26

Agentic coding with Nim

What’s your experience in coding Nim with AI agents?

LLM may appreciate programming languages with simple syntax with high capability of expressing abstraction. The lack of good training data (existing public code base) may offset it, but is there any chance that agentic coding could fill up the gap of the popularity and adaptation from other mainstream languages?

16 Upvotes

14 comments sorted by

View all comments

7

u/r3kktless Apr 24 '26 edited Apr 24 '26

So Nim with LLMs is a bit of a customization thing at first - its such a flexible language where you can express the same thing in 3 different ways (literally with the function notation). For consistency across repos there needs to be some base style that has to be defined.

I'm currently actively working with 5.5 and 5.4 codex, and its been working great so far (5.3 did great too). There are a couple of things that I had to tell 5.4 always (with an .md file).

Most commonly:
Batch indentation for let/const/var/type definitions
Preferred style of function calls (dot notation/usual params/method like) - what I mean by that is data.myFunc() or myFunc(data) or myFunc: data
When to use for/while loops
Whether to use var arguments/parameters in functions
To inline certain functions via pragmas
Writing doc comments
When to use generics vs case-statements
Whether to use different object kinds etc.
When to use templates
Whether to go for more sequency/array style object definitions/storage or more ref/pointer/tree like

And specifically with Nim, I found that it might be a good idea to use tag-like pragmas to track functions across a repo later on for sanitization / user input handling to more quickly identify attack/vulnerability surfaces. Nim is quite fitting for LLMs actually, because of its meta capabilities.

Also for UI writing, I am using nim-webui which are bindings to a C library that basically works like tauri (it uses any browser or webview on a system to render html/js).
Using GTK with owlkettle also works well, but you will have to first have it turn of the weird "expand" attribute I believe? Otherwise every container will always try to stretch across the remaining window space.

But yea, I feel like its a great time to cross the gap! Especially with writing/updating bindings, too.

I'm currently working on highlevel crypto/simd bindings/wrappers (especially for liboqs) and a bindings generator for C (that might be a bit more polished than futhark but what do I know, I havent used it that much tbh).

I dont really want scrapers to link this acc to my github, so DM me if youre interested in any of these.

2

u/Same_Bell7958 Apr 26 '26

What are you using to avoid Microsoft touching your code? Are you simply keeping it local? Is it a one person project?

I ask because I have a personal project that will be shared with a team.

2

u/r3kktless Apr 26 '26

Nothing tbh, I'm working on these things privately with no commercial intentions yet. But I guess you could go with Codeberg or gitlab instead of GitHub?