Skip to content

Conversation

@xiazcy
Copy link
Contributor

@xiazcy xiazcy commented Jan 5, 2026

A follow up of #3059 to make the go GLV working and buildable in master. Most implementations were done previously inside a feature branch, updates were needed due to accumulated tech debts in the past year.

Major changes included in this PR:

  • GremlinLang replace Bytecode
  • GraphBinary 4

Additional changes includes test set-up fixes, HTTP connection updates, basic auth, and various update in traversal to enable successful build.

Major changes pending:

  • Response chunk streaming (entire response is processed at once)
  • Interceptors (ie. authentication)

Comment on lines +142 to +156
if math.IsNaN(float64(v)) {
return "NaN", nil
}
if math.IsInf(float64(v), 1) {
return "Infinity", nil
}
if math.IsInf(float64(v), -1) {
return "-Infinity", nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely out of scope for this PR, but its occurring to me that we are losing the float 32 type for infinities and NaNs. Seems like a minor gap in the grammar which we may want to address.

case time.Time:
return fmt.Sprintf("datetime(\"%v\")", v.Format(time.RFC3339)), nil
case cardinality, column, direction, operator, order, pick, pop, barrier, scope, t, merge, gType:
name := reflect.ValueOf(v).Type().Name()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate that we need to use reflection here. Definitely out of scope for this PR but we might want to revisit the design of our "pseudo-enums" and see if there's anything better.

return g.V("44").ValueMap().With(WithOptions.Tokens, WithOptions.Labels)
},
equals: "g.V('44').valueMap().with(WithOptions.tokens,WithOptions.labels)",
equals: "g.V(\"44\").valueMap().with(\"~tinkerpop.valueMap.tokens\",2)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WithOptions in this and following cases don't look right, the grammar should parse the enums directly.

Suggested change
equals: "g.V(\"44\").valueMap().with(\"~tinkerpop.valueMap.tokens\",2)",
equals: "g.V(\"44\").valueMap().with(WithOptions.tokens,WithOptions.labels)",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grammar actually accepts the string literal. It looks like python also sends this, so I'd think it's a separate topic for revisit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd much rather see WithOptions encoded in token form (WithOptions.tokens, WithOptions.labels) instead of their underlying value form ("~tinkerpop.valueMap.tokens", 2), however I see that this may present a challenge given the current implementation in some languages. I agree this should be saved for a future revisit.

UnscaledValue *big.Int
}

func (bd *BigDecimal) Value() *big.Float {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could get rid of our BigDecimal type and allow users to directly use the native big.Float type

@xiazcy xiazcy force-pushed the go-http-converge-conn-lang branch from 60a6887 to 9ba6ac2 Compare January 21, 2026 01:32
@xiazcy
Copy link
Contributor Author

xiazcy commented Jan 21, 2026

VOTE +1

@Cole-Greer
Copy link
Contributor

I still have a few unresolved comments here which I believe need to be addressed before the TP4 Go GLV can be considered complete, however I'm ok with considering all of these out of scope of this PR, and as topics to be revisited later.

VOTE +1

@kenhuuu
Copy link
Contributor

kenhuuu commented Jan 26, 2026

This is a necessary change to make the Go driver compatible with TinkerPop 4 so my VOTE is +1.

@xiazcy xiazcy force-pushed the go-http-converge-conn-lang branch from 416570e to 3a32645 Compare January 26, 2026 23:46
…o 4.0 spec. Contains various code updates & fixes to enable HTTP connection & tests.
@xiazcy xiazcy force-pushed the go-http-converge-conn-lang branch from 3a32645 to 4430cee Compare January 27, 2026 00:04
@xiazcy xiazcy merged commit f8bb719 into master Jan 27, 2026
35 of 36 checks passed
@xiazcy xiazcy deleted the go-http-converge-conn-lang branch January 27, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants