Diesel engines have been used only for trucks for a long time, but now diesels are becoming popular elsewhere. They are not being adopted very quickly in the US, but such cars are used by a greater number of people nowadays.

There are a number of major differences between gasoline and diesel engines. Both types convert chemical energy from fuel into mechanical energy through a series of explosions, that's why the two types are quite similar in theory. These explosions happen in different ways, which represents the main difference between these engines.

Diesel engines are designed to operate at higher compression ratios, usually between 15 to 20, while gasoline (petrol) engines have lower compression ratios usually between 8 to 10. Diesel engines generally have a better fuel efficiency than gasoline engines. In diesel engines, the fuel and air mixture is compressed much more than in gasoline engines. Compressing the fuel/air mixture causes the fuel to ignite. In gas engines, the fuel is ignited by a spark from a spark plug.

In gasoline engines, there is a carburetor where the gas and air are mixed to the proper proportions of each then drawn into the engine during the intake cycle. In a diesel engine, there are fuel injectors which pump the fuel into the engine (no carburetor used).

Gasoline 'quality' is measured by Octane Rating. The Cetane number or CN is an indicator of the combustion speed of diesel fuel. It is an inverse of the similar octane rating for gasoline (petrol). The CN is an important factor in determining the quality of diesel fuel. Gasoline will not work in a diesel engine and diesel fuel will not work in a gasoline engine.

More Info: en.wikipedia.org