3

I've been experimenting with SALT but am encountering consistent Load problems that seem to only affect raw function-trains. I hoped for any advice on ensuring all functions Load correctly.

To illustrate, in a clear workspace I'll create some example functions for converting hex and octal. Some are dfns, others are raw trains:

FromOct←8⊥⊢
ToOct←(FromOct⍣¯1)
FromHex←{16⊥⍵}
ToHex←{((16⊥⊢)⍣¯1)⍵}
HexToOct←ToOct FromHex

Initial salt state:
⎕SE.SALT.List '/path/to/salt'
Type Name Versions Size Last Update

Then Snap the workspace:
⎕SE.SALT.Snap '/path/to/salt -clean -loadfn'

** WARNING: ⎕LX is empty
 #.FromHex  #.FromOct  #.HexToOct  #.ToHex  #.ToOct 

⎕SE.SALT.List '/path/to/salt -type'

 Type  Name      Versions  Size  Last Update         
 Fn    FromHex               25  2021/05/18 17:08:32 
 Fn    FromOct               25  2021/05/18 17:08:32 
 Fn    HexToOct              46  2021/05/18 17:08:32 
 Fn    ToHex                 36  2021/05/18 17:08:32 
 Fn    ToOct                 31  2021/05/18 17:08:32 
 Fn    load_ws              537  2021/05/18 17:08:32 

And check what the load_ws function is importing:
⎕CMD 'cat /path/to/salt/load_ws.dyalog | grep "^ Load''"'

 Load'"/path/to/salt/FromHex" -target=#'       â #.FromHex
 Load'"/path/to/salt/FromOct" -target=#'       â #.FromOct
 Load'"/path/to/salt/HexToOct" -target=#'      â #.HexToOct
 Load'"/path/to/salt/ToHex" -target=#'         â #.ToHex
 Load'"/path/to/salt/ToOct" -target=#'         â #.ToOct

In a clear workspace, run the load_ws:
⎕SE.SALT.Load '/path/to/salt/load_ws'
load_ws

*** could not fix "/path/to/salt/FromOct.dyalog"
*** could not fix "/path/to/salt/HexToOct.dyalog"
*** could not fix "/path/to/salt/ToOct.dyalog"

The dfns load fine, the trains fail.
A ready workaround is to wrap with tradfns or dfns, but this is very undesirable.

Any thoughts on getting SALT to Load these kind of functions correctly?
Thanks

Adám
  • 6,573
  • 20
  • 37
alexgibbs
  • 2,430
  • 2
  • 16
  • 18
  • 1
    I don't think there is any reason to use SALT, it's obsolete, and I think Dyalog itself recommends you use LINK instead. I'm not sure its worth tracking down why it doesn't work. – Paul Mansour May 18 '21 at 18:22

1 Answers1

4

As per the current SALT User Guide:

Nameclasses 3.3 (primitive or derived function) and 4.3 (primitive or derived operator) cannot be manipulated using SALT – attempting to do so can result in a loss of data.

As mentioned in Paul Mansour's comment, Dyalog Ltd. recommends transitioning from SALT to Link, especially when using Dyalog APL version 18.1, due to be released in the upcoming months. However, note that even Link does not currently handle tacit functions:

Functions, operators and namespaces without text source (⎕NC of 3.3 or 4.3, namely derived functions/operators, trains and named primitives), are not supported.

As opposed to SALT, which is not scheduled to receive any major feature additions, this is likely to change in the near future.

While it is awkward to wrap tacit functions in tradfns by hand, the “Lazy” library makes this a breeze.

Adám
  • 6,573
  • 20
  • 37
  • 1
    Though I confess to having hoped for some way to get SALT to work, this is a wonderful answer; the citations and context help reasoning about the problem and the future. Thanks for the clear answer and the alternatives to explore. I'll look to Link. – alexgibbs May 19 '21 at 04:22
  • As a P.S., this is an awkwardly public forum for an unrelated comment, but I believe I recognize your name, as a RIDE author? Being new/amateur with dyalog, it is not an overstatement to say RIDE has single-handedly kept me going. Thanks for all the work, it makes a big difference. – alexgibbs May 19 '21 at 04:23
  • @alexgibbs I'm but a minor contributor to RIDE. As for the forum, you may want to visit [The APL Orchard](https://chat.stackexchange.com/rooms/52405) Stack Exchange chat room. – Adám May 19 '21 at 04:25