Python/Unix Hybrid Demoed at PyCon (xon.sh)
A new shell "combines the Python language with features of Bash Unix and the fish and zsh shells," according to InfoWorld. An anonymous reader writes: Pronounced "conch," but spelled Xonsh, it runs on Linux, Windows, and Mac OS X systems, bringing Python libraries to the command line -- for example, the ability to use regular expressions when globbing files. "The first thing you'll notice about Xonsh is that it's really meant to be used as a general-purpose shell," the lead developer explained in a presentation at PyCon. "But on the other hand, it really is Python, so you can do things like add two numbers together."
They're describing it as "a Python-ish, BASHwards-looking shell language and command prompt...a superset of Python 3.4+ with additional support for the best parts of shells that you are used to, such as Bash, zsh, fish, and IPython...the superglue that bonds Python to a command-line interface and other shells."
They're describing it as "a Python-ish, BASHwards-looking shell language and command prompt...a superset of Python 3.4+ with additional support for the best parts of shells that you are used to, such as Bash, zsh, fish, and IPython...the superglue that bonds Python to a command-line interface and other shells."
It's cleverly named "conch", like the history of other shells (Korn shell, Bourne Shell, Bourne Again Shell (BASH), C Shell). I kinda wonder why there isn't a Taco Shell....
This is awesome! Wait, it's Python 3?
NOOOOOOOO
That's okay, I'll have your sloppy seconds.
W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
Why is the title of this article "Python/Unix Hybrid Demoed at PyCon" when it is a Python/Bash hybrid? Bash != Unix
This is such a great idea. I've always wanted to remove the separation between simple execution scripts and complex code which is difficult to understand. it really bugs me that we have these "standards" which simplify portability and make things clear.
Ideally in a few years, we will have inscrutable, half-assed code all over the execution space. This will give people the opportunity to learn python so they can debug simple execution wrappers. EXCELLENT!
But if it's not ready yet, we don't have to wait for it... we can simply replace all the .sh files on our systems with .pl files. That'll make everyone happen, too, and we can start today!
Python's not as bad as it could be. It's tedious, but relatively clear. I think it's a fine language for other people to program in.
Unix is not a shell (if it were, we would not need shells) and Xonsh/bash/Python are not operating systems.
Many people know that Perl is spelled "perl" and not pearl, but a lot of people don't know it's pronounced "Gob gipple fish waddle". So if you have been wondering while real perl monks ignore you when you ask a question about perl now you know.
Seriously, if you want a shell with magic powers just use perl. it's exactly what it was originally built for. It is wood chipper to pythons battery powered hedge trimmer when it comes to sysadmin tasks. It's the ideal sys admin and glue language.
Some drink at the fountain of knowledge. Others just gargle.
What is it with all this "it's spelt this way, but pronounced that way" stuff?
Just give it a not-so-clever name nobody cares.
Hipsters. As indicated by them taking the effort to call out "Pun in name" as being a distinguishing feature.
I am Slashdot. Are you Slashdot as well?
is "Bash Unix"?
Is a self referential acronym Hipster?
Some drink at the fountain of knowledge. Others just gargle.
Shouldn't that be Christonch?
1. What is so awesome about adding two numbers in the shell?
2. In any case, bash can do it too -- try echo $((15+7)).
3. One of the selling points of bash is that it needs to be fast for power users, so it uses cd instead of change_directory(). One of the selling points of Python is that readability counts, so it would choose change_directory() over cd. How do you plan to reconcile the two approaches?
My first program:
Hell Segmentation fault
How about NO?
This is yet another example of stupidity in the open source community. You don't get to define how a word sounds. The way you write it defines how it's said.
And even if you say "Xonsh", it sounds stupid anyway.
There's a reason people don't use "GIMP" in businesses. Nobody can go see his boss and asks to replace Photoshop by "GIMP".
perl can look rather odd if you are not used to it.
Yes but in this instance it looks like Bash! and Awk and Sed and Grep. So for a shell, the syntax is just like what you are replacing.
Some drink at the fountain of knowledge. Others just gargle.
"Pronounced "conch," but spelled Xonsh, ..."
Why give it an annoying name that makes it more difficult to communicate?
Unix is a family of OSes, Python is an interpreted language.
How can a command line shell be a hybrid between an OS and a language?
You insensitive GUI clod! ^C^C^C^D!
P.S.
PySh whould have been a much better prank, at least in Italian!
Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
Like PEP 8 clearly says,
Use 4 spaces per indentation level.
That's it. That's all there is to it. It's simpler and clearer than the rules for just about every other programming language out there.
Anyone who can't handle using 4 spaces is a lost cause.
I develop in python, java, and objective-c... you know what I hate more then python? Putting parenthesis around every single conditional statement. Once you work in python for awhile and go back, you start to notice how many brackets there are in the other languages.
Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
Python's not as bad as it could be. I think it's a fine language for other people to program in.
That's faint praise. People said similar things about COBOL. You could always read what someone else wrote ...
This is a really nice shell. From it's features it's basically comparable to Fish shell. It's probably not compatible to the Bourne shell, so not really good to execute Shell scripts. But the same is true for Fish.
What I am missing is a good type system and a possibility to exchange data between processes in a way that is more structured than plain text. For the moment it is really hard to even put the output of ls into any other process in a reliable way
Bash is a poorly designed language, compared to Python. Bash was great a few decades ago, but it is no match to Python's expressiveness and massive libraries.
If I want the computer conch and am not interested in seeing a bunch of pictures of shells, I know what to type.
... you can do things like add two numbers together.
You mean like I was doing with /bin/sh 25 years ago?
I develop in python, java, and objective-c... you know what I hate more then python? Putting parenthesis around every single conditional statement. Once you work in python for awhile and go back, you start to notice how many brackets there are in the other languages.
You'll also notice how other languages need a semicolon after each line, whereas Python (and Julia, Fortran etc.) understands line breaks. I guess early programming environments had a good reason for cramming multiple statements on one line, but now that we can use line breaks for readability, it might as well be a part of the syntax.
Escher was the first MC and Giger invented the HR department.
You don't indent your code blocks? I pity the fool who has to maintain it.
It will literally take any amount of spaces or a single tab character as one level of whitespace. Hell, it doesn't even need to be consistent, you just can't mix, and when outdenting it has to match the level you're going back to. If someone can't manage their whitespace, I wouldn't want them anywhere near real code.
Sounds like someone got jealous of Powershell and decided to a "me too!" shell for the other OSs. Meh.
Agreed. Once you work a lot on all these languages, Python feels a lot more like pseudo-code and therefore more natural. Java has some things you need to do to satisfy the grammar of the language itself, and more so for Objective-C. This is good in certain larger projects with many people, but it depends what you want to do.
Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
People xonshtantly mispronounce these things.
Quay.io? It's not "kway", it's "key".
"Conch" isn't fucking "konsh", it's "konk". Like the devs need on the fucking head.
More info here: http://xon.sh/
Some of it looks really cool, python + sh is a great idea. Though some of it looks ugly (http://xon.sh/bash_to_xsh.html), the alternative to '$?' for example.
If someone can't manage their whitespace, I wouldn't want them anywhere near real code.
People shouldn't have to worry about and/or manage their white space. That Python cares is a stupid feature of the language. Yes, at some level, it's elegant, but not additionally useful and is more a result of Guido's ego than anything else. The language would be just as powerful, useful and productive using block delimiters but w/o the fucking around with problems caused by a extra or missing space on a line. I'll stick with Perl.
It must have been something you assimilated. . . .
Let me rephrase that: if someone can't keep indentation straight, especially with the fact that an editor is doing most of the work anyway, I wouldn't want them checking in code for any language regardless of whether the white space was syntactically significant or not.
I develop in python, java, and objective-c... you know what I hate more then python? Putting parenthesis around every single conditional statement. Once you work in python for awhile and go back, you start to notice how many brackets there are in the other languages.
Parentheses != brackets
Just saying.
You'll also notice how other languages need a semicolon after each line, whereas Python (and Julia, Fortran etc.) understands line breaks. I guess early programming environments had a good reason for cramming multiple statements on one line, but now that we can use line breaks for readability, it might as well be a part of the syntax.
I prefer languages which require statements to be terminated by a semicolon (C, C++, Java, Perl, etc.) — and not because I cram multiple statements onto a single line all the time. I just find it much easier for my mind to parse the syntax. I also prefer poetry that places a period at the end of a sentence rather than making me think about where the sentence ends.
It's not pronounced conch, it's pronounced zonsch.
Jesus, seriously? Zonsch? That's even dumber than being pronounced conch. At least if it were spelled Xonsh and pronounced "conch" they could claim that the X is a (chi) like TeX does.
yes, and I meant to say brackets. Am I not allowed to increase the scope of my comment in the next sentence?
Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
yes, and I meant to say brackets.
Did you also mean to confuse "then" with "than"?
I'm a minority race. Save your vitriol for white people.
Let me rephrase that: if someone can't keep indentation straight, especially with the fact that an editor is doing most of the work anyway, I wouldn't want them checking in code for any language regardless of whether the white space was syntactically significant or not.
That I can definitely agree with.
It must have been something you assimilated. . . .
Expect it to have its name ripped to pieces (pronounced pisces, for the heck of it). Which pronunciation guide did they use? Is there a language in the world that natively makes it sound right like that?
"Everybody's naked underneath" -- The Doctor
Personally, I would rather lean Cobol than Python, but that is just me.
Sent from my ASR33 using ASCII
They clearly define the block no matter how you format it.
More than once I've seen a python program where someone has accidentaly deleted tabbed whitespace on a end line in a block and moved that line into the outer block and of course python says nothing. But now the program is broken. Try removing a bracket in C/C++/java and see what happens.
Whitespace as a block delimiter is a retarded idea, always has been, always will be.
... not as bad as it could be...
Wish I could say that about the upcoming election...
You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
You want to pronounce it 'conch', then spell it that way. Not starting with a consonant pronounced like a 'z'. Enough with the cutesy brain damaged fucking names.
-- I ignore anonymous replies to my comments and postings.
And the really sad part is you still don't understand why Python is fucking retarded for not having them all over the place.
Your whining about 2 characters which make it infinitely more readable.
Congratulations, in 10 years, you'll have enough experience to realize how stupid Python is.
Python does all sorts of stupid shit, it likes to imply via white space changes rather than solid well defined delimiters.
The fact that white space controls program logic and loading it in the wrong editor or a bad copy and paste can result in code that executes without error even though it's doing something completely different than intended, that's what you need ... More unpredictability and harder readability.
Idiot
Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
Yeah I can't really get that excited about a programming language either way. I just use the tool for the job.
Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
I also prefer poetry that places a period at the end of a sentence rather than making me think about where the sentence ends.
good point
but if you always put a line break between statements
then a period is redundant
Escher was the first MC and Giger invented the HR department.
Whoa.
You prefer the semicolons because that's what you learned with and you've been doing for a while. If you had learned with line breaks, you would prefer it instead. Personally, it's just one less character I have to type virtually every line.
"Be particularly skeptical when presented with evidence confirming what you already believe." -
This is probably the most insightful comment in this whole thread.
"Be particularly skeptical when presented with evidence confirming what you already believe." -
> Never understood the attraction to the bash cli. Good for scripting, though (when Perl is missing).
Often a lot better than Perl. Perl is a mediocre operating system that lacks a lightweight text-parsing/scripting ability.
I'm not repeating myself
I'm an X window user; I'm an ex-Windows user
It says right on the homepage:
the xonsh shell
~ It is pronounced zonsch ~
Either way, it's still terrible name.
Pretty sure that's supposed to be something less than praise of any kind.
Does the author of this posting not realise that "UNIX" isn't the same as bash or whatever you use for you login shell? Anyway, in UNIX (incl. Linux), you can use anything as a login shell, including less productive commands like "/sbin/shutdown -r" and "/usr/games/sl". This is not unique to UNIX, BTW - I once worked with an IBM product called AS, which had a fascinating command that could log you out and then log in as a different user; well, I say different - this included the same user, of course. You could also specify this command as you login shell, and if you didn't use a password, you would then have a loop that could only be stopped by atking the whole of AS down.
Bash was not "designed" at all. It is a hack to bourne sh adding a crazy quilt of spliced-on features while not totally destroying compatibility all the way back to Unix v7.
I agree, this is the one stupid thing about the language, I definitely prefer white space being completely irrelevant. But everything else about Python fucking rocks, so meh, you get used to it. Honestly I can't remember the last time it was an issue for me, and I use Python A LOT.
Only crack the nuts that crack. You don't put the ones that don't crack in the sack.
I love Python (disclaimer). But semicolons in other languages are more about splitting lines, not combining them, in my experience. That's a nice feature about being white space agnostic. Occasionally, like when splitting a string across multiple lines, you have to escape the line break, but you have to do that in Python as well sometimes, so it's a wash.
Only crack the nuts that crack. You don't put the ones that don't crack in the sack.
I have a different vision for future shells: https://github.com/ilyash/ngs/ . Using one of the existing languages has obvious advantages but it's not a domain-specific language for system tasks so it will never be optimal for that. Making DSL on top of an existing language also does not sound like an optimal solution. My approach is a domain specific language which specializes on system tasks and has small simple bash-like syntax mode and "normal" programming language syntax mode. The two modes are easily mixed.
but if you always put a line break between statements then a period is redundant
Not true. It would still be ambiguous whenever a line wrapped to the next line.
You prefer the semicolons because that's what you learned with and you've been doing for a while.
You would be wrong on that. I prefer semicolons because they make statements unambiguous.
If you had learned with line breaks, you would prefer it instead. Personally, it's just one less character I have to type virtually every line.
You would be wrong on that, too. I actually did learn coding originally in a language that used line breaks for the end of a statment. When I learned C, and switched to semicolons, it was a breath of fresh air for me.
I love python, I love bash and shell scripting, but why would I want this? I usually just start a python shell if I want python's more advanced string parsing.
but if you always put a line break between statements then a period is redundant
Not true. It would still be ambiguous whenever a line wrapped to the next line.
True, and this is why linebreak-sensitive languages need an extra character for wrapping long lines. Arguably, it's not very elegant, but it's tolerated in many languages, presumably because it happens so rarely; the total count of line-noise characters is lower than peppering everything with semicolons.
Escher was the first MC and Giger invented the HR department.
I love Python (disclaimer). But semicolons in other languages are more about splitting lines, not combining them, in my experience. That's a nice feature about being white space agnostic. Occasionally, like when splitting a string across multiple lines, you have to escape the line break, but you have to do that in Python as well sometimes, so it's a wash.
As I mentioned in another post, most lines in practice won't need splitting. So while the escape in Python (or shell scripts, etc.) is ugly, the total amount of ugly punctuation is still lower. It's also nice that you need to do a little extra work to deal with the exceptionally long lines, and perhaps consider if that part of the code needs cleaning up.
Escher was the first MC and Giger invented the HR department.
Interesting. So a \ character in bash, for example, or in the C preprocessor, is sort of like an anti-line-break.
Only if you never use a line break for a comma
like you did above