Coral using NewCompiler

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

Coral using NewCompiler

Luc Fabresse
I modified LoadCoral and Coral so that it works in the pharo1.0-10418-BETAdev09.08.3 image and uses NewCompiler.
Since I cannot commit on the Coral repository, I attached the files.

To test it : 
1- file in LoadCoral that installs dependencies and the Coral version on ss 
2- file in Coral and Coral-DeadCode
3- save image as coral.image
4- create coral.sh script :

#! /bin/sh
vm='/Applications/SqueakVMs/Squeak 4.1.1beta2U.app/Contents/MacOS/Squeak VM Opt' 
"$vm" "coral.image" $1

5- create hello.st 
[
        Console print: 'Hello World'
]

6- execute : ./coral.sh hello.st

-------

Below another script using Rio (File-Kernel, File-Base).
1- Installer ss project: 'Rio' ; install: 'File-Kernel'; install: 'File-Base'
syntax error on loading (just comment the pragma and accept)
2-create rio-test.st

[
Object subclass: #SaBox
instanceVariableNames: 'bob'
classVariableNames: ''
poolDictionaries: ''
category: 'SandBox'
]

"a dummy example that convert a class in a file hierarchy"
SaBox>>convertToFiles: aClass inDirectory: rootDir
[
| classDir categoryNames |
classDir := (rootDir / aClass asString) mkdir.
categoryNames := aClass organization categories collect: [ :aCategory | aCategory asString ].
categoryNames do: [ :aCategoryName | | protocolDir | 
protocolDir := (classDir / aCategoryName) mkdir. 
(aClass methodsInCategory: aCategoryName) do: [ :aSelector |
(protocolDir / (aSelector asFileName replaceAll: $: with: $_)) asFile contents: (aClass sourceCodeAt: aSelector) 
]
].
^classDir
]


[
SaBox new convertToFiles: Object inDirectory: Directory home.
]
3- ./coral.st rio-test.sh



#Luc

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Coral.st (185K) Download Attachment
Coral-DeadCode.st (167K) Download Attachment
LoadCoral.st (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Coral using NewCompiler

Stéphane Ducasse
Excellent! Excellent! Excellent!
I want to
        - fix the problem about the path of the script so that you do not  
have to put the full path
        - have a better way to define classes
                Object > Point (may be like ruby)

        - use use use it

We should fix the to do
        - !#/usr/bin

I granted you access. I want coral to work.
Can you publish?

Stef

On Sep 3, 2009, at 9:59 AM, Luc Fabresse wrote:

> I modified LoadCoral and Coral so that it works in the  
> pharo1.0-10418-BETAdev09.08.3 image and uses NewCompiler.
> Since I cannot commit on the Coral repository, I attached the files.
>
> To test it :
> 1- file in LoadCoral that installs dependencies and the Coral  
> version on ss
> 2- file in Coral and Coral-DeadCode
> 3- save image as coral.image
> 4- create coral.sh script :
>
> #! /bin/sh
> vm='/Applications/SqueakVMs/Squeak 4.1.1beta2U.app/Contents/MacOS/
> Squeak VM Opt'
> "$vm" "coral.image" $1
>
> 5- create hello.st
> [
>         Console print: 'Hello World'
> ]
>
> 6- execute : ./coral.sh hello.st
>
> -------
>
> Below another script using Rio (File-Kernel, File-Base).
> 1- Installer ss project: 'Rio' ; install: 'File-Kernel'; install:  
> 'File-Base'
> syntax error on loading (just comment the pragma and accept)
> 2-create rio-test.st
>
> [
> Object subclass: #SaBox
> instanceVariableNames: 'bob'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'SandBox'
> ]
>
> "a dummy example that convert a class in a file hierarchy"
> SaBox>>convertToFiles: aClass inDirectory: rootDir
> [
> | classDir categoryNames |
> classDir := (rootDir / aClass asString) mkdir.
> categoryNames := aClass organization categories collect:  
> [ :aCategory | aCategory asString ].
> categoryNames do: [ :aCategoryName | | protocolDir |
> protocolDir := (classDir / aCategoryName) mkdir.
> (aClass methodsInCategory: aCategoryName) do: [ :aSelector |
> (protocolDir / (aSelector asFileName replaceAll: $: with: $_))  
> asFile contents: (aClass sourceCodeAt: aSelector)
> ]
> ].
> ^classDir
> ]
>
>
> [
> SaBox new convertToFiles: Object inDirectory: Directory home.
> ]
> 3- ./coral.st rio-test.sh
>
>
>
> #Luc
> <Coral.st><Coral-
> DeadCode
> .st><LoadCoral.st>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Coral using NewCompiler

Stéphane Ducasse
In reply to this post by Luc Fabresse
Excellent! Excellent! Excellent!
I want to
        - fix the problem about the path of the script so that you do not  
have to put the full path
        - have a better way to define classes
                Object > Point (may be like ruby)

        - use use use it

We should fix the to do
        - !#/usr/bin

I granted you access. I want coral to work.
Can you publish?

Stef

On Sep 3, 2009, at 9:59 AM, Luc Fabresse wrote:

> I modified LoadCoral and Coral so that it works in the  
> pharo1.0-10418-BETAdev09.08.3 image and uses NewCompiler.
> Since I cannot commit on the Coral repository, I attached the files.
>
> To test it :
> 1- file in LoadCoral that installs dependencies and the Coral  
> version on ss
> 2- file in Coral and Coral-DeadCode
> 3- save image as coral.image
> 4- create coral.sh script :
>
> #! /bin/sh
> vm='/Applications/SqueakVMs/Squeak 4.1.1beta2U.app/Contents/MacOS/
> Squeak VM Opt'
> "$vm" "coral.image" $1
>
> 5- create hello.st
> [
>        Console print: 'Hello World'
> ]
>
> 6- execute : ./coral.sh hello.st
>
> -------
>
> Below another script using Rio (File-Kernel, File-Base).
> 1- Installer ss project: 'Rio' ; install: 'File-Kernel'; install:  
> 'File-Base'
> syntax error on loading (just comment the pragma and accept)
> 2-create rio-test.st
>
> [
> Object subclass: #SaBox
> instanceVariableNames: 'bob'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'SandBox'
> ]
>
> "a dummy example that convert a class in a file hierarchy"
> SaBox>>convertToFiles: aClass inDirectory: rootDir
> [
> | classDir categoryNames |
> classDir := (rootDir / aClass asString) mkdir.
> categoryNames := aClass organization categories collect:  
> [ :aCategory | aCategory asString ].
> categoryNames do: [ :aCategoryName | | protocolDir |
> protocolDir := (classDir / aCategoryName) mkdir.
> (aClass methodsInCategory: aCategoryName) do: [ :aSelector |
> (protocolDir / (aSelector asFileName replaceAll: $: with: $_))  
> asFile contents: (aClass sourceCodeAt: aSelector)
> ]
> ].
> ^classDir
> ]
>
>
> [
> SaBox new convertToFiles: Object inDirectory: Directory home.
> ]
> 3- ./coral.st rio-test.sh
>
>
>
> #Luc
> <Coral.st><Coral-
> DeadCode
> .st><LoadCoral.st>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Coral using NewCompiler

Luc Fabresse


2009/9/3 Stéphane Ducasse <[hidden email]>
Excellent! Excellent! Excellent!
I want to
       - fix the problem about the path of the script so that you do not
have to put the full path
       - have a better way to define classes
               Object > Point (may be like ruby)

       - use use use it

We should fix the to do
       - !#/usr/bin

I granted you access. I want coral to work.
Can you publish?
Ok done.
Just load LoadCoral to test.

#Luc
 
Stef

On Sep 3, 2009, at 9:59 AM, Luc Fabresse wrote:

> I modified LoadCoral and Coral so that it works in the
> pharo1.0-10418-BETAdev09.08.3 image and uses NewCompiler.
> Since I cannot commit on the Coral repository, I attached the files.
>
> To test it :
> 1- file in LoadCoral that installs dependencies and the Coral
> version on ss
> 2- file in Coral and Coral-DeadCode
> 3- save image as coral.image
> 4- create coral.sh script :
>
> #! /bin/sh
> vm='/Applications/SqueakVMs/Squeak 4.1.1beta2U.app/Contents/MacOS/
> Squeak VM Opt'
> "$vm" "coral.image" $1
>
> 5- create hello.st
> [
>        Console print: 'Hello World'
> ]
>
> 6- execute : ./coral.sh hello.st
>
> -------
>
> Below another script using Rio (File-Kernel, File-Base).
> 1- Installer ss project: 'Rio' ; install: 'File-Kernel'; install:
> 'File-Base'
> syntax error on loading (just comment the pragma and accept)
> 2-create rio-test.st
>
> [
>       Object subclass: #SaBox
>               instanceVariableNames: 'bob'
>               classVariableNames: ''
>               poolDictionaries: ''
>               category: 'SandBox'
> ]
>
> "a dummy example that convert a class in a file hierarchy"
> SaBox>>convertToFiles: aClass inDirectory: rootDir
> [
>       | classDir categoryNames |
>       classDir := (rootDir / aClass asString) mkdir.
>       categoryNames := aClass organization categories collect:
> [ :aCategory | aCategory asString ].
>       categoryNames do: [ :aCategoryName | | protocolDir |
>               protocolDir := (classDir / aCategoryName) mkdir.
>               (aClass methodsInCategory: aCategoryName) do: [ :aSelector |
>                       (protocolDir / (aSelector asFileName replaceAll: $: with: $_))
> asFile contents: (aClass sourceCodeAt: aSelector)
>               ]
>       ].
>       ^classDir
> ]
>
>
> [
>       SaBox new convertToFiles: Object inDirectory: Directory home.
> ]
> 3- ./coral.st rio-test.sh
>
>
>
> #Luc
> <Coral.st><Coral-
> DeadCode
> .st><LoadCoral.st>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project