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

Change Fwd of Df to Maybe instead of Data #89

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

t-wallet
Copy link
Collaborator

Also fixed some linter warnings. HLS was very useful for this job, but it was not configured in the nix shell. I'd like to hear your opinions on adding HLS to shell.nix? We used this in the clash-ethernet repo and it worked pretty well with vscode.

@t-wallet t-wallet linked an issue Jul 19, 2024 that may be closed by this pull request
@rowanG077
Copy link
Member

Don't forget to update the readme.

@martijnbastiaan
Copy link
Member

HLS was very useful for this job, but it was not configured in the nix shell. I'd like to hear your opinions on adding HLS to shell.nix?

Go for it. I never got it working within Nix though, do you need to start vscode in a specific way?

@t-wallet
Copy link
Collaborator Author

HLS was very useful for this job, but it was not configured in the nix shell. I'd like to hear your opinions on adding HLS to shell.nix?

Go for it. I never got it working within Nix though, do you need to start vscode in a specific way?

Yes, you need to start vscode from the terminal while in nix-shell (and have the vscode hls extension of course).

@martijnbastiaan
Copy link
Member

Could you check whether this breaks underscore notation in the circuit plugin?

@t-wallet
Copy link
Collaborator Author

Could you check whether this breaks underscore notation in the circuit plugin?

Tests.Protocols.Plugin still compiles, so I don't think it breaks

@martijnbastiaan
Copy link
Member

Ah of course, that's because you did Data -> Maybe, but not Ack -> Bool. Makes sense, sorry for the noise.

@christiaanb
Copy link
Member

christiaanb commented Jul 25, 2024

Do we have some benchmarks that show there’s no space leaks, or at least no simulation performance degradation from this change?

The issue that is closed by this PR just says that “Maybe is lazy, but that’s not a problem any longer”. So what was the original problem that is no longer there?

I guess a benefit of this change is that we no longer have an unlawful Applicative Data instance.

@martijnbastiaan
Copy link
Member

martijnbastiaan commented Jul 25, 2024

The issue that is closed by this PR just says that “Maybe is lazy, but that’s not a problem any longer”. So what was the original problem that is no longer there?

This was more based on a gut feeling back then, after having experienced many space leaks at a client. The idea was that it doesn't make much sense to have an X-value when you have a Data, hence making the seqX in Signal's fmap/app actually do something / do more.

@t-wallet
Copy link
Collaborator Author

Do we have some benchmarks that show there’s no space leaks, or at least no simulation performance degradation from this change?

The issue that is closed by this PR just says that “Maybe is lazy, but that’s not a problem any longer”. So what was the original problem that is no longer there?

I guess a benefit of this change is that we no longer have an unlawful Applicative Data instance.

There was no huge difference in the runtime of the Df tests (actually, the strict version ran 5% slower on average). The point of this PR is to make things uniform, right now we use Data for Df and Maybe for PacketStream and Axi4Stream. I'm also open to doing things the other way around, i.e. using the strict version for every protocol.

Copy link
Member

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

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

Let's add an issue discussing a similar Ack -> Bool migration.

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.

Change the definition of Df to use Maybe instead of Data.
4 participants