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 warning when using '=' for non-immediate values #7524

Closed
vicuna opened this issue May 2, 2017 · 3 comments
Closed

Add warning when using '=' for non-immediate values #7524

vicuna opened this issue May 2, 2017 · 3 comments

Comments

@vicuna
Copy link

vicuna commented May 2, 2017

Original bug ID: 7524
Reporter: modlfo
Status: acknowledged (set by @dra27 on 2017-05-02T10:08:27Z)
Resolution: open
Priority: normal
Severity: minor
Category: typing
Related to: #3921 #7502

Bug description

This is a proposal/request for creating a warning that will be trigger when using '=' on any value that is not immediate (like lists, records).

The main motivation is to avoid problems as the ones described in the reports 0003921, 0007502.

We were also affected in our product by this behavior. The problem that we had was that an algorithm using 'compare a b = 0' was changed to 'a = b'. This produced a big performance degradation since we were not aware that '=' didn't performed physical comparison.

When enabling this warning new programmers will be notified of this behavior therefore avoiding the unintended consequence.

@vicuna
Copy link
Author

vicuna commented May 2, 2017

Comment author: @dra27

It's hard at the moment to imagine our being able to turn this warning on by default, I think, so the benefit to new users may be harder to achieve. That doesn't detract from the benefit of having the warning, though.

@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
@yallop yallop changed the title Add warning when using '=' in for none immediate values Add warning when using '=' for non-immediate values Apr 11, 2019
@modlfo
Copy link

modlfo commented Dec 18, 2019

I just one to +1 this issue (even when I reported it originally). We recently got bitten again by this problem: A piece of code was changed to use = and we got a really bad slowdown in a function that was rarely used to be noticed. But when used, it could take 20 minutes instead of taking seconds.

This warning would be very useful to avoid these kind of mistakes made by any new OCaml programmer that joins our team.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants