Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MATLAB support #147

Merged
merged 34 commits into from
May 16, 2024
Merged

Add MATLAB support #147

merged 34 commits into from
May 16, 2024

Conversation

naegelejd
Copy link
Contributor

@naegelejd naegelejd commented Apr 15, 2024

Adds Matlab support for the yardl binary format.

Closes #78.

And lots of changes to Matlab codegen and supporting files.
Mid-way through adapting the Vector/Array serializers to handle
nested arrays/vectors. Next up are the Subarrays tests.
All passing. Next:
- Clean up the Vector/Array serializers
- Add C++ translator to RoundTripTest
- Finish fixing computed fields and ComputedFieldsTest
- Documentation
Instead of the entire stream into memory.
Also clean up Matlab code and improve serializer input validation.
@naegelejd naegelejd self-assigned this Apr 15, 2024
@naegelejd naegelejd changed the title Add MATLAB support (#78) Add MATLAB support Apr 15, 2024
@naegelejd
Copy link
Contributor Author

@johnstairs When you are ready, you can follow the additions to README.md to get started with Matlab.

On my Windows PC, where I run my devcontainer in WSL, my WSL shell profile $HOME/.profile looks like this:

export MATLAB_LICENSE_FILE=/mnt/c/Users/username/Downloads/Network.lic.com

Be sure to restart all instances of VS Code before building the devcontainer.

@johnstairs
Copy link
Member

Should we have have the sandbox model generate MATLAB too? In the past, I've found that model to be a useful testbed for isolating problems

docs/index.md Outdated Show resolved Hide resolved
Copy link
Member

@johnstairs johnstairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you delete a top-level type (like a record or a protocol), we should make sure we delete the associated generated files.

Copy link
Member

@johnstairs johnstairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MyType: !record
  fields:
    a: int->string

If I create two instances and call a.eq(b), I get

Error using ==
Concatenating 'dictionary' objects is not supported because 'dictionary' objects can only be scalar.

Copy link
Member

@johnstairs johnstairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MyType: !record
  fields:
    a: int*

If I create two instances of this type where the a fields have different lengths, eq raises an error:

Arrays have incompatible sizes for this operation.

Error in == (line 20)
        all([self.a] == [other.a]);

@johnstairs
Copy link
Member

I don't know if we can customize a class' string representation, but say the default for union is not that helpful:

  Int32OrString with no properties.

docs/matlab/language.md Outdated Show resolved Hide resolved
docs/matlab/language.md Outdated Show resolved Hide resolved
@naegelejd naegelejd requested a review from johnstairs May 15, 2024 16:45
Copy link
Member

@johnstairs johnstairs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, Joe!

@naegelejd naegelejd merged commit bb18619 into main May 16, 2024
14 checks passed
@naegelejd naegelejd deleted the naegelejd/matlab branch May 16, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add MATLAB support
2 participants