-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REPL becomes irresponsive for some seconds if StyledStrings is loaded after OhMyREPL #355
Comments
I think this is due to the type piracy in StyledStrings (cc @tecosaur) |
I'd suspect so. To backport as much from the 1.11/StyledStrings behavior as possible, the compat "1.0" release of StyledStrings redefines the generic methods for Perhaps there's a better compromise to be struck between complete comparability and latency/invalidations? If so, I don't have much of an intuition about where to strike it. X-refs: JuliaLang/StyledStrings.jl#57, JuliaLang/StyledStrings.jl#61 |
But why there's a lag after the recompilation apparently finished? Waiting for recompilation is, well, ok, but having an irresponsive REPL is another kind of issue. |
Without doing testing + profiling: no idea on my end. |
Oh boy... That's kind of awful. And 1.10 is an LTS so everyone who happens to start depending on StyledStrings will inject these latency mines for people using the LTS for a long time... This is not an issue with this package, it should be opened in StyledStrings. |
Yea, I don't want to have those "latency mines" as you call them either, but I'm having trouble seeing how they can be avoided without compromising backwards compatibility. As always, help would be appreciated. |
You have to make the code so that it is generic and doesn't have to inject its special behavior into every But this is completely unscalable and "anti Julian", what if someone else would want to do something similar? Whatever packages that got loaded last would "win" but this behavior would be wholly unpredictable. |
It's not all |
If we wanted To me it doesn't seem as though |
It has because it wins vs all string types and the way it does it is via type piracy and method overwriting. And the generic You might have the same argument about |
A generic API that doesn't privilege the |
The fundamental problem here is that annotations are an incompatible extension of the concept of a string. It's similar to the famous "circle-ellipse problem" in OOP. So far an The There is obviously a lot of history of string types and algorithms, and people are familiar with them. So personally I don't think it's realistic to add the idea of annotations and expect everyone to be able to work with it. Strings are just too fundamental and popular to take on this new job. This is a really cool feature so it's unfortunate, but IMO it needs to remain an opt-in feature where annotations can only be preserved when you are careful about it, and AbstractString code can continue working only on codepoint sequences. |
It's an interesting situation. In conversation a while ago with Scott Jones about the type hierarchy and A consequence of this though would be that a lot of The way I see the compromise (I should probably PR an update to the I think this goes some way to resolving the tension, but there are a bunch of basic functions (e.g. Perhaps I'm overly optimistic, but despite the complications I find myself encouraged by the improvements I'm seeing it enable/open the door to, things such as:
and I expect more to come with time. |
This is the issue:
OhMyREPL
andStyledStrings
OhMyREPL
(using OhMyREPL
).StyledStrings (
using StyledStrings`).Result:
The REPL is returned normally after loading StyledStrings, but becomes irresponsive for some seconds. In my computer, about 10 seconds. In the example below, the multiple julia REPLs shown at the end appear because I typed "enter" multiple times without any response:
The issue does not occur in Julia 1.11.
The text was updated successfully, but these errors were encountered: