Yep. You read it right.
Someone told me that its impossible to implement - write a new programming language in less than a day. I said "If I can write it in python and its just has to work... Eg: no error checking or complex operation. I can write one in 3 hours".
He jumped on it VERY quickly. We agreed on all the features: "functions, global variables, local variables, addition, subtraction, print to terminal".
It has to print "Hello World", add 2+2 together and call a function which will do something.
No other restrictions. I can choose the keywords and how I represent my data types.
I did realize that it has to be very naive and super simple. I just wanted to hack something together to prove him wrong. I decided on a mixture of JavaScript and Php. I chose those two because they have a simple construct where I can easily recognize if a variable or a function getting declared or called.
Let me jump to the end of the story... I won the bet :-)
Yes, that's right. It fulfilled all the requirements we set.
In the next few blog posts I will walk you through how I hacked it together.
Stay tuned.
Please Note!!
Don't expect a Real/True compiler or interpreter or the next big programming language!
I am NOT an expert on that field. I do love parsers/interpreters/compilers and I write simple dns(domain specific language) for work, but I am very far from understanding all the ins and outs of a language design.
Showing posts with label code. Show all posts
Showing posts with label code. Show all posts
Sunday, December 27, 2009
Thursday, December 17, 2009
Matrix in your terminal
This has to be the one thing all geeks(inluding me) want to do at some point. Turn your teminal into a Matrix terminal. Folks at commandlinefu.com submitting their own implementation. It's great to see how much you can accomplish with such a small amount of code. Whats even sweeter is that all that is done with tools all ready shippid with every linux or unix machine.
Go over there and try out the code samples or even submit your own.
Here is the link www.commandlinefu.com
Enjoy...
Go over there and try out the code samples or even submit your own.
Here is the link www.commandlinefu.com
Enjoy...
Subscribe to:
Posts (Atom)