As far as the BEAM’s concerned, a port is just a process where you can send bytes with {:command, io_list} and get bytes back by receiving {:data, io_list}. If it’s easier for your program, you can just send those JSON bytes instead of encoding term -> binary.
The term conversion process is handy if you’re sending complicated structures that aren’t already encoded. Take a look at erlport, which already handles decoding ETF and has a Protocol abstraction for dispatching to multiple commands through a single port.






















