Jim's
Tutorials

Spring 2013
course
navigation

Language Project

Code on GitHub

Install:
$ git clone https://github.com/olleicua/hot-cocoa $ git clone https://github.com/olleicua/hcl $ cd hcl $ ln -s ../hot-cocoa node_modules/hot-cocoa # the above could be done for you by npm or, alternately a global install of hot-cocoa.
Test:
$ ./node_modules/hot-cocoa/bin/testrunner.js $ ./bin/hcl examples/fizzbuzz.hcl $ node examples/fizzbuzz.js

Timeline

Feb 5: General purpose code nearing a completed state Feb 19: Documentation for the general purpose code drafted Feb 26: Lisp language near complete March 5: Lisp language documentation drafted March 12: Documentation and final write-up drafts BREAK ...

January 29

My project has evolved a bit over winter break. At this point I have a working set of general purpose tools for implementing languages in Node.js as an NPM library. My library features a tokenizing system, a parser, a test suite, a string formatting/templating system, tools for structuring language templates, and tools for semantic analysis. Some of these will need small tweaks/improvements. I also have an implementation of the lisp-like language I've been working on this past semester using these tools that is at about 90%. There are features that I want to add and there are details to clean up but the basics are there and it can compile a somewhat non-trivial recursive fizzbuzz program.

Feb 5

See attached.

Feb 12

I've made quite a few improvements to the language. And I've added docs that can be viewed here: http://htmlpreview.github.com/?https://github.com/olleicua/hcl/blob/master/docs/README.html
I still need to work out how introspection is going to function. I have some ideas but they need a bit of development. I hope we can talk about them today.

Feb 19

Talked briefly about exam ; no other progress this week. (Flurry!)

Feb 28

I have been working steadily on the docs which should be in decent draft-like state by next week. I've made a few incremental improvements to the language and in the course of using the language for an exam question I've discovered a feature that would be quite useful to add. When building large projects that have dependencies in multiple files the compile-test-loop can end up being something like:
$ hcl dependency1.hcl && hcl dependency2.hcl && hcl main.hcl && node main.js
This can get a bit cumbersome so I'm considering adding a language primitive called something like source that would take a path to an .hcl source file and make sure that it's corresponding .js file is up to date then return the path to the .js file. Then the inclusion of something like:
(require (source "dependency1.hcl"))
would automatically instruct the compiler to recompile the dependency.
So far I've really only been working in the context of the Node.js CLI and it seems like it would be sensible to implement a way to instruct the compiler to create source designed to work in a browser. This would mean a few things:
Apart from the two above features, I still plan to make some improvements to the annotations and fix some problems that still exist with the way that variables are initialized.

March 5

I've implemented the dependency system I was talking about last week:
$ cd hcl-directory $ git pull $ ./bin/hcl examples/dependencies.hcl $ node examples/dependencies.js
In doing so I discovered an interesting idiosyncrasy of Node.js's cyclic dependency management. The idiosyncrasy is well documented (as I discovered) here: http://nodejs.org/api/modules.html#modules_cycles
I've created a simplified version of the case where my project was failing here: https://gist.github.com/olleicua/5087130. As the gist suggests, the bug can be eliminated by moving one of the requires inside of a closure where it is being used. This works because it guarantees that particular require won't be loaded later when the module will have been processed to the point of containing the expected function. I've added preliminary documentation in the code explaining the fix.
I've also made various smaller incremental improvements and added more tests. The tests can be run with:
$ ./node_modules/hot-cocoa/bin/testrunner.js
This does three things.
I've also fixed the repl to use the Node.js repl library:
$ ./bin/hcl hcl> (+ 1 2) 3

options I should add to the hcl CLI

man page?

March 12

Sam telling me what happened this week:

April 2

"Most of the language features are complete."
Sam described a possible extension to (require 'file.js') which is typical in nodejs, which he would use also to handle code aimed at a browser by including the file. I argued that (include 'file.js') would be cleaner.
We also talked about whether underscore.js (or some of its functions) should be included by default in hcl . Probably, since they're tasty function things like map.
I mentioned that asm.js (i.e. http://asmjs.org/spec/latest/ ) has been getting some press these days, as a fast, assembly-oriented subset of js.

April 16

I've made a fairly detailed outline for my language design paper. I was hoping we could discuss it in tutorial today and see if there were any topics you thought I should cover that aren't in there or that are in there and I could leave out.
http://cs.marlboro.edu/ courses/ spring2013/jims_tutorials/ sam/ Language_Project
last modified Tuesday April 16 2013 12:05 am EDT

attachments [paper clip]

     name last modified size
   feb5_thoughts.hcl Feb 5 2013 3:20 pm 905B    hcl_outline.org Apr 16 2013 12:04 am 6.41kB