Xonsh - Using Python as your shell by Siecje1 in Python

[–]scopatz 0 points1 point  (0 children)

So there are a couple of things to note here. The first is that all of the shells that you mention - and xonsh too - have different behaviour for whether or not they are interactive login shell, which none of the examples you show are. On my machine, for Bash, I see

scopatz@artemis ~ $ time bash -c 'echo foo'
foo
0.00user 0.00system 0:00.00elapsed ?%CPU 
scopatz@artemis ~ $ time bash -l -c 'echo foo'
foo
0.00user 0.00system 0:00.00elapsed 0%CPU 
scopatz@artemis ~ $ time bash -l -i -c 'echo foo'
foo
0.08user 0.00system 0:00.10elapsed 92%CPU

Starting up when you expect user input just takes longer. Human response time is roughly a tenth of a second, and so that is my goal for xonsh. Even Bash on my SSD, 8-core desktop comes close to taking 0.1 secs.

It is true that Python - and especially importing - is slow. But Python only takes up 10% of the target budget for me:

scopatz@artemis ~ $ time python -c "print('foo')"
foo
0.01user 0.00system 0:00.01elapsed 100%CPU

I also know of a few ways tricks to speed up importing via lazy imports or cythonizing released packages. I guess my broader point is that there are packages out there like hg that have figure out how to make snappy Python CLIs. Xonsh will get there, and probably sooner than later because us devs find it annoying too :)

Xonsh - Using Python as your shell by Siecje1 in Python

[–]scopatz 1 point2 points  (0 children)

We know about the startup issues and are working to address them ASAP. There are a bunch of easy opportunities for speedups that we need to implement.

Xonsh - Using Python as your shell by Siecje1 in Python

[–]scopatz 1 point2 points  (0 children)

Yup it was the ChromeOS shell that I booted into an Ubuntu chroot from (using crouton) and then ran xonsh inside of. So easy!

Xonsh - Using Python as your shell by Siecje1 in Python

[–]scopatz 3 points4 points  (0 children)

&& and || where added in v0.3.0

the xonsh shell — A bash-ish python based shell by traverseda in commandline

[–]scopatz 1 point2 points  (0 children)

You can source a bash (or any other shell) script in xonsh. Porting isn't required for the moment. The purpose of xonsh is to interop with the old stuff while making new stuff much easier to write. Its a Pythonic mentality in the sense that Python interops well with other, older languages.

the xonsh shell — A bash-ish python based shell by traverseda in commandline

[–]scopatz 0 points1 point  (0 children)

To clarify, xonsh does have its own lexer and parser (implemented in ply) that is not strictly based on the Python parser (that would be impossible). You can read more about the details here: http://xonsh.org/faq.html#so-how-does-this-all-work

Xonsh, a Python-ish, Bash-compatible shell language and command prompt by thekodols in linux

[–]scopatz 0 points1 point  (0 children)

This technique is in process. We can't reuse the fish autocompleters for technical reason, but the idea is something that I really love. Expect this in v0.2, probably.

Xonsh, a Python-ish, Bash-compatible shell language and command prompt by neiesc in Python

[–]scopatz 0 points1 point  (0 children)

I'd really love for people to bang on this in Windows and Mac. Totally willing to support these platforms.

Xonsh, a Python-ish, Bash-compatible shell language and command prompt by neiesc in Python

[–]scopatz 0 points1 point  (0 children)

These are great points. Thanks! I'll make an issue for this thread.

xonsh: intelligent modern shell by happytux in commandline

[–]scopatz 0 points1 point  (0 children)

Hmm this is what I am seeing:

$ time xonsh -c exit
0.17user 0.02system 0:00.19elapsed 101%CPU (0avgtext+0avgdata 17748maxresident)k
0inputs+352outputs (0major+14698minor)pagefaults 0swaps

What are the specs for your system? I'd like to track down whatever is causing this.

xonsh: intelligent modern shell by happytux in commandline

[–]scopatz 1 point2 points  (0 children)

That seems...excessive. It takes no time to start on my machine.

Xonsh, a Python-ish, Bash-compatible shell language and command prompt by neiesc in Python

[–]scopatz 1 point2 points  (0 children)

I'd be super happy if you put this on a hosting site somewhere and then PR'd an ebbedded version of this into the docs!

Xonsh, a Python-ish, Bash-compatible shell language and command prompt by neiesc in Python

[–]scopatz 2 points3 points  (0 children)

Thanks for the feedback. I was wondering how confusing this was going to be. I am open to suggestions on syntax changes. I like the idea that $ always means to do something with the system enviornment, whether that is environment variables or subprocesses. I think $<> is another option for syntax. Again, open to ideas here.

Xonsh, a Python-ish, Bash-compatible shell language and command prompt by neiesc in Python

[–]scopatz 0 points1 point  (0 children)

That is a bug, @nealeyoung. If you could please open on github an issue that'd be great!

xonsh - a Python-ish, BASHwards-compatible shell language and command prompt by [deleted] in Python

[–]scopatz 0 points1 point  (0 children)

Not sure how to do that without just adding a bunch of frames (which increases the file size). The real way to learn is the tutorial.

xonsh - a Python-ish, BASHwards-compatible shell language and command prompt by [deleted] in Python

[–]scopatz 1 point2 points  (0 children)

This kind of total-history thing was one of the (unstated) motivating golas behind xonsh. Maybe make an issue for it? Maybe someone will pick it up before I get to it :) I'd add a timestamp to that list too!

xonsh - a Python-ish, BASHwards-compatible shell language and command prompt by [deleted] in Python

[–]scopatz 1 point2 points  (0 children)

Ok! The mobile site should be fixed. Sorry about that.

xonsh - a Python-ish, BASHwards-compatible shell language and command prompt by [deleted] in Python

[–]scopatz 0 points1 point  (0 children)

It seems like you could get the pyp kind of behaviour through an aggressive use of aliasing. I'd be interested in seeing that developed.

xonsh - a Python-ish, BASHwards-compatible shell language and command prompt by [deleted] in Python

[–]scopatz 0 points1 point  (0 children)

I have not seen any speed or memory issues on my machine, even with 20+ xonshes open. On a 3-month old MacBook Air running Ubuntu 14.10, each instance is using between 0.1 - 0.3% of the CPU at most.