Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

add safety checker #24

Merged
merged 16 commits into from
Oct 4, 2021
Merged

add safety checker #24

merged 16 commits into from
Oct 4, 2021

Conversation

Alonely0
Copy link
Owner

This is a prototype of a safety checker, which should help to prevent shooting yourself in the foot. If you are sure of what you are doing you can opt out of the checker by using the --bypass-all-checks flag, but it is more recommended using the new unsafe token, which will skip individual functions. It can be used like this: copy(@name, @name.txt) unsafe print(@sum=sha256). I am not sure if maintaining both options is too much overkill, though.

This is a prototype of a safety checker, which should help to prevent shooting yourself in the foot. If you are sure of what you are doing you can opt out of the checker by using the `--bypass-all-checks` flag, but it is more recommended using the new `unsafe` token, which will skip individual functions. It can be used like this: `copy(@name, @name.txt) unsafe print(@sum=sha256)`. I am not sure if maintaining both options is too much overkill, though.
I disabled it because i was testing the safety checker
…ead of exiting directly

It used to exit directly, which was not library-friendly. parse error instead returned an `Err`, and now safety errors also do so.
@Alonely0 Alonely0 added the enhancement New feature or request label Sep 26, 2021
@Alonely0
Copy link
Owner Author

Alonely0 commented Sep 26, 2021

83fd04d

@Cybergsus and I agreed in the Discord that it was redundant and unnecessary maintaining both options.
The unsafe keyword is better than the bypass-all-checks flag because the first lets you specify individual functions to ignore, while the second one ignores them all, so having a safety checker loses the point.

@cg-jl
Copy link
Contributor

cg-jl commented Sep 26, 2021

Then we can close #5 after this

@Alonely0
Copy link
Owner Author

Then we can close #5 after this

yep, this pr is linked to it, so after merging this the issue will be automatically closed.

@Alonely0 Alonely0 merged commit 6e70799 into main Oct 4, 2021
@Alonely0 Alonely0 deleted the #24 branch October 4, 2021 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Note on resources, and undefined behavior inside the cycles (long term planning)
2 participants