Comments (7)
Thanks for the bug report. You're right, our current method for dealing with assertions is pretty anti-modular, and we should be able to do a lot better.
I'll talk with the rest of the team about this on Monday, and we'll come up with something that works with all of our existing Ivory targets, and allows the user to pick a more flexible assertion implementation.
from ivory.
I think @expipiplus1's suggestion is completely reasonable. Are there any reasons not to?
from ivory.
There may need to be a mechanism to put the users ivory_assert
in scope everywhere.
from ivory.
I'd prefer not to give the user arbitrary control of includes and macros in the Ivory runtime if we can avoid it. Here is a proposed solution which allows the user to provide an assertion hook as a library. I made this a bit flexible with a verbose user hook as an option. This is configurable because users might not have room for __FILE__
and __LINE__
constants on embedded systems with limited program size.
from ivory.
Often it's nice to have the expression for arg
as a string when printing asserts in addition to file and line.
Changing the line in the verbose definition for ivory_assert
to ivory_user_verbose_assert_hook(atype, #arg, __FILE__, __LINE__);
from ivory.
That suggestion sounds good to me. I'll merge this with master as soon as we work out what the assert hooks will be for each of our user's platforms.
from ivory.
assert hooks are now in master. Thanks again for this bug report!
from ivory.
Related Issues (20)
- Invalid code generated: initialization discards βconstβ qualifier from pointer target type HOT 9
- Hackage build failed HOT 4
- The documentation for the latest version of this package is missing on Hackage. HOT 2
- Question: Using "Simple" Sum Types in Ivory HOT 2
- Why `deref` is effectful? HOT 7
- Add support for template-haskell-2.12 HOT 1
- Constant assertions
- Remove `IvoryZero` constraint from `ifte` and `cond`
- Travis entry for 7.10 looks invalid
- http://ivorylang.org seems down HOT 1
- How to actually run the tutorial? HOT 1
- ivory-backend-acl2 can not work
- Incompatibility with newer versions of base-compat and monadLib HOT 1
- The documentation for the latest version of `ivory-backend-c` is missing on Hackage. HOT 3
- ProcPtrs and Refs in MemAreas
- Remove noop casts in the C code HOT 4
- Finish/integrate new model-checker
- Generalize Ivory memory model
- Ivory module system improvements
- cvc4 errors in local test HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ivory.