Comments (4)
I haven't tested this hypothesis, but I believe it's to be expected that black-holing doesn't detect such loops. In fact, as long as you don't use deep_seq
(but both nickel eval
and nickel export
do use it, which is why it's looping), this term doesn't loop, in that it's always productive: if we evaluate y
, we get a lazy record {foo = y}
. If we then evaluate foo
, we get in one step the record {foo = y}
, and so on. It's basically an infinite record { y = { foo = {foo = { foo = ....
, which is - at each step - at most one variable substitution away from being in weak head normal form.
So, evaluating y
always terminates, and doesn't trigger the infinite recursion detection.
However, this is different when forcing/deep_sequing the record, of course, because we are now trying to recurse into an infinite data structure. I wonder if we can extend the blackholing mechanism to handle this case, by forbidding thunks to be evaluated again while we're still forcing the children of this thunk.
from nickel.
I'd expect the same infinite recursion error that you get from, say let rec y = y in y
from nickel.
I mean, it is an infinite loop, right? Although we should probably be able to detect that without black-holing, and I'm not sure why we don't.
What behavior do you think would be right?
from nickel.
Related to #1722
from nickel.
Related Issues (20)
- README is missing Plk in the comparison table. HOT 1
- `std.array.split_at` broken if index equals length of array HOT 2
- `{a : "str"}` evaluates into a function HOT 2
- Typo on the homepage (underscore and dash) HOT 4
- Querying in REPL is broken in 1.4 (undue unbound identifier error)
- The LSP doesn't show the details of type errors anymore in the diagnostics HOT 1
- Nickel Release 1.5.0 does NOT contain binaries HOT 3
- Subcommand for applying functions to commandline arguments HOT 4
- Dynamic import resolution HOT 5
- Confusing merge behaviour in `std.record.{update,remove}` HOT 1
- `std.string.find_all` HOT 1
- Add `record.has_field_all` and `record.fields_all` HOT 1
- Add raw strings
- NLS crashes on recursive definitions HOT 11
- Proposal: freeze recursive records upon insert/remove/update/map
- NLS reports same diagnostic message multiple times HOT 3
- VSCode extension does not show hints for functions annotated with record contract HOT 1
- VSCode Extension should not disregard cursor position and collapse all symbol breadcrumbs to "..." in all occasions
- Weird `nix develop` error 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 nickel.