20081 converting workspaces and using salt & subversion to maintain them. v1.02
TRANSCRIPT
![Page 1: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/1.jpg)
2008 1
Converting workspaces and
using SALT & subversion to
maintain them.V1.02
![Page 2: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/2.jpg)
2008 2
Introduction
This is an example of converting an existing application to SALT and using a version control system afterwards to maintain it.
![Page 3: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/3.jpg)
2008 3
What is SALT?
SALT is a tool to deal with code outside the workspace in text (Unicode) format.
![Page 4: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/4.jpg)
Script formUp until V11 namespaces came in a
single form.They contained functions, variables
and other namespaces.
2008 4
![Page 5: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/5.jpg)
Script formStarting with V11 namespaces also
came in a script form.The contained functions, etc. are
listed in text format:
2008 5
![Page 6: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/6.jpg)
Script formThe script and the functions in it can
be edited via the editor, e.g.)ED ns2)ED ns2.tfn1
2008 6
![Page 7: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/7.jpg)
2008 7
How do we do it?
• We'll see the conversion process and• how to use subversion, a third party
product, to control its versioning
![Page 8: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/8.jpg)
2008 8
The situation
• BAAD is a military weapons manufacturing company
• One of its best sellers is the SD2, a device used to search and destroy specific targets
![Page 9: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/9.jpg)
2008 14
The simulator's structure• The workspace is divided into
namespaces• One namespace contains all the
units' logic, here its name is 'R' (for Robots)
• Each unit's logic is also contained in a namespace whose name is the name of the unit (like CARLA or AI2)
![Page 10: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/10.jpg)
2008 15
The simulator's structure
Here, namespace RR is where all the Units' logic reside
![Page 11: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/11.jpg)
2008 16
Updating the workspace • This involves modifying individual
units' code in their respective namespaces
• and resaving the entire workspace when finished with the changes
• This prevents other users from updating the workspace at the same time
![Page 12: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/12.jpg)
2008 17
Acceptable updating timeline
Time
Tester A
Tester B
load
load
save
save
change
change
Sequential updates
![Page 13: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/13.jpg)
2008 18
Unacceptable updating timeline
Time
Tester A
Tester B
load
load
save
save
change
change
Tester A's changes are overwritten by Tester Beven if the modified namespace is different
![Page 14: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/14.jpg)
2008 19
Tracking changes
Another problem with this model is that changes are irreversible.
Even tracking changes is difficult.
Finding differences in code is hard to document.
![Page 15: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/15.jpg)
2008 20
Dyalog V11.0This version allows namespaces to
exist in script format.
Instead of havinga series of namespaces each with functions and variables
![Page 16: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/16.jpg)
2008 21
Dyalog V11.0You can have
everything in script form, including the definition of variables
![Page 17: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/17.jpg)
2008 22
Scripts files
Keeping namespaces in scripted form allows us to save them in (Unicode) text files outside the workspace.
workspace
![Page 18: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/18.jpg)
2008 23
Updating can now be done in parallel for different namespaces
Tester A
Tester B
load
save
change
Tester A's changes are NOT overwritten by Tester B
Timelo
adsave
change
namespace A
namespace B
![Page 19: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/19.jpg)
2008 24
Tracking changes
It is easier to track changes now that files are in human readable format.
By saving multiple copies we can see the difference between each modification.
workspace
![Page 20: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/20.jpg)
2008 25
Tracking changes
Comparing files can be done easily in APL by SALT or by any 3rd party program.
Line aLine bLine c
Line aLine XLine c
![Page 21: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/21.jpg)
2008 26
Doing it
The first step is to convert the workspace to the new form
![Page 22: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/22.jpg)
2008 27
Start Dyalog, SALT should be there:
Converting the workspace
![Page 23: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/23.jpg)
2008 28
If it isn’t we have to make sure SALT is enabled:
Converting the workspace
![Page 24: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/24.jpg)
2008 29
)LOAD our workspace:
Converting the workspace
![Page 25: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/25.jpg)
2008 31
Bring in the conversion tools:
Converting the workspace
![Page 26: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/26.jpg)
2008 32
NStoScript is a namespace containing code to perform conversion of regular (non sourced) namespaces.
The function to use in it is <Convert>.
Converting the workspace
![Page 27: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/27.jpg)
2008 33
For example, to convert namespace 'UTIL':
Converting the workspace
![Page 28: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/28.jpg)
2008 34
To convert several namespaces first )CS where the namespaces are:
Converting the workspace
![Page 29: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/29.jpg)
2008 35
Then use an expression like:
Converting the workspace
![Page 30: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/30.jpg)
2008 36
Explorer now shows us the namespaces with the new icons:
Converting the workspace
![Page 31: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/31.jpg)
2008 37
The workspace has the same functionality as before.
It can be )SAVEd in this new format
Converting the workspace
![Page 32: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/32.jpg)
2008 38
Filing away
The next step is to store those namespaces in Unicode files.
Altho is it relatively simple to read/write text to file, their management, because of the encoding, is a bit more complex.
Again, SALT comes in handy.
![Page 33: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/33.jpg)
2008 39
Saving the scripts as text files
1. decide where to put them
2. use the SALT Save function
![Page 34: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/34.jpg)
2008 40
Saving the scripts as text filesThe Save function takes a string
argument of: 'namespace location':
![Page 35: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/35.jpg)
2008 41
Saving the scripts as text filesTo save all the namespaces at once
do:
![Page 36: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/36.jpg)
2008 42
Saving the scripts as text filesIf you want to save everything at
once you can do instead
![Page 37: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/37.jpg)
2008 43
Saving the scripts as text filesEither way you should now have a
folder with many scripts in it:
![Page 38: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/38.jpg)
2008 44
Making changes
SALT 'remembers' where each script was saved.
Changing one of them now means SALT will change the file as soon as the script is modified through the editor.
![Page 39: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/39.jpg)
2008 45
Making changesHere's what one of the scripts' contents looks like:
![Page 40: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/40.jpg)
2008 46
Making changesAnd here we make a change:
![Page 41: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/41.jpg)
2008 47
Making changesSALT detected the change and offers to change the script file:
![Page 42: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/42.jpg)
2008 48
Making changes
You should )SAVE the workspace here.
Like this SALT will remember where the edited namespaces are stored and detect if changes have been made outside APL (e.g. with Notepad)
![Page 43: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/43.jpg)
2008 49
Version Control
This is the 2nd part of the work to do.
SALT comes with its own versioning of files and comparison functions but it is primitive compared to state of the art version control systems like subversion.
![Page 44: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/44.jpg)
2008 50
Version Control
For a company it is preferable to use existing software like subversion.
To use subversion we first need somewhere to put the scripts files.
![Page 45: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/45.jpg)
2008 51
Version ControlWe picked folder \weapons as
repository
![Page 46: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/46.jpg)
2008 52
Version Control
We now import the scripts into the repository:
(we put our code in 'Troops')
![Page 47: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/47.jpg)
2008 53
Version Control
One of the testers now checks out a copy:
![Page 48: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/48.jpg)
2008 54
Version Control
Any other tester can do the same thing and update it independently.
repository
checkout
tester x
checkouttester 7
tester n
tester 3
checkoutcheckout
![Page 49: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/49.jpg)
2008 55
Version Control
He can see what's in his folder
![Page 50: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/50.jpg)
2008 56
Version Control
And use any portion (pattern) of it
![Page 51: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/51.jpg)
2008 60
Version Control
He can now repeat this procedure each time he )LOADs the workspace or )SAVE his own copy (e.g. 'tester1robots') which can be )loaded instead.
![Page 52: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/52.jpg)
2008 61
Version ControlHe, and any other tester that has
done the same thing, can now test the system and update it independently.
repository
tester x
tester 7
tester n
tester 3
![Page 53: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/53.jpg)
Modifying the code
2008 62
![Page 54: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/54.jpg)
Viewing changes
2008 63
![Page 55: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/55.jpg)
Viewing changes
2008 64
![Page 56: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/56.jpg)
2008 65
Version Control
When changes are ready to be checked in you do (here DANIMAL has been changed)
![Page 57: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/57.jpg)
2008 66
Version ControlHe, and any other tester that has
done the same thing, can now test the system and update it independently.
repository
tester x
tester 7
tester n
tester 3
commit
commit
commit
commit
![Page 58: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/58.jpg)
2008 67
Version Control
The VC should be able to handle conflicts, report on differences and generate complete new systems from the current repository.
![Page 59: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/59.jpg)
2008 68
Conclusion
For local or smaller systems you may choose to use SALT's limited versioning and comparing abilities but a solid Version Control system is a must for large systems.
![Page 60: 20081 Converting workspaces and using SALT & subversion to maintain them. V1.02](https://reader036.vdocuments.mx/reader036/viewer/2022062322/5697bfe31a28abf838cb4ca4/html5/thumbnails/60.jpg)
2008 69
Conclusion
Any version control will probably do but subversion is well supported and well documented.
And it's free.