https://github.com/instantiations/pharo-to-vast
Little tool to ease exporting code from Pharo to VA Smalltalk
https://github.com/instantiations/pharo-to-vast
cvs git pharo pharo-smalltalk smalltalk vasmalltalk vastplatform
Last synced: 29 days ago
JSON representation
Little tool to ease exporting code from Pharo to VA Smalltalk
- Host: GitHub
- URL: https://github.com/instantiations/pharo-to-vast
- Owner: instantiations
- License: mit
- Created: 2019-01-18T14:50:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-10T19:18:27.000Z (almost 5 years ago)
- Last Synced: 2025-02-05T06:36:15.061Z (3 months ago)
- Topics: cvs, git, pharo, pharo-smalltalk, smalltalk, vasmalltalk, vastplatform
- Language: Smalltalk
- Size: 19.5 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Pharo2VA
Facilitating code export from Pharo to VAST Platform (VA Smalltalk)
Explore the docs »
Report a defect
|
Request feature
[](https://github.com/vasmalltalk/pharo2va/releases/latest)
[](https://travis-ci.com/vasmalltalk/pharo2va)
[](https://ci.appveyor.com/project/marianopeck/pharo2va)
[](https://coveralls.io/github/vasmalltalk/pharo2va?branch=master)Little tool to ease exporting code from Pharo to VA Smalltalk
This is an exporter from Pharo source code to Instantiations VA Smalltalk. This exporter can reject explicit classes, extension methods, methods, and generates the resulting Monticello files (.mcz) into a user specified direcotry.
By default, the exporter will also take care of re-write the Pharo's literal Array that use curly brackets with a way that would work in VA Smalltalk.
## License
- The code is licensed under [MIT](LICENSE).
- The documentation is licensed under [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/).## Quick Start
- Download the latest [Pharo 32](https://get.pharo.org/) or [64 bits VM](https://get.pharo.org/64/) and follow this [instructions](docs/Installation.md).
- Download a ready to use image from the [release page](https://github.com/vasmalltalk/pharo2va/releases/latest)
- Explore the [documentation](docs/)## Installation
To load the project in a Pharo image, or declare it as a dependency of your own project follow this [instructions](docs/Installation.md).
## Example
Below is an example when porting STON to VA:
```smalltalk
Pharo2VA
exporter
directory: FileSystem disk workingDirectory / 'exports';
packagesNames: {'STON-Core' . 'STON-Tests'};
methodsBlacklist:
{(Text class >> #fromSton:).
(STONWriterTests >> #testMimeType).
(STONWriteReadTests >> #testFileSystemSupport).
(STONWriteReadTests >> #testMimeTypes).
(STONWriteReadTests >> #testTextAndRunArray).
(STONReaderTests >> #testMimeType).
(STONReaderTests >> #testWideSymbol).
(STONReaderTests >> #testClassWithUnderscore).
(STONReaderTests >> #testURL).
(STONWriterTests >> #testURL)};
addToBlacklistAllExtensionsOf:
{RunArray.
FileReference.
SmallDictionary.
ZnMimeType.
ZnUrl.
Path.
OrderedDictionary};
classesBlackList: {STONFileReference};
export
```Before evaluating above code, be sure to have those packages `'STON-Core'` and `'STON-Tests'` loaded into your image (for the tool it doesn't matter how you load them).
Evaluating that code will end up creating one .mcz file (Monticello file) per exported packaged (`#packagesNames:`), under the specified directory (`#directory:`). As you can see, there are ways to exclude methods (`#methodsBlacklist:`), extension methods from classes (`#addToBlacklistAllExtensionsOf`), and even full classes (`#classesBlackList:`).
## Converting literal arrays
VA Smalltalk do not have the same array notation for `{}` as Pharo has. But do not worry this exporter export this `{'A'}` in this order `(Array new: 1) at: 1 put: 'A'`.
## Importing on VA
To import in VA, you can use the [Monticello Importer](https://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=sg/stugmi.html) feature.
Right now the tool always exports the packages into .mcz and so you must use Monticello Importer in VA to import. However, as soon as Tonel is supported on VA, this tool would be able to write into Tonel instead of .mcz.
## Acknowledgments
- Pharo2VA was influenced by a subset of the [Pharo2VW](https://github.com/ObjectProfile/Pharo2VW) project. There are parts which we even copied and adapted them like the AST literal Array converter . Other parts, we took them as inspiration.
- Github repository layout was generated with [Ba-St Github-setup project](https://github.com/ba-st/GitHub-setup).
- Thanks [Gabriel Cotelli](https://github.com/gcotelli) for the help on setting up Travis CI and Coveralls integration.## Contributing
Check the [Contribution Guidelines](CONTRIBUTING.md)