cs 403: programming languagescs403.cs.ua.edu/previous_semesters/fall...

41
©2004 Joel Jones 1 CS 403: Programming Languages Fall 2004 Department of Computer Science University of Alabama Joel Jones

Upload: others

Post on 25-May-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

©2004 Joel Jones1

CS 403: Programming Languages

Fall 2004Department of Computer Science

University of AlabamaJoel Jones

Page 2: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Industrial Coloquium Series

6:00pm,Tuesday, November 16th. East Engineering 119(free food is provided during the talk)

William EngelkeMercedes-Benz (MBUSI) Information Technology Careers in Enterprise Resource Planning (ERP)

Sponsored by the ACM and the Department of Computer Science

Visit the website at http://cs.ua.edu/industrial.asp

For more information contact: [email protected]

Page 3: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

NEED A JOB??? CARE Research & Development Lab

is looking for bright, motivated students

Skills desired: Previous .NET experience Web programming experience Graphics skills are a plus

Contact Kerri Keith at 348-5934 or [email protected]

For more information about our offices visit: http://care.cs.ua.edu

Page 4: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Ruby

• an interpreted scripting language used for object-oriented programming

• All data is an object, like we saw in Smalltalk

• Its syntax and design was influenced by Perl

• It has no functions, only method calls

• Simple Syntax

What is Ruby?

What is it used for?• Text Processing

• System Management (Databases)

• XML Programming

• GUI Programming

Page 5: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

• It is very similar to Perl in text editing, but considered newer and better.

• Handles exceptions like in Java

• Like Smalltalk, it only supports single inheritance and also uses code blocks.

• It provides a number of features that Python is still working toward

How does it compare with other languages?

Interesting Facts:• Ruby is not an acronym. It was named after the jewel.

Sources:

http://www.rubycentral.com/misc/intro.html

http://www.ruby-lang.org/en/

Page 6: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

LISPUses:

• real world programming anywhere from web development to finance, prevalent in academia, and also in AI• Yahoo! Store web commerce site originally coded in LISP

Differences:

• Lisp does not require the programmer to specify the data type of variables• Lisp code can also be denser (i.e. there is more expressed in a single line)

Tiffany Cooper

Page 7: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

11/11/2004 Chris Butler7

ASP.NET

Chris Butler

CS403

Homework 1

Page 8: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

11/11/2004 Chris Butler8

ASP.NET

Active Server Page

The implementation behind the ASP page was created by

Microsoft and intended as an open technology server-side

framework, giving web developers the freedom to develop

dynamic web sites.

ASP can be object oriented. ASP scripting host is language-independent. So you can script

with Python, Rexx, PerlScript, JScript and VBScript. There are many different reasons and ways to use asp, such as

html/web server controls, user controls, forms, form viewstate and form validation, caching, object, accessing databases, security options, and XML Web services.

Page 9: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

11/11/2004 Chris Butler9

Form Viewstate

What is Viewstate? It works in two parts…

The first part is client detection and dynamic adjustment of the html being sent to the client.

The second part controls the viewstate via hidden form fields. http://butlerit.net/cs403/viewstate/. The client sends the state of the form along with the form each time it is sent to the server. Along with this the server sends back the state to the client in the form of the hidden field.

Note that this information is not stored on the server and it’s not done by client-side software via ActiveX or Java. The state is maintained by standard html.

The downside to this is the increase in the size of the page.

Page 10: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

11/11/2004 Chris Butler10

<%@ Page Language="VB" %><script runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)If Request.Form("txtName") <> "" Then

lblSentence.Text = Request.Form("txtName") _& " selected " &

Request.Form("ddlColor")End If

End Sub</script>

<html><head><title>ASP.NET Viewstate Form Sample #1</title></head><body bgcolor="#FFFFFF">

<form action="form1.aspx" method="post">

Enter Your Name:<input type="text" id="txtName" name="txtName" />

Pick a Color:<select id="ddlColor" name="ddlColor">

<option>Red</option><option>Orange</option><option>Yellow</option><option>Green</option><option>Blue</option><option>Indigo</option><option>Violet</option>

</select>

<input type="submit" id="btnSubmit" text="Submit" />

</form>

<asp:label id="lblSentence" runat="server" />

</body></html>

<%@ Page Language="VB" %><script runat="server">

Sub btnSubmit_Click(Sender As Object, E As EventArgs)lblSentence.Text = txtName.Text & " selected " _

& ddlColor.SelectedItem.TextEnd Sub

</script>

<html><head><title>ASP.NET Viewstate Form Sample #2</title></head><body bgcolor="#FFFFFF">

<form id="frmViewState" action="form1.aspx"method="post" runat="server">

Enter Your Name:<asp:TextBox id="txtName" runat="server" />

Pick a Color:<asp:DropDownList id="ddlColor" runat="server">

<asp:ListItem>Red</asp:ListItem><asp:ListItem>Orange</asp:ListItem><asp:ListItem>Yellow</asp:ListItem><asp:ListItem>Green</asp:ListItem><asp:ListItem>Blue</asp:ListItem><asp:ListItem>Indigo</asp:ListItem><asp:ListItem>Violet</asp:ListItem>

</asp:DropDownList>

<asp:button id="btnSubmit" text="Submit"onClick="btnSubmit_Click" runat="server" />

</form>

<asp:label id="lblSentence" runat="server" />

</body></html>

Form1.aspx Form2.aspx

Page 11: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

11/11/2004 Chris Butler11

References

http://www.asp101.com This is where the examples and tutorials came from.

http://www.asp.net The official Microsoft ASP. net site.

Page 12: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Bradford Hester

Page 13: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Bradford Hester

What is Groovy?• Groovy is an objected oriented language that

uses Java-like syntax.

• It’s purpose is to be able to use the same powerful and concise coding syntax of Ruby or Python but allowing you to stay on the Java Virtual Machine.

• You can use Jython and JRuby, which are ports for Java but they share the look and feel of their ancestors.

• Groovy gives you this ability with out having to learn a new syntax.

Page 14: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Bradford Hester

Groovy Examples

• Dynamic typing like Smalltalk

• Range Syntax

• Negative Indexing

Page 15: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

SQR

Daniel Robinson

Page 16: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

SQR

SQR is a programming language specifically designed for SQL database reporting and information processing.

Page 17: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

SQR Script Language Built-in output formatting Used mostly for creating reports Has SQL as it’s base Runs on serveral different platforms

Page 18: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Resources http://www.ontko.com/sqr/ http://www.codefactory.net/lesson1.htm

Page 19: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Tool Command Language (tcl)

Originally intended to be a reusable command language

These command languages were developed quickly and designed poorly

Developers then concentrated on implementing a general-purpose command language that could be easily integrated into new applications.

Syntax is a mixture of C and UNIX

Suzanne Howard

Page 20: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Pros and Cons of tcl

Interpreted language

High-level scripting language

Runs on many platforms

Extensible

Embeddable in applications

Free!

Interpreted language Strange syntax Weak facilities for namespace control and modularity Weak data structures Difficult to organize/debug

Suzanne Howard

Page 21: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Katrina Roan 21

Haskell

Page 22: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Katrina Roan 22

Haskell

Functional Language The standard version is Haskell-98 It is different from that it uses lazy evaluation

– i.e. it only implements enough of the code to get the answer.

A lot of the programs I found that were written in Haskell were for thesis or dissertation work.

There is an implementation of Quake written in Haskell.

Page 23: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Katrina Roan 23

Haskell

Haskell.org boasts that Haskell code is “shorter, clearer, and more maintainable” and that using Haskell “offers you substantially increased programmer productivity.”

There are several derivatives that implement object orientation. These include: Haskell++, O’Haskell, and Mondrian.

MIT and Glasgow University each developed a version called Parallel Haskell for parallel computing.

Page 24: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

PostScript Programming

All Text in Italics were taken from the following website:E. Weingar A First Guide to PostScript. [Online] Available http://

www.cs.indiana.edu/docproject/programming/postscript/postscript.html, January 18, 1997

David Crawford

Page 25: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

PostScript

• What is PostScript?“PostScript is a programming language optimized for printing graphics and text (whether on paper, film, or CRT is immaterial). In the jargon of the day, it is a page description language.”

• Why PostScript? “The main purpose of PostScript was to provide a convenient language in which to describe images in a device independent manner. This device independence means that the image is described without reference to any specific device features (e.g. printer resolution) so that the same description could be used on any PostScript printer (say, a LaserWriter or a Linotron) without modification. In practice, some PostScript files do make assumptions about the target device (such as its resolution or the number of paper trays it has), but this is bad practice and limits portability.”

David Crawford

Page 26: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

PostScript

• Developed by Adobe in the early 1980’s• PostScript is widely used on many platforms as a page description

language.• Probably most widely used page description language in use today.• Commonly used for Desktop publishing.• Most Printers support PostScript• Alternatives to PostScript: HPGL, PCL, GDI, etc…• PostScript is a flexible language and “could” be used for application/game

development, but this would be difficult.

David Crawford

Page 27: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

PostScript

• Stack Based Language using something similar to reverse polish notation.

• PostScript is an Interpreted language.• Uses arguments, operators, comments and a

lot of other good stuff other programming languages have.

• Fern Example:

David Crawford

Page 28: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,
Page 29: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Darwin

--In order to achieve fast learning and adaptation, the syntax of the language resembles the standard C language syntax.

--The DARWIN language is designed to be a simple genetic algorithm oriented language.

--DARWIN language has a special syntax construct called moderators.

--A moderator is a function that associates an operation on a data structure, creating the effect of encapsulation present in Object Oriented

programming.

--For example, the gene construct has the print, initialize, crossover, mutate and evaluate operations defined on it.

--A DARWIN program is generally composed of three parts - -the genetic algorithm constructs specification, -the moderator definitions, -and the user-defined set of functions. Josh Naro

Page 30: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Glade

April GuyCS 403

11/08/2004

Page 31: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Glade is a free user interface builder for GTK+ and GNOME that is released under the GNU General Public Liscense

• Using Glade to create interfaces is slightly different to other widget sets because instead of having fixed positions and sizes for widgets, Glade uses containers such as horizontal boxes and tables to arrange widgets. This feature makes it easier to support resizing of windows and allows easy conversion into alternate languages.

Page 32: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Glade windows

• Main window - lists all of the windows and dialogs making up a project

• Widget palette - shows icons representing all of the available widgets

• Property editor - allows user to alter the properties of widgets, such as the widget size or the label text

Page 33: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,
Page 34: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Gonvert

• Gonvert is a conversion utility that allows conversion between many units like Ancient, Imperial with many categories like length, mass, numbers, etc. All units converted values shown at once as you type. Easy to add/change your own units.

Page 35: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Kellan Burt

Dylan (Dynamic Language) Intended for rapid Application and System

Development Combines best qualities of static languages

(small, fast programs) with the best qualities of dynamic languages (rapid development, code that's easy to read, write, and maintain)

Facilities for Database and GUI programming have been implemented

Page 36: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Kellan Burt

What Makes Dylan Special? Automatic memory management Clean, consistent syntax Fully and consistently object-oriented

model Dynamic as well as static type

checking First-class functions and classes

Page 37: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Kellan Burt

Dylan vs. Other Languages Syntax structure resembles Scheme Similar to Smalltalk: everything is an object, has

an interactive prototyping environment

Page 38: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Mercury.

john hayes

Page 39: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

About it.- A logical programming language (like Prolog)- In fact, could be described as what Prolog should’ve

been.- Strongly typed, strongly moded

e.g. :- pred func(int, int, int).:- mode func(in, out, out) is det.

- nondet, multi, semidet modes

From the Mercury site: “Mercury is designed for the construction of large, reliable, efficient software systems by teams of programmers.”

Page 40: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Some more about it.- Compiler actually creates C code as intermittent step,

then uses shell script to run gcc. :-\- Seems to have some advantages:

- "Half of the typical programming errors cannot even be expressed using Mercury and a lot of the others are automatically caught and pinpointed," — Dr Zoltan Somogyi

- Disadvantages:- Documentation is lacking- Syntax is difficult to read

Page 41: CS 403: Programming Languagescs403.cs.ua.edu/Previous_Semesters/Fall 2004/02StudentPresentations.pdfLISP Uses: • real world programming anywhere from web development to finance,

Who cares?- Microsoft, apparently. ~ $500,000 donated to

University of Melbourne for Mercury research.- Then again, it only takes Microsoft Corp about 22

minutes to generate that much money…- Project is now targeting .NET.

- If you do, look athttp://www.cs.mu.oz.au/research/mercury/