-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Project Management v0.1 #203
Comments
Looks reasonable. I like this structure; it provides a nice mix between especially Rust's modules, but also Lua's module system. Would the |
The goal was to create something that is a bit simpler than Rusts method but without losing the ability to seperate functionalities. The design is also inspired by Typescript/Javascript. I think the mun.toml file will be required yes. WDYT @Wodann ? |
I don't see how we could not have a config file. We could do without the currently listed items for sure, but going forward we'll want to add settings such as:
Those will require a |
To add to my previous comment, we want to have full compile flag support alongside the |
That does make a lot of sense, for more independent libraries. Having an extensible |
That's definitely the goal. |
With beagle-lang I was planning on in the future adding a build system where I had build scripts in each of the modules that needed custom build scripts.
With this kind of structure, we can have modules that have more complex build scripts such as a module whose submodules are compiled for different platforms. Such as a module The structure would look something like this fun build(builder: Builder){
//A method which takes the name of the artifact which becomes the name of the binary and takes a lambda argument for decorating the artifact
builder.createArtifact("artifact_name"){
//A method which takes a lambda argument which returns dependency information. This can be used within a DSL for more complex stuff such as getting context about the current build session such as environment variables, machine information, etc
builder.addDependency{
//Logic for adding a dependency
}
}
} However, the same effect could be done with |
Interesting. It reminds me of the Unreal Build Tool. A |
One of the main reasons I want to use a configuration file (*.toml, or whatever) is that its easily machine readable. This makes it much easier for tools to parse as well without requiring a very complex setup. |
I've been tinkering with the implementation a bit. I currently run into this question: Currently, we have the |
Yes, we could do that by default. Two comments w.r.t. that plan:
|
@Wodann Ah cool, I'll add the I think we can add the |
All functionalities have landed in |
To support multi-file Mun libraries, we need to come up with a project management system that allows users to easily setup, build, and tweak packages.
A Mun project will look as follows:
The main directory contains a
src
directory andmun.toml
configuration file. All files in thesrc
directory are automatically added to the build tree. This is different from Rust in that you cannot/do not have to writemod a
in your source code.A sub-module can be created by either:
a
with amod.mun
file; ora.mun
file in the parent directory.To use a struct
Foo
, defined insrc/a/b.mun
, you can access it in the current file by writing:use a::b::Foo;
.By default, a type or function defined in a module is not accessible outside of its file and sub-modules. You can expand accessibility in three ways:
pub
: accessible within the package and externally (incl. marshalling to the host language)pub(package)
: accessible within the packagepub(super)
: accessible within parent module and its sub-modulesA
mun.toml
contains information about the package, similar to aCargo.toml
:Depends on
pub(...)
scope #248use
statement #249Improved by
TypeInfo
withTypeRef
in Runtime FFI #168Remaining issues moved to later milestones
The text was updated successfully, but these errors were encountered: