Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration format rework #221

Merged
merged 141 commits into from
Aug 18, 2021
Merged

Configuration format rework #221

merged 141 commits into from
Aug 18, 2021

Conversation

elkowar
Copy link
Owner

@elkowar elkowar commented Jul 26, 2021

This is the massive PR you've all been waiting for!

We're replacing XML as the configuration language with a custom, s-expression based configuration syntax named yuck.

yuck puts a lot of focus on providing clean, readable and useful error messages where possible, and aims to at some point allow for the implementation of advanced development-tooling such as a language server. To achieve that, eww is now split up into several crates:

  • yuck: the main configuration syntax parser, API to deal with parsed ASTs and the datastructures that represent a basic interpreted eww configuration file.
  • simplexpr: (weird name, I don't care) The parser and evaluator for the inline infix expressions eww allows for. These where previously possible to use in {} within string literals. This crate provides not only the AST structure and evaluation logic, but also the dynval value, which is a string-value that may be interpreted as a value of other types depending on where it is used. DynVal is thus the main primitive value type used for typejuggling, and replaces PrimVal from the old eww codebase.
  • eww_shared_util: a small crate that provides types and functions used across some of the other crates. Mainly, it provides the Span type used throughout the codebase.
  • eww: The core eww codebase. This contains all of the server-logic, GTK related code, as well as anything else not directly related to the configuration file.

This PR is still work in progress for several reasons:

  • Error handling could still take a good bit of improvement. Not only do I still see multiple places where better diagnostics could be provided, but also I still see some issues with how the code is structured right now. As this is not a "breaking" change in any way, I might merge this PR before all of those error-handling related tasks are fully done - I don't want to block the syntax migration longer than necessary just to pursue some form of "PR-purity" or whatever.
  • The documentation needs to be adjusted - this is not yet done at all. @manderio has agreed to help me out here
  • The examples need to be migrated to the new syntax
  • A release / tag before the rework should be made, so people that don't want to migrate right away don't have to search through hundrets of commits to find the version prior to the rework
  • I want to find an alternative syntax for string literals that doesn't conflict with " in shell-scripts - this shouldn't be hard, I just don't know what syntax to choose yet

However - this is a cursive statement - but:
It should be usable. There might still be dealbreaking bugs, I haven't tested everything - if there are, please leave a comment here.
If you want to be the early adopter, feel free to give this a try! The syntax is (most likely, I'll not rule it out 100%, but it's very unlikely) not gonna go through any big changes - if any at all, those will be minor changes of keywords or some additions to syntax. So if your stuff that you do now works, it'll most likely continue working once this is fully finished!

Have fun!

PS: Note that this PR may get some force pushes still, as I do want to clean up the commit history - so maybe don't build big branches on top of this right now

Other changes

During work on this PR, some other changes have been made during refactorings.

Notes / TODOs

  • Allow comments in simplexprs
  • Include shell error message in script-execution failures, and mention "Failed to execute script" in the error message explicitly

@undefinedDarkness
Copy link
Contributor

A pr of 116 commits...
Truly astounding

@elkowar
Copy link
Owner Author

elkowar commented Aug 17, 2021

note: checks failing because of rust-lang/rust#88043 - nightly moment

@elkowar elkowar marked this pull request as ready for review August 18, 2021 14:39
@elkowar elkowar merged commit 9c12a31 into master Aug 18, 2021
@VuiMuich
Copy link

Awesome! 🎉
Congrats on this milestone achievment! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants