It is currently Thu Mar 28, 2024 2:36 pm


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Unit 1 - Lesson 2: Compiled vs. Interpreted MUMPS Systems
PostPosted: Wed May 18, 2011 4:57 pm 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
First, it is important to understand the concepts of compiled verses interpreted systems.

Fully compiled systems require the programmer to write source code, typically in modules. The source code is then compiled into object code. Object code consist of code that will actually run on the underlying hardware once it is linked. Because the code is usually broken up into modules, it is then linked together to form the executable. The executable is the part that actually runs on the target machine. Typically (not always today), the compiler approach assumes the source code to be static (unchangeable) as opposed to dynamic (changeable) at runtime. Originally, the compiled approach has been preferred because it gave a considerable performance advantages over other approaches.

On the other end of the spectrum is the fully interpreted system. It assumes that the source code can be dynamic. That is, code can change and it needs to be interpreted at runtime simply because the outcome will be different. This is a powerful feature of interpreted systems since not all scenarios can be anticipated at compile time. However, this feature was often offset by the fact that strictly interpreted systems were slower than fully compiled systems.

The MUMPS language was designed to be interpreted. In fact all of the original systems were strictly interpreted such as DSM-11. Why? MUMPS was originally written as a language to implement medical record systems. Medical computing can be complex and require a system that could handle changeable scenarios at runtime. Consequently, the language was designed to handle this through the concept of indirection. You will learn more about the various forms of indirection towards the end of this course and more completely in the MUMPS Programming II course. It is an incredibly powerful aspect of the MUMPS language. Systems like File Manager and EsiObjects would have been extremely difficult to implement without it.

As the field of computer science evolved, it became obvious that you could have both dynamic and speed of execution at runtime. Hence, the intermediate approach, or more technically known as p-code (precompiled or pseudo-code) generation, was used to implement more modern systems. This approach would compile the source code into an intermediate language (object code) that was then interpreted. The compilation process removed the problems of a fully interpreted system. What were some of the features of a strictly interpreted system that contributed to its slower performance? Here are a couple:

  • Embedded comments in the source code had to be skipped over on each interpretive iteration. This was a waste of processor resources which was a precious commodity in the early days.
  • More esoterically, complex expressions required wasteful nested stack oriented interations to evaluate them. However, this could serialized by compiling the expression into “reverse polish notation” (Go to Wikipedia for a complete explanation). Reverse polish notation rearranges the operator and its operand such that the interpreter can simply evaluate based on a sequential scan of the expression.

Those MUMPS systems that thrived were either originally written using p-code generation or they were evolved to replace the strictly interpreted approach.

_________________
Terry L. Wiechmann


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 14 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