This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will block this actor and hide all of their past and future posts. Are you certain you want to block this actor?
This action will block this object. Are you certain you want to block this object?
I finally published the blog post I was working on about how we wrote a C Node in #CrystalLang to call into our existing #Golang libraries from #ElixirLang! You can read about it here: https://relistan.com/calling-go-from-elixir-with-a-cnode
I'm having a weird #Golang dependency issue that I've never seen before. The code compiles on macOS and Alpine Linux absolutely fine. On Ubuntu and Debian I get a complaint from the compiler that the dependencies need to have `go mod tidy` run. Running it does nothing.
This stinks... because our CI is Debian. Very strange issue.
I shipped an app some months back that uses Badger (#Golang) as the data store. I wanted to be able to see what was in the store easily when debugging, so I stuck a simple Redis API into the app using redeo
as a local-only port. I exposed a few Redis commands to make it easy to see what was in the store, walk keys by prefix, etc. This took maybe 1.5 hours to add. It has been super useful. I think I'll do this again next time I ship something with Badger.
Messing with #Golang KV DB Badger and finding it pretty cool. It's FAST.
New blog post: "Parsing Protobuf Definitions with Tree-sitter" . It's all about how I used #Treesitter to jumpstart some nice internal #Protobuf tooling at work in #Golang. https://relistan.com/parsing-protobuf-files-with-treesitter
This #Golang production project at work has been a lot of fun so far. Nearly 20K LoC and the static binary is about 45MB :)
I compared ZStandard compression against GZip in #Golang for a workload that I have at work. ZStandard produces binaries that are about 5% smaller but takes 50% less time to compress and 50% less time to decompress. That's a real boost.
The Go implementation is here
Go `sqlmock` from Data Dog can be useful for making sure you know exactly which queries are being sent to the DB. But it has a limited set of type matchers and when matchers don't match, it's so hard to figure out what was actually sent. It supports custom matchers.
I figured out a little pattern I like there I pass `t` from the test (`testing.T`) into the custom matcher's struct and then use `t.Log()` to pass back what the heck was wrong with the value passed. So many WTFs saved when tests fail. #Golang
type MicrosTimestamp struct { t *testing.T } func (r MicrosTimestamp) Match(v driver.Value) bool { i, ok := v.(int64) if !ok { r.t.Log(fmt.Sprintf("TESTS: MicrosTimestamp got %v which is not an int64", v)) return false } ...
I'm experimenting with using a couple of #Golang database libs together that I haven't used before: https://github.com/blockloop/scan and https://github.com/Masterminds/squirrel . So far I am quite positively impressed with the simplicity and niceness of the combo. I wrote some custom code generation to generate models from the DB schema. So far I am happy.
I've been writing a new Event archiving service for the new event-based environment at my new gig. This is a second chance to iterate on what we built at Community that I talked about in my blog post on the subject. This time, I'm writing in #Golang because I'm on my own on this stuff at the moment. I've taken a different approach with it by archiving events to a local copy of #DuckDB as they come off the wire. Then I use DuckDB's native Parquet and S3 support to write the events batches out to S3, where they can then be queried with Athena.
This approach seems to be good so far. I will learn more when I get it into production. I feel another blog post coming later this year...