Tuesday, August 02, 2011

Transformative C

The most important part of the project is over. I have given the language a name.

Presently I'm at the stage where I'm still playing with the lexer, parser, and the code generator, trying to make it do anything at all, but there are some things that have become more obvious through the short time it's been in development.

  • a program is made up of transforms that operate on streams of data
  • the selection of, and order in which the transforms are called is the program.
  • the transforms know nothing about what created the data they are operating on
  • the transforms know nothing about what will use the data they create
  • you can reuse code in two main ways
    1: sub functions called by transforms
    2: using programmes of transforms given streams as arguments
  • everyone is going to love or hate this language
Once I have a program that prints hello world, I'll start putting up source code snippets.

4 comments:

Noel said...

Very intriguing! Can't wait to see what you come up with.

macton said...

No surprise that I'm interested! Sounds cool. Share details soon.

bullno1 said...

Interesting. So does it generate native code or does it compile to C?

Isn't printing "Hello world" kind of a side effect? And your language allows that?

Richard Fabian said...

As far as I got before crunch took over my life once more, was having it generate LLVM intermediate representation. When I do pick it up again, I think I'm going to move towards generating c/assembly, as llvm doesn't seem to have yet matured to the point at which it can generate good code for more advanced instrinsic types.