3 ms·
YAML config file? Pain? Try Lua
- josephcsible 3y ago> Yes, it's all too possible for someone to write: > (function() while true do end end)() > in the configuration and block the process with 100% CPU utilization If you care about this, you can use lua_sethook, which lets you interrupt running Lua code.
- sixthDot 3y agoLUA definition of an identifier seems not strong enough for a configuration file: > Names (also called identifiers) in Lua can be any string of letters, digits, and underscores, not beginning with a digit. This coincides with the definition of names in most languages. (The definition of letter depends on the current locale: any character considered alphabetic by the current locale can be used in an identifier.) config file being essentially KV pairs, thay means that certain property names are not valid or won't be valid if loaded by someone living in "country-with-strange-locale-istan".
- drekipus 3y agoLua for nvim is a blessing and a curse. It is a bit more grokkable than vimL, but it's verbose and gross in its own way under certain things. But really, a low cost lisp is the way to go :^) (I use fennel for nvim, and it does a good job)