News for hackers. Stuff that matters.
Re:Choosing Go at American Express by EdwardDiego on Wednesday January 03, 2024 @04:19PM (#38860092)
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.

Re:Choosing Go at American Express by liampulles on Wednesday January 03, 2024 @05:15PM (#38860604)
You may rejoice on the logging front: https://go.dev/blog/slog
Re:Choosing Go at American Express by aaomidi on Wednesday January 03, 2024 @09:47PM (#38862431)
This is nice but it’s not a simple library to use and I think that’s going to hurt it.
Re:Choosing Go at American Express by i_am_programmer on Thursday January 04, 2024 @04:00AM (#38864737)
It'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)

Re:Choosing Go at American Express by jen20 on Thursday January 04, 2024 @10:42AM (#38868306)
It’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.

Re:Choosing Go at American Express by helsinki on Wednesday January 03, 2024 @08:00PM (#38861856)
It’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.

Re:Choosing Go at American Express by EdwardDiego on Wednesday January 03, 2024 @08:17PM (#38861969)
It's not that hard, but it is an extra step.
Re:Choosing Go at American Express by dilyevsky on Wednesday January 03, 2024 @06:26PM (#38861208)
franz-go is the least painful kafka library out there
Re:Choosing Go at American Express by helsinki on Wednesday January 03, 2024 @08:02PM (#38861866)
I personally don’t trust anything other than the confluent-kafka/v2 package.
Re:Choosing Go at American Express by dilyevsky on Wednesday January 03, 2024 @08:54PM (#38862178)
franz-go is like 4x-20x faster than standard confluent client
Re:Choosing Go at American Express by helsinki on Wednesday January 03, 2024 @09:41PM (#38862408)
I’ll try it
Re:Choosing Go at American Express by EdwardDiego on Monday January 08, 2024 @08:17PM (#38920976)
Having 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.

Re:Choosing Go at American Express by dilyevsky on Tuesday January 09, 2024 @05:53PM (#38933473)
Slightly longer linger.ms should squeeze more throughput (at the expense of higher latency) not the other way around.
Re:Choosing Go at American Express by helsinki on Tuesday January 09, 2024 @06:20PM (#38933764)
I ran some tests and it does appear to be about 3x faster at consuming, for my use-case.
Re:Choosing Go at American Express by jollyllama on Thursday January 04, 2024 @10:47AM (#38868372)
>Go is a decent industrial programming language

Industrial?

Re:Choosing Go at American Express by EdwardDiego on Monday January 08, 2024 @07:59PM (#38920826)
Yeah, 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.