According to Paul Graham, the power of a programming language is equal
to its succinctness (see "http://www.paulgraham.com/power.html"). I
agree with him, and extend his postulate from languages to application
development environments in general.
I'm spending most of my time writing the database-and-GUI kind of
business applications. So this is the field where I'm personally
interested in, and which is sufficiently large and specialized in its
requirements to be also of general interest. I'm using Pico Lisp for
that, having built an application server framework on top of it with
quite high succinctness and abstractions for this type of applications.
I don't doubt that other people have tried to solve these problems before, so
there should be other environments with equal or higher succinctness (and thus
programming power). To make the systems somehow comparable, I specified a very
simple application with certain typical features, and posted it as a challenge
to the Lisp community:
http://software-lab.de/succinctness.html
There is a specification, a complete solution (in Pico Lisp), and a link
to a life test setup.
- Alex
--
Software Lab. Alexander Burger
Bahnhofstr. 24a, D-86462 Langweid
a...@software-lab.de, http://www.software-lab.de, +49 821 9907090
I think programming languages are more about "expressiveness",
of which "succinctness" is just one aspect. This all just sounds
to me like an opportunity to argue over the meaning of words.
>>>>> On 29 May 2004 14:10:46 GMT, Alexander Burger ("Alexander") writes:
Alexander> There are endless discussions about the best and most
Alexander> powerful progrmming environment.
I thought this was settled 20 years ago and the answer was "Genera".
(The MIT-cum-Symbolics crowd had plenty of discussions and ideas about
relatively radical new places to move forward from there, but the world
wasn't even ready for Genera, yet, so those were never realized.)
Alexander> But perhaps is it possible in some certain, well-defined fields?
Generally, people will construct a problem that suits
the answer they wanted.
For example, I think most people would even agree that SQL
is the best language for manipulating SQL databases as such.
APL is a very concise and beautiful language for expressing
many kinds of problems.
If you're talking about programming environments, I think
you'll find that it's fairly religous. Might as well ask
what the "best" editor is.
And we all know the answer is ZMACS/ZWEI, so don't kid yourself.
:)
No, I have this type of problem permanently, and I'm sure that other
people have it, too.
> For example, I think most people would even agree that SQL
> is the best language for manipulating SQL databases as such.
But how succinct are the resulting programs?
I don't want to start a philosophical debate, but simply see hard facts.
A short and succinct solution. Is that so difficult?
> And we all know the answer is ZMACS/ZWEI, so don't kid yourself.
> :)
Maybe 42 ? ;-)
Yes, and what I'm looking for are _other_ systems optimized for such
tasks.
> comparison with other languages should include other tasks as
> well.
The spec has to be as simple as possible. You cannot put many diverging
tasks into such a posting.
Also, I don't want to compare languages, but APIs.
> - a small graphical editor for entity-relationship-diagrams
> (say, it should be possible to insert, delete, label, move
> and join boxes and directed arrows between them)
This is completely the opposite direction. Pico Lisp is text based,
so, for example, the following line
(rel mate (+List +Joint) mate (+Person)) # Spouse(s)
completely specifies the bi-directional Spouse relation. What does it
help here to draw arrows, except to make it less succinct?
> - a programm to patch a directory of HTML files
> ...
No meaning in the case of Pico. There is not a single HTML-File involved,
everything is generated dynamically from execution of Lisp sexprs.
> For example, I think most people would even agree that SQL
> is the best language for manipulating SQL databases as such.
Yeah, but it sure sucks for relational database work ;-)
The problem is that it depends what you are the most interested in.
> I don't doubt that other people have tried to solve these problems before,
so
> there should be other environments with equal or higher succinctness (and
thus
> programming power). To make the systems somehow comparable, I specified a
very
> simple application with certain typical features, and posted it as a
challenge
> to the Lisp community:
>
> http://software-lab.de/succinctness.html
I also do lots of web applications but I view the SQL only as a back-end I
don't leave it influence my design.
In fact my framework is mainly CLOS based and I use HTML instead of Java for
the GUI. (and yes I have controls on each field and no submit button. ;-)
So I can't do exactly the same application but I can solve the same problem
with a different approach and the same succinctness.
Marc
> "Alexander Burger" <a...@software-lab.de> wrote
> > There are endless discussions about the best and most powerful
> > progrmming environment. The subject is mostly a matter of taste, and can
> > usually not be measured in absolute terms. But perhaps is it possible in
> > some certain, well-defined fields?
> The problem is that it depends what you are the most interested in.
Or, more precisely, what your customers request you to do.
> In fact my framework is mainly CLOS based and I use HTML instead of Java for
> the GUI. (and yes I have controls on each field and no submit button. ;-)
The problem with plain HTML is that you can't provide for life
interactivity as it is necessary for business-type applications. There
is no clean way to do input-validation and -aid, and also no
satisfactory multi-user synchronization.
But the physical appearance of the GUI doesn't matter. I'm only
interested in the functionality and behavior of the resulting
application.
> So I can't do exactly the same application but I can solve the same problem
> with a different approach and the same succinctness.
The same application is not necessary, or even desired. But it would
be nice if you take some time and post your approach.
And it does not handle the interactions with the user interface.
What I'm asking for are the abstraction layers in between.
>> The problem is that it depends what you are the most interested in.
>
> Or, more precisely, what your customers request you to do.
>
> [...]
>
> The problem with plain HTML is that you can't provide for life
> interactivity as it is necessary for business-type
> applications. There is no clean way to do input-validation and -aid,
> and also no satisfactory multi-user synchronization.
There are enough customers out there that only allow plain HTML
because they have security constraints.
Edi.
Sure, therefore many of our installations are restricted to a LAN.
> But how succinct are the resulting programs?
by definiton they can't be as succint as the apps you write with a
framework designed for writing your apps :). of course, your framework
imposes one kind of mindset, ucw imposes another, certain apps are
easier with your framework, certain apps are easier with ucw,the real
question we should be asking is "how much should a framework impose?"
ucw tends to do only the web/frow-contral stuff and leave everytihng
else to the programmer, i honestly don't know where the line should
lie.
anyway, here's a ucw version of your program.
Notes:
0) the db is in RAM. UCW doesn't impose a particular db setup, so i'll
just use the simplest one i can think of. Redfining the accessors
for the person class should be easy enough should someone want to
add a "proper" DBMS in here.
1) I've left out the date manipulation code, it's currently broken.
2) The view tables are written out by hand only because i haven't
decided which abstraction i want for auto generating data views,
not because i don't want it. (well, that's my excuse at least :)).
3) i've not implemented the propagation of sex changes from one person
to their childern's parents, it's fairly trivial, rather boring,
and adds nothing to this example.
4) there's more or less no explicit validation when creating a new
user since this app never asks you for textual input but only
allows you to chose from a list of valid possibilites. this choice
would have to be revisited if the db becomes large.
5) This a 40 minute hack which may or may not even work, i just hope
it's enough to give you an idea of what the ucw API is like.
The app initally presents the user with a listing of all the people in
the db (and a "create new user" button), navigating the app is done by
clicking on the names of the current person's spouses, parents or
children. the "search for person by name" button doesn't exist.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :it.bese.ucw-user)
(defclass people-app (standard-application)
((people :accessor people :initform (make-hash-table :test 'equal))))
(defapplication *people-db*
(:url-prefix "/ucw/people/")
(:clase people-app))
(defclass person ()
((name :accessor person.name :initarg :name :initform (gensym))
(sex :accessor person.sex :initarg :sex :initform :unknown)
(mother :accessor person.mother :initarg :mother :initform nil)
(father :accessor person.father :initarg :father :initform nil)
(children :accessor person.children :initarg :children :initform nil)
(spouses :accessor person.spouses :initarg :spouses :initform nil)))
;;; init the db
(let ((adam (make-instance 'person :name "Adam"
:sex :male
:birthdate (cl-icu:make-date 0)))
(eve (make-instance 'person :name "Eve"
:sex :female
:birthdate (cl-icu:make-date 0))))
(push adam (person.spouses eve))
(push eve (person.spouses adam))
(setf (gethash "Adam" (people *people-db*) adam
(gethash "Eve" (people *people-db*) eve))))
;;;; viewing, editing and navigating an individual
(defcomponent person-viewer (standard-component)
((person :accessor person :initform nil :initarg :person)))
(defaction view ((p person))
(call (make-instance 'person-viewer :person p)))
(defaction change-name ((p person))
(let ((new-name (call 'string-choser
:message "New name:"
:validate (lambda (name)
(not (gethash name (people *people-db*))))
:error-message "Sorry, the name ~S is taken.")))
(remhash (person.name p) (people *people-db*))
(setf (person.name p) new-name
(gethash new-name (person.name *people-db*)) p))
p)
(defaction change-sex ((p person))
(setf (person.sex p) (call 'option-dialog
:message "New sex?"
:options '((:male . "Male") (:female . "Female"))
:confirm nil))
(case (call 'option-dialog
:message "What should we do about ~S's child's fathers?"
:options '((:leave . "Leave the DB in an invalid state.")
(:update . "Change the other parent's sex and swap mother and father.")))
(:leave
;; just return the person
t)
(:update ;;update the entire db
(dolist (c (person.children p))
(case (person.sex p)
;; person has changed from male to female, need to change the
;; mother's sex and update all of the mother's children.
(:female ...)
;; person has changed from female to male, need to change the
;; father's sex and update all of the father's children.
(:male ...)))))
p)
(defaction chose-or-make-person ((subject person) message &key (test #'identity))
(or (call 'option-dialog
:message message
:options (list*
(cons nil "Make a new person.")
(loop
for person being the hash-values of (people *people-db*)
when (funcall test person)
collect person)))
(call 'new-person :person (make-instance 'person) :test test)))
(defaction change-mother ((p person))
(let ((new-mother (chose-or-make-person p "Who should be the new mother?"
:test (lambda (possible-mother)
(eql :female (person.sex possible-mother))))))
(setf (person.mother p) new-mother)
(unless (find p (person.children new-mother))
(push p (person.children new-mother)))
p))
(defaction change-father ((p person))
(let ((new-father (chose-or-make-person p "Who should be the new father?"
:test (lambda (possible-mother)
(eql :male (person.sex possible-mother))))))
(setf (person.father p) new-father)
(unless (find p (person.children new-father))
(push p (person.children new-father)))
p))
(defaction add-spouse ((p person))
(let ((new-spouse (chose-or-make-person p "Who should be the now spouse?"
:test (lambda (possible-spouse)
;; assume a conservative country
(not (eql (person.sex possible-spouse)
(person.sex p)))))))
(push new-spouse (person.spouses p))
(unless (find p (person.spouses p))
(push p (person.spouses new-spouse))))
p)
(defaction add-childer ((p person))
(let ((new-child (chose-or-make-person p "new child?")))
(push new-child (person.children p))
(ecase (person.sex p)
(:male (setf (father new-child) p))
(:female (setf (mother new-child) p)))
p))
(defaction delete-child ((p person) (child person))
(setf (person.children p) (delete child (person.children p)))
;; must chose a new mother-father for child
(if (eql p (person.mother child))
(setf (person.mother child)
(chose-or-make-person p (format nil "New mother for ~S?"
(person.name child))))
(setf (person.father child)
(chose-or-make-person p (format nil "New father for ~S?"
(person.name child)))))
p)
(defaction delete-spouse ((p person) (spouse person))
(setf (person.spouses p) (delete spouse (person.spouses p)))
(setf (person.spouses spouse) (delete p (person.spouses spouse)))
p)
(defmethod render-on ((res response) (v person-viewer))
(with-slots (name sex birthdate mother father children spouses)
(person v)
;; yes, this mess should be class->table macro,
(<:table
(<:tr (<:td "Name:") (<:td (<:as-html name)
(<ucw:a (lambda () (change-name (person v)))
"Change Name.")))
(<:tr (<:td "Sex:") (<:td (<:as-html sex)
(<ucw:a (lambda () (change-sex (person v)))
"Change Sex.")))
(<:tr (<:td "Mother:") (<:td (<ucw:a (lambda () (view mother))
(<:as-html (person.name mother)))
(<ucw:a (lambda () (change-mother (person v)))
"Change Mother.")))
(<:tr (<:td "Father:") (<:td (<ucw:a (lambda () (view father))
(<:as-html (person.name father)))
(<ucw:a (lambda () (change-father (person v)))
"Change Father.")))
(<:tr (<:td "Children:")
(<:td
(<:ul
(dolist (c children)
(<:li (<ucw:a (lambda () (view c)) (<:as-html (person.name c)))
(<ucw:a (lambda () (delet-child (person v) c)) "Delete.")))
(<ucw:a (lambda () (add-child (person v))) "Add a child."))))
(<:tr (<:td "Spouses:")
(<:td
(<:ul
(dolist (s spouses)
(<:li (<ucw:a (lambda () (view s)) (<:as-html (person.name s)))
(<ucw:a (lambda () (delete-spouse (person v) s)) "Delete."))))
(<ucw:a (lambda () (add-spouse (person v))) "Add a spouse."))))
(<ucw:a (lambda () (make-new-person (make-instance 'new-person :person (make-instance 'person))))
"Create a new person.")
(<ucw:a (lambda () (answer-component v (person v))) "Ok.")))
;;; creating new people
(defcomponent new-person (person-viewer)
((test :accessor test :initform (lambda (v) (declare (ignore v)) t) :initarg :test)))
(defmethod render-on :after ((r response) (p new-person))
;; just add a cancel button
(<ucw:a (lambda () (answer-component p nil)) "Cancel."))
(defaction make-new-person ((default new-person))
(loop
for p = (view default)
do (cond
((null p) ;; cancel
(return-from make-new-person nil))
((gethash (person.name new-person) (people *people-db*))
(call 'info-message
:message (format nil "Sorry, the name ~S already exists."
(person.name new-person))))
((null (funcall (test default) p))
(call 'info-message
:message (format nil "Sorry, the person did not pass the extra validation.")))
(t ;; ok, save the person.
(setf (gethash (person.name new-person) new-person))
(return-from make-new-person new-person)))))
;;;; the "main window" component
(defcomponent person-window (standard-component)
((body :accessor body :initform nil)
(title :accessor title :initform "The People App" :backtrack t)))
(defmethod render-on ((res response) (w person-window))
(<:html
(<:head (<:title (<:as-html (title w))))
(<:body
(render-on (body w))
(<ucw:a (lambda () (make-new-person (make-instance 'new-person)))
"New person."))))
;;; the main entry point
(defentry-point "index.ucw" () ()
(goto (make-instance 'person-window))
(setf (component.place self) (make-place (body self)))
(loop
(call 'range-view :data (maphash (lambda (k v)
(declare (ignore k))
v)
(people *people-db*))
:item-render-method (lambda (p)
(<:as-html (person.name p))))))
--
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
Marco Baringer <m...@bese.it> wrote:
> framework designed for writing your apps :). of course, your framework
> imposes one kind of mindset, ucw imposes another, certain apps are
> easier with your framework, certain apps are easier with ucw,the real
You are right, concerning the GUI framework.
I didn't know ucw, but it seems to be a web development package. Then
it does not really access the type if (interactive) applications I
need for my projects, but covers mainly the HTTP/HTML part, right? But
this is Ok, as you said, if we settle on certain types of apps.
> ucw tends to do only the web/frow-contral stuff and leave everytihng
> else to the programmer, i honestly don't know where the line should
If I understand your code correctly, you implemented the management of
object-relations on-the-fly.
So now it would be interesting to separate the parts which implement a
general API (the "abstractions") from those which a special for the
demo application (the "elaborations") to see the resulting
succinctness.
Explanation: In my usual work I have to write such applications
permanently, and then there are much more complicated relations than
in the given spec, between tens or hundreds of classes, so we cannot
code these things explicitly each time.
> > The problem is that it depends what you are the most interested in.
>
> Or, more precisely, what your customers request you to do.
Well I try to choose them so that they are interested in what interest me.
;-)
> > In fact my framework is mainly CLOS based and I use HTML instead of Java
for
> > the GUI. (and yes I have controls on each field and no submit button.
;-)
>
> The problem with plain HTML is that you can't provide for life
> interactivity as it is necessary for business-type applications. There
> is no clean way to do input-validation and -aid, and also no
> satisfactory multi-user synchronization.
This is quite wrong. I do have real time control of all the values of all
the fields and that validation is server based.
The choice of HTML (+ jscript) was done mainly because, as Edi wrote, most
of my customers only allow plain HTML
because they have security constraints. As it's plain HTML it works for
banks which have zillions of firewalls and proxies for instance.
> But the physical appearance of the GUI doesn't matter. I'm only
> interested in the functionality and behavior of the resulting
> application.
If you come to the Oslo Lisp workshop, I will show you the framework ;-)
BTW if you are interested I can send you the paper I wrote for the ILC2002.
Marc
I'm not sure if we are talking about the same thing. With
Input-validation I mean that the user can only enter information into
a GUI-field which is correct in the current application context (e.g.
a reference to another database object).
> the client/user. For security reasons, it needs to be done on
> the server anyway.
That's the way the Pico Lisp GUI works. It is handled by dynamically
generated Java-Applets which keep a permanent connection to the
server. The application logic executes on the server. AFAIK there is
no other way to do this portably in a browser except with Java
(perhaps Flash?).
> Christopher C. Stacy <cst...@news.dtpq.com> wrote:
> > Generally, people will construct a problem that suits
> > the answer they wanted.
>
> No, I have this type of problem permanently, and I'm sure that other
> people have it, too.
Perhaps you should see another doctor. There has to be a cure!
--
An ideal world is left as an excercise to the reader.
--- Paul Graham, On Lisp 8.1
> There are enough customers out there that only allow plain HTML
> because they have security constraints.
Indeed.
I think it is ok to use JavaScript in a web page, but its use should
be restricted to form validation to reduce traffic back and forth
between the client and server. The application should not rely on the
JavaScript being turned on.
I've seen many sites where links call JavaScript functions. They
don't seem to do it for any particular reason other than that they
can. I think this should be a crime.
In many ways, going with pure HTML simplifies UI design for web
applications. You no longer have to worry about the annoying
differences between JavaScript implementations. You are just
generating text for your output, not code. It's a practical
application of Occam's razor.
> > > The problem is that it depends what you are the most interested in.
> >
> > Or, more precisely, what your customers request you to do.
> Well I try to choose them so that they are interested in what interest me.
> ;-)
Oh nice! You are a lucky man :-)
> > The problem with plain HTML is that you can't provide for life
> > interactivity as it is necessary for business-type applications. There
> > is no clean way to do input-validation and -aid, and also no
> > satisfactory multi-user synchronization.
> This is quite wrong. I do have real time control of all the values of all
> the fields and that validation is server based.
Hm, actually I also implemented a plain HTML version. If you replace
"lib/gui.l" on the command line with "lib/htm.l", you get a Java-less
version. I did never complete the implementation, but it basically
works by placing each TextField in its own HTML-form, so that hitting
Return during text input generates the necessary interactivity. The
focus is set with JavaScript (if enabled). I found this method too
limiting, however, and did not research about any further. Perhaps you
have a better solution?
> If you come to the Oslo Lisp workshop, I will show you the framework ;-)
Unfortunately, I had to cancel my trip two weeks ago.
> BTW if you are interested I can send you the paper I wrote for the ILC2002.
Please do so. Many thanks.
> > This is quite wrong. I do have real time control of all the values of
all
> > the fields and that validation is server based.
>
> Hm, actually I also implemented a plain HTML version. If you replace
> "lib/gui.l" on the command line with "lib/htm.l", you get a Java-less
> version. I did never complete the implementation, but it basically
> works by placing each TextField in its own HTML-form, so that hitting
> Return during text input generates the necessary interactivity. The
> focus is set with JavaScript (if enabled). I found this method too
> limiting, however, and did not research about any further. Perhaps you
> have a better solution?
Sure: Hidden frame or IFRAME.
> > If you come to the Oslo Lisp workshop, I will show you the framework ;-)
>
> Unfortunately, I had to cancel my trip two weeks ago.
:(
> > BTW if you are interested I can send you the paper I wrote for the
ILC2002.
>
> Please do so. Many thanks.
Sent.
Marc
> I've seen many sites where links call JavaScript functions. They
> don't seem to do it for any particular reason other than that they
> can. I think this should be a crime.
This is the default (perhaps only) behavior in ASP.NET applications. So, the
blame falls squarely on Microsoft. There are a number of other
"interesting" things in ASP.NET, like "textarea" fields that render
properly only in MS IE, when the /obvious/ way to code them would render
properly in Mozilla-and-related browsers as well.
It's /almost/ as if Microsoft were /intentionally/ introducing compatibility
problems. Imagine that! :-O
Chris Capel
Hm, I'm still not convinced of the interactivity of the resulting
application.
Plain HTML (with or without server- or browser-based scripting) does
not allow a life connection between the client and the server, so the
GUI handling of the resulting applications is always limited.
For example, our customers are used to applications
- where keyboard input is expanded automatically from the database
- immediate responses to function keys acting on the database
- pop-up dialogs and menus which handle database contents
- unlimited table scrolling through the database
For a more complete application than the simple person database take a
loot at "http://bws.software-lab.biz", which is a scaled-down version
of a real application. It may not be fully functional because we were
too lazy to generate all necessary test data, but you'll get an idea.
Login with "test" and "test" and play around a little.
I forgot one of the more important points:
- enable/disable GUI components depending on the current state of the
database and the activities of other users
You should. It puzzles all the Java/Zope/PHP web application developpers
I've met ;-)
> Plain HTML (with or without server- or browser-based scripting) does
> not allow a life connection between the client and the server, so the
> GUI handling of the resulting applications is always limited.
>
> For example, our customers are used to applications
Here is what I do in my framework:
> - where keyboard input is expanded automatically from the database
No.
> - immediate responses to function keys acting on the database
Yes.
> - pop-up dialogs and menus which handle database contents
Yes.
> - unlimited table scrolling through the database
Yes.
> I forgot one of the more important points:
>
> - enable/disable GUI components depending on the current state of the
> database and the activities of other users
Yes, of course!
And also :
Simultaneous update of all the views for all the users when a value changes.
On the fly pdf generation with cl-pdf and cl-typesetting,
It works trough firewalls and proxies.
(cf the ILC2002 paper for details)
> For a more complete application than the simple person database take a
> loot at "http://bws.software-lab.biz", which is a scaled-down version
> of a real application. It may not be fully functional because we were
> too lazy to generate all necessary test data, but you'll get an idea.
> Login with "test" and "test" and play around a little.
OK I've played a little with it (though I don't speak German)
It's a nice Java database application, not really a web application.
Obviously each framework designer will prefer it's own one, otherwise he
would have done it in another way ;-)
Marc
Interesting. I still don't see how you do it in a portable way without
Java, because no other technology gives you a permanent connection to
the server in a portable way. Sorry, I could not find that information
in your paper :-(
I was trying many times to get away from Java (that's also the reason
for the experiments in "lib/htm.l" I mentioned before), not because of
security reasons, but because of poor Java support across many
platforms.
> And also :
> Simultaneous update of all the views for all the users when a value changes.
> On the fly pdf generation with cl-pdf and cl-typesetting,
Besides pdf, we also generate plain PS and LaTeX in some cases.
> It works trough firewalls and proxies.
Firewalls and proxies are not so much a problem, because it only
concerns connections in one direction (from client to server, as the
applet connects backwards). And Pico Lisp also supports a tunneling
protocol.
> > For a more complete application than the simple person database take a
> > loot at "http://bws.software-lab.biz", which is a scaled-down version
> > of a real application. It may not be fully functional because we were
> > too lazy to generate all necessary test data, but you'll get an idea.
> > Login with "test" and "test" and play around a little.
> OK I've played a little with it (though I don't speak German)
> It's a nice Java database application, not really a web application.
> Obviously each framework designer will prefer it's own one, otherwise he
> would have done it in another way ;-)
Yes, we agreed on that before :-)
As you said, it depends very much on the purpose. A web application is
probably easier for an un-initiated user, but for people who have to
work with it 8 hours a day a dedicated application might be preferred.
It would be nice if you could post a solution to the simple person
database of my original posting, using your framework.
I could tell you, but after that I would have to ask Tim B. to send you his
black helicopters. ;-)
More serioulsy, I just use an hidden frame for behind the scene
communication.
Look at the table of content on the left of
http://msdn.microsoft.com/library/ to see what I mean (and you can look at
the javascript)
> I was trying many times to get away from Java (that's also the reason
> for the experiments in "lib/htm.l" I mentioned before), not because of
> security reasons, but because of poor Java support across many
> platforms.
Yes, one of my first framework version used a Java applet too, but nobody
accepted this.
> > And also :
> > Simultaneous update of all the views for all the users when a value
changes.
> > On the fly pdf generation with cl-pdf and cl-typesetting,
>
> Besides pdf, we also generate plain PS and LaTeX in some cases.
>
> > It works trough firewalls and proxies.
>
> Firewalls and proxies are not so much a problem, because it only
> concerns connections in one direction (from client to server, as the
> applet connects backwards). And Pico Lisp also supports a tunneling
> protocol.
OK.
> > > For a more complete application than the simple person database take a
> > > loot at "http://bws.software-lab.biz", which is a scaled-down version
> > > of a real application. It may not be fully functional because we were
> > > too lazy to generate all necessary test data, but you'll get an idea.
> > > Login with "test" and "test" and play around a little.
>
> > OK I've played a little with it (though I don't speak German)
> > It's a nice Java database application, not really a web application.
> > Obviously each framework designer will prefer it's own one, otherwise he
> > would have done it in another way ;-)
>
> Yes, we agreed on that before :-)
>
> As you said, it depends very much on the purpose. A web application is
> probably easier for an un-initiated user, but for people who have to
> work with it 8 hours a day a dedicated application might be preferred.
Hm, I assume you mean a dialog based application as the web applications are
dedicated too.
> It would be nice if you could post a solution to the simple person
> database of my original posting, using your framework.
Here it is: (I made some modifs to show some disable predicates, added a
maried status to show interaction with the spouse value, if you change sex
or your spouse gets maried to somebody else you are automatically un-maried,
etc.)
As you can see I don't rely on any database to make the controls though it
would be possible.
(defclass person nil
((name :value-type string :user-name #T(:en "Name" :fr "Nom" :de "" :sp ""
:it "") :disable-predicate 'locked-name)
(locked-name :value-type boolean :user-name #T(:en "Lock name" :fr
"Verouiller nom" :de "" :sp "" :it ""))
(sex :value-type symbol :user-name #T(:en "Sex" :fr "Sexe" :de "" :sp ""
:it "") :initform :male)
(bithdate :value-type :date :user-name #T(:en "Birth date" :fr "Date de
naissance" :de "" :sp "" :it ""))
(father :value-type person :user-name #T(:en "Father" :fr "Père" :de ""
:sp "" :it "") :get-object-func 'choose-father)
(mother :value-type person :user-name #T(:en "Mother" :fr "Mère" :de ""
:sp "" :it "") :get-object-func 'choose-mother)
(maried :value-type boolean :user-name #T(:en "Maried" :fr "Marié" :de ""
:sp "" :it ""))
(spouse :value-type person :user-name #T(:en "Spouse" :fr "Conjoint" :de
"" :sp "" :it "") :disable-predicate '(not maried) :get-object-func
'choose-spouse))
(:user-name #T(:en "Person" :fr "Personne" :de "" :sp "" :it "") :guid
39944127642591635827640405902 :short-description 'name))
(defun choose-father (obj)
(remove obj
(remove :female (persons *all-persons*) :key 'sex)))
(defun choose-mother (obj)
(remove obj
(remove :male (persons *all-persons*) :key 'sex)))
(defun choose-spouse (obj)
(nset-difference
(remove (sex obj)(persons *all-persons*) :key 'sex)
(list obj (father obj)(mother obj))))
(defmethod (setf spouse) :around (spouse (obj person))
(let ((prev-spouse (spouse obj)))
(unless (eq prev-spouse spouse)
(call-next-method)
(when prev-spouse
(setf (maried prev-spouse) nil))
(when spouse
(setf (maried spouse) t
(spouse spouse) obj)))))
(defmethod (setf maried) :before (maried (obj person))
(let ((spouse (spouse obj)))
(when (not maried)
(setf (spouse obj) nil))))
(defmethod (setf sex) :before (value (obj person))
(unless (eq value (sex obj))
(setf (maried obj) nil)))
Marc
[Who should really be working on real work!]
> If you come to the Oslo Lisp workshop, I will show you the framework ;-)
> BTW if you are interested I can send you the paper I wrote for the ILC2002.
I would appreciate a copy of this paper also if you don't mind.
The ability to make an interactive application with a pure HTML
interface (no JavaScript) that approaches the interactivity of a local
desktop application is something I find very appealing at this time.
There is of course the academic (or perhaps not so academic) curiosity
that I have about the future being server based applications, a place
where I could use Lisp or any other language I want. There is also a
more practical problem that I am working on where a desktop app looks
like the only way to produce the required interactivity, but I am not
so sure and would love to do it as a pure web based app.
Brian Mastenbrook demoed a web based IRC application. It's not as
good as a "real" IRC client, but it will run on a web enabled phone
without having to install any special software on the phone. It was
really cool.
That again. I know a cure to the problem. I don't think anyone would
miss Redmond, WA should it be, um, nuked. I expect the
environmentalists would complain though. Then again, when they start
getting less spam, perhaps they will shut up.
Sent.
> The ability to make an interactive application with a pure HTML
> interface (no JavaScript) that approaches the interactivity of a local
> desktop application is something I find very appealing at this time.
I was probably not clear enough but I use JavaScript.
Marc
> Hm, I assume you mean a dialog based application as the web applications are
> dedicated too.
Sorry, perhaps "dedicated" was the wrong word. I wanted to indicate
the difference to "web" applications, as in my case the browser and
web technology are not of central importance, just a portable means
for zero-install clients.
> > It would be nice if you could post a solution to the simple person
> > database of my original posting, using your framework.
> Here it is: (I made some modifs to show some disable predicates, added a
Many thanks.
> maried status to show interaction with the spouse value, if you change sex
> or your spouse gets maried to somebody else you are automatically un-maried,
> etc.)
So you assume exactly one spouse during a person's lifetime, of
opposite sex? I intended to handle it more tolerantly ;-)
But for the purpose of demonstration, this is Ok for me, though
similar mechanisms exist with the parent <-> kid relations.
As far as I see, however, this is only the database part, not the
whole application. How about the definition and behavior of the GUI?
Also, my original request was primarily for an API as abstracted as
possible. Similar to the 'ucw' solution of Marco Baringer you coded
the mechanics of the relations on-the-fly. Can you abstract it more,
in a way that is usable for all other applications of this kind (e.g.
when you have customers, suppliers and articles instead of persons)?
Then I'd ask for your permission to include it in the
reader-contributed solutions on my page.
> [Who should really be working on real work!]
Sorry ...
But perhaps these abstractions will be useful for you later, too :-)
Not one spouse, you can change when you want. But one at a time and of the
opposite sex. As I do web applications for banks (for the technical
infrastructure) I have
to make them compatible with the law ;-)
> But for the purpose of demonstration, this is Ok for me, though
> similar mechanisms exist with the parent <-> kid relations.
>
> As far as I see, however, this is only the database part, not the
> whole application. How about the definition and behavior of the GUI?
This is the whole application!
The GUI and web navigation are SQL storage are for free. They are 100% auto
generated from this.
> Also, my original request was primarily for an API as abstracted as
> possible. Similar to the 'ucw' solution of Marco Baringer you coded
> the mechanics of the relations on-the-fly. Can you abstract it more,
> in a way that is usable for all other applications of this kind (e.g.
> when you have customers, suppliers and articles instead of persons)?
Hey, it's a succinctness challenge not an abstraction challenge.
I don't even see what you want.
It's plain Lisp here. The interest of the framework is that I just write
plain Lisp code and then it manages to provide a nice GUI and a persistent
storage in the SQL database (Postgresql through CLSQL). Generally the
objects are much more complicated and can't easily be represented in SQL
tables.
And I don't think there is an interest to make a reusable abstraction for 42
lines of code.
> Then I'd ask for your permission to include it in the
> reader-contributed solutions on my page.
No problem, but I don't have any other one to submit.
If I find some time I will try to put it on the web and I will send you an
email with the URL.
Marc