iceoryx2 icon indicating copy to clipboard operation
iceoryx2 copied to clipboard

Go language binding

Open andrew-ares opened this issue 1 year ago • 8 comments

Is there a plan to do this? It should be doable after #210 closed.

andrew-ares avatar May 29 '24 03:05 andrew-ares

@TENX-S

Is there a plan to do this?

There is now :smile:! In our roadmap, we listed all the languages that came to our mind, and Go just slipped it, partly because I think none of our core contributors ever got in touch with Go.

Would you be willing to help us out? Maybe you could push the Go language binding here or, as an alternative, review the corresponding pull requests — this would take much more time since we currently have other tasks and would need to learn the Go basics as well.

The tasks that would need to be done:

  1. Add the files required for the language binding under iceoryx2-lang/go (see here, our intermediate state: https://github.com/elBoberido/iceoryx2/tree/iox2-210-create-c-language-binding)
  2. Port all examples from examples/rust to Go and store them under examples/go
  3. Integrate examples into CI so that they are running there as well (this can be done completely on our side)

If you decide to help us out here, you will make the whole iceoryx family very happy!

elfenpiff avatar May 29 '24 05:05 elfenpiff

Thank you for your response! I’m more than willing to help with the go binding. However, I noticed that the API in iceoryx2.h are not yet complete. Please let me know when you’re ready to release the C bindings.

In case you need some good examples of porting C library to Go by using cgo:

  1. https://github.com/mattn/go-sqlite3
  2. https://github.com/confluentinc/confluent-kafka-go/tree/master/kafka

andrew-ares avatar May 29 '24 06:05 andrew-ares

@TENX-S we have finished the iceoryx2 c binding, it is merged with examples and documentation, see: https://github.com/eclipse-iceoryx/iceoryx2/tree/main/examples and https://iceoryx2.readthedocs.io

Are you still interested in creating a go language binding for iceoryx2? If so we would be happy to support you with whatever you need.

With C/C++, our first goal was to recreate all the examples of Rust in C/C++. When they were working, we added the API stuff (we are still working on attributes and config) that was not part of the examples. Then the user can go into the examples folder, click on the language in the list they would like to use and start coding.

elfenpiff avatar Aug 29 '24 13:08 elfenpiff

@TENX-S we have finished the iceoryx2 c binding, it is merged with examples and documentation, see: https://github.com/eclipse-iceoryx/iceoryx2/tree/main/examples and https://iceoryx2.readthedocs.io/

Thanks for the information. I'm gonna play with these examples and see what I can do.

andrew-ares avatar Sep 01 '24 01:09 andrew-ares

Hello, I currently need to implement a subscriber in Golang, but due to my limited coding experience, understanding iceoryx2 is a bit difficult for me at the moment. I’m not sure how to implement it, and I don’t fully understand how to use FFI. Is it possible to use cgo to implement a Golang subscriber? I’d be happy to offer a reward for this

Zunea avatar Feb 25 '25 20:02 Zunea

@xieyuschen @Zunea @TENX-S Pinging you all since you were interested in the Go language bindings.

The current state is that we do not have the funding to work on the go binding, but we can drive this feature as project lead, guide you through the development, and help you with code reviews and some pair programming.

The first step would be to get Go as a language for iceoryx2 up and running, meaning:

  • setup a Go target in our CI
  • define a static code analysis tool and coding guidelines
  • define the testing framework we are going to use
  • write a mini hello-world lib as starting point

When this is done, we can start with the next step and discuss how the Go language bindings shall be realized. One way would be to utilize the existing C language binding and build an abstraction on top, like we did with C++ - if this is possible and makes sense for Go?! (I am unfamiliar with Go).

We would have three options.

  1. One or all of you would give this a try and we support you as much as we can.
  2. One of you would be able to help us fund this feature, in this case get in contact with us (see Readme - commercial support section)
  3. I can create a Reddit post with a public request for help, and see if we find someone who would be interested in the implementation, and then I would follow this plan with them.

elfenpiff avatar Mar 07 '25 03:03 elfenpiff

@xieyuschen @Zunea @TENX-S Pinging you all since you were interested in the Go language bindings.

The current state is that we do not have the funding to work on the go binding, but we can drive this feature as project lead, guide you through the development, and help you with code reviews and some pair programming.

The first step would be to get Go as a language for iceoryx2 up and running, meaning:

  • setup a Go target in our CI
  • define a static code analysis tool and coding guidelines
  • define the testing framework we are going to use
  • write a mini hello-world lib as starting point

When this is done, we can start with the next step and discuss how the Go language bindings shall be realized. One way would be to utilize the existing C language binding and build an abstraction on top, like we did with C++ - if this is possible and makes sense for Go?! (I am unfamiliar with Go).

We would have three options.

  1. One or all of you would give this a try and we support you as much as we can.
  2. One of you would be able to help us fund this feature, in this case get in contact with us (see Readme - commercial support section)
  3. I can create a Reddit post with a public request for help, and see if we find someone who would be interested in the implementation, and then I would follow this plan with them.

hi @elfenpiff , glad to see your invitation, recently I'm quite busy on my current job. But i will find some time to help setup a go target in our ci this month. By the way, do you expect a bazel usage in go as well, as I saw we have supported bazel in rust. For me, I don't think that's necessary:)

xieyuschen avatar Mar 07 '25 03:03 xieyuschen

@xieyuschen I expect that there will be Bazel users but we should face this challenge when it actually arises. For now I suggest ignoring Bazel, and get something working first.

elfenpiff avatar Mar 07 '25 05:03 elfenpiff