News for hackers. Stuff that matters.
Re:Announcing Rust 1.6 by VeilEm on Thursday January 21, 2016 @04:59PM (#10948771)
Congratulations! I'm loving Rust, it's my go-to default language now. I'm going to start messing around with piston.rs to make some basic 2d games. I already wrote an irc bot with Rust.

For those wondering, stable just meant the API defined for interactions with some libraries were subject to change. It wasn't like a problem with using the APIs, it was just the developer has to know that new releases might change how they worked or if they would even be available in the future.

Re:Announcing Rust 1.6 by chocolatebunny on Thursday January 21, 2016 @05:20PM (#10948942)
How are the software libraries for Rust? What did you do for network access, string manipulation and GUI stuff?
Re:Announcing Rust 1.6 by VeilEm on Thursday January 21, 2016 @05:26PM (#10948993)
The string manipulation is good in Rust, but in Rust strings are unicode and characters are unicode codepoints. IRC is an ASCII protocol and so I went with using binary slices `[u8]` for parsing.

For network stuff I used openssl[0] and std::TcpStream [1]

I didn't use a GUI. I plan on using piston.rs[2] to build games but there are Qt, GTK+ and even Cocoa integrations for rust.

[0] https://crates.io/crates/openssl/

[1] https://doc.rust-lang.org/std/net/struct.TcpStream.html

[2] http://www.piston.rs/

Re:Announcing Rust 1.6 by fpoling on Friday January 22, 2016 @05:15AM (#10951875)
Yes, its a pity that Rust requires that strings must be UTF-8. Go designers got it right as their strings are just immutable sequences of bytes making them very suitable for network protocols and binary data.
Re:Announcing Rust 1.6 by heinrich5991 on Friday January 22, 2016 @06:50AM (#10952171)
That's what Rust has byte slices for: `b"abcdef"`
Re:Announcing Rust 1.6 by fpoling on Friday January 22, 2016 @07:30AM (#10952306)
One cannot use string library in Rust against byte slices. For example, regexp works only against strings making it unsuitable for processing, say, log files, that may contain non-utf8 bytes.
Re:Announcing Rust 1.6 by kibwen on Friday January 22, 2016 @02:01PM (#10954811)
This is somewhat incorrect, as Rust doesn't have a standard regex library. You're likely thinking of burntsushi's regex crate, which made its own decision to be Unicode-aware. There's no reason that someone couldn't come up with their own regex library (or fork burntsushi's, or just wrap an existing C regex library) that works as you desire.
Re:Announcing Rust 1.6 by heinrich5991 on Friday January 22, 2016 @11:49AM (#10953822)
Yea, also found that limitation of the regex library pretty annoying. But conceptually this has nothing to do with string slices being different from byte slices... It might encourage it though.
Re:Announcing Rust 1.6 by kbenson on Friday January 22, 2016 @12:14PM (#10954019)
FWIW, I think getting the underlying string representation right (and relatedly how it interacts with byte buffers/slices) is really hard. So far, I think Perl 6 probably has the most well thought out structure with regard to that, but they took a decade and a half and lots of testing to come up with what they did. Then again, how it works in Perl 6 is also a function of how the language functions, so it wouldn't be a a direct mapping of concepts, but there are some really good ideas there.
Re:Announcing Rust 1.6 by rjtobin on Thursday January 21, 2016 @05:28PM (#10949009)
There are wrappers for basically any C/C++ library you can think of. I found string support to be pretty great from the standard library (compared to C++), such as UTF-8 and string interpolation.

In terms of networking, I threw together a working console IRC client in about 60 lines of Rust (using standard library threads and TcpStreams). And I'm very much a Rust beginner. And Rust forced me to consider error handling in a way I wouldn't have otherwise.

I should also say that the community is unusually supportive: I've asked some questions on the IRC channel and got really helpful replies (and haven't noticed any of the snark that comes with a lot of IRC channels).

Re:Announcing Rust 1.6 by anonbanker on Thursday January 21, 2016 @05:36PM (#10949049)
from the #gimp IRC Jargon file:

irc client: Everyone's least favorite Gtk project. For whatever reason, at one time there were seven active projects to develop a Gtk irc client. Used to deride poor judgement in choosing projects or lack of knowledge about what's going on. Often used self-deprecatingly, as in "I know, I'll write an irc client."

Thanks for keeping the dream alive.

Re:Announcing Rust 1.6 by VeilEm on Thursday January 21, 2016 @06:22PM (#10949357)
I made an irc bot, not an irc client.

An IRC bot is a great way to learn a new programming language. You have to learn how to use threading or asynchronous operations to get multiple connections, you have to learn how to use TLS for secure connections, you have to learn how to manipulate strings, how to read configuration files. It's a super good project for learning.

Re:Announcing Rust 1.6 by chucksmash on Thursday January 21, 2016 @08:56PM (#10950222)
I think this would even be a good refresher project in languages one might otherwise be comfortable mentioning on one's resume. Thanks for the idea.
Re:Announcing Rust 1.6 by anonbanker on Thursday January 21, 2016 @08:51PM (#10950195)
you should throw it up on $repo_of_choice. I'd love to play with it in my channel.