Difference between revisions of "Computer Science/164/HW3"

From lensowiki
Jump to: navigation, search
(draft)
 
(Part 1: Choose the problem that your language will solve: intro)
Line 6: Line 6:
 
# 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?
 
# 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?
 
# 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.
 
# 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.
 +
 +
Navigation bars are a standard feature of many web pages. In recent years, a somewhat standard paradigm has developed of using unordered lists, which are then styled with CSS to give them a more traditional appearance.
 +
 +
Accomplishing this in a good-looking and cross-browser-compatible manner is not trivial and requires a fair amount of CSS fiddling. Furthermore, the HTML code which must be written to set up the navigational elements contains a fair amount of extraneous markup which detracts from getting a clear picture of the navigational elements and their actions.
 +
 +
Furthermore, navigational menus can often contain submenus for a structured hierarchy. This requires additional javascript coding to work properly and further detracts the web page designer from concentrating on accomplishing his task; namely, working on the actual ''design'' of the menu
  
 
==Part 2: Study a language that solves a similar problem and describe it in this homework==
 
==Part 2: Study a language that solves a similar problem and describe it in this homework==

Revision as of 06:08, 21 November 2009

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.

Navigation bars are a standard feature of many web pages. In recent years, a somewhat standard paradigm has developed of using unordered lists, which are then styled with CSS to give them a more traditional appearance.

Accomplishing this in a good-looking and cross-browser-compatible manner is not trivial and requires a fair amount of CSS fiddling. Furthermore, the HTML code which must be written to set up the navigational elements contains a fair amount of extraneous markup which detracts from getting a clear picture of the navigational elements and their actions.

Furthermore, navigational menus can often contain submenus for a structured hierarchy. This requires additional javascript coding to work properly and further detracts the web page designer from concentrating on accomplishing his task; namely, working on the actual design of the menu

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?