How to communicate with attiny84 over the lines which are used for programming

okay, I have an arduino uno. I have 4x attiny84. now I want communication - general communication in a certain program between the arduino uno and attiny such that uno will be the thing between the tiny avr and my computer without any big code on attiny for I require a lot of space for my program. now I am a very new person to programming any device except the arduino . therefore I want to know if there is a way to do what I mentioned. I also want to know if the pins are automatically initialized to their correct functions at a reset. thank you ( sorry if it is a stupid question).

Yeah, you could communicate via SPI or I2C, sure.

I2C has advantage of arduino libraries for slave mode working out of the box.

You can (and will have to) use the same lines for programming via ISP as you do for SPI or I2C.

After programming the chip goes through the usual reset process and all pins are reset to their power on state (input with pullup off, equivilent of pinMode(pin,INPUT).

sorry for the late reply. I wanted to ask that this won't make the chip non reprogrammable (using the arduino uno as isp) right?

The only things that can make the chip non-reprogrammable are writing certain values to the fusebytes:

  1. Setting RSTDSBL or DWEN to 0 or SPIEN to 1 when writing the HFUSE (if using ATTinyCore, these are never set when using a board definition without a bootloader. Optiboot and Micronucleus board definitions provide an option for this, since when using a bootloader the part can still be programmed using the bootloader, just not by ISP; this is quite popular for ATtiny85-based Digispark (micronucleus) boards to get the extra I/O pin. Where ATTinyCore offers this option, it is never selected by default, and such dangerous options are marked as such in the menus).
  2. Setting the LFUSE (which determines clock source) to an external clock/crystal setting, when no such crystal is present. This can be done using ATTinyCore by selecting an "external" clock source when such a clock source is not connected to the part.
  3. Setting the LFUSE to run at a very low clock speed, such that your ISP programmer does not support a slow enough clock for the part to understand it. This can be done using ATTinyCore by selecting a clock speed slower than 1MHz.
  4. Connecting external hardware to the programming pins which interferes with the programming signals.

How to recover from these:
In case 1, normal ISP programming can only be restored by using an HV programmer to write a new value to the HFUSE. This is the only case where you need special equipment to unbrick it.
In case 2, normal ISP programming can be restored by (assuming it was programmed to use an external crystal, not external CLOCK) connecting a crystal and loading capacitors to the XTAL1 and XTAL2 pins (it does not need to match the selected speed, just needs to be between 1MHz and 20MHz) - or by connecting a suitable clock signal to the XTAL1 pin (this will work whether it was set to use external crystal or clock); versions of Arduino as ISP sketch are available which output an 8 MHz clock signal for this purpose. Once such a clock source is provided, ISP programming will once more work, and you can "burn bootloader" with internal clock source selected, and then disconnect the external crystal/clock. HV programming can also be used to write a new value to the LFUSE.
In case 3, normal ISP programming can be restored by using a programmer which supports a slower SCK clock, or via HV programming.
In case 4, disconnect the offending external hardware. If you need to have things connected to the programming pins which would interfere, Atmel/Microchip recommends putting a resistor (330~1k ohm) between the pin and external hardware, and connecting the programmer on the side of the resistor closer to the chip you are programming).

When using ATTinyCore (or any other Arduino core, to my knowledge; though it is possible for a hardware package to rewrite fuses on every upload, I have never seen this done, as it violates expectations of Arduino users), the fuses are only written when doing "Burn Bootloader". When doing "burn bootloader", any clock source marked "internal" is a safe option.

There is no way to "brick" the chip such that ISP programming won't work by uploading a bad sketch.

thank you so much for telling . i am running all of them currently on internal 1 mhz because i wanted to operate them on voltages as low as 2v or 1.9v but i didnt need very high speeds. i connected 2x 8k resistors between the arduino outs and attiny ins and used the usi in 2 wire mode. the resistors were because the attiny would start clocking the same line which the arduino used as spi sck right after getting the sketch . and......... it sent a byte to arduino which passed it to my computer (yay!) and the byte got printed on the serial monitor! i tried to reprogram it and.... it got reprogrammed! now i will try the other modes. thanks once again!