Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Pollyanna
Mar 5, 2005

Milk's on them.


Clojure implements efficient persistent data structures as part of the language so clearly they should have used Clojure. :smug:

Adbot
ADBOT LOVES YOU

Pollyanna
Mar 5, 2005

Milk's on them.


I kinda like Go as a language too, but I think the problem is that its applications are primarily lower-level and specialized - as people have said, it seems to do a specific few things:

  • shell script replacement
  • related to the above, devops scripting
  • systems programming for stuff people used to do in C or C++, basically drivers 'n poo poo
  • basic, unframeworked web and networking stuff like microservices
  • CONCURRENCYYYYY as an alternative to OTP

It's not a surprise that Docker, Kubernetes, and Hashicorp stuff are written in Go - they're very low-level, systems-oriented solutions for things the grand majority of programmers and engineers take for granted and never have to think about. Way I see it, if what you're doing is relatively independent of platform, complicated enough to be handled by a framework like Rails or Phoenix, noticeably benefits from functional programming, has anything to do with game dev, or is particularly high-level in concept, it's not really a Go thing.

Basically, Go is an ops language.

Dangerllama posted:

It's still a pretty niche language by overall usage, even though it seems like literally everything new and awesome is being written in it: Docker, Kubernetes, Prometheus, pretty much everything in the Hashicorp stack now.

I'd argue that the reason Go is niche yet a bunch of cool stuff is made in it is because 1. these are solutions to real and difficult problems, 2. Go is specifically designed around enabling these solutions, and 3. these solutions are widely used and very much the backbone of the systems we use. These solutions are niche because not many people work in it yet heavily rely on what's written with it, and not many people work in it because the problems it is specialized in solving are really advanced and really hard. There's a reason it's Google's baby.

Pollyanna fucked around with this message at 16:16 on Oct 18, 2016

Pollyanna
Mar 5, 2005

Milk's on them.


This may or may not be the best place to ask, but:

We have a protobuf defined that represents a particular set of data, most of it nested. We want to expose filters based on that data, such that given a particular protobuf instance you know you can say “I want to filter on this message’s value between X and Y” or “I want to filter on this enum being of either value Foo or value Bar, and allow any others”.

We currently have to define these filters manually by being aware of these data “leaves” and what type they are, and manually changing what our filters do and allow based on that. What I’m wondering is, is there a way to list all data leaves and their type so we can programmatically filter on them? I’m hoping there’s a way to know when a protobuf message has a new age value and thereby programmatically generate a filter on that new value, without having to manually do so.

Is this something a protobuf can do? If it helps, we are using the Ruby implementation of gRPC and protobufs.

Pollyanna
Mar 5, 2005

Milk's on them.


I was hoping the Ruby gem or something intrinsic about protobufs would allow them to know about their own data leaves, but I don’t see any helper methods or anything for that. As it is, it will be impossible to programmatically list the specific stuff I want since it will also be accompanied by a bunch of irrelevant constants and members that aren’t what I want to filter on.

That said, I just dug into the Descriptor API, and I think I got what I need. Thanks!

Pollyanna
Mar 5, 2005

Milk's on them.


How are you expected to keep protobuf definitions and compiled files up to date? Just constantly ping a GitHub repo until the file changes or something? That sounds dangerous.

Adbot
ADBOT LOVES YOU

Pollyanna
Mar 5, 2005

Milk's on them.


Jabor posted:

That's the best part about protobufs - if you do them right, you don't have to. As long as your protobuf only changes in particular ways, servers and clients can keep using the definitions they were originally compiled with and continue to work correctly, even when the thing they're talking to is using updated definitions.

Can you give an example of a situation that you're concerned about?

We have some enums (a list of insurance agencies) that get updated with new entries e.g. a new “FooGroup Inc.” with id 180. Our old protobuf does not have that entry, so it can’t map 180 to the symbol “FooGroup Inc.”, and therefore bugs out because our “hey we can’t translate this symbol to a display string” exception handler logs “can’t translate symbol 180” instead of “can’t translate symbol FooGroup Inc.”. We need to know it’s symbol instead of just an integer so we know what entry we need to add to our translation dictionary.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply