Giter Site home page Giter Site logo

Rust and Go implementations about urkel HOT 8 OPEN

handshake-org avatar handshake-org commented on August 11, 2024 2
Rust and Go implementations

from urkel.

Comments (8)

davebryson avatar davebryson commented on August 11, 2024 1

In case there's any interest, the latest Rust version now has the initial file store working:
ukel-trie. Not complete, but getting there.

from urkel.

chjj avatar chjj commented on August 11, 2024

Wow, totally awesome! Now we just need a C implementation and we have all the bases covered. :)

from urkel.

chjj avatar chjj commented on August 11, 2024

I noticed you added flags as a member of the node struct in the rust impl. That flags field probably isn't as necessary for rust. In node.js it's just meant to keep heat off of the javascript GC (having one field packed into bits is smaller than having multiple properties on the object). Rust probably has the luxury of making things a lot cleaner since it has no GC overhead.

from urkel.

adrianbrink avatar adrianbrink commented on August 11, 2024

It is possible to export a C api from the Rust implementation. That way we don't have to maintain an extra implementation. Even for other languages we can simply write thin wrappers around the C implementation.

Rust FFI
Rust FFI Examples

from urkel.

davebryson avatar davebryson commented on August 11, 2024

I noticed you added flags as a member of the node struct in the rust impl. That flags field probably isn't as necessary for rust.

Ahhh, ok. I need to work through that a bit more. I actually have some uncommitted refactoring and updates I'll add that to.

from urkel.

davebryson avatar davebryson commented on August 11, 2024

It is possible to export a C api from the Rust implementation. That way we don't have to maintain an extra implementation. Even for other languages we can simply write thin wrappers around the C implementation.

Haven't really thought about that much. Am trying to see how far I can get with a "safe" implementation.

from urkel.

adrianbrink avatar adrianbrink commented on August 11, 2024

Exposing methods to C is still safe. It only means that the Rust compiler does the memory layout in a way which is compatible with C. This is arguably the best part of the Rust FFI. It allows you to gradually replace old unsafe C code with safe Rust code.

from urkel.

davebryson avatar davebryson commented on August 11, 2024

@chjj Regarding flags, I can't seem to find any where in the code base where the setter node.leaf = ... is actually used. It appears flag values come solely from the node.pos setter, is that correct? Part of my confusion here is probably coming from me trying to grok the low level storage layout/format

from urkel.

Related Issues (9)

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.