Nepedia
Back to Discover
Independent Reader
💻

Declarative programming

technology Maturity 7-9 Next article →

Computers follow rules to finish tasks. Most rules use a set of steps. This is called imperative programming. It tells the computer exactly how to work. Declarative programming is different. It focuses on what the result should be. It does not list every tiny step. You just describe what you want to happen.

One type is logic programming. These programs use facts and rules. The computer uses these to solve problems. A tool called Prolog is a good example. It can find answers by looking at rules. Another tool is Datalog. It works by finding new facts from old ones.

Some tools are for special jobs. These are called domain-specific languages. HTML is one. It tells a web page what to show. It does not say how to draw it. There is also functional programming. This uses math to find answers. Languages like Haskell use this way. This style can make it easier to run many tasks at once. It helps the computer handle hard work in a smart way.

171 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.