gactar icon indicating copy to clipboard operation
gactar copied to clipboard

Read initializations from file

Open asmaloney opened this issue 3 years ago • 0 comments

If there is a lot of data to initialize, writing it all in the amod file is impractical. So instead of hard-coding specific file formats, provide an API and allow plugins to read the data - possibly with something like go-plugin. If done properly, this would allow writing plugins in almost any language.

Then the init section might look like this:

memory {
    reader: my-csv-plugin
    files {
        'file name 1'
        'file name 2'
    }
}

Where reader might be an external plugin or an internal one (i.e. flat text file).

Currently the python backend has to write these out like this:

	def init():
		memory.add('count 0 1')
		memory.add('count 1 2')
		memory.add('count 2 3')
		memory.add('count 3 4')
		memory.add('count 4 5')
		memory.add('count 5 6')
		memory.add('count 6 7')
		memory.add('count 7 8')

Which is also impractical. So we would have to figure out how to handle this more intelligently.

asmaloney avatar Aug 08 '21 15:08 asmaloney