Open RobBW opened 2 years ago
Do you have any idea how to use it though? It promotes a couple of CLI tools but doesn't really go into much detail for the lexing/parsing. I see there's a fork that's trying to implement something for parsing to Python: https://github.com/chaoqing/miss_hit/blob/9304eb2800681fa2bcfe5a18fc3a5d898d1da35d/miss_hit_core/m_ast.py#L3358
Hey. :)
Lexing and parsing is fully complete with all features of MATLAB (even the dumb ones) supported. What is not working yet is semantic analysis (i.e. name resolution and type inference). I am very happy to assist you or answer any questions you might have to get something working.
It's enough to write a bunch of tools (code formatter, code metrics, linter, etc.) but to do more interesting things (like code generation) I still need to put in place a lot of code.
Generally the focus is completeness and correctness over "do everything fast but only for a small subset".
That's a nice focus for the project! For the SMOP community what is going to matter most is translation of MATLAB code into equivalent Python code. I saw someone with a fork who is trying to do just that. How would one go about using the project for transpilation purposes?
You can test that fork online here: https://translate.mat2py.org The underlying code is here: https://github.com/mat2py/mat2py
Hi @RobBW, thanks for linking mat2py
. Actually mh_python
is responsible for code translating and mat2py
is the runtime to evaluate the generated code. Hi @Helveg, you can give a try to this online matlab emulator.
There is a new and open source tool for parsing and lexing Matlab at:https://misshit.org Github repository at https://github.com/florianschanda/miss_hit It is described as follows:
It will undoubtedly be a good resource for people wanting to extend the capabilities of smop.