Skip to content

Commit 70173bf

Browse files
committed
* Separated a GlobalOptions module
* Removed astronomers specific rules * Removed types from the astronomer rules. * Learned: It's not always a great thing to denormalize data, it leads to inconsistency opportunities. An instance of premature optimization likely. Now I'm questioning why .ll does this. * Added better humanizing of errors * Added a MUCH better solver error printer * Brought back the distinction between declaration names and imprecise names * Made a better distinction between drop and free * Fixed build failure counting bug in Tester * Took out localRunes and knowableRunes from Astronomer, moved some of that logic back into astronomer. * Learned: It's not always a great thing to pull as much logic as possible out of Templar. In this case, reducing the amount of code in Templar actually increased its complexity, ironically. * Changed some astronomer tests into integration tests, feeding actual vale source code now. * Learned: Unit tests have a high cost in maintaining the inputs. Perhaps unit tests only make sense on very established chunks of code. * Moved a bunch of hardcoded functions (weaks, drop, free, array len, panic) to actual vale code. * Made tuple an extern struct, using variadic members. * We now internally support variadic members! * Made a functor struct, to give to the array instructions, since they need a 'this' object basically * Removed special PackTT type. * Took out `all` function, pulled into a separate Collector class * Added the "macro" concept, for any syntactical sugar features (or semantic sugar? like anonymous substructs, theyre kind of semantic sugar I guess?) * Moved drop functions into macros. * Moved anonymous substruct functionality into macros. * Better distinction between a template name and a stamped name, see CitizenNameT vs CitizenTemplateNameT. * Fixed types starting with _, like __Never * Added free() functions for interfaces, which then call virtualfree(). Now, there is a normal free() function for every immutable type. * Fixed printing exceptions twice in tests * Added a "Location In Function" notion, so places in the code are marked by tree-shaped paths * Made impl rules sane again, no more NMORFI! Breaking changes: - Void's name changed from Tup0_0 to Tup0 - To define abstract functions outside an interface, now need `sealed` on the interface - To make custom destructors, need #!DeriveStructDrop now, and it's called `drop` not `destructor`. - All parameters need a type. `fn do(callable)` -> `fn do<F>(callable F)`
1 parent 5bcca34 commit 70173bf

File tree

290 files changed

+14695
-21968
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+14695
-21968
lines changed

Midas/src/c-compiler/globalstate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ class GlobalState {
181181
return numMetalMethods + i;
182182
}
183183
}
184+
std::cerr << "Couldn't find method " << prototype->name->name << " in interface " << interfaceKindM->fullName->name << std::endl;
184185
assert(false);
185186
}
186187

Midas/src/c-compiler/metal/readjson.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ StructDefinition* readStruct(MetalCache* cache, const json& struuct) {
587587
struuct["weakable"] ? Weakability::WEAKABLE : Weakability::NON_WEAKABLE);
588588

589589
auto structName = result->name;
590-
if (structName->name == std::string("Tup0_0")) {
590+
if (structName->name == std::string("Tup_0")) {
591591
cache->emptyTupleStruct = cache->getStructKind(structName);
592592
cache->emptyTupleStructRef =
593593
cache->getReference(Ownership::SHARE, Location::INLINE, cache->emptyTupleStruct);

Midas/src/c-compiler/region/rcimm/rcimm.cpp

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -702,34 +702,8 @@ void RCImm::discard(
702702
buildFlare(from, globalState, functionState, thenBuilder, "Freeing shared str!");
703703
innerDeallocate(from, globalState, functionState, &kindStructs, thenBuilder, sourceMT, sourceRef);
704704
});
705-
} else if (auto interfaceRnd = dynamic_cast<InterfaceKind *>(sourceRnd)) {
706-
buildFlare(FL(), globalState, functionState, builder);
707-
assert(sourceMT->ownership == Ownership::SHARE);
708-
if (sourceMT->location == Location::INLINE) {
709-
assert(false); // impl
710-
} else {
711-
auto rcLE =
712-
adjustStrongRc(
713-
from, globalState, functionState, &kindStructs, builder, sourceRef, sourceMT, -1);
714-
buildIf(
715-
globalState, functionState,
716-
builder,
717-
isZeroLE(builder, rcLE),
718-
[globalState, functionState, sourceRef, interfaceRnd, sourceMT](
719-
LLVMBuilderRef thenBuilder) {
720-
auto immDestructor = globalState->program->getImmDestructor(sourceMT->kind);
721-
722-
// auto virtualArgRefMT = functionType->params[virtualParamIndex];
723-
// auto virtualArgRef = argsLE[virtualParamIndex];
724-
int indexInEdge = globalState->getInterfaceMethodIndex(interfaceRnd, immDestructor);
725-
auto methodFunctionPtrLE =
726-
globalState->getRegion(sourceMT)
727-
->getInterfaceMethodFunctionPtr(functionState, thenBuilder, sourceMT, sourceRef, indexInEdge);
728-
buildInterfaceCall(
729-
globalState, functionState, thenBuilder, immDestructor, methodFunctionPtrLE, {sourceRef}, 0);
730-
});
731-
}
732-
} else if (dynamic_cast<StructKind *>(sourceRnd) ||
705+
} else if (dynamic_cast<InterfaceKind *>(sourceRnd) ||
706+
dynamic_cast<StructKind *>(sourceRnd) ||
733707
dynamic_cast<StaticSizedArrayT *>(sourceRnd) ||
734708
dynamic_cast<RuntimeSizedArrayT *>(sourceRnd)) {
735709
buildFlare(FL(), globalState, functionState, builder);

Tester/src/main.vale

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ fn FinishTests(suite &!TestSuite, until_this_many_left int) {
349349
println("stderr:");
350350
println(build_result.stderr);
351351
}
352+
set suite.num_failures = suite.num_failures + 1;
352353
} else {
353354
program_name = if (IsWindows()) { "main.exe" } else { "main" };
354355
run_program = test_build_dir./(program_name).str();

Valestrom/.idea/codeStyles/Project.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Valestrom/.idea/modules.xml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Valestrom/Astronomer/Astronomer.iml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
<orderEntry type="module" module-name="Utils" />
1616
<orderEntry type="library" name="org.scalatest:scalatest_2.12:3.0.8" level="project" />
1717
<orderEntry type="library" name="scala-sdk-2.12.6" level="application" />
18+
<orderEntry type="module" module-name="Solver" />
19+
<orderEntry type="module" module-name="Options" />
1820
</component>
1921
</module>

0 commit comments

Comments
 (0)