#21: command line option parsing
-------------------------------+--------------------------------------------
       Reporter:  was          |         Owner:  jdemeyer  
           Type:  enhancement  |        Status:  needs_work
       Priority:  critical     |     Milestone:  sage-6.0  
      Component:  interfaces   |    Resolution:            
       Keywords:               |   Work issues:            
Report Upstream:  N/A          |     Reviewers:            
        Authors:               |     Merged in:            
   Dependencies:  #9958        |      Stopgaps:            
-------------------------------+--------------------------------------------

Comment (by kini):

 jdemeyer: I think you misunderstand. Currently, `sage` is a bash script,
 which checks some options, then starts up Python to handle the rest
 (separately in various different code branches, no less). What we're
 proposing is the following scenario:

 `sage` is a Python script. `sage-sh` is a bash script. `sage-sh` does not
 parse any arguments - it just sources sage-env, does whatever other setup
 required, and dumps you in a shell. Any arguments to `sage-sh` are just
 passed to that shell. As such, `-c` would allow you to specify a command
 to execute in the Sage shell, such as `gap` or `gp`. `sage-sh` does not
 load Python unless you happen to give it `-c python` as an argument.

 `sage` is directly run by Python because it is a python script. `sage
 --sh` (or probably `sage sh` because of rohana's subcommands idea) will
 cause Python to start up, parse the arguments, and then exec the bash
 script `sage-sh` (i.e. be very slow).

 The argument would be that if you need something to happen fast and want
 to avoid starting up Python, or are the release manager and are doing
 things with Sage in a state where Python doesn't exist, you're probably
 writing scripts anyway and can afford to write out `sage-sh -c sage-pkg`
 (or whatever the package manager command ends up being) inside your
 script, or make an alias in your shell. If you're a normal user just
 typing on the command line, you won't care that Python had to start up
 just to parse your command line arguments.

 The benefit of doing this is that the entire normal startup chain of Sage
 can be made pure Python, which is easier to maintain and might be more
 portable (?).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/21#comment:39>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to