hi, I have a set of xml files with tons of static ...
# announcements
p
hi, I have a set of xml files with tons of static data (350,000 lines) which need maintenance and version control; is kotlin DSL an option here? Or intellij/compile times will be destroyed?
c
I don't understand the question. There's git for version control, and for maintenance - no idea what you mean. Could you add some details? What are you proposing to use Kotlin DSL for?
p
a huge amount of data to specify how thousands of objects are created
let's say all the skills in a mmorpg
c
and what do you want to do with it? parse it with Kotlin? replace xml with Kt objects, or what?
p
yes, replace
<skill id="12" name="Slap"><effect type="dmg" value="30" /></skill>
with something like
skill(12, "Slap") { effect(Effects.DMG, 30) }
, just to give you an example
I have like 100,000 objects like that placed in several xml files, and it would be so neat to be able to use kotlin instead of xml... however, I guess that needs a parser or a script loader, rather than being placed in the src...
c
You would only have performance problems with clean compile, then incremental compilation would help. You could parse the xmls and generate code with something like kotlin-poet. You could also put different subtrees of the skills tree in separate modules, then gradle would also help with compilation, it would only compile changed modules.
Script loading in kotlin at this point is non-trivial, it's still work in progerss. You can ask around in #C0BT46EL8
Another point, compiling Kotlin based DSL will probably be much faster then loading data from XML
1
p
we're loading around one million xml lines in 20 secs so I guess not
ok, I'll rather wait for everything to be more mature, thanks for all your guidance!
e
do you need it human readable?
you could version-control the xml while having a binary version..
you'll go down from 20s to a bunch of ms at max