Show HN: I've used Go to build a daemon for the Raspberry Pi
jondot.github.io
jondot.github.io
I just released an alpha project for the Raspberry pi using Go for controlling your sprinklers.
Shameless plug: https://github.com/pothibo/irrigation
But make it go-gettable, dammit. :-) [1]
Also, is there anything I could read that would explain how I'd hook up my RPi to my sprinkler system? Thanks!
Nice job
Well, I'm not saying it is only for the Pi (took care of adding it into the FAQ recently), just that it's been run and tested on one for more than two weeks now - so I feel comfortable with saying it works great on the Pi.
But yes - I have been building and testing it on OSX and Linux alternatively, before deploying on the Pi for testing, so it is perfectly suitable for any unix device with low resources indeed.
Hope it works well for you anywhere you want to run it :)
Unfortunately what the git logs don't show is that some of that code was written very late at night (where my spare time lives), and sometimes I neglected to do that out of sheer tiredness.
I will definitely try to improve on that when needed, thanks!
And just right now I'm working on an alarm system, where you'll be able to launch any arbitrary commands or start/stop playing a radio. In a few days I'll release the new version.
BTW, for the ones who have a dynamic IP and want to use a Dynamic DNS service for being able to access to your RPi from the internet, you can check this out[3].
[1] Official site: http://raspctl.com/ [2] Repository: http://code.krenel.org/raspctl [3] http://ip.raspctl.com/
In C those functions would be provided by third party libraries like libCURL (or handwritten and likely insecure).
This is slightly irrelevant in terms of your question about performance, but in terms of dev it is very nice to avoid dealing with 3rd party packages, especially when programming for multiple architectures.
LibCURL is used (along with a TON of other 3rd party C libs) in a bunch of systems securely. Writing C code isn't __always__ insecure. It all depends on the developer/team. Just like writing Java isn't always portable.
It seems like it's all about saving dev time these days. I was once pulled onto a project where some devs had used perl & python for an embedded system. They got a prototype system up pretty quickly, but performance just wasn't there and they were using WAY too much RAM/CPU based on what the system had to offer. They wasted many man-months trying to optimize their code. Eventually, they brought in some C devs and we rewrote in C and the system ran great. It turned out great for the Python/Perl devs too because they got to learn C and some of the benefits of using it.
Don't get me wrong. C doesn't fit all problems.
It has always been about saving engineering time; otherwise, why aren't you handcoding things in assembler? Any reasonable development process involves at least a subconscious decision about how much hardware to give up in exchange for a manageable engineering cost.
For the problem domain, Go seems like a reasonable point in the continuum of efficiency and engineering costs.
Another part people overlook when they say "well, my low level language has a library for that, too" is that there is also a cost decision when adopting a library. How quickly can you vet libcurl has no buffer overflows or memory leaks? Compare that to Go's net/http? Does the library have enough public usage in your problem space that you can assume someone else has found and reported the bugs?
Dependencies are like puppies. They are cute, right up until they become your responsibility. The author might have felt more comfortable with his chances of updating and maintaining "net/http" and the lower chance that he would need to.
Until something happens to make engineering time limitless and free, it's ALWAYS going to be about saving dev time.
I've been working on an open source project like this for JavaScript called Nitrogen. You can read about it here if you are interested in a node.js/JavaScript take on this: http://bit.ly/18k67ow
How easy would it be to add support for statsd[1] / graphite[2]?
[1] https://github.com/etsy/statsd/ [2] http://graphite.wikidot.com/
It was made out of several reasons
* For fun (as said here)
* Scratching my own itch - I needed a way to remotely run commands though a nice UI, and a way to see how my Pi is doing when i'm not at home.
* For lack of better tooling - every thing I evaluated needed a combination of things, no other tool gave me all-in-one. This made the resources bloated. With GC, you get around 3-4MB RSS.
* To prove to myself that Go can be as great for development on the Pi as Python (which many people use there)
I also like the idea of Internet of Things http://en.wikipedia.org/wiki/Internet_of_Things
I already had everything working in an evening based on a concept I had, and it took additional few days of my spare time to get a nice looking UI, landing page, code cleaned up, supporting more reporters etc.
So all in all I invested that additional time on the premise that others may find it useful to make their own life a bit easier -- naively speaking, if it make your life harder please let me know why so I can improve it :)
However being that it has very slim resources and an easy way to cross compile, it is perfect for the Pi.