2010/3/4 Simon King <simon.k...@nuigalway.ie>: > Hi! > > On Mar 4, 8:35 am, Robert Bradshaw <rober...@math.washington.edu> > wrote: > [...] >> I think we can have the names there without importing all the code >> behind everything. With tab completion, a huge global namespace isn't >> that bad. > > How would this be possible, technically? I mean, is there a technical > solution that does not require python to be patched? > > Perhaps modifying the sage preparser: > - At startup, virtually nothing of sage.all is imported, but the > names of things in sage.all are known, and it is known where to import > them from. Let SageAllNames be a dictionary that associates the name > with the location for import. > - The preparser could detect whether a given command line contains an > identifier N outside an import or assign statement, with N in > SageAllNames.keys(). If not globals().has_key(N), the preparser would > prepend "from %s import %s"%(SageAllNames[N],N) to the given command > line. > - It would be easy to modify tab completion so that > SageAllNames.keys() is accessible to tab completion. > > Would that be feasible? > > I think it could reduce the startup time considerably. A user wouldn't > notice any change during an interactive session. And since it only > concerns the preparser, it would not break any code. > > Cheers, > Simon
After reading the continuation of the thread, the first thing that come to my mind was unexec. A quick google search showed a few matches, and an attempt from 2003, that apparently had a few regressions (in signal and thread tests), and also, in the message I found, the fact that the unexec code was gpl was also considered a problem. I know only as from overview what unexec does; used by emacs and xemacs; basically, a way to dump a running program, and reload it at a later stage, much faster. Does anybody know if there are any new approachs in it (I only found some emails from 2003 in a google search...) ? I believe it may require significant work if starting from emacs/xemacs unexelf.c to work correctly with shared modules/libraries, etc. But, it could be a way to to drastically reduce sage load time, but possibly, by generating a very huge image file. Paulo -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org