Coder Social home page Coder Social logo

Comments (9)

heri16 avatar heri16 commented on May 14, 2024 2

Thanks for the quick response. It's amazing what this library could do if it takes off in the Elixir/Golang community.

We are using it to work with AWS services where the quality of the rust-native drivers are not yet production ready (to use with Rustler NIFs). The startup I work at is comfortable with Golang, but we know how much more productive a true functional language with pattern matching can be. So my sell to management is for Golang on the code paths were every extra ounce of performance is critical, combined with the robustness of OTP.

Will test out your fix over the weekend.

I'm also comfortable with golang so if you are open to contributions, let's formulate some guidelines.

from ergo.

halturin avatar halturin commented on May 14, 2024

etf.Term is just an interface type. You don't need it. What exactly are you trying to do?

from ergo.

heri16 avatar heri16 commented on May 14, 2024

I think I was looking for how go Structs can be converted to an etf.Map via annotations/tags just like the built-in json lib and aws-ion marshaller.

See: https://www.digitalocean.com/community/tutorials/how-to-use-struct-tags-in-go

from ergo.

heri16 avatar heri16 commented on May 14, 2024

We use *string extensively and ergo seems to crash when any nested value is a *string.

from ergo.

halturin avatar halturin commented on May 14, 2024

Hmm. It's a very interesting case. Actually, the value should be dereferenced during the encoding process.
https://github.com/halturin/ergo/blob/master/etf/encode.go#L547

I'll take a look closer.

from ergo.

halturin avatar halturin commented on May 14, 2024

created issue #65

from ergo.

halturin avatar halturin commented on May 14, 2024

I think I was looking for how go Structs can be converted to an etf.Map via annotations/tags just like the built-in json lib and aws-ion marshaller.

ETF encoder encodes any struct to the erlang map using field name as a key.
as an example this kind of value

type test struct {
	A string
}

will be encoded like this

#{'A' => "example"}

from ergo.

halturin avatar halturin commented on May 14, 2024

may I ask you to check out my fix of #65? just merged into the master

from ergo.

halturin avatar halturin commented on May 14, 2024

not valid any more

from ergo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.