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 Julia support #58

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

jonschumacher
Copy link

Closes #54

Still WIP. I will update this post as soon as I am more confident about the implementation. I only tested the backlight of a 20x4 LCD ;)

@photron
Copy link
Member

photron commented Oct 15, 2021

Very interesting!

It seems you started to do what I suggested and forked the Python bindings generator.

Are you looking for detailed feedback at this stage or just want to announce that you're working on Julia bindings?

@jonschumacher
Copy link
Author

Since a lot of functions are not yet working, a detailed review seems to be too much at this stage. I primarily created this PR for letting people know that something is happening. Since this is just a minor side project, it might take a while to get this fully working.

But I have one question: Is it somehow possible to test the bindings against some mockup devices? Or do you have some setup for integration tests? Since I don’t have many different devices, I can’t easily test.

@photron
Copy link
Member

photron commented Oct 18, 2021

There is no official test suite.

I started to develop an emulator that should be able to emulate any device and error condition. But it's far from being finished yet. The core protocol mechanic works but there are basically no devices yet, apart from a minimal Ambient Light Bricklet 3.0 that is just complete enough to work in Brick Viewer.

But you can give it a try, see the emulator directory in the repository and run the emulate_ambient_light_v3_bricklet.py file in Python >= 3.7. It listens to port 5555 instead of the default 4223.

I think I can make up a fake device in the emulator for you in the next days that uses all the protocol features. So you can test your bindings against that fake device. If your bindings work correct with that fake device then they should be able to work with all real devices as well.

@jonschumacher
Copy link
Author

jonschumacher commented Oct 18, 2021

That sounds awesome, I will test emulate_ambient_light_v3_bricklet.py in the next days. If you have a testsuite in Python that works with this fake device I can translate it to Julia and we should have a fully working binding quickly.

@photron
Copy link
Member

photron commented Oct 19, 2021

I just added the start of the Common Test Bricklet. There is now emulate_common_test_bricklet.py and test_common_test_bricklet.py. I'll extend this to cover all protocol types and features.

@jonschumacher
Copy link
Author

I have to admit that I now went the lazy route of simply using Julia's PyCall module to wrap the Python version of the bindings since I failed to get the IPConnection working in Julia (for now).
@photron: Is this something you would consider merging if the documentation part and everything else is working properly? What would be needed to have this as an officially registered binding?

@photron
Copy link
Member

photron commented Jan 17, 2022

I'd prefer a pure Julia implementation if possible. What problems did you run into with that?

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.

Julia support
2 participants