These are chat archives for rust-lang/rust

8th
May 2018
bspeice
@bspeice
May 08 2018 05:10
I could be going crazy, but it looks like serde_json is producing a quote-escaped version of JSON when to_string is called. Is there a way to prevent this behavior?
scottmcm
@scottmcm
May 08 2018 07:05
@bspeice are you writing out the string with {:?}?
Dumindu Madunuwan
@dumindu
May 08 2018 10:10
Denis Lisov
@tanriol
May 08 2018 10:14
Sure you can call it recursively, what's the problem?
However, I'd suggest that an explicit loop may be a better idea than recursion :-)
To avoid the possibility of a stack overflow.
Dumindu Madunuwan
@dumindu
May 08 2018 10:17
Got it, thanks :)
bspeice
@bspeice
May 08 2018 10:58
@scottmcm I'm not, though when I do write out with debug print it's double escaped.
James Albert
@jamesalbert
May 08 2018 17:11
I just had a quick, simple question about rust-wasm. I understand it's still very early, but is the concept to offload ALL javascript to Rust->wasm? Including all JS ui and logic, or is it more like a bottleneck optimizer of sorts?
I've only been poking around, thought I'd see what the community thought of it
Ravi Shankar
@wafflespeanut
May 08 2018 17:24
The latter - for bottlenecks
Although, there are attempts to support using actual JS objects
Dan Kaplun
@dbkaplun
May 08 2018 17:25
you can do isomorphic rust (with e.g. yew) but you still need a couple of lines of js, but it's not extremely stable yet
James Albert
@jamesalbert
May 08 2018 17:31
@wafflespeanut that's what I suspected. Cool Cool @dbkaplun I'll check that out. I'd have to read up more on rust.
apiraino
@apiraino
May 08 2018 17:50
@jamesalbert me too, I have a couple of links in my WASM-related stash
(maybe you already know this already)
it's interesting because it gets you directly to the code, without all the hassle of the toolchain. you can also inspect the wasm binaries (cool)
Stephen Judkins
@stephenjudkins
May 08 2018 18:04
i'm building a small program I want to package as WASM. I'd like to include binary assets in the build and I expect something like include_bytes! should work just fine. But what if I'd like to include some extra build steps?
basically, I want to parse multiple files (with Rust code I've written), do some processing, and include output as a collection of constant byte arrays. what's the recommended approach for doing something like this?
Stephen Judkins
@stephenjudkins
May 08 2018 18:15
current thoughts on approach: use a build script [https://doc.rust-lang.org/cargo/reference/build-scripts.html] to parse the assets, and generate both files and some rust source with include_bytes! in it. but could it be done more easily directly in a macro?
Ethan Kravitz
@emkman
May 08 2018 21:02
I have project that build locally but during a docker build one package fails to compile with no useful output. Any suggestions on how to debug?
error: Could not compile `tiny-keccak`.

Caused by:
  process didn't exit successfully: `rustc --crate-name tiny_keccak /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tiny-keccak-1.4.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=02e0439983b6af98 -C extra-filename=-02e0439983b6af98 --out-dir /usr/src/artgraph/target/debug/deps -L dependency=/usr/src/artgraph/target/debug/deps --extern crunchy=/usr/src/artgraph/target/debug/deps/libcrunchy-53ad13544d0ada53.rlib --cap-lints allow` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: build failed
The command '/bin/sh -c cargo build --verbose' returned a non-zero code: 101
I have a (signal: 9, SIGKILL: kill) and a error code 101
but that's all I know