Pharo 4 Playground open file menu

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

Re: Pharo 4 Playground open file menu

Tudor Girba-2
Hi,

I think this is an interesting use case, and it is already supported only in a less classic way :).

I just wrote a blog post about it:

Let me know if this works for you.

Cheers,
Doru




On Sun, May 3, 2015 at 3:02 PM, [hidden email] <[hidden email]> wrote:


Le 3 mai 2015 12:28, "Esteban Lorenzano" <[hidden email]> a écrit :
>
>
>> On 02 May 2015, at 23:28, [hidden email] wrote:
>>
>> When some sysadmin has to edit them on servers, you want them in .st files.
>>
>> No class. No IDE. Not too much Smalltalk.
>
>
> but  then 
> - if not smalltalk, the scripts should not be in the image… even in workspaces
> - if the sysadmin has to edit them, he can always do something like: 
>
> #! /bin/bash
>
> pharo MyImage.image eval “
> my 
> multilined
> more or less smalltalk
> script”
>
> - you can always see and edit your scripts by doing: 
>
> 'play-cache' asFileReference inspect 
>
> (instead ‘play-cache’ you can put: ‘my-script-folder’, whatever)
>
> and you will have a complete inspector that allows you to see and edit your scripts (who are in the file system, where a sysadmin can find them, and not in an obscure workspace).
>
> also I bet you would take no more than 5’ to add functionality to gtinspector (it is designed to be moldable, after all) to add new scripts, and no matter what other functionality you need… and the result will be a lot more “pharoish” than storing it in a workspace. 

I agree to these things for the Pharoish experience.

Just that those scripts are to be edited with Vim on remote boxes.

I don't want to convert a sysadmin to pharo.

I want pharo to be used as any other tool in the lineup.

My image builder is fullly in a class etc.

Also I am using Sebastian Sastre's ConfigurationFiles that do load conf/SomeConfFile.st

I have several such files:

- email addresses
- mongodb conf
- seaside ports, debug level..
- API config
- configuration file for a tree structure
- preferences

These are using code that get eval'd because it is practical to use variables etc.

e.g.

defaultBandwidth := 50 megabitsPerSecond.

....

#(10 20 30 40) do: [:id |
config add: SomeModule new bandwidth: defaultBandwidth; id: id asString; label: 'SomeLab', is asString; picture:'some.jpg'; geoLocation: 45.55@44.42; yourself]

....

^config

I am preparing them in with Playground etc.

So nothing wrong with Playground.

I just like the simple workspace too.

I also added a : prefix in Spotlight to execute what I do type.

Going 4.0 is not yet done here.
I am using 3.0 with GToolkit.

Phil

>
> Esteban
>
>
>> Just the DSL on an as needed to know basis to configure things.
>>
>> That's better that XML/YAML/JSON...
>>
>> So, that's the case.
>>
>> Startup scripts same story.
>>
>> Phil
>>
>> Le 2 mai 2015 17:56, "Esteban Lorenzano" <[hidden email]> a écrit :
>>>
>>> well… IMO those scripts also should be in a method. 
>>> Probably under a class named: MyCoolProjectRunScripts or something like that… but in a class. 
>>> If they are in a class you can: 
>>> - save them with your project
>>> - version them
>>> - if you add <script> pragma, you can even execute them by clicking on it (Pharo 4).
>>>
>>> so… even if you might have a case where you want the save/load… you actually have (what I consider) a better option. 
>>>
>>> Esteban
>>>
>>>> On 02 May 2015, at 15:17, Esteban A. Maringolo <[hidden email]> wrote:
>>>>
>>>> Ditto here.
>>>>
>>>> I have cron tasks that fire a smalltak script, the startup script itself or a small import script that doesn't belong to a class. All those are my cases for the workspace.
>>>>
>>>> El may 2, 2015 4:38 AM, "[hidden email]" <[hidden email]> escribió:
>>>>>
>>>>> playground cache is actually not nice when scripts are to be part of a project with a name etc. And I have a ton of files in it. I can't remember which is which.
>>>>>
>>>>> I have scripts to do lots of cli things and I like the save as of the workspace.
>>>>>
>>>>> But I have done extra key bindings for getting the ws or the playground.
>>>>>
>>>>> Phil
>>>>>
>>>>> Le 2 mai 2015 06:49, "Sergio Fedi" <[hidden email]> a écrit :
>>>>>>
>>>>>> Oh! That link gives a GREAT explanation! Thanks.
>>>>>>
>>>>>> On the subject of how to show it better, I'm not a graphic designer (although I'm working with one)
>>>>>> so I'll ask him for some insights on the matter.
>>>>>>
>>>>>>
>>>>>> For now, he pointed out some issues like lack of consistency on some interfaces
>>>>>> and some other details.
>>>>>>
>>>
>




--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Pharo 4 Playground open file menu

philippeback


On Sun, May 3, 2015 at 10:34 PM, Tudor Girba <[hidden email]> wrote:
Hi,

I think this is an interesting use case, and it is already supported only in a less classic way :).

I just wrote a blog post about it:

Let me know if this works for you.

Nice, I need to go to 4.0 to get that Spotter thing :-)

One note: scripts are saved with the CR (or ^M) line ending by Pharo.
Now, vim in Linux positively hates that (showing a single line with ^M s all over).

This also makes diffing files a pain (meld is not recognizing any lines etc).

So, I have to mac2unix convert them after they have been saved.

I think we should be much better LF (\n) citizens in the Linux world.


Phil
 

Cheers,
Doru




On Sun, May 3, 2015 at 3:02 PM, [hidden email] <[hidden email]> wrote:


Le 3 mai 2015 12:28, "Esteban Lorenzano" <[hidden email]> a écrit :
>
>
>> On 02 May 2015, at 23:28, [hidden email] wrote:
>>
>> When some sysadmin has to edit them on servers, you want them in .st files.
>>
>> No class. No IDE. Not too much Smalltalk.
>
>
> but  then 
> - if not smalltalk, the scripts should not be in the image… even in workspaces
> - if the sysadmin has to edit them, he can always do something like: 
>
> #! /bin/bash
>
> pharo MyImage.image eval “
> my 
> multilined
> more or less smalltalk
> script”
>
> - you can always see and edit your scripts by doing: 
>
> 'play-cache' asFileReference inspect 
>
> (instead ‘play-cache’ you can put: ‘my-script-folder’, whatever)
>
> and you will have a complete inspector that allows you to see and edit your scripts (who are in the file system, where a sysadmin can find them, and not in an obscure workspace).
>
> also I bet you would take no more than 5’ to add functionality to gtinspector (it is designed to be moldable, after all) to add new scripts, and no matter what other functionality you need… and the result will be a lot more “pharoish” than storing it in a workspace. 

I agree to these things for the Pharoish experience.

Just that those scripts are to be edited with Vim on remote boxes.

I don't want to convert a sysadmin to pharo.

I want pharo to be used as any other tool in the lineup.

My image builder is fullly in a class etc.

Also I am using Sebastian Sastre's ConfigurationFiles that do load conf/SomeConfFile.st

I have several such files:

- email addresses
- mongodb conf
- seaside ports, debug level..
- API config
- configuration file for a tree structure
- preferences

These are using code that get eval'd because it is practical to use variables etc.

e.g.

defaultBandwidth := 50 megabitsPerSecond.

....

#(10 20 30 40) do: [:id |
config add: SomeModule new bandwidth: defaultBandwidth; id: id asString; label: 'SomeLab', is asString; picture:'some.jpg'; geoLocation: 45.55@44.42; yourself]

....

^config

I am preparing them in with Playground etc.

So nothing wrong with Playground.

I just like the simple workspace too.

I also added a : prefix in Spotlight to execute what I do type.

Going 4.0 is not yet done here.
I am using 3.0 with GToolkit.

Phil

>
> Esteban
>
>
>> Just the DSL on an as needed to know basis to configure things.
>>
>> That's better that XML/YAML/JSON...
>>
>> So, that's the case.
>>
>> Startup scripts same story.
>>
>> Phil
>>
>> Le 2 mai 2015 17:56, "Esteban Lorenzano" <[hidden email]> a écrit :
>>>
>>> well… IMO those scripts also should be in a method. 
>>> Probably under a class named: MyCoolProjectRunScripts or something like that… but in a class. 
>>> If they are in a class you can: 
>>> - save them with your project
>>> - version them
>>> - if you add <script> pragma, you can even execute them by clicking on it (Pharo 4).
>>>
>>> so… even if you might have a case where you want the save/load… you actually have (what I consider) a better option. 
>>>
>>> Esteban
>>>
>>>> On 02 May 2015, at 15:17, Esteban A. Maringolo <[hidden email]> wrote:
>>>>
>>>> Ditto here.
>>>>
>>>> I have cron tasks that fire a smalltak script, the startup script itself or a small import script that doesn't belong to a class. All those are my cases for the workspace.
>>>>
>>>> El may 2, 2015 4:38 AM, "[hidden email]" <[hidden email]> escribió:
>>>>>
>>>>> playground cache is actually not nice when scripts are to be part of a project with a name etc. And I have a ton of files in it. I can't remember which is which.
>>>>>
>>>>> I have scripts to do lots of cli things and I like the save as of the workspace.
>>>>>
>>>>> But I have done extra key bindings for getting the ws or the playground.
>>>>>
>>>>> Phil
>>>>>
>>>>> Le 2 mai 2015 06:49, "Sergio Fedi" <[hidden email]> a écrit :
>>>>>>
>>>>>> Oh! That link gives a GREAT explanation! Thanks.
>>>>>>
>>>>>> On the subject of how to show it better, I'm not a graphic designer (although I'm working with one)
>>>>>> so I'll ask him for some insights on the matter.
>>>>>>
>>>>>>
>>>>>> For now, he pointed out some issues like lack of consistency on some interfaces
>>>>>> and some other details.
>>>>>>
>>>
>




--

"Every thing has its own flow"



Reply | Threaded
Open this post in threaded view
|

Re: Pharo 4 Playground open file menu

Offray
In reply to this post by philippeback
Hi,

I didn't thought about sysadmin jobs on Smalltalk, like Ben, but seems
like a good case for having stuff outside the image, but being image
friendly. The options explained by Tudor[0] could be a good approach and
may be the "..." button on the playground could have a dialog to rename
page as file or something that makes the procedure of doble clicking the
page name as a way to "communicate" with file system more explicit.

[0]
http://www.humane-assessment.com/blog/managing-external-pharo-scripts-with-gtinspector-and-gtspotter

My approach to give persistence to what I was doing on the
workspace/playground was pretty different: After years of using Leo [1]
I was very used to its tree-like interface, but I was thinking in
something more interactive (like the IPython[2] notebook, but without
loosing the trees, that gives context[3]) and more document oriented,
like TeXmacs[4] and pandoc. From this kind of sources of inspiration I'm
making grafoscopio[5], which is still pretty alpha, but let's you save
scripts with context and mix them with documentation or write
interactive documentation. The storage format is STON[6]

[1] http://leoeditor.com/
[2] http://ipython.org/notebook.html
[3] http://mutabit.com/mutabit/default/wiki/ipython-deepness
[4] http://texmacs.org/
[5] http://smalltalkhub.com/#!/~Offray/Grafoscopio
[6] https://github.com/svenvc/ston/blob/master/ston-paper.md

So, it will not let you edit code from vim (by the way, I'm with Ben
about more Unix/Internet friendly line endings for storage/exporting on
external files), but It will bridge the document/script world, with the
object world. Making such bridges with the external world is important
for delivering the promises of the dynabook and pharo to more people.

Cheers,

Offray

Ps: I have attached and screenshot of my "apprentice notes" grafoscopio
notebook, to illustrate my point :-)

El 02/05/15 a las 16:28, [hidden email] escribió:

> When some sysadmin has to edit them on servers, you want them in .st files.
>
> No class. No IDE. Not too much Smalltalk.
>
> Just the DSL on an as needed to know basis to configure things.
>
> That's better that XML/YAML/JSON...
>
> So, that's the case.
>
> Startup scripts same story.
>
> Phil
>
> Le 2 mai 2015 17:56, "Esteban Lorenzano" <[hidden email]
> <mailto:[hidden email]>> a écrit :
>
>      well… IMO those scripts also should be in a method.
>      Probably under a class named: MyCoolProjectRunScripts or something like
>      that… but in a class.
>      If they are in a class you can:
>      - save them with your project
>      - version them
>      - if you add <script> pragma, you can even execute them by clicking on it
>      (Pharo 4).
>
>      so… even if you might have a case where you want the save/load… you actually
>      have (what I consider) a better option.
>
>      Esteban
>
>>     On 02 May 2015, at 15:17, Esteban A. Maringolo <[hidden email]
>>     <mailto:[hidden email]>> wrote:
>>
>>     Ditto here.
>>
>>     I have cron tasks that fire a smalltak script, the startup script itself
>>     or a small import script that doesn't belong to a class. All those are my
>>     cases for the workspace.
>>
>>     El may 2, 2015 4:38 AM, "[hidden email] <mailto:[hidden email]>"
>>     <[hidden email] <mailto:[hidden email]>> escribió:
>>
>>         playground cache is actually not nice when scripts are to be part of a
>>         project with a name etc. And I have a ton of files in it. I can't
>>         remember which is which.
>>
>>         I have scripts to do lots of cli things and I like the save as of the
>>         workspace.
>>
>>         But I have done extra key bindings for getting the ws or the playground.
>>
>>         Phil
>>
>>         Le 2 mai 2015 06:49, "Sergio Fedi" <[hidden email]
>>         <mailto:[hidden email]>> a écrit :
>>
>>             Oh! That link gives a GREAT explanation! Thanks.
>>
>>             On the subject of how to show it better, I'm not a graphic
>>             designer (although I'm working with one)
>>             so I'll ask him for some insights on the matter.
>>
>>
>>             For now, he pointed out some issues like lack of consistency on
>>             some interfaces
>>             and some other details.
>>
>


apprentice-notes.png (156K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Pharo 4 Playground open file menu

Sean P. DeNigris
Administrator
In reply to this post by philippeback
philippeback wrote
One note: scripts are saved with the CR (or ^M) line ending by Pharo.
Now, vim in Linux positively hates that (showing a single line with ^M s
all over).
I think we should be much better LF (\n) citizens in the Linux world.
Yes! Same with fileouts on Mac via MacVim - one long incomprehensible line strewn with special characters. Should we save using the line ending of the underlying platform? Or is there one that's, if not universal, workable (i.e. least offensive) on all major platforms?
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Pharo 4 Playground open file menu

Sean P. DeNigris
Administrator
In reply to this post by Tudor Girba-2
Cool! I made a few edits to the copy https://gist.github.com/seandenigris/d873780236bcbd45b933/revisions

The last sentence sounds weird:
"At the same time the global Playground is freed by the quaint constraint of saving and loading files."
but I don't understand the intention well enough to improve it.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Pharo 4 Playground open file menu

Sven Van Caekenberghe-2
In reply to this post by Sean P. DeNigris

> On 04 May 2015, at 01:03, Sean P. DeNigris <[hidden email]> wrote:
>
> philippeback wrote
>> One note: scripts are saved with the CR (or ^M) line ending by Pharo.
>> Now, vim in Linux positively hates that (showing a single line with ^M s
>> all over).
>> I think we should be much better LF (\n) citizens in the Linux world.
>
> Yes! Same with fileouts on Mac via MacVim - one long incomprehensible line
> strewn with special characters. Should we save using the line ending of the
> underlying platform? Or is there one that's, if not universal, workable
> (i.e. least offensive) on all major platforms?

NeoCSV, NeoJSON and STON all can output using any EOL convention, but they traditionally use CR like the rest of Pharo.

Maybe we should make the default LF like I believe they did in Cuis ?


Reply | Threaded
Open this post in threaded view
|

Re: Pharo 4 Playground open file menu

vonbecmann
In reply to this post by philippeback
The same as Phil mentioned, but with Emacs on Debian Wheezy you get a lot of ^M and Emacs says this about the coding system:

- -- undecided-unix (alias: unix)

No conversion on encoding, automatic conversion on decoding.
Type: undecided (do automatic conversion)



On Sun, May 3, 2015 at 5:46 PM, [hidden email] <[hidden email]> wrote:


On Sun, May 3, 2015 at 10:34 PM, Tudor Girba <[hidden email]> wrote:
Hi,

I think this is an interesting use case, and it is already supported only in a less classic way :).

I just wrote a blog post about it:

Let me know if this works for you.

Nice, I need to go to 4.0 to get that Spotter thing :-)

One note: scripts are saved with the CR (or ^M) line ending by Pharo.
Now, vim in Linux positively hates that (showing a single line with ^M s all over).

This also makes diffing files a pain (meld is not recognizing any lines etc).

So, I have to mac2unix convert them after they have been saved.

I think we should be much better LF (\n) citizens in the Linux world.


Phil
 

Cheers,
Doru




On Sun, May 3, 2015 at 3:02 PM, [hidden email] <[hidden email]> wrote:


Le 3 mai 2015 12:28, "Esteban Lorenzano" <[hidden email]> a écrit :
>
>
>> On 02 May 2015, at 23:28, [hidden email] wrote:
>>
>> When some sysadmin has to edit them on servers, you want them in .st files.
>>
>> No class. No IDE. Not too much Smalltalk.
>
>
> but  then 
> - if not smalltalk, the scripts should not be in the image… even in workspaces
> - if the sysadmin has to edit them, he can always do something like: 
>
> #! /bin/bash
>
> pharo MyImage.image eval “
> my 
> multilined
> more or less smalltalk
> script”
>
> - you can always see and edit your scripts by doing: 
>
> 'play-cache' asFileReference inspect 
>
> (instead ‘play-cache’ you can put: ‘my-script-folder’, whatever)
>
> and you will have a complete inspector that allows you to see and edit your scripts (who are in the file system, where a sysadmin can find them, and not in an obscure workspace).
>
> also I bet you would take no more than 5’ to add functionality to gtinspector (it is designed to be moldable, after all) to add new scripts, and no matter what other functionality you need… and the result will be a lot more “pharoish” than storing it in a workspace. 

I agree to these things for the Pharoish experience.

Just that those scripts are to be edited with Vim on remote boxes.

I don't want to convert a sysadmin to pharo.

I want pharo to be used as any other tool in the lineup.

My image builder is fullly in a class etc.

Also I am using Sebastian Sastre's ConfigurationFiles that do load conf/SomeConfFile.st

I have several such files:

- email addresses
- mongodb conf
- seaside ports, debug level..
- API config
- configuration file for a tree structure
- preferences

These are using code that get eval'd because it is practical to use variables etc.

e.g.

defaultBandwidth := 50 megabitsPerSecond.

....

#(10 20 30 40) do: [:id |
config add: SomeModule new bandwidth: defaultBandwidth; id: id asString; label: 'SomeLab', is asString; picture:'some.jpg'; geoLocation: 45.55@44.42; yourself]

....

^config

I am preparing them in with Playground etc.

So nothing wrong with Playground.

I just like the simple workspace too.

I also added a : prefix in Spotlight to execute what I do type.

Going 4.0 is not yet done here.
I am using 3.0 with GToolkit.

Phil

>
> Esteban
>
>
>> Just the DSL on an as needed to know basis to configure things.
>>
>> That's better that XML/YAML/JSON...
>>
>> So, that's the case.
>>
>> Startup scripts same story.
>>
>> Phil
>>
>> Le 2 mai 2015 17:56, "Esteban Lorenzano" <[hidden email]> a écrit :
>>>
>>> well… IMO those scripts also should be in a method. 
>>> Probably under a class named: MyCoolProjectRunScripts or something like that… but in a class. 
>>> If they are in a class you can: 
>>> - save them with your project
>>> - version them
>>> - if you add <script> pragma, you can even execute them by clicking on it (Pharo 4).
>>>
>>> so… even if you might have a case where you want the save/load… you actually have (what I consider) a better option. 
>>>
>>> Esteban
>>>
>>>> On 02 May 2015, at 15:17, Esteban A. Maringolo <[hidden email]> wrote:
>>>>
>>>> Ditto here.
>>>>
>>>> I have cron tasks that fire a smalltak script, the startup script itself or a small import script that doesn't belong to a class. All those are my cases for the workspace.
>>>>
>>>> El may 2, 2015 4:38 AM, "[hidden email]" <[hidden email]> escribió:
>>>>>
>>>>> playground cache is actually not nice when scripts are to be part of a project with a name etc. And I have a ton of files in it. I can't remember which is which.
>>>>>
>>>>> I have scripts to do lots of cli things and I like the save as of the workspace.
>>>>>
>>>>> But I have done extra key bindings for getting the ws or the playground.
>>>>>
>>>>> Phil
>>>>>
>>>>> Le 2 mai 2015 06:49, "Sergio Fedi" <[hidden email]> a écrit :
>>>>>>
>>>>>> Oh! That link gives a GREAT explanation! Thanks.
>>>>>>
>>>>>> On the subject of how to show it better, I'm not a graphic designer (although I'm working with one)
>>>>>> so I'll ask him for some insights on the matter.
>>>>>>
>>>>>>
>>>>>> For now, he pointed out some issues like lack of consistency on some interfaces
>>>>>> and some other details.
>>>>>>
>>>
>




--

"Every thing has its own flow"






--
Bernardo E.C.

Sent from a cheap desktop computer in South America.
123