GithubHelp home page GithubHelp logo

Comments (3)

richardpringle avatar richardpringle commented on September 16, 2024

How would state across multiple simulator calls be stored?

@dboehm-avalabs and I chatted about this a bit. You should be able to have a State struct that implements all the interfaces (mutable, view, etc) that is simply instantiated with a few function pointers. Those function pointers can come from the Rust side of the simulator. I'm pretty sure you can even use a function pointer to a closure, though how to do so soundly is less clear.

In any case, you should essentially be able to inject the state-dependency on instantiation of the cgo wrapper around the runtime.

Does that make sense?

from hypersdk.

richardpringle avatar richardpringle commented on September 16, 2024

gRPC

Should note that shared types are defined in protobufs. You would still need to spin up the server via Rust, but that should almost be trivial.

from hypersdk.

samliok avatar samliok commented on September 16, 2024

@dboehm-avalabs and I chatted about this a bit. You should be able to have a State struct that implements all the interfaces (mutable, view, etc) that is simply instantiated with a few function pointers. Those function pointers can come from the Rust side of the simulator. I'm pretty sure you can even use a function pointer to a closure, though how to do so soundly is less clear.

so essentially you pass in the struct with method pointers through FFI, and then in go you reconstruct that interface by referencing those function pointers.

from hypersdk.

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.