Any plans for (new) java bindings?

Are there plans for generating Java bindings or in more general: how the bindings for other languages will be created and supported?

3 Likes

These will happen. First will be the nodejs bindings because these are needed for Safe Browser, but after that other language will follow although I don’t know how quickly.

2 Likes

Previously there was the ffi repo which was used to generate the bindings but now I cannot find it.
Is there some even rough doc how to build bindings for any language which can be used as a starting point?

I think @riddim had success doing this for python - maybe he can help.

1 Like

Hmm - sorry but my last attempts to get going with the ffi layer weren’t super fruitful and I’m thinking about waiting for a WASM interface to safe and utilising this instead of the (a bit unhandy to use) c ffi layer @DASK and me used a while back from python…

… I think (!) the current ffi repo is not a compatible ffi layer with the latest safe network…
(I hope someone from the team corrects me if this is not the case)

Edit:

To me this sounded like the plan of maidsafe might be to offer a Web assembly interface rather than the last c interface because that might be easier to use and to integrate (and easier to be interoperable between the different OSes/architectures)

Edit 2:

Hmhmm but not sure about what’s possible with wasm and what isn’t and how the plan forward is right now in regards of APIs… Maybe they need a bit of time for the current release to finish some things first before working on the api again (but the browser needs to talk to the network too - so some form of api must exist somewhere [fairly soon])

1 Like

Well, I guest we will just have to wait few more weeks and let the guys “recover” from the testnet launch :slight_smile:

1 Like

Most certainly yes - I guess latest as soon as we see a browser that will be the moment to ask for an API description and steps to compile/contact it again

1 Like

Thanks for your interest in this guys. Always happy to see people come forward to help.
For now, language support is not part of our short-term goals. We are considering going the WASI/WASM route but there’s no definitive plan in place.
We want to focus on solidifying the network using the CLI as an entry point and then extend support for other frontend apps and language API :slight_smile:

4 Likes

Thanks for the update @lionel.faber. Correct me if I’m wrong, but isn’t the WASI/WASM route blocked until WASI supports network protocols, and AFAIK there’s no chance of that happening soon? In which case updating ffi bindings seems the only option for the foreseeable future.

Also, are the nodejs bindings required for Safe Browser, in which case we can expect those at least in the very short term?

Those bindings are very much required for the browser. It’s an Electron app, so it needs the bindings to use the Rust Safe APIs. I’ve worked a little on the browser with @joshuef, but I do not have much experience with Electron, React and Redux. I used the bindings in the browser to try and test a simple web app and got that to work. As far as I know getting the browser to a usable state should not be that much of an operation, but I guess it doesn’t quite have full priority yet (but will be in the near future).

4 Likes

I’m working on FFI for Safenet if someone would like to help. I aim at Red bindings, but FFI layer will be a byproduct.

4 Likes

I saw this a month back and it piqued my interest. I didn’t dig any deeper though.

https://www.reddit.com/r/programming/comments/lplubp/how_i_built_a_telnet_chat_server_in_2021_with/?utm_medium=android_app&utm_source=share

Lunatic is using an experimental socket API, but I will also add WASI-sockets once it’s stable.

The biggest issue with currently using sockets is that Wasm doesn’t have an API for spawning threads. Lunatic works around this by introducing a concept of Processes (green threads).

3 Likes

whats current build environment like?

download safe browser for testing, make web app, then have to host own local network?

There no alpha or beta or Test 13 networks to use for testing now?

I think currently you only have command line interface or Rust API options. The browser needs updating when JS bindings are updated (along with any other language bindings).