Hacker News new | comments | ask | show | jobs | submit login
Objectivist C (fdiv.net)
221 points by mkopinsky on May 18, 2012 | hide | past | web | favorite | 73 comments



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...


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.


Makes me think of exokernels: http://en.wikipedia.org/wiki/Exokernel



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.


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.


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.


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.


Wow. That only makes this that much more amazing.


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.


"centuries of scourges and disasters"

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


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


Tsarist Russia sucked pretty hard too.


the best way to understand what's being said here is to remember that Rand escaped communist Russia

No, not at all. The best--in fact, the only--way to understand what's being said here is to read the fucking book (Atlas Shrugged).


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.


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


> The Objectivist C API is also copywritten.

Oh, so it's just like Cocoa Touch!


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...


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


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.


The Poe factor[1] of this post approaches 1. Well done bluekeybox.

[1] A factor normalized as a real number between 0 and 1, which determines how applicable Poe's Law (http://rationalwiki.org/wiki/Poes_Law) and its corollaries are to the post - e.g. in this case it is both hilarious and frightening when assumed facetious or serious (respectively).


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.


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.


> 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.


"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.


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?


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.


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


I would assume that such method calls are actually descriptive reports by lesser objects of things the superior objects have already decided they are going to do. Otherwise those superior objects wouldn't have listed them in their public interface.


> (portions omitted for brevity)

Definitely not very Ayn Rand.


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.


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

(shrug)


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


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


I think you'll find that, due to the highly polarizing nature of Objectivist-C, the truth value of rand() depends on what machine you run it on.


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


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


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.


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


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.


Bravo, a poignant demonstration of the value of collectivism through code.

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


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?


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.)


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.


On the other hand its totally unlike capitalism for reasons I hope I don't have to explain.

You're going to have to explain it if you want me to tell you why you're wrong in thinking that they're "totally different."

The free market is the economic aspect of capitalism, which is an economic and political system.


Well, I'd say that that Capitalism is the practice of the owners of capital and providers of labor (which might be overlapping sets) getting together to sell items for a profit, with said profits apportioned between labor and capital somehow. Which is clearly not how open source software works.

Capitalism is entirely compatible with free markets and since it seems to be the best way to produce rivalrous, excludable goods I'd expect to see it in any free market unless humans someday invent something better. On the other hand you can easily imagine a non-free market capitalist system, say where the state grants a monopoly on every good to some company or other, or maybe just auctions the monopolies off. I'm not sure how you can call capitalism a political system, since it's existed under a wide variety of political systems ever since it's time coexisting with feudalism.


"I mean, if you're making these decisions collectively how could you justify the division of effort?" For the sake of argument, it could be arrived at by deciding that Python was good for some things and Ruby was good for others. Or rationally understanding that tastes differ and so it would be good to have both options to maximize individual productivity. Or by collectively deciding to have a competition. Or any number of other ways.


It's collectivist in the sense that it is owned by the people.


Open Source software is owned by the copyright holder. "the people" have no ownership whatsoever. Merely a license to use the software (albeit a very permissive license)


In the case of the GPL, everyone can use, modify and re-distribute it of their own accord, as long as it's distributed under the license the author chose. It's not the same, but effectively pretty close to ownership. It's a public entitlement to a permissive license. Open source != GPL, however; the BSD license creates something indistinguishable from common ownership.


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).


Or perhaps it is because individualism is considered such a virtue that it is mocked. Humor is often employed by the minority or those not in power.


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.


I don't think the parties have any choice but to present the image of being altruistic. After all, most people would (understandably) rather have their leaders say "We'll give you good things" rather than "We'll give you what you deserve". That is, I believe altruism is what's given lip-service rather than individualism. Anyways, parties have no direct control over the philosophies that people choose to follow; their motive in the matter is simply to run a nation that has high living standards. This is best accomplished by individual incentives and competition, which is why I think they will always fundamentally support independence rather than altruism.


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


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.


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


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


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

http://nathan.ca/2012/04/introducing-sdfry-the-modern-progra...


Rand would never be able to adhere to DRY


… 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?).


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


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


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


The boring response:

- An individual, because it is a conglomeration of mostly independent entities working both alone and together in a mostly deterministic fashion. The entire collective is viewed as a cohesive "system" with a purpose by those outside of it, even IF that singular identity is actually an illusion produced by nothing more than the emergent properties of a bunch of individual parts working together according to predefined rules. (Example: an individual computer program)

- A community, because as we build systems on top of systems, each of which is semi- or fully-autonomous, and each interacting with other systems in a sense of rational self-interest (even if that self-interest is itself nothing but an emergent illusion), the whole collection of these systems begins to exhibit the properties usually reserved for human communities. (Examples: a smartphone with its OS and all apps working together; an enterprise-wide IT infrastructure; the internet)

- Neither, because (as some might argue), no computer system at any level (from CPU microcode to applications to the entire internet) actually exhibits the true self-directed nature of complex biological entities.*

* I don't actually believe this, if only because humans usually provide that "random self-direction" by proxy.


And now the ten dollar question: When thinking about the computer in these different ways, should we be using different languages?


Because computer systems reliably do exactly what they are told, they cannot be accurately compared to unpredictable and self-interested actors.


All of the above.

It is analogous to a community because you often have several different parts of the program working together to achieve a common goal (although I would consider it closer to a tribe than a community), it is an individual because it works with one mind and it is neither because it is a computer program, not human.


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


Google Objectivism and/or Ayn Rand


It is related to Ayn Rand.

I would dare to guess that this is a US-specific cultural reference, very much like a parody of a local tv host would be.


haha?


"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.




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: