<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vitiral: vital literal trivial content, probably not viral.</title>
    <description>Blog about life and linux
</description>
    <link>http://vitiral.github.com/</link>
    <atom:link href="http://vitiral.github.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Tue, 13 Sep 2022 06:15:25 +0000</pubDate>
    <lastBuildDate>Tue, 13 Sep 2022 06:15:25 +0000</lastBuildDate>
    <generator>Jekyll v3.9.2</generator>
    
      <item>
        <title>When Nothing Is Done Nothing Is Left Undone</title>
        <description>&lt;p&gt;When I was young, my passion for needing certainty burned brightly. Unlike
what is often said I never actually believed I had all the answers, but I did
believe I knew the overall direction things should go and small actions I could
take to affect them.&lt;/p&gt;

&lt;p&gt;Sometimes it feels like our identity has become about these small actions, which
can be as large as a protest to as small as a tweet. It’s not even that this is
incorrect: clearly almost all large actions are made up of smaller ones. It’s
just that there is now a seeming consensus that we should be more intentional
about which actions are taken and that they aligns to a specific worldview.&lt;/p&gt;

&lt;p&gt;I’ve been reading the Tao De Ching (Stephen Mitchel translation) a lot lately,
and not reading social media or the news. Several important realizations have
come up for me which I wanted to share. For those who don’t know, the Tao De
Ching is an ancient work unlike any other. It is, as Stephen Mitchell put it
“the classic manual on the art of living, written in the style of gemlike
lucidity, radiant with humor and grace and largeheartedness and deep wisdom: one
of the wonders of the world.” If you have not read it, I encourage you to do so
soon. It is only a few thousand words. If you read it slowly, as it is meant to
be read, it should not take up more than a few hours of your time.&lt;/p&gt;

&lt;p&gt;When I first encoutered the Tao as a child, I had thought it to be cryptic
and self-contradictory. This may have been a result of the translation (I would
like to eventually study multiple translations), but it is also because I have
significantly dulled my certainty. I am now 34, but as a teenager and in my
early 20’s I strongly believed that holding contradictory opinions
simultaniously was impossible. I now believe it is the first sign of a healthy
intellect.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;20
Stop thinking, and end your problems.
What difference between yes and no?
What difference between success and failure?
Must you value what others value,
avoid what others avoid?

3
If you overesteem great men,
people become powerless.
If you overvalue possessions,
people begin to steal.

The Master leads
by emptying people's minds
and filling their cores,
by weakening their ambition
and toughening their resolve.
He helps people lose everything
they know, everything they desire,
and creates confusion
in those who think that they know.

Practice not-doing,
and everything will fall into place.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One of the things that surprised me the most about the Tao De Ching was it’s
focus on governance. I would guess that at least 10% of the pages mention
government or have advice specifically for a leader. Some important context here
is that probaly all government in Lao Tzu’s time was monarchical, so addressing
a single “leader” makes more sense. Regardless, there is a lot here that applies
to the present day perhaps even more than it applied then.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;17
When the Master governs, the people
are hardly aware that he exists.
Next best is a leader who is loved.
Next, one who is feared.
The worst is one who is despised.

If you don't trust the people,
you make them untrustworthy.

The Master doesn't talk, he acts.
When his work is done,
the people say, &quot;Amazing:
we did it, all by ourselves!&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;“When nothing is done, nothing is left undone.” This is perhaps the essential
wisdom of action though non-action. I think there is a reflective desire to take
this statement defensively, as an attack against one’s very being. How does one not
take the right action when one knows it to be required? No. It is much simpler
than this. So much simpler it can be difficult to see.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Do you have the patience to wait
till your mud settles and the water is clear?
Can you remain unmoving
till the right action arises by itself?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lao Tzu is not suggesting you take no action, just that you relax into it. You
are the Tao.  Society is the Tao. “The great Tao is everywhere. All things are
born from it”.  You are action, whether you try to force it or not. Do you want
to know how to make the world a better place? First accept it as it is.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;23
Express yourself completely,
then keep quiet.
Be like the forces of nature:
when it blows, there is only wind;
when it rains, there is only rain;
when the clouds pass, the sun shines through.

If you open yourself to the Tao,
you are at one with the Tao
and you can embody it completely.
If you open yourself to insight,
you are at one with insight
and you can use it completely.
If you open yourself to loss,
you are at one with loss
and you can accept it completely.
Open yourself to the Tao,
then trust your natural responses;
and everything will fall into place.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lao Tzu has more to say about government than I would have thought possible for
a religious work. It has something for everyone: left and right wing, communists
and libertarians, and everything in-between. Seeing so many seemingly
contradictory and modern opinions from a work written 2600 years was fairly
shocking and made me realize that my reaction has more to do with my own
preconceived notions than anything rooted in reality.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;59
For governing a country well
there is nothing better than moderation.

The mark of a moderate man
is freedom from his own ideas.
Tolerant like the sky,
all-pervading like sunlight,
firm like a mountain,
supple like a tree in the wind,
he has no destination in view
and makes use of anything
life happens to bring his way.

Nothing is impossible for him.
Because he has let go,
he can care for the people's welfare
as a mother cares for her child.

32
If powerful men and women
could remain centered in the Tao,
all things would be in harmony.
The world would become a paradise.
All people would be at peace,
and the law would be written in their hearts.

When you have names and forms,
know that they are provisional.
When you have institutions,
know where their functions should end.
Knowing when to stop,
you can avoid any danger.

All things end in the Tao
as rivers flow into the sea.

46
When a country is in harmony with the Tao,
the factories make trucks and tractors.
When a country goes counter to the Tao,

warheads are stockpiled outside the cities.
There is no greater illusion than fear,
no greater wrong than preparing to defend yourself,
no greater misfortune than having an enemy.

Whoever can see through all fear
will always be safe.

53
The great Way is easy,
yet people prefer the side paths.
Be aware when things are out of balance.
Stay centered within the Tao.

When rich speculators prosper
While farmers lose their land;
when government officials spend money
on weapons instead of cures;
when the upper class is extravagant and irresponsible
while the poor have nowhere to turnall this is robbery and chaos.
It is not in keeping with the Tao.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;For more chapters concerning politics see 30, 53, 57, 58, 60, 61, 65, 66, 75,
77.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, the Tao De Ching is not a coherent political philosophy. Lao Tzu will
not give you answers, all he can do is take them away. This is because there are
no answers, at least not ones that can be spoken. “The tao that can be told is
not the eternal Tao.”&lt;/p&gt;

&lt;p&gt;Beliefs are built of concepts. Concepts are built of language.  Language is a
tool which separates the world by segmenting things from other things. The
meaning of words like “mountain”, “human” and “life” are dependent on them having a
background – the mountain is part of a landscape, a human is part of an
ecosystem. Words have meaning because they point at something and also don’t
point at other things. An actual mountain has no meaning. You cannot point at a
mountain and ask “what is its meaning?”. Words have meaning because they point to
something beyond themselves. An actual mountain or individual life has no
“meaning” outside of itself.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;71
Not-knowing is true knowledge.
Presuming to know is a disease.
First realize that you are sick;
then you can move toward health.

14
Approach it and there is no beginning;
follow it and there is no end.
You can't know it, but you can be it,
at ease in your own life.
Just realize where you come from:
this is the essence of wisdom.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When we use langauge to craft a purpose or meaning it is attempting to point to
something other than what we are. This isn’t to say that words are not useful.
Sometimes they point to something fundamental. But as the saying goes, “Zen is a
finger pointing at the moon, do not confuse the finger for the moon.” Never
confuse the words for the things they point to. The things are real. The words,
concepts and ideals are not.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;67
I have just three things to teach:
simplicity, patience, compassion.
These three are your greatest treasures.
Simple in actions and in thoughts,
you return to the source of being.
Patient with both friends and enemies,
you accord with the way things are.
Compassionate toward yourself,
you reconcile all beings in the world.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Can we learn (or unlearn) these lessons while consuming social media? I believe
that only someone who is already enlightened would stand a chance. To relax in
this way we must first find solitude. This doesn’t need to be in a cave with
zero contact with friends. It doesn’t need to be meditating for hours a day. But
it does have to be while microwaving our coffee. It does have to be while laying
in bed. Our minds have to have room to breathe, to not be stimulated and have
some of our own thoughts and opinions – and then let go of them.&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;All quotes unless otherwise stated are taken from the Tao Te Ching written by
Lao-tzu, Translation by Stephen. Mitchell Last updated 20 July 1995&lt;/p&gt;

&lt;p&gt;http://albanycomplementaryhealth.com/wp-content/uploads/2016/07/TaoTeChing-LaoTzu-StephenMitchellTranslation-33p.pdf&lt;/p&gt;
</description>
        <pubDate>Mon, 12 Sep 2022 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2022/09/12/when-nothing-is-done-nothing-is-left-undone.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2022/09/12/when-nothing-is-done-nothing-is-left-undone.html</guid>
        
        
      </item>
    
      <item>
        <title>How I Reclaimed My Attention</title>
        <description>&lt;p&gt;It feels like boredome has been nearly extinguished, but our resiliency to it
is lower than ever. Our smartphone is always at hand, and if you pay attention
you can likely find yourself checking it nearly every second of downtime –
becomming a default impulse that hapens so quickly there isn’t even an
&lt;em&gt;opportunity&lt;/em&gt; to resist it.&lt;/p&gt;

&lt;p&gt;However, I believe boredom has immense value. I find some of my most creative
and enjoyable moments to be when I am otherwise largely bored. For instance,
it’s hard to really &lt;em&gt;enjoy&lt;/em&gt; music if you are not otherwise bored – as music
cannot be fully appreciated while doing another task. More important, being
resilient to boredom allows you to have more freedom to direct your attention
to the things you value.&lt;/p&gt;

&lt;p&gt;This blog post is not about the value of boredom in our lives, nor about the
value in having freedom in how we apply our attention. It is assumed that you
already see the value of those things or at least how they could be valuable.
Instead, this is about some of the general strategies I employ to reduce my
levels of distraction and live what I feel is a moderatly happy life.  I’ve
struggled with attention addiction (addiction to video games, streaming website
information, etc) for most of my adult life, and have built up a large variety
of methods and tricks to reduce their hold on me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: make it very difficult to “automatically” do distracting behavior&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Specifically, (1) remove apps like twitter, reddit, facebook, games etc from
your phone. (2) Since these are all accessible via the web, &lt;strong&gt;also remove
chrome/safari&lt;/strong&gt; (and any other browser) as well. Technically on most phones you
can only “disable” these things, but the point is not to make it impossible to
distract yourself (you can never accomplish that) but to provide a barrier
against it being an &lt;em&gt;impulse&lt;/em&gt;. Personally, I have also disabled the App Store
and the Search functionality built-into the phone, even disabling Gmail for a
few weeks at a time, since I found myself impulsively using that.&lt;/p&gt;

&lt;p&gt;Finally, (3) have a laptop/computer that is for “getting things done.” Most
likely, this is your work computer. (For linux/mac) go to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/hosts&lt;/code&gt; and
disable sites that distract you like so:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;127.0.0.1     facebook.com
127.0.0.1     www.facebook.com
127.0.0.1     reddit.com
127.0.0.1     www.reddit.com
# ... etc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Step 2: create consequences&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Write a contract with yourself; even better a best friend or significant other.
It should have:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;What (significant) behaviors you are not allowed to do.&lt;/li&gt;
  &lt;li&gt;The consequences for doing those behaviors.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For me, since I don’t like sports, doing any of the distracting behaviors (for
more than 1 minute) requires me to purchase or wear Denver Broncos memoribilia.
If I do distracting behaviors 10ish times, I have to get a Denver Broncos
tatoo.&lt;/p&gt;

&lt;p&gt;For smaller behaviors, like compuslively checking my phone, I have a
spreadsheet where I keep track of how often I compulively checked my phone that
day. This means that if I compusively open my phone, I have an immediate
consequence of needing to record it.&lt;/p&gt;

&lt;p&gt;I found the book Atomic Habbits by James Clear useful as well. You might as
well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Find ways to still be connected (when useful)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have a “personal laptop” which I can only use after I put my kids to bed for
about an hour and a half. This is where I do my open source work, and also
where I briefly check some tech news. The news is blocked on my work computer
for obvious reasons, but it is nice to be able to stay up to date. I try to
stay away from most news. I find it tends to depresses me even though
I have no control over it, which has limited value.&lt;/p&gt;

&lt;p&gt;I also still listen to podcasts, audiobooks and music on my phone, especially
while running or doing chores. This lets me stay connected while doing
activities that I value.&lt;/p&gt;

&lt;p&gt;For me personally, I have completely abandoned video games, reddit and (non
educational) youtube. This is the nature of my own addiction, which is akin
to an alcoholic not being able to “just have one drink”.&lt;/p&gt;

&lt;p&gt;Also for me personally, I have found outlets for some of my addictions. I find
(open source) programming nearly as enjoyable/distracting as playing video
games, but with a much larger long-term benefit. Therefore, I do open source
programming for a large chunk of my freetime. My recent project is
&lt;a href=&quot;https://civboot.org&quot;&gt;civboot&lt;/a&gt;, check it out!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclussion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Come up with your own methods or mimick mine – what’s important is that you
have strategies. Also, it is important that you accept failure, because you
will fail alot. You have your whole life to figure out how to reduce
distraction and pay attention to the things that matter, so don’t stress out
about it. Don’t stress, but start right now.&lt;/p&gt;

</description>
        <pubDate>Sun, 06 Dec 2020 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2020/12/06/how-I-reclaimed-my-attention.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2020/12/06/how-I-reclaimed-my-attention.html</guid>
        
        
      </item>
    
      <item>
        <title>Artifact 2.0 Rust Full Stack Web And Cli Application</title>
        <description>&lt;p&gt;After at least 6 months of effort (and interruptions… so many interruptions)
I have finally completed the complete rewrite of artifact – including
rewriting the Web UI to be in rust compiled into web assembly. &lt;a href=&quot;https://github.com/vitiral/artifact/releases&quot;&gt;2.0 is
complete and you can download it here (for linux only
ATM&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;This release spans a huge amount of effort. The TLDR version:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;I felt like I needed a cohesive CLI SDK and so I created the
&lt;a href=&quot;https://github.com/rust-crates/ergo&quot;&gt;ergo&lt;/a&gt; crate. This included several
other crates created by me:
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/vitiral/path_abs&quot;&gt;path_abs&lt;/a&gt; for better path handling.&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/vitiral/std_prelude&quot;&gt;std_prelude&lt;/a&gt; for glob importing what I need.&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/vitiral/termstyle&quot;&gt;termstyle&lt;/a&gt; for cleaner terminal styles.&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/vitiral/taken&quot;&gt;taken&lt;/a&gt; for taking ownership.&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/vitiral/stfu8&quot;&gt;stfu8&lt;/a&gt; for serializing/deserializing
arbitrary bytes that are “mostly” utf8 compliant (i.e. paths).&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;I used &lt;a href=&quot;https://github.com/DenisKolodin/yew&quot;&gt;yew&lt;/a&gt; for developing the frontend. I ended up
contributing a fair amount to both yew and &lt;a href=&quot;https://github.com/koute/stdweb&quot;&gt;stdweb&lt;/a&gt; but
these frameworks were &lt;em&gt;surprisingly stable&lt;/em&gt;. I also made a few crates:
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/vitiral/jrpc&quot;&gt;jrpc&lt;/a&gt;: for easily creating JSON-RPC
requests and handling responses.&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/vitiral/yew_simple&quot;&gt;yew_simple&lt;/a&gt;: a simpler (in my
opinion) imlementation of several yew services. It is important to note
that yew is flexible enough that this is even possible :)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I ended up with is the first (to my knowledge) full stack application in
rust that is more than a toy. Artifact is a reasonably complex piece of software,
and rust delivers its promises of speed and stability even at the cutting edge of
the web.&lt;/p&gt;

&lt;h2 id=&quot;why-rewrite-everything&quot;&gt;Why Rewrite Everything?&lt;/h2&gt;
&lt;p&gt;The first question is probly why I decided a complete rewrite was necessary.
There are two answers: for fun and because I initially wrote artifact when I
was just learning rust for the first time and it &lt;em&gt;showed&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I wanted to write artifact “the right way” – using standardized libraries and
split into several reusable crates. However, the standardized those libraries
didn’t really exist yet (or at least they weren’t cohesive) so I went about
building ergo. It was my way of giving back to the fantastic rust
community :)&lt;/p&gt;

&lt;p&gt;The other reasons to rewrite were:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Speed: I wanted to make the implementation completely parallel, and I did.
It is &lt;em&gt;blazingly&lt;/em&gt; fast now.&lt;/li&gt;
  &lt;li&gt;Simplicity: the filesystem interface now has an API which acts like a CRUD
database. You simply give it a list of operations (create/modify/delete) and
it makes sure they are valid and consistent and performs them. This made
implementing the CLI and Server layers trivial, as they could both use this
simple interface.&lt;/li&gt;
  &lt;li&gt;New Features: I added several new features that the old library made
difficult to add and test.
    &lt;ul&gt;
      &lt;li&gt;Sub Artifacts: you can add sub-artifacts using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[[.subart]]&lt;/code&gt; syntax in the
text of any artifact, making it possible to split up the definition
of how to implement the artifact in source code. This also includes
test subarts (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[[.tst-subart]]&lt;/code&gt;).&lt;/li&gt;
      &lt;li&gt;Markdown format: the default way to specify artifacts is now using
an extended form of commonmark markdown.&lt;/li&gt;
      &lt;li&gt;The docs (including the Simple Quality book) are now distributed directly
with the web app.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;how-was-wasm--yew&quot;&gt;How was WASM / yew?&lt;/h2&gt;
&lt;p&gt;Rewriting the frontend in rust using yew (and compiling to webassembly) was
truly fun and exciting. There was definitely a few areas that needed
improvement; and being willing to contribute to fix your own issues was
&lt;em&gt;critical&lt;/em&gt; with the ecosystem where it is at now – but the responsiveness of
the rust developers has never ceased to amaze me.&lt;/p&gt;

&lt;p&gt;Probably the most amazing thing about writing your whole stack in a single
langauge is code reuse. I have a single crate, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;artifact-ser&lt;/code&gt; with the
serialization datatypes and logic that can be used anywhere in the stack.
This allows me to implement code once and use it anywhere – a benefit
that can seriously not be overstated!&lt;/p&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;I love rust, it is definitely my favorite language at the moment. Writing
a full stack application in pure rust has been an amazing experience.&lt;/p&gt;

&lt;p&gt;The highlights however are definitely my interactions with the community. After
my &lt;a href=&quot;https://vitiral.github.io/2018/01/17/rust2018-and-the-great-cli-awakening.htm&quot;&gt;Rust and the Great CLI
Awakening&lt;/a&gt;
blog post I was invited to be on the &lt;a href=&quot;https://github.com/rust-lang-nursery/cli-wg&quot;&gt;CLI Working
Group&lt;/a&gt;. Unfortunately, that
pulled too much of my time away from rewriting artifact so I had to drop out.
However, my experience there and with the WASM folks has been nothing but
positive. Its been said before and I’ll say it again: Rust has a great
community!&lt;/p&gt;

&lt;p&gt;There is still much work to be done for artifact. For one thing I need to
figure out how to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cargo-web&lt;/code&gt; in CI for mac and windows so that I can
distrubute artifact for those platforms. I also need to finish end to end
testing (including using frontend testing using rust, more on that later!).&lt;/p&gt;

&lt;p&gt;However, one of the primary distractions over the last several months has
been interviewing at Google… and the distractions paid off! I will be
starting as a Test Engineer at Google working on &lt;a href=&quot;http://fortune.com/2018/05/07/volvo-google-assistant-cars/&quot;&gt;Android
Auto&lt;/a&gt;. This is
super exciting, but will not leave a lot of time for working on artifact.
Therefore this blog post is basically also a notice that I will be on haitus
for the next several months as I get up to speed on everything Googly.&lt;/p&gt;

&lt;p&gt;If you find artifact valuable, please leave
&lt;a href=&quot;https://vitiral.github.io/artifact/docs/Feedback.html&quot;&gt;feedback&lt;/a&gt;. Help
in maintaining it would also be much appreciated :).&lt;/p&gt;

</description>
        <pubDate>Mon, 16 Jul 2018 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2018/07/16/artifact-2.0-rust-full-stack-web-and-cli-application.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2018/07/16/artifact-2.0-rust-full-stack-web-and-cli-application.html</guid>
        
        
      </item>
    
      <item>
        <title>Rust2018 And The Great Cli Awakening</title>
        <description>&lt;h1 id=&quot;rust2018-and-the-great-cli-awakening&quot;&gt;#Rust2018 and the Great CLI Awakening&lt;/h1&gt;
&lt;p&gt;This is a response to the &lt;a href=&quot;https://blog.rust-lang.org/2018/01/03/new-years-rust-a-call-for-community-blogposts.html&quot;&gt;#Rust2018&lt;/a&gt; call for blog posts with a little bit of my
experience and how I see the 2018 year moving forward.&lt;/p&gt;

&lt;h2 id=&quot;the-experience-of-writing-a-cli-in-rust&quot;&gt;The Experience of Writing a CLI in Rust&lt;/h2&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;spoiler&lt;/strong&gt;: simultaniously refreshing and painful&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Rust is a fantastic language for writing a Command Line Application (CLI). For the
ergonomics of hacking, it has one of the best &lt;a href=&quot;https://github.com/TeXitoi/structopt&quot;&gt;argument parsers
ever&lt;/a&gt;, has seriously the &lt;a href=&quot;https://github.com/serde-rs/serde&quot;&gt;best serialization library ever&lt;/a&gt;
and it compiles to almost any target and goes &lt;em&gt;fast&lt;/em&gt; when it runs.&lt;/p&gt;

&lt;p&gt;For testing and robustness, its type system prevents you from making stupid
errors, hooking into &lt;a href=&quot;https://github.com/AltSysrq/proptest&quot;&gt;fuzz-testing&lt;/a&gt; is trivial, and there are &lt;a href=&quot;https://github.com/killercup/assert_cli&quot;&gt;better
and better&lt;/a&gt; libraries for testing CLI applications. It is simply
a fantastic language and will be my goto for writing CLIs from now on (and I
come from python!).&lt;/p&gt;

&lt;p&gt;However, there are some serious difficulties. The std library is small, and while
adding functionality from crates with &lt;a href=&quot;https://github.com/killercup/cargo-edit&quot;&gt;cargo-edit&lt;/a&gt; is a simple
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cargo add&lt;/code&gt; away, there are &lt;em&gt;so&lt;/em&gt; many crates that make up a typical CLI, each
one requring you to add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;extern crate foo&lt;/code&gt; to your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main.rs&lt;/code&gt; and then have to
write &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;use foo&lt;/code&gt; at the top of every file you want to use it.&lt;/p&gt;

&lt;p&gt;Probably the most significant paper cut is that rust’s error handling semantics
of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Result&amp;lt;T, E&amp;gt;&lt;/code&gt; don’t work well for the CLI use case. In most cases a CLI
works like a compiler: I want to show the user &lt;em&gt;all&lt;/em&gt; the things that are wrong,
not fail on the first error I find! There needs to be a standard crate for
handling a “stream of errors and warnings”, probably via a channel, which I can
query “were there errors in the last function?”.&lt;/p&gt;

&lt;h2 id=&quot;filling-the-gaps&quot;&gt;Filling the Gaps&lt;/h2&gt;
&lt;p&gt;I have a strong desire to fill the gaps that exist in the ecosystem today. I am
currently doing a complete rewrite of my command line and web application
&lt;a href=&quot;https://github.com/vitiral/artifact&quot;&gt;artifact&lt;/a&gt;, and am using that use case to “fill the holes” that I see.&lt;/p&gt;

&lt;p&gt;Here are some of the things I am working on to fill the gaps. I would like
help from the community as well.&lt;/p&gt;

&lt;h3 id=&quot;gap-1-working-with-paths&quot;&gt;Gap 1: Working with Paths&lt;/h3&gt;
&lt;p&gt;I found working directly with paths to be &lt;em&gt;extremely annoying&lt;/em&gt;. Does my path
exist? Is it equal to this other path? Is my path a file or a directory and why
can’t a type tell me? Why is creating/writing/appending a string to my path not
possible in a single line of code?&lt;/p&gt;

&lt;p&gt;To solve this I wrote the crate &lt;a href=&quot;https://github.com/vitiral/path_abs&quot;&gt;path_abs&lt;/a&gt;. It exports types which
guarantee that all paths exist and are absolute. Even better, it has &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PathFile&lt;/code&gt;
and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PathDir&lt;/code&gt; types with commonly used methods attached to them.&lt;/p&gt;

&lt;p&gt;Oh and did I mention that you can serialize the paths with serde? That was
one of my biggest pain points – if I have a path I can’t stick it in a struct
which I want to send anywhere. This library solves that and more.&lt;/p&gt;

&lt;p&gt;This was one of my biggest pain points developing a CLI in rust, and it was
filled (by me…) in early 2018 – so the year is already looking good for
CLI ergonomics!&lt;/p&gt;

&lt;h3 id=&quot;gap-2-writing-tests&quot;&gt;Gap 2: writing tests&lt;/h3&gt;
&lt;p&gt;Rust makes it extremely simple to write &lt;em&gt;unit tests&lt;/em&gt;, but once you want to
do a more end-to-end test there isn’t a lot out there. Unfortunately, testing
a CLI application requires end to end tests to be confident you are giving
the user the experience you expected.&lt;/p&gt;

&lt;p&gt;If all your text is plain (not colored or formatted) then
&lt;a href=&quot;https://github.com/killercup/assert_cli&quot;&gt;assert_cli&lt;/a&gt; is the crate for you. However, the second you put
style or color – or even a table – in your application it becomes a tedious
affair of editing a string of raw bytes every time you make a minor change to
your application.&lt;/p&gt;

&lt;p&gt;I’m currently working on a CLI testing &lt;em&gt;framework&lt;/em&gt; built in rust, using the new
crate I wrote called &lt;a href=&quot;https://github.com/vitiral/termstyle&quot;&gt;termstyle&lt;/a&gt; to aid in being able to easily
express your styles (when you write your app) and then make it easy to test
them as well. The goal is to be able to write your CLI tests in a simple YAML
file and get clear diffs against the expected vs result. One of the benefits:
while you are writing your tests there is no compilation time if you are not
touching your source code – and running the tests takes almost no time at all!&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Shoutout to &lt;a href=&quot;https://github.com/colin-kiegel/rust-pretty-assertions&quot;&gt;pretty_assertions&lt;/a&gt; for making reading diffs
in regular rust tests SO much easier. This is a life saver for CLI
applications!&lt;/p&gt;

  &lt;p&gt;Also shoutout to the &lt;a href=&quot;https://doc.rust-lang.org/std/fmt/#sign0&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;{:#?}&quot;&lt;/code&gt;&lt;/a&gt; pretty printing formatter.  When
I discovered it I felt like the largest pain point of rust just vanished.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;gap-3-working-with-errors&quot;&gt;Gap 3: working with errors&lt;/h3&gt;
&lt;p&gt;This one is a little bit more difficult and I am currently trying out solutions
in my rewrite of artifact.&lt;/p&gt;

&lt;p&gt;The basic idea is this:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Instead of returning errors, I get passed a &lt;a href=&quot;https://doc.rust-lang.org/std/sync/mpsc/struct.Sender.html&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Sender&lt;/code&gt;&lt;/a&gt; object
where I push errors/warnings/info to that may or may not end up getting
displayed to the user. (note: I use a sender so that multithreading is
trivial)&lt;/li&gt;
  &lt;li&gt;If I don’t get any useful work done, I return &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;None&lt;/code&gt;, but there might have
been &lt;em&gt;several&lt;/em&gt; errors that contributed to that instead of only one.&lt;/li&gt;
  &lt;li&gt;The function above me checks for errors and can choose to exit early.
At the highest levels, the errors are sorted and displayed to the user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I would like to do is leverage something like &lt;a href=&quot;https://github.com/slog-rs/slog&quot;&gt;slog&lt;/a&gt; for this
purpose. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;slog&lt;/code&gt; has a similar design: it wants you to pass a “log sender”
into every function/struct and log to that. What I need is a way to &lt;em&gt;query&lt;/em&gt;
what logs have been passed (in particular whether they are errors). More
investigation is necessary, but I (personally) found slog very difficult to get
running. Maybe simply improving &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;slog&lt;/code&gt;’s ergonomics could fill this gap and
simultaniously provide built-in logging?&lt;/p&gt;

&lt;h3 id=&quot;gap-4-bringing-it-all-together&quot;&gt;Gap 4: bringing it all together&lt;/h3&gt;
&lt;p&gt;The fourth major gap is the ergonomics &lt;em&gt;of actually using&lt;/em&gt; the ecosystem. It is
often stated that rust’s ecosystem is immature. While this is somewhat true,
the real issue is in &lt;em&gt;finding&lt;/em&gt; and &lt;em&gt;using&lt;/em&gt; the pieces you need.&lt;/p&gt;

&lt;p&gt;My final major project this year (along with artifact itself) is to flush out
the &lt;a href=&quot;https://github.com/vitiral/stdcli&quot;&gt;stdcli&lt;/a&gt; crate. The goal (unlike the similar crate &lt;a href=&quot;https://github.com/brson/stdx&quot;&gt;stdx&lt;/a&gt;) is
to have a &lt;em&gt;specific use case in mind&lt;/em&gt; – which is to create a Command Line SDK.&lt;/p&gt;

&lt;p&gt;I have made significant progress already, and will flush out the first release
as I rewrite artifact, but the primary goal is to reduce the number of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;use foo&lt;/code&gt;
and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;external crate foo&lt;/code&gt; statements that have to be made (especially regarding
traits), by providing a &lt;em&gt;standard prelude&lt;/em&gt; for developing CLI applications. The
idea is that developing a CLI using stdcli should almost feel like a completely
different language. Everything you need should be directly within reach, and
the only crates you need to add should be application specific.&lt;/p&gt;

&lt;p&gt;Unlike stdx, I plan on using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;gt;=X.Y.Z&lt;/code&gt; syntax for all dependencies. I then
plan on setting up something similar to Crater. If your application depends on
stdcli and you have a solid set of tests then you can have your project run
automated tests with it’s dependencies continuously updated. This will give
you a feeling of security that you can stay on the cutting edge, because stdcli
will be detecting any regressions and opening bugs with the relevant libraries.&lt;/p&gt;

&lt;h2 id=&quot;gap-5-stretch-distributing-your-application&quot;&gt;Gap 5 (stretch): Distributing Your Application&lt;/h2&gt;
&lt;p&gt;This one is a bit of a stretch, but I would like to have a simple way to
distribute applications written in rust that doesn’t require me to maintain a
build systems on Travis and Appveyor for 3 platforms. I am seriously looking at
the Nix project as the savior to all my woes. I don’t have much more to say
except that the rust team’s goal of making it easier to integrate cargo into
build system is &lt;em&gt;much&lt;/em&gt; appreciated.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I think CLI applications are (perhaps surprisingly) one of rust’s strong suites,
and it needs only a few relatively minor tweaks to make it the best language
for developing CLIs bar none.&lt;/p&gt;

&lt;p&gt;The introduction of webassembly and being able to write client-side web
applications will only make this case &lt;em&gt;stronger&lt;/em&gt;. Imagine being able to expose
a CLI application that can launch a static (or dynamic+backend) webpage
whenever that makes sense. Imagine &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ps&lt;/code&gt; (for monitoring processes), but you
could do &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ps serve&lt;/code&gt; and it would pop open a dynamically updating processor
status in your browser, with complex searching and graphing functionality built
in.&lt;/p&gt;

&lt;p&gt;Rust will push this frontier. We are going to see more and more hybrid CLI/Web
applications being built every day and rust could be the language of choice. I
think it will be, and I think #Rust2018 will be what turns the tide.&lt;/p&gt;

</description>
        <pubDate>Wed, 17 Jan 2018 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2018/01/17/rust2018-and-the-great-cli-awakening.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2018/01/17/rust2018-and-the-great-cli-awakening.html</guid>
        
        
      </item>
    
      <item>
        <title>Password Manager In Rust Using Argon2</title>
        <description>&lt;h1 id=&quot;my-second-cli-application-in-rust-was-so-fun&quot;&gt;My second CLI application in rust was so fun!&lt;/h1&gt;

&lt;p&gt;I’ve had an itch to write a better password manager using my favorite
language (rust), and this last weekend I decided to give it a go.
I’ve spent the last year writing the &lt;a href=&quot;https://github.com/vitiral/artifact&quot;&gt;artifact&lt;/a&gt; command line
application (which just hit 1.0, check it out!).&lt;/p&gt;

&lt;p&gt;I had already written a “vault” password manager in python, called
&lt;a href=&quot;https://github.com/vitiral/litevault&quot;&gt;litevault&lt;/a&gt; using scrypt to decrypt AND encrypt the passwords.
That was cool, but had several issues:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Didn’t run on python3. I’m pretty good at writing for both but
I kept hitting minor bugs and finally just gave up.&lt;/li&gt;
  &lt;li&gt;Adding passwords was a pain – I wrote a helper to “merge” two
vaults but it was a nerve wracking experience.&lt;/li&gt;
  &lt;li&gt;The thought of forgetting to commit the vault was scarry – the
passwords were randomly generated so they would be just &lt;em&gt;gone&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have kept my eye on the application &lt;a href=&quot;http://masterpasswordapp.com/&quot;&gt;masterpassword&lt;/a&gt; for some time, but
I’ve never been quite happy with its mixture of features. Why does it need
to know my name? What is up with the colorful symbols coresponding to a
password?&lt;/p&gt;

&lt;p&gt;All I wanted was something that using a hash of the password for
validation purposes, and then site passwords are just a hash of the
same password. The setings, reference hash and existing sites should
be stored in a simple toml file, which can be put on github.&lt;/p&gt;

&lt;p&gt;So I set out to write it and have completed the working implementation:
&lt;a href=&quot;https://github.com/vitiral/novault&quot;&gt;novault&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;rust-is-da-best&quot;&gt;Rust is da best&lt;/h2&gt;
&lt;p&gt;The first thing that hit me was how quickly I was up and running.  I started by
thinking I would use SHA512 hashing and quickly &lt;a href=&quot;https://github.com/sfackler/rust-openssl&quot;&gt;found a library&lt;/a&gt;. I used
&lt;a href=&quot;https://www.google.com/search?q=rust+cargo+add&amp;amp;ie=utf-8&amp;amp;oe=utf-8&quot;&gt;cargo-edit&lt;/a&gt; to achieve an impresive pace of adding libraries – every
library was a quick cli command away. Having written a cli app before, I knew
what I wanted. I used a &lt;a href=&quot;https://github.com/vitiral/stdcli&quot;&gt;list of cli libraries&lt;/a&gt; I had compiled to cut
through my requirements like butter. Within a few hours of work I had a working
prototype that compiled and &lt;em&gt;actually ran&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I spent the next few hours cleaning up the docs. I discovered that maybe SHA512
wasn’t secure enough for storing the hash in plain-text on the internet so
instead settled on &lt;a href=&quot;https://en.wikipedia.org/wiki/Argon2&quot;&gt;Argon2, the winner of the 2015 Password Hashing
Competition&lt;/a&gt;. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;argon2rs&lt;/code&gt; library was a quick &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cargo add&lt;/code&gt; away, and the docs
could be read with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cargo doc --open -p argon2rs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I refactored the library to use types for everything I cared about. It is now
IMPOSSIBLE to serialize the user’s master password (outside of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;secure.rs&lt;/code&gt;), and
serializing a site password (even PRINTING it) requires using it’s
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;password.audit_this&lt;/code&gt; attribute.&lt;/p&gt;

&lt;h2 id=&quot;the-application&quot;&gt;The Application&lt;/h2&gt;
&lt;p&gt;The NoVault application itself is now in a pretty good state.  I would really
appreciate some people more versed in security to give it an audit, as well as
any contributions or tests anyone wants to contribute. It can currently be
installed by installing rust and using&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cargo install novault
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I will probably start actually using it in the comming month. For now I am
just using it to store my reddit password, which is &lt;a href=&quot;https://github.com/vitiral/dotfiles&quot;&gt;on github&lt;/a&gt;. Feedback
and audits would be great!&lt;/p&gt;

</description>
        <pubDate>Tue, 12 Sep 2017 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2017/09/12/password-manager-in-rust-using-argon2.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2017/09/12/password-manager-in-rust-using-argon2.html</guid>
        
        
      </item>
    
      <item>
        <title>Distribution Of Rust Binaries</title>
        <description>&lt;h1 id=&quot;rust-ergonomics-101-fast-and-easy-access-to-the-tools&quot;&gt;Rust ergonomics 101: fast and easy access to the tools&lt;/h1&gt;

&lt;h2 id=&quot;the-problem&quot;&gt;The Problem&lt;/h2&gt;
&lt;p&gt;One of the pain points often mentioned around rust is the long compilation
times. While this is certainly an issue I would like addressed, it is often
over-hyped in my opinion when talking about developing in rust.&lt;/p&gt;

&lt;p&gt;However, when trying to download applications distributed in rust, the compile
times become a &lt;em&gt;huge pain&lt;/em&gt; since the standard as of today seems to be to
distribute applications via cargo. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cargo install &amp;lt;crate&amp;gt;&lt;/code&gt; requires the full
download and compilation of all crate dependencies, which can easily take more
than half an hour for several applications.&lt;/p&gt;

&lt;p&gt;This is unnacceptable in my opinion, and it really harms rust as a language
that tools like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rustfix&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cargo-edit&lt;/code&gt;, etc have to be installed through
cargo. When I want to create a fake virtual env I require all my contributors
to have these in their local path – but setting up all these tools takes
upwards of 40 minutes on my laptop (!).&lt;/p&gt;

&lt;h2 id=&quot;one-possible-solution-0install&quot;&gt;One possible solution: 0install&lt;/h2&gt;
&lt;p&gt;The solution is simple: rust allows extremly easy cross compilation and
deployment of binaries through the amazing template &lt;a href=&quot;https://github.com/japaric/trust&quot;&gt;trust&lt;/a&gt; which uses
&lt;a href=&quot;https://github.com/japaric/cross&quot;&gt;cross&lt;/a&gt;. In the future I would like to make a script for setting up this
template, but for now it works quite well and &lt;a href=&quot;https://github.com/vitiral/artifact&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot;&gt;rust&lt;/a&gt; projects use
it.&lt;/p&gt;

&lt;p&gt;However, distributing a binary is not enough – there needs to be an easy way
to install it for any platform – whether that be included in a build script,
a “virtual environment”, or a user’s desktop. I thought about going out and
creating such a tool and then I came accross &lt;a href=&quot;http://0install.net/&quot;&gt;0install&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;0install relies on only a &lt;em&gt;webpage&lt;/em&gt; for knowing how to install software.
The webpage simply needs to include the xml data of the binaries and
dependencies – and &lt;em&gt;that’s it&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I like the design philosophy of 0install, but I had an impossible time
&lt;em&gt;actually installing it&lt;/em&gt; on my arch linux system. There is an &lt;a href=&quot;https://github.com/0install/0install/issues/58&quot;&gt;open bug&lt;/a&gt;
about this. In addition, I opened &lt;a href=&quot;https://github.com/0install/0install/issues/59&quot;&gt;another one&lt;/a&gt; requesting a pre-compiled
binary. Since 0install is written in OCaml, I don’t know how likely
this is to be fulfilled.&lt;/p&gt;

&lt;h2 id=&quot;another-solution-where-rust-can-shine&quot;&gt;Another Solution: where rust can shine&lt;/h2&gt;
&lt;p&gt;Distributing an easy to install binary is an area where rust can really shine.
I &lt;a href=&quot;https://github.com/vitiral/artifact&quot;&gt;already distribute artifact&lt;/a&gt; as a pre-compiled binary and it is
works really well.&lt;/p&gt;

&lt;p&gt;So this blog post might be the lanch of my next project: a simple binary
package manager written in rust. The requirements are similar to
0install but I am trying to make it even simpler. I call the tool
wpkg (“web package”, like wget but for package installation). I’ve started
the initial design approach and would love to know who is interested
and if anyone might want to join the effort.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/vitiral/wpkg&quot;&gt;https://github.com/vitiral/wpkg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have an opinion (either positive or negative) please
&lt;a href=&quot;https://github.com/vitiral/wpkg/issues&quot;&gt;open an issue&lt;/a&gt; and let me know!&lt;/p&gt;

&lt;h2 id=&quot;edit-nix-to-the-rescue&quot;&gt;Edit: Nix to the rescue&lt;/h2&gt;
&lt;p&gt;Although this doesn’t meet quite ALL my requirements (mainly that it still
requires packaging in the Nix repo), I am very interested in the &lt;a href=&quot;https://nixos.org/nix/&quot;&gt;Nix package
manager&lt;/a&gt;. &lt;a href=&quot;https://dzone.com/articles/isolated-development-environment-using-nix&quot;&gt;This blog post&lt;/a&gt; details how it can be used as a virtualenv
esq package manager.&lt;/p&gt;

</description>
        <pubDate>Fri, 01 Sep 2017 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2017/09/01/distribution-of-rust-binaries.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2017/09/01/distribution-of-rust-binaries.html</guid>
        
        
      </item>
    
      <item>
        <title>One Year With Rust</title>
        <description>&lt;h1 id=&quot;i-wrote-a-full-featured-application-in-rust-and-so-can-you&quot;&gt;I wrote a full featured application in rust, and so can you!&lt;/h1&gt;

&lt;p&gt;This past year has been one of the most exciting years of programming for me,
and a large part of that is due to the programming language rust. It has been
nine months since I started writing &lt;a href=&quot;https://github.com/vitiral/artifact&quot;&gt;artifact&lt;/a&gt;, and about a year since I
first started learning rust. Artifact is in its final beta release, and I
couldn’t possibly be happier with the rust language.&lt;/p&gt;

&lt;p&gt;Before writing python at my current job as a Software Engineer in Test, I was an
Electrical Engineer who mostly had experience with C for microcontrollers.
When I first learned python it was an absolute breath of fresh air – I felt
like I could develop for every-day needs (other than microcontrollers) with
very little effort. The code was beautiful, easy to read and fairly easy to
write. I felt like there was no other language for me.&lt;/p&gt;

&lt;p&gt;After writing python for more than a year as my day job however, I started to
see the rough edges of the language. Making small changes caused catastrophic
trivial problems like AttributeErrors to propagate throughout the code base.
Since our code was not well unit tested (its own problem to be sure) these
problems, coupled with a dynamic language like python, quickly became a
nightmare.&lt;/p&gt;

&lt;p&gt;When I started to think about what kind of testing would need to be done to
mitigate these problems I balked: unit tests would basically have to be written
to validate not just a function but &lt;em&gt;callers&lt;/em&gt; of the function to make sure they
were passing in the right type. The looseness of python was going to require a
huge amount of boilerplate and pain.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: tools like mypy would help alleviate some of these issues, and we are
currently using Pycharm’s type checking for all new code. However, there are
still problems (such as exception handling) which make you afraid when writing
python code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s when I started looking for a new languages, and the two I decided to
check out were Go and rust.&lt;/p&gt;

&lt;p&gt;I have to admit, I really really &lt;em&gt;loved&lt;/em&gt; the design concepts of Go. Keep it
simple, keep the number of concepts small, and try and stay out of your way as
much as possible. I wrote a bit with Go and it was exactly as it billed itself
to be: dead simple, no frills, almost no abstraction at all. Actually kind of
pythonic in a strange way, but with a type system and more robust error
handling. It stayed out of my way… but made me do everything. Although Go
contains a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;for&lt;/code&gt; loop it doesn’t have any concept of iterators (except the one
built into the langauge). This kind of magic bothered me at some deep level.&lt;/p&gt;

&lt;p&gt;After spending a week doing the Go tutorials I decided that although I liked the
language alright it just wasn’t &lt;em&gt;fun&lt;/em&gt;. I wasn’t learning anything, and if I
ever wanted to use it at a job I could easily pick up the language in a few
weeks. Possibly more importantly, my EE background chimed in – “could you write
an Operating System in this? How about code on a microcontroller?.” I have to
admit, I am the kind of person who want’s a language that is completely general
purpose and can be used for &lt;em&gt;any&lt;/em&gt; task, and Go wasn’t that language. It was very
clearly designed for one specific purpose – and that wasn’t a purpose I was
very interested in.&lt;/p&gt;

&lt;p&gt;That left me with rust, which had recently reached 1.0 and was &lt;em&gt;extremely
capable&lt;/em&gt; of doing anything I might want it to do. Plus, it offered things which
were completely new: concurrency without fear, safety without garbage
collection and abstraction without cost. I was enthralled, and dove in quickly. I
found the borrow checker surprisingly easy to learn (much easier to learn that
trying to do an equivalent thing in C), and although passing around lifetimes
threw me for a loop for a long time (I was missing that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;'a, 'b: 'a&amp;gt;&lt;/code&gt; means
that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;'b&lt;/code&gt; outlives &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;'a&lt;/code&gt;) progress was good.&lt;/p&gt;

&lt;p&gt;It was around that time that my work held a training on Risk Based Testing, and
my entire opinion of the software development community’s best practices were
completely torn down. I quickly realized that we should be writing down our
requirements, linking them to our design specifications and writing out the high
risk test cases for &lt;em&gt;every project&lt;/em&gt;, no matter how small. Doing so was a
&lt;em&gt;pillar of good software development&lt;/em&gt;, and we weren’t doing it.&lt;/p&gt;

&lt;p&gt;I quickly realized why - there were no good tools for us to do it in a way that
made it easier for us to do our jobs. I wanted to do this for small projects,
so I started looking for a simple command line tool that could get the job
done… and hit a dead end. How could this be? How could such a simple and
important thing not exist? All I needed to do is name an artifact, write down a
description, and be able to link it to other artifacts. This is a simple
problem.&lt;/p&gt;

&lt;p&gt;You can probably guess what happened next: I decided to create it. Hundreds of
hours of learning and programming later my tiny and simple command line tool
is now a full featured application with a whole suite of submodules
and static and hosted web-page support (I learned Elm too!). It has entered its
final beta release, with 1.0 slated for sometime next month.&lt;/p&gt;

&lt;p&gt;The code base has grown to be larger than I expected, about 7000 lines of code.
I have refactored the &lt;em&gt;design documents&lt;/em&gt; at least 3 times (something that was
very easy using the artifact tool) and have refactored large amounts of the
codebase several times more than that. My fairly extensive unit tests have
smoothed those efforts, but the rust language itself has been nothing less than
spectacular. People often say of rust “if it compiles, it runs” – and they
aren’t wrong. I can remove or change a critical struct or function base and
typically only have to fix the compiler errors. Adding new features is almost as
simple.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;In conclusion, I wrote a large and feature full application in rust and so can
you! Some say that rust’s libraries are not mature, but for these purposes they
are extremely well developed and supported. When I think about how things would
have been had I written artifact using python (a language with arguably the
&lt;em&gt;most&lt;/em&gt; mature libraries) I run away scared. Every time I had refactored my
library would have been hours of grueling effort running and rerunning the
commands trying to hunt down every new bug. With rust, the compiler tells me
almost 100% of what needs to be fixed.&lt;/p&gt;

&lt;p&gt;If you’re interested in simple quality development best practices, check out my
new open source book &lt;a href=&quot;https://vitiral.gitbooks.io/simple-quality/content/&quot;&gt;Simple Quality&lt;/a&gt; and its associated tool &lt;a href=&quot;https://github.com/vitiral/artifact&quot;&gt;artifact&lt;/a&gt;.
It has been a pleasure working on them, and I look forward to help improve the
quality best practices of the software development community for years to come.&lt;/p&gt;

</description>
        <pubDate>Sat, 25 Feb 2017 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2017/02/25/one-year-with-rust.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2017/02/25/one-year-with-rust.html</guid>
        
        
      </item>
    
      <item>
        <title>Rst Server</title>
        <description>&lt;h1 id=&quot;rst-03-released-now-with-a-web-ui-and-windows-linux-and-mac-osx-binaries&quot;&gt;rst 0.3 released, now with a web ui and windows, linux and mac osx binaries!&lt;/h1&gt;

&lt;p&gt;I have just released the 0.3beta release of &lt;a href=&quot;https://github.com/vitiral/rst/releases&quot;&gt;rst&lt;/a&gt;,
the requirements tracking tool made for developers. This release brings many benefits,
including support for all major platforms and a web-ui for viewing requirements. In
addition, I have a clear path forward for how to make the web-ui be able to edit
the requirements as well.&lt;/p&gt;

&lt;p&gt;There are many points I would like to cover in this post, in summary they are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;rst’s licensing changes&lt;/li&gt;
  &lt;li&gt;learning a new programing langugage to write the front end in, &lt;a href=&quot;http://elm-lang.org/&quot;&gt;elm&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;using &lt;a href=&quot;https://github.com/nickel-org/nickel.rs&quot;&gt;nickel.rs&lt;/a&gt; and the
  &lt;a href=&quot;https://github.com/ethcore/jsonrpc-core&quot;&gt;jsonrpc_core&lt;/a&gt; rust libraries
  for the backend&lt;/li&gt;
  &lt;li&gt;packaging the static html files directly into the released rust binary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;rst&lt;/strong&gt;’s primary goal is to be &lt;em&gt;simple&lt;/em&gt; – to make it easy to track requirements and
integrate into development tools. It will always run locally on your machine&lt;/p&gt;

&lt;h2 id=&quot;change-to-a-copy-left-license&quot;&gt;Change to a copy-left license&lt;/h2&gt;
&lt;p&gt;Just before the 0.3 release I switched rst’s license from the MIT permissive
license to the LGPLv3+ copy-left license and I would like to talk a little bit
about why.&lt;/p&gt;

&lt;p&gt;rst is an application tool that I strongly feel developers need. Requirements
tracking and detailed design are core pillars to effective software development,
and yet there are really no tools to express these ideas that improve a
developer’s &lt;em&gt;day to day&lt;/em&gt; work. In summary, there is nothing like git for
requirements tracking.&lt;/p&gt;

&lt;p&gt;But there should be! What are requirements but a name,
a piece of text and links to other requirements? This is a simple problem with
a simple solution, but the industry has not pursued simplicity – all we’ve
gotten is large web tools with database backends.&lt;/p&gt;

&lt;p&gt;By having your requirements be simple text files that live in your code,
you get another benefit – the requirements can easily link &lt;strong&gt;to&lt;/strong&gt; your code
and be revision controlled &lt;strong&gt;with&lt;/strong&gt; your code. This allows you to integrate
your requirements with tools you already use for tracking your code development
(github, Atlassian, etc).&lt;/p&gt;

&lt;p&gt;Because rst’s very design is to enable simplicity, it was important to me
that the core library always remain open source. That is why I chose LGPL, it
allows propriety companies to use rst as a library and build on it, but if
they want new features then they need to share. Free developer tools should
remain free and companies that want to improve them should contribute.&lt;/p&gt;

&lt;p&gt;On the other hand, I fully support using rst within a larger application,
and that is why I am using the “Lesser” GPL which allows others to build
on rst and why the format for the artifact files are public domain.&lt;/p&gt;

&lt;h2 id=&quot;learning-elm&quot;&gt;Learning Elm&lt;/h2&gt;
&lt;p&gt;The rst backend and cmd line tool are written in
&lt;a href=&quot;https://www.rust-lang.org/en-US/&quot;&gt;rust&lt;/a&gt; a systems programming language that
runs blazingly fast, prevents segfaults, and guarantees thread safety. There
really is no replacing rust – it is an amazing language for the backend.
The safety guarantees make runtime errors practically impossible.&lt;/p&gt;

&lt;p&gt;Elm is a functional programming language designed from the ground up to make
WebUIs that are maintainable and fun to program. I have to say they accomplished
all those goals, and learning elm after learning rust was pretty much a matter
of just learning new syntax. Many of the concepts that rust taught such as
&lt;a href=&quot;http://rustbyexample.com/expression.html&quot;&gt;expressions returning a value&lt;/a&gt;
and &lt;a href=&quot;http://rustbyexample.com/flow_control/match.html&quot;&gt;pattern matching&lt;/a&gt;
were utilized for exactly the same benefit in elm.&lt;/p&gt;

&lt;p&gt;A frontend in elm with a backend in rust is a match made in heaven: fun,
performant and safe.&lt;/p&gt;

&lt;h2 id=&quot;rust-web-development&quot;&gt;Rust web development&lt;/h2&gt;
&lt;p&gt;Before I got too far, I would like to give a shoutout to
&lt;a href=&quot;https://github.com/nickel-org/nickel.rs&quot;&gt;nickel.rs&lt;/a&gt; and
&lt;a href=&quot;https://github.com/ethcore/jsonrpc-core&quot;&gt;jsonrpc_core&lt;/a&gt;. They made developing
a json-rpc backend about as easy as anyone could ask for.&lt;/p&gt;

&lt;p&gt;What was really fun was learning how to package an elm/node app into
a rust binary – it turned out to be surprisingly easy! I used
&lt;a href=&quot;https://github.com/casey/just&quot;&gt;just&lt;/a&gt; to create a simple makefile which
compiles my node/elm frontend into a tar file that I included in the source.
I then then use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;include_bytes!&lt;/code&gt; macro to include the tar file directly in
the rust binary during the build. I then followed the directions on
&lt;a href=&quot;https://github.com/japaric/rust-everywhere&quot;&gt;rust-everywhere&lt;/a&gt; to compile
rust for linux, mac and windows. It was a pain figuring out how to
package the node-app in a &lt;em&gt;cross platform&lt;/em&gt; manner, but other than that
it went really smoothly!&lt;/p&gt;

&lt;p&gt;With nickel, hosting was as simple as
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;server.utilize(StaticFilesHandler::new(&amp;amp;tmp_dir))&lt;/code&gt;, where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tmp_dir&lt;/code&gt; was
just the unpacked &lt;a href=&quot;https://github.com/alexcrichton/tar-rs&quot;&gt;tarfile&lt;/a&gt;
in a temporary directory created by
&lt;a href=&quot;https://github.com/rust-lang-nursery/tempdir&quot;&gt;tempdir&lt;/a&gt;. Big shoutout to
&lt;a href=&quot;https://github.com/alexcrichton&quot;&gt;alexcrichton&lt;/a&gt;, along with your
&lt;a href=&quot;https://github.com/alexcrichton/toml-rs&quot;&gt;toml&lt;/a&gt; library I have used an
incredible number of your tools for core development needs – you have
done an incredible amount to make rust useful for developing complex
applications!&lt;/p&gt;

&lt;p&gt;If you want more details, check out the source code at
https://github.com/vitiral/rst.&lt;/p&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;p&gt;Huge steps have been made in the development of rst, with a read-only web-ui
deployed, and a fully supported one which includes editing just around the
corner. I simply cannot be thankful enough to the wonderful people who have made
rust and elm what they are today. These languages make development easy and
&lt;em&gt;fun&lt;/em&gt;, and anything that I can do to support them I will do.&lt;/p&gt;
</description>
        <pubDate>Wed, 30 Nov 2016 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/2016/11/30/rst-server.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/2016/11/30/rst-server.html</guid>
        
        
      </item>
    
      <item>
        <title>Why hackers should track their requirements</title>
        <description>&lt;p&gt;&lt;a href=&quot;https://en.m.wikipedia.org/wiki/Software_requirements_specification&quot;&gt;“Creating requirements”&lt;/a&gt; 
may not be the first two words that come to mind
when you think of a hacker, but nothing could be more important. Whether
those requirements exist entirely inside the developer’s head or span multiple directories
depends on the person and the project they are working on, but all of
us create requirements if we expect the product of our efforts to look
anything like what we were intending to create. Oftentimes, the quality
of our requirements directly corelate to the quality of our product.&lt;/p&gt;

&lt;p&gt;It is for the hacker that I developed the tool &lt;a href=&quot;https://github.com/vitiral/rst&quot;&gt;rst&lt;/a&gt;.
It is an ultra-simple method of writing requirements and specifications so
they can be tracked throughout the lifecycle of a project.&lt;/p&gt;

&lt;p&gt;Common developer wisdom (hacker and enterprise alike) now tells us that we 
should always be using revision control, that we should always be writing unit 
tests and that we should keep good documentation – and we should, and there are a 
ton of great tools for doing exactly those things. However, those “core pillars”
of good software development miss one of the most important pieces, and that is 
writing down your requirements, creating your high level design (linked to your 
reqs), and thinking about what tests to write before you write your code.&lt;/p&gt;

&lt;p&gt;All the tools that I have seen for this are Web/GUI’s that are clunky and 
difficult to integrate. They are particularily ill-suited to small projects.
It doesn’t make sense to me. If we are to become good at requirements, we need
to practice for small projects so that we know what we are doing for large ones.
This problem isn’t difficult to solve: requirements are just text that
have a few basic features:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;you want to be able to name them&lt;/li&gt;
  &lt;li&gt;you want to be able to describe them&lt;/li&gt;
  &lt;li&gt;you want to be able to link them&lt;/li&gt;
  &lt;li&gt;you want to be able to track their completeness&lt;/li&gt;
  &lt;li&gt;you want to be able to revision control them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These four goals are trivial to accomplish for a text based tool and
quite difficult to accomplish for a GUI tool. Why then are so many
requirements tracking tools GUI based?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/vitiral/rst&quot;&gt;rst&lt;/a&gt; chooses to be simple instead of
complicated, while still choosing to provide features users want (i.e.
viewing requirements via the web in future releases). Creating 
requirements and specifications is something all of us should be doing 
for our projects – wouldn’t it be great if it were easy to do?&lt;/p&gt;

&lt;p&gt;I intend to add a “hacker’s guide to quality” tutorial to the 
&lt;a href=&quot;https://github.com/vitiral/rst/wiki&quot;&gt;rst wiki&lt;/a&gt; over the next couple of months.
I would highly appreciate feedback from developers all over the world about
how they address quality in their projects, and what &lt;strong&gt;rst&lt;/strong&gt; could do to
help them.&lt;/p&gt;
</description>
        <pubDate>Mon, 08 Aug 2016 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/developer/2016/08/08/why-hackers-should-track-their-requirements.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/developer/2016/08/08/why-hackers-should-track-their-requirements.html</guid>
        
        
        <category>developer</category>
        
      </item>
    
      <item>
        <title>Software Development Best Practices for the Average Developer</title>
        <description>&lt;p&gt;It is hard to make good software. For a project to be successful, every team member must
bring quality with the work they do. Quality is an elusive attribute, gotten through some
combination of knowledge, discipline, tooling and planning.&lt;/p&gt;

&lt;p&gt;It feels as though the ease of developing quality software has been going up. Powerful tools
and methodologies like git, unit-testing, agile and others have significantly increased
the productivity and quality of the work done by developers. By providing powerful revision
control tied with short testing cycles, it is much easier to develop software which meets
the requirements and is robust even with changing requirements.&lt;/p&gt;

&lt;p&gt;There is an enourmous gap, however, in current software development practices, and that is
an almost complete failure to adhere to and develop tools for actually following best practices –
by which I mean the process of requirements gathering, developing detailed design specifications,
risk analysis and test design.&lt;/p&gt;

&lt;p&gt;I blame this, primarily, on the almost complete lack of tools for &lt;em&gt;developers&lt;/em&gt; to use to meet 
these needs. Most developers depend on writing their thoughts down on a wiki, including them
in code documentation or other such unreliable and untrackable means. Sure, there is some
expensive proprietary software that might help, but non of it seems to be designed for those
who hack at code in their day to day. In other words, none of it seems to be designed for
the people who are actually developing software.&lt;/p&gt;

&lt;p&gt;In the same way that writing tests can help you write better code, writing and tracking your
requirements, specifications and test-designs can help you be a better software developer.
But in order to become better at following best practicies, you need to apply them
and see their value in every project you work on – from the smallest personal project to the largest
project involving a team or community of people.&lt;/p&gt;

&lt;p&gt;That is why I have decided to create &lt;a href=&quot;https://github.com/vitiral/rsk&quot;&gt;rsk&lt;/a&gt;, an open source
requirements tracking tool made for developers. The hope is that by creating a simple and highly
scalable tool which uses commands and formats developers are already familiar with,
developers will be able to easily follow design best-practices as often as they follow
unit testing best-practices – and they will get at least as much value from doing so.&lt;/p&gt;

&lt;p&gt;Although I am fairly new to software development and even newer to quality, it is my intent
to create a wiki which both explains how to use this tool as well as educating the average
software developer about the usefullness of requirements gathering and detailed design.
My hope is that all projects (especially open source) can be well designed and that progress, 
new features and completeness can be easily tracked by anyone using a command line tool that 
is easy to become familiar with.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: &lt;strong&gt;rsk&lt;/strong&gt; is still in pre-alpha, and is not considered usable. This blog post is about
why I am writing rsk.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
        <pubDate>Fri, 10 Jun 2016 00:00:00 +0000</pubDate>
        <link>http://vitiral.github.com/software,/quality/2016/06/10/best-practices.html</link>
        <guid isPermaLink="true">http://vitiral.github.com/software,/quality/2016/06/10/best-practices.html</guid>
        
        
        <category>software,</category>
        
        <category>quality</category>
        
      </item>
    
  </channel>
</rss>
