profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/jerel/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.
Jerel Unruh jerel Toyota Connected Texas/Missouri jerel.co Building connected car tech at Toyota Connected.

jerel/ember-cli-loading-slider 116

A YouTube like loading indicator for EmberJS packaged as an Ember CLI add-on.

jerel/ember-cli-clock 30

Make the passing of time observable in your Ember app.

jerel/ember-storage 29

Store data in localStorage or sessionStorage and if using localStorage also synchronize it between browser tabs.

jerel/ecto_fields 23

Provides common fields for Ecto

jerel/ember-cli-growl 20

A growl notification system for EmberJS packaged as an Ember CLI add-on.

jerel/banners 2

The Banners module is a url driven way of displaying images on your site

jerel/CodeIgniter 1

EllisLab's Open Source PHP Framework

jerel/devcomo-ember 1

Slides for a talk I gave at the DevCoMO meetup in Columbia Missouri

jerel/distance 1

Elixir library for various distance calculations

push eventjerel/serde-reflection

Jerel Unruh

commit sha d3cc7eb230eb2ece13a18b59ac7c4de7077bf41a

Store implementation code in lib/src/ directory

view details

push time in 2 days

issue commentdtolnay/inventory

Feature request: support for extern use

@Bajix thats's correct, the crate is parsed here from an outer attribute and is used here in the path as macro variable #prefix in the #prefix inventory::submit({ #expr }); statement (Rust allows spaces in paths so the gap after prefix is fine).

Bajix

comment created time in 3 days

issue commentdtolnay/inventory

Feature request: support for extern use

I just ran into this as well and while reading the inventory source found that this is supported via an attribute. This is how my [working] project is now configured:

// acme_macro/src/lib.rs
#[proc_macro_attribute]
pub fn my_macro(_attrs: TokenStream, input: TokenStream) -> TokenStream {
  let out = quote! {
    ::acme::inventory::submit! {
      #![crate = ::acme]
      // additional plugin code goes here
    }
  }

  // other macro work
}

// acme/src/lib.rs
pub use inventory;
pub use acme_macro::my_macro;

// some_crate/src/bin.rs
use acme::my_macro;
Bajix

comment created time in 4 days

pull request commentsunshine-protocol/allo-isolate

Add support for DartNativeExternalTypedData to enable zero-copy buffers

@shekohex ah, ok. I was surprised that CI failed this last time because I ran clippy and fmt locally. Yes, it's ready as far as I'm concerned.

jerel

comment created time in 7 days

Pull request review commentsunshine-protocol/allo-isolate

Add support for DartNativeExternalTypedData to enable zero-copy buffers

 impl IntoDart for Vec<i8> {     } } +impl IntoDart for ZeroCopyBuffer<Vec<u8>> {+    fn into_dart(mut self) -> DartCObject {+        self.0.shrink_to_fit();+        let length = self.0.len();+        assert!(length == self.0.capacity());+        let ptr = self.0.as_mut_ptr();+        std::mem::forget(self);

Good idea, I switched to ManuallyDrop

jerel

comment created time in 8 days

PullRequestReviewEvent

push eventjerel/allo-isolate

Jerel Unruh

commit sha d693610723f9d360f619f4346aaeb83cb05e16bf

Fix lint and clippy suggestions

view details

Jerel Unruh

commit sha c46549facc08a15cf8a23b5671b5e3cd6e6774fd

Export ZeroCopyBuffer at lib root and switch to ManuallyDrop

view details

push time in 8 days

push eventjerel/allo-isolate

Jerel Unruh

commit sha f46c8d65440a61f9739b12372de4415675f3e834

Call the deallocation callback from the test vm

view details

push time in 8 days

push eventjerel/allo-isolate

Jerel Unruh

commit sha 33468cf447fc0148b5b3cd4e1c319897feda9fdb

Add ZeroCopyBuffer type to provide a backwards compatible API for raw buffers

view details

push time in 8 days

push eventjerel/serde-reflection

Jerel Unruh

commit sha 22b79c8646b591b090326e212768827d19c364e1

Update == and hashCode

view details

push time in 22 days

push eventjerel/serde-reflection

Jerel Unruh

commit sha 5d917be42568c94c3130cae22be5dc4e708e0931

Make generated Dart classes immutable

view details

push time in 22 days

push eventjerel/serde-reflection

Jerel Unruh

commit sha 2e8a14191981750bfc75203d3ca50eb931f59182

Add a toString implementation to each generated Dart class

view details

push time in 22 days

push eventjerel/serde-reflection

Jerel Unruh

commit sha d7ac9bf2f8b88e187dbd8686094e91f338922ad0

Rename missed CamelCase Dart files

view details

push time in 23 days

delete branch jerel/serde-reflection

delete branch : refactor

delete time in 23 days

push eventjerel/serde-reflection

Matt Ickstadt

commit sha 13c907df24f5875f86720fdaa08d429578cbdf09

CSharp: Add Clone methods (#91)

view details

Mathieu Baudet

commit sha d5921ed8dd1942e3ffa3a08a1b5bc206ca9360e2

migrate to rust 1.52.1

view details

Mathieu Baudet

commit sha 416a231b9f22af89b1a6a5f32ab7d96af4ab2762

[serde-generate] release version 0.19.2

view details

Mathieu Baudet

commit sha ee146df0be4f80bac2ce66dd05a91b0f69b28d5d

[serde-reflection] add trace_simple_type

view details

Mathieu Baudet

commit sha 35661cba52e0cc774007a87edd64b1ed8a09bd4c

[serde-reflection] simplify code after https://github.com/rust-lang/rust/issues/68354

view details

Mathieu Baudet

commit sha 6205d6311601c6bb97ae478da447c1f8881209db

[serde-reflection] fix repeated tracing of values

view details

Mathieu Baudet

commit sha def69bcee5281c4ba71f822d6b736fa02509740b

[serde-reflection][nit] rename variable to avoid type confusion

view details

Mathieu Baudet

commit sha 5d063583436051624bfdff4c7908ebe648da3025

run cargo update

view details

Mathieu Baudet

commit sha ade1415491d72848e725bf05638492877887a6ae

cargo upgrade + fix test

view details

Mathieu Baudet

commit sha 90cf4f0cce4f747849b0a7daa8abc6da835d5206

[serde-reflection] prepare release v0.3.3

view details

Mathieu Baudet

commit sha 53578f208c484dbd1f82950149e762b0b607e84d

improve documentation

view details

Mathieu Baudet

commit sha ef421d9917cf260c11f2bd6495f9a82f6c0071da

[releases] serde-generate v0.19.3 and serde-name v0.1.2 (dependency updates)

view details

Mathieu Baudet

commit sha 9de715ca33130a8c46faa1cd4909d8f24f99c979

update README

view details

Mathieu Baudet

commit sha 969e50eadb7c19d0408915ea4f21d30426136fef

[serde-generate] fix cross-reference in documentation

view details

Mathieu Baudet

commit sha 1694c58d103eb76dff6ef01638b73dbc46eec181

[serde-reflection] fix cross-reference in documentation

view details

fanngyuan

commit sha a1edee395ae1cef780aebd9f03ae5062e3243f60

add dart runtime

view details

fanngyuan

commit sha d84cc83cace7c9bd8b9f86ed8a9bab9573ca62d1

add more test

view details

fanngyuan

commit sha 0cf8e7b644f2083e48769598cea22530d03708ed

add dart generator

view details

fanngyuan

commit sha 4f9632183beaa7baed4fbd84040660d6dec7e9b1

remote useless code

view details

fanngyuan

commit sha 165a8402d967dc895806b9a5244ae1707282006e

fix enum problem

view details

push time in 23 days

create barnchjerel/serde-reflection

branch : refactor

created branch time in 23 days

push eventjerel/serde-reflection

Jerel Unruh

commit sha 9fc8d2f7dca4ddcfcd68bf0782031ca7d8c97673

Update to use Dart conventions such as snake_case filenames

view details

push time in 23 days

pull request commentsunshine-protocol/allo-isolate

Add support for DartNativeExternalTypedData to enable zero-copy buffers

I would think that a ZeroCopyBuffer wrapper would be better than replacing Vec<u8> because there's likely still use cases where the existing copy approach is desirable. For example in some benchmarks with large amounts of data (100k structs) @cmc5788 observed frame drops during the call back to Rust to free the Rust owned memory, so I would think that letting the user choose the approach would be good.

I can add that to this PR if you like.

jerel

comment created time in 23 days

push eventjerel/serde-reflection

Jerel Unruh

commit sha 5ce5d2d26c5800bcfabd434f7c4ee4c9fa659081

Remove Optional lib and format identifiers per Dart style

view details

push time in 24 days

PR opened sunshine-protocol/allo-isolate

Add support for DartNativeExternalTypedData to enable zero-copy buffers

Since there is already an impl for Vec<u8> I'm not sure of a good way to add this zero-copy approach to into_dart without it conflicting with the existing copy approach so I've just included a working example below. For now we're doing the work shown in application code and passing the resulting DartCObject to isolate.post() and it works well. This PR adds the necessary types to enable that.

The Dart VM exposes both the DartNativeTypedData and the DartNativeExternalTypedData as a Uint8List but in the DartNativeExternalTypedData case the finalizer calls the provided callback to deallocate.

The implementation that sends a zero copy mutable buffer to Dart looks like this:

impl IntoDart for Vec<u8> {
    fn into_dart(mut self) -> DartCObject {
        self.shrink_to_fit();
        let length = self.len();
        assert!(length == self.capacity());
        let ptr = self.as_mut_ptr();
        std::mem::forget(self);

        DartCObject {
            ty: DartCObjectType::DartExternalTypedData,
            value: DartCObjectValue {
                as_external_typed_data: DartNativeExternalTypedData {
                    ty: DartTypedDataType::Uint8,
                    length: length as isize,
                    data: ptr,
                    peer: ptr,
                    callback: deallocate_rust_buffer,
                },
            },
        }
    }
}
+17 -0

0 comment

1 changed file

pr created time in 25 days

push eventjerel/allo-isolate

Jerel Unruh

commit sha 9f944594fa3b87a2ecf0398c3191e388d5b1a94c

Add deallocation callback to ffi module

view details

push time in 25 days

push eventjerel/allo-isolate

Jerel Unruh

commit sha 768761c81822eadbf317144a868d5315ba0b7a5f

Add the DartNativeExternalTypedData to enable sending raw buffers with zero copy

view details

push time in a month

fork jerel/allo-isolate

Run Multithreaded Rust along with Dart VM (in isolate) 🌀

fork in a month

issue commentsunshine-protocol/allo-isolate

Passing structs through an isolate.post()

Thanks for the quick feedback, this was very helpful!

jerel

comment created time in a month

push eventjerel/serde-reflection

Jerel Unruh

commit sha b6656f90f8321c6bb61f8941e895203ee9b7d023

Fixed some deserialization bugs

view details

push time in a month

push eventjerel/serde-reflection

Jerel Unruh

commit sha 2af60ff0a309b745b2a64d91e6721ed216b4afdc

Converting to null safety

view details

push time in a month

fork jerel/serde-reflection

Rust libraries and tools to help with interoperability and testing of serialization formats based on Serde.

fork in a month

issue openedsunshine-protocol/allo-isolate

Passing structs through an isolate.post()

@shekohex I've looked through dart-bindgen, allo_isolate, and the flutterrust projects and one example that I can't find is that of passing a struct to an isolate. Is that currently possible?

Example:

struct Location {
  lat: f64,
  lng: f64,
  name: String,
}

let location = Location {
  lat: 20.1,
  lng: 52.2,
  name: String::from("test"),
};

let isolate = Isolate::new(port);
isolate.post(location);

created time in 3 months

issue commentshekohex/flutterust

Moving to dart FFIGen

I just ported our project to use ffigen 1.0 since dart-bindgen is deprecated and this worked well for allo_isolate:

// manually added this in lib.rs of our rust project
#[no_mangle]
pub unsafe extern "C" fn store_dart_post_cobject(ptr: DartPostCObjectFnType) {
  allo_isolate::store_dart_post_cobject(ptr)
}

and then in the Dart code:

final example = NativeLibrary(DynamicLibrary.open('libfoo.so'));

// note that this now uses the address int because of the headers ffigen generates
example.store_dart_post_cobject(NativeApi.postCObject.address);
JoschuaL

comment created time in 3 months