profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/paulkernfeld/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Paul Kernfeld paulkernfeld Somerville, MA paulkernfeld.com I like Rust, machine learning, Python, and statistics

paulkernfeld/contiguous-data-in-rust 55

An opinionated guide that tries to help you choose the best way to store contiguous data in Rust

paulkernfeld/bitcoin-script-explorer 26

A tool to help programmers learn Bitcoin Script.

paulkernfeld/bfgs 16

A pure Rust implementation of the BFGS optimization algorithm

paulkernfeld/bitcoin-nanopayment 13

A probabilistic Bitcoin nanopayments library in Node using the Bitcoin-Qt RPC API

paulkernfeld/burnie 6

An SPV Bitcoin burn verification library built on webcoin

deffen3/rally_game 3

Creating my first "game-engine game". First time using Rust, Amethyst, and Entity-Component-System.

paulkernfeld/burn-stream 3

A world-writable append-only log using burned bitcoins

paulkernfeld/burn-name 1

Simple decentralized username registration by burning bitcoins

issue commentpaulkernfeld/contiguous-data-in-rust

Mention HeaderVec?

Thanks for sending the link! When adding this, I'd want to see two things:

  1. What use cases does it excel at? There are many ways to implement graph data structures, so particular examples might be helpful.
  2. Is the library battle-tested enough to be sure that it's robust and usable? For example, is there a way that the unsafe logic could be safely encapsulated?
makoConstruct

comment created time in a month

issue commentpaulkernfeld/contiguous-data-in-rust

arrayvec vs tinyvec

Ah, thanks for the clarification. Looks like there is a feature request to make a copyable arrayvec::ArrayVec so it's actually plausible that arrayvec will get this. Overall there are a lot of small differences between tinyvec and arrayvec, but I think it would be too detailed to describe all of them.

chinoto

comment created time in 3 months

issue commentpaulkernfeld/contiguous-data-in-rust

arrayvec vs tinyvec

I found tinyvec because of your guide, but I'd like to note that the difference isn't just that its elements must implement Default, they must also implement Copy (mutually exclusive with Drop).

The program below makes me think that elements in tinyvec::ArrayVec don't need to implement Copy because String does not implement Copy. Does this understanding sound correct?

I was helping someone in Discord who needed a type that could vary in length and be Copied.

If by varying in length you mean that the type is not Sized, you probably wouldn't be able to store that type in an array-like data structure because they will all require that elements have a known size. To store objects with a dynamic size, you'd need some kind of way to keep track of the start and end of each object, i.e. an allocator.

#!/usr/bin/env run-cargo-script
//! https://crates.io/crates/cargo-script
//!
//! ```cargo
//! [dependencies]
//! tinyvec = "1.2.0"
//! ```
fn main() {
    tinyvec::ArrayVec::<[String; 4]>::new();
}
chinoto

comment created time in 3 months