Comments (7)
I guess this will be a breaking change? If we make all-sentences
the default feature, applications use default-features = false
for no-std support will break
from nmea.
Valid point. Yes it will be, but we'll bump version to 0.5
.
We can also include Changelog but I'm not afraid to break the build from minor version updates.
default = ["std", "all-sentences"]
all-sentences = ["...", "vendor-specific"]
vendor-specific = [".."]
...
..
.
from nmea.
What about usage of macros instead of features?
Something like
generate_parser![SentenceType::AAM, SentenceType::ABK];
and that generate nmea parser that parse only AAM
and ABK
messages,
so compiler+linker in release mode can remove unused part of nmea crate?
Plus it would be nice implement the similar fnctionality for Nmea::create_for_navigation
.
This variant of dealing with redundant code allows the compiler to solve the unnecessary code problem,
instead of manually marking of each sentence with feature.
from nmea.
@Dushistov macros might make it more difficult to use the crate and contribute to the project IMO.
Also, not all tools/ides/editors play nicely with macros.
On no_std
crates, I've seen macros used to implement different peripherals but not exposing the internal macros for users to define their own.
It's tedious process to add these features now but explicitly listing them sounds like a very good approach.
Due to the way parsers work, I suppose we can even add "Feature not enabled" error when a sentences is passed which can be parsed but the feature hasn't been enabled.
from nmea.
There's one more additional benefit that I though of.
We can leave the parsers themselves and just exclude the calling of the parser in the parse_str
function.
Compiler will still optimize and remove the unused parser/code, however, if you want to parse a specific sentences in your project which you have excluded from parse_str
, then it's your choice and you can do it without enabling the feature.
from nmea.
In my case, I use my own ParseResult
-like enumeration type combined with some public parsers instead of using ParseResult
. So I think it is a good change to be able to exclude unused sentences from the compilation by means of a feature flag.
from nmea.
Related Issues (20)
- More complete docs HOT 1
- Tests for sentences/utils.rs HOT 3
- What is the MSRV? HOT 1
- Tags for versions 0.1 & 0.2 HOT 2
- AIS NMEA messages HOT 4
- Additional message types support HOT 1
- README update - Contributing & dual license
- Iterator-based parser
- Supporting additional sentences HOT 20
- Fix failing test HOT 2
- Not all parts of a RMC sentence are parsed HOT 1
- Update README - what is NMEA 0183
- use `f64` (double) over `f32` precision in the Parser HOT 5
- Fix chrono deprecation warning
- MWV and MDA to "all supported messages" test HOT 1
- Update README/docs for a new release
- CI: Fix code coverage reporting
- Parsing of vendor-specific extended sentences that are not included in the `SentenceType` fails. HOT 3
- Support defmt HOT 3
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 nmea.