Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

Why my favourite language is .NET

Sign in to follow this  


I quite like Microsoft's .NET initiative. And not simply because it further abstracts one from the hardware and ensures any application you write will work on all hardware, all OS's, which have the framework implemented. No, that is only a small bonus. The real great aspect of .NET is its Common Language Specification and the perfect interoperatability between all languages which meet the CLS - are .NET compliant. The fact that all languages compile/produce IL files that are basically the same, regardless of language of choice makes the case much stronger. This freedom, this flexibility, this ability to use what language fits your needs and mix and match strengths and counter weaknesses from this and that language is what I feel is .NET's greatest attribute.

For example, I am using C#, F# and IronPython for my project. Each for a specific reason. C# is what the core engine is in, the language is quite clean..at least when compared to C++. It arguably generates the fastest code of all the .NET languages and is the main Microsoft language, it would seem. I use IronPython to script the application, this is because python is a far more flexible language than C# and is more intuitive. It is also simple but in a manner which allows complex behaviour - using this as a script will allow things to be done that would not have been easy any other way. F# is used to code certain things that would not make sense in anything but a functional language. This functionality is exported as assemblies to be used by the C# app. Specifically, a simple implementation of Metamath to allow for exploration of meta-mathematical concepts in a pretty visual and innocent setting. Takes in scripts as well. A modal logic interface will be built on top of this and will control the behaviour of certain aspects to do with planes and magic etc. Again, I am wrapping some pure maths in the guise of a game. I hope. hehe. Nonetheless this freedom, the ability to not be restricted to any one language is in my mind the greatest offering of .NET. Just take a look at the number of languages available for the platform which can be made to operate with each other with little to no effort.

Why there can be no One Perfect Language

All programming language, all computers, computers running programs by a certain language are all essentially formal systems. This feature allows us to discuss things and apply things and proofs from logic on the capabilities of languages.

Formal System

In the most basic sense, a formal system is a system of logic that allows us to "reason" mechanically. A formal system is composed of:
  • an alphabet: symbols which compose its language e.g. {P,q, - }

  • a syntax which describes how to form a proper expression in the system. Formally called well formed formulae

  • A formal language, valid strings formed with our alphabet

  • Rules of inference - series of operations we perform on our sentences (strings of symbols from our alphabet e.g. pq--p) that end in something which is true in our system

  • and some starting wffs or Axioms.
A theorem in our system is a list of sentences with the first being an axiom or a proven wff (theorem) and every sentence within being a result of transformations which follow our rules - the last sentence in our string is a theorem.

Formal Language

A formal language is in the most basic sense a set of strings over some alphabet or rather, a proper subset of the set of all possible strings that may be composed with some alphabet, with an alphabet being no more than a set of symbols. Formal languages are devoid of ambiguities common to natural languages as English or Chinese (in fact there is no inherent meaning to the set of string or sentences formed in them), they are mechanically manipulable. That is, a computer can follow instructions formed in them. They were originally developed with formal logics and the wish to make math completely mechanized and in essence, air tight. All programming languages contain formal languages. In fact the term programming language is a misnomer since most programming languages are more than just languages. They are entire systems, indeed the term computer programming system would be more appropriate than computer programming language. This argument for this will be given informally later.

Should have known that no machine could replace a pup named scooby doo

Computers can be represented as formal systems, programming languages can be said to generate or represent rules of inferences which control the computer's state. This state may be considered sentences in the computer formal system with the act of following wffs represented by computer code transforming sentences to generate a theorem in the machine's formal system. Indeed an operating computers actions is analogous to proving theorems in its formal system. Programming languages and computers in principle contain "within" the entirety of current mathematics. Converesly, they are tightly bound by the limits on formal systems based on their very nature.

Can the brain be considered a formal system? There are those who argue using Godel's Incompleteness Theories and similar mechanisms (Lucas , Penrose) that the brain is more than a computing machine. Indeed, no finite machine could ever hope to replicate human brains since for one, such a machine would have unprovable propositions contained within that the human brain it was supposed to emulate could. For another it is almost certain (since nothing can be certain) that the human engages in activity in the mathematic endeavour that is not limited to computable functions. Interestingly, if this is true then the Church Turing thesis - any evaluatable function can be computed by an algorithm on some computer is wrong, since we would have an example of a set of "mechanical operations" or more appropriately an algorithim that other machines could not compute. Conversely, if you feel the Church Turing thesis must be true and that the human brain can be represented by a [finite] computing machine then it is necessary that you accept the corollary (assuming consistency) that the human brain can never understand itself, there will be lines of "thought" that it simply will never be able to get to. Nonetheless such arguments for and against the human brain as a machine assume the consistency of the humans brain logical operation (note the use of consistency) and that a list of axioms may be attachable to it. The truth or untruth of this is an issue of debate, one which will not be gotten into in this post, although I do think the human brain to be more than a computing machine.

Why there can be no Perfect Language

One can show that Godel's theorems apply to computer languages and thus that no computer languages can ever show itself to be consistent nor are they complete in the sense that every statement in their system is decidable. Godel's theorems apply only to formal systems which have axioms that are fairly strong and interesting, in order words they can *encode* some representation of the natural numbers {1, 2, 3, 4, 5, ...}. Every computer language that is Turing complete can do any anything that a Turing machine can do. Turing machines can arguably evaluate any computable function as can the lambda calculus (although as mentioned earlier, this statement is untrue if you like me, believe that the human brain is more than a mere computer), an equivalent but different formalism, The natural numbers are definable with the lambda calculus. Thus any Turing complete computer language is powerful enough to define the naturals.

As stated before, programming languages are actually formal systems with wffs (the syntax), alphabet, vocabulary and rules of inferences with the computer state actually being the sentences and the "computer code" being the transformations on the previous list of theorems and axioms (previous computer state) of the formal system. The computer code represents some range of the valid behaviour or transformations of our system. Thus every language coupled with the computer represents a different formal system. Godel's second incompleteness theorem does not concern us. But the first one is of great relevance. It guarantees that our system will be incomplete and will never be complete. Every new axiom will add, every new feature or behaviour will always allow another new undecidable behaviour to crop up. In programming terms this boils down into the fact that every language will have unreachable portions, states, behaviour. That is there will be things that the computer language will never be able to do. No one language will ever be made capable of doing "everything" at least not while remaining consistent and not convoluted. There will be behaviour that our computer may be able to evince but our language will not allow us to invoke.

This is basically a very elaborate argument for the fact that no programming language can have or will ever have everything and be perfect. As such the .NET and its CLS are the perfect solution around this limitation and the closest one can ever get to a perfect language.
Sign in to follow this  


Recommended Comments

<musing> That's a neat thought -- using IronPython for scripting while C# for the game itself. I'm definitely going to have to look into this some more. Thanks! [smile] </musing>

Share this comment

Link to comment
Original post by ApochPiQ
Pfft, noob. Everyone knows Epoch is way sexier than .Net.

Pfft, noob. Everyone knows Epoch doesn't exist yet.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!