These are chat archives for rust-lang/rust

20th
Jun 2016
Aditya Singh
@adiultra
Jun 20 2016 03:33
Thanx 😃 I found one in the answer text_io it has read!() Macro which does my thing
Ashutosh Kumar Gupta
@ashu01
Jun 20 2016 11:06
src/libstd/sys/unix/mutex.rs:58:60: 58:86 error: unresolved name libc::PTHREAD_MUTEX_NORMAL [E0425]
src/libstd/sys/unix/mutex.rs:58 let r = libc::pthread_mutexattr_settype(&mut attr, libc::PTHREAD_MUTEX_NORMAL);
^~~~~~
src/libstd/sys/unix/mutex.rs:58:60: 58:86 help: run rustc --explain E0425 to see a detailed explanation
error: aborting due to previous error
make: * [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.std] Error 101
on make i encountered theabove errors
src/libstd/sys/unix/mutex.rs:58:60: 58:86 error: unresolved name libc::PTHREAD_MUTEX_NORMAL [E0425]
src/libstd/sys/unix/mutex.rs:58 let r = libc::pthread_mutexattr_settype(&mut attr, libc::PTHREAD_MUTEX_NORMAL);
^~~~~~
src/libstd/sys/unix/mutex.rs:58:60: 58:86 help: run rustc --explain E0425 to see a detailed explanation
error: aborting due to previous error
make: * [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.std] Error 101
Peter Atashian
@retep998
Jun 20 2016 12:40
@ashu01 You'd probably be better off asking on IRC
Ashutosh Kumar Gupta
@ashu01
Jun 20 2016 13:11
okay @retep998
Regis Boudinot
@selfup
Jun 20 2016 16:17

Quick question, just to see the level of interest. I am working on a JSON Key Value store, which would be great for something like nickel or iron, and was wondering how interested you all would be? It's not quite ready yet, but we are getting close!

The idea is that you build a schema (public facing structs in a file) so that the library can infer the type (for serialization and deserialization) and can do business logic, and then store the JSON on the filesystem. read_table/create_table/update_table/append/find_by_id, delete_by_id/drop_table, etc..

Each table (file) can store multiple records, as the records property is a HashMap<String, T>, where String is the id, and T is the object you build/manipulate

Just wondering!

Ashutosh Kumar Gupta
@ashu01
Jun 20 2016 16:26
@selfup Explain it properly
LeonineKing1199
@LeonineKing1199
Jun 20 2016 16:29
Sounds like it's re-implementing Mongo in Rust, almost
Actually, that sounds like exactly what that is.
Ashutosh Kumar Gupta
@ashu01
Jun 20 2016 17:21
fn main(){ println!("ac{{}"); // Error println!("ac{{}}"); //working properly prints ac{} println!("ac{1123}"); //Error }
fn main(){
println!("ac{{}"); // Error
println!("ac{{}}"); //working properly prints ac{}
println!("ac{1123}"); //Error
}
can I consider this as a bug ?
Till Höppner
@tilpner
Jun 20 2016 17:33
@ashu01 - No, I don't think it looks like a bug. https://doc.rust-lang.org/std/fmt/index.html#escaping
Regis Boudinot
@selfup
Jun 20 2016 18:04
@ashu01 What do you mean by properly? I will post official documentation and write better language once the library is ready to be pushed to Crates.io
But for now, instead of: setting up Mongo, and getting a crate, generating a schema, and setting up the ORM - you just need one crate, define a schema, and you are good to go! This will not work on Heroku however..since it works on git history and once the dyno restarts the data will go away. Mongo is the same on Heroku anyways, since you need to sign up for an external server to connect to regardless.
This was more of poking around haha. @LeonineKing1199 it is pretty close to it. Mongo uses mmap since it is concurrent. I just write to the file system synchronously. Seems pretty fast so far. 88,000 ns/iter for writing a file, pushing data in said file, and reading the file.
Regis Boudinot
@selfup
Jun 20 2016 18:10

The data will live in the project directory, so there are no namespace issues if there are multiple applications on a single server.

The main purpose for this was to make it easy for Rustaceans that are into front end framework pass JSON back and forth, and delegate business logic on both the front end and the server side.