4,235 karma · joined Sep 10, 2015 (11y ago) · 1,525 submissions
comment 5y ago · link · parent
It's not done usually because it's also very useful to take advantage of new language and library features and all software is supposed to not break compatibility with new versions, so if there is an issue due to upgrading it's because an incompetent maintainer failed at their job.
comment 5y ago · link · parent
What you ideally want is a first step that "validates", i.e. creates a representation from text that is easy to use but also succeeds for any input, and then a further "parsing" step that converts it to another representation such that the parsing only succeeds for valid input and is invertible for any value of the representation type, and then finally code that checks constraints that aren't captured by the type system.
This way you can support IDEs that need to edit partially incorrect code.
comment 5y ago · link · parent
comment 5y ago · link · parent
The only limitation that may not eventually be removed is the lack of dependent types (although you can kind of emulate them by lifting terms to the type level and using lifetimes to represent variables).
C++ is not memory safe, Lisp has no type system and Haskell has GC, all values are boxed in a closure and it cannot mutate memory safely, so none of these languages are even in contention.
comment 5y ago · link · parent
[of course captchas do nothing against targeted attacks]
comment 5y ago · link · parent
comment 5y ago · link · parent
If only one sensor input changes then intermediate computations that don't depend on it don't need to be updated.
comment 5y ago · link · parent
If you have multiple outputs you can also have a scheduling/prioritization system for the subtasks.
And yes, use interrupts or multiple timers to detect only changed parts without having to compare current input to previous input.
It's basically the same problem as updating a browser DOM in response to application state changes.
comment 5y ago · link · parent
For instance:
- Changes to C source files of a shared library should not require a rebuild of dependents (assuming you don't LTO with shared library bitcode)
- Changes to an executable in a dependency that you run as a child process during usage but not at build time should not require a rebuild of dependents
comment 5y ago · link · parent
There is already RSLint and SWC as JavaScript tools written in Rust and I would expect such tools to take over, with a good choice of it happening before Rome is ready.
comment 5y ago · link · parent
Haskell doesn't use that notation either, it uses -> both for the parameter list and for the return type, and separates argument names (arguably, these are poor choices, since currying is not an efficient CPU-native operation and not intuitive so distinguishing between multiple arguments and returning closures is useful, and argument names are useful for documentation).
comment 5y ago · link · parent
You can also do this:
struct Vehicle
{
speed: f32,
type: VehicleType
}
enum VehicleType
{
Car(...),
Bicycle(...)
}
Or this (although this is the least common): struct Vehicle
{
data: VehicleData
type: Box<dyn SpecificVehicle>
}
struct VehicleData
{
speed: f32,
}
trait SpecificVehicle
{
fn quack(&self, data: &VehicleData);
}
impl SpecificVehicle for Car {...}
impl SpecificVehicle for Bicycle {...}comment 5y ago · link · parent
From the paper it's not clear how much of the overhead is fundamental and how much is due to the frameworks being just terrible (many of them are written in Java, so they can't be good since no decent programmer would use Java for efficient algorithmic code instead of Rust or C++ before Rust was available).