
Objectivist C - mkopinsky
http://fdiv.net/2012/04/01/objectivist-c
======
bithive123
This is the perfect language for the libertarian operating system I am
developing. Well, it's not really a traditional operating system since it
eschews coercive central controls in favor of giving each rational actor the
maximum amount of freedom.

For instance, there will be no virtual memory since that would be akin to fiat
money. Ever wonder why the memory footprint of your programs gets larger every
year? It's because we abandoned the freedom of direct memory access in favor
of fiat systems of paging and garbage collection.

Programs would be much faster and more capable if they weren't constantly
being oppressed by centrally imposed costs associated with asking the kernel
to do everything for you. Who decided that ivory tower fatcats like Linus
Torvalds should make all my decision for me?

The CI system will also require that everyone read all the source code before
they can make any commits. That way new code will introduce fewer unintended
consequences.

Yeah, it's hard to sustain these metaphors for too long...

~~~
oleganza
Such a wonderful confusion of libertarianism with technology :-)
Libertarianism makes sense only for freely acting independent entities (not
necessarily "rational", by the way), meaning there is no objective way to
establish an entity more "rightful" and more "reasonable" - hence the policy
of no aggression.

But in the operating system everything acts according to a command of a
designer. Programs run because user has launched them, memory is paged because
the designer wanted so and the user freely agrees to trust his judgement.

There is no ground whatsoever to compare virtual memory to fiat money. In some
systems virtual memory makes a lot of sense even with non-desirable side
effects. In some others, it makes sense to have a direct access to the memory.
But in both cases the solution is completely determined by the somebody's
choice. There are absolutely no "free actors".

Even if you design the OS with a policy of "no policy", it's still your
particular choice, not a laissez-faire for the "actors". And, of course, Linus
Torvalds has nothing to do with your decision to use a particular kernel for
your particular use. If the computer belongs to your employer or customer,
it's not the Torvalds, but you and your counterpart who decide whether to use
the system or not (and how).

EDIT: What a fool I am :-) I didn't see the irony in the above comment.

------
biot
This code sample no longer works:

    
    
        Printer *printer = [[Printer alloc] init];
        if (printer)
        {
            [printer print:hello inExchangeForUSDollars:2.00];
            [printer release];
        }
    

Because objectivist ideals require that there be no regulation of the free
market, I have opened the maximum number of allowable handles to the printer,
thereby exhausting the supply (which I now horde). All printer access must now
be routed through me. So please use the following code snippet instead, which
is the only mechanism by which you can access the printer:

    
    
        PrinterMonopoly *printer = [[PrinterMonopoly alloc] init];
        if (printer)
        {
            [printer print:hello inExchangeForUSDollars:99.00];
            [printer release];
        }
    

Should you attempt to build a printer replacement, I will deny you and your
customers access to every other system resource I have similarly horded
(you'll probably need a file handle to open the file you want to print,
right?) and I will undercut your pricing thereby forcing your bankruptcy after
which prices will resume at previous extortionate levels.

------
lmkg
Objectivist C is an expressive language, but it's not built for reliability. I
tried using a hypervisor written in Objectivist C one time to manage some VM
instances, but once it realized it was critical to my business, it stopped
responding to requests and removed itself from my network drive.

------
pohl
The parody of Ayn Rand's writing style captures it well:

 _Through centuries of scourges and disasters, brought about by your code, you
have cried that your code had been broken, that the scourges were punishment
for breaking it, that men were too weak and too selfish to spill all the blood
it required. You damned men, you damned existence, you damned this earth, but
never dared to question your code. Your victims took the blame and struggled
on, with your curses as reward for their martyrdom - while you went on crying
that your code was noble, but human nature was not good enough to practice it.
And no one rose to ask the question: Good? - by what standard?_

Nice.

~~~
javert
It's a direct quote, except in the original, the first instance of "code" is
actually "code of morality".

OP could not have written that paragraph.

~~~
nirvana
It probably doesn't make much sense taken without any context, so the best way
to understand what's being said here is to remember that Rand escaped
communist Russia.

Imagine you're a russian and you're taught that the "code of morality" is to
sacrifice for the proletariat (which really amounts to the politburo's whims)
and that when the wheat harvest fails to be sufficient, it is not caused by
the inefficiencies of central planning, but by the greed of individuals who
didn't sufficiently sacrifice themselves for the good of all.

~~~
legutierr
"centuries of scourges and disasters"

Is she really talking about communism here, or something else?

~~~
rdl
I think collectivism in general. Russian history was pretty bleak before
communism too, with the accounting unit being the "soul" as an example.

------
laconian
Works made using Objectivist C is licensed under copy-far-right licenses,
where the rights holder cannot share the source code and is obligated to use
the code only for projects that further his own selfish goals.

The Objectivist C API is also copywritten.

~~~
powrtoch
You don't need the actual source code. You can have perfect knowledge of its
inner workings by sensing and reasoning about its output.

------
FuzzyDunlop
Is a program not entitled to the sweat of its brow?

"No!" says the man in San Francisco, "it belongs to the community."

"No!" says the man in Hollywood, "it belongs to the Creator."

"No!" says the man in Sweden, "it belongs to everyone and no one."

I rejected those answers. Instead, I chose something different...

------
laconian
The immutable truth of A == A cannot be disregarded - the Objectivist C
compiler considers compile time optimizations of this sort to be immoral.

------
bluekeybox
Meh. This is only funny for as long as your mind can hold the analogy software
object :: human individual, which is for two minutes at most. Then the
objectivist in you kicks in, and you realize that said analogy is cruel
because it derives its punch from comparing something that is subordinate by
design with something that is subordinate through misfortune.

~~~
aaronasterling
Individual humans aren't subordinate by misfortune. Evolution "designed" them
to accept cultural assumptions so as to avoid threatening cultural cohesion. I
love Ayn Rand (as a writer, not a philosopher. I have never identified with a
character so much as with Howard Roark) but an isolated human is weak and
vulnerable. We're a social creature and leaving society amounts to suicide.
Absorb those stupid cultural assumptions and question them at your own risk.

~~~
bluekeybox
Haha Ayn Rand proponent vs Ayn Rand proponent: fight!

> Evolution designed them to accept cultural assumptions

It's a bit presumptuous to squarely pin something like that on evolution.
Evolution is likely to favor many things, including individualism and
rationality. Yes, Aritstotle said that man is a political animal. Yet
Aristotle didn't spend time observing baboons on the plains of Ethiopia.

I'm not sure where Ayn Rand stands as a writer because her writing is hard to
separate from her philosophy as she chose writing as a tool to transmit her
philosophical beliefs. I also loved Roark in the Fountainhead (yet I tend to
identify more with her imperfect characters like Gail Wynand), and as I'm
currently somewhere around p.300 in Atlas Shrugged (warning: as it is a very
long book, my judgement of it may easily be a wrong one), I feel that she
wrote Atlas Shrugged when her mind dogmatised her beliefs (the Fountainhead, I
think, was written when she was still questioning herself and reading it feels
like reading a bit more honest piece to me). Despite her later dogmatism, I
respect her as a philosopher because she (a) opened my eyes to how absurd
Hegel-derived philosophies are, and (b) made me understand the cult of Athena
in the ancient Greece and the impact it likely to have had on Western
civilization. Since Ayn Rand was so much courageous philosophically than Marx,
I think it would be completely unfair to everyone involved to call Marx but
not Rand a philosopher.

> an isolated human is weak and vulnerable

Not really, unless you immerse him/her into an unfamiliar society. Although
I'm not a follower of Thoreau, I think he made a fair argument that it is not
at all unhealthy to live outside of society. Now I'm not an advocate of moving
into a cabin in the woods, I just wanted to point out that there exists a
different perspective.

> leaving society amounts to suicide

No, leaving a society is much more like quitting cocaine than committing
suicide. Society is a lot like a drug. It takes some time to become hooked,
but once you do, it seems nigh impossible to leave. Hence the recent success
of Facebook.

~~~
aaronasterling
> It's a bit presumptuous to squarely pin something like that on evolution.
> Evolution is likely to favor many things, including individualism and
> rationality.

To a certain extent we will see individualism and rationality favored by
evolution as is evident by the fact that these things exist. Note however that
even the most individualistic person still accepts the vast majority of the
cultural assumptions with which they are brought up. Too much crititcal
thought would interfere with the transmission of culture and without culture
(i.e. those things which we've learned without having to figure out for
ourselves) humans are a fairly weak animal.

> Although I'm not a follower of Thoreau, I think he made a fair argument that
> it is not at all unhealthy to live outside of society.

Yet Thoreau still had social contact. He spent a lot of time by himself (as
most thinkers seem to) but he was still part of society as is evidenced by the
fact that we know him. Imagine yourself existing in a jungle with no clothes,
tools or language as a naked animal. That's leaving society and that's what
accepting cultural assumptions helps to prevent. Challenging cultural
assumptions leads to debate and most people can't handle that in my
experience.

------
TwiztidK
"In Objectivist-C, there are not only properties, but also property rights."

At this point I had to stop reading because the laughter was noticeable
outside of my cube.

------
mhd
I was about to complain that the code is a bit too concise, but then I read
this:

 _"Another principle that Objectivist-C software engineers have little use for
is Don’t Repeat Yourself."_

But is printHelloWorld a proper function? It neither accepts something, and it
returns "void". As the proper means of interaction with others is trade, this
function seems rather aberrant. Functions like this probably listen to
Beethoven, too.

Can a function that produces output, yet doesn't accept any parameters in
return pass the compiler?

~~~
fleitz
That style is definitely not objectivist, real objectivist functions always
take exactly one argument and return one argument.

a -> a

Rational randian functions never obey imperatives or procedures, and certainly
never return void to their investors, they obey only the Rearden calculus as
defined in the Rearden-Taggart theory of universal exchangability.

~~~
shalmanese
Functions take in 0 arguments and generate one argument. Arguments are created
out of ontological necessity.

------
steve-howard
> (portions omitted for brevity)

Definitely not very Ayn Rand.

------
eric_bullington
I tried it out but the core library functions seem to reject all arguments. I
can't decide if this is a bug or a feature.

------
tosseraccount
I tried it. The rand() function keeps segfaulting.

(shrug)

~~~
powrtoch
You're probably using it wrong. rand() simply returns true.

~~~
psykotic
In Objectivist C, there are no Booleans. If True exists then False exists, and
False values are an affirmation of the death principle.

------
dicroce
I think an objectivist programming language would be functional and pure, and
NOT object oriented.

------
fruchtose
This is fake. Actual Objectivist C code doesn't support the import
declaration.

------
F_Catalan
In Objectivist C a reference to the current object can be obtained by the
indistinct use of any of the following keywords: I self me my mine

Trying to use "this" results in: "Syntax error: Insufficient property
assertion"

Also be advised that the "?" modifier for regular expression quantifiers isn't
implemented.

------
brudgers
Warning: Although objectivist-c programs can create files, they are free to
destroy those files if another program makes changes.

------
WiseWeasel
It's a good thing I wasn't reading over the sample code in the office.

Bravo, a poignant demonstration of the value of collectivism through code. As
coders, it is easy to overlook how much we depend on the generosity of others
to do our work, to feel entitled to all this infrastructure we can leverage at
little or no cost, and especially to not see how this empowering system should
be used in other aspects of our society.

Maybe KickStarter for open-source medical technology or textbooks.

~~~
javert
_Bravo, a poignant demonstration of the value of collectivism through code._

Open source software is not "collectivism", which is a moral/political
doctrine.

~~~
Symmetry
Indeed. Open source software is the first example I'll reach for when talking
about the difference between the ideas of "free market" and "capitalism".
Anybody can choose to contribute to open source or not, for reasons that are
selfish or altruistic, in any way that they decide. Other's may or may not
decide to pull their changelists, but everything is all about voluntary
transactions - what you'd call a totally free market. On the other hand its
totally unlike capitalism for reasons I hope I don't have to explain.

I can easily imagine collectivist code development, but I can't imagine a
collectivist software effort that would allow both Ruby and Python, both Java
and C# to exist. I mean, if you're making these decisions collectively how
could you justify the division of effort?

~~~
jerf
Capitalism doesn't mean that everybody is running around for themselves. If
its opponents seriously thought about that accusation for a moment, they'd
realize that it is completely inconsistent with also talking about large
corporations being abusive... indeed, large corporations existing _at all_.
Capitalism allows you to freely set up your own organizations within its top-
level free matrix, so if you find a problem space where near dictatorial
"collectism" is the answer, you're free to choose that. (Fast food springs to
mind.) That's in contrast to many ideologies which really do insist they are
the right answer for every scale. Making that accusation of capitalism is
generally a form of projection of the biases of the accuser, since it works
exactly the opposite. (And the answer to many of the putative abuses of the
system is for people to band together and form things like insurance
corporations and credit unions and such.)

~~~
javert
A large fast food giant (to take your example) is still not a dictatorship and
it's still not collectivist.

You can have collectivist things under capitalism (for example, a hippie
commune), but you cannot have a dictatorship.

------
zaptheimpaler
It's ironic that Ayn Rand is mocked so much in an age where individualism is a
seen as the highest of virtues (in the US).

~~~
javert
Individualism is most definitely _not_ seen as the highest of virtues in the
US. Both major parties are highly altruistic. It's just given lip-service.

By the way, there is no virtue of "individualism" in Objectivism, it's
independence. Which isn't the most important virtue.

~~~
guscost
If I didn't know any better I would think that you just made a judgement about
which virtues are most important...

~~~
javert
I was only intending in that part of my comment to report on Objectivism. I
guess that wasn't entirely clear.

However, I do happen to agree with it.

In Objectivism, one virtue is more fundamental/"above" the others. Want to
take a guess at what it might be? It actually makes sense, so you might be
able to guess it.

~~~
cma
Let me guess: hoarding capital that wasn't even produced by a human hand?
(unimproved value of land, etc.)

------
mike626
This is genius. So much so I want to keep it all for myself.

------
JonnieCache
This is pretty hilarious. Not a patch on SDFRY though.

[http://nathan.ca/2012/04/introducing-sdfry-the-modern-
progra...](http://nathan.ca/2012/04/introducing-sdfry-the-modern-programming-
language/)

------
skibrah
Rand would never be able to adhere to DRY

~~~
JadeNB
… as the author observed:

> (Another principle that Objectivist-C software engineers have little use for
> is Don’t Repeat Yourself.)

(or perhaps you were merely adhering to the DDRY principle yourself?).

------
guscost
OK, I'll start the argument: Is a computer system analogous to a community, an
individual, both or neither?

~~~
bgilroy26
Communities and individuals are isomorphic [1]. A good compiler will
substitute individuals for communities wherever it results in a performance
gain.

1\. <http://plato.stanford.edu/entries/plato-ethics-politics/#1.3>

~~~
guscost
Intriguing. Makes me think that an individual is just an extremely evolved
community.

------
JoeCortopassi
I'm an iOS/Objective-c developer, and I'm completely missing the joke. Anyone
care to explain it to me?

~~~
daed
Google Objectivism and/or Ayn Rand

------
nintax
haha?

------
maxharris
"First they ignore you. Then they ridicule you. And then they attack you and
want to burn you. And then they build monuments to you." \-- Nicholas Klein
(commonly attributed to Ghandi)

Rand is mocked and attacked by some (who know very little about her actual
ideas^), but increasingly appreciated others. It won't be that long before our
culture starts to shift into the fourth phase, wherein it finally gives her
ideas the credit they deserve.

^If you skipped Galt's speech in Atlas Shrugged and haven't read her non-
fiction works, you don't know much about her actual ideas.

tl;dr: This is evidence that Objectivism is making its mark.

