If you change your newDPL proc with this?
proc newDPL*(): DPL =
DPL(id: createLibrary())
Also it's better to use when instead of if for checking whether it's main
module or not
when isMainModule:
mainProc()
