Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenDAL Golang Binding #1472

Closed
1 task done
Xuanwo opened this issue Mar 4, 2023 · 12 comments
Closed
1 task done

OpenDAL Golang Binding #1472

Xuanwo opened this issue Mar 4, 2023 · 12 comments

Comments

@Xuanwo
Copy link
Member

Xuanwo commented Mar 4, 2023

We know golang doesn't play well with C/CPP/Rust but we can do our best to build a golang binding.

We will build a golang lib that can:

  • static/dynamic/build from source to libopendal with CGO
  • dlopen libopendal without CGO via purego

We expect to see users use it like:

package main

import (
    "fmt"

    opendal "opendal.apache.org/go"
)

func main() {
    fmt.Println(opendal.Xxxx)
}

Tasks

@odysa
Copy link

odysa commented Mar 30, 2023

What do you think about this example?
https://github.com/mediremi/rust-plus-golang

@Xuanwo
Copy link
Member Author

Xuanwo commented Mar 30, 2023

What do you think about this example?

Thank you for providing this example. This issue is currently blocked by missing a opendal-c lib.

@gaby
Copy link

gaby commented May 9, 2023

@Xuanwo is this still blocked after the merge of #1861 ?

@Xuanwo
Copy link
Member Author

Xuanwo commented May 9, 2023

@Xuanwo is this still blocked after the merge of #1861 ?

No, let's have a try!

@ImSingee
Copy link
Contributor

ImSingee commented May 9, 2023

Hope to see it 👀. And if need, I can give a help.

@Xuanwo
Copy link
Member Author

Xuanwo commented May 9, 2023

I'm a bit worried about how to release a go package. But we can start to make it work first!

@ImSingee
Copy link
Contributor

ImSingee commented May 9, 2023

@Xuanwo By the way, my suggestion about the CGO or dlopen

  1. If build with a CGO_ENABLED=1 environment (which can be determined by a cgo tag) then use CGO
  2. Or else, fallback to the dlopen

@Xuanwo
Copy link
Member Author

Xuanwo commented May 9, 2023

  1. If build with a CGO_ENABLED=1 environment (which can be determined by a cgo tag) then use CGO

How to build a rust project by cgo? (NOTE, opendal-c also requires rustc to build opendal first)

  1. fallback to the dlopen

So the problem becomes how to release opendal-c itself (users maybe need to have opendal-c lib at local first)

@ImSingee
Copy link
Contributor

ImSingee commented May 9, 2023

@Xuanwo Oh, so sad about the status😂

Maybe we should wait until we have something like libopendal.so or libopendal.a. And after that, everything will be simple (not requires user to build from rust).

@Xuanwo
Copy link
Member Author

Xuanwo commented May 9, 2023

Maybe we should wait until we have something like libopendal.so or libopendal.a. And after that, everything will be simple (not requires user to build from rust).

Yes, they are what I'm worry about. But we can start our work first anyway~

@Xuanwo
Copy link
Member Author

Xuanwo commented Jun 18, 2023

I start a PR here for comments: #2488

@Xuanwo
Copy link
Member Author

Xuanwo commented Sep 28, 2023

work has been started at #3205

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

No branches or pull requests

4 participants