Arc Forumnew | comments | leaders | submitlogin
4 points by Pauan 2761 days ago | link | parent

Also, another interesting point: if you move away from our typical text-based ways of editing code, it may be possible to achieve convenience and performance:

http://unisonweb.org/2015-05-07/about.html#post-start

In Unison, you do not need to import code. That's because every variable is actually the hash of its definition, and when you use that variable in your code, it automatically "imports" the hash. That also means that your code contains only the variables that you actually use.

You do still lose some correctness, though. As an example, if you have a function and you change the definition of that function, it will create a new hash (for the new definition), but the old hash is still being used in your code.

Which means that you have both the old version of the function and the new version of the function existing at the same time. So you need to manually update all of your code to use the new hash:

http://unisonweb.org/2015-06-12/editing.html

This problem hasn't been solved yet, but there's been discussions about providing some tools that can automate certain tasks (such as replacing an old hash with a new hash, in your entire code base).

Assuming the above problem is solved, it may actually be possible to have convenience, correctness, and performance with an auto-import system.

But Unison's approach doesn't work with existing languages, so my point that "the language needs to be designed specifically for auto-imports" still stands.