Posted by

Initial Project Plan for Soda.js: an interface extention to Popcorn.js

Soda

I have chosen to create Soda.js, an interface extension to Popcorn.js this semester. Popcorn.js is establishing a programmatic way to play and access information on HTML5‘s audio and video elements. Soda.js will provide innovative and non-standard user interfaces for commonly needed web video controls (ie. visual timelines, play, pause, volume control, etc.).

Background

The interface features implemented in Soda.js are specially aimed at the needs of the Global Lives Project. The Global Lives Project documents a full 24 hours in the lives of 10 people who represent the diversity of the world population. They have filmed well over 240 hours of video and have thousands of hours of volunteer work put into their project. The mission of the Global Lives Project is to collaboratively build a video library of human life experiences, and to reshape how people think of other cultures, nations and people outside of their own communities.

Currently, the Global Lives Project functions as exhibit that tours around the world, but they are looking to put this project up on the web. This is where Soda.js comes in. The Global Lives Project is looking for an interface that can control and manipulate more than one video at a time, and the mock ups they have come up with look very interesting. They want to enable a more convenient way for their viewers to watch and navigate their video library. Once the interface controls are created in Soda.js, they will be available for other people to use as well.

I chose this project because it looked like a lot of fun to me. I’m very excited to be working with HTML5 and I look forward to learning advanced JavaScript. I also really liked what I saw in the Global Lives Project and I am very happy to be working on something to contribute to their project.

Follow this Project

I have created a wiki page for the Soda.js project. This page will stay up-to-date on project news, contributions and detailed specs. To follow this project as I proceed, please stay tuned to my blog and/or view updates on the wiki page.

The Time Line for this Project:

0.1 Release – Oct 22, 2010
0.2 Release – Nov 16, 2010
0.3 Release – Dec 7, 2010

Actually, I remember something about a competition mentioned in class – the latest entry deadline is Dec 9. I’ll get more info on that and update when I do. If there is some kind of competition, my time line may need to modified for earlier releases.

Release 0.1

For my Release 0.1, I would like to have 2 or 3 controls working. The Soda.js description listed on the CDOT wiki mentions “visual time lines, play/pause, changing the volume, etc.” I’ll take these controls for my release 0.1 until I have talked to Joel and find out what other features are wanted or planned for Soda.js.

I will measure my success by each properly working user interface control. As long as the control works and does what it’s supposed to do, I’ll be happy.

Releases 0.2 and 0.3

I’ll have to update this after speaking to Joel.

The success of release 0.2 and 0.3 will be measured the same way release 0.1 is measured. The controls need to work, and hopefully by this time, I should have some feedback to consider for 0.2 and 0.3.

Technologies I’ll need to Learn

The technologies needed for this project are JavaScript, <video>, <canvas> and HTML5. I will need to brush up on my JavaScript, and get to know the video and canvas elements. My only experience with canvas is what I saw while testing the Chrome Experiments. I can say I was definitely impressed and I look forward to starting some research.

My plan is to locate and utilize tutorials. I’ve learned in the past that reading is nice, but actually working with the stuff (aka. just jumping right in) is a lot more effective.

Resources:

I think these are nice places to get started.

Contacts

So far, I have contacted Humph about the work on this project. He has given me links to the Global Lives Project and sent me a few interface mock ups. Humph has also introduced me to Anna Sobiepanek (the main Seneca/Popcorn.js developer) and is trying to connect me with Joel Young (the main developer for the video wrapper and user interface work for the Global Lives Project). I have yet to meet Brett Gaylor, a filmmaker who works for the Mozilla Foundation, whom I believe I might find in #drumbeat on Moznet.

Collaboration and Contribution Opportunities

A great way for people to get involved with Soda.js is to test the user interface controls as they come out with each release. Users and feedback will be much needed.

I also hope to contribute to other projects this semester. As I will be working with JavaScript, <video>, <canvas> and HTML5 for this project, I would like to contribute to other projects that utilize these technologies. I know some of my colleagues will be using these same technologies and I look forward to following their blogs.

Barriers

Last time, I had a few barriers. This time I only have one. I’m afraid that this project will end up like the ANTLR one and not be completed. Last time, I got stuck and I gave up. Given how often you’re supposed to get stuck when working in Open Source, I have a feeling this threat is going to loom over my head the entire semester.

I suppose the looming is a good thing because, so far, it has kept me going coming back – to test the Chrome Experiments, file some bugs, and research the soda.js project. I keep reminding myself that (I’m quoting Humph) 1) “the norm is to feel lost” and 2) “Try to answer your own question. When you really get stuck, ask IRC, don’t give up”. I think, this semester, all of the looming and the determination to not let Soda go down the same path as my ANTLR project are going to get the Soda releases out and on time.

Hopping onto IRC

Here’s the first time I’ve hopped back on IRC in months. I would like to thank this wiki page about IRC and its hyperlink on registering your /nick for helping me shake the rust off.

I’m using the ChatZilla! add-on for Firefox and I highly recommend it. I would like to give screen + irssi a shot, but I’ll save that for when I have more time to kill.

This time, I’m writing down a few basic commands – in case I ever get rusty again!

/nick cldenobr
/msg nickserv identify top-secret-password!

because I know I’ll forget how to identify myself.

/join #seneca
/leave

I forgot about /leave (leave a channel) and only remembered /quit (quit entire IRC session).

/msg humph ping

sends a private message to humph, because I’ll have to contact him in a sec.

My nicks are cldenobr and cldenobrega.
If I’m online, you’ll find me lurking on #seneca. =)

That’s all I need to function on IRC right now. I’ll update this post if I forget something really important.

Lab 1: Minefield, Chromium & Chrome Experiments

I’ve been working on Lab 1: Firefox Performance Testing – I was assigned Chrome Experiments numbers 101-110. This was the first time I’ve really worked with Minefield (last time I managed to build it and break it right away, then that was it) and it was also the first time I’ve really tested out Chrome (or Chromium).

I never really cared to try out Google Chrome – I had Firefox. From this lab, I have re-learned a valuable lesson and received one hell of a first impression:

  • It reminded me why I should be testing out new applications, regardless of how much I like what I’m using right now. I’ll admit that I got lazy. I have a new respect for Google Chrome – it ran the Chrome Experiments so beautifully.
  • I don’t know what I was expecting from the Chrome Experiments, but I was blown away. I have heard Dave talk about the canvas tag, HTML5 and JavaScript numerous times and I though they sounded wonderful, but I had yet to really look into them. I was so impressed with some of the Chrome Experiments that I started looking for people to show them to. Of the Chrome Experiments, my favourites (so far) are Multiuser Sketchpad and Canvas Cycle, though I found all of the experiments I tested very exciting.

I didn’t expect to enjoy myself as much as I did. I know there’s more to the lab, so I’ll be back when that’s started.

Hello, again.

Aloha, I’m Crystal.

It’s been a while since I’ve posted anything to this blog. Last time I took OSD600, I failed to do any of the work. I know Dave constantly mentions the importance of failing in Open Source, though I’m pretty sure my kind of fail isn’t what he is talking about. So I’m back again – I was inspired enough to want to give Open Source Development another shot.

I went through the week one readings, again. I was curious to see if I’d have a different perspective this time around. I started with the video Revolution OS because I knew how long The Cathedral and the Bazaar is. The first time I watched Revolution OS, I understood the very basic idea of ‘freedom’ in Open Source software: Free, not as in price, but free as in Freedom. Freedom to use the software, look at the code and change it up, etc. I enjoyed the video mostly because it enabled me to put names to faces.

This time around, what really stood out to me was the freedom to form a community. I originally didn’t pick up on the way all the other freedoms came together to enable this one freedom. Freedom to form a community and to create a better society to live in, that is what I remember of Richard Stallman this time. This is important to me because last semester, I was focused on the freedom to look at and modify code. I shyed away from the freedom to engage and talk to as many people as possible. The freedom to wander into the bazaar, *meet people*, and to contribute to the the Bazaar in some way.

Speaking of Bazaar, my favourite part of Eric Raymond’s Cathedral and Bazaar paper is simply the title. The analogy is a great intro to Open Source methodology and just makes everything really easy to visualize and understand. I have always remembered rule #3 because I really didn’t want to do it:

3. “Plan to throw one away; you will, anyhow.” (Fred Brooks, The Mythical Man-Month, Chapter 11)

I hate that rule as I begrudgingly know it’s true. The first time around is more of a trial than anything else. Maybe something more like a first draft? Anyway, Dave changed my disposition towards this rule when he asked the class ‘Have any of you ever received somebody else’s code and wished they had thrown it away?’

I have grumbled, and decided I like rule #3.

The final assigned reading was the NY Times article ‘For Mozilla and Google, Group Hugs Get Tricky ‘. I think it was a great article as the details between Mozilla and Google’s relationship is interesting. What’s more interesting is the next step, Lab 1: checking out Chrome Experiments and getting in to part of the competition between the two browsers.

That’s all for my not-so-first post. Thanks for reading!

Thunderbird Bug Fix Lab

Dave had everyone in the class working on the Thunderbird Bug Fix Lab on Thursday.

The lab should give us first-hand experience in creating, fixing and submitting a patch.

The first thing I did was create an account on Mozilla’s fake Bugzilla. Then I filed a dummy bug.

When I went to file the bug, I got hit with a ton of form fields. I got a little confused, so I went over to the real Bugzilla to observe how others file their bugs. Dave mentioned at the start of the semester that people who are not developers often file bugs. If I wasn’t a programming student, I would have looked at those form fields and hit the back button. I ended up writing in a summary and description, leaving everything else blank or at its default. Now that I think about it, the description I wrote is pretty ugly.

When I tried to do a debug build of Thunderbird that night, I was met with an error:

WARNING: NS_ENSURE_TRUE(compMgr) failed: ... nsComponentManagerUtils.cpp, line 90 WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040154: ... Could not initialize nsContentUtils: \'Error\'

Two Screen Shots. The first one is a warning I missed the first 2 times I ran Shredder (scrolls by too fast). The second one is of Shredder right before it died on me. Here’s that lovely error:


WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040154: file c:/comm-central/mozilla/content/base/src/nsContentUtils.cpp, line 383
###!!! ASSERTION: Could not initialize nsContentUtils: 'Error', file c:/comm-central/mozilla/layout/build/nsLayoutStatics.cpp, line 168

and the only reason I typed that out is so Google can find it.

I probably should have started by searching Bugzilla, but habit sent me to Google. I wanted to find anyone who had encountered this bug. Maybe it’s because I was using nsContentUtils.cpp, nsLayoutStatics.cpp, and variations of the two in my search criteria. I was taken to Planet CDOT, where Jianming blogged about encountering the same error. I was still unable to find out how to fix the problem. Actually, I feel really lucky that I found Jianming’s blog. I bet there are others blogging about the same error. I also bet they posted screen shots of their errors. Google won’t find those posts for me.

I changed my approach by google-ing for a list of mozilla’s mailing lists. I wanted to search any Thunderbird-related mailing-list archives. I went through dev-apps-thunderbird, feedback-thunderbird, feedback-thunderbird-prerelease, and support-thunderbird. At the time, I didn’t find anything.

Actually, it’s been 4 days since I originally searched those Thunderbird mailing lists. As I was writing this post, and creating a link to dev-apps-thunderbird, I found this post by Mark Banner (Trunk Builds – current failures). It’s a nice surprise.

With no success in the mailing list archives, so I finally went after Bugzilla. Again, I couldn’t find anything.

I didn’t know where else to search, so I called it a night.

The next day, I went to check up on CDOT to see if Jianming had any luck with the error. Instead, Andor Salga’s “(Not) Building Minefield” came up. When his build wasn’t working, he checked Tinderbox. It was one more place to search, so I went with that. Turns out Thunderbird’s ‘WINNT 5.2 comm-central check %’ is burning. At least the problem isn’t me.

There’s a link right above the chart, leading to Bug 546913.

Turns out there was a bug filed regarding nsContentUtils.cpp and nsLayoutStatics.cpp. It was filed on the 18th (a week earlier). I guess I suck at searching. Mark Banner, the same guy who posted on dev-apps-thunderbird, is the one assigned to the bug. Best part is, I think he’s almost done with his fix. He had a patch that was waiting for review. When I checked Tinderbox again (today) I see that the trunk is building (1h and 5 minutes have elapsed).

For now, I’ve been reading zenit’s Real World Mozilla Incremental Build Lab and Andor’s post on Patches. Trying to figure out how to apply patches and what not. If the trunk turns green again, I’ll try applying Mark Banner’s patch myself. I’ll need the practice anyway.

For now, I’ll keep an eyeball on Tinderbox while I read up on patches. and ANTLR.
I haven’t given up on that.

New Plan of Attack – ANTLR grammar

I did some reading last night. Yes, the Language Implementation Patterns book, but that’s not what I want to talk about.

I went through wk 5s’ class reading ‘Code Reading: An Open Source Perspective’ – Chapter 11. Curiosity + avoiding studying for a mid-term.

If I accessed it via the wiki link, I wasn’t able to log in and view full pages. I had to log into Seneca libraries > ebooks and search from there.

When I wasn’t falling asleep during the reading, I was taking notes and plotting against this semester’s ANTLR bug.

Here is the plan and the ideas from whence it came:

Plan: Locate Processing‘s ANTLR based Java grammar. Use it to model the Javascript grammar.

So what happened in Chapter 11? Summary + commentary:

There’s this dude (the author). He wants to add a new function ‘PHASEOFMOON’ to an sql database of 34,000+ lines of Java source.

First thing he does is try to get an overview of the system. He finds an outline of top level directories in index.html.
—>After seeing Dave use Mozilla’s mxr so much, I started to focus on the benefits of ‘jumping into code’. I forgot the most obvious of starting places (like index.html or a root directory) is actually a great place to start. If developers wanted you to find some information, that’s the perfect place for them to put it.

Next he builds the system. This way he knows any future warnings or errors will be his own doing.

His plan of attack is to search for documentation for functions similar to the one he’s trying to add (he’s looking for ones with similar attributes and types). He finds a few, selects the one with the most uncommon name (he calls it ‘using plain text-matching effectively’), and plans to use it as a model for his own function. This would keep everything uniform and help with readability and code maintenance. This is why I’m eyeballing the Java grammar now.

He also gets frustrated with a lack of comments in the code. You sort of feel his pain.
—>Let me rant. About ‘potm’. What the heck is ‘potm’? It’s the name of a function the author runs into. It’s an acronym for ‘phase of the moon’. That’s just nasty. It doesn’t even register in my brain as something to look into if I’m skimming lines of code. What’s worse is that I’m pretty sure I’ve coded assignments using acronyms for variables. I am officially ashamed.

The author also reads code backwards. Terence gives his readers a tip in Lang. Implementation Patterns: start with the end/outcome you want and work backwards from there. I’m thinking this backwards thing must have some merit to it.

My favourite part. The author runs his code and gets an error. So he searches the code for the error’s implementation. My mind imploded.

There’s how you know I grew up on Windows and closed-source applications. I’m used to getting an error and accepting it. That’s after pasting it into Google and praying someone else knew how to fix it. I realized this somewhere in week 2 of OSD600 and I keep having to remind myself because it doesn’t come naturally yet. Google-ing the error used to be the only way, I like the thought of getting to the error itself and finding out what its problem is.

/me writes a mental note.

Couple more things, don’t worry, my brain imploded so I can’t write for much longer.

There’s a lesson on maintaining code. Remember to update the change log with a comment, or create a README file in the source root directory indicating any modifications made.
—>After meeting ‘potm’ I would take the time to do this. For the sake of humanity.

3 more things I learned. I’m gonna do this in point form:

  • Code reading is opportunistic and goal-directed. That sounds pretty cold. But okay.
  • Use the build process, and execution of the system, to find code that needs attention. This is helpful in locating other files or functions that need modification after the main fix is written.
  • If you run into code that is very difficult to understand – ditch it. This is the author’s ‘breadth-first strategy’. Code-reading problems can be attacked from many angles, just keep going until something gives.

There’s the end of the list. I’m gone. Back to studying.
‘potm’.

Learning ANTLR – Language Implementation Patterns

The first thing I learned about ANTLR: the best place to start is with Terence Parr’s books.

I ordered them online last week, and they finally came in the mail on Monday. I was in bed when there was a knock at the door – I knew it was the mail man with my ANTLR books. I couldn’t kick my blankets off fast enough.

I said I would start with Parr’s second book in my Initial Project Plan. One of the problems I listed in my project plan is my learning style. I planned to only read the chapters of the book I need. So here’s the problem:

The book lists 4 language application categories:

  1. Readers – builds a data struct from input streams
  2. Generators – walks an internal data struct & emits output
  3. Translators – a combined reader & generator
  4. Interpreters – reads, decodes, executes instructions

What I need to write is a translator(#3). Which means I need to write a generator(#2), which won’t work without the internal data structure created by the reader(#1). Since I have no prior language application experience, I’ll be reading most of this book – starting at the front and going from there.

When I started with the front of all fronts – the Preface – I was still looking for the ANTLR community. Where are they besides the mailing lists and their wiki? Turns out this book has a little forum. Only 12 topics and 32 posts, but the last post was written 10 hours ago and some of those topics have 400, 600, 900 + views. Good to know it’s alive.

The preface also mentioned ANTLR’s support page. Which I’ve visited before, but I must have missed almost EVERYTHING they had written on there. It’s like finding gold:

I’ll be back after I read a few chapters.
Toodle-loo for now!

Building Firefox

I disappeared last week. I was taking a 5 hour nap on Tuesday, when I should have been in class. Guess I shouldn’t do that again – I missed Dave’s class on compiling Firefox.

Wednesday I was back in school. I spent a few hours in TEL’s Open Lab, downloading all the the tools I would need to build Firefox later that night. I needed to have it built (or try to have it built) for Thursday’s class.

I used this task as an excuse to take over my mom’s new laptop >=]

The list of goodies I secured from the TEL lab and the order I installed them:

0 – Alcohol52% Free Edition – I use a virtual drive to install all of my .iso files. I love the name and it’s wonderful.

1 – Visual Studio 2005 Pro – decided to go with ’05 because it was marked by Mozilla as ‘official‘. Seneca students can download it (2 .iso files) from ACS

2 – VS05 Team Suite Service Pack 1

3 – Microsoft Hotfix – cures a linking problem

4 – Windows 7 SDK – went with the .iso download so I could use Alcohol52% again. I didn’t know which one to choose, so I tried the first one: x86. It didn’t work right off the bat, so I downloaded AMD64. It worked perfectly. <3 Download takes 20 minutes per .iso in TEL's Open Lab.

5 – Mozillabuild <– that links right to the mozillabuild download

This is as far as I got before Thursday’s class. I started installing the files Wednesday night, fell asleep during the VS05 disk 1 install, and again during the Windows 7 SDK install. I finished installing Mozillabuild right before I left for class.

Monday, I finally got back to the Firefox build. I followed MDC’s ‘Simple Firefox build‘ page

run:
c:\mozilla-build\start-msvc8.bat

and a lovely window appears. Ensure your path doesn’t have any spaces in its name:
cd /c

get source code:
hg clone http://hg.mozilla.org/mozilla-central/

got an error:
requesting all changes
adding changesets
adding manifests
transaction abort!
rollback completed
abort: connection ended unexpectedly

Google: 5 seconds later I was at Konstantin’s blog. Apparently I needed to grab a LAN cable. But I was cozy in my room, on wi-fi. So I ran the command again:
hg clone http://hg.mozilla.org/mozilla-central/

and again:
hg clone http://hg.mozilla.org/mozilla-central/

and again:
hg clone http://hg.mozilla.org/mozilla-central/

I was about to search for the LAN cable when that 4th time succeeded. I am delighted.

continue:
cd mozilla-central

create the mozconfig file, I’m going with the debug build (1.5GB larger than the release build):
echo '. $topsrcdir/browser/config/mozconfig' > mozconfig
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-debug' >> mozconfig
echo 'ac_Add_options --enable-debug' >> mozconfig
echo 'ac_add_options --disable-optimize' >> mozconfig

build:
make -f client.mk

I don’t know how long the build took. I went off for 40 mins to go eat, came back, and realized the laptop had gone to sleep …. karma?

When the build did finish, this line didn’t work:
objdir-ff-release/dist/bin/firefox

I thought firefox.exe wasn’t created. Turns out my directory was named objdir-ff-debug, not objdir-ff-release. Before I realized that, I had gone to Google, thinking there was a problem with my build.

I found a blog post by Simon Jung. His post is excellent – and very detailed. He wrote a note on Minefield:

If there is a current Firefox session running, Minefield will open another window, it won’t actually run Minefield.

After I fixed my path:
objdir-ff-debug/dist/bin/firefox

A window popped up – and looked exactly like the Firefox/google search home-page-thingy. It even had the Firefox icon. How suspicious. Turns out I had minimized my Firefox window so it was still running when I ran Minefield. I remembered what Simon Jung had posted, closed the Firefox windows and tried again. This time:

Minefield
The page was huge, so I tried ‘Ctrl + -’ to shrink it …. and I broke it already.

Initial Project Plan – Learning Processing and ANTLR v3

My project for this semester is creating an ANTLR based Processing to JavaScript converter.

Basically, I’m using ANTLR v3 to create a tool that translates Processing code into JavaScript.

The Processing.js project is working on porting Processing to JavaScript. Currently, it utilizes a series of regular expressions in order to parse the code into JavaScript. However, as Dave puts it, this current method is brittle.

There is an ANTLR v2 based Java grammar that translates Processing to Java. When ANTLR v3 came out, it had JavaScript added as a new target language (a language it could translate to), enabling ANTLR to translate languages to JavaScript. The JavaScript target is still in beta state. It has a few bugs, but is passing many test suites. Short-term, the regular expression parser will work out. Long-term, a stand-alone converter based on ANTLR would be nicer. What I’ll be doing this semester is writing the grammar (the set of rules) needed to translate Processing to JavaScript, thus creating the converter.

If you’d like a peek, here is THE BUG Dave filed.

I have chosen this project because I want to do something for the Processing for the Web project. I am interested in where Processing.js is going. I find that I like the Processing language on a personal level (it programs graphics!), and it has found a little space in my heart. I am also interested in learning about grammars, dusting of my JavaScript skills, and I like the word ANTLR (Both Jeff and Mike saw that one coming). I have decided that if Processing wants an ANTLR based JavaScript grammar, then I want it to have one.

I am about to spend this semester figuring out what it will take to produce this grammar.

The Process:

My work can be tracked via this fantabulous project page on the CDOT wiki.
As things progress, comments may appear on lighthouse, where Dave filed THE BUG.
I will also be updating this blog as I proceed.

The Timeline:

0.1 Release – Feb 19th, 2010
0.2 Release – Mar 19th, 2010
0.3 Release – Apr 9th, 2010

All of these days are Fridays. 11:59pm is the latest I can submit each release before it’s counted as late. Check out my blog. When things are going well, expect earlier releases.

0.1 Release

For the first release I intend to have the ANTLR grammar able to translate variables from Processing into JavaScript. The reason this is so basic is that I have approximately 20 days between today and the 0.1 release to learn ANTLR, familiarize myself with ANTLRWorks (ANTLR’s grammar development environment), dust off my Java and JavaScript skills and write the first piece of this grammar. It is possible that I could finish early. If this is the case, I will start pulling tasks out of the 0.2 release and including them with 0.1.

Translating variables would make an excellent starting point for this project. Once I succeed in getting a piece of the ANTLR grammar working, the rest should come along with a little time and effort.

0.2 Release

(To be updated while I learn ANTLR during the beginning of the 0.1 release)

I believe I’ll be writing 2 grammars. One for a lexer and one for a parser. Here’s the big problem. Until I get more into ANTLR and writing grammars … this section is going to be a little blank.

I’m in the middle of the ANTLR Translator Generator FAQ From jguru. I’m reading ‘an overview of ANTLR and how to approach building things with it’. I’m not totally hopeless.

Any update to this section will be posted on the Project Page.

0.3 Release

This release will have that nice little ANTLR based JavaScript grammar for Processing.
PDE (Processing Development Environment), Bespin, and Eclipse should be able to “compile Processing for the web”. =)

Things I’ll Be Learning:

ANTLR and ANTLRWorks

  • ANTLR may take a bit of time and the best place to practice it is probably by using it’s grammar development environment, ANTLRWorks. At least for the purpose of practicing examples from Terence Parr’s ANTLR reference books (more on those in a sec), and examples from the wiki. Unfortunately, ANTLR’s JavaScriptTarget isn’t integrated into ANTLRWorks yet.

Processing and the PDE

  • I know nothing of Processing, but I like what I’ve seen from it. I’ll learn it so I can translate it to JavaScript. Excited.

Refreshing my Java and JavaScript

  • I need the JavaScript because it’s my target language. I must know how it works. I need Java because Terence’s reference books, and a large majority of the examples, were written for ANTLR’s Java target. I need it to learn ANTLR.

I Plan to Learn ‘em with these Resources:

I’m going to be all over antlr.org (especially the FAQ and documentation) and Processing.org/learning/.

Besides a few class readings I need to catch up on,

this blog is going to be about learning Processing and ANTLR v3.

The best way to learn ANTLR is from Terence Parr himself. He has 2 books out:

  1. The Definitive ANTLR Reference: Building Domain-Specific Languages
  2. Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages

The second book came out Dec 31, 2009, just in time! Apparently, the first book (noted as being an excellent resource) is easier to grasp once parts of the second book is read.

Supplement the books with examples from ANTLR’s wiki (for examples in target languages other than Java) and ANTLR’s two mailing lists: ANTLR-[interest] and ANTLR-[dev], and I should be good to go. I hope.

I’ve been looking high and low for ANTLR’s IRC channel. Does it exist? If anyone knows where the ANTLR developers are on IRC, I’d love to do some lurking.

Contacts:

None. Contacting someone now would only waste their time.

Since I am completely new to ANTLR and its dev environment, I need to familiarize myself with it before I can ask any feasible questions. My 0.1 release requires a lot of learning. Shortly before its release, I should have a much clearer picture of what I am dealing with, and I will be able to ask some good questions. Until then, I will be sitting down with ANTLR, learning in small steps.

First, I must RTFM.

Any update to this section will be posted to the Project Page.

Collaboration:

My code will need to be tested on PDE (Processing Development Environment), Bespin and Eclipse once I’ve got the grammar going.

The grammar needs to be tested to ensure it translates functions properly. Anyone who would like to try breaking it is welcome.

Contribution:

Since this project will require me to brush up on my Java and JavaScript, as well as learn some Processing, I would be up for testing or debugging in these languages. I’m also good for any tasks that may be deemed ‘boring’. I’m not easy to bore.

Talk to me.

Barriers and Risks:

Learning ANTLR3JavaScriptTarget, which is still in beta state.

  • It has poor documentation, isn’t integrated with ANTLRWorks yet, the -debug option is unavailable, and I’m told to expect bugs and problems.
    Fix: the Java target API Documentation will suffice for now, the rest  I have to figure out as I go.

My learning style, which is very systematic.

  • I will be hesitant to start on any code until I have thoroughly researched my topics (ANTLR, ANTLRWorks, Java, JavasScript, grammars). I like (and will be tempted) to read entire books/webpages on the subject before starting. I know I cannot approach the project in this way.
    Fix: I need to tweak the way I usually learn. I only need to learn enough code to solve the problem. Use indexes, and tables of contents. (This is the only risk I could control).

ANTLR3JavaScriptTarget isn’t integrated with ANTLRWorks.

  • I’ll need ANTLRWorks to help me work my way through examples, etc. However, when it actually comes to my grammar, ANTLRWorks won’t be of much use.
    Fix: … hum. I guess ANTLRWorks will be temporarily reduced to being a regular text editor.

Wk 3 – On Processing

Yesterday’s class introduced me to the Processing language and the Processing.js project. I’ve seen this project around, but I didn’t look into it. I really like how Processing.js is making it possible to program graphics and render them in the browser. I also took an interest in ANTLR once Dave mentioned ‘grammar’. A part of INT522 (a voice-driven web app programming course at Seneca) studies VoiceXML grammars. I love when different courses start to touch on the same subject, so I’ve grown curious about ANTLR and would like to learn a little more. I joined the ANTLR-interest mailing list looking for this info.

I think I’d be interested in working on the ANTLR based JavaScript grammar for Processing that Dave was discussing in this post.

Follow

Get every new post delivered to your Inbox.