Bug 58 - create pipeline from a python3 function with type information
Summary: create pipeline from a python3 function with type information
Status: CONFIRMED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: Low enhancement
Assignee: Luke Kenneth Casson Leighton
URL:
Depends on:
Blocks:
 
Reported: 2019-04-07 01:04 BST by Luke Kenneth Casson Leighton
Modified: 2019-04-15 12:26 BST (History)
1 user (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2019-04-07 01:04:46 BST
> (makes me wish we were using Rust:
> CombStage would just be:
> impl<I: SignalGroup, O: SignalGroup, F: Fn(I, &mut Module) -> O> Stage<I,
> O> for F {...}

 it's probably doable, using iterators and reduce, or something
equally obscure.  overriding __add__ or something as a way to connect
two stage instances [basically __add__ is calling connect_to_next,
then reduce on... you get the idea]

 actually... *click*... the input "type" and the return "type" of the
function: that's it.  it should be possible to do introspection on
them.  i was trying to work out how the hell you could encode the
input and output data types into a function.  without the input and
output data types, the function itself has to declare them (somehow)
and it gets complex enough to make it not worthwhile, you might as
well use a class.

> that way you could just use any function with the right prototype as a
> Stage without needing to make a CombStage or anything.)