An Introduction to Objectivist-C An Introduction to Objectivist-C

Posted by jstrecker on 2012.04.01 @ 21:39

Filed under:

Let me introduce you to the best language you’ve never heard of: Objectivist-C.

Although academic computer scientists have generally dismissed Objectivist-C, it has a zealous following among self-taught programmers and college sophomores.

Objectivist-C was invented by Russian-American programmer Ope Rand. Based on the principle of rational self-interest, Objectivist-C was influenced by Aristotle’s laws of logic and Smalltalk. In an unorthodox move, Rand first wrote about the principles of Objectivist-C in bestselling novels, and only later set them down in non-fiction.

Here’s what you need to know to program in Objectivist-C.


In Objectivist-C, an object — every object — is an end in itself, not a means to the ends of others. It must live for its own sake, neither sacrificing itself to others nor sacrificing others to itself.


In Objectivist-C, a Hello World program looks like this (portions omitted for brevity):

#import <Fountainheader.h>
 
@interface HelloWorld
// ...
@end
 
@implementation HelloWorld
 
- (void)printHelloWorld
{
    NSString *hello = @"I am. I think. I will.";
    Printer *printer = [[Printer alloc] init];
    if (printer)
    {
        [printer print:hello inExchangeForUSDollars:2.00];
        [printer release];
    }
    else
    {
        // In Objectivist-C, objects are self-sufficient. 
        // Here, I implement string printing from scratch. 
        [self createTheUniverse];
        [self createStandardOutputDevice];
        [self print:hello];
    }
}
 
// ...
 
@end

In Objectivist-C, software engineers have eliminated the need for object-oriented principles like Dependency Inversion, Acyclic Dependencies, and Stable Dependencies. Instead, they strictly adhere to one simple principle: No Dependencies.

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


In Objectivist-C, there are only two numerical data types: rational and real.


In Objectivist-C, there are only two colors:

+ (ReardenColor *)colorWithJudgment:(BOOL)isGood  // factory method
{
        return (isGood ? kReardenColorWhite : kReardenColorBlack);
}

In Objectivist-C, there are not only properties, but also property rights. Consequently, all properties are @private; there is no @public property.


In Objectivist-C, each program is free to acquire as many resources as it can, without interference from the operating system.


In Objectivist-C, objects communicate by message-passing. In Ope Rand’s magnum opus, one object sends a message that goes on for 70 pages.


In Objectivist-C, there are no exceptions.


I leave you with a quote from Ope Rand, in which she condemns programming languages that are inferior to Objectivist-C:

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?

ROFL.

A fine work, sir.

Thank you.

But, like Dagny Taggart, I am a “ma’am”.

OMG. Absolutely hilarious!!! Well done.

Love it, Jaymie!

Doubt you’ll get much love on Hacker News though, as the adolescents there are still aswoon with Ayn. Most of them don’t get out much.

I see Objectivist-C is racist.

return (isGood ? kReardenColorWhite : kReaddenColorBlack);

Excellent.

An insta-classic. Bravo. I highly suspect that you are a KANTian, however…

This is hilarious. Nice work!

It’s funny because we all know programmers are statist socialists.

If I write code in Objectivist-C will I then only be attracted to other Objectivist-C developers?

Very well done.

My hat is off to you.

Or it would be, if I wore one.

An objectivist programming language would SURELY be a functional language.

I dunno… a lot of objectivist work has some pretty serious side effects.

Found this on HN, and it’s the funniest thing I’ve seen all week. It’s sublime. Thank you!

Great Work!! This is cool….

This is rather amusing, despite the clueless response from the individual implying that finding the value in Rand’s work requires one be an adolescent. Those of us who have been developing for over two decades professionally and have succeeded with our objectivist/egoist principles intact wholeheartedly disagree with your implication.

Bravo to the original poster nonetheless, very funny indeed.

One sure sign of a committed (or should be) objectivist.

No sense of humor.

p.s. Ms Rand, while right about a lot of things, was a BORING AWFUL writer. BORING BORING BORING Sydney.

I bet esr wrote that comment.

I suppose I have had the privilege of knowing many types of “tea party” and “libertarian” types to know that there are many different types of beliefs. Same goes for my “liberal” friends. However, this was pretty amusing at parts.

(for hell’s sake, make the CAPTCHA placement a little more obvious)

You neglected to add that to an Objectivist-C programmer, the only acceptable operating system is a microkernel!

A true Objectivist-C coder does not need a kernel.

Quite superb. I look forward to the comments on the hopefully inevitable YouTube presentation. ^_^

Shouldn’t it be gold not US Dollars?

All of this, from one overloaded Rand() function?

Well played sir or madam.

In Objectivist-C, each program is free to acquire as many resources as it can, without interference from the operating system.

This is an important area to consider in terms of Heap management. Valid objects only have CREATE methods which are entirely self-instantiated. Only inferior OSes implement garbage collection. Of course, these operations are never implemented in Objective-C, because they only implement a DESTROY method (probably written in Lisp). Obviously, there is no shared memory.

Objects ALWAYS pass by value. Though the OS and viruses are always trying to coerce objects into passing by reference, this kills all objective standards and delivers objects into the arbitrary power of an arbitrary setter of values[cache management]

Only objects that share the same function signature can exchange data. Interesting because Objective-C objects never return values.

Hilarious! I love it! Thank you.

@Charles Feduke:

If I write code in Objectivist-C will I then only be attracted to other Objectivist-C developers?

Clearly. And, although other developers consider it bad practice, Objectivist-C developers are not averse to coupling.

@T.O.

Shouldn’t it be gold not US Dollars?

Wow, you really know your Objectivist-C. I stand corrected.

People are mooching on the upper middle class white males with two decades of programming experience who never exited adolescence.

[Intellect assert:A isEqualTo:A]

A work of true beauty.

But how do you say A is A in Objectivist-C, and does everything follow from that?

Ha ha ha ha ha. Very clever.

Re: jstrecker

Wow, you really know your Objectivist-C. I stand corrected.

Actually, you are both right, your article seems to be using one of the earlier versions of objectivist-C. That version, as it aged ended up having to use the operating system’s health monitoring functions as well as other various public functions in order to remain operational as it’s methods became outdated on existing hardware.

He’s referring to the new version Objectivist-C++. This has the gold functionality, even so though, the US Dollar code remains valid for backwards compatibility for now.

True brilliance! Yes, it is very, very, very (object-C is cool with repeating oneself, remember) funny, but it’s also a really clever critique of objectivism. I wonder how other philosophical and political systems would fare if they were to be subjected to the same treatment.

In theory, Objectivist-C objects are entirely self sufficient. In practice, many programs rely heavily on inheritance.

This comment wins.

No one helped me… . ” - Ayn Rand

I’m surprised there has been only the one stuffy verbose Objectivist. Maybe this bodes well for our future.

Actually, the creator of Objectivist-C got around the limitations of the language by spawning a separate process that skirted OS restrictions and injected its output back to the original program.

heh

I believe that is only legal in certain Southern States.

The article is wrong on Objectivist-C’s scope; the world is really running on it. The code in question is written by invariantly brilliant, yet anonymous and exploited, entry-level Java programmers in their spare time (and on vacation).

Some parts are exaggerated beyond the comic. For example, the “no dependencies” part should be apprx. “voluntary dependencies”. Big difference.

Objectivist C must be terribly inefficient, if it needs a whole universe to accomodate a print utility. I don’t want to know how long it takes to create an instance..

// Jikes! Are you a rookie? 
// We all would void if you'd recreate the universe we live in!!!
// Workaround: add a Universe instance it to the current array of defined Universes
// at the moment 42 U's exist  4 were disposed a few billion years ago.
 
self universes[].add [self createTheUniverse: recursive swap];           
[self universes[universes.size-1]]<<[self createStandardOutputDevice];
// afterwards. simply dispose the universe instance asap,
// before yet another planet therein instantiates (automagically) 
// populated with "intelligent apes" that create nuclear weapons etc.
// Simply:
super blackholeIrreversible.Absorb(universes[universes.size-1]]
self universes[universes.size-1].dispose.
//Sigh..

Absolutely wonderful! I love it!

Just wait for the movie, it will make more sense.

Awesome !! Amazing piece of work. I get better kick reading this than when I read Atlas Shrugged as teenager :)

 //correction to instructions. 
 //- Objectivist C does not have access to CPU functions, but must recruit RAM resources from other programs. 
 //- Hence, Objectivist C programs can only acquire resources to execute their code and/or replicate by fulfilling the ($value) of other programs, leveraging their existing momentum. 
-Warning- Objectivist C may create networks of said leveraged RAM of other programs, each of which will replicate those pieces of the Objectivst C programming that match its (x$value) function, multiplying its RAM. 
 //Objectivist-C tends to build complex interdependencies in these cases that are difficult to eradicate.
 //e: these programs will often reject each other over small differences in code.
-Warning- most programs have specific anti-Objectivist C antivirus, which will sometimes eat up valuable RAM towards (-y$value) functions, including recruiting the RAM of networked programs in similar fashion. 
 //programs with the anti-Objectivist programs far outnumber the Objectivist-C compatible programs.
 //it is as of yet unclear if anti-Objectivist-C anti-firus is a bug or a feature.

This was funny until I realized you are serious! The joke’s on me, ha, ha, ha. Knock yourself out. – A long-time Rand fan.

Brilliant! I especially like “In Objectivist-C, there are no exceptions.”