rohit_nsit08's blog

corellaScript : Functions and Objects

With only two days left before the hard dead line and that will the end of my first GSOC . These three months has given me a tremendous insight into the world of open source, scripting languages and off-course compilers.

The good parts

Three months ago, I was a programmer who knew how to programme in javascript and few other languages but nothing about what is going inside the compiler which drives a language but now I know what makes javascript so dynamic and powerful ,I know how code is read, converted into tokens and the formation of Syntax tree.

corellaScript : Arrays

After missing action from some time, Corella is rising again . Right now Corella is not able to compile itself which was intended to but I'm trying to cover as much as possible and will give my best in this week. Corella's object system ("Corella-System") is ready and working.

Worked on arrays today and now corella is having support for arrays and even multi dimentional arrays as given in the ecmaScript.

e.g.


var arr = []

results in


.HLL "corella"
.include "corella_system.pir"
.sub 'main' :main

corellaScript : testing and objects

hmm..tired after a busy week with lots of paper work and formalities for coming job session.
Coming back to CorellaScript which is now able to run tests and ensure no feature breaks while implementing the new ones .
As the last month is approaching I have started working side by side on ducumentation as well to avoid any last minute hassle,
last few days were not much productive as lots of things kept me busy but now that I'm done with them I can began work again

corellaScript : git push

hmm.. that was a long delay in blog posts , but I'm glad to inform that corella has started flying , I mean producing output in PIR . though broken in many places but it has started and is getting updated every hour now .
I am planning to have a meeting with coke about the so far delayed test-suite as I'm really feeling the need of that.

As far as object system is concerned, I had meeting with coke few days ago and they will be in code before the end of mid term evaluation.

JavaScript : Object System

Seems to be the toughest part of the project, providing inbuilt object's support. Thanks to the specification provided by Ecmascript, finally got hold of whole Object thing. Time to speed up my work now..

JavaScript's object system is based around a global Object which is created before the control enters any execution context and that is its whole purpose also. We can't call it as a function neither as a constructor. All the other features are its properties only.

CorellaScript : AST and LALR parsing.

In the process of understanding of parse trees to get PIR, I spent some time learning the LALR(1) parsing algorithm which is being used in corellaScript.
Out of the three stages of compiler design, lexical analysing, Parsing, and code generating.
Parsing is the most important one, It is the stage where the token stream generated by lexer is analyzed according to the rules of specified grammar .

CorellaScript : talking in PIR .

greetings!

An another week filled with working with PIR and JavaScript.
some struggle with JavaScript's confusing syntax
self executing anonymous functions , prototype inheritance, and why "this" behaves differently in different situations.

Coming to corellaScript
----------------------------------
some work on test-suite as well. It is now using commonjs's unit-test library. working on tests .

Had first meeting and a nice discussion with _Coke yesterday.

CorellaScript: Parsing JavaScript

hmm... done with the parser and AST part. learned the use of
temporary scope and closures in JavaScript.
Quite interesting to see how Jison can make help in parsing languages.

Will start work on code generator this week, and implement basic features.

repository for the project will be CorellaScript

Looking forward to lots of coding.

Hello Parrot

Hello, My name is Rohit Jangid and I have been selected as a Google Summer of Code student.
My project is Implementing "JavaScript Compiler on Parrot". This is my first post on Parrot so I would like give a brief introduction to my project and why It's an awesome one.

I am an undergrad in Department of Computer Engineering in NSIT India.

Syndicate content