fruxo / turbobadger

Small footprint UI library for hardware accelerated games & applications
578 stars 84 forks source link

yaml instead of tb.txt #96

Open rokups opened 8 years ago

rokups commented 8 years ago

What do you think about using yaml instead of custom file format for UI?

Pros:

Cons:

Reason i am suggesting this is because existing format is already close to yaml which is great. If we could use format that is already widely supported by other tools it would only benefit users of library.

fruxo commented 8 years ago

I reviewed using yaml before writing the custom parser that is in TB, but didn't like it. I couldn't find any implementation that would fit well either. Maybe things has changed on the implementation front since then (haven't checked).

RobertoMalatesta commented 8 years ago

Another option could be the use of JSON files. All editors have excellent tools and (small and effective) C/C++ parser implementations abound.

--R

codecat commented 8 years ago

I think if you use yaml (or json for that matter) you'd have to add an additonal children tag to add children elements in layouts for example, which would just be yet another line of syntax. (I guess you could still see class names as children elements, but still)

As for editing, I have made and published a Sublime Text plugin for TB node syntax on Package Control: https://github.com/nimbletools/turbobadger-sublime

rokups commented 8 years ago

I would happily write one more line in order to get editor support. As for json - it was not created to be readable so something like yaml would still be better for writing by hand. Besides curlies=extra lines. Though honestly... Json still better than custom format imho.

RobertoMalatesta commented 8 years ago

@angelog great plugin. Too bad I don't use Sublime. Today I'm converging all my code on Visual Studio Code.

RobertoMalatesta commented 8 years ago

@rokups I admit my sheer ignorance on YAML (always skipped it thinking it was yet another markup --and I hate markups) but it shows some nice points, so I'll have a look adopting it in some other project (JS/TS based -- VSC seems to have interesting plugins as well)

I agree that JSON is maybe less readable, but today it is everywhere and well supported by libs and tools.

--R

codecat commented 8 years ago

@RobertoMalatesta You should be able to use the tmLanguage file on VSCode (Atom) too: https://code.visualstudio.com/docs/customization/colorizer

jeduden commented 8 years ago

Please also note that yaml has a pretty large specification. In addition, it is fairly easy to replace /adapt the current format with/to yaml in application code.