Dyalog / link

Source code for Link – the built-in component that enables the use of text files as the primary storage mechanism for APL source code
https://dyalog.github.io/link
MIT License
19 stars 12 forks source link

Add a namespace crawler background process to check for APL names that have been changed by APL primitives #51

Open stampes opened 5 years ago

stampes commented 5 years ago

[]EX and []FX (and probably also []OR and others) breaks the linking to files. The APL must give an (optional) warning when a link is broken

abrudz commented 5 years ago

Just a note that there are a lot of things to consider here, including:

  1. Scope: Potential link-breakers include ⎕EX ⎕FX ⎕FIX ⎕CY ⎕NS ⎕NA, )erase )copy, and maybe most controversial;
  2. How would we warn the user? A GUI pop-up? A message to the status window? An error? Printing to the session? What do we do if there is no interface?
  3. How would code that knows what it's doing prevent message spam?
  4. Performance: Do we really want to check for a link all the time?
  5. Assignments: When reassigning, the ref-count is decremented, but it may not be feasible to do a link-check at the time.
stampes commented 5 years ago

As I wrote earlier I am mostly worried about []EX, []FX and []OR. Any tool that the developers make that beautifies have to transform their functions to text and back. These will have to be LINK aware. But in general I find it very unhealthy to advocate for use of files - but you still have to nurse every single system call to ensure that they do not break the link. If you encourage people to use the APL with files then you have to ensure that all their work gets saved in files - first time they loose their work then they will stop using this mechanism.

nicolas-dyalog commented 3 years ago

This is simply not feasible - at least as long as Link is an APL tool rather than an integrated interpreter feature.

The workaround is a namespace crawler background process that keeps crawling through APL names to see if any has changed, compared to file.

Unfortunately this is much more heavy-weight than haveing a file crawler (see issue #88 ).