News for hackers. Stuff that matters.

fvncc

Re:Patterns for Defensive Programming in Rust on Saturday December 06, 2025 @05:51AM (#46172296)
Note its possible to write the example more succinctly (while having the same behavior) with:

https://docs.rs/itertools/latest/itertools/trait.Itertools.h...

Re:The Future of Large Files in Git Is Git on Friday August 15, 2025 @10:27PM (#44919596)
When I tried DVC ~5 years ago it was very slow as it constantly hashed files for some reason.

Switched to https://github.com/kevin-hanselman/dud and I have been happy since ..

Re:Matt Godbolt sold me on Rust by showing me C++ on Tuesday May 06, 2025 @06:30PM (#43910307)
There are libraries that help with these conversions. See e.g.: https://docs.rs/bytemuck/latest/bytemuck/trait.TransparentWr...
Re:NYT: The Data That Powers AI Is Disappearing Fast on Sunday July 21, 2024 @11:13PM (#41030605)
Japan passed a law allowing use of copyrighted material for machine learning.

https://www.deeplearning.ai/the-batch/japan-ai-data-laws-exp...

Re:Rapier is a set of 2D and 3D physics engines written in Rust on Tuesday February 27, 2024 @06:28PM (#39531670)
Actually another reason people use the architecture is for process level isolation, i.e. limiting the blast radius of memory corruption. But in both cases, Im sure you could design an ergonomic RPC framework that takes care of offloading computation mostly transparently behind the scenes :)
Re:Rapier is a set of 2D and 3D physics engines written in Rust on Tuesday February 27, 2024 @08:40AM (#39523938)
You can also check https://github.com/sequenceplanner/r2r for another example of ROS2 bindings (using in production at work for a couple of ROS nodes).

But TBH, in a Rust world, it’s worth revisiting the assumptions behind the ROS node architecture, since Rust is so strong at scaling to large monolithic applications (due to the strict hierarchical code patterns it encourages).

A transitional Rust approach, that doesn't try to reimplement everything from scratch, could do something like a strangler pattern: Take each ROS node, run them separately in “jails” with a Rust API around each one, then implement the plumbing/management logic in pure Rust.

Re:How to think about `async`/`await` in Rust on Wednesday July 05, 2023 @02:47PM (#36605201)
Well each time you use the await keyword you are saying its a safe point to exit, which is more predictable than killing at random points. Holding locks across await points is an anti-pattern, and Rust at least can give a hint if you try to do that. Async/await implementations will also generally allow you to run cleanup code on cancellation (but the exact mechanism depends on the language).

In the end, its about expressing a state machine in a more concise implicit way, which is a suitable level of abstraction for most use cases.

Re:How to think about `async`/`await` in Rust on Wednesday July 05, 2023 @03:24AM (#36596830)
One advantage of async/await is that its easier to cancel things. For example, this leads to the design pattern where you have multiple futures and you want to select the one that finishes first and cancel the rest.

In regular threaded programming, cancellation is a bit more painful as you need to have some type of cancellation token used each time the thread waits for something. This a) is more verbose and b) can lead to bugs where you forget to implement the cancellation logic.

There are a few options I’ve seen for “liveview” type approaches in Python, see e.g. reactpy and streamlit. (Assuming you are not looking specifically for something that transpiles to JS.)
Re:Mojo – a new programming language for AI developers on Wednesday May 03, 2023 @01:06AM (#35798254)
That would work nicely :)
Hi is there any plan to have high level model training tools (one example is things like Pytorch dataset loaders), or is the focus more on inference/deployment use cases?
Re:Open Dynamic Robot Initiative (2020) on Tuesday December 07, 2021 @11:05PM (#29481147)
Actually chemical weapons don’t do well on “cost effectiveness”, apparently:

https://acoup.blog/2020/03/20/collections-why-dont-we-use-ch...

Re:PyMC: Theano Is Dead, Long Live Theano on Saturday November 07, 2020 @02:18AM (#25013643)
Maybe variational inference is a possibility? You can try searching for black box stochastic gradient variational inference, easy to use and scales well.
Another example is RealNVP, which has the same structure to enable inversion (partition, process half, then use the result to mutate the other half in an invertible way).

Sadly, I gather the computational performance Is pretty bad ..

https://arxiv.org/abs/1605.08803

Re:An industry dedicated to making foods crispy on Sunday March 01, 2020 @10:37PM (#22461455)
This is another factor to consider regarding carbs/starches, in addition to the more commonly known ones like GI:

https://en.m.wikipedia.org/wiki/Resistant_starch

I think there are some newer tests which only require maternal blood and can screen for some genetic conditions by filtering extra-cellular genetic material.
Re:How to recognize AI snake oil [pdf] on Tuesday November 19, 2019 @08:37PM (#21580349)
Maybe they can use something like this?

https://blog.acolyer.org/2019/11/01/optimized-risk-scores/

They optimise a simple set of decision rules which has reasonable accuracy in their application, quite cool really