
TempleOS: 5 minute random code walkthrough - GuiA
http://www.templeos.org/Wb/Accts/TS/Wb2/WalkThru.html
======
Mithaldu
These videos already make me inordinately happy, because everything about
templeos is beautiful, and having it explained is so very nice. However the
most beautiful take-away from these videos to me is that Terry has a bird. :)

~~~
trentmb
His voice seems much calmer in this video. I hope that's an indication he's
doing well.

------
chippy
I want to build in some kind of primitive networking into this OS - just so
one machine can talk to another... it's on my side project list. Anyone had
much experience with the code?

Also - Love the positive comments in this thread. Proud of this community.

~~~
tedks
I think the maintainer has said that God forbids networking. This seemed
irrational to everyone, and then the NSA scandal happened, so I'm inclined to
side with Terry on this one.

~~~
sillysaurus3
Specifically, his belief is that God forbids networking in TempleOS, not other
OS's. (Otherwise he wouldn't maintain a website, upload YouTube videos, or
comment on HN.) It may not be a good idea to add networking to TempleOS, since
he may take that as an affront to his religion.

Also, if code has no license, then apparently it's equivalent to having an
"All Rights Reserved" notice, preventing any re-use of the code at all,
according to [http://osswatch.jiscinvolve.org/wp/2013/05/21/unlicensed-
cod...](http://osswatch.jiscinvolve.org/wp/2013/05/21/unlicensed-code-
movement-or-madness/)

"Experienced developers won’t touch unlicensed code because they have no legal
right to use it." [http://osswatch.jiscinvolve.org/wp/2013/05/23/unlicensed-
cod...](http://osswatch.jiscinvolve.org/wp/2013/05/23/unlicensed-code-is-it-
ever-ok/)

So if TempleOS has no license, then it may not be strictly legal to add
networking support and then re-release the code. Glancing at the "Downloads"
section shows no mention of a license. Of course, no one is going to be able
to enforce those protections in Terry's case, but if it's likely to
simultaneously offend him and be illegal, is it a good idea?

What a strange situation.

EDIT: TempleOS turns out to be in the public domain.

~~~
JeremyBanks
According to
[http://www.templeos.org/Wb/Accts/TS/Wb2/TempleOS.html](http://www.templeos.org/Wb/Accts/TS/Wb2/TempleOS.html),
it's public domain. There shouldn't be any licensing troubles, at least.

 _TempleOS is an x86_64, multi-tasking, multi-cored, public domain, open
source, ring-0-only, single-address-map (identity-mapped), non networked, PC
operating system for recreational programming._

~~~
sillysaurus3
Aha, there it is. Thank you!

I wish there was a way to simply ask Terry if he'd have a problem with someone
adding networking support. Does anyone know if he responds to email?

~~~
jacobparker
He has for me before.

------
M4v3R
It makes me sad that even with his illness he delivered more working code than
I probably will ever do. Maybe not because I can't, but because I procastinate
so much and I really have hard time focusing on doing work.

~~~
staticshock
Work is hard, and staying on task in the face of digital distractions is
harder still, but you can do it.

My philosophy is that in order to battle distractions, you need a more
structured environment. Sure, some can manage without, but I think those
people are probably outliers. Most of us are click-happy, trivia collecting
pseudo-information junkies.

In school, that structure was created by classes, tests, assignments, due
dates, etc. Those may seem like external factors, and yet they _can_ be traced
back to you: at some point you probably _chose_ your course load and schedule,
you likely _chose_ your degree, and even the act of attending a college in the
first place was, arguably, a choice.

College was a maze of your own creation, and you were the mouse running
through it. After academia, though, that structure disappears. If you want it
back, you have to go back to playing the roles of two different people: the
visionary CEO of your life, who sets the broad agenda, milestones and
deadlines, and the engineer who implements that vision.

Concretely, that means you need to break down big tasks into smaller ones, and
deciding that those smaller tasks need to be done in a concrete amount of
time, such as "today", "this week", or "this month". Make a calendar, put it
up on a wall, make it visible. The structure dissolves if you ignore it, so
make it hard to ignore it.

Oh, and invest in some of that "grit" everyone seems to be talking about:
[http://blogs.kqed.org/mindshift/2014/09/measuring-self-
contr...](http://blogs.kqed.org/mindshift/2014/09/measuring-self-control-a-
marshmallow-test-for-the-digital-age/)

~~~
MatthewRayfield
I really like the idea of the CEO and employee roles within ourselves. Thanks
for that.

~~~
ma2rten
Too bad I can't fire myself.

~~~
triangleman
You most certainly can. Just sit yourself down and calmly explain to yourself
that, while this working arrangement has been mutually beneficial in the past,
it's clear that it's not working out any more and that it's time to part ways.

------
microcolonel
I had a conversation with Terry on freenode a couple years ago, back when
TempleOS was "losethos".

I was convinced, given the context, that losethos was just computer malware,
and he had a hard time articulating why it wouldn't be, and ended up just
getting frustrated at the most cursory of questions.

A few days later, somebody who had witnessed the conversation informed me that
he was a well known probable schizophrenic, and it really bummed me out that I
didn't know or handle the situation better.

While he hasn't convinced me of anything other than that having nice uniform
names for types can be helpful(U64, S64, F64, etc.), that conversation gave me
some perspective on what it means to be schizophrenic.

------
gojomo
What if the giant computing platform battle of 2040 is TempleOS vs. Urbit,
because everyone else got neurobricked by the iBrain/mindroid 0day of 2034?

~~~
bshimmin
Is Urbit a joke? I've looked at its Github repo several times over the last
year or so and still have no idea.

~~~
plaguuuuuu
just read the intro page

if anything you could probably find some interesting people to talk to using
the chat client. heh.

on the other hand, I can make approximately zero sense of the source. or what
I think might be the source.. for something...

[https://github.com/urbit/urbit/blob/master/urb/zod/main/mar/...](https://github.com/urbit/urbit/blob/master/urb/zod/main/mar/zing/door.hook)

    
    
        ::
    
        ::::  /hoon/core/zing/pro
    
    	  ::
    
    	/?  314
    
    	/-  zing
    
    	|_  zig=zing
    
    	::
    
    	++  grab                                                ::  convert from
    
    	  |%
    
    	  ++  noun                                              ::  convert from %noun
    
    		|=  src=*
    
    		^+  +>+
    
    		+>+(zig (zing src))
    
    	  --
    
    	--

~~~
jcburnham
...clearly that's a content type validator.

A zing is actually just a chat message.

Take a look at the zing type definition in
[https://github.com/urbit/urbit/blob/master/urb/zod/main/sur/...](https://github.com/urbit/urbit/blob/master/urb/zod/main/sur/zing/gate.hook)

    
    
        $%  [%hola p=path]
            $:  %mess  p=path
              $=  q
                $%  [%do p=@t]
                    [%exp p=@t q=tank]
                    [%say p=@t]
        ==  ==  ==
    

Which (ignoring the crazy syntax) is either an initialization (an %hola), an
action (a %do, like /me in IRC), an embeded Hoon expression (an %exp, which is
a [code output] pair), or a message (a %say). @t is just a string type.

sur/zing/gate/hook defines the type, mar/zing/core/hoon uses
sur/zing/gate/hook to validate untyped data received over the network.

~~~
applecore
Of course.

------
userbinator
What makes this amazing is that Linus Torvalds probably wouldn't be able to
pick a random piece of code in the Linux kernel and do this.

The fact that it's quite featureful for an OS of ~100kLOC - including an
assembler and compiler for a language with some OOP - makes this even more
interesting. "The shell is a compiler/interpreter" concept somewhat reminds me
of Lisp machines too.

~~~
SwellJoe
I'd wager that there's 138k lines of code for which Linus _could_ drop into
the code and figure out what's going on in a couple of minutes, in the same
way as this; at least he could in the past. I've watched realtime
conversations on IRC and in other realtime environments where he exhibits
exactly this kind of comprehension of huge swaths of Linux. Linux just happens
to be vastly larger than this now.

Not to dismiss this guy's impressive grasp of his chosen language and the
things he's built in it; watching him using so many tools that seem to be of
his own devising is impressive as hell. Downright intimidating, in fact. My
lifetime software output becomes practically zero in comparison.

------
Igglyboo
This guy never ceases to amaze me, he's insanely smart and dedicated.

------
andrewljohnson
Random numbers coming from God is cute. I'm not a theist, but I also feel awe
of the elusive concept of true randomness. I read something about this from
him before, and it pops up in the 1st video.

The flashing Menu button and marquee filename are _interesting_. A distraction
to most people, but I wonder if they help the author Terry stay focused.

~~~
goldfeld
Well, if you believe in god, then random numbers must come from him, right?
Even in the sense that randomness is deterministic, it's then part of fate
which is ruled by whatever supreme power you would believe in. As Luke says in
The Dice Man, if "not a single sparrow can fall to the ground without your
Father knowing it", then how can a die tumble without his knowing it? A die is
just as pseudo-random of course, but it's nigh impossible to have a "seed" of
the exact hand movement and height you use, the surface and the form of the
die.

I'm an atheist, but I do find the concept of randomness being the pure will of
god fascinating.

~~~
themodelplumber
> Well, if you believe in god, then random numbers must come from him, right?

Interesting!

Personally I don't know if the second part must follow from the first, at
least not for * in theists. But then I'm a theist who doesn't believe in fate,
or "God knowing about something == God giving a care" or God giving a care
what you had for dinner. Even the beliefs I harbor about what you _did_ have
for dinner (i.e. treating your body in a specific way) have more to do with
God wanting good things for man in general.

~~~
goldfeld
I realize I'm treading into waters of religion discussion here, but if you're
a theist who refutes my statement you quoted, then you must dismiss the theory
of chaos, does that follow? Since you said you don't believe in fate, I guess
it does. Because if you think the theory of chaos true, that is, that
everything is indeed deterministic in the sense that the world state now comes
directly from the world state before, and we only think it is chaos because we
can't control for all the absurd amount of variables, and if god knows
everything, he sees the exact order in the chaos, and thus he knows that
something as seemingly innocuous as a random number generator can have
profound consequences sometimes--especially when it's used in softwares that
altogether affect millions or billions of people every day.

That is, pseudonumber generation in software does indeed affect a lot of
people, and then if god isn't willing it, he has by the theory of chaos
absolutely no control or grasp upon the world whatsoever in the end. The
alternative is that you believe that god _sometimes_ wills a random number,
and most times doesn't. That would make me uncomfortable actually, but I guess
that's why I don't believe in a supreme being having a will of its own, as
opposed to us simply being governed by supreme principles or laws--I guess
chaos is my god.

------
orbifold
One concept I really like is to just identity map the whole address space and
run everything with full priviledges. With a sufficiently high level memory
safe language with good concurrency and memory regions support, you should be
able to statically enforce most of the guarantees that the hardware provides
and at the same time get rid of context switches. Untrusted code in a memory
unsafe language would simply run in a VM.

~~~
pjmlp
This is how the Xerox PARC OSes and Oberon OSes families work, among a few
others.

~~~
smorrow
Inferno.

------
sitkack
The world is definitely better off with Terry. Thanks man and keep on doing
your thing.

------
incision
Neat, subscribed.

I make a point to read TempleOS' comments. Looking past the frequent nastiness
they're sometimes interesting and even poetic, in a way that's as sadly
familiar as the intonation in these videos.

~~~
corin_
Ditto - he's the reason I keep showdead on.

------
MarkPNeyer
i've been through a lot of psychosis and feel like i can understand this guy.
i had a psychotic break in late 2012 and thought strongly that catholicism was
created to teach the world computer science concepts.

when you start reading about roko's basilisk, it's not a stretch at all to
imagine that primitive human beings exposed to an artificial intelligence
would think of it like 'god'.

------
tlo
Can somebody explain in a few words what TempleOS is?

~~~
kazagistar
It is an operating system and associated infrastructure (editor, compiler,
etc) written by one man who believes he is doing the word of god.

~~~
MrBuddyCasino
Must. Not. Make. RMS reference.

~~~
LeonidasXIV
> Must. Not. Make. RMS reference.

Yeah because that wouldn't really make sense, considering RMS stated to be an
atheist.

~~~
cygx
It does make sense. RMS himself has had his fun with this:

[https://stallman.org/saintignucius.jpg](https://stallman.org/saintignucius.jpg)

[https://stallman.org/saint.html](https://stallman.org/saint.html)

------
codezero
I actually like the idea of having to pick a random routine in a large
codebase and then explaining it on the fly. Terry does a pretty good job at
this, he's done similar things in other videos.

------
callahad
I love the idea of a built-in hotkey for jumping to a random line across the
entire codebase. Like a fuzzer, but for your understanding of your project.

...and now I really want to write a vimscript to do the same.

~~~
lost-theory
Here's a python one-liner that will do it:

import os; import random; os.system("vim %s +%s" % (lambda f: (f,
random.randint(1,len(open(f).readlines())+1)))(random.choice([f for f in
sum([[os.path.join(p, f) for f in fs] for (p, ds, fs) in os.walk(".")], []) if
not ".git" in f])))

~~~
dradtke
That's one hell of a one-liner.

~~~
e12e
It's a great example of the trade-offs made in python (as opposed to, say,
perl) design: It's not really a one-liner (yeah, it fits on one line, but it
just cries out to be re-formatted) -- it's too verbose -- but the flip side is
that it's actually rather readable.

~~~
vegggdor
Having to use lambdas just to get the syntax to allow for a one liner makes
your point about reformatting.

------
curiousDog
As much as I appreciate what he did (most of us wrote a bare bones OS in
school anyway), I'm not a fan of his racist comments. Some are incredibly
specific like "I can't believe a nigger is the boss of a white guy, that just
isn't right" or something like that. It's like he has these thoughts actually
bottled up but cannot control them because of his illness. Nonetheless, my bad
to rain on someone with such an illness. All the best to him.

~~~
nmjohn
> It's like he has these thoughts actually bottled up but cannot control them

It is not at all like he simply can't control them & would have the thoughts
regardless.

That's not really how the disease works. I'm not saying you need to be a fan
of his comments - but I do think he deserves a little more slack than you're
giving him.

------
LukeB_UK
All the flashing bits and marquees... I never thought that someone could
create an OS that reminds me of GeoCities

~~~
oftenwrong
He uses <blink> tags on his site. The blinking might have some intended
significance. Or maybe he just likes it.

------
cmdrfred
I hope medical science can one day find a way to help our friends like Terry
find their way home. Until then all we can do is let him know that he is loved
and respected by his peers, Terry you are one of us.

~~~
wetmore
I'm sure his hellban here is really helping demonstrate that...

~~~
cmdrfred
I think thats probably more to protect Terry from some of us then it is to
protect us from Terry.

Example(I'd beat everyones ass in this thread):
[http://forums.somethingawful.com/showthread.php?threadid=343...](http://forums.somethingawful.com/showthread.php?threadid=3434374&userid=0&perpage=40&pagenumber=4)

~~~
JimmyM
How horrible.

A classic example of the fact that the mentally ill are more likely to be
victims of violence - whether verbal or physical.

------
broken
"showdead -> yes" is the only reason i have a HN account.

~~~
tedks
Off topic: lately, I've noticed a lot of dead HN comments and entire
shadowbanned accounts that seem totally reasonable and on-topic. I really wish
there was a way to flag dead comments that were auto-flagged as false
positives, because in the past HN mods have said people who comment from IPs
that were previously banned also get shadowbanned.

~~~
enneff
Next time, take a look into their comment history. A lot of hellbanned people
are totally reasonable on some topics but have pet topics about which they can
be incredibly obnoxious.

------
ivans__
Terry is always a huge inspiration to me!

------
qznc
I like the idea for quick impromptu presentations, so a made a script for git:
[https://github.com/qznc/dot/blob/master/bin/git-
randomline](https://github.com/qznc/dot/blob/master/bin/git-randomline)

$ vi $(git randomline)

Then explain to someone in five minutes

------
josteink
Direct youtube links for those (like me) for whatever reason were unable to
watch the videos directly in the page:

 _5-Minute Random Code Walk-Thru_

Episode #1:
[http://www.youtube.com/watch?v=qqoJfIbPGv8](http://www.youtube.com/watch?v=qqoJfIbPGv8)

Episode #2:
[http://www.youtube.com/watch?v=vuqBc5FZH2g](http://www.youtube.com/watch?v=vuqBc5FZH2g)

Episode #3:
[http://www.youtube.com/watch?v=JzlU8YywcAo](http://www.youtube.com/watch?v=JzlU8YywcAo)

Episode #4:
[http://www.youtube.com/watch?v=z9ocExv4xcs](http://www.youtube.com/watch?v=z9ocExv4xcs)

Episode #5:
[http://www.youtube.com/watch?v=5VlnLQOFv_g](http://www.youtube.com/watch?v=5VlnLQOFv_g)

Episode #6:
[http://www.youtube.com/watch?v=rjaHfqkxfn8](http://www.youtube.com/watch?v=rjaHfqkxfn8)

Episode #7:
[http://www.youtube.com/watch?v=KxRDmfeQxpQ](http://www.youtube.com/watch?v=KxRDmfeQxpQ)

Episode #8:
[http://www.youtube.com/watch?v=22goZWnhMOw](http://www.youtube.com/watch?v=22goZWnhMOw)

Episode #9:
[http://www.youtube.com/watch?v=mzkLAlYlbbo](http://www.youtube.com/watch?v=mzkLAlYlbbo)

Episode #10:
[http://www.youtube.com/watch?v=7B6-pxFvcrM](http://www.youtube.com/watch?v=7B6-pxFvcrM)

Episode #11:
[http://www.youtube.com/watch?v=j0MVG2e2Mco](http://www.youtube.com/watch?v=j0MVG2e2Mco)

Episode #12:
[http://www.youtube.com/watch?v=GR_Qm47_EDY](http://www.youtube.com/watch?v=GR_Qm47_EDY)

Episode #13:
[http://www.youtube.com/watch?v=SahDS27GdQ0](http://www.youtube.com/watch?v=SahDS27GdQ0)

------
donatj
A little over a year ago I wrote a post about the problems I saw in
Coffeescript, Terry commented that switching to TempleOS would prevent my
complaints as I could use his C variant. Made my day to have him comment.

------
no_future
Terry is a goddamn hero and an inspiration to us all

~~~
cmdrfred
Here here.

~~~
teddyh
This is neither here nor there, but it's “Hear, hear”.

~~~
cmdrfred
I stand corrected.

------
axaxs
I'd just be happy for a usable Holy C. Growing up in the south, I can perhaps
sadly deal with the political or racist rants. Putting that aside, I think the
man is a genius who has much to offer the world. I'd love for someone like
this to mentor me, though such a thing is hard to find outside academia.

------
desireco42
After looking at some of videos and intro, he is onto something with this. You
can always run this in vm, I can see how permissions and ownership can get in
a way. By using subroutines, he gets every ounce of juice out of his machine.
Also document format, based on his description, sounds awesome.

------
thaumaturgy
Does anyone have the code for the PRNG handy, or is familiar with it? It'd be
kinda neat to see how that bit works.

~~~
SwellJoe
It is, after all, the mind of god, which would be interesting to understand.

------
namecast
Shine on, Terry, you crazy diamond.

If nothing else, TempleOS is a testament to how much one programmer can
accomplish absent feedback or collaboration from others. For better or worse.

~~~
gohrt
> Shine on, Terry, you crazy diamond.

This is clearly a statement of adoration, but even still, it is anti-helpful
to perpetuate the use of the word "crazy" in conversations that touch on
mental health.

~~~
arh68
_Shine On_ is incredibly on-point here, since Syd Barrett himself went "crazy"
to a degree and dropped out of the band. It's not a adoration of the person,
it's an appreciation for Syd's inspiration or work. I'm not in Pink Floyd, but
I very much like and appreciate the song.

~~~
mkal_tsr
It's more than that. This is an exact example of someone not understanding
context, not using tools available to understand context, and then projecting
their thoughts and beliefs onto someone else, all while completely avoidable.

If you have the means to read the comment on the internet, you also have the
means to search that phrase or set of words and immediately see it's connected
to a Pink Floyd song.

Even if you don't do the search, you're still projecting yourself onto their
words.

"Crazy diamond" ... what makes a diamond a 'typical' diamond? Sharp/precise,
clear, focused. Now let's look at 'crazy' \- typically means extremely far
beyond the average/normal point. Literally 'off the charts' but in this
context, mentally off the charts. To be in possession of such qualities so
strong that we can't even think about how possible that is, but here we have
something that demonstrates that. A person that wrote their own hobbyist
kernel and OS.

Is that easy to do? Show me your custom kernel & OS. Oh, don't have one? Then
how many people do you _personally_ know that have pretty much single handedly
done that? Probably not that many. So you don't have a primary or secondary
sources that you can speak to the dedication and depth of effort for this this
task/accomplishment.

It removes power from the one actually being discussed as to encourage others
to speak on _the individuals '_ behalf, thus less emphasis and power on their
own self-representation and more importantly, their own voice.

I think it is a perfect description: someone who is so clear and focused in
their passion and pursuit of it to the extent that we can not comprehend the
effort to achieve what he single handedly did, and the clear focused and
beautiful nature of what they've created, straddling between pure effort and
pure art. I think it's a very humanizing thing to show that mental illness is
not inherently dangerous and not inherently _bad_ and that those either
showing signs or suffering are _people_ first and foremost, and we should
listen to what _they_ have to say, not voices that claim to represent them.

------
Davesjoshin
How come his rants have a lot of racial slurs? Am I missing something?
[http://www.templeos.org/Wb/Accts/TS/Wb2/Rants/TAD/2014/09/Ra...](http://www.templeos.org/Wb/Accts/TS/Wb2/Rants/TAD/2014/09/Rant140922.html)

~~~
DanBC
i) perhaps he's a massive racist

ii) perhaps he has an illness that affects inhibition

It's a bit rude to just gossip about someone, especially when he reads (and
posts to) HN. I always feel vaguely uncomfortable when this topic is discussed
on HN.

~~~
jtheory
Yeah, just skip past that stuff.

I get the sense he's just compelled to post all that -- the random "Words from
God", the racist stuff... it's not necessarily anything to do with inhibitions
(or lack thereof), just rules he has to follow that won't make sense to us.

I was reading a random rant and noticed a "Fuck you, God." in there, in the
middle of a few pages that seemed to be almost all compelled material and
almost nothing else.

I.e., maybe it pisses him off that he has to post that stuff. But he has to.

------
elwell
Let's all hope Terry doesn't learn AI enough to equip TempleOS with the
ability to learn (as well as networking). There's is no guessing as to what a
randomized OS with a god-complex might do.

~~~
narrator
Your future AI overlords will program in BrainF*ck

[http://www.reddit.com/r/programming/comments/17fe6q/your_ai_...](http://www.reddit.com/r/programming/comments/17fe6q/your_ai_overlords_will_program_in_brainfck/)

------
smegel
If nothing else, this guy's got staying power.

------
cmdrfred
What if he's right?

~~~
sitkack
That God is a hypervisor? Or that religion is paravirtualization? I do know
that we should be using some Ocaml/Lisp hybrid with hardware transactional
memory support.

~~~
cmdrfred
Its the matrix, and Terry Davis is Neo.

------
cschep
Whhhaaaaat the hell? Is this real?

~~~
bithush
Yup. Terry Davis and his TempleOS are quite well known. I believe he suffers
from schizophrenia although I do not know if this has been confirmed by
anyone?

He is certainly a gifted programmer.

~~~
dkulchenko
Here's some more background:
[http://www.reddit.com/r/SubredditDrama/comments/1buh8c/the_c...](http://www.reddit.com/r/SubredditDrama/comments/1buh8c/the_creator_of_templeos_appears_in_an/)

And more still:
[http://terry.davis.usesthis.com/](http://terry.davis.usesthis.com/)

~~~
mjn
Another article (annoyingly undated, but I believe ~3 years old):
[http://9ol.es/LoseThos.html](http://9ol.es/LoseThos.html)

