6

The last time somebody asked this question, I replied: why not just use an existing language? What you have right now is an API. You can provide a library in which your commands are function calls, or method calls, or whatever suits you. This saves you from having to design and implement a language, and it saves your users from having to learn yet another ...


4

They're orthogonal. In declarative programming, you describe what would count as an acceptable solution, without necessarily describing how to find it. For instance, a declarative program might have rules like "if you want to install the package gcc, you must have first installed the binutils and cpp packages" and "if you want to install the binutils ...


3

Not that I know of, but "stateful function" is reasonably descriptive. In informal conversation, that's what I'd use, as long as I suspect the audience will understand what I mean. In formal writing, I might still use the same phrase but also provide a careful definition of what I meant by that phrase. Really, that's a large part of what "formal" writing ...


3

The abstract conclusion is not really that "some languages are better than others" but that "some languages are better than others for some purposes". Different languages are somewhat like species in evolutionary biology. They have evolved to fill certain niches. There are many evolutionary niches. They have strengths and weaknesses in different areas. ...


1

The listing does not appear to be a good illustration of LSP violation, since no clear reason is given why the draw method couldn't be a virtual method of Shape. If it was, then there would be no need to do any type query in drawShape: calling draw would work for all subclasses of Shape. The Liskov Substitution Principle is typically described in terms of ...


1

You first need to establish the access speed of the cache, depending on the cache size (usually larger cache -> slower speed, because of physics). You also need to determine the energy consumption of a larger cache, which will lead to increased heat, which will lead to lower clock speed (again, because of physics). Then you need to find the cost of a larger ...


1

The state transition function just says "If you're in state $X$ and receive input $Y$, go to state $A_{X,Y}$", for every possible $X$ and $Y$. Designing the transition function is a matter of programming; implementing it is just a case of state := start_state while state is not a terminating state do input := read_input (); state := ...


1

Design Pattern: It is a "good practice". It can be considered as a possible solution for a problem that may ofter occur. The solution usually comes from the experience. Examples are MVC and Identify Field. Metamodel: It can be considered as a set of rules, constraints and constructs that allow to model a problem. As an example you can consider a map. A ...


1

Expose your API in the form of calls from a well-known language, so you can leverage the development already done in that language, and even combine with modules for other APIs and libraries. I'd probably choose Python or Perl. Use one of the languages designed as lightweight extension languages, thought as a way to write extensions or control of the ...


1

Another possibility, somewhere between API and new language: create a domain-specific language on top of a general-purpose language. Think regular expressions: a mini-language, with its own syntax, built for just one purpose (e.g. text processing), which is usable from within another, more flexible language. Then you get the benefits of a language with a ...


1

In the realm of functional programing, functions that give the same result when called with the same arguments are usually called pure. The Wikipedia page explicitly adds the condition that mutable variables should not be modified by the function call, though presumably they mean mutable variables that can be observed outside of the function scope which ...


1

In a nutshell My first impulse was to agree with D.W.'s answer that the two concepts are orthogonal. On second thought, I think it is only partially true, and I will also try to argue that they are two sides of the same coin. In first approximation, declarative programming just specifies what you want and lets the system find how to get it, while ...


Only top voted, non community-wiki answers of a minimum length are eligible