REPL freezes without error

Pasting a short script into the REPL, it slowly accepts line after line but when it gets to the last line it just freezes there indefinitely.

No errors. No cpu activity. no idication anything is wrong or failing iany detected way just stops and does nothing?

The entire session/program in case it helps diagonse the issue:

julia> using Plots, Interact

julia>

julia> function linear_partition(x, N, r)
           return [x * (i / (N-1))^r for i in 0:N-1]
       end
linear_partition (generic function with 1 method)

julia>

julia> function geometric_partition(x, N, r)
           ratio = r^(1/(N-1))
           first_segment = x * (1 - ratio) / (1 - ratio^N)
           return [first_segment * ratio^i for i in 0:N-1]
       end
geometric_partition (generic function with 1 method)

julia>

julia> function logarithmic_partition(x, N, r)
           return [x * log(i + r) / log(N + r) for i in 1:N]
       end
logarithmic_partition (generic function with 1 method)

julia>

julia> function exponential_partition(x, N, r)
           return [x * (exp(i * r / (N-1)) - 1) / (exp(r) - 1) for i in 0:N-1]
       end
exponential_partition (generic function with 1 method)

julia>

julia> function plot_partitions(N, r)
           x = 10  # Arbitrary total length
           partitions = [
               ("Linear Scaling", linear_partition(x, N, r)),
               ("Geometric Progression", geometric_partition(x, N, r)),
               ("Logarithmic Scaling", logarithmic_partition(x, N, r)),
               ("Exponential Scaling", exponential_partition(x, N, r))
           ]

           p = []
           for (title, part) in partitions
               push!(p, plot(title=title, legend=false, size=(600, 200)))
               for d in part
                   plot!(p[end], [d, d], [0, 50], linewidth=2, color=:black)
               end
           end

           plot(p...)
           end
plot_partitions (generic function with 1 method)

julia>

julia> @manipulate for N in 5:50, r in 0.1:0.1:5
           plot_partitions(N, r)

There are lots of issues with the REPL:

https://github.com/JuliaLang/julia/labels/REPL

For now, my suggestion would be not to paste code into the REPL (at least not more than a few lines) and to use include("my-script.jl") instead.

Thanks for the response. Its more than I got to:

Conclusion. Ditch Julia.

  1. it aint ready for prime time.
  2. you can whilst dixie before getting answers to apparently simple questions.

be well. Buk.

Did you press Return after the last line?

If that is your last input, it is incomplete and for is missing an end. Could be that the REPL is just waiting for the input to complete.

3 Likes

@bertschi’s observation is probably the correct one. Your last input is incomplete, so the REPL is still waiting for the rest of the expression.

I’m sorry another user in this thread gave you the wrong impression that the REPL is buggy and unusable. There are many open issues on Github for every open source language, but those languages are still quite usable.

Regarding the other thread that you linked here and haven’t gotten a response to yet, please keep in mind:

  • This forum is filled with volunteers. No one is payed to respond to your questions.
  • That question is actually unusual and not easy to answer.
1 Like

I paste scripts into the REPL all the time without issue. Furthermore, I don’t think pasting into the REPL was ever an issue.

1 Like

In that thread maybe people were waiting for your response to the person who already replied about trying v1.11 to see if the issue persists on that version…? Seems disrespectful to the person who replied there to dismiss them like that in this comment.

Anyway, as mentioned the REPL here wasn’t frozen since it was waiting for your input. I haven’t really had any other issues with the REPL, I don’t think just looking at the issue count on the REPL as the first commenter suggests is productive since any big project has lots of open issues.

1 Like

I wish I’d thought of that.

Oh wait. I did. And ctrl-C. And Esc. And a bunch of random keys, but nothing was ever displayed.

And I tried adding a bunch of newlines to the file before C&P. And I added a couple of do nothing lines to the bottom of the file, but they were never displayed.

Maybe I not quite as stupid as I look! (Hang on, you can’t see my face?)