01mf02 / jaq

A jq clone focussed on correctness, speed, and simplicity
MIT License
2.61k stars 63 forks source link

chore(core): export core functions based on enabled features #174

Closed ssddOnTop closed 2 months ago

ssddOnTop commented 2 months ago

The main idea behind this PR is that some applications are platform independent and they do not need std.

currently we have option for jaq_core::core() and jaq_core::minimal() but core needs all features to be enabled, there is no way that we can avoid excluding specific feature.

This pr adds new function feature_enabled which chains with feature flags

ssddOnTop commented 2 months ago

I am not sure why we have core and minimal functions only but I have a

proposal: make all feature specific implementations, run and upd functions public so we don't have to update several functions on addition of each feature

01mf02 commented 2 months ago

I know that you closed this issue, but it might still be worth to explain why I would not do it like this: In jaq, feature flags should not change the output of any function of a library crate. So enabling a feature flag should not make one function suddenly return more filters. However, it may expose new functions, which can be used in an application.

ssddOnTop commented 2 months ago

I don't know if the feature flags are used anywhere else in the codebase, so I thought it would be good idea that people can only add feature they want and add functionality based on that