-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC/WIP: Move more of jl_uv into julia code #3199
Conversation
# to use it properly | ||
# | ||
|
||
immutable UvBuffer |
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.
this maybe shouldn't be immutable, they tend to be a bit hard to ensure they are rooted properly in the GC (e.g. it may gets copied to the stack in the ccall)
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.
Doesn't need to be rooted (after the ccall), since libuv makes a copy of it.
I'm not really a fan of all this writing C in julia syntax. C should be written in C. Julia is not supposed to have |
Another way to put it: what matters is (1) API design, (2) performance. That's what we need to be addressing. |
I agree with you, of course, though the reason that most of these had wrapper functions in C in the first place is that we didn't used to be able to pass Julia functions as callbacks to C, which we now can, so I saw no point in keeping them in C. I have no problem with moving the contents of e.g. |
I would add that we really need to focus on stability – especially for I/O stuff, which has felt a bit rickety ever since the windows merge. My impression is that it's gradually been getting better, but I'm leery of introducing a large amount of churn in the I/O code at the risk of further destabilizing things until what we already have is really rock solid. |
I think what we should do is (1) design the API, (2) starting from what we have now, figure out what layer we need to write in C to best support it. "Best" includes making all ccalls from julia very straightforward. |
/cc @vtjnash
I'm pretty sure that this breaks the REPL on windows, which is why I didn't push it to master. Anyway, I'm working to replace readline in the REPL anyway, so that shouldn't be an issue soon.
I have a couple more changes in the works that build on this, which I'll push to this branch soon.
This helps #2816