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
Add ExprSplitter #425
Add ExprSplitter #425
Conversation
I'm pretty sure we're using |
Instead of working hard on deprecation and then just have everyone immediately update to the new one (effectively making the work on the deprecation pointless) we could also release a new breaking version and have people just update to that. Of course, this depends on how hard it is to do the deprecation and how hard it is to do the upgrade. |
6df203c
to
3eb5ed0
Compare
Since these are officially internal (though well-used) functions, I decided to go with the breaking change. The transition is pretty straightforward as can be seen by the tests. The main thing I'm unsure of is whether we want to export a utility for detecting and stripping out |
@test isa(JuliaInterpreter.prepare_thunk(Main, :(Base.BaseDocs.@kw_str "using")), Nothing) | ||
# Some expressions can appear nontrivial but lower to nothing | ||
# @test isa(Frame(Main, :(@static if ccall(:jl_get_UNAME, Any, ()) == :NoOS 1+1 end)), Nothing) | ||
# @test isa(Frame(Main, :(Base.BaseDocs.@kw_str "using")), Nothing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't quite sure what to do about these.
b817367
to
41d398f
Compare
Ugh, this is ugly getting it over the finish line. The various bugs that different Julia versions have wrt LineNumberNodes are really annoying. Are the remaining errors anything to worry about? Travis had a failure on Windows 1.4 (a strange string-indexing error), appveyor on 1.2 (a problem with |
as far as I know, the only consumer who uses the utility for |
Thanks! If Revise is the only one, I've already got that covered from within Revise. There's isn't much to it, really, just grabbing the 4th argument of the expression so it wouldn't be much of a utiliy anyway. |
I would not really worry about unmaintained julia versions (1.1 - 1.4). Might be time to drop compat from them completely so they will keep working at the state they are in but not get updates. |
Sounds good. Looks like JuliaLang/julia#26685. I just pushed a debug commit; let's see if that reveals an easy fix, and if not I'll just |
That is one weird filename 😄.https://ci.appveyor.com/project/KristofferC/juliainterpreter-jl/builds/35055810/job/ubmbpu36otugvd9e |
20992bd
to
c188c7e
Compare
Codecov Report
@@ Coverage Diff @@
## master #425 +/- ##
==========================================
+ Coverage 88.73% 88.96% +0.22%
==========================================
Files 12 12
Lines 2006 2256 +250
==========================================
+ Hits 1780 2007 +227
- Misses 226 249 +23
Continue to review full report at Codecov.
|
A JuliaHub search indicates that the only known users of |
Wow, where did that come from? |
e32db7a
to
24b7089
Compare
I am not sure. Seems likely to be a memory bug or something. |
The main motivation is to eliminate their need to `eval`, which feels like a code smell.
24b7089
to
41b463a
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Seems like folks are willing to do the work of updating for the breaking change. Many thanks, all! |
Before merging I'm going to back out the commit disabling the ambiguity test. That means the test will fail, but we've at least seen the tests pass. |
41b463a
to
06ff99c
Compare
This implements an "expression-splitting iterator" that returns individual expressions ready for evaluation to the caller. This allows the caller to decide what to do with them (e.g., evaluation, signature analysis, whatever). It's basically a proposed replacement for
prepare_thunk
andsplit_expressions
; by placing the consumer in charge, we get rid of any of the weird "should I eval if I can't lower?" questions that have dogged the previous framework.For the moment this is parallel to our older framework; I've not yet actually rebased JuliaInterpreter on this, although theMy local copy ofFrame(::Module, ::CodeInfo)
constructor is a step in this direction.Revise#revise3
is now based on this and it seems to work well.@pfitzseb and @aviatesk, are there callers of these functions outside JuliaInterpreter, Debugger, and Revise? If so we'd want to think about a careful deprecation path. Indeed we might want to do that anyway since
split_expressions
, even though not exported, is pretty essential in some contexts (so there may be unknown users).Closes #406
Closes #419