From my experience the hardest part is interaction with other programs and libraries. Still cannot make pipes work in https://github.com/XVilka/r2pipe.prolog/blob/master/r2pipe.p...
process_create('/bin/cat',
[],
[stdout(pipe(Out)),stdin(pipe(In))]),
write(In, "hello"), nl(In), close(In),
read_line_to_codes(Out, Codes).