From: gavino
Subject: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <1161194677.185226.4730@h48g2000cwc.googlegroups.com>
HOW?
Why will it be faster?

From: ··@homeunix.net
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <c7adnT9PsY8S6qvYnZ2dnUVZ_tqdnZ2d@comcast.com>
gavino wrote:
> HOW?
> Why will it be faster?
> 
what do you mean by "faster?"

faster in operation?
faster in design?
faster than a speeding bullet?
what?
From: gavino
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <1161204753.679631.313800@i42g2000cwa.googlegroups.com>
faster to respond to requests

faster to get to market and develop

faster to upgrade
From: ··@homeunix.net
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <2-qdnZM1Gumfa6vYnZ2dnUVZ_vadnZ2d@comcast.com>
gavino wrote:
> faster to respond to requests
> 
Sometimes these engineering decisions are a matter of compromise.  I 
don't think you would want to code an http server in assembly language 
just because you want a high number of transactions per second.  But if 
you do, you can always optimize by interfacing to C.

Of course, you should be the final judge of what actual performance you 
need and to do this you must try and actual Lisp server, conduct certain 
tests and then come to a conclusion.

Let me ask you this.  Have you tried any of the Lisp servers yet?

> faster to get to market and develop
> 
Lisp systems are excellent for quickly prototyping your ideas and trying 
them out in the environment.  Write small, manageable functions, test 
them, then build higher levels of abstraction upon them.  Try a Lisp 
development environment.  Come to a conclusion.

Do you think this will help you out in time-to-market?

> faster to upgrade
> 
Lisp apps don't have to be shut down to be upgraded.
Is this fast enough?

In the end, you are the only one who can answer these question.
Who are you trying to convince?
From: Kaz Kylheku
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <1161276201.472458.124320@h48g2000cwc.googlegroups.com>
gavino wrote:
> faster to respond to requests
>
> faster to get to market and develop
>
> faster to upgrade

For all this, you need to be a smart, "self-starting" person who get
things done.
From: boating12345
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <1161342617.737959.90940@i3g2000cwc.googlegroups.com>
Kaz Kylheku wrote:
> gavino wrote:
> > faster to respond to requests
> >
> > faster to get to market and develop
> >
> > faster to upgrade
>
> For all this, you need to be a smart, "self-starting" person who get
> things done.


We have built a full application server with LISP it now is serving a
POKER site.

We used SBCL and EMACS to build it with some stuff at the back end. Now
development is much faster than when we were building ASP based
websites, also people have tried to hack our server with no success
(basically because it doesn't understand what they are trying to make
it do!)

Paul 
http://www.hyperstring.net
From: Kaz Kylheku
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <1161219734.247506.235380@k70g2000cwa.googlegroups.com>
gavino wrote:
> HOW?
> Why will it be faster?

Because it will have only one user.
From: Lars Rune Nøstdal
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <pan.2006.10.18.18.29.24.515540@gmail.com>
On Wed, 18 Oct 2006 11:04:37 -0700, gavino wrote:

> HOW?
> Why will it be faster?

If you by "CLISP" mean Common Lisp then some implementations of Common
Lisp are compiled to native code which runs faster than for instance
interpreted PHP, or Python.

By adding declarations to the code you will in some cases get results that
run as fast as C or sometimes faster.

SBCL generates native code: http://sbcl.sourceforge.net/

Here is one example of how one can generate optimized native code, this is
SBCL:


cl-user> (proclaim '(optimize
           (compilation-speed 0)
           (debug 3)
           (safety 3)
           (space 0)
           (speed 0)))

(defun sum (x)
  (+ x x))

#| gives: |#

cl-user> (disassemble 'sum)
; 0C9A51D2:       64               byte #X64            ; no-arg-parsing entry point
;      1D3:       800D4800000004   or byte ptr [#x48], 4
;      1DA:       B920000000       mov ecx, 32
;      1DF:       64               byte #X64
;      1E0:       030D20000000     add ecx, [#x20]
;      1E6:       64               byte #X64
;      1E7:       3B0D24000000     cmp ecx, [#x24]
;      1ED:       7607             jbe L0
;      1EF:       E8E4D46BFB       call #x80626D8       ; alloc_overflow_ecx
;      1F4:       EB0A             jmp L1
;      1F6: L0:   64               byte #X64
;      1F7:       890D20000000     mov [#x20], ecx
;      1FD:       83E920           sub ecx, 32
;      200: L1:   8D4907           lea ecx, [ecx+7]
;      203:       C741F93E060000   mov dword ptr [ecx-7], 1598
;      20A:       64               byte #X64
;      20B:       80354800000004   xor byte ptr [#x48], 4
;      212:       7402             jeq L2
;      214:       CC09             break 9              ; pending interrupt trap
;      216: L2:   B84A000000       mov eax, 74
;      21B:       8941FD           mov [ecx-3], eax
;      21E:       C741050B000005   mov dword ptr [ecx+5], 83886091
;      225:       8B0500509A0C     mov eax, [#xC9A5000] ; "SB-DEBUG-CATCH-TAG"
;      22B:       894109           mov [ecx+9], eax
;      22E:       C7410D0B000005   mov dword ptr [ecx+13], 83886091
;      235:       64               byte #X64
;      236:       8B050C000000     mov eax, [#xC]
;      23C:       8945C8           mov [ebp-56], eax
;      23F:       8B05F8000005     mov eax, [#x50000F8]
;      245:       64               byte #X64
;      246:       8B00             mov eax, [eax]
;      248:       8B1518040005     mov edx, [#x5000418]
;      24E:       64               byte #X64
;      24F:       8B12             mov edx, [edx]
;      251:       8945CC           mov [ebp-52], eax
;      254:       8955D0           mov [ebp-48], edx
;      257:       8965C4           mov [ebp-60], esp
;      25A:       8D55D4           lea edx, [ebp-44]
;      25D:       8B0518010005     mov eax, [#x5000118]
;      263:       64               byte #X64
;      264:       8B00             mov eax, [eax]
;      266:       8902             mov [edx], eax
;      268:       896A04           mov [edx+4], ebp
;      26B:       C74208EC62CB0C   mov dword ptr [edx+8], 214655724
;      272:       894A0C           mov [edx+12], ecx
;      275:       8B05F8000005     mov eax, [#x50000F8]
;      27B:       64               byte #X64
;      27C:       8B00             mov eax, [eax]
;      27E:       894210           mov [edx+16], eax
;      281:       8B05F8000005     mov eax, [#x50000F8]
;      287:       64               byte #X64
;      288:       8910             mov [eax], edx
;      28A:       64               byte #X64
;      28B:       813D500000000B000005 cmp dword ptr [#x50], 83886091
;      295:       7402             jeq L3
;      297:       CC0F             break 15
;      299: L3:   8B55EC           mov edx, [ebp-20]
;      29C:       8B7DEC           mov edi, [ebp-20]
;      29F:       E8849E34F4       call #xCEF128
;      2A4:       7302             jnb L4
;      2A6:       8BE3             mov esp, ebx
;      2A8: L4:   8BF4             mov esi, esp
;      2AA:       52               push edx
;      2AB:       8975F4           mov [ebp-12], esi
;      2AE:       C745F004000000   mov dword ptr [ebp-16], 4
;      2B5:       8B0DF8000005     mov ecx, [#x50000F8]
;      2BB:       64               byte #X64
;      2BC:       8B09             mov ecx, [ecx]
;      2BE:       8B4910           mov ecx, [ecx+16]
;      2C1:       8B05F8000005     mov eax, [#x50000F8]
;      2C7:       64               byte #X64
;      2C8:       8908             mov [eax], ecx
;      2CA:       EB6E             jmp L8
;      2CC:       8D73FC           lea esi, [ebx-4]
;      2CF:       8B7DC4           mov edi, [ebp-60]
;      2D2:       8BC7             mov eax, edi
;      2D4:       83EF04           sub edi, 4
;      2D7:       894DF0           mov [ebp-16], ecx
;      2DA:       C1E902           shr ecx, 2
;      2DD:       E303             jecxz L5
;      2DF:       FD               std
;      2E0:       F2               repne
;      2E1:       A5               movsD
;      2E2: L5:   8D6704           lea esp, [edi+4]
;      2E5:       8945F4           mov [ebp-12], eax
;      2E8:       8B4DCC           mov ecx, [ebp-52]
;      2EB:       8B55D0           mov edx, [ebp-48]
;      2EE:       8B05F8000005     mov eax, [#x50000F8]
;      2F4:       64               byte #X64
;      2F5:       8908             mov [eax], ecx
;      2F7:       8B0518040005     mov eax, [#x5000418]
;      2FD:       64               byte #X64
;      2FE:       8910             mov [eax], edx
;      300:       8B75C8           mov esi, [ebp-56]
;      303:       64               byte #X64
;      304:       8B150C000000     mov edx, [#xC]
;      30A:       39D6             cmp esi, edx
;      30C:       742C             jeq L8
;      30E: L6:   8B42FC           mov eax, [edx-4]
;      311:       09C0             or eax, eax
;      313:       7417             jeq L7
;      315:       8B4AF8           mov ecx, [edx-8]
;      318:       8B5811           mov ebx, [eax+17]
;      31B:       64               byte #X64
;      31C:       890B             mov [ebx], ecx
;      31E:       C742F800000000   mov dword ptr [edx-8], 0
;      325:       C742FC00000000   mov dword ptr [edx-4], 0
;      32C: L7:   83EA08           sub edx, 8
;      32F:       39D6             cmp esi, edx
;      331:       75DB             jne L6
;      333:       64               byte #X64
;      334:       89150C000000     mov [#xC], edx
;      33A: L8:   8B75F4           mov esi, [ebp-12]
;      33D:       8B4DF0           mov ecx, [ebp-16]
;      340:       8B45F8           mov eax, [ebp-8]
;      343:       83F904           cmp ecx, 4
;      346:       750D             jne L9
;      348:       8B56FC           mov edx, [esi-4]
;      34B:       8B7DFC           mov edi, [ebp-4]
;      34E:       8BE5             mov esp, ebp
;      350:       8BEF             mov ebp, edi
;      352:       F8               clc
;      353:       FFE0             jmp eax
;      355: L9:   8BDD             mov ebx, ebp
;      357:       8B6DFC           mov ebp, [ebp-4]
;      35A:       E9999C34F4       jmp #xCEEFF8
;      35F:       90               nop
;      360:       CC0A             break 10             ; error trap
;      362:       02               byte #X02
;      363:       18               byte #X18            ; INVALID-ARG-COUNT-ERROR
;      364:       4D               byte #X4D            ; ECX
;      365:       CC0A             break 10             ; error trap
;      367:       02               byte #X02
;      368:       18               byte #X18            ; INVALID-ARG-COUNT-ERROR
;      369:       4D               byte #X4D            ; ECX


cl-user> (proclaim '(optimize
                    (compilation-speed 0)
                    (debug 0)
                    (safety 0)
                    (space 3)
                    (speed 3)))


#| Now gives (note that it now gives us helping messages): |#


; No value
cl-user> (defun sum (x)
          (+ x x))
; in: lambda nil
;     (+ X X)
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a rational.
;   The second argument is a number, not a float.
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a float.
;   The second argument is a number, not a rational.
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a single-float.
;   The second argument is a number, not a double-float.
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a double-float.
;   The second argument is a number, not a single-float.
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a (complex single-float).
;   The second argument is a number, not a (complex single-float).
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a (complex single-float).
;   The second argument is a number, not a real.
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a real.
;   The second argument is a number, not a (complex single-float).
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a (complex double-float).
;   The second argument is a number, not a (complex double-float).
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a (complex double-float).
;   The second argument is a number, not a real.
;
; note: unable to
;   optimize
; due to type uncertainty:
;   The first argument is a number, not a real.
;   The second argument is a number, not a (complex double-float).
;
; note: forced to do generic-+ (cost 10)
;       unable to do inline float arithmetic (cost 2) because:
;       The first argument is a number, not a double-float.
;       The second argument is a number, not a double-float.
;       The result is a (values number &optional), not a (values double-float
;                                                                &rest t).
;       unable to do inline float arithmetic (cost 2) because:
;       The first argument is a number, not a single-float.
;       The second argument is a number, not a single-float.
;       The result is a (values number &optional), not a (values single-float
;                                                                &rest t).
;       etc.
;
; compilation unit finished
;   printed 11 notes
style-warning: redefining sum in DEFUN
sum
cl-user>


#| now gives shorter more optimized result: |#

cl-user> (disassemble 'sum)
; 0B42ED58:       8BD0             mov edx, eax         ; no-arg-parsing entry point
;       5A:       8BF8             mov edi, eax
;       5C:       E8E713BDF5       call #x1000148       ; generic-+
;       61:       7302             jnb L0
;       63:       8BE3             mov esp, ebx
;       65: L0:   8D65F8           lea esp, [ebp-8]
;       68:       F8               clc
;       69:       8B6DFC           mov ebp, [ebp-4]
;       6C:       C20400           ret 4
;       6F:       90               nop


#| but it stills calls a generic function, so let's fix that: |#


cl-user> (defun sum (x)
          (declare (fixnum x))
          (+ x x))
; in: lambda nil
;     (SB-INT:NAMED-LAMBDA SUM (X) (DECLARE (FIXNUM X)) (BLOCK SUM (+ X X)))
; ==>
;   #'(SB-INT:NAMED-LAMBDA SUM (X) (DECLARE (FIXNUM X)) (BLOCK SUM (+ X X)))
;
; note: doing signed word to integer coercion (cost 20) to "<return value>"


#| it lacks info about return-type, so we add that too: |#


cl-user> (defun sum (x)
          (declare (fixnum x))
          (the fixnum (+ x x)))
style-warning: redefining sum in DEFUN
sum
cl-user> (disassemble 'sum)
; 0C60D896:       8D0412           lea eax, [edx+edx]   ; no-arg-parsing entry point
;       99:       8BD0             mov edx, eax
;       9B:       8D65F8           lea esp, [ebp-8]
;       9E:       F8               clc
;       9F:       8B6DFC           mov ebp, [ebp-4]
;       A2:       C20400           ret 4


..a bit faster than when we started.


-- 
Lars Rune Nøstdal
http://lars.nostdal.org/
From: Lars Rune Nøstdal
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <pan.2006.10.18.18.31.32.620470@gmail.com>
On Wed, 18 Oct 2006 20:29:27 +0200, Lars Rune Nøstdal wrote:

> On Wed, 18 Oct 2006 11:04:37 -0700, gavino wrote:
> 
>> HOW?
>> Why will it be faster?
> 
> If you by "CLISP" mean Common Lisp then some implementations of Common
> Lisp are compiled to native code which runs faster than for instance

hm, or:

"..some implementations of Common Lisp compile (your code) to native code.."

-- 
Lars Rune Nøstdal
http://lars.nostdal.org/
From: Pascal Bourguignon
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <87fydl4g1c.fsf@thalassa.informatimago.com>
"gavino" <········@yahoo.com> writes:

> How can I build a dynamic website better with CLISP?

Well, already using lisp allows you to build dynamic web sites better
than with anything else.  Better as in faster (less programmer time),
better as in funnier (it's funnier to code lisp than anything else
(but perhaps intercal)), etc.


> HOW?

Programming.  

You can also use various libraries such as UCW, Aserve, Araneida, etc.


> Why will it be faster?

Faster than what?  
Do you have a 1 Gb/s link between your web site and your customers?


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

CAUTION: The mass of this product contains the energy equivalent of
85 million tons of TNT per net ounce of weight.
From: Ari Johnson
Subject: Re: How can I build a dynamic website better with CLISP?
Date: 
Message-ID: <m2r6x5axgu.fsf@hermes.theari.com>
"gavino" <········@yahoo.com> writes:

> HOW?
> Why will it be faster?

I have a much more important question.  How can I have enough spare
time to troll comp.lang.lisp every few weeks?  I am swamped right now
and want to know your time management secret that allows this.