Open main menu

lensowiki β

Computer Science/164/HW3

< Computer Science‎ | 164
Revision as of 05:02, 21 November 2009 by Lensovet (talk | contribs) (draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Contents

Part 1: Choose the problem that your language will solve

  1. What problem are you addressing? First, describe the context and the general nature of the problem. Then describe a instance of the problem: depending on your problem, you may want to
    1. show a fragment of ugly code that you want to improve with your language, or
    2. describe a code development scenario that your language will make less tedious and more automatic.
    3. missing features that you want to add to a language; say what these features would allow that is not possible (or too hard to do) today.
  2. Argue why this problem is hard. For example, the code example you show may be obviously ugly, but do programmers indeed find it difficult to write this code, or to debug it?
  3. Argue why this problem is worth solving. Aren't there simpler solutions than designing a language? For exaple, it may be possible to work around the problem, sidestepping it by switching to a different, existing language. Of course, switching languages is not always possible, which motivates embedded languages and tools for dealding with existing languages.

Part 2: Study a language that solves a similar problem and describe it in this homework

  1. One simple code example. Your comments must sufficiently explain the meaning of the code.
  2. Describe the implementation. (Two paragraphs and pseudocode of the implementation.)

Part 3: What features specifically will your language support

  1. The domain. Give a list of a few small programs that you hope to be able to write in your language. These will guide your language design.
  2. Give an outline of the programming model of your language. What are the "objects" in your language? What operations on these objects will you allow? How will you combine small programs into bigger ones, hiding the implementation details of the smaller ones (what abstraction mechanism will you support, if any?).

Part 4: Decide on the implementation

Choose two alternative implementations, and compare them along these aspects. For each aspect, write a paragraph. Your two approaches may be identical in some aspects.

  • frontend: How will you translate the input (source) program into the program's internal presentation (often, this is an AST)? You know that this can be done with a parser or with an embedded DSL, as in rake or protovis. Some languages may not need an internal representation.
  • the core language: Are some features built as sugar on top of a simpler-to-implement language? If yes, what is that core language, and how will you desugar those features?
  • internal representation. What are the alternative ways of representing the program for the interpreter or compiler?
  • interpreter/compiler: how will you interpret or compile the language? Is there a prepossessing step, eg translation from AST to bytecode? If you want to generate code, what is the target language? Why did you choose that language?
  • debugging: How will you debug the implementation of the language?