[-] hairyballs@programming.dev 2 points 1 year ago

We can go further, I think it's impossible to prevent memory leaks in a general purpose language

[-] hairyballs@programming.dev 2 points 1 year ago

WTF I didn't understand, thanks for the explanation. The fact that it's used all around the world in big companies doesn't matter I guess.

[-] hairyballs@programming.dev 1 points 1 year ago

What the actual fuck. It's a made up story I'm sure.

[-] hairyballs@programming.dev 1 points 1 year ago

It's a toy example. In that case, the solution is to assign the expression to a variable to compute its result upfront.

[-] hairyballs@programming.dev 1 points 1 year ago* (last edited 1 year ago)

There are still obvious things the BC cannot get. For example:

struct Foo;

impl Foo {
    fn num(&mut self) -> usize { 0 }
    fn index(&mut self, _i: usize) { }
}

let foo = Foo;
foo.index(foo.num()); //error
[-] hairyballs@programming.dev 1 points 1 year ago

It's like someone has pooped on my screen.

[-] hairyballs@programming.dev 2 points 1 year ago

My coworkers do document the code:

/// Returns a list of foos, given a bar. 
fn get_foos_from_bar(bar: Bar)
[-] hairyballs@programming.dev 1 points 1 year ago

Funny, I think C++ is literally the worst language to learn programming. I would go with JS or OCaml at first, then Rust if they need manual memory management.

[-] hairyballs@programming.dev 1 points 1 year ago

In my company, we use zenhub on top of github, but I'm not sure it's worth it.

[-] hairyballs@programming.dev 1 points 1 year ago* (last edited 1 year ago)

I'd argue the macros are quite bad:

  • Declarative macros are hard to read, same level as regex
  • Procedural macros require to write a new crate with a ton of boilerplate, sometimes for stuff conceptually really simple (like hash is: apply the same function to every field, then compose the results)

I agree, though, that it's better there're here than nothing. It's just that there is to be a better solution.

[-] hairyballs@programming.dev 1 points 1 year ago* (last edited 1 year ago)

Sorry for the late answer. Those days, I'm interested in Ante. The language creator has some novel ideas for a non-GC memory safe language. And the compiler is written in Rust. It's not finished at all tho.

[-] hairyballs@programming.dev 1 points 1 year ago

As said my sibling comment, I use KDE connect with GNOME shell

view more: ‹ prev next ›

hairyballs

joined 1 year ago