archives

Creating a markup language compiler

Hi everyone,
I'm undertaking creating a proof of concept for a software idea I have.
The basic idea is to create a language/program/platform/framework in which a developer can write a program that can then compiled (or otherwise made) to run on multiple platforms. Specifically, an instruction set consisting of three instructions/functions would be allowed. A developer (which in this case would be me) would use these three instructions to form a program. This simple program would be compiled so that the program could be executed on one or more different platforms.
One analogy I can think of is, for example, if the platforms were mobile computing platforms. So the instruction set might be

  • Display calendar (parameter 1: date;)
  • Create new calendar event
  • Display warning if new event conflicts with current event

While the most basic and logical program that can be created using these three instructions is in the order above, theoretically, the compiler should be able to take any combination of them and generate program code to run on the selected platform. The selected platform would be one or more platforms from a predefined set such as

  • Windows mobile X.X
  • Palm X.X

At this point, I'm thinking that the language would be a markup language similar to OpenLaszlo's LZX or Facebook's FBML. But I also know my disposition is due entirely to my current involvement in UI development.

What would be the simplest way to create this proof of concept?

A couple of ideas come to mind.

  1. Write a sample program in each of the platforms' native languages
  2. Examine the generated assembly code? Examine the generated machine code?
  3. Play around to try to determine what the output is for a given function in the native language
  4. At this point, great. Assuming I know what code is being generated from a given function/piece of functionality, wouldn't I still have to figure out what additional code is required to make the program function?

Integration:
This, I imagine would be one of the more difficult parts. Figuring out how to take the same program and have a compiler generate multiple versions of it capable of running on multiple platforms.

So, what am I in for? My undergrad is computer engineering. But it was more hardware than software focused. To get this done in the shortest amount of time – I’m trying to get this idea funded so I can hire “real developers” and assume the proof of concept won't survive beyond funding - do I learn:

  • Compiler design?
  • Reflection?
  • Compiler reverse engineering?
  • Other things?
  • Programming language specification?
  • Programming languages (theory)?

Which language is best suited for this? The platforms I’m going to target are nearly all Java based. Is there any open source project whose code I could benefit from learning?
As small as this is in scope (three instructions, 2-3 platforms to run on) this would be the most advanced programming project I’d ever undertaken and am nervous about doing so. But it’s something I believe in as well that believing that I can do anything anyone else can (however that’s a function of time), I’m going to keep going forward.
Any advice is well appreciated and I look forward to keeping you informed on my progress.
Shmuel

Lisp-like language for Domain Specific Languages prototyping

A new version of MBase framework is released, along with a DSL building tutorial. MBase is a DSL prototyping/implementation framework for Microsoft .NET - a Lisp-like language with some unique features.

Tutorial:
http://www.meta-alternative.net/calc.pdf

MBase documentation, including some highlights on the language architecture:
http://www.meta-alternative.net/MBase-0.6-doc.pdf

A bigger example - a subset of Paul Graham's Arc language compiler for .NET, a literate program:
http://www.meta-alternative.net/pseudoarc-Jul2008.zip

Project page, where MBase distribution can be downloaded:
http://www.meta-alternative.net/techpreview.html