phillipstanleymarbell / Noisy-lang-compiler

Noisy language compiler
MIT License
17 stars 1 forks source link

New backend to generate C code for computing invariants #359

Open phillipstanleymarbell opened 6 years ago

phillipstanleymarbell commented 6 years ago

New backend to generate C code for computing invariants. This should work with either the hand-written invariants or those synthesized from the dimensional analysis (see, e.g., #358). The generated C code should be generic. As a guide to what "generic" is, the source file should be compilable into an object file, from the command line, using gcc -c with no platform dependence. (NOTE: compilable into an object file, not into a binary, since it will have no main().) It will be linked together with embedded firmware (e.g., on Warp) which will feed the functions with the appropriate signals (e.g., velocity computed from acceleration, etc.).

float
computeDragForceInvariant(float viscosity, float velocity...)
{
    ...

    /*
     *  function to compute the value of the invariant
     */

    return invariantValue;
}

See comments here https://github.com/phillipstanleymarbell/Noisy-lang-compiler/issues/354#issuecomment-418620426 and here https://github.com/phillipstanleymarbell/Noisy-lang-compiler/pull/301#issuecomment-409131120 for a guide on how to add a new backend/pass into the compiler.

phillipstanleymarbell commented 5 years ago

This is merged. Moving to verify.