Re: [Pharo-users] PharoJS

2017-06-28 Thread Norbert Hartl
Sorry for being late with my reply. Comments at the bottom.

> Am 22.06.2017 um 20:01 schrieb askoh :
> 
> Norbert:
> 
> I appreciate you explanation of Amber and PharoJS. I feel at a lost
> understanding the plethora of Smalltalk + Web frameworks. Is there a place
> where there is a pros and cons comparison of frameworks:
> Seaside, SqueakJS, PharoJS, Amber, Caffeine, VisualWorks Appex, Illiad,
> Aida, Teapot, etc?
> 
> The sheer number of frameworks just makes it difficult for anyone to commit.
> It is terrifying. Can we discuss and consolidate the best features into one
> or two and kill the rest?
> 

No, I don't think that would work. The web is a combination of resource linking 
and remote procedure calls. Web technology is really complex and is able to 
serve a huge amount of use cases. I don't think there can be one framework 
solving all the problems for all the use cases. So every framework focusses on 
a different aspect. 
I would turn your comment around. If you want to be successful in the web 
environment you need to learn about the fibres it is made of. As soon as you 
dive into I think all those frameworks will separate before your eyes quickly.

Maybe it is good that you first come up with a problem you want to solve. With 
that specific information there are a lot of people here that can guide you. 
I'm being one of them. So just ask.

Hope that helps,

Norbert



Re: [Pharo-users] Are we able to run pharo images in a read only environment?

2017-06-28 Thread Tim Mackinnon
FYI: I managed to get it to work - I still get the message about trying to save 
the changes file and it not being possible - however my error was not 
specifying —no-default-preferences  and also  around correctly escaping the 
command line - the “eval” command is a bit tricky as you need to escape any “ 
characters as they are badly interpreted.

Thus I had to do the following:

const child = exec('./pharo Pharo.image --no-default-preferences eval "Lambda 
processJSON: \'' + JSON.stringify(event).replace(/"/g,'\\"') + '\'"', (error) 
=> {
   
}

It looks like a simple lambda execution takes about 2700 to 2900ms

Tim

> On 28 Jun 2017, at 01:01, Tim Mackinnon  wrote:
> 
> Hi Sven, I'm curious how you are running your image.
> 
> I am following this tutorial - 
> https://aws.amazon.com/blogs/compute/scripting-languages-for-aws-lambda-running-php-ruby-and-go/
>  
> 
> 
> And am running pharo like the GO example by exec'ing via node js.
> 
> My aim was to write an Alexa service in pharo vs nodejs like I have been 
> doing.
> 
> I was assuming I can call pharo via the eval option and stringify the Jaon 
> Alexa Paramus and return a result via Stdout... well in theory, and the work 
> to make pharo play better in wider ecosystem.
> 
> It should work, and it seems you did make it work... but how?
> 
> Like you, I am wondering when I run it on an ec2 instance (non lambda), why 
> it takes so long to load? It feels like it can be faster?
> 
> Tim
> 
> Sent from my iPhone
> 
> 
> 
> Sent from my iPhone
> On 27 Jun 2017, at 20:21, Sven Van Caekenberghe  > wrote:
> 
>> 
>>> On 27 Jun 2017, at 18:05, Tim Mackinnon >> > wrote:
>>> 
>>> Hi - I am trying to run a pharo image in lambda (as an experiment) - 
>>> however I get an error from Pharo about not being able to write to the 
>>> changes file?
>>> 
>>> As I am just evaluating some code - I’m not really coding, so don’t need a 
>>> changes file - is there a command line option to not require it?
>> 
>> That is really strange, it should just work (it does for me using the zero 
>> config scripts).
>> 
>> I would try to use absolute (resolved) paths as much as possible.
>> 
>>> Also, am I running pharo the most efficient way - I’m using eval on the 
>>> command line and referencing a class with a class method - but is this the 
>>> best way?
>> 
>> Yes, that is ok.
>> 
>>> Thanks,
>>> 
>>> Tim
>>> 
>>> "errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda 
>>> processJSON: 
>>> '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo 
>>> cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease 
>>> check that you have write permission for this file.\n\nYou won''t be able 
>>> to save this image correctly until you fix this.'\n\u001b[31mError: Can't 
>>> find the requested 
>>> origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ 
>>> self cantFindOriginError ] in 
>>> UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ 
>>> self cantFindOriginError 
>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
>>>  self home / '.config' ] in UnixResolver>>preferences in Block: [ self home 
>>> / '.config' 
>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
>>>  self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ 
>>> self unknownOrigin: origin 
>>> ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
>>>  class>>initializeUniqueInstance\nGlobalIdentifier 
>>> class>>uniqueInstance\nSystemSettingsPersistence 
>>> class>>resumeSystemSettings\n[ :persistence | persistence 
>>> resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block: 
>>> [ :persistence | persistence resumeSystemSettings 
>>> ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
>>>  class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
>>>  "errorType": "Error",
>>>  "stackTrace": [
>>>"'Pharo cannot write to the changes file named /var/task/Pharo.changes.",
>>>"",
>>>"Please check that you have write permission for this file.",
>>>"",
>>>"Y

Re: [Pharo-users] Are we able to run pharo images in a read only environment?

2017-06-28 Thread Esteban A. Maringolo
2017-06-28 8:13 GMT-03:00 Tim Mackinnon :
> FYI: I managed to get it to work - I still get the message about trying to
> save the changes file and it not being possible - however my error was not
> specifying —no-default-preferences  and also  around correctly escaping the
> command line - the “eval” command is a bit tricky as you need to escape any
> “ characters as they are badly interpreted.
>
> Thus I had to do the following:
>
> const child = exec('./pharo Pharo.image --no-default-preferences eval
> "Lambda processJSON: \'' + JSON.stringify(event).replace(/"/g,'\\"') +
> '\'"', (error) => {
>
> }
>
> It looks like a simple lambda execution takes about 2700 to 2900ms

I guess it is more affordable to pay for 3 secs than for a whole
minute with 95% idle time.
However it seems to be a lot of time for the case of lambda use cases.


Esteban A. Maringolo



Re: [Pharo-users] Are we able to run pharo images in a read only environment?

2017-06-28 Thread JeremieRegnault
Tim Mackinnon wrote
> FYI: I managed to get it to work - I still get the message about trying to
> save the changes file and it not being possible - however my error was not
> specifying —no-default-preferences  and also  around correctly escaping
> the command line - the “eval” command is a bit tricky as you need to
> escape any “ characters as they are badly interpreted.

The error about saving the changes file comes from the fact that at startup,
Pharo tries to open Pharo.changes in read and write mode, which is
impossible if you are in a read-only environment. I am working on deploying
Pharo in read-only, and it's one of the main problems that shows up during
my tests.



--
View this message in context: 
http://forum.world.st/Are-we-able-to-run-pharo-images-in-a-read-only-environment-tp4952705p4952771.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Are we able to run pharo images in a read only environment?

2017-06-28 Thread Sven Van Caekenberghe

> On 28 Jun 2017, at 13:52, JeremieRegnault  
> wrote:
> 
> Tim Mackinnon wrote
>> FYI: I managed to get it to work - I still get the message about trying to
>> save the changes file and it not being possible - however my error was not
>> specifying —no-default-preferences  and also  around correctly escaping
>> the command line - the “eval” command is a bit tricky as you need to
>> escape any “ characters as they are badly interpreted.
> 
> The error about saving the changes file comes from the fact that at startup,
> Pharo tries to open Pharo.changes in read and write mode, which is
> impossible if you are in a read-only environment. I am working on deploying
> Pharo in read-only, and it's one of the main problems that shows up during
> my tests.

Did you see my hack here: 
https://pharo.fogbugz.com/f/cases/20126/Running-Without-Changes-and-Sources ?

> 
> --
> View this message in context: 
> http://forum.world.st/Are-we-able-to-run-pharo-images-in-a-read-only-environment-tp4952705p4952771.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 




Re: [Pharo-users] Are we able to run pharo images in a read only environment?

2017-06-28 Thread Tim Mackinnon
Thanks Sven - I was going to search for that as I recall it being talked about. 
I will give it a go and report back on results with Lambda.

I’m not sure how sensitive it is to image sizes and trying to open that file - 
so it will be interesting.

Tim

> On 28 Jun 2017, at 13:15, Sven Van Caekenberghe  wrote:
> 
> 
>> On 28 Jun 2017, at 13:52, JeremieRegnault  
>> wrote:
>> 
>> Tim Mackinnon wrote
>>> FYI: I managed to get it to work - I still get the message about trying to
>>> save the changes file and it not being possible - however my error was not
>>> specifying —no-default-preferences  and also  around correctly escaping
>>> the command line - the “eval” command is a bit tricky as you need to
>>> escape any “ characters as they are badly interpreted.
>> 
>> The error about saving the changes file comes from the fact that at startup,
>> Pharo tries to open Pharo.changes in read and write mode, which is
>> impossible if you are in a read-only environment. I am working on deploying
>> Pharo in read-only, and it's one of the main problems that shows up during
>> my tests.
> 
> Did you see my hack here: 
> https://pharo.fogbugz.com/f/cases/20126/Running-Without-Changes-and-Sources ?
> 
>> 
>> --
>> View this message in context: 
>> http://forum.world.st/Are-we-able-to-run-pharo-images-in-a-read-only-environment-tp4952705p4952771.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>> 
> 
> 




Re: [Pharo-users] PharoJS

2017-06-28 Thread askoh
Craig:

Great news for Pharo. I presume it will be after you are done with Squeak
running on SqueakJS. Do you have a roadmap. How will WebAssembly help or not
with project?

All the best,
Aik-Siong



--
View this message in context: 
http://forum.world.st/Re-PharoJS-tp4952267p4952832.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] PharoJS

2017-06-28 Thread askoh
Norbert:

Great answer. Spoken like a wise man.

I want a web app to fill paper forms - like income tax forms say. The forms
are scanned or input into the app. The developer provides the logic
connecting the input and output fields of the forms. The users then use the
app to fill their own forms, print them or send them electronically. Can
Smalltalk provide a superior solution? How?

Thanks,
Aik-Siong



--
View this message in context: 
http://forum.world.st/Re-PharoJS-tp4952267p4952833.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] ZdcPluginMissing: SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-06-28 Thread Offray Vladimir Luna Cárdenas
Hi,

I'm trying to deploy a small web app in Teapot, following the Enterprise
Pharo documentation and so, using Pharo 4 in the server. Installation
went fine, but when I try to actually use the app and I get this error:

ZdcPluginMissing: SSL/TLS plugin initailization failed (VM plugin
missing ? OS libraries missing ?)

Looking at [1] I see that this is because Pharo VM is expecting to found
libssl at some place. My server is a virtual Debian 6 64 bits, as
provided by Digital Ocean. When I locate the missing library and make a
symbolic link using:

ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.1.0.0

I still get this behavior:

ldd libSqueakSSL.so
linux-gate.so.1 (0xf7747000)
libssl.so.1.0.0 => not found
libc.so.6 => /lib32/libc.so.6 (0xf758b000)
/lib/ld-linux.so.2 (0xf774a000)

So, still is not finding the libssl.so.

[1]
https://stackoverflow.com/questions/12293670/zodiac-mail-sending-in-pharo-smalltalk

I don't know if this is related with running a 32 VM inside a Debian 64
bits distro, but running the chapter 2 example of the Enterprise Pharo,
I have not any problem like this one, on the same virtual server while
deploying the web app. How can I solve this?

Thanks,

Offray





Re: [Pharo-users] ZdcPluginMissing: SSL/TLS plugin initailization failed (VM plugin missing ? OS libraries missing ?)

2017-06-28 Thread Sven Van Caekenberghe

> On 29 Jun 2017, at 06:20, Offray Vladimir Luna Cárdenas 
>  wrote:
> 
> Hi,
> 
> I'm trying to deploy a small web app in Teapot, following the Enterprise
> Pharo documentation and so, using Pharo 4 in the server. Installation
> went fine, but when I try to actually use the app and I get this error:
> 
> ZdcPluginMissing: SSL/TLS plugin initailization failed (VM plugin
> missing ? OS libraries missing ?)
> 
> Looking at [1] I see that this is because Pharo VM is expecting to found
> libssl at some place. My server is a virtual Debian 6 64 bits, as
> provided by Digital Ocean. When I locate the missing library and make a
> symbolic link using:
> 
> ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.1.0.0
> 
> I still get this behavior:
> 
> ldd libSqueakSSL.so
>linux-gate.so.1 (0xf7747000)
>libssl.so.1.0.0 => not found
>libc.so.6 => /lib32/libc.so.6 (0xf758b000)
>/lib/ld-linux.so.2 (0xf774a000)
> 
> So, still is not finding the libssl.so.
> 
> [1]
> https://stackoverflow.com/questions/12293670/zodiac-mail-sending-in-pharo-smalltalk
> 
> I don't know if this is related with running a 32 VM inside a Debian 64
> bits distro, but running the chapter 2 example of the Enterprise Pharo,
> I have not any problem like this one, on the same virtual server while
> deploying the web app. How can I solve this?

Probably you forgot

sudo apt-get install libssl1.0.0:i386

The following should be enough to run 32 bit pharo on 64 bit ubuntu

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386
sudo apt-get install libssl1.0.0:i386
sudo apt-get install libfreetype6:i386

> Thanks,
> 
> Offray
> 
> 
>