<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git, branch rmerr</title>
<subtitle>a (mostly) posix compliant shell and tiny functional programming language
</subtitle>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/'/>
<entry>
<title>Fix &amp;&amp; behavior regression</title>
<updated>2024-02-28T23:05:45+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-28T23:05:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=2d2d5af3553b732237937549dc9b6df28b7c00cb'/>
<id>2d2d5af3553b732237937549dc9b6df28b7c00cb</id>
<content type='text'>
Introduce a switch to break from recite() if the forked process returns
a non-zero exit code. The one except to this, is when using semicolons,
then we do not care if the previous command failed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce a switch to break from recite() if the forked process returns
a non-zero exit code. The one except to this, is when using semicolons,
then we do not care if the previous command failed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove zombie slayer code from main repl</title>
<updated>2024-02-28T23:04:20+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-28T23:04:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=5890deb68e54838559c5d32c70d65e033e33d682'/>
<id>5890deb68e54838559c5d32c70d65e033e33d682</id>
<content type='text'>
Reaping is currently handled by a signal handler, so this code is no
longer necessary.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reaping is currently handled by a signal handler, so this code is no
longer necessary.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove custom errors and fix background forking</title>
<updated>2024-02-27T10:49:01+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-27T10:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=e94d09da9449cabd7ece2acd98d52b1946a922a4'/>
<id>e94d09da9449cabd7ece2acd98d52b1946a922a4</id>
<content type='text'>
Removes the custom errors in src/recite/erro.rs, and replaces them with
std::io::Errors throughout (recite(), incant_, macros).

Fixed a bug with the way forking to the background is handled, where
registering the signal handler in main for all processes would break
couplets (i.e. pipes). Instead, this sets up a new signal handler each
time a process is forked into the background. It uses a Vec&lt;i32&gt; to keep
track of all the background processes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Removes the custom errors in src/recite/erro.rs, and replaces them with
std::io::Errors throughout (recite(), incant_, macros).

Fixed a bug with the way forking to the background is handled, where
registering the signal handler in main for all processes would break
couplets (i.e. pipes). Instead, this sets up a new signal handler each
time a process is forked into the background. It uses a Vec&lt;i32&gt; to keep
track of all the background processes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup recite(), custom errors, fixed forking</title>
<updated>2024-02-27T06:14:13+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-27T06:14:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=0548e74cb3227716cf445f27bd64b8c0b4d0f981'/>
<id>0548e74cb3227716cf445f27bd64b8c0b4d0f981</id>
<content type='text'>
First off, moved the giant match statements out of recite(), and into
macros in src/recite/ps.rs. There still needs to be two, since any verse
using the 'couplet' meter will need to redirect its STDOUT. Now the
recite() function returns a Result&lt;(), Mishap&gt;, which can be invoked
when calling the incant_ functions.

Custom errors were added in the form of 'Mishap''s. They are intended to
be returned from the incant_ functions, in the event that something goes
wrong with the Command::spawn() or Child::wait(). They each take a
String, which should be the verb or stanza that was entered by the user.

The incant_ functions separate the functionality of each type of meter
from the recite() function. They return a Result&lt;i32, Mishap&gt;, where
i32 is the exit code of the program that ran, and Mishap is a possible
error.

Before, the shell was cheating at forking a process to the background.
It would actually spawn a thread to wait for that process to finish.
Now, the program simply registers a handler for SIGCHLD, and uses libc's
waitpid() function to reap the child process, and print some output to
the user, indicating that it's finished.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
First off, moved the giant match statements out of recite(), and into
macros in src/recite/ps.rs. There still needs to be two, since any verse
using the 'couplet' meter will need to redirect its STDOUT. Now the
recite() function returns a Result&lt;(), Mishap&gt;, which can be invoked
when calling the incant_ functions.

Custom errors were added in the form of 'Mishap''s. They are intended to
be returned from the incant_ functions, in the event that something goes
wrong with the Command::spawn() or Child::wait(). They each take a
String, which should be the verb or stanza that was entered by the user.

The incant_ functions separate the functionality of each type of meter
from the recite() function. They return a Result&lt;i32, Mishap&gt;, where
i32 is the exit code of the program that ran, and Mishap is a possible
error.

Before, the shell was cheating at forking a process to the background.
It would actually spawn a thread to wait for that process to finish.
Now, the program simply registers a handler for SIGCHLD, and uses libc's
waitpid() function to reap the child process, and print some output to
the user, indicating that it's finished.
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace ctrlc with signal-hook</title>
<updated>2024-02-25T04:24:19+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-25T04:24:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=b6fc81066cfcc29d4519191eae5ba19581ad2774'/>
<id>b6fc81066cfcc29d4519191eae5ba19581ad2774</id>
<content type='text'>
Replaced the 'ctrlc' crate with 'signal-hook' for handling of SIGINT.
The 'signal_hook::low_level::register' function is actually unsafe.
However, according to
https://docs.rs/signal-hook/latest/signal_hook/low_level/fn.register.html,
it is only unsafe in the case of multithreaded applications. There are
some race conditions as well. For instance, it appears that even when we
fork to a child process, SIGINT is captured on both that process, as
well as the shell.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replaced the 'ctrlc' crate with 'signal-hook' for handling of SIGINT.
The 'signal_hook::low_level::register' function is actually unsafe.
However, according to
https://docs.rs/signal-hook/latest/signal_hook/low_level/fn.register.html,
it is only unsafe in the case of multithreaded applications. There are
some race conditions as well. For instance, it appears that even when we
fork to a child process, SIGINT is captured on both that process, as
well as the shell.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reorganization and comments</title>
<updated>2024-02-23T06:12:24+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-23T06:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=536e250653e5c140a6d9e60f1cd652b79135e7a6'/>
<id>536e250653e5c140a6d9e60f1cd652b79135e7a6</id>
<content type='text'>
Broke out the structs for a poem into their own file: src/recite.rs.
Also put the 'prefresh' function into it's own file: src/recite/path.rs.
Commented most of the parser code (including structs and helper methods
related to parsing (i.e. Verse, Stanza, Meter, Poem)). Renamed any
instance of the 'paths' variable to 'path'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Broke out the structs for a poem into their own file: src/recite.rs.
Also put the 'prefresh' function into it's own file: src/recite/path.rs.
Commented most of the parser code (including structs and helper methods
related to parsing (i.e. Verse, Stanza, Meter, Poem)). Renamed any
instance of the 'paths' variable to 'path'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add back the 'cd' command</title>
<updated>2024-02-21T06:18:42+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-21T06:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=a14fdf8faa85628baf06399961eb1f9ab4c5f3eb'/>
<id>a14fdf8faa85628baf06399961eb1f9ab4c5f3eb</id>
<content type='text'>
Add back change directory functionality into the new parser.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add back change directory functionality into the new parser.
</pre>
</div>
</content>
</entry>
<entry>
<title>Parsing improvements</title>
<updated>2024-02-20T23:29:29+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-20T23:29:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=309a101a0e09ffe2bcd4f0032744f8532a5988d1'/>
<id>309a101a0e09ffe2bcd4f0032744f8532a5988d1</id>
<content type='text'>
Now the parser goes char by char, since special characters like '|' and
'&amp;' don't necessarily have to be whitespace seperated. Also added some
VERY basic error detection for the parser (revolving around special
chars).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now the parser goes char by char, since special characters like '|' and
'&amp;' don't necessarily have to be whitespace seperated. Also added some
VERY basic error detection for the parser (revolving around special
chars).
</pre>
</div>
</content>
</entry>
<entry>
<title>Pipes, forks, and consecutive calls</title>
<updated>2024-02-20T09:49:20+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-20T09:49:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=5d7e3646b7a267bdcf068d5667201033b3aa9207'/>
<id>5d7e3646b7a267bdcf068d5667201033b3aa9207</id>
<content type='text'>
This adds some preliminary support for pipes (|), forks (&amp;), and
consecutive command calls (&amp;&amp;) to the shell.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds some preliminary support for pipes (|), forks (&amp;), and
consecutive command calls (&amp;&amp;) to the shell.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only print command name in error messages</title>
<updated>2024-02-20T00:45:14+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-20T00:45:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=de2fe9dd7f2836f89490b822ae4464dab3bc769c'/>
<id>de2fe9dd7f2836f89490b822ae4464dab3bc769c</id>
<content type='text'>
Only print out the command name in error messages, rather than printing
out the full path to the command.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only print out the command name in error messages, rather than printing
out the full path to the command.
</pre>
</div>
</content>
</entry>
</feed>
