Making electronics out of coal