I was not particularly satisfied with my experience of doing fully hands-off vibe coding, but I wanted also to see what I can do if I spend bit more thinking and instructing the LLM before hitting ‘send’ button. So another Sunday spent ‘usefully’.
Gemini 2.5 pro exp is free(!) (for now)
The shocking part is that Gemini 2.5 pro is currently available in free tier of Google AI Studio (and to chat with at Gemini). The quota is quite generous - you can do essentially up to 25 M tokens per day (25 request limit per day, 1M context size - I did not get quite that far as my requests were <= 100k context size).
So I resolved to use this for what I wanted to do. I hadn’t used Gemini for coding before so this was good opportunity to learn about its capabilities, or lack of them.
The mission
I am planning to write something for which I need local network level synchronization about available services and their resources, and for that I have written a standard and an implementation years ago (RFC 7787: Distributed Node Consensus Protocol/RFC 7788: Home Networking Control Protocol). While I think I have some raw Python version of it somewhere, and a C version, I wanted something with single binary that is easy to cross compile.. so I wanted the whole solution in Go.
So I set out to implement first Trickle (RFC 6206: The Trickle Algorithm) algorithm, and then subsequently as much of DNCP as I could given limited time available during Sunday, and within rate limits of Gemini.
Outcome
Gemini was quite pleasant to work with, with the exception of eventually hitting finally ‘daily’ ratelimit and that means it allows 1 request per hour or so after that. It is much faster than Anthropic’s Claude 3.7 Sonnet, and API never said ‘no’ to me due to capacity (Anthropic seems to do it quite often). As a cherry on top, it also has larger context size - I never hit context size limit , and I fed it whole codebase + some RFCs + other stuff for implementation purposes.
What I got was (after perhaps 3 hours with LLM + some pause to let ratelimit recover):
- Reasonably good seeming Trickle implementation (with tests)
- Mostly functional DNCP implementation (although as it is abstract protocol, it cannot be quite used as is) (limited tests)
- Start of SHSP2 implementation (concrete protocol on top of DNCP which I want to use for my next hobby project) - not yet published as I am not happy with what it does.
What is SHSP2?
SHSP was ’Simple Home System Protocol or something that I defined in appendix of RFC7787 and used with some of my home automation ( GitHub - fingon/kodin-henki: ‘Spirit of home’ - my home automation project written in Python 2/3. ), until I phased out the whole custom home automation code altogether years ago.
SHSP2 is spiritual successor of SHSP, without some of its limits. It is basically mechanism for dynamically detecting http endpoints with least packets on the wire possible, and what those endpoints do, is up to the application layer. I need it for some distributed consensus stuff I am baking next.
I managed it all 95% with free Gemini quota - I cheated slightly by using Claude 3.7 for some minor fixes when I got ratelimited at an awkward time.
It is open source!
https://github.com/fingon/go-dncp
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Go 22 4240 3027 686 527
Makefile 1 29 12 11 6
Markdown 2 38 0 21 17
Plain Text 1 24 0 13 11
===============================================================================
Total 26 4331 3039 731 561
===============================================================================
It is still quite raw, and somewhat limited by my ratelimit with Gemini, but I am planning to continue the experiment over time, limited both by my rate limit, as well as time available for hacking outside work. Still, scarily plausible results for initial hour or two
I’m hoping to get actually good base DNCP implementation, and functional SHSP2 implementation out of the exercise eventually so I can actually implement the project I really wanted to implement in the first place.
Anyway, more to come..