Skip to content

Instantly share code, notes, and snippets.

@rohit-nsit08
Created March 26, 2011 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohit-nsit08/888418 to your computer and use it in GitHub Desktop.
Save rohit-nsit08/888418 to your computer and use it in GitHub Desktop.
project proposal for javascript compiler
Name: Rohit Jangid
Email id: rohit.nsit08@gmail.com
Google id: rohit.nsit08
Other contact info:
Irc nick-name on #parrot channel: rohit_nsit08
Project title: JavaScript on Parrot
Abstract:
The project is based on implementing a JavaScript compiler to be written mostly or entirely using JavaScript.
The existing compiler projects like (jasper/cafe) are most likely to be used for base development. Reusing
already built code will be the utmost priority which requires use of parser generators like Jison or PEG.js etc;
the primary goal is to customize the backend (code generator) of cafe to make it generate parrot friendly PIR/PBC code. Cafe project is most likely to provide much needed compiler infrastructure.
Benefits to the Parrot VM and Open Source Community:
JavaScript is one of the most popular and preferred scripting language among users and hackers
on the internet, all such people will be benefitted with its inclusion in parrot
Its importance can be easily seen that all the present browsers have javaScripting capabilities
but there are very few command line tools available for it.
There are Compilers already available like
Rhino which is written in java is one of the sought after tool in this regard , but has limitations
with size of byte code generated by it (which I faced myself) currently narwhal is using rhino
node.js which is using much better Google’s v8 engine which is built in C++,
But there are none in JavaScript,
Though there exists a JavaScript compiler on parrot "ECMASCRIPT" which is not quite usable in its
current form due to lack of people working on it and its dependencies on old NPQ and PGE
In short, there is a need for a better, fast, optimized command-line JavaScript compiler with better features
And we can offer this service on parrot
Since good tools are already available in JavaScript like parser generators and interpreters ,
bootstrapped compiler becomes a very good option to start with.
So, here is my proposal on how we can proceed and develop a bootstrapped JavaScript compiler written entirely in JavaScript.
Deliverables:
A basic JavaScript compiler, with tests and a suitable build infrastructure compatible with major systems and a project documentation that will help future developers to carry on work further.
Providing a good build infrastructure and documentation will be highly important for building a community and popularize project after the end of summer.
Project Details:
• The project is based on bootstrapping,
• Using already available compiler/interpreter which will act as a stage 0 compiler
• Stage 0 compiler will be used to compile and build stage 1 compiler in JavaScript
• Stage 1 compiler will be modified and stage 2 Compiler will be using stage 1 compiler for compiling itself.
• the cycles of improvements will carry on from stage 1 to stage 2 , until a fully working compiler is made
• possible targets for stage 0 compiler ( narwhal using rhino as its engine, and nodejs using v8 )
• stage 1 compiler to be built on already available cafe compiler with modified backend to generate PIR code and Jison parser library will be used to generate parser
• testing is to be included wherever it is possible and needed.
I’m currently experimenting on narwhal, Jison, cafe combination and in touch with author of cafe Jison and narwhal since there are compatibility issues with them.
<R: more details required>
Project Schedule:
Stage 0, stage 1 will be the initial milestones, after that improvement cycles and testing will be performed to improve previous compiler
I’ve tried to integrate my project schedule with gsoc’s timeline
March 28(application period start) – April 8(application deadline):
• Discuss idea with mentors and submit project application, Study codebase of café. Discuss further improvements and changes
Interim Period: till April 25:
Finalize main idea with mentor and a basic layout of the work, study tools required, get familiarize with
git and use of parrot system, Learn PIR during this time
From April 25 onwards
Start hacking on café Backend integration of PIR code generation,
Original AST to be replaced by parrot’s PAST
Build stage 1 compiler before and ready for stage 2
Before Mid-term evaluations deadline to have enough time for implementing features
References and Likely Mentors:
Discussed project idea with
Whiteknight
Dukeleto
Moritz
Lucian
Bio
Hello,
My name is Rohit Jangid, and I’m a computer science student (6th semester) from NSIT college, India.
I’ve been programming from my school time and have a wide experience in various types of languages and platform , C/C++ , JavaScript and Java are my primary languages, have also worked extensively in j2ee technology like Servlets and jsp for web-applications.
I’m open source promoter and infact love working on Linux.
I’m very dedicated towards my work and can learn things quickly and I believe that makes me a good candidate to work on this project.
I’m new to parrot but now I’m reading and experimenting on it.
Our semester course for next semester contains “compiler design” as a subject also, This is also one of the motivating factor that attracts me to my project.
I’m familiar with basic project development on Linux and version control system like bazaar and launchpad, recently started using github for parrot.
I’m pursuing a graduate course and currently in 3rd year , and I believe that makes me an eligible student for gsoc , I’ll clarify the legal requirements if needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment