In most programming languages, most programs begin with
import statements, to import code nearby the current
program file or that have been downloaded by dependency
management.
I think this solution is not good enough. Downloading code
from the internet and getting it to work is a painful
experience. If you've ever tried to
download a Java application that uses Maven or Gradle, it
breaks consistently. Or NPM or Ruby gems.
Today if you want to make a React application with create-
react-app, you have to
download at least 1,568 dependencies. You need a program
(create-react-app)
to
generate an empty project.
I propose an alternative dependency management strategy.
We have a registry of keywords and each library can
register
keywords, which are entrypoints to APIs. We have a global
namespace for APIs. You're not allowed to use APIs that are
reserved.
We can produce an API search server by spidering codebases
for unique exported symbols. These are what would be
reserved.
You would get a warning if you try write code that tramples
an existing API.
When a program is interpreted or compiled, the central
registry for the symbol key word is looked up and matching
APIs are found and downloaded to the system.
Alternatively an API can be searched for based on API call
patterns.
You don't need import statements anymore.
I can just use React.createElement and have React pulled in
automatically.