Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
ion
ion
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 95
    • Issues 95
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • redox-os
  • ionion
  • Issues
  • #918

Closed
Open
Opened Sep 02, 2019 by Steven Pease@spease

Plan for sourcing/translating sh scripts?

Once general concern that I have so far is that Ion introduces a lot of idiosyncratic behavior. It’s neither a Rust REPL with a subset of the language, but it also isn’t compatible with sh either. It’s kind of a mix of concepts of both. This introduces an additional barrier to learning and adoption.

One particular issue is that a lot of packages will install a shell script to set up environment variables etc. For instance, nix. There doesn’t seem to be any good way to source this file, and translating it currently would require rewriting it by hand (and potentially manually updating it if it changes).

A few thoughts I had:

  1. An external translation application that can easily be used with a source directive
  2. An sh-compatibility mode that can be invoked through use of a special sh directive
  3. An sh-compatibility mode triggered by the shebang (this might still require annotating files, but be O(1) every time)
  4. An extraction mode that actually forks an sh-compatible shell, then extracts default/new/specified environment variables at the end of that process back into the Ion environment

To keep the scope manageable, if it’s a pain to parse sh, you could probably get away with providing a subset of the most commonly used language features.

Edited Sep 02, 2019 by Steven Pease
Assignee
Assign to
unplanned
Milestone
unplanned
Assign milestone
Time tracking
None
Due date
None
Reference: redox-os/ion#918