Altitude - Seaside JSON example

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Altitude - Seaside JSON example

Chris Cunnington
http://ss3.gemstone.com/ss/Oakville/AL-Examples-chc.13.mcz

I've taken the Seaside JSON example from Seaside 3.0.6 and put it into
Altitude. Load AL-Eamples-chc.13.mcz into a working Altitude image (load
script at the bottom of this post). The example loads a bunch of
pictures from Flickr's Seaside (as in pictures of the beach) account.

Then:

server := ALServer on: 8624 application: ALExampleApplication new.
server start

Go to http://localhost:8624

In Seaside it's mainly pure JavaScript. Not a lot of abstraction over
the JavaScript there. It's an interesting question what the sweet spot
of abstracting over JavaScript really is. Altitude has none. Seaside has
lots. For this JSON example it sort of looks the same on both frameworks.

Chris





| oldPref oldAuth|





oldPref := Scanner prefAllowUnderscoreSelectors.

oldAuth := Utilities authorInitialsPerSe.



Scanner prefAllowUnderscoreSelectors: true.

Utilities setAuthorInitials: 'al-loader'.

$_ tokenish ifFalse: [

   Character

     compile: 'tokenish

   "Answer whether the receiver is a valid token-character--letter,
digit, or

   colon."



   ^self == $_ or: [self == $: or: [self isLetter or: [self isDigit]]]'

     classified: 'testing'.

   String initialize ].



(Installer repository: 'http://source.squeak.org/FFI')

   install: 'FFI-Pools';

   install: 'FFI-Kernel';

   install: 'FFI-Tests';

   install: 'FFI-Win32';

   install: 'FFI-MacOS';

   install: 'FFI-Unix'.



(Installer wiresong project: 'al')

   addPackage: 'Xtreams-Support';

   addPackage: 'Xtreams-CoreTests';

   addPackage: 'Xtreams-Core';

   addPackage: 'Xtreams-Substreams';

   addPackage: 'Xtreams-Terminals';

   addPackage: 'Xtreams-Parsing';

   addPackage: 'Xtreams-Http';

   addPackage: 'Xtreams-Xtras';

   addPackage: 'Xtreams-ParsingTests';

   addPackage: 'Xtreams-TerminalsTests';

   addPackage: 'Xtreams-XtrasTests';

   addPackage: 'Xtreams-SubstreamsTests';

   addPackage: 'Xtreams-TransformsTests';

   addPackage: 'Xtreams-Transforms';

   addPackage: 'Xtreams-HttpTests';

   install.



Scanner prefAllowUnderscoreSelectors: oldPref.

Utilities setAuthorInitials: oldAuth.



(Installer wiresong project: 'mc')

   addPackage: 'FS-Core';

   addPackage: 'FS-Disk';

   addPackage: 'FS-Memory';

   addPackage: 'FS-AnsiStreams';

   addPackage: 'FS-Zip';

   addPackage: 'FS-Xtreams';

   addPackage: 'FS-FileStream';

   addPackage: 'FS-Tests-Core';

   addPackage: 'FS-Tests-AnsiStreams';

   addPackage: 'FS-Tests-Xtreams';

   addPackage: 'FS-Tests-Zip';

   addPackage: 'FS-Tests-Disk';

   addPackage: 'FS-Tests-FileStream';

   install.



(Installer wiresong project: 'al')

   addPackage: 'AL-Rendering';

   addPackage: 'AL-Http';

   addPackage: 'AL-Application';

   addPackage: 'AL-Serialization';

   addPackage: 'AL-Json';

   addPackage: 'AL-Html5';

   addPackage: 'AL-HtmlApp';

   addPackage: 'AL-User';
   addPackage: 'AL-Examples';

   addPackage: 'AL-Tests-Json';

   addPackage: 'AL-Tests-Html5';

   addPackage: 'AL-Tests-User';

   addPackage: 'AL-Tests-Serialization';

   addPackage: 'AL-Tests-Http';

   addPackage: 'AL-Tests-Application';

   install.



Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Colin Putney-3
On Mon, Sep 24, 2012 at 11:56 AM, Chris Cunnington
<[hidden email]> wrote:

> In Seaside it's mainly pure JavaScript. Not a lot of abstraction over the
> JavaScript there. It's an interesting question what the sweet spot of
> abstracting over JavaScript really is. Altitude has none. Seaside has lots.
> For this JSON example it sort of looks the same on both frameworks.

Yeah, it's quite similar because there's very little happening on the
server side. The Javascript in the browser does all the work, so all
the server is doing is rendering one tag and a snippet of Javascript.

I've thought a little bit about Javascript abstraction in Altitude,
but it's tricky. One of the fundamental things about modern web apps
is that they involve a lot of Javascript in the browser. There are
gazillion ways of writing that Javascript, with a ton of JS
frameworks, programming styles, preprocessing tools and
your-favourite-language-to-javascript compilers. It seems like baking
any fixed way of handling Javascript into Altitude would just limit
what could be done on the client side. There are a few things that
could be really useful—e.g., a DAV server and some way of storing
Javascript within the image—but I can't really see doing anything to
eliminate the need to write Javascript.

Colin

Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Chris Cunnington
On 12-09-24 9:17 PM, Colin Putney wrote:
There are a few things that
could be really useful—e.g., a DAV server and some way of storing
Javascript within the image—but I can't really see doing anything to
eliminate the need to write Javascript.
And abstracting over the JavaScript doesn't release a person from the obligation of already knowing the JavaScript that you're abstracting over either. I think I'd have to agree with you that there is no blanket way of abstracting over it so that you're saving effort in all situations. There are some situations where Lukas's work in Scriptaclous was impressive in that you'd write a class and then pop, pop, pop add attributes and you're on your way. I remember translating an AJAX Hacks book example to his Scriptaculous and being impressed by the brevity.

At STIC Eric Clayberg was using HTML5 2D canvas examples incidental to his Dart presentation. Afterward I found a library called jCanvas[1] that is a plugin for jQuery. I'd like to make some classes abstract over specs for shapes:

$("canvas").drawRect({
  fillStyle: "#000",
  x: 50, y: 50,
  width: 200,
  height: 100,
  fromCenter: false
});
would become something similar to one of Lukas's classes with a few attributes. And then I'd like to code Breakout [2]. That'd be nifty.

Chris


[1] http://calebevans.me/projects/jcanvas/index.php
[2] http://billmill.org/static/canvastutorial/index.html


Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Edgar De Cleene
In reply to this post by Chris Cunnington

> server := ALServer on: 8624 application: ALExampleApplication new.
> server start

I using the script in original mail for loading in Squeak4.4-11925, but
having the following error

EVP_MD_CTX_init: ctx
    <cdecl: void 'EVP_MD_CTX_init' (XTEVPMDCTX*) module: 'libcrypto'>
    ^self externalCallFailed

'External function is invalid'

See attached.

I'm on Mac Os X 10.6, don't know if this matter

Any help welcomed


Edgar




SqueakDebug.log (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Chris Cunnington
The Xtras package in Xtreams uses libcrypto. The EVP_MD_CTX_init error is saying that the FFI call to the libcrypto library that comes with OpenSSH cannot be found. This library is used by Altitude to generate random URLs.

Open your Terminal and "man openssl" to see if you have libcrypto. I think it comes standard on a Mac. If that's the case, then perhaps your FFI cannot make the call to the library.

Chris




On 12-09-29 6:44 AM, Edgar J. De Cleene wrote:

      
server := ALServer on: 8624 application: ALExampleApplication new.
server start
I using the script in original mail for loading in Squeak4.4-11925, but
having the following error

EVP_MD_CTX_init: ctx
    <cdecl: void 'EVP_MD_CTX_init' (XTEVPMDCTX*) module: 'libcrypto'>
    ^self externalCallFailed

'External function is invalid'

See attached.

I'm on Mac Os X 10.6, don't know if this matter

Any help welcomed


Edgar




    










| oldPref oldAuth|





oldPref := Scanner prefAllowUnderscoreSelectors.

oldAuth := Utilities authorInitialsPerSe.



Scanner prefAllowUnderscoreSelectors: true.

Utilities setAuthorInitials: 'al-loader'.

$_ tokenish ifFalse: [

  Character

    compile: 'tokenish

  "Answer whether the receiver is a valid token-character--letter, digit, or

  colon."



  ^self == $_ or: [self == $: or: [self isLetter or: [self isDigit]]]'

    classified: 'testing'.

  String initialize ].



(Installer repository: 'http://source.squeak.org/FFI')

  install: 'FFI-Pools';

  install: 'FFI-Kernel';

  install: 'FFI-Tests';

  install: 'FFI-Win32';

  install: 'FFI-MacOS';

  install: 'FFI-Unix'.



(Installer wiresong project: 'al')

  addPackage: 'Xtreams-Support';

  addPackage: 'Xtreams-CoreTests';

  addPackage: 'Xtreams-Core';

  addPackage: 'Xtreams-Substreams';

  addPackage: 'Xtreams-Terminals';

  addPackage: 'Xtreams-Parsing';

  addPackage: 'Xtreams-Http';

  addPackage: 'Xtreams-Xtras';

  addPackage: 'Xtreams-ParsingTests';

  addPackage: 'Xtreams-TerminalsTests';

  addPackage: 'Xtreams-XtrasTests';

  addPackage: 'Xtreams-SubstreamsTests';

  addPackage: 'Xtreams-TransformsTests';

  addPackage: 'Xtreams-Transforms';

  addPackage: 'Xtreams-HttpTests';

  install.



Scanner prefAllowUnderscoreSelectors: oldPref.

Utilities setAuthorInitials: oldAuth.



(Installer wiresong project: 'mc')

  addPackage: 'FS-Core';

  addPackage: 'FS-Disk';

  addPackage: 'FS-Memory';

  addPackage: 'FS-AnsiStreams';

  addPackage: 'FS-Zip';

  addPackage: 'FS-Xtreams';

  addPackage: 'FS-FileStream';

  addPackage: 'FS-Tests-Core';

  addPackage: 'FS-Tests-AnsiStreams';

  addPackage: 'FS-Tests-Xtreams';

  addPackage: 'FS-Tests-Zip';

  addPackage: 'FS-Tests-Disk';

  addPackage: 'FS-Tests-FileStream';

  install.



(Installer wiresong project: 'al')

  addPackage: 'AL-Rendering';

  addPackage: 'AL-Http';

  addPackage: 'AL-Application';

  addPackage: 'AL-Serialization';

  addPackage: 'AL-Json';

  addPackage: 'AL-Html5';

  addPackage: 'AL-HtmlApp';

  addPackage: 'AL-User';
  addPackage: 'AL-Examples';

  addPackage: 'AL-Tests-Json';

  addPackage: 'AL-Tests-Html5';

  addPackage: 'AL-Tests-User';

  addPackage: 'AL-Tests-Serialization';

  addPackage: 'AL-Tests-Http';

  addPackage: 'AL-Tests-Application';

  install.


Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Edgar De Cleene
Re: [squeak-dev] Altitude - Seaside JSON example


On 9/29/12 7:56 AM, "Chris Cunnington" <[hidden email]> wrote:

  
The Xtras package in Xtreams uses libcrypto. The EVP_MD_CTX_init error is saying that the FFI call to the libcrypto library that comes with OpenSSH cannot be found. This library is used by Altitude to generate random URLs.
 
 Open your Terminal and "man openssl" to see if you have libcrypto. I think it comes standard on a Mac. If that's the case, then perhaps your FFI cannot make the call to the library.
 
 Chris

Very thanks for fast response.
Terminal said have openssl.
Go to found the mac book air which have the latest Mountain Lion and see what’s happen

Thanks to you , Colin and all which is working on this,
Nice to see finally Xtreams found his way into Squeak

Edgar
 


Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Edgar De Cleene
In reply to this post by Chris Cunnington
Re: [squeak-dev] Altitude - Seaside JSON example


On 9/29/12 7:56 AM, "Chris Cunnington" <[hidden email]> wrote:

  
The Xtras package in Xtreams uses libcrypto. The EVP_MD_CTX_init error is saying that the FFI call to the libcrypto library that comes with OpenSSH cannot be found. This library is used by Altitude to generate random URLs.
 
 Open your Terminal and "man openssl" to see if you have libcrypto. I think it comes standard on a Mac. If that's the case, then perhaps your FFI cannot make the call to the library.
 
 Chris

Very thanks for fast response.
Terminal said have openssl.
Go to found the mac book air which have the latest Mountain Lion and see what’s happen

Thanks to you , Colin and all which is working on this,
Nice to see finally Xtreams found his way into Squeak

Edgar
 
I have same on OS X 10.8.2.
How I could have Altitude examples working on Mac ?

Very thanks


Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Chris Cunnington
On 12-09-29 8:13 AM, Edgar J. De Cleene wrote:
Re: [squeak-dev] Altitude - Seaside JSON example


On 9/29/12 7:56 AM, "Chris Cunnington" [hidden email] wrote:

  
The Xtras package in Xtreams uses libcrypto. The EVP_MD_CTX_init error is saying that the FFI call to the libcrypto library that comes with OpenSSH cannot be found. This library is used by Altitude to generate random URLs.
 
 Open your Terminal and "man openssl" to see if you have libcrypto. I think it comes standard on a Mac. If that's the case, then perhaps your FFI cannot make the call to the library.
 
 Chris

Very thanks for fast response.
Terminal said have openssl.
Go to found the mac book air which have the latest Mountain Lion and see what’s happen

Thanks to you , Colin and all which is working on this,
Nice to see finally Xtreams found his way into Squeak

Edgar
 
I have same on OS X 10.8.2.
How I could have Altitude examples working on Mac ?

Very thanks



    
I have a Mac with 10.7.2. I've never had a problem with Altitude on Mac. I've encountered problems on Linux due to the FFI. Run your tests for FFI. Are they all green?

The issue, I'd say, is what VM you're using. Try a one of the latest versions of Cog:

http://www.mirandabanda.org/files/Cog/VM/

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Edgar De Cleene
Re: [squeak-dev] Altitude - Seaside JSON example


On 9/29/12 9:19 AM, "Chris Cunnington" <[hidden email]> wrote:

The issue, I'd say, is what VM you're using. Try a one of the latest versions of Cog:
 
 http://www.mirandabanda.org/files/Cog/VM/

 Chris

Yes, this was the solution.

Time to switch to Elliot VM for all ....

Very, very thanks

Edgar


Reply | Threaded
Open this post in threaded view
|

Re: Altitude - Seaside JSON example

Chris Cunnington
On 12-09-29 8:30 AM, Edgar J. De Cleene wrote:
Re: [squeak-dev] Altitude - Seaside JSON example


On 9/29/12 9:19 AM, "Chris Cunnington" [hidden email] wrote:

The issue, I'd say, is what VM you're using. Try a one of the latest versions of Cog:
 
 http://www.mirandabanda.org/files/Cog/VM/

 Chris

Yes, this was the solution.

Time to switch to Elliot VM for all ....

Very, very thanks

Edgar



    
Super. I'm glad it works now.

Chris