Hacker News new | past | comments | ask | show | jobs | submit | hbrid's comments login

Interesting but I haven't seen any killer feature yet that makes me want to get accustomed to this shell. Command level completion for arguments has existed in zsh, aliases being a sort of dictionary is kind of interesting but not too useful (just some familiar syntactic sugar). Mutliline input isn't new, csh can do it, bash can do it, so can zsh. Admittedly the ability to duck type and evaluate numerical expressions with "let" is kind of nice but nothing too special. Regexes for globbing files might be a new one, certainly a useful one that I'd otherwise be writing special awk or python to handle.


> Regexes for globbing files might be a new one

Regexes in particular are new AFAIK, but zsh's extended globbing is already extremely powerful: http://www.refining-linux.org/archives/37/ZSH-Gem-2-Extended...

Bash also comes close, iirc.

But we use shells because of their ubiquity, not because of how nice scripting languages they are (they aren't). So I don't see myself ever using xonsh – I'm already glad when a system has bash and I don't have to figure out what "posix /bin/sh compliant" is supposed to mean this week.


I think the big plus is that you can use a proper programming language in the shell.


I've longed for a language that can run both pipelines of commands with the conciseness of UNIX shells and have control structures and arithmetic as elegantly as Python...


Not to get off on too much of a tangent, but you may be interested in concatenative programming languages. They’re a variety of stack-based programming languages with a functional flavour, in which the default style is a sort of data pipeline. For example, in Factor[1]:

    ! Just some imports.
    USING: accessors smtp ;

    ! Create a new email object.
    <email>

    ! That object is piped implicitly to these setter words.
    ! E.g., >>from: ( email new-address -- email )
    "alice@example.com" >>from
    { "bob@example.com" } >>to
    "Coffee?" >>subject
    "You pick the time and place." >>body

    ! Pipe that object on to the “send-email” word.
    send-email
Note how no local variables are necessary for simply plumbing data around—although of course you can use them if you want.

The weirdest thing is probably that arithmetic in most concatenative languages is written in postfix, which you may find off-putting. But it’s no worse than Lisp’s prefix notation, and has some other benefits.

Factor also has an excellent interactive environment; the whole thing feels like a Lispy Smalltalk.

[1]: http://factorcode.org/


>arithmetic in most concatenative languages is written in postfix

Postfix? I'm assuming a typo here but not sure what you meant.

Edit: Ah, I'm guessing it was supposed to be postscript. Makes more sense now.

Looks like an interesting language style though, I've been looking for a language that has the bash style piping baked into the language.


Prefix/postfix/infix refer to the order in which you write operations and their operands—equivalently you can think of preorder/postorder/inorder traversals of the syntax tree.

    AST          +
                / \
               *   5
              / \
             2   3

    Infix    2 * 3 + 5
             2 times 3 plus 5.

    Prefix   + * 2 3 5
    Lisp     (+ (* 2 3) 5)
             The sum of the product of 2 and 3, and 5.

    Postfix  2 3 * 5 +
             With 2 and 3, multiply. Then with 5, add.


Ahh, understood now. I figured postscript as it's also a concatinative programming language.

I read postfix as in the mail server not as a synonym of suffix, thanks for the clarification.


> synonym of suffix

Antonym, actually. Prefixes are literally on the other end of things than suffixes are ;)


He's talking about postfix, not prefix. It's closer to being a synonym of suffic.


Oh shit, true. My mistake. Sorry!


You can do this with Tcl ! I wrote an extension called "pipethread" to make UNIX shell pipelining more natural. It uses threads instead of processes but otherwise operates pretty similarly.

Example: set lsOutput [pipethread::pipe exec ls | exec tac | foreach line { puts $outchan "[string length $line]:$line" } | { gets $inchan line; puts $outchan $line }]

Usage: https://chiselapp.com/user/rkeene/repository/pipethread/arti...


That language is Ruby.


Well, there are some other as well.

TCL works nice as a shell and is very elegant as a programming language. The famous equivalence of code and data is visible here, while still syntactically looking pretty normal.

Scheme (via https://scsh.net/about/about.html) is also worth looking into. S-exp based syntax looks strange at first, but you get used to it rather quickly.

Emacs Eshell is very similar to xonsh, but with Emacs Lisp instead of Python.

On Windows PowerShell is also a choice. It's both a shell and a sane, procedural programming language, with full access to dotNET.

Tulip (https://github.com/tulip-lang/tulip) express goals are to be good for both shell work and programming.

On the other hand, jq (https://stedolan.github.io/jq/) is just a DSL, but it turns out it's ok for doing more advanced work if you're familiar with functional programming.

Not to mention, almost every language with a REPL can be made into a shell/programming environment given enough library support. For example Python with IPython is a very decent shell and I think OCaml with utop could also be.


For me, this is a shell that retains all the interactive command structures I know from sh (e.g. job control and redirection), and adds sane globbing and looping. As long as it retains familiarity with what I already know and use, it doesn't need a killer feature for me because switching costs are low.


Please turn JavaScript on and reload the page.

DDoS protection by CloudFlare

...um, no!


I don't see why Cloudflare would require JS to be on


It's what they use to try and detect if your browser is a real browser, not a fake one. Which is very hard to determine without Javascript.


It looks like an important goal

Maybe they can do it better and not turn people without JS away (at least while accesses are at a regular level)


Something like hashcash?


To fingerprint the visitors.


EDIT: Why did someone flag this? This is literally what CloudFlare said they do – they fingerprint your browser, to track you, and find out if you are a bot DDoSing them – or if you have a normal browsing behaviour.

For that to work they need to fingerprint and track you. Which is why they said they block users with NoScript or on TOR.


Cloudflare surreptitiously injects its own Javascript into pages it serves, including NSA malware.


Something tells me Matt Prince would sooner shut down CF than bow to NSA demands.


If that were true, he wouldn't have built something so perfect for abuse.


What if shutting down was not an option?


Looks very good. I got stuck learning elm at about the point I wanted to integrate a call to a javascript function. Can't for the life of me remember if that involved signals or not. Will definitely try the tutorial(s) again when I get some more time because I really was enjoying everything else about the language and developing in it.


Great read and I've passed it on, it may come in useful for me or someone I know some day. Just want to ask a few questions: 1-What triggers this response? Are you just swimming casually when all of a sudden this kicks in? 2-For those who have experienced drowning, what stopped you from swimming normally? I've always been a good swimmer and hardly ever had problems in the water. There was one year when I was 9 in a wave pool in Rhodes, there were no more Rubber Rings so I swam in, I was out of my depth and I got hit by a wave I miss timed, and couldn't correct my timing so I started to panic realising I was about to drown, luckily a woman close by saw this and pulled me up...drowning scares the hell out of me.


I'm interested in this as well.

I have had a few very close calls, but never had the drowning response, even when severely out of breath and panicking.


Makes me wonder whether NSA is seriously involved. If they were to have vacuumed up and provided all these deleted emails to the FBI in the course of this investigation, that will have been the absolutely most benevolent application of broad surveillance powers I can think of.


The NSA quietly and illegally helping an investigation into a presidential candidate in an election year is pretty much the antithesis of benevolence, regardless of what you think of Hillary. That kind of activity is basically worst-case scenario, war-on-democracy level stuff.


Postgres is still going through the motions of a transaction for every query you issue it even if nothing else but that transaction is happening on the server. So obviously if you add extra load in the form of writes, you may slow your reads down, but this was not a full benchmark, but instead a comparison of the same workload running against multiple versions of Postgres.


Huh, that's funny to see a comment of mine copied word for word from Reddit: https://www.reddit.com/r/programming/comments/4in70l/postgre...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: