machinekit / machinekit-hal

Universal framework for machine control based on Hardware Abstraction Layer principle
https://www.machinekit.io
Other
109 stars 63 forks source link

HAL declarative #130

Open ArcEye opened 6 years ago

ArcEye commented 6 years ago

Issue by machinekoder Sun Apr 26 08:34:28 2015 Originally opened as https://github.com/machinekit/machinekit/issues/591


In this thread https://github.com/machinekit/machinekit/issues/581 I mentioned a way to make HAL configurations even a step easier to create. What I am talking about is a features that automatically creates logic and arithmetic operator components when linking signals. This of course should not be a default feature of HAL but more an extension. The described approach somehow reminds me of declarative/functional programming that's why I called it "HAL declarative". Let me give you an example:

set_thread('base_thread')
bitSignal += bitPin1 & bitPin2
floatSignal += (floatPin3 + floatPin4) * 5.2

The code above expands into a set of newinst, newsig, net and addf. Therefore it would automatically generate components and singals where necessary.

ArcEye commented 6 years ago

Comment by mhaberler Sun Apr 26 09:10:16 2015


there is no reason to assume a component actually has a particular number of thread functions.

There are components which have zero (userland, or special function comps like kins), one (many) or several (like motmod) thread functions.

not sure hiding the relation between comps and thread functions is going to help clarity