14 ms·
Gokrazy – Go Appliances
- denysvitali 3y agoPresentation by Michael: https://youtu.be/mv_THRgLRHY https://youtu.be/mv_THRgLRHY
- drux 3y agoThe 25 Gbit/s at home guy https://michael.stapelberg.ch/posts/2022-04-23-fiber7-25gbit-upgrade/ https://michael.stapelberg.ch/posts/2022-04-23-fiber7-25gbit...
- jpgvm 3y agoMore importantly the author of i3. :)
- vasergen 3y agothanks, I didn't know that, I love i3!
- denysvitali 3y agoMore importantly: the author of Gokrazy :)
- crimsontech 3y agoAnd the KinT custom controller for Kinesis Advantage keyboards https://michael.stapelberg.ch/posts/2020-07-09-kint-kinesis-keyboard-controller/ https://michael.stapelberg.ch/posts/2020-07-09-kint-kinesis-...
- triyambakam 3y ago[flagged]
- bayindirh 3y agoIt's a defragmenting stack, garbage collected programming language, and even mentioned as a memory-safe programming language in NSA's "Memory Safe Programming Languages Recommendations". Why disagree? That's true.
- PurelyApplied 3y agoNot the glib root-commenter, but the two big caveats is that Go is memory-safe provided you import neither `unsafe` nor `c`. That can end up being a pretty restrictive constraint, if it's not something your dependencies cared about. If it is a concern of yours, it's pretty easy to check for at build time.
- randomdata 3y agoImporting `C` declares that you intend to use Cgo instead of Go. Cgo is not Go[1]. [1] https://go-proverbs.github.io https://go-proverbs.github.io
- bayindirh 3y agoWell, unsafe says it all. It's "unsafe". On the other hand, I never had to import "C" in any of my projects, yet. However, if I'm going to wander into CGo realm, I can always pivot to C++, if speed or things implemented in C is that important for me. No programming language, incl. a particular one which has an orange mascot, is perfect. I also find trying to solve social problems with technology (i.e. let's make programming languages foolproof to enable lazier-er programmers), pointless, to put it mildly. Honestly, in my eyes Go is a very nice, little language, and I like how it handles.
- oefrha 3y agoIn my experience, a typical project in orange-mascot language is also more likely to bring in a C dependency through a -sys dep than a typical project in blue-mascot language. (That might be changing with more RIIR, though.)
- 3y ago
- lyxell 3y agoThe showcase of projects is (a bit unintuitively) listed under Available packages and is helpful if you want to get a picture of what you can build on top of gokrazy: https://gokrazy.org/packages/showcase/ https://gokrazy.org/packages/showcase/
- cedws 3y agoI am very fond of the idea of a from-scratch userspace written entirely in Go. I've been dreaming of building something like gokrazy for servers. Or possibly something like Bottlerocket OS in Go. I experimented a few weeks ago with packaging a custom kernel and minimal Go init binary into a disk image bootable on GCE. No bootloader needed, just EFI loading the kernel directly.
- hyperthesis 3y agoTo some extent, android is this with java. For a low-powered device, would a Go usespace bring particular benefits? (Though, even the cheapest phones today aren't really "low-powered" anymore)
- yjftsjthsd-h 3y agoGo has memory safety (via GC rather than fancy ownership, but if it works it works); that's an asset anywhere that can afford the overhead. Edit: In order to preempt the argument others are having: Safer than C, anyways, while being much easier than rust.
- pjmlp 3y agoIf only we didn't need the const dance for enumerations, even Pascal like ones, to yet another 10 years, I guess.
- jrockway 3y agoI don't have a big problem using codegen to get "syntax" for enumerations. "go generate ./..." before you checkin, save yourself some typing. I have used this in the past: https://github.com/abice/go-enum https://github.com/abice/go-enum But mostly use protos as much as possible these days. (The enum is going to be in the API, might as well use the same object inside the app.)
- pjmlp 3y ago
- espe 3y agothis looks really cool. might be perfect for an old odroid. hope that doesn't stray too far from the happy paths.
- withinboredom 3y agoGo simply can't really do well unless it has globs of memory or properly set kernel parameters (that affect the whole global machine). To get it to run reliably in low-memory conditions also requires careful tuning of GOGC + GOMEMLIMIT + MADV_DONTNEED. Go is geared more towards servers with tons of available memory, not IoT devices. Further, it's networking stack does really well on low-latency connections (ie, a datacenter) and starts to do poorly if you throw a in link with lots of data loss (this includes clients across the internet on crappy wifi). I love that they basically reimplemented libc to get more performance, but they also threw away decades of edge cases that it doesn't (yet) handle very well. I'm confident they'll get there, eventually, especially when people do things like this and report issues.
- denysvitali 3y agoThat's why you have TinyGo: https://tinygo.org/ https://tinygo.org/
- withinboredom 3y agoThis looks like a really interesting project. Thanks for sharing it! I'm going to have to try this out with a couple of projects. Just a cursory experiment reveals that it's GC seems to be much better than Go's GC and I'm very curious as to why that is.
- dolmen 3y agohttps://tinygo.org/docs/reference/lang-support/#garbage-collection https://tinygo.org/docs/reference/lang-support/#garbage-coll...
- withinboredom 3y agoInteresting that it says it is slower. It may actually be slower, but tends to not suffer as much degradation as the Go's GC. In other words, on my test setup using Go, I get ~1k rps once I hit memory limits, but with tinygo I get 7k rps once I hit memory limits. So it might be "slower" but it looks like it may be more efficient as well.
- dolmen 3y agoLooks interesting. However, I don't like to have a Go compiler on the production machine for security reasons, as well as to reduce even more the system base. I think instead that the compiler should be needed only to deploy binaries and should stay on the syadmin's machine. The Go toolchain is very good at cross-compiling, so there should not be a need for the compiler on the target machine.
- secure 3y agoI don’t know where you got the impression that the Go compiler would run on “the production machine”. gokrazy images are built whereever you like (typically your PC, or some more automated setup) and then deployed to the target device. There is no Go toolchain on the target device.
- __jonas 3y agoOh this seems great, I actually just wrote a small Go program that I was planning on running on a Raspberry Pi as the only thing running on the device, looks like this could make it a bit simpler to deploy, very nice!
- asim 3y agoThe idea is not bad. Execution is always hard with this stuff. I've done a pure Go app platform with this sort of desire for a native tool chain but it's very hacky. I do wonder whether wasm will solve some of this but sometimes it's a solution in search of a problem. Still the simple idea of a server that will pull and run your code on demand with a simple "run x" is always appealing.
- nyadesu 3y agoCouldn't someone achieve this by using a very lightweight Linux distro, setting up ssh and using Ansible?
- theshrike79 3y agoYes, but this is even lighter weight. There is no distro or kernel, only the program.
- AHTERIX5000 3y agogokrazy does use Linux kernel though.
- rickcarlino 3y agoReminds me very much of the Elixir Nerves framework*. I’m glad to see there are more options out there now. How does Go fare on single core machines like older RPi0 models? * https://nerves-project.org/ https://nerves-project.org/
- Thaxll 3y agoGo is pretty performant, faster than Nerves for sure, I have an old RPB+ from 2014 and some go code on it, works just fine. The Go compiler can target most popular arm platforms by default.
- rcarmo 3y agoExcept that you need older versions of Go to target ARMv6, like the pre-2 revs and the Zero.
- Thaxll 3y agoAren't those are arm11? They can all be compiled with any version of Go afaik GOARM=6
- whalesalad 3y agoThey are different beasts. Nerves does OTA updates (blue/green deploys), and a lot of other cool stuff. Needs beefier hardware but I started building a pretty wicked little tool on rpi4 with nerves to try and accurately track motorcycle lap times using gps and sensor fusion. It was pretty snappy in my experience.
- IshKebab 3y agoThis is the right way to do Raspberry Pi projects, but I think tying it so strongly to Go is a mistake. Is that really necessary?
- asylteltine 3y agoThis is actually quite useful to something I am working on thank you. I love Go.