JuliaCollections / JuliaCollections/DataStructures.jl

stackoverflow on comparisons for long linked lists

Open
#878 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
745
Forks
261
PR merge metrics
No merged PRs in 30d

Description

== comparisons for linked lists use recursive implementation. Since julia does, as of now, not support tail call optimization, this will lead to stack overflow errors for long lists. To reproduce try this:

using DataStructures
l = nil(Float64)
n = 100_000
for i in 1:n
    l = cons(rand(), l)
end

l2 = copy(l);

# this will crash
l == l2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the recursive == implementation for linked lists in DataStructures.jl and run the provided 100,000-element reproduction. Replace the stack-overflowing comparison behavior with an approach that handles long lists, and verify that comparing the copied lists completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.