I only know Roc as much as I recall from Richard Feldman's talks, so bare with me and my assumptions.
I've written up my master thesis idea in poits, so it's easier to read:
In OO languages adding new operation to a set of types enforces change in all these types
In FP adding a new handled type case enforces change in all relevent functions
You can't add both new types and new operations without recompiling existing code
There are many solutions, my favourite: singleton traits/protocols/concepts combined into larger concepts
This solution makes it so you implement each pair type⨉operation separately
Problem as it's defined in literature solved, but:
... no organization is now enforced on your implementations,
... if you organize you put things to the same file either by function, or by type, so you're still forced to jump around
My solution: display implementations in a matrix
On X axis all functions that get some abstraction, on Y axis all instances of that abstraction, implementations in cells
Crucially: don't treat code as code, but as a higher level structure, that gets materialized only when compiled
Benefit: automatic recollection of commonalities. Common parts of the implementations are displaed as recollected, separate are displayed as switched on.
On compilation best performing code is formed
Additionally: represent a single multi-argument function as a matrix
Two selected arguments on X, Y axis, the rest is switched on in implementations.
Why I thought of Roc for this?
Extensible editor project - prefect environment for an extension like this
All functions pure - easier to reason about. Taking out common parts of implementations shouldn't result in any changes in behavior, as well as trasposition in relation to arguments
I've heared Roc has something like traits/protocols/concepts.
What problems do I forsee?
Roc doesn't have stable versioning iirc. For a master thesis I'd need a recreatable enivronment.
The solution shuold allow for dynamic dispatch. Rust's traits do allow that (although it requires going through hoops, as I've been made aware of). Does Roc provide dynamic dispatch at all, being pure functional? Cause I've learned Haskell doesn't really.
The editor is at early stage of development (?). I'd need to finish my work (at least the implementation part) up to June indeally.
Please, give me some feedback. I personally think this is a good overall idea, but it will serve as my master thesis, and has to be grounded to some level, apart from having the "cool factor".
These do feel like major roadblocks. I may just end up writing this for Rust or Go, althought I'll probably have a lot of trouble with formal analysis of functions, assembling different, logically equivalent views of the same functions.
I have been already trying to imagine how to conceptualize the different aspects of the flow of the data trough Roc program, and whilst struggling to put clear cuts on it I imagined that you have to have to reduce a representation to a form of a 2d matrix for easiest and clearest comprehension of what is going on.
Actually, informed question this time. How statically can you write Julia code? Can I make all the variables statically typed unless I know I will need a dynamic dispatch?