redox-os issueshttps://gitlab.redox-os.org/groups/redox-os/-/issues2021-06-01T13:51:19Zhttps://gitlab.redox-os.org/redox-os/ion/-/issues/920Official container builds2021-06-01T13:51:19ZColeman McFarlandOfficial container buildsShould we have official container builds for ion that live alongside our [other images](https://hub.docker.com/u/redoxos)? We could use docker, or another OCI container builder.
Benefits:
* Another way for interested folks to try ion.
*...Should we have official container builds for ion that live alongside our [other images](https://hub.docker.com/u/redoxos)? We could use docker, or another OCI container builder.
Benefits:
* Another way for interested folks to try ion.
* Test environments for ion's debian packages (and redhat, and alpine...)
* The ability to use `image: redoxos/ion:0.x.x` in _other_ CI jobs, so we can dogfood more ion scripts for automation
Drawbacks:
* builds taking up resources on the serverIon Shell v1.0.0matu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/918Plan for sourcing/translating sh scripts?2020-12-12T22:46:30ZSteven PeasePlan 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. ...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.unplannedhttps://gitlab.redox-os.org/redox-os/ion/-/issues/916HISTFILE doesn't appear to work in ion-1.0.5 (Arch Linux)2020-12-13T00:20:28ZSteven PeaseHISTFILE doesn't appear to work in ion-1.0.5 (Arch Linux)In ~/.config/ion/initrc I placed:
```
source "${HOME}/.profile"
let HISTFILE="${HOME}/.histfile"
export TERM="xterm-256color"
which omniprompt > /dev/null || cargo install --git https://github.com/spease/omniprompt.git
fn PROMPT
&& om...In ~/.config/ion/initrc I placed:
```
source "${HOME}/.profile"
let HISTFILE="${HOME}/.histfile"
export TERM="xterm-256color"
which omniprompt > /dev/null || cargo install --git https://github.com/spease/omniprompt.git
fn PROMPT
&& omniprompt 0 || omniprompt "E"
end
```
This still doesn't appear to use .histfile . In the end, I replaced the default history location with a symlink and it worked. However, it'd be preferable for the config setting to work.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/914Missing end quote on export command generates weird errors2022-11-26T09:23:26ZSteven PeaseMissing end quote on export command generates weird errors```
export GEM_HOME="${HOME}/something
```
This can cause anywhere from `assignment error: GEM_HOME: variable does not exist` to `extra values were supplied, and thus ignored` depending on the following commands.
If this is intentional...```
export GEM_HOME="${HOME}/something
```
This can cause anywhere from `assignment error: GEM_HOME: variable does not exist` to `extra values were supplied, and thus ignored` depending on the following commands.
If this is intentional, I'm guessing the intention was to allow strings spanning newlines?
An error when there's an uneven number of quotation marks etc. would be nice to have.Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/913No expected practices documentation for startup2020-12-12T22:51:57ZSteven PeaseNo expected practices documentation for startupGetting ion set up as my default shell.
I couldn't find a "best practices" / "expected practices" documentation for startup scripts. Eg equivalents of .profile, .bashrc, .bash_profile, etc. For now I've just been putting everything in t...Getting ion set up as my default shell.
I couldn't find a "best practices" / "expected practices" documentation for startup scripts. Eg equivalents of .profile, .bashrc, .bash_profile, etc. For now I've just been putting everything in the initrc file.
Thanks!Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/910Nicer error messages2021-07-18T05:53:40ZDiego GanglNicer error messagesRight now, Ion throws error messages like this:
```ion: pipeline execution error: command exec error: Permission denied (os error 13)```
While they are correct and tell you what the problem is, they could be more polished like rustc's e...Right now, Ion throws error messages like this:
```ion: pipeline execution error: command exec error: Permission denied (os error 13)```
While they are correct and tell you what the problem is, they could be more polished like rustc's errors (I'm only talking about the interactive prompt in this case).
### No permissions
```
You don't have permission to open [FILE]. The owner is [USER].
Permissions are: rw--x---
```
### Executables that can't be run
If it doesn't have any exec permissions:
```
Can't run [FILE]. It's not an executable.
Try running chmod +x [FILE].
```
If it has one, but we can't run it:
```
[FILE] is an executable but you don't have permission to run it.
The owner is [USER]. Permissions are: rwx-w---
Try running chmod +x [FILE].
```
### Command not found
```Command not found: pyothn. Did you mean "python"?```
If the command ends with a forward slash, it's a path not a command. The error should be more like:
```Directory not found```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/907(Re)consider @ token for array expansion - or allow disabling it in interacti...2020-12-12T22:58:09Ztheduke(Re)consider @ token for array expansion - or allow disabling it in interactive modeI love Ion's speed, and used it as my main shell for a while.
But I ultimately stopped due to the big annoyance of the `@` symbol being used for array expansion. (in part... the other element was lack of dynamic complections, which is no...I love Ion's speed, and used it as my main shell for a while.
But I ultimately stopped due to the big annoyance of the `@` symbol being used for array expansion. (in part... the other element was lack of dynamic complections, which is now being worked on in the Shellac effort, which is awesome!)
This now means having to quote every occurence of `@`.
Due to the prevalence of `@` in things you might type in the shell, the token seems like a suboptimal choice.
(Git URLls, database URIs, FTP, emails, ....)
I briefly mentioned this in chat ages ago, and someone brought up the lack of alternative tokens.
If the `@` symbol is already too ingrained or there isn't a viable alternative, another option could be providing an option that disables `@` in the interactive shell to remedy this.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/905`history` command not listed in `builtins.md`2020-12-17T00:06:00Zngirard`history` command not listed in `builtins.md`Shouldn't `history` be listed in `builtins.md` ?Shouldn't `history` be listed in `builtins.md` ?Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/901Array-based process expansion insufficiently documented2020-12-17T00:05:55ZngirardArray-based process expansion insufficiently documentedhttps://gitlab.redox-os.org/redox-os/ion/blob/master/manual/src/expansions/02-process.md#process-expansions
states:
> an array-based process expansion will split the output into an array delimited by whitespaces.
> ```shell
> ...
> let a...https://gitlab.redox-os.org/redox-os/ion/blob/master/manual/src/expansions/02-process.md#process-expansions
states:
> an array-based process expansion will split the output into an array delimited by whitespaces.
> ```shell
> ...
> let array = @(cmd args...)
> ```
> **NOTES:**
>
> ...
> * `@(cmd)` is equivalent to `@split($(cmd))`
But in a test directory containing files aa, bb, and cc, doing
```sh
let res=@(ls)
echo @res[0]
```
gives
```
```
while doing
```sh
echo @split($(ls))[0]
```
gives
```
aa
```Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/900"help" builtin command prints garbage2020-12-12T22:59:12Zngirard"help" builtin command prints garbagetyping `help` gives
```
fnhelpjobsreaddirsends-withexistspushdtestdisowndroptypesetexitisunaliasisattybghistorycalckeybindingsrandomsuspendstarts-withaliastrueboolcontainseqstatuspopdsourcewhichfalsefgmatchescdevalechowaitexec
```typing `help` gives
```
fnhelpjobsreaddirsends-withexistspushdtestdisowndroptypesetexitisunaliasisattybghistorycalckeybindingsrandomsuspendstarts-withaliastrueboolcontainseqstatuspopdsourcewhichfalsefgmatchescdevalechowaitexec
```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/898Document "Ctrl-c" (clears the line) vs Ctrl-D (clears the scope when typed at...2020-12-17T00:12:58ZngirardDocument "Ctrl-c" (clears the line) vs Ctrl-D (clears the scope when typed at an empty line)After typing ```fn a <return>```, ctrl-c doesn't work, and there's seemingly no way of escaping the REPL, except typing ```end <return>```.After typing ```fn a <return>```, ctrl-c doesn't work, and there's seemingly no way of escaping the REPL, except typing ```end <return>```.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/897Document how can functions be written in one line2020-12-17T00:05:48ZngirardDocument how can functions be written in one lineIn bash, the following line is a valid function definition:
```
square(){ local x=$1; echo $(( x * x )); }
```
Can we do the same in Ion ?
I guess the answer is no, but it would be nice to mention it in the manual (functions.md).In bash, the following line is a valid function definition:
```
square(){ local x=$1; echo $(( x * x )); }
```
Can we do the same in Ion ?
I guess the answer is no, but it would be nice to mention it in the manual (functions.md).Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/895Manual: slicing syntax in example doesn't match documentation2020-12-17T00:05:38ZngirardManual: slicing syntax in example doesn't match documentationExample in https://gitlab.redox-os.org/redox-os/ion/blob/master/manual/src/control/02-loops.md#chunked-iterations has
```
{1..=10}
```
but the `..=` syntax isn't documented in https://gitlab.redox-os.org/redox-os/ion/blob/master/manual/s...Example in https://gitlab.redox-os.org/redox-os/ion/blob/master/manual/src/control/02-loops.md#chunked-iterations has
```
{1..=10}
```
but the `..=` syntax isn't documented in https://gitlab.redox-os.org/redox-os/ion/blob/master/manual/src/slicing.md#ranges-slicing-syntax.Ion Shell v1.0.0betamatu3bamatu3bahttps://gitlab.redox-os.org/redox-os/ion/-/issues/893Failed running Ion with AlpineLinux2021-06-01T17:24:11ZNiklas Rosencrantzniklasr@protonmail.comFailed running Ion with AlpineLinuxI tried building it in a dockerized AlpineLinux. It did build the target but there is an error message when I tried to execute commands (echo $0, pwd, ls...). I can try again with some other Linux but my first attempt with Alpine failed.I tried building it in a dockerized AlpineLinux. It did build the target but there is an error message when I tried to execute commands (echo $0, pwd, ls...). I can try again with some other Linux but my first attempt with Alpine failed.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/886Replace method does not consider strings of zero length to be an input2021-03-18T17:21:54ZMichael Aaron Murphymmstick@pm.meReplace method does not consider strings of zero length to be an inputThis currently gives an error about needing an extra argument
```
echo $replace("foobar" "bar" "")
```This currently gives an error about needing an extra argument
```
echo $replace("foobar" "bar" "")
```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/881Maps: Assignment does only type check against `str`2021-01-12T16:16:14ZRoland KovácsMaps: Assignment does only type check against `str`* ion revision: 04f7be9
* expected behavior: map assignments are validated against the value type
```
$ let hm:hmap[int] = [ 'a'=0 ]
$ let hm['a'] += 1
ion: assignment error: type error: variable `hm` of type `str` does not support oper...* ion revision: 04f7be9
* expected behavior: map assignments are validated against the value type
```
$ let hm:hmap[int] = [ 'a'=0 ]
$ let hm['a'] += 1
ion: assignment error: type error: variable `hm` of type `str` does not support operator
```
The bug persist for `float` and `int` values types for both `hmap[]` and `bmap[]`.Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/880Multiple LHS values with indexing using math assignment operates on entire array2020-12-12T23:10:27ZRoland KovácsMultiple LHS values with indexing using math assignment operates on entire array* ion revision: 04f7be9
* expected behavior: indexed assignment only applies to the index position.
```
$ let a:[int] = [0 0 0]
$ let b:int = 0
$ let a[1] b += 1 1
$ echo @a
1 1 1 # [0 1 0] expected
$ echo $b
1
```* ion revision: 04f7be9
* expected behavior: indexed assignment only applies to the index position.
```
$ let a:[int] = [0 0 0]
$ let b:int = 0
$ let a[1] b += 1 1
$ echo @a
1 1 1 # [0 1 0] expected
$ echo $b
1
```Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/877Is ion language embeddable into Rust?2020-12-12T23:02:21ZDieter KonradIs ion language embeddable into Rust?Like lua in c?Like lua in c?Ion Shell v1.0.0https://gitlab.redox-os.org/redox-os/ion/-/issues/869Slice syntax doesn't work immediately following a function2020-12-12T23:12:04ZTom AlmeidaSlice syntax doesn't work immediately following a functionI think this is actually related to #868 and probably explains it.
If you have a method that should generate an array and then immediately follow it by a slice pattern, then the slice pattern isn't generated, whereas if you surround the...I think this is actually related to #868 and probably explains it.
If you have a method that should generate an array and then immediately follow it by a slice pattern, then the slice pattern isn't generated, whereas if you surround the method by `[]`, then it works as intended.
```bash
tommoa:~# let multiline = "one
two
three
four"
tommoa:~# for line in @lines($multiline)[..2]
echo $line
end
one
two
three
four
tommoa:~# let second = @lines($multiline)[..2]
tommoa:~# echo $second
one two three four
tommoa:~# for line in [@lines($multiline)][..2]
echo $line
end
one
two
tommoa:~# let second = [@lines($multiline)][..2]
tommoa:~# echo $second
one two
```Ion Shell v1.0.0betahttps://gitlab.redox-os.org/redox-os/ion/-/issues/868For-loop expansion gobbles the end of the line2021-01-07T02:50:24ZAdminXVIIFor-loop expansion gobbles the end of the line`for a in @split("a b c"); echo $a; end` hangs, waiting for an extra end statement.`for a in @split("a b c"); echo $a; end` hangs, waiting for an extra end statement.Ion Shell v1.0.0betamatu3bamatu3ba