5 ms·
The Dune Shell
- deleted 2y ago[deleted]
- hi-v-rocknroll 2y agoI like the ideas of Dune and Nu, which I think were trailblazed by powershell to a degree. The problems of pure *NIX pipe philosophy with text as the lingua franca were persistent parsing problems and escaping. However, the problems of going to far in the way powershell went was it was too radical having to reimagine/replace/relearn almost everything, and generally more difficult to accomplish simple text manipulation. Nu at least maintains most of the *NIX shell UX. Maybe at some point in the future, we will reach parity to where there will fusion of the main DSLs, shells, and programming languages into a runtime interaction system that is somewhere between psql, Erlang shell, nu, and Squeak where there is programming language-OS parity obliterating the distinctions between programming languages, command shells, and DBMS shells. One can dream of a future where perhaps it will be possible to write a function, library, or program in any language one chooses and call it from any other shell or language without swig or ceremony.
- wodenokoto 2y ago> too radical having to reimagine/replace/relearn almost everything I switched to zsh because at the time I thought it had better autocomplete, but honestly I use it as I would bash. And I don't think it was worth it to change a little bit. To change shell I think the change _should_ be radical.
- idunnoman1222 2y agoBut it is bash…
- MrDrMcCoy 2y agoNot quite. It has some incompatible default settings, and is missing a small percentage of obscure bash features that I sometimes like to rely on. I'm sure I could do it all with zsh just fine, but it would be more work for me mentally.
- idunnoman1222 2y agoIncompatible with what? Which obscure features? I can’t actually name them either
- MrDrMcCoy 2y agoIt's been several years since I've dug into it and implemented the features I cared about for my personal shell in bash, but I recall that implementing a function to determine if an item exists in an array is significantly shorter and easier in bash 5 due to a feature that is not present in zsh. Probably too obscure for most people to care about, but at the time I was maintaining some rather preposterous bash glue code that relied on that, and compensating for zsh on some people's machines was tedious.
- abhinavk 2y agoTry fish or xonsh.
- kitd 2y agoA day or so there was this: https://news.ycombinator.com/item?id=41558081 https://news.ycombinator.com/item?id=41558081 Imagine your shell's model not being a command line console but a spreadsheet!
- actionfromafar 2y agoShades of Q, APL and other array languages, but visual by default. Maybe an APL spreadsheet-shell would fit the bill? :-D
- ghayes 2y agoI wonder if there's a good middle ground where unix commands could opt into a structured output, and until they exist, you could shim via `ls -la | shim "ls -la" |> ".modified_time"`. Then one day it could be `ls -la |> ".modified_time"` when structured data is supported natively by the program or command. I feel every project ends up dying since it needs to support every command all at once to be useful.
- actionfromafar 2y agoTo me the silly hang-up for PowerShell is none of that, but the strange syntax. I'd taken (even!) JavaScript-ish syntax over that.
- packetlost 2y ago> One can dream of a future where perhaps it will be possible to write a function, library, or program in any language one chooses and call it from any other shell or language without swig or ceremony I mean, there's a reason text was selected, it's the lowest common denominator. What you're asking for is universal FFI, which we already have that for the most part: C. The problem ultimately turns into runtime and resource management issues when crossing language boundaries, that is, unless you use OS primatives (pipes, sockets, shared memory, processes, etc.) and use message passing/pipelines exclusively. Then we're back to plaintext. There's a ton of non-printable characters in ASCII that are useful as delimiters for non-keyboard interactive programs that are largely vestigial. One could at least consider reusing them for delimiters and special control sequences for message passing, but without some sort of standardization it's limited in practical use.
- Brian_K_White 2y agoThe problem with those ascii values is editors don't display them and there are no keyboard keys to type them. The reason csv exists is because you can actually see and type all parts of it, on anything, any platform, any hardware, any software, any age, even a mechanical typewriter, even a pencil. That is not merely nice, it's essntially priceless, infinitely, incalculably valuable. The utility outweighs the problems as big as they absolutely are. Actually the same is true for json, yaml, xml...
- packetlost 2y ago> The problem with those ascii values is editors don't display them and there are no keyboard keys to type them. Did you read my post? Like, every word of it? Being able to type a control sequence is not particularly useful for ephemeral data in a message-passing between programs context. It's absolutely important for persistent, editable data. It seems like more of a feature to me to use these special characters for special contexts and not have escaping typeable characters be load-bearing. Further, my editor seems to print control characters just fine, though entering them would be a bit of a pain and the behavior is likely configurable.
- WorldMaker 2y ago
- chrisweekly 2y agoInteresting thought experiment. Reminds me of my cousin's project Xonsh https://xon.sh/ https://xon.sh/
- BeetleB 2y agoHappily been using xonsh for the last 6 years. Strongly recommend.
- Brian_K_White 2y agoThe problem of powershell is not merely thet it's new and different, and not merely that you have to learn a new and different way to get a given task done. Powershell makes some things possible or easier that weren't possible or easy, but only at the expense of making other things either impossible or at least vastly less practical, and all in all it's a bad trade off and a wrong set of priorities for the job it claims to fill, or at least for the job bash currently fills. It's not that bash is a gold standard, just that it's not fundamentally wrong.
- xelamonster 2y agoIt's also just absurdly verbose for a language intended mainly for manual input. I get annoyed having to type out `sudo systemctl` multiple times in a row, in Powershell every single command is at minimum that long. Which makes it way more difficult to memorize the commands too.
- Vegenoid 2y agoIMO, getting comfortable with and tuning autocomplete makes this a non-issue, and the benefit of the verbose commands is that they are very discoverable.
- rustyminnow 2y agoAny tips or links for tuning? zsh has a powerful engine and lots of great work out there, but when I've tried cooking my own it's all just too dense to get "comfortable" for long.
- WorldMaker 2y agoFor VS Code there is a good first-party PowerShell extension which helps a lot at writing scripts in the verbose style. There's experimental new IntelliSense available in the VS Code terminal: https://code.visualstudio.com/docs/terminal/shell-integration#_experimental-intellisense-for-powershell https://code.visualstudio.com/docs/terminal/shell-integratio...
- hnlmorg 2y agoThere are shells out there that sit between PowerShell / Nu and the old guards like Bash / Zsh. Ones that support data structures out-of-the-box (like any et al) but also work perfectly fine with existing UNIX commands (like Bash).
- sea-gold 2y agoHere is a nice list: https://github.com/oils-for-unix/oils/wiki/Alternative-Shells https://github.com/oils-for-unix/oils/wiki/Alternative-Shell...
- brazzledazzle 2y agoPowerShell seems to work fine calling a nix executable, unless I'm missing something: > ls -t *.js | head -n 10 | foreach { echo $_ ; Get-ChildItem $_ | fl Name, Length } product_original.js Name : product_original.js Length : 3353 gulpfile.js Name : gulpfile.js Length : 382
- Aurelius108 2y agoI was scripting on a windows machine which didn’t have WSL setup and decided to learn PowerShell. After a week or so of scripting with PowerShell and seeing how intuitive and robust the syntax is, something changed in my brain and I decided I never again wanted to deal with bash and its endless quirks and brittleness. It’s unnatural to have to wrap every variable access with “${}”, that unnatural key sequence always caused a break in my flow. Anyway I reach for Python sooner and really hunger for a clean, robust nix shell. I hope powershell has instilled this in many people and it drives adoption of something better
- dgan 2y agoI have tried to do the same, but i have opposite experience. I just can't grok the syntax, it always seems like a magician pulling out another "Haha! I bet you haven't seen this one coming !" Like, i can't even construct the abstract model of how it's supposed to work
- plaguuuuuu 2y agoI'm even a windows .NET developer and I also find Powershell extremely weird. I'm not sure what it is.
- brazzledazzle 2y agoWould you be able to provide an example? I'm not doubting your experience, just incredibly curious since I had the opposite experience.
- dgan 2y agoSure thing : $env::Path (the semicolon? so Path is not quoted here? But when I assign a value it's quoted?) Dir -r | %($_.Name.ToLower) ( what is this? statement dreamed by utterly deranged) They took us for absolute fools
- brazzledazzle 2y agoI mean you don't need to use the convenience aliases, or use even use it exactly that way. Here's it without any aliases: Get-ChildItem -Recurse | ForEach-Object { $PSItem.Name.ToLower() } This might be a better mix of both worlds: gci -r | foreach { $PSItem.Name.ToLower() }
- solidsnack9000 2y agoMaybe tabular data is a credible intermediate step. Many shell tools already export data in a tabular format.
- 082349872349872 2y ago> One can dream of a future where perhaps it will be possible to write a function, library, or program in any language one chooses and call it from any other shell or language without swig or ceremony. Was that not VMS?
- MrDrMcCoy 2y ago> One can dream of a future where perhaps it will be possible to write a function, library, or program in any language one chooses and call it from any other shell or language without swig or ceremony. That's a neat idea, and sounds like something that could be built on graalvm.
- kseistrup 2y agoHm, even if I download the sample .dune-prelude, dunesh keeps asking me if this is my first time. Also, can I make it use a 24h clock and non-US date formatting?
- kickingvegas 2y agoObligatory mention of Emacs Eshell. https://www.gnu.org/software/emacs/manual/html_mono/eshell.html https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...
- ssivark 2y agoThe advertisement promises a combination of bash and lisp. So it makes me wonder -- why couldn't we just use lisp? What are the affordances needed for a "scripting" language (or for interactive use) vis-a-vis more "production use? Is it just about having minimal boilerplate, and a large corpus of ready-to-use functions in the namespace?
- Kinrany 2y agoProcess composition is one thing that shell languages do better than traditional programming languages
- hnlmorg 2y agoThere’s plenty of LISP packages that support process composition. Also LISPs syntax better suits write once type environments like REPL shells than your average C-derived syntax.
- Kinrany 2y agoAny examples? Searching for this is hard. What would `foo | bar | baz` look like in a lisp?
- christophilus 2y agoSomething like Clojure’s threading macro, probably: (-> (foo) (bar) (baz))
- slowmovintarget 2y agohttps://github.com/babashka/babashka https://github.com/babashka/babashka Granted, if you're saying why can't we have the shell also... well, now you're talking about Emacs.
- jimbokun 2y agoMaybe the ultimate would be default to bash but if you start a command with a prefix everything following is parsed and evaluated as an s-expression.
- tempodox 2y agoNice, it even has Muad'Dib (the desert mouse from the “Dune” movies) as its mascot. The question “but does it have Muad'Dib?!” was the first thing I thought of when I saw the title.
- beardedwizard 2y agoMore white rat than desert mouse, I was disappointed. The mouse is also featured in the source material - the books :)
- globular-toast 2y agoAlso the one in the film looked more like a jerboa.
- herodoturtle 2y agoDon’t know what a jerboa is but I quite liked the depiction in the film. In particular the attention to detail, when they showed a bead of sweat running down its optimally shaped ear, whereupon it was pawed into its mouth. I loved that little scene so much.
- lagniappe 2y agoJerboas ride on your shoulder to alert you of an incoming storm.
- mmastrac 2y agoI like the ideas behind Powershell, but the DX has always felt ugly and clunky compared to standard shell. Unix/Posix are full of great tools, but they are all extremely painful for newbies and take years to master. There's got to be a middle ground where we can have the power and approachability of SQL with the beautiful elegance of standard Unix pipes. Dune seems to take a step in that direction which is great.
- mattmight 2y ago"Think of it as an unholy combination of bash and Lisp" reminded me of Scheme Shell: https://scsh.net/ https://scsh.net/ My Ph.D. advisor Olin Shivers created this. It's more pulling bash into Lisp than Lisp into bash. It doesn't seem to be maintained anymore, but some of its ideas live on in Racket.
- michaelsbradley 2y agoAnd now there’s Rash: The Reckless Racket Shell http://rash-lang.org/ http://rash-lang.org/ https://github.com/willghatch/racket-rash https://github.com/willghatch/racket-rash
- nxobject 2y agoI’ve always wanted to ask about the notorious introduction to scsh’s manual… [1] could Olin have been less than 100% satirical there? [1] https://scsh.net/docu/html/man.html https://scsh.net/docu/html/man.html
- esafak 2y agoLooks like it needs some contributors; no releases in almost a year.
- delichon 2y agoThe shell avatar is a rodent but not a desert mouse, not a muad'dib. It's "a shell by the beach", not inspired by any intellectual property you might be thinking of. Yet memorable. Well played.
- CMCDragonkai 2y agoIt kind of sucks that the default shell language is so clunky on Linux O/Ses. Bash marginally better than POSIX sh, and Zsh marginally better.
- pasc1878 2y agoEven worse is that POSIX forces this to be used. Using a non POSIX shell is much easier to write (e.g. fish xonsh - and possibly Powershell or rash but I have not used the last two) sh and derivatives are difficult for me to follow the syntax is impenetrateable - and I was a professional APL programmer.
- solidsnack9000 2y agoThe author writes: With my last shell, Atom, I had accomplished some of the coziness that bash was missing, but I also introduced a lot of really fatal flaws in the syntax and the type system. I would be interested to read more about this -- what the author learned from that experiment.
- noisy_boy 2y agobash has its own issues but my main gripe is handling of arrays and dictionaries - the syntax is so awkward and hard to remember that I inevitably have to have a reference open in another window. I wish they added some syntactic sugar to make that more ergonomic while retaining backwards compatibility.
- imp0cat 2y agoThis is where Copilot (or other similar tool) help a lot!
- ulbu 2y agoIn the domain and history that shells inhabit, the design should not prioritize arithmetic operations over indirection. '>>' is a biiig footgun. Elevation of a symbol to non-destructive operation into a destructive one is obviously a wrong choice. I wonder if it was a deliberate decision. edit: just leave '>>' as append and make '>>>' destructive instead.
- olejorgenb 2y agoI was thinking the same. They should at least make it an option to prompt the user when interactively redirecting to an already existing file. ZSH has this, except for the prompt (you'll need to run the command again using `>!`)