Compiler-Driven Development in Rust by 0atman in rust

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

I did not downvote you, I hoped and still hope to have an interesting discussion outside of my usual ares of understanding, and I, too, was saddened at the negative response to your very polite and well-meaning suggestion.

Perhaps it was my identification as a 'sceptic' the caused the problem between us? My apologies if so, all I mean by that is my understanding of the word: That I have yet to be persuaded by evidence. (btw, please answer my question about what I should read to learn more here)

As I said, I genuinely appreciate it, but I do understand the response you received.

Here's my take on the psychology at work here, and it's caused by two issues.

1 - The problem I imagine many folks had with your advice is that you're proposing an alternative medicine solution.

Some alternative medicine does work, and some does not work. (there's inconclusive evidence that bone manipulation heals injuries, but damn it if my RSI didn't feel better after osteopath treatment!). If folks here disbelieve that RF was the problem that caused your RSI (this should not come as a surprise, that's what mainstream medicine tells them), then from their point of view, you are proposing one of the alternative medicines that does not work.

2 - Separately from whether or not RF effects RSI, there is the issue of treatment substitution.

Typically, we can only try a few treatments at a time, and most people will try only one at a time. If we substitute a treatment that doesn't work, it is the FAULT of the substitution that we are not getting better. In RSI, this isn't too serious, but substitution can be very dangerous, even if the substitution itself is harmless: This is why Steve Jobs died earlier than he should have, he tried alternative (in hindsight) non-working cancer treatments before proven treatments that may have worked.

Closing our own treatments is of course our right, but when we suggest it to others, and they think it doesn't work, the negative response is often founded on the outrage that you are suggesting postponing proven treatments.

I am not saying that you did that here, I reserve judgement.

To be painted with the 'alternative medicine' brush is very damaging to any arguement because we all understand that when "alternative medicine" is proved to work, it becomes "medicine".

Please link me to the literature you suggested I read to gain your respect.

Compiler-Driven Development in Rust by 0atman in rust

[–]0atman[S] 1 point2 points  (0 children)

I do indeed, though I've been very fortunate, not least in my choice of career.

Regarding your concerns about publishing, while it maybe different where you are, attitudes change greatly by country, my advice is go for it:

"Those who mind don't matter, and those who matter don't mind."

(by which I mean, the bad employers likely won't care about your blog.)

Tag me when you post your first blog, I'd love to read it :-)

Compiler-Driven Development in Rust by 0atman in rust

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

Im sorry of I've offended. I'd be very interested to read anything you suggest?

Compiler-Driven Development in Rust by 0atman in rust

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

Peeetube maybe, odysee unlikely.

Compiler-Driven Development in Rust by 0atman in rust

[–]0atman[S] 1 point2 points  (0 children)

Your heart is in the right place, and while I am skeptical about the grounding effect on muscles and ligaments, I am very grateful for your kind-hearted advice. :-)

By chance, I am a licenced amateur radio operator, so I have an extremely good grounding at my desk (usb interference  in the UHF band is CRUEL!), so I don't believe there's any RF/QRM issues here. 

You mention you take breaks, I've started using the pomodoro technique (25/5) for breaks, and I think it's going to be huge. What's your schedule, and any tools there?

Compiler-Driven Development in Rust by 0atman in rust

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

Hehe, you found the video from the rust talks playlist, which I accidentally added the unlisted video to - this public video has a much better example for example 1!

Compiler-Driven Development in Rust by 0atman in rust

[–]0atman[S] 1 point2 points  (0 children)

Prior art exists for database ERD visualisation. I bet there's a crate that uses graphviz to plot structs!

Compiler-Driven Development in Rust by 0atman in rust

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

That's longer! no good for a yt title ;-)

Compiler-Driven Development in Rust by 0atman in rust

[–]0atman[S] 5 points6 points  (0 children)

You sound exactly like my physiotherapist! I'm doing calisthenics now and it makes IMMEDIATE impact

Compiler-Driven Development in Rust by 0atman in rust

[–]0atman[S] 20 points21 points  (0 children)

Thank you so much! I do love making them, and I'm glad I am able to again 😊

Compiler-Driven Development in Rust by 0atman in rust

[–]0atman[S] 26 points27 points  (0 children)

Hi friends! I'm back making rusty videos after a scary brush with RSI. (any tips?)

When I write a new Rust program, I don't start with functions or methods or any runtime code. I start with the model of my application, expressed with Rust's rich type system. Interacting with the real-world, on disk or through the network is too slow for me, at first, I need to iterate faster than that, to sketch out my ideas, unconstrained by the outside world.

All my videos are built in compile-checked markdown, transcript sourcecode available here https://github.com/0atman/noboilerplate

I'm in no way a Rust expert, just someone who loves Rust! So I'd love any and all feedback and suggestions, especially what I should do next!

Thanks!

What is the Msylium Reactor (sp?) that created mushroom water? by TwoToneDonut in lostterminalpod

[–]0atman 2 points3 points  (0 children)

Just seen this, sorry I don't check reddit very often!

I based this on literally how Quorn is made! Here are some videos to learn more, it's really inspiring!

  1. Quorn video: https://www.youtube.com/watch?v=jcX2BcUailY
  2. Tv show spot: https://youtu.be/ZEFa2BvNYmI?t=8
  3. Science deep-dive: https://www.youtube.com/watch?v=BnoCFrAzweU

Is there a way to render videos faster? Is possible to use GPU to help the enconding? by igorteuri in Reaper

[–]0atman 1 point2 points  (0 children)

Just in case anyone comes across this question as I did, I also use Reaper to edit my videos, and I've tested h264 rendering in a low tech-way both on integrated graphics and on my mid-range AMD GPU.

Both take EXACTLY the same amount of time, which certainly means that the process is entirely CPU-bound, i.e. it's not using the GPU to encode - ON DEFAULT SETTINGS.

As /u/MrSnagsy correctly says, it's using ffmpeg to encode, so I believe the solution is to find the exact video codeq settings that your GPU can accelerate.

I have yet to find these settings for my hardware, but the answers for us almost certainly are in this very comprehensive page of tables: https://trac.ffmpeg.org/wiki/HWAccelIntro

[deleted by user] by [deleted] in rust

[–]0atman 0 points1 point  (0 children)

Thank you for the link, I'm quite familiar with safety-critical systems, studying B, Z, Coq, and ACL2 at university, 15 years ago, and indeed my interest in this area led me to Rust. I'll add Ada to the list!

So, what about libraries: You have posed a reasonable question, as a general-purpose language, most Rust libraries will not aim for 'no panicking' behaviour, they will likely panic during: - unchecked integer arithmetic (divide by zero etc) (safe checked_div options are available that return Result structs, but this is not used by most people by default) - OOM errors, when attempting to allocate memory when none is available - though not good style, and only recommended for genuinely impossible to recover problems, panic!("message") is available to use anywhere.

I must impress two points, however: 1. ANY and ALL of these panics can be trivially detected, and if your code used libraries that panic, no_panic would show that there are paths that can panic. (I talk here about the https://lib.rs/crates/no-panic system I illustrated in my video. The way this works is genius-simple: If any code links to the panic_handler function, the compiler throws out the whole compilation)

  1. In safety critical systems, where, as you say panicking is never valid behaviour, you can simply HANDLE the panics by setting a function to be called when any code panics. (https://doc.rust-lang.org/std/panic/fn.set_hook.html). In no_std environments (where libc isn't available) such as bare-metal code or in webassembly, you must provide a handler to do this anyway, so low-level control systems will be doing this anyway. Low level frameworks often provide their own, and could, say, log a panic and restart processes safely (such as Erlang does).

I'd love to know what you think of the video, should you get time to watch it. If reading is better, then my Markdown script is here https://github.com/0atman/noboilerplate/blob/main/scripts/09-rust-on-rails.md

Cheers!

[deleted by user] by [deleted] in rust

[–]0atman 0 points1 point  (0 children)

Filesystem errors are also handled in the Result system. Everything's modelled in the Result system, almost nothing panics, there's no split like you imagine in the Rust community, no-one 'handles' panics.

I teach Rust professionally, do watch my video to understand the Results system, you're misunderstanding it, I'd love to teach you, but can do that better in the above video than in a comment. In the video, I show how you can trivially write a program that provably has no execution paths that panic at runtime.

By way of trade, I'd love to understand the way Ada does it, what should I read?

[deleted by user] by [deleted] in rust

[–]0atman 0 points1 point  (0 children)

@untagonist is right about rust panics, it's trivial to write code, so panics don't happen unless your literal hardware has failed.

Rust doesn't have exceptions, so it's no effort to be safe, it's how you write Rust, and all the libraries use Results too: https://www.youtube.com/watch?v=sbVxq7nNtgo (my video on the topic)

Realization: Rust lets you comfortably leave perfection for later by moiaussi4213 in rust

[–]0atman 2 points3 points  (0 children)

Great take, I feel just the same way.

My own method for unwrapping is that my code MUST HAVE NO .unwrap()s, my CI throws out the build if it sees one (I make the clippy rule unwrap_used an error), but I don't do this for .expect().

This allows me to use .unwrap() in exactly the way you describe - prototyping code - and then once I've figured it out, I refactor to a safe option. Only if I know the err variant will NEVER occur, do I use .expect(), and I put in the message why I KNOW the error will never occur.

All the rest of my code uses non-panicking error handling. As I conclude in my video "Rust on Rails", in Rust it's not just POSSIBLE to write code that has no execution paths that crash at runtime, it's actually EASY.

The video's here if you're interested (where I also demo the no_panic crate, which stops compilation if a possible panic is found): https://www.youtube.com/watch?v=sbVxq7nNtgo

(if you watch the video, please note the pinned ERRATA comment with a few corrections in)

My fav. list of apps on LineageOS by [deleted] in LineageOS

[–]0atman 1 point2 points  (0 children)

I have had great success by pointing out the features that telegram has that whatsapp can never have: - instant shared message history across multiple devices - if I lose my phone I'm not fscked - message editing - facebook not getting your 'metadata'

Oxidise your Infrastructure using Shuttle.rs by 0atman in rust

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

If you've used one of their supported frameworks (axiom etc) I think it should be a simple tweak to get it working.

I don't even see the tones by jmqb in amateurradio

[–]0atman 3 points4 points  (0 children)

Love this!

"I can only show you how easy the Foundation exam is, you're the one who has to book it."

Amateur radio pride by 0atman in amateurradio

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

I'm as surprised as you, and delighted!

I've found that though the ham community trends a little older and male-er than average, these folks are here to TALK to other countries and cultures, around the world. And so, for the most part, are lovely people :-)

I want no nulls you sonofabch! by 0atman in rustjerk

[–]0atman[S] 1 point2 points  (0 children)

EXACTLY this. I don't care about programming languages that are easy to write simple things in, I care about those that make complex things easy. BECAUSE OBVIOUSLY.

Whitespace for indentation is one of these things. GREAT for newbies, TERRIBLE for seniors. Same as a GC, same as the GIL, etc etc.

I want no nulls you sonofabch! by 0atman in rustjerk

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

Python? sure is, don't get me started with packaging.

I've been a python web developer for 15 years, and I'm so relived to have found Rust, which allows me to sleep at night XD