[Navigation Bar]  
 
 

    

[OpenSUSE powered]
[BUSH powered]
[vi powered]
[XML] [RSS]
Dinner Meeting Minutes
Networking, Learning and Working Together
 
  • Not available 
 

Live in southern Ontario? Attending dinner meetings is free.

Thursday, June 17, 2004

Attendance

Ken B, Mel W, Mel W, Dave M, Chris Jz, Lawrence L, William P


Meeting Business

Summer Retreat 2004

PegaSoft's Annual Summer Retreat is a 3-day weekend in Ontario vacation country
with computer hacking, boating, fishing and an all-you-can-eat breakfast.
Attendance is free but everyone is expected to bring a computer and chip in for
food.  Two months away--August 20-22 weekend.  Need a confirmation on who's
going.

Ken B. Dan B, Mel W, Dan M are planning to attend.  Dave M may not be able to
attend the entire event.


Summer Programming Challenge 2004

This year's challenge: Esmeralda, the Gloomy Fortune Teller.  The classic AI
game Eliza reads what a user types, rewrites it and prints it back as a
question.  Create a similar game featuring Esmeralda, a gloomy fortune teller,
who begins by saying "I'm peering into my crystal ball."  Take the user's
questions about what she sees and have Esmeralda predict tragic events that
will happen in response to the questions. The program should pick out key words
from the user's questions and should use the key words correctly in the
responses.

Mel W. reported some unexpected challenges presented by the project making it
more difficult than it seemed at first sight.

The deadline for entries in this contest is the third weekend in August, the
PegaSoft Summer Retreat weekend.  Let's see some creative entries.


PegaSoft Web Site

Ken is looking at getting at static IP and host www.pegasoft.ca from his house.
(This assumes his firewall troubles are over.)  Groupware could be installed
and ssh access for PegaSoft members.



Open Forum - Industry Quote
[The opinions are those of the participants.]

Quote: "Our emphasis on Linspire is ease of use making Linux quick and easy to
install and use," he said. "Other products may have a different focus. That
doesn't mean they aren't great products, just that their focus may be
different. Every new Linux computer helps the Linux desktop industry,
regardless of what company's product you choose...We want to encourage
side-by-side comparisons of the latest Linux products." [Michael Robertson,
Lindows President]

Lindows was sued by Microsoft and changed the name of their distribution to
Linspire.  Linspire is being bundled with Red Hat Fedora and Mandrake for
comparison.  It was noted that Knoppix (smart and easy to install) and SuSE
(heavily tested and full of features) were not included.


Open Forum - In the News
[The opinions are those of the participants.]

Headline: Ontario Ministry of Education is rolling out StarOffice over all its
school.  It will be used by 2.5 million students and is one of the largest
deals for the Sun office suite. [Slashdot]

There's no real need for students to use Microsoft Office.  The functionality
of StarOffice is equivalent and it can load/save MS Office files.  This acts as
a natural stepping stone: get the staff used to using StarOffice as their
day-to-day application makes it much easier to adapt to Linux in the future.

The adoption of StarOffice happened sooner than expected.  There is a budget
crunch in Ontario.  Customs and Revenue department apparently use Linux.

Headline: SCO revenues fall by more than half, partly due to legal costs. [eWeek]

SCO was delaying their lawsuit, slow in presenting evidence.


Headline: Xandros, a start-up focused on desktop Linux, has begun offering a
stripped-down but free version of its product. [eWeek]

Xandros is the former Corel Linux.  It looks bad for a commercial product to
begin releasing a free version.


Headline: Fedora Core 2 Released

Ken installed Fedora Core 2.  It comes with the latest versions of Gimp,
OpenOffice 1.1.1 and Ximian (the Outlook-like mail reader).  However, there
were numerous small bugs that should have been corrected, such as a boot
floppy image that doesn't work and no sound at startup.  Red Hat's Fedora
project is apparently a way to release Linux distributions without any testing
whatsoever.  Ken was seriously considering moving to another Linux distribution
where he knew that some basic testing would be done and the volume would not be
muted on startup.


PegaSoft Project Updates


BUSH

Throws an exception on Fedora Core 2 startup.  Problem being investigated.


SQL BASH

William P is working on a version of Bash with SQL interface to GDBM.


MPEG Logger

Chris Jz presented a summary of the information in the "Linux Toys" book that
related to the MPEG Logger project.  Chapter 4 covered "Building a Digital
Home Video Archive" and Chapter 5 was entitled "Building a Television
Recorder/Player".  Chris outlined the recommended hardware, cabling and
software.


Lease/Rentals

Ken presented a preliminary overview of the Lease and Rentals project.  The
official RFP and deadline were yet to be determined.  It was noted that the
project was sizable, involving hundreds of buildings and thousands of users.
When the RFP is finalized, PegaSoft would be expected to supply a bid for the
project, covering estimated time and costs.  Until that time, Ken cautioned
people about the confidentiality of the client's name and private information.

There was disagreement as to whether another meeting should be held to discuss
this project or if discussion should be held on the mailing list.  It was
decided that a a preliminary meeting would be held on Tuesday, June 29 (1 1/2
weeks) to determine who was interested and discuss air out the challenges
presented by the project.

Ken would email details to Lawrence L and Dave M.  Dave M requested more
information about BUSH as a development environment and how it would tie into
project.  Ken would supply more information at the next meeting.


Discussion: Survey of Web Template Tools (Ken Burtch)

Web development can be divided up into the following layers:

- Web page templates (the presentation layer).  With CGI software, the program
  had to maintain a stack of open tags and ensure that tags were closed
  properly.  Templates allow content to be inserted into specific points in an
  HTML page.  Virtually every scripting language has a template system
  available.
- Shared data servers (JavaBean servlets, C++/CORBA server, etc).  With
  multiple web servers (or multiple applications) access the same
  functionality, there needs to be servers to serve up content.  On simple web
  sites, servers aren't needed and databases are directly accessed.
- Support libraries

General Problems with Scripting Languages

There are several problem common to many scripting languages and template
engines.

a. Lack of Redundancy / Implicitly Typed Languages

Languages have no real-world knowledge.  They require redundancy to check for
inconsistencies (for example, variables declarations that make explicit the
variable names and types to be expected.)  Many scripting language have
"typeless" or "dynamically typed" variables and the context is used to
determine the types.  Scripts are shorter but the reliability suffers because
errors are only caught when the bad statement runs.  They require extensive
test suites which are longer than type declarations and must be kept up-to-date
with the project when they should be focusing on the functionality of the
project.

There is also an issue called "type juggling".  If there are two alternatives
for conversion, the programmer must try to guess which conversion the language
will use.     With implicit conversions, comparing two things can have unusual
semantics (in PHP, "hello" == 0 is false ).

a1. The Boolean Problem

Many scripting languages have no boolean values in order to save typing.  This
idea stems back to at least the C days (if ( !f = fopen(...) ) { printf "%s\n"
"file was not opened" } ).  Perl combines this with the default variable $_ so
you can loop through a list without explicitly assigning anything.  The cost of
this is that malformed expressions are treated as good.

b. Overreliance on Objects

To improve reliability and control scope, an often recommended solution is to
use objects as a catch-all fix.  That is, "Just throw an object around it as a
wrapper and write in a few tests" for common mistakes.  For example, Python has
a clean syntax but if you need to implement large numbers of objects, Python
begins to have the cluttered syntax of Java and has similar problems.

c. The Kitchen Sink Problem

In the old days, features meant "can I break out of a for loop?"  Now you can
count how many loop control statements a language has¿yet the majority of the
time breaking out of a loop is what you need.  Some scripting languages steal
features from other languages indiscriminately.  Can you hold the basic feature
set in your head? Sometimes throwing in large numbers of seldom-used features
introduces more loopholes for errors than saves time.

d.Performance Hype

Many claims are taken out of context.  Steve Ferg claims Python is 5-10 times
more productive than Java because "Hello World" programs are smaller in Python.
Productivity is directly related to project size and purpose...or even the
personality of the programmer.  Shorter projects have less need of strong
testing, large projects have less need for rapid development.  Take performance
claims in context.

e. Evolution Problem

When scripts grow too big, how difficult are they to convert to a language
designed for larger projects?  Will they have to be rewritten from scratch?
Python has a compiler but you are still left with the Python environment.  You
can embed real Java in a JSP page.

f. Model / View / Controller (MVC) abuse

Some suggest that a web site should be split up into programmer application
logic (model), web designer presentation (view) and middleware glue
(controller).  Some tools also split up user content or place heavy
restrictions on what can be done in which section.  This is not a magic bullet.
XML and CSS take care of most of a content designer's issues.  Overkilling
simple projects with unnecessary features before they get started (the old "if
OOP programmers build toasters" joke).  Break up a web site appropriately to
fit the project and environment instead of repeating an acronym you lifted off
the web.


1.2.3 Perl + Mason

Perl (Practical Extensible Report Language, http://www.perl.org) is a scripting
language loosely based on UNIX command tools and written by Larry Wall.  Perl
is often used to provide a UNIX-like tool on non-UNIX platforms.  Perl is a
hodge-podge of features without much of a language design, intended to be a
portable swiss-army knife for development.  Modern Perl has object-like
structures and a modular structure, but it's design has left the roots on
which it was built.

Perl has strongly integrated pattern matching capabilities (similar to awk),
shell-like ability to run commands, supports typeless variables, arrays and
hashes (associative arrays).  Many add-on modules are available from CPAN for
database access, web scripting, graphics and more.  The mod_perl Apache modules
allows scripts to be compiled and cached in memory for faster executing.

Claim to Fame: Portable CGI scripts
Reality Check: Perl became popular in the early days of web design because of
the availability of CGI scripts that would run on a variety of platforms.  As
CGI scripting has been superceded by template approaches, Perl has become less
popular for web development.

Perl Advantages:
- contains basic business functionality
- good for quick scripts and concept prototyping
- large number of support libraries

Perl Disadvantages:
- Linux tools exist that do many of Perl's basic features
- Perl has many features implemented in non-standard ways
  - Perl eq version Shell eq
  - OR versus || - have different precedence
- Context-sensitive syntax
  - sleep 4|3 versus print 4|3, vertical bar has different precedence
  - function parentheses are optional...sometimes...kind of...
  - meaning of $_ depends on context
  - substr( s, 0,3 ) = "hey"
  - if ( @array ) { .. } - returns the length
- Doesn't scale well
- minimal objects and module design
- Poor error checking / in some ways, too much like shell scripting
  - adding an extra right parenthesis causes an error 20 or 30 lines down the
    source
  - undefined values
- the boolean problem
- the kitchen sink problem

Mason (http://www.masonhq.com) is a PHP-Smarty-like template engine for Perl.
Mason refers to templates as "components".  Using mod_perl, Mason supports
embedding Perl scripts in templates.  Apache information is shared through a
request object.

Mason's scripting language is an extended Perl but it has a large number of
special purpose embedding tags beyond simply substituting expressions into the
web page: <%perl> embeds a perl script, <%doc> is preprocessor
comments (that never make it to the client browser), <%filter> can filter
lines matching a regular expression, <%init> for page startup commands,
<% x %> substitute value of expression x, etc.  Templates can inherit
each other.

Mason actually uses Perl to process the embedded source.  Persistence of
variables is handled by mod_perl.  Mason runs 3 times slower than pure mod_perl
scripts.

Mason template example:

    <%perl>
    my $noun = 'World';
    my @time = localtime;
    </%perl>

    Hello <% $noun %>,
    % if ( $time[2] < 12 ) {
    good morning.
    % } else {
    good afternoon.
    % }

Advantages:
- more popular that PageKit
- more powerful than PageKit
- the templates use an extended Perl actually interpreted by Perl

Disadvantages
- Web server must be restarted on any library module change (or use
  Apache::Reload).
- Touching templates only rebuild/re-cache that template, not anything that
  depends on the template.
- The Boolean problem (because of Perl)
- The Kitchen Sink problem (because of Perl)
- Implicitly Typed Language (because of Perl)


1.2.4 PHP + Java + Bash

PHP (Preprocessor: Hypertext Preprocessor, http://www.php.net) is the most
popular template engine in the world and a part of the Apache web server
project.  It supports a wide-range of databases, including PostgreSQL.

PHP commands similar to shell and Perl.  They are contained in <?php...?>
tags embedded in a template.  Anything written to standard output is inserted
into the web page.  Its arrays are actually hashes¿it has no true arrays.
Variables are expanded using shell syntax.  It uses shell-style quoting rules.

Claim to Fame: First Open Source Template Engine
Reality Check: There are hundreds open source template engines now.  PHP
remains the most popular.

<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
   echo 'You are using Internet Explorer.<br />';
}
$a = array(1, 2, 3, 17);

foreach ($a as $v) {
   echo "Current value of \$a: $v.\n";
}
?>

PHP Advantages:
- Industry standard solution, heavily supported
- Fast execution speed

PHP Disadvantages:
- The Boolean problem - "hello" == 0 is false, (boolean) "hello" == (boolean) 0
  is true
- Implicitly typed language
- The Overreliance on Objects problem
- poor error checking / in some ways PHP is glorified shell scripting
- shell-style quotations

Although PHP is itself a template engine, creating new PHP extensions is a
popular past-time.  There are over 100 template classes for PHP.  The most
popular is extension Smarty.  Instead of a single .php file, there is a .php
file containing content (.conf files), the application logic (.php files) and
the HTML and variable substitutions (.tpl files).  The PHP code should register
all values with the Smarty object and end with
"$smarty->display('template')" to load the template and performs the
substitutions.  It also caches the web pages.  

Smarty values are substituted using {$..} which may include filters called
modifiers chained together with vertical bars (|).  There are control tags
like {if...}.  In a pinch, php can be added to a template using {php}...{/php}.

Smarty example (template file):

{include file="header.tpl" title="User Info"}

<h1>{$title|default:"no title"}</h3>
User Information:<p>

Name: {$user.name|capitalize}<br>
Address: {$user.address|escape}<br>

{include file="footer.tpl"}
{literal}{$ is not a substitution here{/literal}

Smarty Advantages
- template modifiers allow basic customization of output by page designers
  without needing PHP
- caches web pages
- widely adopted, GUI editors available

Smarty Disadvantages
- extending a language with an object doesn't work very well...disconnects from
  PHP
  - values to be substituted must be registered in the object
    ($smarty->assign('total','1500');)
  - the template name must be typed in
- the template syntax is non-standard
  - {$..} neither PHP nor shell
  - parameters are separated by colons(:)
  - config files use Microsoft INI syntax, not PHP
- caches are not cleared on code changes
- merging templates results in variable conflicts/mismatches (same problem as
  PageKit storing variables in hashes)


1.2.5 J2EE (JSP) + Bash

Java is an object-oriented language developed and owned by Sun Microsystems.
Loosely based on C++, Java has features such as exceptions, threads and
objects.  Java is supported by Linux and GCC.

Java applets plus java servlets makes the Java 2 Enterprise Edition (J2EE).
Sun's answer to PHP and ASP is a templating system called JSP.  This uses a
tag language called EL (expression language) that resembles XML.  JSP treats
the web page as a kind of object.  EL is intended to control the presentation
layer while the application logic is held in a Java bean (distributed object).
JSP pages can also contain small Java "scriptlets"...fragments of Java source
code.  The latest model is called "JavaServer Faces" (JSF) which supports
event-driven web pages (June 2004).

Claim to Fame: The Official Sun Template Engine
Reality Check: Since when have any of Sun's ideas ever lived up to the hype?

Regarding EL.  Use ${..} shell-like notation to substitute a value or
expression,  <%@ for page attributes set page attributes or import
functions, <jsp:set or <jsp:get to import the bean, form or session
objects attributes (variables),  <c: for conditional statements (tags), and
so forth.  To create and import a taglib function requires writing the Java
function, defining the header in an XML TLD document, and then importing it
into the web page.  To import a bean, use <jsp:useBean.  To import an
applet, use <jsp:plugin. 

Pages are served up as a thread running in a Java server (ie. a "servlet").

Sample JSP Page:

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page isThreadSafe="true" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/functions" prefix="f" %>
<html>
<head<title>Localized Dates</title></head>
<body bgcolor="white">
<%@ include file="banner.jspf" %>
<jsp:useBean id="locales" scope="application" class="mypkg.MyLocales"/>

<form name="localeForm" action="index.jsp" method="post">
<c:set var="selectedLocaleString" value="${param.locale}" />
<c:set var="selectedFlag" value="${!empty selectedLocaleString}" />
<b>Locale:</b>
<select name=locale>
<c:forEach var="localeString" items="${locales.localeNames}" >
<c:choose>
  <c:when test="${selectedFlag}">
    <c:choose>
      <c:when 
        test="${f:equals(selectedLocaleString, localeString)}">
...
  <jsp:setProperty name="date" property="locale"
    value="${locales.selectedLocale}"/>
  <b>Date: </b>${date.date}
</body>
</html >

JSP Advantages:
- true booleans, stronger debugging
- pages can be compiled into executable Java class files

JSP Disadvantages
- Sun has sided with Microsoft against Linux
- EL is hard to read and cumbersome compared to other tools
  - importing a function requires setting up 3 different files
- The Overreliance on Objects problem
  - simple tasks are awkward to code (loops require declaring an iterator
    object, etc.)
- notoriously hard to read error messages that assume internal knowledge of Java
- compatibility problems with non-Sun Java vendors


1.2.6 Python + Zope

Python (named after the Monty Python comedy troupe. http://www.python.org) is
a scripting language designed for simplicity and readability.  It is described
as a "prototyping language" for testing concepts, not for large scale
applications.  Modern Python supports exceptions, threads, packages and
objects.  Python is known to be slow, has weak encapsulation and lacks a strong
typing system--limiting its scalability.

Claim to Fame: Python is easy to learn.
Reality Check:  At one time, this might have been true.  The current version of
Python suffers from the Kitchen Sink problem.  Too many ideas from Java, C++
and Perl were haphazardly shoved into Python, causing Python to become a
tangled weave of conflicting design philosophies.  Core Python is simple.
Learning to do something useful is not.

Example of Python:

    # Print out the menu:
    print "Please select a shape:"
    print "1  Rectangle"
    print "2  Circle"

    # Get the user's choice:
    shape = input("> ")

    # Calculate the area:
    if shape == 1:
        height = input("Please enter the height: ")
        width = input("Please enter the width: ")
        area = height*width
        print "The area is", area
    else:
        radius = input("Please enter the radius: ")
        area = 3.14*(radius**2)
        print "The area is", area

Python Advantages:
- has basic features required to do the job
  - arrays (..), lists [..] and hashes {..}
- lean syntax with indent blocks and eol as statement terminator...but why :?
- works with source control
- has web, time and database libraries
- is easy to learn basics

Python Disadvantages:
- poor interface to O/S environment (shutil package to run shell commands)
  - awkward to use for UNIX shell activities
- inconsistent language features
  - Two string literals concat ("A" "Test") but two numbers don't add together
  - _ works at the command prompt but not in a script
  - 2+2 prints 4 at the command prompt but prints nothing in a script
  - triple quote string kludge for documentation
- language features stolen from other languages
  - two many tricks, not enough substance ¿ kitchen sink syndrome
  - C++ objects put straight into Python, not Python-ized to fit into the
    language...as if designers
    said, "Go learn C++ and then come back to finish learning Python."
   - C string formatting
- poor error messages
  - If everything is legal, then nothing is illegal
  - "def fib(n)" results in "SyntaxError" not "comma missing", Ada says missing
    "is"
- poor scaling due to a lack of redundancy
  - If there is no redundancy, then nothing can be checked
  - multiple assignments, a>b==c relation chains
  - no strong typing
  - lack of truth values (everything is true)
- overuse of object syntax
- using non-object syntax, then switching to object syntax for additional
  functions
- exceptions as classes, etc.
- use of objects to overcome deficiencies in the language


Chris Jz argued that Python was strongly typed, but Mel W pointed out that,
unlike other strongly typed languages,  Python was also dynamically typed as
well, meaning the run-time typing issues were significant.

Zope (Z Object Publishing Environment, www.zope.org) is a collection of Python
classes for performing basic web site administration, including user logons,
database connects, template processing and invisible saving of variables
(persistence/sessions).  It can run as its own web server (Zserver) or under
Apache.

Zope's scripting language is called DTML (Document Template Markup Language).
The format of the commands is <dtml-var name="varname"> to substitute a
variable or expression into a page, <dtml-if "x>y">, <dhtml-in>
to access values in a hash, <dhtml-let> for a for loop, etc.  DTML is
loosely based on Python.  A new template system called ZPT is superseding DTML.

Zope works by generating dynamic web page via Python objects (that is, web page
generating objects).  The objects (documents) are managed by container objects
(virtual folders): that is foo/bar means bar is a function called by the foo
object (like PageKit).  The objects are persistent (their variables are static,
saved) so simple applications never access a database directly.  If you need to
access the database, you use Zope SQL (ZSQL).  Access a directory will
automatically call up the index document.
  
New web pages can be created by declaring new objects in the ZMI GUI builder.  

Zope DTML example:

<dtml-var standard_html_header>

<h1>Thanks <dtml-var user_name></h1>
<dtml-if zooName>
    <p><dtml-var zooName></p>
  </dtml-if>
<table border="1">
  <th>Name</th>
<dtml-in actors>
  <tr>
  <td><dtml-var sequence-item</td>
  </tr>
</dtml-in>
</table>
</body>
</html>

Advantages:
- Zope is good for prototyping because of the GUI builder
- Zope is good if you're a web designer building multiple web site that have
  the same basic features, or web sites like newspapers that present variations
  of content and layout (not so good if you're building a single web site with
  many unique web pages)

Disadvantages:
- The Overreliance on Objects problem
- The Boolean problem
- Zope objects don't scale well to complex, detailed web sites
- Zope Postgres drivers have problems
- Zope has poor documentation
- Zope has a poor design making it difficult to debug and use to large projects.
- Zope has poor server-side security


1.2.7 Other Products

- BUSH
- WebMacro
- Walt Disney's TEA
- MicroSoft Active Server Pages (ASP) and .Net objects ¿ essentially <% tags
  containing MS BASIC instructions. <% =2+2 %> returns 4, <% =date
  %> substitutes the value of date.
- ColdFusion

Ken cautioned people that this overview was based on web research and that he
did not install all of the products.


Next Meeting

The next meeting will be Thursday, July 15, 2004.  Topic: TBA

There will be no August meeting due to the Summer Retreat.

       

« Truth Humility Communication Nobility Freedom Purity Excellence Right Support Courage Compassion Quality Honesty Trust Cooperation Challenge Education »
PegaSoft Canada - A Linux Association Since 1994