Generally speaking, ex post facto laws are seen as a violation of the rule of law as it applies in a free and democratic society. Most common law jurisdictions do not permit retrospective legislation, though some have suggested that judge-made law is retrospective as a new precedent applies to events that happened prior to the judicial decision. In countries that have a parliamentary system of government, ex post facto laws are technically possible as parliamentary supremacy allows the parliament to pass any law it wishes; an entrenched bill of rights may limit such supremacy or a written constitution may prevent such ex post facto legislation.
In the United States ex post facto laws are explicitly prohibited by Article I section 9 (applying to federal law) and section 10 (applying to state law) of the U.S. Constitution.