Code isolation side discussion

It seems to me that:

This is a security liability for the language, meaning it can not be used in anything critical.

Which is another reason why I think that some form of isolation like I proposed in contextual dispatch, is the only way forward.

In the mean time parallel compilation and caching ”moar” things will improve usability for sure, but probably will not change the state of the community and language much.

This makes no sense. You are running arbitrary code in the same process anyway. Please don’t spread misinformation like this.


If that were true, no programs written in C would be acceptable since you can overwrite arbitrary memory. One of the biggest failings of java et. al. is the idea that code being run in process needs protection from itself.

What do you mean by isolation here? Would this be doable while retaining the composability, which is one of the foremost strengths of the language? Or are you just referring to type piracy?

Well, I didn’t ask about that. I asked if this might impact composability. Prohibiting type piracy doesn’t sound so terrible, but package ‘isolation’ and contextual dispatch sounds as though they might affect that.

In this context, I think the right way to think about it is “type piracy is just loading code in the wrong order.” While it should generally be avoided, there are legitimate cases for this. The classic case is ColorVectorSpace, which provides operations on colors that are “wrong” from the standpoint of exact colorimetry but which are nevertheless widely used in the image-processing world. Because the “purists” rightfully objected to them being in the same package as the non-offensive definitions and methods, we split them into two packages.

There are other cases of internal piracy. For example,consider a package that defines some useful types and methods, for which there’s a simple implementation of an algorithm and a vastly more optimal one that also introduces huge, often-undesirable dependencies. The package could define the simple implementation to be used by default, and put the more sophisticated version under a @require. In that case it’s not technically piracy because it’s all in the same package, but it does mean that you might end up redefining internal methods depending on what other modules are loaded.

When you think about it as a question of “what order does code get loaded in?” it makes it a purely pragmatic (as opposed to moral high horse :smile:) problem. I don’t think the answer is to erect all sorts of barriers that prevent people from getting their work done. The answer is (1) to develop tools that allow one to detect and diagnose problems (“what’s causing my slow compilation?”) and (2) design packages so that load-ordering problems crop up extremely rarely. When we agree that there are reasons for wonky ordering, we just accept that as a cost of getting those other things we want. If people just can’t agree on a common set of goals, then we have multiple packages optimized for different use cases.


Why did you replace your posts in this topic with nonsense?

This is somewhat disruptive, and makes it difficult for future readers who come across these posts to reconstruct these discussions.


I don’t think this is acceptable behaviour, frankly. It’s good that people can edit their posts, but this is abusing that right.

I didn’t move my posts, and it wasn’t my intention to open a discussion on code isolation.
So since I felt abused and rejected, I tried to delete my posts… It took me some time to find a way to remove my posts.

Having a side discussion split off and moved to a different topic is pretty normal, and should not be seen as an insult. Maybe you could ask for this thread to be locked, but deleting content like this is counterproductive, imho. At this point, the thread is rendered worthless.


Just by way of an analogy: Let’s say you’re with a group of people over a board game, and the game goes south for you. Maybe you’d excuse yourself and say you lost interest, but you wouldn’t stand up and sweep the board off the table, would you?

I understand the purpose of splitting a too long topic, or a diverged one (although the nature of fruitful discussions is to diverge , sometimes more than once).

This incident felt much more personal… more like fencing a discussion with a certain individual.

I apologize if it harmed a discussion you actually tried to make with the community about code isolation.
But if it did, you can re-open it and I will chime in if I feel there is information of insight within me that can contribute.

Well, no I was mostly curious about what code isolation actually means, and what consequences it might have. I had no previous interest, but it sounds like a worthy topic.

If you feel that the topic splitting is part of a pattern, I hope you will be able to clear it up with the moderators. I’m not sure exactly what the best approach is, unfortunately.

1 Like

I have restored your posts to their original content so that this discussion can be seen as it occurred. There was nothing personal about splitting this discussion off—it was requested both on the original thread and on slack that this side discussion be split off as it was fairly tangential from the original topic (compiler performance of dicts).

1 Like

I will quickly chime in here to say I do think there is a place for isolated modules as a separate feature. We don’t need to disallow type piracy; we just need some way to mark some code as “fully baked” and no longer extending or getting extended by anyone else. The module Core.Compiler is already largely like this, and we would also like to use it to replace the parser with one written in julia.

This is useful, but it’s not a generic solution to latency problems, since interactively loading type-pirating modules is still something you want a lot of the time.