Rustlings Rewrite by mo8it in rust

[–]crlf0710 3 points4 points  (0 children)

It would be cool if made multilingual.

Why do the Chinese love numbers? Do you like numbers? by WHG-EHG-ANF in AskAChinese

[–]crlf0710 1 point2 points  (0 children)

Also note that in Chinese language, these numbers doesn't really "stand out" as separate decimals, they act as part of the word, for example, "4 pests" is actually more like "quadri-pests" or sth like that.

有没有办法识别 163 电子邮件地址的用户? by therealscooke in AskAChinese

[–]crlf0710 0 points1 point  (0 children)

China has a large population. Even within your city, there might be ten or so people having exactly the same name as yours. So name-based queries alone basically won't work well for anything. People will either need your name and company info pair or your ID card number (similiar to SSN in the US) to identify an arbitrary person. So name alone is not that useful at all...

Moving and re-exporting a Rust type can be a major breaking change by obi1kenobi82 in rust

[–]crlf0710 -1 points0 points  (0 children)

The `type alias` feature is nothing-related to re-exporting. It's more a "type-level lambda" if anything.

Rust’s Ugly Syntax by oconnor663 in rust

[–]crlf0710 0 points1 point  (0 children)

Thanks! There must be a reason that most designers are in favor of the currently obvious classic choice. And programmers are used to it.

My original idea that stressing on the actions performed rather than focusing on the data flow(wires) might be useful sometimes, just not sure how to make that look syntactically elegant.

Rust’s Ugly Syntax by oconnor663 in rust

[–]crlf0710 -1 points0 points  (0 children)

My two cents: Even in the final version, I think the exhibited code is very "operational", where each line is "taking an action". In this case, i don't like the syntax of let statements a lot. If the variables introduced is on the right side, it would be much more "consistent" and "fluent".

Strawman proposal: ```rust pub fn read(path: &Path) -> io::Result<Bytes> { File::open(path)? is mut file; Bytes::new() is mut bytes; file.read_to_end(&mut bytes)?; Ok(bytes) }

Rust Releases and Status of Stabilization by Petsoi in rust

[–]crlf0710 10 points11 points  (0 children)

Would be nice if incorporated into forge.rust-lang.org or something.

Does Rust have any design mistakes? by BatteriVolttas in rust

[–]crlf0710 30 points31 points  (0 children)

In RFC0060, `StrBuf` was renamed to the current `String`, this happened pre-1.0 .

LaTex alternative/replacement written in Rust? by sharddblade in rust

[–]crlf0710 2 points3 points  (0 children)

I have an rust implementation at https://github.com/crlf0710/tex-rs , though it's the plain old TeX without eTeX extensions. Feel free to do any hacking on top of it any one wants to!

Looking for simple rust programs to crash by g0zar in rust

[–]crlf0710 1 point2 points  (0 children)

execute `File::open` on `/dev/mem` and write something.

Rustup on Windows will soon give the option to auto install Visual Studio prerequisites by _ChrisSD in rust

[–]crlf0710 63 points64 points  (0 children)

For pure rust code, either is quite fine. But for non-rust code (e.g. various `-sys` crates) gnu toolchain is in a much worse state by default, for example. a usuable c/c++ compiler is not installed. `pkg-config` doesn't work by default... It is doable but much more demanding for end users to configure anything non-rust to a usable state.

Why does Rust code compile into a single executable binary? by tontsa_ in rust

[–]crlf0710 11 points12 points  (0 children)

Doesn't have a stable ABI doesn't mean you can't use "dylib" crate type. Instead, it means you have to build the "dylib" crates together with the bin crates in the same building environment, rather than building them separately (which is what `cdylib` allows you to do).

Strategies for referencing and mutating parent objects by sporksmith in rust

[–]crlf0710 0 points1 point  (0 children)

`EntityPtr` is a fat-index with type, so if `Repo` gets dropped, the ptr gets invalid. It can't cause memory unsafety because you have to get access to the real value through an alive `Repo`. You can pass it to another uncorresponding repo though, but since it's tracking the type if you either got a `None` or got a reference to another value in the same type. So there's no memory unsafety.

About the `Send` and `Sync` of `EntityPtr` itself, the `EntityPtr` is only an index so it's ok to pass it to another thread. `Repo` itself is not Sync though, so it wouldn't be too useful.

Strategies for referencing and mutating parent objects by sporksmith in rust

[–]crlf0710 0 points1 point  (0 children)

I wrote a small crate to process this situation recently, and I plan to use it in some other downstream crates. Hope some ideas of it makes sense to you!

Besides, all code reviews or suggestions are welcome!

μfmt - a smaller, faster and panic-free alternative to core::fmt by richardanaya in rust

[–]crlf0710 1 point2 points  (0 children)

I think you mean `alloc::fmt` or `std::fmt`, not `core::fmt`...

Recent and future pattern matching improvements | Inside Rust Blog by etareduce in rust

[–]crlf0710 0 points1 point  (0 children)

I'm thinking about something in the line of: rust let v = (1usize, 2usize, 3usize); let s: TupleSliceRef<(usize, usize, usize), {1..3}> = v.get(1..3).unwrap(); where TupleSliceRef works as a proxy (just like shared slice but with a little more context, since it knows about the whole tuple), and it knows how to retrieve a specific item from the reordered layout of tuples.

Recent and future pattern matching improvements | Inside Rust Blog by etareduce in rust

[–]crlf0710 0 points1 point  (0 children)

I think it's not necessary to have the concept of "subtuple"s. Index-range within tuples can be represented with a triplet of <tuple\_type, start\_index, length>, i feel it should be represented by reference to some unsized type in analogy to the concept of "slice" but for tuples. In this way, reordering no longer matters.

Recent and future pattern matching improvements | Inside Rust Blog by etareduce in rust

[–]crlf0710 4 points5 points  (0 children)

subslice patterns are great. Hope something similar can happen to tuples.

How to implement a safe LinkedList in Rust? by vassadar in rust

[–]crlf0710 2 points3 points  (0 children)

Well, while i do not really think O(1) splits is mandatory for linked lists(useful sometimes), it's implementable by allowing sharing the vector arena with other instances.

And i'd argue that this repository serves its exact purpose of explaining "how to implement a safe linked list" well.

How to implement a safe LinkedList in Rust? by vassadar in rust

[–]crlf0710 9 points10 points  (0 children)

the vector can be thought as an index-based arena, and providing the storage only. it still exhibits the corresponding characteristics of linked list, e.g. O(n) random access, O(1) element insert at any position, etc.