1.22k likes | 1.37k Views
SALT and Version Control. How to handle projects using version controlled SALT V1.09. Reasons for external storage. Ever since large IT projects have been going on there has been a need to keep code out of the workspace and manage it. Whether the code is small or big.
E N D
SALT and Version Control How to handle projects using version controlled SALT V1.09
Reasons for external storage Ever since large IT projects have been going on there has been a need to keep code out of the workspace and manage it. Whether the code is small or big. Sep 2009
Reasons for external storage Programs evolve and distributed copies should be kept separately, even if small Sep 2009
Reasons for external storage • More room needed in the workspace • Backup copies (security) • Modularize code • Code control • Trace history • Find culprits • Etc. Sep 2009
Managing applications • Larger applications have to be maintained whether they are written in APL or not • You have to keep track of changes to know who's done what and when • You must be able to undo changes • Generally cope with (large) system related problems Sep 2009
workspace Code DB Managing applications Apps have been maintained using a combination of workspace and external storage Sep 2009
How In APL: • APL files (most common way) • Other workspaces ([]CY) • External DBs (e.g. Oracle) • Etc. In other (e.g. compiled) languages • Text files (distributed, e.g. file system) Sep 2009
APL stands out The rest of the world APL Sep 2009
Managing applications in APL This makes porting code or even sharing snippets of it difficult. • You cannot transport it • Hard to compare changes • You need the (proper) interpreter just to VIEW the code Sep 2009
Managing applications in APL • You need to maintain the code management system (CMS) itself • Employees need time to learn it • They go away with “useless” skills when they leave • The IT dptm sees APL as a problem, an outcast Sep 2009
Managing applications in APL There is another way: Unicodetext files • You can transport them • You don’t need any interpreter to VIEW them • They integrate with any text file based control system Sep 2009
Managing applications in APL With existing text based CMS • You don’t need to write your own CMS • Employees may already know about it • They go away with useful skills • The IT department doesn’t see APL as a non team player Sep 2009
APL doesn’t have to stand out The rest of the world APL Sep 2009
Unicode With the wider acceptance of Unicode it has become easier to share code in text files. • They can be reorganized e.g. Disk Explorer • APL code can now be cut & pasted and viewed in Notepad or other Unicode compliant editor/program • They can be exchanged easily Sep 2009
Dyalog V11 • This version introduced the scripted form of classes/namespaces • Their definitions, including functions in them, can be edited. Sep 2009
Dyalog V11 • The definition of objects like classes can be retrieved and manipulated like the definition of functions • And, like the ⎕CR of a function, it can be stored outside the workspace, e.g. in a text (Unicode) file Sep 2009
Requirements All that is needed to store and retrieve text to any Operating System is a pair of functions to • Store code to a text file • Read a text file into the workspace Easy enough to do. Sep 2009
Requirements Of course, once you’ve done that you may want to: • Save multiple versions • Retrieve any of them • List them • Compare them • Etc. * Basically manage them * Sep 2009
Enter... SALT Sep 2009
OK, so, what is SALT? Sep 2009
SALT SALT is exactly that: • A pair of functions to store/retrieve • + other functions to list/compare/etc. • + utility functions (e.g. ease migration of namespaces to text format) Sep 2009
SALT SALT stands for Simple APL Library Toolkit Itis a source code management system for functions, Classes and script-based Namespaces in Dyalog APL. Sep 2009
SALT basics • SALT is tucked away in ⎕SE - you can )LOAD and run any workspace anytime • To save a namespace use Save:⎕SE.SALT.Save 'myns \path\myfile' • To bring in a namespace use Load:⎕SE.SALT.Load '\path\myfile' Sep 2009
Features • The editor can be rigged to react on edition of SALTed objects • The user commands include all the SALT functions, e.g. ]save myns \path\myfile Sep 2009
Features SALT can save back a script on file right after it has been modified. Modify <test> After modification you are prompted to confirm saving over the present script file: Sep 2009
Storing a script with a stack This can happen if you modify a function of a class on the stack. Stack shows up Edit the function After modification you are prompted to confirm saving over the present script file. Once saved both the script and the class are modified and you can resume execution. Error happens Sep 2009
Storing multiple version of a script • You can store and KEEP several versions of a script. • By using the –version modifier you tell SALT to start using version numbering: Sep 2009
Storing multiple version of a script Every time you modify a script SALT stores the definition in a new file: V0 V1 Sep 2009
=? Showing differences between versions SALT can show the difference between 2 versions of a script, either • natively, using APL, or • using a 3rd party Unicode comparison program Sep 2009
→ is used to denote inserted lines ← is used to denote deleted lines =? lines inserted lines modified Showing differences between versions If ‘APL’ is the method chosen to compare, the output will appear in the session like this: Sep 2009
SALT features SALT has many more features It is UNIX ready It comes with tools of its own It can be extended easily by adding your own utilities Sep 2009
SALT limitations For small applications it may be sufficient to keep all code on file managed by SALT For larger apps this is clearly inadequate, you need Version Control on a grander scale Sep 2009
What is Version Control (VC)? VC is a good way to ensure team members of a project don't step over each others' toes. On a large project it is imperative to use VC. Otherwise, time (and money) will be lost trying to recover from coordination problems.
original files repository import Version Control overview You usually start by importing an existing system (a set of files) into a version control repository: Sep 2009
Version Control overview The original files can then be forgotten: original files repository Sep 2009
original files repository checkout subset Version Control overview You then checkout a subset to work with: Sep 2009
Version Control overview You then work on the subset for a while: repository subset Sep 2009
Version Control overview If you are using SALT you maintain the files from APL: Dyalog APL subset Sep 2009
Version Control overview Every once in a while you update the repository: repository Checkin subset Sep 2009
repository new release export Version Control overview When the repository is in a stable state you may produce a new release: Sep 2009
VC systems There are several VC systems out there. To mention a few: PerForce, ClearCase, Visual SourceSafe, CVS and SubVersion. There are pros & cons for each. Sep 2009
VC systems In the following slides we'll use subversion as an example. subversion is a popular open source program. It is well documented, has a large user base and it's free. Sep 2009
Enter... subversion Sep 2009
subversion subversion is a version control system for Unix and Windows. It is independent of any file system or file types to manage It is easy to install Sep 2009
subversion subversion comes in command line (shell) mode. Most commands involve a single program: svn. For ex: svn import ... svn checkout ... svn checkin ... svn export ... Sep 2009
subversion There are many more commands in subversion. They handle updates, conflicts, allow to see differences between versions. The complete list is extensive but well documented. Sep 2009
subversion There is also a GUI front-end for subversion. This front-end is completely separate but closely integrated to the GUI. It's name isTortoiseSVN. subversion is integrated. Sep 2009
subversion Different people prefer different things: Windows users may choose the GUI front-end for subversion. Unix users may prefer the shell environment APL users might prefer to stay in APL Either way the results will be the same: better coordination! Sep 2009
subversion: an example Assuming we have the following workspace named ROBOTS written in Dyalog: It has 2 top level namespaces in which there are 5 (nested) namespaces: • namespace Master: 2 namespaces • namespace Troopers: 3 namespaces Sep 2009
workspace Master Data game Troopers Pound SDuck Robot1 subversion: an example There are 7 namespaces, 5 of which are nested Sep 2009