Monday, March 31, 2008

Programming Languages : ALGOL Paper
William Easton: 03/30/2008

ALGOL’s Incredible Impact on Computing Languages

ALGOL known as ALGOrithmic Language is a computer language used for expressing specific algorithms. ALGOL presents many new aspects that the world of computing had not ever seen before such as code blocks, reserved words and even a compiler. Backus-Naur form is one of the most important things to come from the production of ALGOL. Looking at the influence that ALGOL has had over languages we can point out several languages that are still used today based heavily off of ALGOL like Ada, PASCAL, and eventually even C.

FORTRAN was one of the biggest reasons for the drive to build ALGOL since FORTRAN could only be used on IBM machines. The makers of ALGOL wanted to make “one universal, machine-independent algorithmic language to be used by all, rather than to devise several in competition,” (Rutishauser 5). At a meeting held in Zurich, Switzerland shortly before ALGOL was built, a foundation was laid for the language. The GAMM (subcommittee for programming languages) and the ACM came together to form a committee and decided:

  1. The notation of the new language should be completely mathematical.

  2. It should be used to describe numerical processes (algorithms).

  3. The new language should be able to translate readily into machine code.

ALGOL 58 was completed in 1958 and took the computing world by surprise, “but it was so complex and different than any other language that had come before it that it was difficult to understand.” (Barrett 119) This is where John Backus presented his paper on the grammar of ALGOL. He presented ALGOL's grammar to a committee but the mathematical format it used contained symbols that could not be realized by current keyboards.

Peter Naur had the job of writing the notes for the conference where ALGOL's grammar was presented. He simplified the symbols into ones he could type into a computer, thus creating Backus-Naur Form. ALGOL 60 was expressed using the meta-language that Backus and Naur created and every subsequent language after ALGOL has been expressed in the same way. John Backus’s creation of Backus Normal Form was so groundbreaking that he was awarded the Turing Prize for what he had accomplished among many other things. ALGOL turned into quite a monolithic language by ALGOL 68. By the time ALGOL 68 came out it was so robust with features that it became too complicated to use because the writers wished to put every facet of programming into it. The amount of features and uses of ALGOL remain unsurpassed to this day.

The creation of ALGOL 68 was so complex that Niklaus Wirth condensed ALGOL to build his own language he called PASCAL. PASCAL was built to “encourage good programming practices,” (PASCAL Wiki) and to reduce the complexity of ALGOL which had grown into almost an infinitely flexible language. PASCAL and ALGOL then came together to form Ada, a military language used in missile, flight and air traffic control systems. Ada is a strong typed language that does runtime checking for anomalies or defects which could result in the injury or death of its users.

One of ALGOL’s most important descendants is the creation of CPL (Combined Programming Language). CPL included many of ALGOL’s unique features like block structure and strong typing but also CPL could control the hardware of the computer directly, something that was not seen before in combination. A programmer using CPL could go from using a very high level of abstraction to a low level hardware manipulation in one program. Sadly due to its complexity, like ALGOL 68, it was not widely adopted by programmers because of the immense complexity that it involved. Almost like clockwork a condensed version of CPL was created called simply, Basic Controlled Programming Language.

BCPL led into yet another language created by Ken Thomson from Bell Laboratories in 1969 named “B”. B was further developed and soon came the most widely used language in the world called “C”. So as you can see C can be traced all the way back to the humble beginnings of ALGOL 58 with just three goals to build a programming language.

The spread of computer languages is greatly influenced by ALGOL which has spawned a repertoire of descendants. Even Object-Oriented programming can be traced back to ALGOL and also the Virtual Machine seen in Java. The ALGOL dynasty is vast but its influence is still seen today by many of the modern languages that we use like block programming and reserved words. Backus-Naur Form is the most important creation to come from the creation of the ALGOL grammar. BNF is so important in fact that every single subsequent programming language has used BNF to describe their lexicon and syntax.


Works Cited

Barrett, Niel. The Binary Revolution. 1st ed. Vol. 1. New York: Sterling Pub Co Inc, 2006. 1-320.

McCracken, Daneil D. A Guide to ALGOL Programming. 4th ed. Vol. 1. New York, London: John Wiley and Sons, 1964. 1-106.

Rutishauser, Hienz. Description of ALGOL 60. 1st ed. Vol. 1a. Hiedlelberg: Springer-Verlag Berlin, 1967. 1-320.




Programming Languages : Definitions Assignment
William Easton : 03/30/2008

Binding - A reference to an object set to have a value of something to be used repeatedly throughout a program. Binding is also the identifier to a value such that a name or symbol references a machine address. These bindings are done during compile time and are called dynamic or static binding.

BNF -
Backus Naur Form is the metalanguage that is used to describe context free languages created by John Backus and Peter Naur. First built to describe the ALGOL programming language in 1959 BNF is now used to describe most subsequent languages to this day.

Lifetime -
The lifetime of a variable or reference refers to the time between when the object is created and when the object is destroyed or not used. Depending on what programming language is used each variables lifetime is different.

Programming Language -
A programming language is a made up language that can be used to control the workings of a computer or machine which are defined by a specific lexicon and syntax of which they are formed.

Recursive Decent -
In parsing recursive decent is a top down tree structure that makes recursive calls when analyzing the the syntax of a program during parsing. It uses the BNF syntax after parsing with block structures.

Referencing Environment -
The referencing environment of a variable or reference is the scope of where that identifier is declared in a program. For instance a subprogram is built in the referencing environment of its parent program.

Scope -
The scope of an identifier can be described as the range of influence that identifier has over an entire program. Variables, references and identifiers can only be accessed in the scope of the program that they are declared. This is static scoping. Dynamic Scoping involves the pushing and popping of almost like a global variable.

Semantics -
The way in which the syntax is used in the workings of a program. The semantics are the meanings of a program statement. A semantic can be expressed in many different ways but come out with the same result. Semantics is not the format of the statement but is the instruction of the statement.


Wednesday, March 26, 2008

Summer

In short. No freaking clue what I'm going to be doing.

I have aspirations of what I want to do.

Research - I applied to four research programs all of which I was rejected from.

Lockheed Martin - Nothing yet...

Vanguard - Nothing yet...

SunGard - Backup...

All of these opportunities seem really unimportant to me. What I really want to do is work on my own projects over the summer be my own boss work with clients and hone my skills and really become proficient in what I love doing.
Lots of desicions and hard work ahead of me.

Tuesday, March 25, 2008

Weird Posts

Yeah I just wanted to explain the strange posts. They are actually all of my midterm notes for most of my classes. I figured I would just publish them since I'm using Google Docs and Ubuntu. I like the setup I have going right now. I have my desktop running ubuntu linux exclusively and I have my laptop dual booting with XP and Ubuntu as well. Along with my sicktastic webserver things are going pretty sweet.

Now I'm working on a Content Management system in php. I'm hoping to get really rolling on this because I got some pretty awesome ideas going into this. A content management system for those who don't know is a tool where a user can easily post, change, create new content on their website using an easy interface. Like Blogspot or WordPress. I'm just doing my own.

So here are some projects I'm working on.

1. JFLAP : I'm working with this software in my Software Engineering class. It's a really sweet tool for theoretical computer science so if you ever get into it I highly recommend it.

2. Also I'm working on a compiler for a "Lisp-like" language. Lisp syntax follows something like this:

(BLAH BLAH)
(BLAH BLAH)

So I'm building a compiler in my programming languages course in PHP that is proving to be rather difficult. Thank God Matt Pfahl is on our team or I'd just be building this thing from scratch.

3. The Content Management system that I want to implement for Scranton Ultimate's website. This way the website can be easily maintained by people after me. Hopefully...maybe prep ultimate could utilize it?

4. In my graphics class the next coming project is to build a cube with textures on each side and transform it by rotating it around it's z axis. I've already created the cube itself and rotated it so I just got to add the texture. I'll post the source after I add the texture.


Work work work. Oh yeah and I turned 21...

-Bill
Computer Engineering Using JFLAP
William Easton : 03/25/08

JFLAP is as descibed on its website www.jflap.com "...software for experimenting with formal languages topics including nondeterministic finite automata, nondeterministic pushdown automata, turing machines and several types of grammers, parsing and L-systems."

There are a bunch of extensive online tutorials on JFLAP and I went through a bunch of them so I can demo one for you today.

If you create a new finite automaton there are endless possibilities you can do for this example we will do something easy. Say we want to find a string that ends in lowercase 'a'. The First thing we have to do is to use the easy editor to create our states for our machine that we need. The second thing we need to do is make a starting and finishing state. Then we do all of our transitions.

Now to test it we go and enter our input and we can even see the transition to each state as the automaton accepts input. We can also translate this into rules for a grammar as well. The possibilities are limitless especially with the theory of computing class. Using this tool would be a wonderful idea.

I really stress especially people who have already taken TOC to experiment with this. It's a very interesting tool and could prove very useful.

Friday, March 14, 2008

Computer Graphics Midterm
03/14/2008 : William Easton

Quiz One:
Difference between Vectors and Scalars:
scalar + scalar = scalar
vector * scalar = vector
vector - vector = vector
|vector| = scalar

Dot Products
<3, 2, 1> DOT <4, 5, 6> = (3 x 4) + (2 x 5) + (1 x 6) = 6 + 12 + 10 = 28


Quiz Two:
Cross Products:
i j k
<1, 2, 3>
<4, 5, 6>

i(12 - 15) + j(12 - 6) + k(5 - 8) = -3i + 6j - 3k <-3, 6, -3>

Convex or Concave

Breaking into segments to force convexity...

Define a plane by using a point and a normal.


Quiz Three:
Affine Transformations
Rotation
Scale
Projection

Bishop will give us the affine matrices.


Quiz Four:
Indexed and Non-Index Color - Indexed color is the fact that a pixel can be colored with a number and that number corresponds to a specific color from the color pallate.
Non-Index color is using the hex values for RGBA.

Vector Graphics - using a beam of light to make an image on a screen like a triangle. It will beam light in three directions making the sides of the triangle.

Alpha channel - used to define transparency of a color in RGBA color scheme.


Quiz Five:
GL_LINES
GL_LINE_STRIP
GL_LINE_LOOP
GL_TRIANGLES
GL_TRIANGE_FAN


Quiz Six:
Orthographic - no matter Z score it will always look same

Perspective - objects farther away will seem smaller and objects closer will seem closer (O RLY?)

Drawing a red empty box:
glBegin();
GL_vertex3f(1, 0, 0);
GL_vertex3f(2, 0, 0);
GL_vertex3f(2, 1, 0);
GL_vertex3f(1, 1, 0);
glEnd();


Quiz Eight:
ambient -
specular - bouces off in one direction and changes as your perspective changes
diffuse - equal lighting all around an object

Z Buffering- looking at how far away each pixel is and draws them accordingly


Quiz Nine:
Painters Algorithm - takes the objects to be drawn and goes from back to foreward.
Z Buffering Again - Calculate by distance of pixels


Quiz Ten:
Bilinear Filtering

(1 - ALPHA)(C0) + (ALPHA)(C1) = C3
(1 - ALPHA)(C0) + (ALPHA)(C2) = C4
(1 - BETA)(C3) + (BETA(C4) = C5


Quiz Eleven:
Bilinear Filtering x 2


Quiz Twelve:
Aliasing- one level of intensity
Antialiasing - more than two levels of intensity


Quiz Thirteen:
Texture mapping to a triangle - using coordinates and texture map to make a texture on an object


Quiz Fourteen:
T1 - (1 - ALPHA)(C0) + (ALPHA)(C1) = C3
(1 - ALPHA)(C0) + (ALPHA)(C2) = C4
(1 - BETA)(C3) + (BETA(C4) = C5

T2 - (1 - ALPHA)(C0) + (ALPHA)(C1) = C3
(1 - ALPHA)(C0) + (ALPHA)(C2) = C4
(1 - BETA)(C3) + (BETA(C4) = C5

C6 = (1 - BETA)(T1C5) + (BETA(T2C5))

BAM DONE!
Programming Languages Midterm Notes
03/13/2008 : William Easton

Chapter One: Preliminaries
1.1 Reasons for Studying Concepts of Programming Languages:
    • Increased capacity to express ideas - having knowledge of a powerful language expands how one can think.
    • Improved background for choosing an appropriate language - in order to choose a good language you need knowledge
    • Increased ability to learn new languages
    • Better understanding of the significance of implementation
    • Better use of languages that are already known
    • Overall advancement
  • Readability
    • Operator Overloading
    • Control statements
    • Syntax
      • identifiers
      • reserved words
      • form
  • Writability
    • abstraction - a term used to define and use complicated structures and ignore the hard part
    • expressivity
  • Reliability
    • aliasing - using one memory cell to be the value of two things.
    • exception handling

1.7 Implementation
  • Compiler Implementation
    • Source Program
    • Lexical Analyzer - use symbol table
    • Syntax analyzer - use symbol table
    • Code Generator
    • Machine Code
    • Computer

Chapter Two: Languages
1.1 History
Here are some of the first languages: in extremely sparse detail
LISP - designed as a functional programming language
FORTRAN - first scientific language
ALGOL - universal language for scientific implementation


Chapter Three: Syntax and Semantics
Semantics - meaning of expressions
syntax - the form of those expressions

index = 2 * count + 17

Lexemes Tokens

index identifier
= equal sign
2 int literal
* mult_op
count identifier
+ add_op
17 int literal
; semicolon

Backus Naur Form -
John Backus and Noam Chomsky to describe the syntax of languages and went on to describe every language following ALGOL which was the first language it was used to describe.

Chapter Four: Lexical and Syntax Analysis
A Lexical analyzer is the precursor to the actual compiler. It looks for patterns in the code and separates the source into lexemes. The process includes skipping comments and blanks. Finite automata are used with the regular languages.

Efficiency, Simplicity, Portability

Parse Trees can be made bottom up or top down depending on the parser.

Chapter Five: Names Bindings Type Checking and Scopes
Special Words - reserved words and keywords

Variables - name, address, type, value

BINDING - the type count is bound at compile time, the values are set at compile time the meaning of + is set at compile time and so is the immediate representation of 5. Count is evaluated and bound again at runtime to its new value.

count = count + 5

STATIC DYNAMIC
pre-compile runtime binding
type stays type may change

Dynamic and Static Scoping should also be observed under scope and blocks.

He mentioned a lot in class about Dynamic and Static scoping last class. Also he has a boner for binding. Also he talked a lot about ambiguity in programming. He talked about parsing and recursive decent in top down parsers.

Thursday, March 13, 2008

Modern Latin America Notes for Midterm Exam
03/13/2008 : William Easton

Atlas Part One Notes:
  • Identify:
    • The Treaty of Tordesillas - Treaty from the pope were Spain was given right to settle west of Brazil and Portugal was given right to colonize Brazil area.
    • Latin American Identity
      • Geography - the geography of the region is very diverse and helps explain the history of how the indigenous people were spread out and how the land was colonized and used.
      • Culture - Catholic Church - Latin America was shaped by the catholic church. The peninsulares took it upon themselves to Baptize the indigenous people and they used that as an excuse to enslave them.
      • Native Americans died mostly because of malaria and overworkedness
      • As the creoles gained pride in their separation from the mainland they started calling the place they live the motherland and patria
    • The Monroe Doctrine - President Monroe offered a statement saying that it will do anything in its power to prevent European Nations mainly aimed at france and england to stop them in "recolonizing" the Latin American Colonies. USA used it as a ploy to keep LA countries under control.
    • Slave Centers in Latin America - The Caribbean, Brazil and the US were the major slave centers of the New world. The Caribbean accounted for much of the slave population because of it's sugar heritage.
    • Simon Bolivar - created a slave army and defeated the armies of Spain in Venezuela and liberated it from Spain. He went on to liberate Columbia and Equador. Fearing disjunction he united these states into what he called Gran Columbia which did not last and fell apart after Venezuela and Equador pulled out. Because of their natural land structures made it more convenient not to have a single state.
    • Miscegenation which is the mixing of the natives with the Spanish and the slaves all together.

  • Essay:
    • The Haitian Revolution: The Revolution was the first black revolution inspired by the French Revolution in Latin America. African slaved fought with l'Ouverature against aristocratic Spanish plantation owners and soon drove or exiled most of them out of the country. This revolution really slowed down excited creoles and brought them back to reality. The creoles seeing the US fight and gain independence and the French revolution as well was excited but slowed down by the violence and bloodshed of the Haitian revolution because much of Latin America is overpopulated with slaves. They felt the same massacre would happen to their countries therefore the calling for independence started 20 years after the start of the Haitian revolution. The creoles feared that the Latin American poor would not distinguish between Spanish and creole.
    • Spanish colonies and Portuguese colonies are alike and very different in many ways. They are the same in that they are all shaped by what was happening over in Europe across the Atlantic Ocean. Tensions mounted in the Spanish colonies as there was no ruler of Spain and also when Napolean conquered Portugal the royal family fled to Rio de Janeiro where Pedro the son of the new king of Portugal declared Brazil independent after the royal family went back to Europe. So in both cases Europe influenced the independence of these colonies. The independence movements of Spain and Portugal are different because of the amount of bloodshed that each side caused. People like Simon Bolivar and San Martin created slave armies that liberated much of Latin America from Spanish rule; places like Venezuela, Equador, Columbia, Peru and Chile. Portuguese colonies on the other hand were more fortunate in that little to no bloodshed was needed in order for them to become independent with Pedro saying "I'm staying here".

Atlas Part Two Notes:
  • Indentify
    • Caudillos - a logical response to disorder. The caudillos were men on horseback mostly leftover soldiers from Latin armies that banded together to form the central structure of Latin American government. They played a large role in the central and functional role in the early 19th century of Latin America. Antonio Lopez was the most influential caudillo that stove for military glory that worked against mexico in the end.
    • Treaty of Guadalupe Hidalgo where the US in a basic land grab conquered almost half of the Mexican land now known as California, New Mexico, Arizona, Texas, Colorado and Utah.
    • South America moved from caudillos to more liberal reforms. The Reform Laws limited the rule of the Catholic Church and authority over the people. It eliminated paying money to receive the sacraments and also stopped the CC from owning property outside of the administrative lands it had. This led to much conflict in places like Argentina and Columbia where some of the reforms originated. Argentina pushed for more education and immigration while Columbia pushed for infrastructure such as roads and steam routes through rivers.
    • The Mexican American war is one of the main examples of the "Manifest Destiny" which is the belief that the US's domination over Latin American countries is in God's divine plan for the United States. The US also tried to pruchase Cuba for 120 million dollars which was refused by Spain.
    • The Spanish-American war also saw the US taking control of the Caribbean, Guam and the Philippians. Finally the US took the hand of Panama in gaining independence from columbia and building its canal.

  • Essay:
    • Foreign investments were very important to the development of Latin American countries. England got the biggest jump in recognizing the industrial potential in LA. After WWI investment dollars boomed in Latin America. Great Brittan invested enormous amounts of money into Argentina almost 5 billion dollars which at that point was more than they were investing into India.
    • The prevailing philosophy at the time in Europe and Latin America was positivism. The idea that societies moved through different stages of development at different times and that predictable patterns dictated this process of development and modernization. Order and progress were the main themes of positivism...