One of the many ways that plastic can be recycled is through pyrolysis. This is where a waste product is put into an oxygen free environment, and heated until it breaks down into gaseous hydrocarbons, liquid hydrocarbons, solid carbon, and ash.
When plastic is pyrolyzed in a reactor whose temperature
is between 400C and 600C, it takes between two to ten seconds.
The air temperature inside of a diesel engine, just before fuel is injected, is between 500C and 600C.
This wonderful overlap in temperatures implies one could perform pyrolysis as follows:
Take some plastic, drop it into a cylinder similar to that of a diesel engine, add some inert gas, compress the gas and plastic with a piston, hold it for a few seconds, and then raise the piston.
If a decent fraction of the mechanical energy needed to press the piston down can be recovered when raising it up, this method might be more energy efficient than conventional pyrolysis, which is typically heated by external combustion.
The least baked part of this idea is how to deal with the soot, which seems likely to stick where it's not wanted.
Nothing prevents this idea from being used with turning wood or agricultural waste into bio-oil and bio-gasses, but plastic seems more relevant.