@@ -108,7 +108,99 @@ pub const main = fn () int {
108108}
109109```
110110
111- ## Build System Integration
111+ ## impl and its unique features
112+ # simple example
113+ impl [ func list...] -> [ struct list...] {
114+ if (1 > 0) {
115+ define a function one way
116+ } else {
117+ define the same function another way
118+ }
119+ }
120+ # The goals of the impl is to implement functions for structs.
121+ # It should have the ability to conditionally make functions.
122+ # The functions are ` injected ` into the struct and can reference
123+ # ` self ` which is a pointer to the struct AstNode that should already be there.
124+ # There should be two types of functions for this instance. Runtime ready, and compile time optional.
125+ # with a tag of #runtime, the function will be compiled and optionally ran during runtime.
126+ # two instances of the same function can only run one at a time, and must be derived from an expression.
127+ # a #compile tag from a function within a conditional will be optionally compiled, and so only one available at runtime.
128+ # Why the two? One use case for @run_time is to allow dynamic function assignment. Lets say you must work with an api.
129+ # This api does not respond with the same data, same type of data and so on. This means you can write multiple capture() functions.
130+ # Yes this is function overloading, but conditionally, and can be programmed for the potential context the appliction will be in.
131+ # For @compile_time, it optionally compiles one of the implementations of the function. Say you need portability, you can use the same
132+ # source code and target specific architectures. This can be thought of #IF_WINDOWS bullshit from C, you can conditionaly compile
133+ # one function or another, but in a nice and effecient way.
134+
135+ ## the ? and None type
136+ someType: ?; # is a None, or a real type.
137+ # Thats what it does. Gives a way to init without a type. Can also be used to identify things. if (someType? == None) {return "Nothing found";}
138+ # It is our solution to NULL, but it provides a more meaning. Because it can also be a value if (someType?) {return "value found";}
139+ # This is very straigh forward in its concept. someType? returns the value inside, or it returns the None type.
140+
141+ ## the set type
142+ # A set is a fixed sized array of types
143+ # a, b, c : (int, float, char);
144+ # const func1 = fn () (int, float, int) {}
145+ # The same thing.
146+ # a, b, c : () = func1;
147+ # changes the the position for the returning set.
148+ # a, b, c : (float, int, int) = func1;
149+ # The () is here to be explicit that we are expecting a set from func1.
150+
151+ ## Luma Post-Processing and Build System (LPBS).
152+ # LPBS is made in Luma and uses a subset (vars, funcs, if (expr)).
153+
154+ // -V2 : verbose level 2 for strictness?
155+ // -OB : object files
156+ cc_o = luma-1 -OB -V2;
157+
158+ // -x86_64 could be used to verify the executable and compatability for translate()
159+ cc = luma-1 -O3 -x86_64;
160+
161+ // the output for artefacts and exe
162+ output = "bin/";
163+
164+ src_files = {
165+ if (check_dir_exists("src/")) {
166+ -> ("main.lx", "src/* lx");
167+ }
168+ -> ("main.lx");
169+ }
170+
171+ compile:
172+ output("Getting internal and external libraries\n");
173+ get_libs -> () {
174+ path_ex = find_external("raylib", "opengl");
175+ path_in = find_internal("std::math", "std::stl::stack", "std::net::network");
176+ return path_ex, path_in;
177+ }
178+
179+ libs, clibs = get_libs();
180+
181+ get_obj -> (cc, src_files, libs, clibs) {
182+ output("Getting luma obj files\n");
183+ obj_files = cc_o src_files -l libs;
184+ output("Getting external library obj files\Combining all obj files\n");
185+ return obj_files + translate(clibs);
186+ }
187+ // compiler, obj files, to where
188+ output("Compiling program\n");
189+ compile(cc, get_obj(), output);
190+ output("Compiled, output: ", output);
191+
192+ clean:
193+ clean_all -> (where) {
194+ remove(output);
195+ output("Removed all artefacts\n");
196+ }
197+
198+ # compile: and clean: are labels, there are the external commands a user can run (lpbs compile, lpbs clean).
199+ # Lets break it down. Post-Processing is about understanding end context from the src code and a solution.
200+ # The LPB System should generate bindings for the end result.
201+ # It should manage ffi for C and providing that compatability.
202+ # It should provide a way to create, manage, and work with shared libraries or static libraries.
203+ # Then it should build the program, it should read in a simp
112204
113205### Manual Binding Generation
114206``` bash
0 commit comments