It is currently Thu Mar 28, 2024 3:25 pm


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Imperative (Command driven) Nature of MUMPS
PostPosted: Tue Dec 21, 2010 12:26 pm 
User avatar

Joined: Wed Nov 17, 2010 4:02 pm
Posts: 71
Location: Houston TX
Real Name: David Whitten
Began Programming in MUMPS: 06 Jan 1982
MUMPS is different than other programming languages because it is a highly imperative language.

There are different styles of programming languages.

For example functional programming treats computation as mathematical functions that take input and result in output. The outputs are then fed back into the functions as input. More complex programs are created by composing functions together. Since pure functional programming has no way to repeatedly do something, functional programming depends on recursion i.e. where a program solves a problem into two parts: 1) solving the simple cases of the problem, 2) breaking the complex case into simpler cases, and then calling itself as a program.

Declarative programming treats computation as a general search through all the possible solutions to a problem. The computer generates a lot of possible solutions to the problem. Each possible solution is tested against the declaration of the program, and the computation is complete when the solution that is found satisfies the requirements stated in the declaration.

Both Procedural Programming and Imperative Programming focus on the programmer explicitly telling the computer the method of doing a computation.

Procedural programming treats computation as generating an algorithm or recipe for calculating using a combination of statements and expressions. Statements group together expressions and based on the kind of expression, the program changes data. All control flow for the program happens by the way that the statements group the expressions.

Imperative programming likewise involves treats computation generating an algorithm or recipe for calculating but treats it as a series of action command events. Each action command does something specific to the programming language's state variables and to the specific program's symbol table variables. Control flow is always clear because each command specifies what will be executed next, and every change that occurs is explicitly part of the definition of command.


Top
Offline Profile  
 
 Post subject: Re: Imperative (Command driven) Nature of MUMPS
PostPosted: Tue Feb 15, 2011 6:23 pm 
Site Admin
User avatar

Joined: Mon Nov 01, 2010 1:58 pm
Posts: 205
Location: Seattle, Washington
Real Name: Frederick D. S. "Rick" Marshall
Began Programming in MUMPS: 15 Jun 1984
Yes, few programming languages are as relentlessly imperative as MUMPS, which has fewer declarations than any other language I know. It has all of one - the line label with its optional parameter list. MUMPS's lack of type or array declarations is often noted as distinctively Mumpsy, but it should be thought of more as the presence of a strongly imperative nature than as the absence of declarations - since declarations are not fundamentally imperative.

So primarily imperative, yes, but MUMPS is secondarily functional. MUMPS's expression-evaluation rules make up a huge part of the MUMPS standard, and the same rules for expressions apply to most MUMPS commands. With the 1990 standard MUMPS introduced the ability for programmers to create their own extrinsic functions, which places even more emphasis on MUMPS's functional programming.

_________________
Frederick D. S. "Rick" Marshall, VISTA Expertise Network, 819 North 49th Street, Suite 203, Seattle, Washington 98103, (206) 465-5765, rick dot marshall at vistaexpertise dot net
"The hidden harmony is best." - Heraclitus of Ephesus


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net