Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Reto Trinkler
    @retotrinkler
    maximum of value
    Reto Trinkler
    @retotrinkler
    sry beginner here, for:
    let mut vec: Vec<i64> = vec![2, 1, 3];
    this would be vec.max_value()
    Reto Trinkler
    @retotrinkler
    awesome thanks @ozkriff
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    What do you guys think about using Rust to build a multiplayer game that runs cross-platform including Android?
    Andréy Lesnikóv
    @ozkriff
    @mhsjlw This is my plan for https://github.com/ozkriff/zoc so i think it's good idea :-)
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    @ozkriff That ... looks ... awesome!
    I was going to write a Voxel-style game, much like Minecraft, that uses the same (original, 2009 'classic') protocol.
    I think I may, it looks like it'd be fun
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    @ozkriff where do you recommend I get started for a 3D block-based game in Rust?
    Any engines, or should I straight up use opengl bindings.
    I'd also like cross-platform Mac/Linux/Windows/Android support
    actually windows doesn't matter as much but yeah
    Lilian Anatolie Moraru
    @lilianmoraru
    @mhsjlw There are a few engines, sec
    @mhsjlw Probably the oldest: http://www.piston.rs/
    Active community
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    thanks!
    kiss3d looks cool. If I tried compiling any of these with the NDK toolchain (android) do you know if any of them have Android support out-of-the box?
    Lilian Anatolie Moraru
    @lilianmoraru
    Not sure about that. Some use SDL2, so, in theory they could, but not sure
    At least Rust doesn't have issues running on Android
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    yeah
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    for server-side, is Rust a much better alternative then C in terms of speed, reliability and security? ex. I can handle more people on the Rust version of a server than C version of the server (assuming they're both written properly) and I can know that I have the safety and security that rust provides while still maintaining threading security and overflow/underflow security?
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    I've got some C++ code I've got to use :( any recommendations for what I should do? C glue code, or maybe https://github.com/mystor/rust-cpp ?
    LeonineKing1199
    @LeonineKing1199
    fn main() {
        println!("Hello, world!");
    }
    ==9674== Memcheck, a memory error detector
    ==9674== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
    ==9674== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
    ==9674== Command: ./hello-world
    ==9674== 
    Hello, world!
    ==9674== 
    ==9674== HEAP SUMMARY:
    ==9674==     in use at exit: 0 bytes in 0 blocks
    ==9674==   total heap usage: 21 allocs, 21 frees, 3,592 bytes allocated
    ==9674== 
    ==9674== All heap blocks were freed -- no leaks are possible
    ==9674== 
    ==9674== For counts of detected and suppressed errors, rerun with: -v
    ==9674== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
    All I literally compiled was the "Hello, world" example too O_o
    Peter Atashian
    @retep998
    @LeonineKing1199 Looks normal to me
    LeonineKing1199
    @LeonineKing1199
    Freaking 21 allocations just for printing a string?!
    Peter Atashian
    @retep998
    @LeonineKing1199 What's the number of allocations without the println!?
    LeonineKing1199
    @LeonineKing1199
    I'm just kind of shocked.
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    no leaks, I wouldn't be complaining
    :P
    Peter Atashian
    @retep998
    So we know how much is being spent on the entry point and such
    LeonineKing1199
    @LeonineKing1199
    How else do you print in Rust lol?
    no leaks, I wouldn't be complaining
    XD
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    because you're using macros, and allocating the char* in memory
    Peter Atashian
    @retep998
    I still say compare the number of allocations to the number without the println
    so you know how much it is really using
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    ^
    Peter Atashian
    @retep998
    Remember, a lot of stuff happens before your main function is even called
    LeonineKing1199
    @LeonineKing1199
    Oh wow, Rust's main loop is 13 allocations for me
    Which means 8 are for printing alone O_o
    Dude...
    Why?
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    easy, more allocations means a better language
    1 alloc in C is < 21 allocs in Rust
    LeonineKing1199
    @LeonineKing1199
    Freaking lol.
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    so technically speaking Rust > C because there are more allocations
    LeonineKing1199
    @LeonineKing1199
    I'm just so confused because I've no idea where they're coming from.
    Ghost
    @ghost~55c54e0e0fc9f982beaca52c
    the more memory that is leaked also determines the abilities of a language