3 ms·
Go is a decent industrial programming language alternative to Java, only things I'm not super enthused about is the logging experience (for the love of Christ,
by EdwardDiego 3y ago
Go is a decent industrial programming language alternative to Java, only things I'm not super enthused about is the logging experience (for the love of Christ, please create a standardised logging facade along the lines of slf4j, and allow the person running the application to set logging levels for individual loggers and choose whether stack-traces are emitted or not! Bonus points if I can change logging conf for a running app without restarting it) and libs that use C bindings, I have enough problems with that in Python already.
E.g., my manager is really interested in Dapr as a way to make basic Kafka usage easier for teams across our org.
Dapr's written in Go, and have made the reasonable decision to not use any libs that have C bindings for the same reason I don't like them.
However, this means that they can't use the Confluent Go Kafka client, as it's just a wrapper around librdkafka.
So they use Sarama, as it's written in pure Go, and is widely used, but is one of the most problematic Kafka clients I've had the misfortune to support. Although now that IBM has taken ownership of the project from Shopify, some of the more egregious bugs and oddities are finally being fixed.
But yeah, while you _can_ bind to C libs in Java, I've never encountered a library that did, so cross-platform lib compatibility wasn't something I ever had to worry about when working with Java.
- liampulles 3y agoYou may rejoice on the logging front: https://go.dev/blog/slog https://go.dev/blog/slog
- aaomidi 3y agoThis is nice but it’s not a simple library to use and I think that’s going to hurt it.
- i_am_programmer 3y agoIt's as easy to use as other 3rd party logging libs. I frequently make use and it's as easy as slog.Info("text", "field", value, "field", value)
- jen20 3y agoIt’s very simple to use, but dilly-dallying about a standard structured logging package means it’s now not widespread across third party libraries. Many non-trivial Go apps have 4-5 logging frameworks pulled in, it’s a mess.
- dilyevsky 3y agofranz-go is the least painful kafka library out there
- helsinki 3y agoI personally don’t trust anything other than the confluent-kafka/v2 package.
- dilyevsky 3y agofranz-go is like 4x-20x faster than standard confluent client
- helsinki 3y agoI’ll try it
- EdwardDiego 3y agoHaving looked at the benchmarking code in franz-go, I'm very dubious about those claims. 1) What settings did they use for those published numbers? 2) They don't change the default `linger.ms` for confluent-kafka-go and indeed, don't provide a argument to do so, unlike for the code to test their client. Automatically that renders the benchmark useless - the code running franz-go defaults to linger.ms of 0, librdkafka defaults to 5ms, so already you're not comparing apples with apples.
- dilyevsky 3y agoSlightly longer linger.ms should squeeze more throughput (at the expense of higher latency) not the other way around.
- helsinki 3y agoI ran some tests and it does appear to be about 3x faster at consuming, for my use-case.
- helsinki 3y agoIt’s not that hard to get librdkafka linked to your Go code. I did it in a day, behind a corporate firewall, without root access, and an outdated GCC compiler. Most of the day was spent compiling a new version of GCC.
- EdwardDiego 3y agoIt's not that hard, but it is an extra step.
- jollyllama 3y ago>Go is a decent industrial programming language Industrial?
- EdwardDiego 3y agoYeah, as in writing code in the general software industry, CRUD apps for businesses etc. Didn't mean for running machinery / sensors etc. although it could be good there? I have no experience at that level.