Yutaka Ichibangase
Yutaka Ichibangase
Instead of allocating a huge chunk of memory right away, we can gradually allocate a large enough chunk for the arguments that are actually referred. In `sparse-compounds` branch, I implemented...
With `length(L,N)`, `L` is unified with a newly introduced `*sparseList` as well. It'll delay memory allocation until its element is unified. ```console $ $(go env GOPATH)/bin/1pl Top level for ichiban/prolog...
Can any of existing implementations handle these queries and raise `resource_error(memory)`? As far as I know, when there's no enough memory, OSs overcommit memory and return unusable memory chunks on...
Thank you for the examples. I think our implementation is more like SICStus except Go runtime doesn't let us handle the case of `runtime: out of memory`. SWI takes a...
You can, but Go runtime immediately `exit(2)` when it reached to the limit. I'm preparing a fix to respect Go's builtin soft memory limit in #279. You can set the...
Merged the fix and released as `v0.15.1`. ```console $ go install github.com/ichiban/prolog/cmd/1pl@latest go: downloading github.com/ichiban/prolog v0.15.1 $ GOMEMLIMIT=500MiB $(go env GOPATH)/bin/1pl Top level for ichiban/prolog v0.15.1 This is for testing...
This is because the memory overflow detection currently implemented can only detect obvious cases such as `length(L, 1024).` before it exceeds the soft memory limit. Since `append/3` is implemented as...
Now that we've added `nth0/3`, the original program can work with a slight modification: ```go package main import ( "fmt" "github.com/ichiban/prolog" ) func main() { p := prolog.New(nil, nil) if...
I'm going to close this issue for now. Feel free to reopen it if anything unclear!
So the complete example is: ```go package main import ( "fmt" "github.com/ichiban/prolog" ) func main() { p := prolog.New(nil, nil) if err := p.Exec(` :- dynamic(test_pred/1). % Declare test_pred/1 is...