objectionary / ideas

Here we keep ideas for future research in EO programming language and Polystat static analyzer
https://www.eolang.org
7 stars 0 forks source link

Specialization of EO objects #6

Closed yegor256 closed 9 months ago

yegor256 commented 1 year ago

Consider this example of a EO program:

[] > first
  [] > boom
    QQ.io.stdout "First!"
[] > second
  [] > boom
    QQ.io.stdout "Second!"

[] > app
  seq > @
    foo first
    foo second
[x] > foo
  x.boom > @

Here, the object foo accepts two "types": first and second. This polymorphism is convenient for programmers, but causes problems in compilation and program analysis. We can modify the code above to remove polymorphism:

[] > app
  seq > @
    foo1 first
    foo2 second
[x] > foo1
  x.boom > @
[x] > foo2
  x.boom > @

Now, we have two objects foo1 and foo2, each of witch accepts only one "type". This program modification technique is called "specialization".

We need to create a command line tool, which will take a directory with .xmir files and create a new directory with the same set of files, but most objects will be specialized (maybe not all of them could be specialized).

Full paper is here: https://www.overleaf.com/read/bjzmfhsypqdb

advasileva commented 1 year ago

I am engaged in this task