oil
ble.sh
Our great sponsors
oil | ble.sh | |
---|---|---|
234 | 52 | |
2,717 | 2,067 | |
1.5% | - | |
9.9 | 9.1 | |
4 days ago | 16 days ago | |
Python | Shell | |
GNU General Public License v3.0 or later | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
oil
-
Autoconf makes me think we stopped evolving too soon
A better solution is just to write a plain ass shell script that tests if various C snippets compile.
https://github.com/oilshell/oil/blob/master/configure
https://github.com/oilshell/oil/blob/master/build/detect-pwe...
Not an unholy mix of m4, shell, and C, all in the same file.
---
These are the same style as a the configure scripts that Fabrice Bellard wrote for tcc and QEMU.
They are plain ass shell scripts, because he actually understands the code he writes.
https://github.com/qemu/qemu/blob/master/configure
https://github.com/TinyCC/tinycc/blob/mob/configure
OCaml’s configure script is also “normal”.
You don’t have to copy and paste thousands of lines of GNU stuff that you don’t understand.
(copy of lobste.rs comment)
will prevent almost all of the "silent footguns".
YSH has strict:all and then a bunch of NEW features.
There's been good feedback recently, which has led to many concrete changes. So your experience can definitely influence the language! https://github.com/oilshell/oil/wiki/Where-To-Send-Feedback
Yup, I call that the Perlis-Thompson Principle -- because Ken Thompson made a very similar combinatorial argument about software composition: you should design it around one thing.
https://www.oilshell.org/blog/2021/07/blog-backlog-1.html#co...
Files had structure on pre-Unix OSes, but they don't on Unix, because it doesn't compose.
---
The reason that shell is universal is a mathematical property of software. How do you make a Zig program talk to a Mojo program?
Probably with a byte stream.
What about a Clojure program and a Common Lisp program? Probably a byte stream. (Ironically, S-expressions have no commonly used "exterior" interchange format)
Every time a new language is introduced, I think "well there's another reason you're going to need a shell script".
The larger the system, the more heterogeneous it is. And software is larger now, which is why MORE GLUE is needed.
This is why shell was the #6 fastest growing language on Github in 2022: https://octoverse.github.com/2022/top-programming-languages
And the #1 fastest growing language is HCL, which is a very closely related form of glue.
---
https://www.oilshell.org/ has JSON as of a few months ago, and is now pure native code (no more Python)
All the normal shell stuff works:
osh$ ls */*.py | wc -l; whoami
-
The secret weapon of Bash power users
in your bashrc to enable it. I've used it for probably ~18 years now.
It also works with https://www.oilshell.org/ since we use GNU readline. Just 'set -o vi' in ~/.config/oils/oshrc
-
Pipexec – Handling pipe of commands like a single command
No other shell does that.
But I didn't know it was called MULTIOS until now. (I guess that's read "mult I/O's"? I have a hard time not reading it was multi-OS :) )
It seems a bit niche to be honest, but it's possible to support in Oils.
---
Oils also uses Unix domain sockets already for the headless shell protocol
https://github.com/oilshell/oil/wiki/Headless-Mode
We could do something like dgsh, but so far I haven't seen a lot of uptake / demand. Every time it's mentioned, somebody kinda wants it, and then it kinda peters out again ... still possible though.
I think flat files work fine for a lot of use cases, and once you add streaming, you also want monitoring, more control over backpressure/queue sizes, etc.
-
Show HN: Hancho – A simple and pleasant build system in ~500 lines of Python
which works well. You don't have to clean when rebuilding variants. IMO this is 100% essential for writing C++ these days. You need a bunch of test binaries, and all tests should be run with ASAN and UBSAN.
---
I wrote a mini-bazel on top of Ninja with these features:
https://www.oilshell.org/blog/2022/10/garbage-collector.html...
So it's ~1700 lines, but for that you get the build macros like asdl_library() generating C++ and Python (the same as proto_library(), a schema language that generates code)
And it also correctly finds dependencies of code generators. So if you change a .py file that is imported by another .py file that is used to generated a C++ header, everything will work. That was one of the trickier bits, with Ninja implicit dependencies.
I also use the Bazel-target syntax like //core/process
This build file example mixes low level Ninja n.rule() and n.build() with high level r.cc_library() and so forth. I find this layering really does make it scale better for bigger projects
https://github.com/oilshell/oil/blob/master/asdl/NINJA_subgr...
Some more description - https://lobste.rs/s/qnb7xt/ninja_is_enough_build_system#c_tu...
-
Re2c
This is sort of a category error...
re2c is a lexer generator, and YAML and Python are recursive/nested formats.
You can definitely use re2c to lex them, but it's not the whole solution.
I use it for everything possible in https://www.oilshell.org, and it's amazing. It really reduces the amount of fiddly C code you need to parse languages, and it drops in anywhere.
-
Ask HN: Looking for a project to volunteer on? (February 2024)
SEEKING VOLUNTEERS - https://www.oilshell.org/ - https://github.com/oilshell/oil/
I'm looking for people to help fill out the "standard library" for Oils/YSH. We're implementing a shell for Python and JavaScript programmers who avoid shell!
On the surface, this is writing some very simple functions in typed Python. But I've realized that the hardest parts are specifying, TESTING, and documenting what the functions do.
---
The most recent release announcement also asks for help - https://www.oilshell.org/blog/2024/01/release-0.19.0.html (long)
If you find all those details interesting (if maybe overwhelming), you might have a mind for language design, and could be a good person to help.
Surveying what Python and JavaScript do is very helpful, e.g. for the recent Str.replace() function, which is nontrivial (takes a regex or string, replacement template or string)
But there are also very simple methods to get started, like Dict.values() and List.indexOf(). Other people have already contributed code. Examples:
https://github.com/oilshell/oil/commit/58d847008427dba2e60fe...
https://github.com/oilshell/oil/commit/8f38ee36d01162593e935...
This can also be useful to tell if you'll have fun working on the project - https://github.com/oilshell/oil/wiki/Where-Contributors-Have...
More on #help-wanted on Zulip (requires login) - https://oilshell.zulipchat.com/#narrow/stream/417617-help-wa...
Please send a message on Github or Zulip! Or e-mail me andy at oilshell dot org.
-
The rust project has a burnout problem
This is true, but then the corrolary is that new PRs need to come with this higher and rigorous level of test coverage.
And then that becomes a bit of a barrier to contribution -- that's a harness
I often write entirely new test harnesses for features, e.g. for https://www.oilshell.org, many of them linked here . All of these run in the CI - https://www.oilshell.org/release/latest/quality.html
The good thing is that it definitely helps me accept PRs faster. Current contributors are good at this kind of exhaustive testing, but many PRs aren't
- Unix as IDE: Introduction (2012)
ble.sh
-
[Release v0.2.0] promkit: A toolkit for building interactive command-line tools in Rust
So could someone say use this to reimplement blesh in Rust?
- After years of bash, I actually found a shortcut I never heard about.
-
Which Shell?
Bash + ble.sh = fish like interactive features but still bash.
-
Sweet Shell: With Oh-My-Zsh, SpaceVim, Starship, True Color, and Demo Mode
> Autocompletion is one thing zsh does better, and that alone is worth it IMO. It can autocomplete things other than filenames and even gives you a short description for each of the subcommands or CLI options in the completion candidates. For the most common commands, this works without even having to install third party completion scripts.
The joke here is: All this requires additional scripts / configs. Whether bundled or not…
With those scripts / config there is no difference between shells.
> Syntax highlighting is useful as well, though that requires the use of a third party plugin. You can detect quoting errors, unmatched braces, missing commands, incorrect filepaths before hitting enter. It's indispensable in an interactive shell because that's where you write convoluted one-off one-liners.
https://github.com/akinomyoga/ble.sh
> In general, zsh is extensible and offers more capabilities than bash.
Nobody ever could show me even one feature that isn't available in almost all popular shells!
> But to feel the difference, you need to configure it and enable the nice features.
Yeah sure. When you tune your ̵c̵a̵r̵ shell it has nice features afterwards…
That's true for any shell as I see it.
---
I for my part don't like Unix shell. Even after 20 years of usage (as since then Linux is my only OS).
Also I've never understood what's the case about zsh. Nobody could ever answer the question why it's anyhow "better" or even show features not available elsewhere.
I came to the conclusion that zsh is just a stupid hype of "cool kids". It's the same as with the car tuning crowd.
A truly better shell would be much different than a Unix shell. There are some experiments out there but nothing really convincing.
So I continue to stay with the not so cool default. As it's most compatible and available everywhere.
But please wake me up when there is some real innovation regarding shells!
> With those scripts / config there is no difference between shells.
As I wrote in my original comment, bash only does filepath completion most of the time even with third party completion scripts. And I have never seen bash
> https://github.com/akinomyoga/ble.sh
ble.sh is impressive work, but it's a hack that won't be as reliable or compatible without built-in support for programmatic manipulation of the command line buffer in bash. ble.sh diverts key input from readline and reimplements its features. It contains workarounds for specific terminals, and scripts have to be modified to accommodate ble.sh. IIRC FZF's shell integration required modifications to work with ble.sh.
> Nobody ever could show me even one feature that isn't available in almost all popular shells!
Read the parts of my original comment which you haven't quoted.
> When you tune your ̵c̵a̵r̵ shell it has nice features afterwards…
Only to the extent that the shell lets you.
> I came to the conclusion that zsh is just a stupid hype of "cool kids". It's the same as with the car tuning crowd.
That was uncalled for.
- Does Bash have something like Powershell's MenuComplete?
-
Fuzzy file completion in bash
You might try blesh. It has a nice completion for files and variables in bash
-
Bash 5.2
Nice, there's also ble.sh -- a bash replacement of readline that has zsh/fish-like syntax colors and completion. It is actively developed and the maintainer has implemented 2 features I've requested in a matter of hours.
If you want to check it out: https://github.com/akinomyoga/ble.sh
(Still, I personally believe these features are overrated and don't actually bring in more usability or comfort to the command line experience)
-
Is there a way to make Konsole act like it does in Manjaro?
Yea, there is also ble.sh. I haven't used them myself because I wrote a simple one of my own to scratch my itch. What do you like the most about oh-my-bash? They don't have the same capabilities as other shells, though.
-
How to get terminal autocomplete like this?
Sadly, no. But if you want to try one of zsh feature is menu complete, you can install ble.sh
What are some alternatives?
bash-it - A community Bash framework.
zsh-syntax-highlighting - Fish shell like syntax highlighting for Zsh.
nushell - A new type of shell
oh-my-bash - A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
fish-shell - The user-friendly command line shell.
elvish - Powerful scripting language & Versatile interactive shell
xonsh - :shell: Python-powered, cross-platform, Unix-gazing shell.
starship - ☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!
fzf-tab-completion - Tab completion using fzf
kitty - Cross-platform, fast, feature-rich, GPU based terminal
tmux - tmux source code