Comments (5)
Yes, this is true. There are, at least at the moment, many ways to shoot yourself in the foot, if you really want to. I spent quite some time to come up with an API that uses more strict typing, but it's really not as trivial as it may seem on first sight. If you have concrete suggests, your PR will be very much appreciated.
from futuresdr.
no I just started to read the source and stumbled on https://github.com/FutureSDR/FutureSDR/blob/main/src/blocks/fft.rs#L104 which made me take note here. It would be great to at least check that all downstream node's scalar are compatible to the input scalar of current node.
from futuresdr.
You can cast the stream inputs and outputs to anything. That's not specific to this mutable reference to the input. It's the case for all stream connections.
A runtime check should be rather easy to implement by requiring any item type to implement Any
and store the TypeId in the stream port. But that's just a runtime check... not sure if this is good enough for you.
from futuresdr.
A runtime check should be rather easy to implement by requiring any item type to implement Any and store the TypeId in the stream port. But that's just a runtime check... not sure if this is good enough for you.
that would definitely be the reasonable way to go 👍
from futuresdr.
Implemented in ba57854.
Stream inputs/outputs are created with the actual type add_input::<T>("in")
/add_output::<T>("out")
. The actual ports remain non-generic, since only the any::TypeId
of T
is stored.
This TypeId
is checked during connection and when cast
ing the slice in work. There are also slice_unchecked
versions, which ignore this check, since some blocks are, for example, easier to implement by casting it to a u8
slice in work
.
from futuresdr.
Related Issues (20)
- VCO and similar blocks HOT 3
- Upgrade axum to 0.6.3
- AudioSink usability HOT 5
- OpenTelemetry Integration HOT 1
- Terminate `AudioSource` when the end of the file is reached HOT 4
- Example for SSB modulation HOT 4
- choosing hackrf as device for examples? HOT 5
- No constellation modulator? HOT 7
- The FIR filtering seems to not work with Complex32 signals HOT 2
- Make SoapySource/Sink new() parameters optional HOT 1
- Allow custom routes to call handlers in blocks HOT 3
- Do not return an error when flowgraph was terminated exteranlly. HOT 7
- Decouple Axum Control Port from Flowgraph HOT 1
- Introduce Port Identifiers HOT 4
- Soapy: multiple channel configuration HOT 6
- macOS support? (making lttng optional) HOT 2
- Look for a way to shutdown gracefully when a task/block panics HOT 13
- Add rustfmt.toml and clippy.toml files HOT 2
- CI: actions-rs is unmaintained HOT 1
- Runtime lifetime not tight to tasks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from futuresdr.