Posts
179
Following
26
Followers
378

@vbabka I immediately got a “Stack overflow” and the println! only went 3 deep. Maybe it was smarter to know it would go further?

1
0
0

@acmel Rust is very much becoming dominate (especially by my employer). I like the guarantees that Rust brings, so I’m working on learning it. I bought a book on Rust, which really gets into the details of the language, but honestly, isn’t a good way to learn the language. I found that learning by example is a much better approach.

I have a non trivial program I’m writing (it was one of the programs I had to write for my interview), and I’m hitting all the fun corner cases with it. I’m trying hard to keep an open mind, but for someone that’s been programming C for over 3 decades, it’s really hard to do so. ;-)

0
0
1

@ljs @acmel I thought that cover said SYSTEM ADMIN

0
0
2

And today I learn that Rust does not like recursive functions :-(

(In user space, I’m recursive function happy!)

1
0
1

@acmel @ljs I was thinking of shimmy()

0
0
1

Continuing my Rust Rants :-)

It’s unfortunate that move is a keyword. As I write my little programs, I found that that’s a common function name I use. Now I need to come up with something else. adjust ?

4
0
0
@mripard also, this is really the exception and not the norm. I find saving these programs in subversion (svn) is more convenient than git. It's best with a central repository than trying to keep several machines in sync.
0
0
0
@mripard I totally agree, and why I've been an advocate. But I like to write these small programs, sometimes to just learn and sometimes to do a small job. All these are mostly throwaway code (but I keep for reference). In this case C/make is so much more convenient than Rust/cargo.
1
0
0

There’s gotta be a better way…

use std::env;
use std::path::Path;

fn usage(arg: &String) {
    let path = Path::new(arg);

    println!("usage: {} a b", path.file_name().unwrap().to_str().unwrap());
}

fn main() {
    let args = env::args();

    if args.len() < 3 {
        usage(&args.collect::<Vec<String>>()[0]);
    }
}
0
0
1

@mripard Yes, I found that. But you still have the extra step of creating the directory structure. It’s possible, but still annoying and not as trivial as C. But I guess that should be the tagline for Rust. Not as trivial as C

0
0
2

@mripard Yeah, I found that. Still not as easy as just creating a bunch of C files, and typing make foo and if will compile foo.c

0
0
1
Using the holiday break to learn Rust, I'm getting frustrated with Cargo. I mean, with C, I have a bunch of small programs that I use. But it seems that with Rust, to do the same, I have to make each one into a separate project, which I find overkill. Is there a easy way to make 100 little programs without making a 100 little projects???
0
2
6

@monsieuricon Will it affect what apps to use it with?

1
0
0

@monsieuricon Honestly, I have no idea what the difference would be.

1
0
0

@wagi Because only the Linux kernel seems to care about not breaking user space.

0
0
1
@monsieuricon @mattblaze there's been several times I found news about things I was unaware of from social media, as my news feeds always try to predict what I'm interested in (forcing me into a bubble as it's based on what I click on). I enjoy seeing articles posted by others as they are not usually within my normal interests.
0
0
0
That was fun. Added two more HDs to my workstation, but accidentally unplugged the power of one of the existing HDs. Thought the new HDs caused my existing md-raid1 to get screwy, and I had to re-add to the existing array as it was down a drive. I accidentally picked my external backup drive (blowing away all my backups). When I finally noticed, I shutdown the machine, plugging in the HD and on booting up, it picked the HD that was powered off as the main drive for the raid1! I spent a good half hour fixing all this. 😛
0
0
1

@joe-lawrence Emacs is more than an operating system. It’s an orchestra.

0
0
0
Show older