You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The internal/filetypes package currently uses CUE itself to decide what attributes should apply
for any given file extension and user-supplied filetype hints. This is a lovely and expressive
way of implementing the logic, but comes with certain down sides:
it's somewhat slow: the generality of CUE means that the logic is never going to be as fast as hard-coded rules
it can easily lead to cyclic import dependencies. It means that some parts of the internals of CUE cannot depend on internal/filetypes because that in turn depends on the entire CUE standard library which has many dependencies. This should really be a low-dependency leaf package.
Point 1 might be addressable with performance improvements, but point 2 is a significant wart.
There are at least two possible ways to work around this:
rewrite the logic in Go
use a preprocessor to evaluate the CUE and generate Go code or data structures that encapsulate the logic
The text was updated successfully, but these errors were encountered:
The
internal/filetypes
package currently uses CUE itself to decide what attributes should applyfor any given file extension and user-supplied filetype hints. This is a lovely and expressive
way of implementing the logic, but comes with certain down sides:
Point 1 might be addressable with performance improvements, but point 2 is a significant wart.
There are at least two possible ways to work around this:
The text was updated successfully, but these errors were encountered: