Re:On Composition (2019)
by yellowapple on Thursday January 16, 2020 @09:52PM
(#22071433)
> If I write a program in Unix using Java or Python, can I reuse the Unix sort to sort an array of items inside my program?
Yes, if you split your program into smaller programs (one which generates the unsorted data, and one which consumes the sorted data), at which point you could run 'generator | sort | consumer'. Or your program runs 'sort' as a subprocess and communicates over STDIO. In either case you'll need to serialize and deserialize the data in question.
Yes, if you split your program into smaller programs (one which generates the unsorted data, and one which consumes the sorted data), at which point you could run 'generator | sort | consumer'. Or your program runs 'sort' as a subprocess and communicates over STDIO. In either case you'll need to serialize and deserialize the data in question.