PWM to vary the light intensity of a 220V bulb
If the relay is a mechanical one it's an Awfully Bad Idea™. Relays need several ms to activate and release, so the switching frequency will be limited to about 100Hz. Your actual control cycle will be much slower than this so you'll end up with noticeable flicker to start with. The relay will also make a lot of noise, and spark all the time, so that a 100 000 cycle relay will reach its end of life after less than an hour. So the relay is out.  

What you could try is to use a MOSFET to do the switching. You'll have to place it in a rectifier bridge, and control it through an opto-coupler, but that's no problem.
The MOSFET, when on, can have a very low resistance (the infamous \$R_{DS(ON)}\$), so we might think that power losses may be low. Unfortunately in general this isn't the case. The MOSFET dissipates power while switching on or off, appropriately called switching-power, and the more frequently you switch the higher the dissipation. And then there's the EMI you're radiating.
On my previous job a colleague of mine worked for a while on what we called the "100kHz dimmer", which was supposed to use PWM to control brightness for high power dimming (4kW). But while internally the name remained the principle was left because it simply isn't worth the trouble.  

That's the reason most dimmer use phase control of your mains frequency.  

  

This image shows forward phase dimming, which most dimmers do, including the simplest "four-component dimmers". They work well, and your switching frequency is fixed to twice the mains frequency (100Hz or 120Hz).
For incandescent bulbs there's a variant, called reverse phase dimming  



which doesn't cut in on the phase, but cuts it off. Simple dimmers using a triac as switching element can't do this; once a triac is on you have to wait until a zero-crossing before it automatically switches off. Advanced dimmers can select forward or reverse phase dimming depending on the kind of load.  

I suggest you stick to phase cutting. If you plan to use a microcontroller you may make it intelligent enough to have a linear power curve. Most dimmers have their phase congruential with the potmeter rotation, but because of the mains sine shape this doesn't agree with the power curve.