Fourtek IT Solutions Pvt Ltd.

Fourtek IT Solutions Pvt Ltd.
We Win Clients

Tuesday, February 17, 2015

Being Functional ( and Awesome !! )

Hi Haskellers)

Oh, no that doesn’t mean anything bad just that the language that we are gonna talk about today is Haskell. So dear Haskeller, this is one language that I have been so excited about, okay all right, Haskell and Julia.

But in this one I am gonna focus only upon Haskell so Julia’s gonna have to wait till next post. But don’t worry, Haskell is definitely gonna keep you busy till the next time.

So, are you rebel ??
Are you one of those who can’t help but do things differently !!

Then, Haskell is just the right language for you.  What sets Haskell apart from all the languages that we have talked about so far ?

I am glad you asked.

Haskell is officially defined as being a pure and lazy functional language.
Quite a strange choice of words to define a language, don’t you think. See, let’s talk about Haskell being pure functional language first and then move on to it being a lazy one as well.

The plus point with going functional is that it mirrors the real world languages to quite an extent.
Now that you have some experience coding in languages like :- C and Python, in real life would you ever say something like ( 2 plus 4 minus 6) ?
Or are you more likely to say ( add 2 and 4, then subtract 6) !!

Obviously the second one. And btw the answer would be 0 due to the BODMAS priority rule.  
The above example makes it quite clear that we program in a different way than how we think.

So, this is exactly the point at which the functional languages come in. They just mirror our normal thinking pattern to a greater extent and help us be natural. But the caveat being that it takes this line of thought to it’s logical conclusion.

No, there is nothing sinister with this “logical conclusion” but it only indicates that the language makes you think things differently and people who program in these functional languages are more attuned to creative thinking rather than bogged down by the “conventions” of the language.

However, functional languages are the one’s which are used extensively in Artificial Intelligence and it’s not for nothing that the most famous one LISP is said to be a “Programmable Programming Language” !!

To achieve this level of modelling power the usual debt is paid i.e. the speed trade off. And I am more than happy to tell you that the next language that we are gonna discuss i.e. Julia is here to challenge these notions. But more about Julia in later post.

Now for the Lazy part. Well, it basically means that an evaluation is “delayed” till the last moment when the computer is  certain that it is “really” gonna have to execute that code. See, how well does it represent the real world=)


And for the people who are suspicious of recommendations by committees ( and rightly so ! ) this one is certainly an exception for during the AI winter i.e. when the research in the field of Artificial Intelligence made relatively fewer advances and the focus of the “industry” turned to more not-productive , not-clever but rather the quantity of code rather than the quality of code the functional languages lost their charm for the “industry-people”.

At that time people who believed in this programming paradigm got together and decided to come up with a functional language which takes the entire paradigm to the next level. Thus was Haskell born.

In retrospect the design recommended by the committee turned out to be like the anticipation of the Gold-rush of the new millenia viz the languages which work well and can be integrated seamlessly with the new CPU with multiple processors once the limit for the maximum efficiency for a single processor had been reached !!

Thus began the project of coming up with the language that adds up the best qualities of the functional languages and which proves adaptable to the future.

Haskell, was born !!

Hey, there are these two resources that I think you should really check out if you want to explore the language on your own, if you ask me, it’s definitely worth it.


Trust me, read this amazing book and explore the world of Haskell.



Next Stop -> Julia

TIll next time, Folks

Himanshu Sharma.

Monday, February 9, 2015

The world of Programming Languages Part - 2

Hi=)

So, today I am gonna continue with the previous theme i.e. exploring The World of Programming Languages !!

Q. What’s on today’s menu ?

  1. How about Python !!

Yes, funny enough, this is the name of a programming language and quite a famous one at that.

Let’s touch up a bit on history. Actually there has been a slow but steady move towards abstractness, remember last time we talked about how tedious it would be to tell the computer about every tiny little detail regarding the memory and tiny little operations.

Well, it’s tedious for programmers too and that’s the reason why people have made constant efforts to change programming languages so that they may focus more upon the problem at hand rather than being bogged by the details of execution.

And it would be pretty safe to say, I think, that being able to deal with “floating points” i.e. the numbers which have fractions with them like 1.23 or 3.234 etc and the support for various languages characters  have been  major themes in the design of the “new age “ languages.

Consider the two codes for printing the simple statement “Hello World” on the computer screen.
BTW don’t fret about these codes, just skim over them, a glance perhaps.

C code

  1. # include
  2. # include

     3.   use namespace std;

     4.   int main() {

     5.   printf(“ Hello World “);

     6.   return 0;

     7. }

And now for the same job in Python

  1. print(“ Hello World”)

And that’s that !!

See, most modern languages have made it dirt-easy to do the most basic of tasks, routines in the languages but a major pay-off of making programming languages smarter is that they have become slower so much so that these languages themselves are implemented in C/C++ so as to speed up the entire system..

Now, where is Python used. Well, this is the most glamorous point about Python.

  1. YouTube
  2. Dropbox
  3. Google
  4. Quora
  5. Bittorrent

And there are many, many more such well-known applications of Python.

Now, the basic difference between Python and C/C++ is that the former is an interpreted language while the latter one is a compiled one. In simpler language this means that the  “customer service” of Python is quite prompt whereas that of the C/C++ is more likely to give every tiny little detail that you may possibly require.

However, as beginners we don’t need to develop websites with Python, or hack someone’s computer;) but walk down the much trodden path of doing some standard programs and get to
“know “ Python on more intimate terms.

BTW, you remember that scene in the movie “The Social Network” when  the Mark has organized a Code Jam to hire some people. You know what languages they were coding in ?

It was Python !!

Though they were using it at a much more advanced level, something that’s near the horizon from our perspective.


Hey, I have some useful links regarding Python which I really think that you should check out and if you already are won over by Python then these links would be lifesavers for a beginner.




Personally, I think that it’s like learning to walk. First steps are always supposed to be the most difficult ones and it only gets easier after that. So, let’s end this post on this note and the next time I am gonna talk about yet another language that has a  completely different design philosophy.

TIll then,
Happy Coding !!

Himanshu Sharma=)

The world of Programming Languages

 Hi folks=)

Hey, this post is about programming languages with a focus on two basic things.

1.     Which one to Choose
2.     How to get started using them.

So, I am gonna take the liberty to skip over the all-too-many details regarding these programming language and focus more upon those aspects which are more useful to our cause viz to get started with programming once we have made our minds to do so.

And as I said in the previous post, I am gonna focus more upon languages which we are more likely to see in future. You know, I don’t really see the point in learning some obscure language until it gives me some leverage or improves my understanding of programming so all the languages that are gonna be enlisted here are to be seen in that light.

Of course, this list would always be incomplete because there hardly is a common consensus upon usefulness and the parameter to judge “which language is better than others “. Believe me, in the world of programming languages the languages differ like Swahili, English and Mandarin do in “real languages”, No Kidding !!

1.    C and C++
2.    Python
3.    Haskell
4.    Julia
5.    D language
6.    Common Lisp
7.    Lua
8.    JavaScript
9.    HTML / CSS
10.  SQL
11.  Go
12.  R

As you can see that this post is gonna be a long one as we cover a lot of ground in this one so let’s discuss only a few ones at a time and continue with the rest of the languages in the coming posts.

Hey, comparing them to real world languages really is a good analogy !! You see, like real world languages there are various “ language families” with different and unique “ grammars “ their own and of course, how can we forget the staunch and the proud  “ language purists “ of each one.

So, here we go.

1.    C and C++
                       
                        Mmm , yes now this is pretty much where we begin from and yes there are languages which precede these both on the level of closeness  to the system a.k.a assembly languages and then there are those which hardly give a thought to the brand of printer that you are using i.e. these languages are called high level languages.






Now,  a low level language deals directly with the hardware to the extent that you would need to specify the memory location where you have stored the necessary data and then use it with the basic primary operation.

An analogy would be to think like a robot i.e. suppose you need to add two digits in your head. Assuming that you can really appreciate the extraordinary level of detail involved and more importantly prepared to do all the manual labour; almost like a control freak in your daily activity. Then, you would need to

1.    Figure out where the data is located in your head.
2.    Move them to the active memory
3.    Add them
4.    Move them back to the memory
5.    Save the resultant into yet another memory location.

Can you imagine how slow we would become if we were to deal with every information and take decisions with this kind of low-level operation ? What a nightmare.Of course, we deal with things on an abstract level and rely upon intuition to take care of the rest.

The very same thing has been realized in programming languages. And C comes in as a comfortable ascent from that level of low-level handling. Plus it gives one an option to control these operations still it becomes an ideal choice for systems where the speed and efficiency are of vital importance.

The most salient thing about C language is that it is fast. Like lighting fast and every other language is compared against C language only.

The C++ language is built upon the C language and adds a lot more support for abstraction and as a consequence of being built upon the language C, it trades off the level of abstraction for speed of the language.

But, if we are to start off with C / C++ we really should look into various text editors and work upon our ability to quickly type things and more importantly how to edit the written text. It is a factory that is never to be overlooked if we are to really program.

The languages C/ C++ have been around for about 20+ years and being highly effective at what they do they have influenced the industry and the entire theory of programming languages a lot. Their massive influence can be sensed with the fact that they have “ passed on their genes “ to most languages that we possibly can think of i.e. in terms of modern languages.

So, if you like being able to run your program at lightning fast speed and are more comfortable in dealing with things whose functioning, you understand like being able to walk about,  then C and C++ are the way to go.

The number of libraries that are built along and for these languages are truly massive. BTW library, generally, means a set of functions and functionalities that can be used with the language.

You seen, almost all the Operating Systems are written in C/C++ language only. Yes, including the Apple OS, Windows OS and our favourite ones like the GNU/Linux systems.

To give you an idea of how deeply C/C++ are there in the entire computer world let’s consider the fact that All Programming Languages provide support to work alongside these C/C++ languages and that’s how important these languages are to the entire Computer World.

Well, we have covered a lot of ground today, well not in terms of number of languages but in terms of the basic concepts so we are more freer to read and explore other languages in the coming weeks.

Hope you enjoyed=)
This is Himanshu Sharma,
Signing Out.


Till Next Time, folks.

Monday, February 2, 2015

Intermezzo !!

    
Hi people !!
Wondering about the intermezzo ?
Well, this post sort of signifies a change in the direction, you know, a few gradients here and there.
So, let’s summarize what we have talked about in previous posts.
>>> Figuring out the LINUX
This was the very first post and we talked about the extent to which this little thing
 or this ideology has changed future of computers. For, if it was not for LINUX and the FSF in general this instrument of freedom i.e. Computer would not have been realized. Not with this much success, had it been locked in the basement for Scientists and the Armed Forces. This FSF has changed things and I, for one, am convinced that it is for the better.
                
                Further on, we talked about where it is really used and how it is put together.
>>> DEBIAN
                
In this post we explored what essentially was the brainchild of this FSF movement and which OS distributions { distro. in the Lingo} use it. We saw why Ian Murdock came up with this name, DEBIAN.
                We also touched upon that deep suspicion of everything Free , as they say “There is no such thing as a free beer”. But I do believe that this culture of Free Software does has the odds favouring it.
                Say for example, you use Mozilla Firefox and there is someone who tries to slip in a virus by changing the code or by intercepting during the download. For  the latter case there are various checks that are used like md5 checksum which is matched against the site’s actual download and thus blocking out the possibility of interception.
                Whereas for the former the code is open i.e. anyone can see what and how it is made and, what is actual script is , to use the theater terminology. So, if there is a bad dialogue in the script then it is sure to be spotted by someone and thus it’s more likely to be remedied than closed softwares.
>>> F.O.S.S
                This is the post in which we really checked up on the details of the co-operative development approach which makes the system work. And what is it really, that makes people want to wake up late into the nights and to use so much of their brainpower and then in the end upload the thing on the internet for free. BTW if you haven’t read the previous posts then this is a good wake up call, that you really should.
                I build up on my previous posts so jumping in on the wagon halfway would not be the most adventurous thing to do.
                
>>> rms
                This one, personally, was my favourite one. Here, I literally tried everything to convince you that you need to code. You really need to go beyond that uncomfortable feeling when you hear the word “programming”. It’s fun and it’s awesome.
                I enlisted a number of links so as to contribute my two cents in your journey and help as much as I could in getting you started.
                And, of course, we discussed the legendary figure to whom we owe the origins of this entire culture i.e. Richard M. Stallman and the espirit of the movement.
So, in the coming posts we are gonna talk about programming languages that you can get started with. Knowing me, you can guess that I am more inclined to the technology of the future so instead of generation old languages we are gonna focus upon the languages that we are more likely to see in action in near and perhaps in distant future too. The young guns of the programming languages.

RMS


Hello again people !!
Hey, this article is a nostalgic one. This means that today we are gonna talk about the entire FSF and l’espirit of the movement.
Let’s begin with a simple thought-experiment. Imagine driving a car, that you really really love and rely upon and which has served you quite well thus far. Now, you are on a road-trip  {aren’t you and adventurous one;) } and sadly, one of the tyres went pufff i.e. flat.
Obviously, you are quite far-sighted and smart so the solution is a simple one, you have another spare tyre with you, you only need to change the tyre and ride on ahead. Can you imagine a person who does not know how to replace a flat tyre !! Well, to say the least this person would most probably come across as an incompetent one or in case it’s your lucky day then it’s a “Damsel In Distress”  but if it’s one of your bad days then it’s “ The hills have eyes “=)
Now, in another scenario something more expected has happened and though you understand even the slightest cringe of your car, you are not able to fix it and you are stuck. You open the hood but there’s hardly anything at all that seems familiar to you, in fact of all things, if it’s the first time you open up that hood you might be surprised how many things are there in the hood. So, you are stuck, your beloved car is apparently dead and your phone’s battery is down.
You wait and you wait, watch so many cars pass by without a glance at you. You are beginning to curse out loud. Luckily, the next thing that you see coming towards you is the car-repair service vehicle and you conveniently have the problem fixed. But sadly, by that time you have already missed that important meeting/ picking someone up from the airport etc and have almost ruined that once in a lifetime opportunity of making a good first impression or your hotel reservation was cancelled.
So, you are angry, to say the least. But then, as smart as you are, you notice that the repairman didn’t really open up any of those parts in the hood but instead he only poured some cold water in the coolant-box and the car came back to life. Now, you are really wondering that if it was so simple and you had plenty of water for the trip, you could have done it yourself and get yourself moving. You resolve to learn a bit more about those parts which are under the hood of your car as you realize that merely driving a car is not enough but you must also understand it a bit, at least to the extent that you can take care of such small problems yourself.
Hey, I know that this is a slight detour but there is an important lesson in this story. You can’t really rely even upon the best vehicle if you don’t have the slightest idea of how it works.
See, the same idea and the same ideal inspired the Free Software Movement. The thing is the user must be free so as to look under the hood. And in terms of computer lingo, it means the source code. I am gonna write more about these terms later on but let’s stick to theWhy’s rather than the How’s for the moment !!
Now, it is the same with the computers only at a much much grander scale. After all the single greatest tool that mankind ever created is the reason you call yourself modern. Computers, if they were a living species then it is not an exaggeration to say that these computer would have already outclassed human beings, be it on the basis of the quantity or on the basis of the rate of evolution. It took milleniums for man to stand on two legs and only decades for a computer to do so !!
But fortunately, they are not alive and depending upon our usage of these computers they can be the greatest ever instrument of freedom or the strongest menacle/chain that human mind could have possibly perceived of. So, the question is which one are they !!
Now, I think it is the right moment to elaborate upon today’s headline.
rms, as I have told you previously also, is Richard M. Stallman’s handle or say pet-name.
Before moving forward I would like you to visit this wiki page about him and notice the fact that the for a guy who studied in expensive universities like Harvard and MIT, the guy has an awesome lot of “free” mentioned in his life.
And if that gives you some idea about the legendary status of the personality then listen to his talk at the TED platform.


So I hope, in fact I strongly insist that you visit the two pages else...

Ahem ahem, with that little detail out of the way. Let’s move on.=)
So, would you rather that this wonderful tool, that’s there in your hand, inside your watch and this instrument that surrounds you more and more every day and makes itself an all the more integral part of your life stay unknown to you.
Why not befriend this strange beast ?? And trust me the journey begins from coding. Oh, those weird lines seem too hard. Trust me, that’s not a problem.
Did you know that  Black Eyed Peas famed wIll.i.am  and the NBA star Chris Bosh code as well !!
And as I am super excited about Coding these days, I would like to share it with you :-
So, I think it’s time to start coding and coding doesn’t have to mean all those matrix-movie like 0’s and 1’s but just thinking logically and there is absolutely nothing that should stop you from getting inspired and started at Code.org !!
Hey, next time we are gonna get started with the tech-lingo !!
Till next time,
Himanshu Sharma
Wishing you a happy coding=)