EDDIC 0.9 - Floating point support

I just finished working on the 0.9 version of the EDDIC Compiler.

The language does now support floating point variables. Here is an example of what can be done in EDDI now:

void main(){
   float a = 1.5;
   float b = 3.0;
   float c = a + b;
   println(c);
   c = b + 2.75;
   println(c);

   println(test(2.0888, 1.00222));

   float array[7];
   array[0] = 21.999;
}

For now, there is no interoperability between integers and floating, so you can't add an integer to a floating point or cast a floating point to an integer. Those features will be added in the 0.9.1 version. The floating point support has been implemented using the Streaming SIMD Extension (SSE) of Intel processors. This won't work on processor that doesn't include support for SSE.

Another big improvement is that the position of the tokens in the source file are now collected through the parser. When an error or a warning arises during the compilation, the precise position of the error or the warning is printed to the console.

New options are available for eddic:

  • --ast : Print the Abstract Syntax Tree representation of the source
  • --tac : Print the Three Address Code representation of the source
  • --ast-only : Only print the Abstract Syntax Tree representation of the source (do not continue compilation after printing)
  • --tac-only : Only print the Three Address Code representation of the source (do not continue compilation after printing)

And, finally, some improvements have been made to the sources of the project.

Download

You can find the compiler sources on the Github repository: https://github.com/wichtounet/eddic

The exact version I refer to is the v0.9 available in the github tags or directly as the release branch.

Related articles

  • EDDIC 0.9.1 - Enhanced floating point support
  • How to print strings and integers in Intel Assembly on Linux ?
  • EDDIC 0.8.1 : do while loop and better optimization
  • eddic 0.5.1 : Better assembly generation and faster parsing
  • Compiler Architecture refinements for eddic
  • EDDI Compiler 0.6.1 : Function return types
  • Comments

    Comments powered by Disqus