The real problem with the Automizer
Posted: Sat Oct 03, 2015 4:12 pm
... IMO is that it wants to be an imperative, procedural programming language.
I'm serious. Right now it uses JSON, a data format. And any moderately functional automizer profile quickly develops into a nightmare of deeply nested, branching potentialities. It winds up completely inscrutable.
But even a complex automizer profiler could be better expressed by switch statements, or even if-then-else statements. Much more expressive, much less verbose. And it's not like we have grave security concerns that discount Turing-complete languages.
e.g. right now my generic "destroy unenchanted equipment" rule looks like this
Now let's say we did this in something like Python.
Much better, I'd say. Less confusing to edit by hand, probably even for computer novices. Plus it becomes trivial to throw in other arbitrary requirements:
With the automizer, that requires a whole lot of messing around.
What say you all?
I'm serious. Right now it uses JSON, a data format. And any moderately functional automizer profile quickly develops into a nightmare of deeply nested, branching potentialities. It winds up completely inscrutable.
But even a complex automizer profiler could be better expressed by switch statements, or even if-then-else statements. Much more expressive, much less verbose. And it's not like we have grave security concerns that discount Turing-complete languages.
e.g. right now my generic "destroy unenchanted equipment" rule looks like this
Code: Select all
[
{
"action": "destroy",
"condition": {
"conditions": [
{
"conditions": [
{
"symbol": ")",
"type": "symbol"
},
{
"symbol": "(",
"type": "symbol"
},
{
"symbol": "]",
"type": "symbol"
},
{
"symbol": "[",
"type": "symbol"
},
{
"symbol": "/",
"type": "symbol"
},
{
"symbol": "\\",
"type": "symbol"
},
{
"symbol": "|",
"type": "symbol"
}
],
"type": "or"
},
{
"conditions": [
{
"status": "average",
"type": "status"
},
{
"status": "bad",
"type": "status"
}
],
"type": "or"
}
],
"type": "and"
},
"module": "ToME",
"name": "Destroy Average Stuff"
}
]
Code: Select all
if object.symbol in [ "[", "]", "(", ")", "|", "/", "\" ]:
if object.status in [ "average", "bad" ]:
object.destroy
Code: Select all
if object.symbol in [ "[", "]", "(", ")", "|", "/", "\" ]:
if object.status in [ "average", "bad" ]:
if not "Dark Sword" in object.name:
object.destroy
What say you all?