ta0kira / zeolite

Zeolite is a statically-typed, general-purpose programming language.
Apache License 2.0
18 stars 0 forks source link

Allow output of multiple binaries per module. #3

Closed ta0kira closed 3 years ago

ta0kira commented 4 years ago

The main reason to allow this, vs. requiring one module per binary, is to allow multiple binaries to utilize the same private code, whether it's in the same .0rx or in $ModuleOnly$ sources. The current compromise would be to hide that code in a submodule with a name like internal.

This is probably an easy fix, but it will require turning CompileBinary into a list. Or, just making CompileBinary a separate object and then updating (and renaming) CompileIncremental to contain a list of CompileBinary.

ta0kira commented 4 years ago

Another option is to add a procedure pragma to indicate a function to use for a binary.

concrete MyBinary {
  @type run () -> ()
}

define MyBinary {
  run () { $CreateBinary["MyBinary"]$
    // ...
  }
}

The main issue here are:

ta0kira commented 3 years ago

I'll reopen this if it turns out to be problematic.