You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all use commands are allowed to have platform based guards. Should they be outlawed for package usage?
If we don't allow package guards then we can type check for all platforms on every build. However that can also lead to situations where people have to install packages specific to other platforms on their machines.
There are 3 basic options:
Allow guards on package use commands (as now). No-one then ever needs to install any files for any other platforms, but we can't type check all platforms in one go.
Outlaw guards for package use commands (very little work). We can then type check all platforms at once, but people may have to install packages for other platforms, that they will never use. This also leads to the problem that a bug in a package that you will never use can stop your program building.
Something more complex. One possibility would be to allow guards on package uses, try to include the package regardless and not generate errors if a package with a failed condition does not exist.
Options 2 and 3 both also suffer from the potential problem of symbol clash. For example, given this:
use "windows_foo" where windows
use "linux_foo" where linux
If both the packages windows_foo and linux_foo define the symbol Bar then there will be a clash, even though the user probably won't expect one.
A further point is that if we allow cross OS compilation up to type checking (which should be easy) then checking another OS type checks OK is as easy as running:
ponyc src/ --pass=expr --target=windows
The text was updated successfully, but these errors were encountered:
Option 1, for now. It's the most flexible, and the only cost is cross-platform type checking, and only if the programmer chooses to make that trade-off. We can revisit this later if we need to.
Currently all use commands are allowed to have platform based guards. Should they be outlawed for package usage?
If we don't allow package guards then we can type check for all platforms on every build. However that can also lead to situations where people have to install packages specific to other platforms on their machines.
There are 3 basic options:
Options 2 and 3 both also suffer from the potential problem of symbol clash. For example, given this:
If both the packages windows_foo and linux_foo define the symbol Bar then there will be a clash, even though the user probably won't expect one.
A further point is that if we allow cross OS compilation up to type checking (which should be easy) then checking another OS type checks OK is as easy as running:
ponyc src/ --pass=expr --target=windows
The text was updated successfully, but these errors were encountered: