ssm-lang / Scoria

This is an embedding of the Sparse Synchronous Model, in Haskell!
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Add "escape hatch" in EDSL #80

Open j-hui opened 2 years ago

j-hui commented 2 years ago

I would like a statement in the EDSL that allows us to inject arbitrary C statements into the generated C code. This would be extremely useful for platform-specific debugging and prototyping. For instance, we can insert escStm [cstm|printk("hello\r\n");|] to insert a printk statement.

For the purpose of testing, these statements can be left out of the trace build (we can make a pass that prunes these out of the AST before feeding it to the backend).

Rewbert commented 2 years ago

This doesn't sound like it should be an issue.

Perhaps when we parameterise the whole thing over platforms & boards, maybe we can tag such escape hatches with a platform?

Rewbert commented 2 years ago

"this escape-thing is relevant for platform X -- all others should ignore"