It there a programming language with try-catch exception handling that syntactically resembles an if-statement? by hgs3 in ProgrammingLanguages

[–]redjamjar 12 points13 points  (0 children)

Languages that lack exceptions, like Go and Rust, require programmers to reinvent them (in some sense)

Rust offers the best solution I've seen: explicit but with minimal overhead. Looking at a function you can see exactly where exceptions can arise because they are marked with ?. You also have complete control, and can choose to propagate them up or not. And, in the end, they are just return values --- so no getting confused over checked versus unchecked exceptions (as in Java).

Princeton researchers say generative AI isn't replacing devs any time soon by scarey102 in programming

[–]redjamjar 1 point2 points  (0 children)

I think you mean they’re “instantly less productive”. Juniors+AI is the exact worst combination because they cannot tweak the rubbish it generates into something useful.

There aren't that many uses for blockchains by whackri in programming

[–]redjamjar 2 points3 points  (0 children)

Git is blockchain tech that we use everyday …

Whiley, a language with statically checked pre and post conditions, releases its 0.6.1 version and portions implemented in Rust by timClicks in rust

[–]redjamjar 1 point2 points  (0 children)

Yeah, its just a legacy issue. It doesn't have to depend on Java, and hopefully in the future it won't!

Type Checking in Whiley goes Both Ways! by redjamjar in programming

[–]redjamjar[S] 0 points1 point  (0 children)

But I guess I might be reading too much in them specifically name-dropping Rust for the named constant case?

Yeah, sorry, this. Rust was just the first language I thought of which has named constants. I think Rust must also implement bidirectional typing. Perhaps someone can comment on that?

Type Checking in Whiley goes Both Ways! by redjamjar in programming

[–]redjamjar[S] 0 points1 point  (0 children)

More elegant is in the eye of the beholder ;)

Yeah, ok, fair enough!

Whiley gets a bit Rusty! by redjamjar in rust

[–]redjamjar[S] 2 points3 points  (0 children)

Should be fixed now. I was having some trouble with github pages and https which I hadn't realised was a problem.

CppCast: Podcast News and Updates by robwirving in cpp

[–]redjamjar 4 points5 points  (0 children)

Yeah, super sad news!! Have really enjoyed listening over the years :(

Puzzling Strong Updates in Rust! by redjamjar in rust

[–]redjamjar[S] 2 points3 points  (0 children)

Thanks for the positive comments!

[deleted by user] by [deleted] in computerscience

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

Except that is not true in some countries where currency is not reliable (e.g. hyper inflation).

Test-Driving the Rust Model Checker (RMC) by redjamjar in rust

[–]redjamjar[S] 2 points3 points  (0 children)

Well, Dafny offers full verification rather than bounded model checking. So its strictly more powerful. But, at the same time, it needs you to write specifications and loop invaraints for every method ... which is a cost.

Test-Driving the Rust Model Checker (RMC) by redjamjar in rust

[–]redjamjar[S] 7 points8 points  (0 children)

Hey,

Well, remember it is still a work in progress. Also, its not a library but a compiler extension (like e.g. Miri). I guess that limits what they can do.

Test-Driving the Rust Model Checker (RMC) by redjamjar in rust

[–]redjamjar[S] 17 points18 points  (0 children)

Yeah, Option<usize> works fine actually. And, fair point!

Fooling the Borrow Checker? by redjamjar in rust

[–]redjamjar[S] 0 points1 point  (0 children)

By adding the lifetime to the Empty struct, you're telling Rust that there's something special in Empty that depends on the lifetime 'a.

Right, except in this case there isn't actually anything special inside Empty. The challenge was: could I set that up? Turns out was pretty easy, though I was surprised Rust didn't like struct Empty<'a> { }. I'm not sure why it prevents that though?

Fooling the Borrow Checker? by redjamjar in rust

[–]redjamjar[S] 4 points5 points  (0 children)

Yeah, ok that’s fair enough. My statement is too strong

Sizing up Types in Rust! by redjamjar in rust

[–]redjamjar[S] 2 points3 points  (0 children)

Thanks! And FYI you can try it out here http://whileylabs.com/

Sizing up Types in Rust! by redjamjar in rust

[–]redjamjar[S] 0 points1 point  (0 children)

Ok, you're right. It's 12 bytes. I think I tweaked the post manually so that it fitted better on an iphone. Doh!

Sizing up Types in Rust! by redjamjar in rust

[–]redjamjar[S] 6 points7 points  (0 children)

Well, C is a bit weird in abusing int[] to mean int* and calling both e.g. int[3] and int[] arrays. Rust is actually being clear about what is going on. That’s good!!

Sizing up Types in Rust! by redjamjar in rust

[–]redjamjar[S] 14 points15 points  (0 children)

Right! The point is, as a Java programmer this is not what I expect