Consider the Java programming language. List 5 major binding times (skip link time and load time from the list of 7 given in your text) and for each discuss properties and aspects of programs in Java that are bound at each time. Briefly explain each item you name.
a) Compare and contrast scripting languages to more traditional
application development languages.
Be sure to explain what each kind of language is good for,
what each is poor for, and when you would want to use each one.
b) Perl is a scripting language. Discuss features of Perl that make
it useful for scripting in the sense of your answers to part (a).
Write a Perl program that will read in all lines of a file (standard input
is fine) and check each line to see if it contains a Pascal-style comment.
Print each line that does contain a match, and toss each line that does not.
(* this is a Pascal comment *) (* they may not be nested *) (* but two or more per line is ok *) it is also ok (* if they are only part *) of the line (* assume a comment will open and *) close on one line therefore (* this line would not be a match ... it has no close this line also is no *) match since it has no openNote that this solution can be done in 3 or 4 lines... I am not asking for a significant program, but rather a demonstration of using regular expressions in pattern matching.
Let's say for some reason I have designed a language that will not allow recursion. But also let's say I have designed the language so that it still needs a heap for dynamic memory management. What language features might I have put in (give 3 good ones) that would cause this.
Explain the difference between internal fragmentation and external fragmentation in heap management.
Consider this program:
int x; int y = 0; /* globals */ proc One (int m) { local int y = 3; Two(m); } proc Two (int k) { y = k; k = 0; } main { x = 6; One(x); print x; print y; }(a) What is the output when the program is executed with static scope rules and call-by-reference parameter passing?