~/talk

MATLAB Coder: Partial Evaluation in Practice

Talkat PEPM 2023 · 2023-01-16..01-17· [compilers-and-language-design]
links:none on file
links:none on file
slides:none on file

MATLAB Coder converts MATLAB into embeddable C/C++ by using online partial evaluation and a type-driven engine that does function specialization on types and values to produce unboxed C types. It reimplements about 3,000 MATLAB functions, generates multiple specialized versions (example: four versions of sum), turns many runtime errors into compile-time errors, supports opt-in no-dynamic-memory for constrained targets, emits readable C for examples like a Kalman filter, and runs in seconds for small cases and minutes (≈6 min) for large builds.

AI-written summary · about

  1. 0:00Intro
  2. 0:50MATLAB is designed for prototyping
  3. 2:33Our goal is to enable MATLAB in production
  4. 7:37Focus: MATLAB Coder's "type inference" algorithm
  5. 22:25Takeaways from the examples...
  6. 23:36MATLAB Coder's Type Inference Engine
  7. 25:26Types propagate bottom-up in each statement
  8. 26:31Type inference visits statement in natural order
  9. 26:57Multiple types assigned to the same variable cause a type
  10. 27:21Constant folding and control-flow pruning help avoid type
  11. 28:13Function calls produce new function specializations by recursively invoking type inference on the callee
  12. 29:07Functions can be specialized not only on input types, but also on constant input values, demand-driven
  13. 30:16Iteration over heterogeneous arrays is another use case for specialization
  14. 31:01Complete loop unrolling for typing uses of heterogeneous arrays
  15. 31:25Type Inference Engine Summary
  16. 32:28Future work planned to make type inference more permissive
  17. 36:59Compiling for embedded systems requires more than just type inference
  18. 39:49Partial evaluation powers tools that enable running MATLAB "anywhere"
  19. 40:53And powers MATLAB embedded in Simulink and Stateflow
  20. 41:24You can deploy high-level languages to embedded systems
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.