You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a suggestion from reading lots of posts about usages of julia and how things are getting out of hand when dealing with large projects. I suggest adding a new import statement as:
OtherModule =moduleimport("otherfile.jl") # as opposed to normal including it would first wrap the file in a module and the load the namespace # Syntax like "moduleimport("otherfile.jl") as Othermodule" could work too# Now the stuff from the "otherfile.jl" is not verbatim included but wrapped in a module same as python does
Othermodule.function1(x)
Othermodule.function2(x)
# It is obvious for people from other languages, and perhaps could be helpful for lspless codebrowsing.
Now, instead of this being a package or a macro, wouldn't this kind of syntax be a good practice for long-term for large project development where people don't wanna wanna wrap every file in a module manually:
module Othermodule
include("otherfile.jl") # people either have to add module...end insideendusing.Othermodule: function1, function2
vs having one-liner import at the top of the file (same like python)
using Package1, Package2
moduleimport("otherfile.jl"): function1, function2
moduleimport("otherfile2.jl"): function3 as f3, function4 as f4
The precise syntax is not of importance, but this is rather an idea how to promote a workflow that suits large codebases better. I wish if such syntax existed in core julia then lsp and other code solution could have a much easier time of discerning what is what and where is it coming form without relying on lsp too much.
This might be a simple macro or what not, but the purpose here is to promote such style of development in general without relying on 3rd party packages. This might touch upon issues like #4600#39235#42080 or merging import and using keywords. Feel free to delete this issue in case this is a dup or something like that.
The text was updated successfully, but these errors were encountered:
Pretty sure this was already discussed ad nauseam, and the conclusion is that such functionality could/should live in a user package (some examples exist). Personally, I much prefer having each Julia source file start with module explicitly.
Yeah I get that it is pretty easy to achieve this via 3rd party, but this if it is core julia then editor tools could take advantage of this extra information. Somehow I feel like unless it is standard julia nobody will conform to standard way of doing this and resort to like 10 different packages and lead to even more confusion. It is just julia allows to much freedom and not opinionated enough for these kind of things. Just my 5cents
Just a suggestion from reading lots of posts about usages of julia and how things are getting out of hand when dealing with large projects. I suggest adding a new import statement as:
Now, instead of this being a package or a macro, wouldn't this kind of syntax be a good practice for long-term for large project development where people don't wanna wanna wrap every file in a module manually:
vs having one-liner import at the top of the file (same like python)
The precise syntax is not of importance, but this is rather an idea how to promote a workflow that suits large codebases better. I wish if such syntax existed in core julia then lsp and other code solution could have a much easier time of discerning what is what and where is it coming form without relying on lsp too much.
This might be a simple macro or what not, but the purpose here is to promote such style of development in general without relying on 3rd party packages. This might touch upon issues like #4600 #39235 #42080 or merging
import
andusing
keywords. Feel free to delete this issue in case this is a dup or something like that.The text was updated successfully, but these errors were encountered: