All Projects β†’ nixpulvis β†’ oursh

nixpulvis / oursh

Licence: GPL-3.0 license
Your comrade through the perilous world of UNIX.

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to oursh

bfetch
πŸ“  Dynamic fetch displayer that SuperB
Stars: ✭ 114 (+93.22%)
Mutual labels:  posix
libjio
[mirror] A library for Journaled I/O
Stars: ✭ 17 (-71.19%)
Mutual labels:  posix
coderun
⏯️ Code runner CLI that can run any languages
Stars: ✭ 23 (-61.02%)
Mutual labels:  posix
spring-file-storage-service
The FSS(file storage service) APIs make storing the blob file easy and simple .
Stars: ✭ 33 (-44.07%)
Mutual labels:  posix
sh
Collection Of My Sh Scripts.
Stars: ✭ 109 (+84.75%)
Mutual labels:  posix
onionjuggler
Manage your Onion Services via CLI or TUI on Unix-like operating system with a POSIX compliant shell.
Stars: ✭ 31 (-47.46%)
Mutual labels:  posix
distrobox
Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
Stars: ✭ 4,371 (+7308.47%)
Mutual labels:  posix
Onyx
UNIX-like operating system written in C and C++
Stars: ✭ 52 (-11.86%)
Mutual labels:  posix
dotfiles skeleton
robust and beginner friendly dotfile skeleton
Stars: ✭ 14 (-76.27%)
Mutual labels:  posix
InitKit
Neo-InitWare is a modular, cross-platform reimplementation of the systemd init system. It is experimental.
Stars: ✭ 364 (+516.95%)
Mutual labels:  posix
await
28Kb, small memory footprint, single binary that run list of commands in parallel and waits for their termination
Stars: ✭ 73 (+23.73%)
Mutual labels:  posix
kotoriotoko
KOTORIOTOKO (little bird man) -- Extremely Compatible and Sustainable Twitter Application Written in Shell Script
Stars: ✭ 89 (+50.85%)
Mutual labels:  posix
cubefs
CubeFS is a cloud native distributed storage platform.
Stars: ✭ 3,062 (+5089.83%)
Mutual labels:  posix
bc
An implementation of the POSIX bc calculator with GNU extensions and dc, moved away from GitHub. Finished, but well-maintained.
Stars: ✭ 115 (+94.92%)
Mutual labels:  posix
cccc
Source code counter and metrics tool for C++, C, and Java
Stars: ✭ 39 (-33.9%)
Mutual labels:  posix
go-sysconf
sysconf for Go, without using cgo
Stars: ✭ 119 (+101.69%)
Mutual labels:  posix
lustre-release
Mirror of official Lustre development repository http://git.whamcloud.com/
Stars: ✭ 35 (-40.68%)
Mutual labels:  posix
init
KISS Linux - Init Framework
Stars: ✭ 85 (+44.07%)
Mutual labels:  posix
tupai
Tupai is a multi-tasking operating system I wrote for my degree that focuses on safety and design, targeting a variety of platforms.
Stars: ✭ 21 (-64.41%)
Mutual labels:  posix
juicefs-csi-driver
JuiceFS CSI Driver
Stars: ✭ 117 (+98.31%)
Mutual labels:  posix

oursh

Documentation CI Dependencies

This shell should be both POSIX compatible and yet modern and exciting. Fancy features should not be prevented by POSIX compatibility. This will effect the design of the shell.

The name of the shell is oursh which is both somewhat unique, and memorable. It's also a nice name to play with pseudo-satirical themes... right comrade? It's short (ish) and sneakily fits rs in it, which is the extension of Rust programs, the language this will be written in.

Features

  • POSIX compatibility
    • Simple commands ls
    • Quotes (#28) echo "foo"; echo 'bar'
    • Assignment LOG=trace cargo run
    • Variables echo $foo
    • Special variables ($54) echo $?; echo $1
    • Boolean status syntax ! true && false || true
    • Conditionals if ; then ; elif ; then ; else ; fi
    • Compound commands { ls; date; }
    • Subshells \$(sleep 1; date)
    • Background jobs { sleep 1; date; }& date
    • Redirection date > now.txt
    • Pipes ls | wc -l
  • Shebang block programs
    • Alternate syntax {# ...}
    • Hashlang syntax {#lang; ...}, i.e. {#posix ls}
    • Shebang syntax {#!/usr/bin/env ruby; puts :sym}
  • bash/zsh autocomplete compatibility
    • Command completion
    • Path completion
    • Variable completion
    • Job completion
    • Syntax completion
    • man / -h / --help parsing
  • Multi-line input
  • Modern scripting language
    • Macros
    • Types
    • Higher-order functions
    • Threading?
  • Obfuscated strings (!'password'!)
  • Time every command
  • mosh like remote session support
  • Smart history, sync'd across devices
  • Pipe old commands without rerunning
  • Package manager
  • Sane defaults
  • Fast

Releases, Tags, and Branches

The master branch will run both the release and ci actions, whereas develop only runs ci. All pull requests into master and release tagged (i.e. vX.Y.Z) pushes also trigger release builds.

Usage

While this project is in early stages, there are no OS packages to use. However, you can compile and run directly from source easily. Just ensure you have rustup installed.

cargo build
cargo run

Testing

We have four kinds of tests in this program. Crate unit tests, Executable unit tests, subprocess based integration tests, and documentation tests.

# Run all tests.
cargo test

Previous Work

I've been using fish as my main shell for a few years now. Fish inspires a lot of the modern syntax.

POSIX compatibility comes from my desire to use this shell as my chsh -s ... shell on Arch Linux. See the full POSIX reference for more information.

Some of the shebang language interoperation was inspired by my time with the Northeastern University PL group, and generally from writing Racket. The beauty of of merging the UNIX style #!... with Racket's #lang ... here is very exciting to me. I might just have to make a {#lang ...} shortcut for Racket!

I've built and wrote a few things about shells before:

POSIX Reference

See the following sections for building the POSIX sh compliant program language, and interactive terminal based REPL.

  • 3Β§2 Shell Command Language
    • 10.2 Shell Grammar Rules
  • 2Β§2.5 Standard I/O Streams
  • 3Β§1.6 Built-In Utilities
  • 3Β§1.4 Utility Description Defaults
  • 2Β§2.3 Error Numbers
  • 1Β§11 General Terminal Interface
  • 2Β§2.4 Signal Concepts

Implementation

This shell will be written in Rust with minimal dependencies. Notably termios and libc will likely be used. The parsing library will be lalrpop, which should support the syntax we want somewhat easily, though grammar's in general can be a tricky beast.

We will want to create a few internal modules for the shell.

This design is subject to change.

  • process - sub-process execution management.
  • program - parser and interpreter for the syntax of the shell.
    • posix - POSIX (sh-like) syntax.
    • modern - Modified syntax for supporting "modern" features, like lambdas.
  • repl - syntax aware, read eval print loop for an underlying terminal.
    • history - records previous execution to a shared DB.
    • completion - searches for autocompletions based on partial syntax.
      • bash - bash completion support.
      • zsh - zsh completion support.
      • parse - dynamic completion generation, from man for example.
    • sync - remote session and DB synchronization.
  • invocation - loading for .ourshrc and others.
  • package - simplistic package manager support (builtin function).

Current modules as of: 2018-10-14

 oursh : crate
 β”œβ”€β”€ job : public
 β”œβ”€β”€ program : public
 β”‚   β”œβ”€β”€ basic : public
 β”‚   └── posix : public
 β”‚       β”œβ”€β”€ ast : public
 β”‚       β”‚   └── tests : private @ #[cfg(test)]
 β”‚       β”œβ”€β”€ builtin : public
 β”‚       └── lex : public
 β”‚           └── tests : private @ #[cfg(test)]
 β”œβ”€β”€ repl : public
 β”‚   β”œβ”€β”€ completion : public @ #[cfg(feature = "completion")]
 β”‚   └── history : public @ #[cfg(feature = "history")]
 └── tests : private @ #[cfg(test)]└── tests : private @ #[cfg(test)]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].