The bridge from C# to JavaScript – Hyperlambda

Imagine if you could easily invoke C# methods from JavaScript, and easily invoke JavaScript functions from C#. The main purpose of Hyperlambda is to serve as a bridge between JavaScript on the client, and C# on the server. Among other things, it allows you to declare your HTML markup, with a syntax similar to YAML. From your Hyperlambda, you can easily declare DOM event handlers on your HTML elements, that invokes your C# methods on the server when raised. Imagine the following code.

  innerValue:Click me!

I assume you don’t need a PhD in computer science to understand what the above code does. Then combine the above Hyperlambda with the C# method created in the video below.

This simple trait, allows you to bridge your server side C# with your client side JavaScript, without having to create complex JSON serialisation and de-serialisation functionality yourself. And, it reduces the size of the client side JavaScript library to 5.7KB, giving you a lot of room to add your own JavaScript …

Check it out here

Proof of that most system developers will fail the Turing test

I just recently posted a link at Reddit/Programming with the header “AI – When the Computer becomes a Software Developer”. It was like throwing a can of gasoline into a bonfire. Read the responses here. Out of 763 readings so far (in an hour), 63% down voted the article. Most of the commenters started immediately attacking the posting. This is a very interesting figure, since there is only one accurate response to the article, and it goes like follows.

This is an interesting system, but I can’t see any AI in it …?

The above is the **ONLY** accurate response to the OP! All other responses are arguably proof of an incapacity to digest and analyse new information, in an attempt at trying to find the best solution for those having hired you. The reason is of course that a simple look at the system’s code, would easily have revealed that it contains *ZERO* AI! All other responses illustrates a system developer’s inability to accept alternative solutions, and investigate new technologies – Probably because it is being perceived as a “threat” to his own job security.

My intention wasn’t to prove that my software system passed the Turing test, it was to prove that most system developers will fail it.

One of the commenters gave me a fabulous response though, which I just simply adored! Read it for yourself below. I think it explains everything you need to know about your system developer’s “resistance towards change”

Hats off to this brilliant and open minded guy (or gal?)

And in doing so, I arguably proved that my software system was more intelligent than 63% of the world’s system developers – Not because my system contains any Artificial Intelligence, because it doesn’t! But because of the emotional baggage, prejudice, and fear of loosing their jobs, the average system developer harbours. And how this fear makes them incapable of finding intelligent and new solutions to their problems. And if you look carefully at my original post, I don’t make a single claim towards that the system contains any “AI”. Of course, I did admittedly combine two characters from the Latin Alphabet, that I knew would make developers go berserk, and trigger their emotions. However, arguably my OP proved that the average system developer is …

An unintelligent, emotionally biased, lesser human beings, corrupted by 50 years of powers, mortally afraid of the future they see is inevitable, and how new technology renders them “obsolete”.

And of course, if you have such people on your payroll, you have a holy duty towards your shareholders to simply fire them. But just relax, you can easily replace these guys with my software system. Because even though it has an IQ of *ZERO* – It’s still more intelligent than your average existing system developer … 😉

Watch my computer create software

In these AI days, it was just a matter of time before the computer starts doing the job of the software developer. Computers are already thousands of times better than us to play chess for instance. Chess is a problem of “perfect information”, so is creating software.

In chess the objective of the game is to check mate the opponent. Describing this objective to a computer is easy – And once you have accurately described your objective to a computer, its intelligence can always outperform humans in all cognitive tasks, as long as it is a task with “perfect information”. Implying if you can accurately describe your objective as a software developer, a computer can outperform any software developer easily, and implement your software much faster, much more accurate, and literally completely bug free. Describing the objective for a software system is actually not that much more complex than describing the objective in chess. It’s really just a task of having a formal way to communicate specifications.

I have created a software system that creates software systems. I refer to it under the name of Camphora Five, and it’s one of the modules in Phosphorus Five. It allows you to declare your data, for then to have the computer create your code. You can see an example of usage in the video below.

An acquaintance of mine, which is a really skilled developer for the record, once bragged about how he had created something resembling the above system in 12 hours. 12 hours to implement the above is quite impressive for a human being. A qualified guess would be that most developers would need weeks to implement something similar. However, my software system does it in 2 seconds, after I have created the specification – And it takes me 2 minutes to create the specification for it! The result becomes functioning code, 100x more responsive, with a fraction of the bugs a human being would create.

The above example of course is only the beginning. Currently my system can only create simple CRUD web apps, with one database table, and some charts to display statistics on your data. However, all problems that can be accurately and formally described, can be accurately implemented by a computer – In a couple of seconds! Implying the future for software developers is destined to change, and I intend to prove it, by creating hooks for all the most common specification types that exist, for then to let my computer implement these types of systems automatically. It’s simply the destiny of Hyperlambda.

Camphora Five even creates rudimentary documentation, an API, extension hooks, “UserControls” (widgets as I refer to these as), and everything you’d normally only expect a human being to be capable of creating. And it creates 2000 lines of code, in 2 seconds, without producing as much as a single bug in the process!

For a decade I have tried to make software development so easy that “grandma could create software”. Not realising that in the process, as I were about to succeed in my goal, this task also became so easy, that even a computer could do it. Leaving the software developer with only simple customisation tasks to apply after the system has been generated – Effectively eliminating 98% of a developer’s workload.

It looks like software developers are to finally get some work/life balance … 😉

Download Phosphorus Five and try it out for yourself here (It’s Open Saucer)

If you’re interested in helping me in this process, feel free to submit a ticket suggesting a formal specification type for me here

A speed comparison between web grids for ASP.NET

When creating web apps, the responsiveness of your app should be priority 1, 2, and 3. If your app spends a minute to load on your CEO’s iPhone, you might as well ask him to carry around the app’s source code, written out on paper. Hence, having accurate data before starting your project, is key to your success  -  And since the most commonly used UI element is probably “the grid”, or “data grid”, I thought I’d write up a speed comparison in the tooling space which is relevant for you when creating ASP.NET web apps.

Telerik KendoUI grid for jQuery

Telerik is one of the largest web component vendors on the ASP.NET stack. They employ thousands of developers, and their components have all the features you can dream of. As always, you pay for what you don’t use, and the specific cost for the Telerik KendoUI grid is exactly 1.4MB of JavaScript, according to their example page. This implies that if you’re trying to consume their grid on a low bandwidth connection, on for instance your phone or something, on an empty cache  -  You can expect to require minutes to load your page initially. On my 50Mb connection the time it takes to simply load their example page, which contains no more than 91 items for the record, is a staggering 7.63 seconds.

Infragistics ASP.NET Data Grid

The “Multi-Column Footers” example from Infragistics, that you can find here, requires a total of 1.3MB of JavaScript. It spends roughly 8 seconds to load on my 50Mb connection, on an empty cache. Yet again, the Infragistics Data Grid has all the features you can imagine, and yet again you pay a staggering price for things you’d highly likely never use. But its feature set is pretty amazing, which allows you to “Filter excel style”, having “Mult-column footers”, “Multi-Column Headers”, etc, etc, etc …

It seems the only thing this thing cannot do, besides from splitting atoms, is to actually have it load on your page, before your users falls asleep. The “wait cursor” is its most frequently seen UI element, as it was with Telerik too.

ExtJS grid

This grid component is in its own category to some extent, since it’s not an ASP.NET datagrid, but rather a generic JavaScript component for any backend you might want to use. However, since it’s so popular in usage, I wanted to include it here none the less. Sencha does not have an example page though, which only illustrates the usage of their grid  –  However, since they often tend to encourage their users to package all of their JavaScript components into a single file, their own usage example is still quite relevant. 1.1MB of JavaScript and 3.5 seconds to load on an empty cache, yet again on a 50Mb connection, which is highly unlikely available on your phone, as you’re waiting for the train, to go to work, and you need to check up when the next train is due …

Phosphorus Five datagrid

This grid is special. First of all, I am its author and creator, so I am probably biased  –  Secondly, it builds upon a unique model of “Managed JavaScript”, which among other things implies that it never downloads more than 4.8KB of JavaScript. It is also the only example that actually uses a “serious dataset”, with more than 315,000 records. Telerik, Infragistics, and ExtJS’ examples pages have somewhere between 100 and 300 records  –  Which makes you wonder if they even work with “real data”. The video below illustrates 315,002 records in its Camphora Five generated app. The initial page load is 4.8KB of JavaScript, and hence arguably more than 200x faster to load than any of the above components. Although I am testing this on localhost, not having an example server to run it in  –  I think the numbers of 4.8KB of JavaScript speaks for itself …

The code necessary to create a grid

Another important fact when creating web apps, is how much time a developer needs to spend to actually implement his application. For Telerik, Infragistics, and ExtJS  -  This implies thousands of lines of code, in 3–4 different languages, in dozens of different source code files. In addition to that you’ll need to learn JavaScript, CSS, jQuery, the component API/Framework, etc, etc, etc. Since I don’t know any ways to illustrate this, since developers tends to not believe me when explain it to them  -  I am compelled to illustrate how to create a data grid in Phosphorus Five using a video …

Summing up

As I said above, I am biased, being the creator of Phosphorus Five  –  However, you can create, consume, and deploy a web app with Phosphorus Five, with a data grid, allowing you to sort and filter hundreds of thousands of records, in milliseconds  –  And you can create your solution 100,000x faster, it will perform roughly 200x better, and you can put real data in it, and not simply tiny sample data of some few hundred records  –  And it simply works …

and you can do it in 2 minutes!

But Telerik, Infragistics, and ExtJS have really beautiful grids  -  I’ll give them that. If you want to build a working app though, with real data though …

you can download Phosphorus Five here (it’s Open Source).

Telerik Kendo UI grid 7 seconds, Camphora Five MySQL grid 0.5 seconds

On my 50Mb internet connection, the examples for the Telerik Kendo UI grid component needs 7.28 seconds to load on an empty cache. My Camphora Five generated MySQL datagrid, with real Ajax, and 315,000 records in its database, needs 0.5 seconds to load on an empty cache. Telerik’s Kendo UI example grid has 91 records in its example. I imported 315,000 records into my Camphora generated app, and still it performs 14 times faster.

If you know anything about web development, you know that size matters. And the smaller things are, the better things are. The reason why Telerik is slow like syrup, while the Camphora Five version is blistering fast, is of course because Telerik needs to download 1,400KB of JavaScript, while the Camphora datagrid only needs to download 5KB. This implies that in regards to bandwidth usage, only counting JavaScript, Telerik’s Kendo UI grid will require 280 times as much bandwidth as the Camphora grid.

Another crucial point in this, is that the Telerik example requires that you write hundreds, if not thousands of lines of code to get it to work – Still it doesn’t use a “real database”. The Camphora Five datagrid was automatically generated in 2 minutes. See how below …

If you want to test my claims yourself, or reproduce the above to comparison, you can download the Open Source code for Phosphorus Five here.

TempleOS, HolyC, pure madness and pure brilliance

I posted a link to my latest DZone article at Reddit, and a commenter ironically said; “TempleOS in the cloud”. I had never heard of TempleOS, so I did a search for it, and I am not really sure about what to even say to be honest with you. First of all, I am not sure I can even legally link to any of its creator’s material, without violating several laws – At the very least break at least dozens of “political correct moral codexes”. Hence, I think I’ll link to the WikiPedia article about it, and simply leave it with that.

However, if you look past the “CIA #$%%$##$ “ parts of its creator’s “condition”, it is not difficult to shimmer some of its brilliance and beauty. First of all, it’s an operating system, with dozens of games, it boots in 1 second, and it does have many highly interesting ideas incorporated into its core – And it’s apprx. 100KLOC of code. Let me repeat that, in case you missed it;

100.000 lines of code, and it’s a “complete” operating system, built from scratch, and it has **dozens of games**!

If I am to ignore some of its obvious flaws, such as a complete lack of networking – I must admit that parts of it is really fascinating. One thing that particularly intrigued me, was “HolyC”, its main programming language. HolyC is a JIT compiled  programming language (Just In Time Compilation), resembling C’s syntax, with some interesting additions. Its architect created it from scratch, and among some of its defining traits, is that you execute the source code files directly. In fact, the JIT compiler for HolyC is so blistering fast, it allows for faster execution of an average HolyC program, using JIT compilation, from its source code, than the startup time for an average Windows program …!!

Yup, you can “execute” a source code file, and it still executes your code BLISTERING FAST!!

Secondly, there’s no “main” function. Invocations within a “source code file” (or an “exe”), are executed in order of appearance, resulting in a much simpler model for coding, than arguably C and C++ has – Or for that matter *any* language out there has. You can include entire programs into your own code, with a simple “#include” statement, allowing you to “reuse entire suits of applications”, in your own customisations, arguably facilitating for reuse, at a level difficult to comprehend for those not acquainted to similar ideas from before. There is only one process, which according to its Biblical inspiration is referred to by its creator Terry as the “Adam process”. This allows you to invoke functions in one program, from another program.

The language contains some pretty amazing reflection capabilities, such as the ability to dynamically determine a function’s arguments and signature, during runtime. Even though it’s compiled into x86 machine code, and does not contain any notions of “byte code” at all. This of course, allows you to dynamically figure out a program’s capabilities, during runtime, from its machine code.

It allows you to “unassemble” any piece of compiled code, and inspect the assembly code for your programs. It contains its own unique filesystem, which allows you to store your files compressed, and have your load file invocations transparently “unzip” them, as you read the files. Yup, you can store your HolyC source code, natively zipped, and execute it, as if it was an executable – At which point the HolyC JIT compiler kicks in, compiles your HolyC source code down to x86 machine code, and executes your program. And …

It does this in MICRO SECONDS!!!!!!

If I were to ignore some of its “quirks”, and some of its architect’s “flaws”, I am left with a single expression on my face, and it is basically “Holy Mother of God”. Its “naive” approach, its inherit simplicity, and some of its intrinsic beauties, are simply too stunning in nature to ignore. And my conclusion is a state of complete awe and jaw-drop …

There is absolutely no way you can seriously refer to yourself as a “computer scientist” today, without having a look at Terry’s HolyC, taking it seriously, and try to squeeze out its diamonds – Because they’re there, in plenty!

Even its terminal, which BTW supports adding images into your text, is built as an immediate HolyC compiler, implying you’re expected to invoke HolyC functions from the kernel to do stuff such as listing a folder’s files, etc …

As to Terry’s fate, I am not even sure about what to say, except if you have a dollar to spare, you should definitely consider giving the man a break. He’s got a PayPal account over at the project’s main website. I’ll send him a Tweet after having published this article, and have him confirm that it actually leads to his wallet. Edit; A guy over at the Reddit group for TempleOS has just confirmed that the PayPal account indeed leads to Terry.

Terry, if you ever read this, I want you to know, that at least in my book, you are absolutely stunningly brilliant, and your work is as close to being a computer programming miracle, as it is possible to come. Here’s one for you bro ❤

This is your brain on OOP

OOP and cults have many of the same effects on the human brain. In a cult there is always one right answer, to most questions you can ask. OOP has these same traits.

If you study a cult, and believe in its dogma, your cognitive abilities changes. Few can doubt this simple fact. Arguably, the same is true for Object Oriented Programming. OOP changes your brain’s ability to see nuances, and makes you want to classify everything into “car”, “house”, etc. Cults work the same way, with their methods of classifying everything into either evil or good – While the truth is that there are always nuances, which both cults and an OOP mind tends to miss.

OOP was invented by two Norwegian professors in 1967, in the programming language referred to as “Simula”. I suspect this was not a coincidence, since in OOP, versus a more functional programming language such as LISP – There always seems to be exactly one right answer to any question you can ask. This made it easier for these professors to hand out grades, since they could just compare their student’s answers to “the correct answer”, and such make their own jobs easier.

The problem with this, is that just like all cognitive frameworks, which arguably OOP in its nature is – It also changes our brain’s ability to function at its peak level. Hence, OOP is arguably damaging to our brains, the same way joining a cult, or taking drugs for that matter is. Hence …

This is your brain on OOP

Kids, don’t do OOP!

Psst, there exist alternatives … 😉

The Unified bigger fool’s Theory of Science

My amazing Homeopathic girlfriend, and the woman of my life ❤

I’ve had a lot of sceptics in my life, and I am myself a devout believer in Homeopathy, to the extent of that I’ve actually gone so far as to name my main software project after my homeopathic constitution remedy. Partially to honour my girlfriend, who have loyally supported me, and arguably scraped me up from the floor, using Homeopathy among other things.

While the “sceptic minded” people around me, has always reminded me about how crazy I am, how insane my ideas are, and what an unbelievably empty and unsubstantiated framework I’ve been able to waste my life on. Well, I have an announcement to make, and it is as follows: I am a Homeopathic software developer.

In fact, I have created a programming language which is not per se a programming language, I have created an operating system, which is not an operating system, and I have created a framework, which is not a framework. In fact, I have even gone so far as to implement polymorphism and encapsulation in Phosphorus Five, chemically cleansed of OOP and classes. Feel free to explain that if you can … 😉

Phosphorus Five was entirely created around the axiom of Homeopathy

If you’re still a s(c)eptic, feel free to explain the following paradox! Feel free to comment below if you believe you can explain it … 😉

CHI – Computer to Human Interface

You don’t need to have a PhD in computer science to understand that the interfaces between humans and computers will be increasingly important in our near future. Traditionally this has been defined as UI, GUI or UX – Implying respectively, User Interface, Graphical User Interface or User eXperience. None of these words accurately describes our tasks as software developers though, and a more fitting word would arguably be CHI, or Computer to Human Interface.

The less friction we have, and the higher our degree of computer literacy we achieve, the brighter our future obviously will become, collectively at least. Which implies that if we can solve this interface problem, in an adequate way, then a new era of Enlightenment can easily be within reach for us collectively. And of course, realising how much the previous era of enlightenment gave us, the potential gains couldn’t possibly be higher.

To solve this, we must create a bridge between the human cognitive model, which arguably is based upon language, creating our cognitive model for understanding our reality, and communicating it to our peers – And the computer cognitive model, based upon algorithms and binary logic. Such a bridge, would put enormous constraints and demands from our programming languages, and arguably require a revision of how we think about computer code in general.

Since the first task for creating such a bridge, is to define it, I’d like to propose a new word describing it; CHI – Computer to Human Interface. Which allows us to create a common cognitive model for what we are actually talking about. Besides, it also happens to be a very beautiful word, with lots of existing positive associations, implying (in Chinese) “the energy that creates life, and is all around us, and the foundation for everything in our universe”. It also holds a lot of other beautiful associations, such as being the letter “X” in Greek, symbolising among other things Jesus Christ, in addition to that it implies a person’s Guardian Spirit in Igbo, etc.

So hence the word itself, arguably becomes a bridge between the “old” and the “new”, being both and acronym (new) for Computer to Human Interface, and having a lot of ancient associations, realising its origins in our ancient past. In addition, it has its own unique Greek letter, which arguably is necessary to make it popular in scientific circles, to please the scientific community 😉

Hence; CHI mathematically written as “X” is its name 🙂

Hyperlambda, a human2computer communication interface

How does your computer feel today?

I have just been in a very interesting email conversation with a renowned senior researcher and scientist. Since I am not entirely certain about whether or not she wants to bring our communication into the public space, I will avoid disclosing who she is. However, our communication illustrates a very good use-case for what I like to refer as the “hard computer literacy problem”.

The researcher I have been communicating with, is a native French speaker, while I am a native Norwegian speaker. Obviously, if we communicated in our native tongues, we would not be able to understand each other. Hence, a common interface between myself and the other party needs to be established – English does a decent job at this!

The same problem exists between computers and humans. Humans understands spoken and written words, while computer understands only computing instructions – And the gap between these two very different mental frameworks, leads to huge communication problems. It doesn’t matter if you exchange “machine instructions” with whatever programming language on the planet here either, since the gap between any current computer language, and any existing human language, is simply to great for most people to be able to engage in a meaningful communication with a computer, to communicate their “intentions”.

Hence, the results becomes that of, only roughly 2% of the population in the western hemisphere, are capable of “communicating with computers”. Which creates an “illiterate gap” between “those who know” and “those who don’t know”. Arguably the same problem as Europe faced in the 15th century in regards to general literacy, before Gutenberg’s invention of the printing press, commoditised the Bible, facilitating for everybody learning how to read the Bible themselves. Needless to say obviously, but the effects of this, made the very concept of power become significantly much more evenly distributed, facilitating for the Enlightenment, modern science, and Democracy, etc.

Linguistics, the framework of the human mind, and the foundation of civilisations

However, if you break down “communication” into its abstract parts, you realise that there’s actually a lot of common ground we can rely upon, to communicate in a much more natural and intuitive way, with our computers. For instance, most sentences have a verb, a noun, etc. The verb might be “move”, the noun might be “car”. OOP was supposed to solve this. Unfortunately, OOP is complicating matters, instead of making things simpler. Hyperlambda though, due to its relative naive structure, seems to perfectly solve this problem though. Below is an example of a piece of Hyperlambda, which might look like pseudo code, but could easily be implemented such that it becomes *actual working code*.

Notice, I want to emphasise that the above is *not pseudo code*! Still, understanding what the above Hyperlambda would do if evaluated, is so simple that it wouldn’t even require explanation to make a child understand it. Compare the above Hyperlambda with the OOP equivalent.

ICar vehicle = Factory.Find ("my-car");
IAction action = AnotherFactory.CreateAction (Action.Move);
action.SetSubject (vehicle);
IPosition pos = YetAnotherFactory.CreatePosition ();
pos.SetSource (Locations.Work);
pos.SetDestination (Locations.Home);
action.Parametrise (pos);
action.Execute ();

You don’t need to be a rocket scientist to understand how one of the above examples are much more easily understood. And you don’t need many years of OOP to realise that the above description of how to perform some simple action with an object in OO, is a highly realistic description of the necessary pre-requisites for being able to even communicate a simple thing, such as moving an object from one position to another position.

An early version of written language, too arcane to be understood by anyone but a few elect members of “the elite”. Just like programming languages are today.

In fact, if anything, I’m willing to bet most OO programmers would perceive my above usage of OO as naive, compared to what they have often had to implement, to create “SOLID” code themselves.

Even ignoring the parentheses, semicolons, object decorations, and cohesion problems – The OOP solution is still “Greek” for most people. While the Hyperlambda solution can be intuitively understood, by everyone having nothing but basic understanding of English.

For a “human 2 computer” interface, Hyperlambda is simply superior. Sure, you can understand how to “communicate” with a computer today, if you spend some 10 years studying some dark and mystical programming language – But why is this necessary …?

Why can’t we use the existing rules of Linguistics and natural language, to find a common ground for communication between computers and humans …?

Why is it necessary having to spend half our lives, before we can create basic programming instructions, communicating our intentions to a computer? I can easily tell a human being to “please turn off the lights before you leave home tonight”. If I asked a computer illiterate to tell their computer the same thing, they’d freeze, unless another software developer had already created a “button” to allow for such an action. Which leads us to the following question …

How many buttons should we have in our software systems?

To communicate ANYTHING to any other human being, requires only 26 “buttons” (the Latin alphabet and a keyword), still most human beings can use those 26 buttons to communicate an infinite amount of different permutations of intentions. So why does my WordPress dashboard have ~1,000 different buttons? It cannot even do 0.0001% of what I can do, using natural speech, or a keyboard with 26 characters.

In fact, the above Hyperlambda example is so close to natural language, that I have taken the liberty of creating a bridge between computers and humans, which allows you to literally speak natural English to your computer, and have the computer evaluate computing instructions as a consequence – Effectively even eliminating the need for even being literate to become a “computer programmer”!