Posts Tagged Takniki Vishleshan

Re – Rethinking Http :)

My friend and colleague , Vishal  had these questions after reading this post of mine.

a. What do we mean by Half Duplex and Full Duplex?

These are communication jargons back from my electronic engg. days :)

A half duplex communication is a two way communication between two devices. But these two devices cannot communicate at the same time. In other words you can either transmit or recieve at a time but not both. A very good example is walky talky communication.

Colonel Vishal : Hello Capt. kgthegreat. What are you working on? Over.

Capt. kgthegreat : Hello hello , Colonel Vishal. I am still working on accesibility. Over.

You hit the transmit button and say something and then say over to signal the end of transmission and release the transmit button.  Now the other party repeats the same protocol to transmit.

A typical example from our software world will be a strict client server interaction. Firstly a handshake is done between the client and server. Then Client sends a request. Server recieves and then sends a response back. The HTTP protocol is designed the same way. You have HTTP request and response objects.

Whereas a Full Duplex communication is more like a modern day telephone conversation. You can transmit and recieve at the same time. Jonas Jacobi talked about getting this behaviour in HTML 5 Commmunication protocols.

Find more information here.

b. What exactly is Web Sockets?

Web Socket is a new Full Duplex interface defined under HTML 5 Specifications. And yes it is a protocol just like HTTP is a protocol. Like HTTP , if implemented , it will sit on top of TCP/IP Layer.

So instead of  ” http : //www.kumargaurav.info ” you will have “ ws : //www.kumargaurav.info ” if implemented.

I will let the people who helped creating it talk more about it.

Here is an excellent FAQ on websockets if there are more questions (which is a healthy sign).

Go here for HTML 5 Specifications which is work in progress.

Go here to know more about the most common network protocol.

Another general reading which I can suggest and personally endorse is Andrew Tanenbaum’s Computer Networks. Its a life changing experience :) .

c. Are we trying to say that Web Sockets is/are going to replace HTTP protocol?

No and Yes. No because it will take time (I think it is envisioned to be completely implemented and accepted by 2020) and yes because it is the right thing to do.  Another compramise in this direction is to make WebSocket sit on top of HTTP but I don’t know how good is that.

Leave a Comment

@GIDS 09 – Workshop on DSLs

Session by Venkat Subramaniam

What are DSLs?

DSLs are domain specific languages. The sole reason of their existence is to solve a single particular problem and to solve it well and better than any other general purpose language.

DSLs are not new as such. We come across a lot of examples of DSLs in our day to day coding. CSS , ANT etc. They have a purpose to their existence and it is difficult for you to make them deviate from their purpose unlike general purpose languages. And guess what. They are sooper good at their job. So DSLs make good sense.

So according to Martin Fowler , there are two types of DSLs , External and Internal. Internal DSLs are so called because they need a host language to define their look and feel. External DSLs have their own custom syntax and a parser is required to process them.   

How do I get Up and Running with My Very Own DSL? 

Answer is simple. You need a tool. There are some available. The best of the breed being ANTLR.  If you are an eclipse fanboi then take a look at xtext. My good friend and colleague , Phaneesh blogged about bloated softwares the other day. I am glad that some powerful stuffs still come in small packages. ANTLR is all of 2.93 mb :)  

Why do we need DSLs as an organisation?

As an organisation, we are looking at various new ways of development of new products and trying to better our software delivery model by changing the rules of the game. 

But we need to do it faster. We have tons of code in what is generally called as legacy architecture. In my opinion , we need good DSLs written by us to get things done faster and more efficiently. I know we are taking steps in those directions. DSLs will help us a great deal.

 

Get the whole presentation here. And while you are at it, browse the site. Its informative.

Leave a Comment

@GIDS 09 – Rethinking HTTP

I am at the Great Indian Developer summit 09 at IISC, Bangalore. Today is the Java Track

 

The Java Track

The Java Track

 

 

One interesting session I attended was Re-architecting the Web with HTML 5 Communication

Jonas Jacobi 

Why are we using http? Or rather, Why are we STILL using http?

Good Question. Because the powers to be decided that you , yes you are doomed to use http forever(?) whenever you want to connect to the internet.

No but really. Why are we still stuck on a half assed protocol such as http. Our backend interaction is not half assed nor is our desktop apps then why oh why is our internet experience be half assed. Why is client server interaction inherently half duplex rather than being full duplex.

One answer comes to mind. Http is half duplex. Why? Because HTTP and the internet was originally thought out to be a good toy for sharing intellectual documents (mainly text) until some one thought of the idea of expanding it and sharing pretty much everything. But somebody forgot to upgrade the protocol :) and this protocol was written way before (1983) I was born so its not me.

Then what is stopping us from upgrading this half assed protocol to something brand new and full assed. :D
Yes you said it. Let it flow , no? Why change it. Don’t fix it if it ain’t broken. Right? 

But it is hindering my interaction with the world. Why should I wait to hit the button everytime I want something. Don’t kid me with AJAX. Though it is a sooper sooper way to increase user experience but it is killing the servers with every small request (which is an HTTP Request which is a bloated block of data anyways) and I am inclined to think green here. With every http request I make I am leaving a Carbon Footprint behind me. 

So whats the solution? According to the speaker, the solution lies in yet another protocol which paradoxically(in my opinion) sits on HTTP and in future might sit on TCP/IP. They call it WebSockets. Interestingly this protocol was developed as a result of trying to control  a toy train using a browser.

Ok. So I stop here. I could not find a link a to the presentation but this blog post by Jacobi is pretty interesting. Google about websockets to know more.

Comments (1)

Windows-Killer is here

Google yesterday announced google chrome . Its a browser or so they say. Looks more like a mini OS to me. The comic rocks too.

When I was in college , I used to wonder what exactly is going on in googleplex. Where are all the brains which were being hired by google going? I used to come to a single conclusion : They are creating a windows-killer. The chrome is only the beginning. I suspect google has a lot of tricks left up their sleeves.

I believe its not very difficult to kill Windows. Mozilla started it. Google is carrying it forward. The world needs more PhD. dropouts.

The next question in my mind : Who is going to be U.S. Robots and Mechanical Men, Inc in the coming years. Who will make OS with AI? Who will bring about the next wave of industrial revolution? Who will be the next Masters of the Universe? Will it be a single entity or a community effort. Any way forward historically has been driven by individual inventors(bulbs, cars, airplanes). What will happen this time around?

While you ponder over these questions, I will go and ponder over what will my PhD. thesis be. As I said, world needs more PhD. dropouts.

Comments (1)