Skip to content

Commit

Permalink
merge: Rewrite Aya using locally nameless and HOAS+JIT compilation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 authored May 27, 2024
2 parents a4a8add + b7fd016 commit 521a9ac
Show file tree
Hide file tree
Showing 988 changed files with 17,945 additions and 27,315 deletions.
22 changes: 11 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ ij_java_blank_lines_after_anonymous_class_header = 0
ij_java_blank_lines_after_class_header = 0
ij_java_blank_lines_after_imports = 1
ij_java_blank_lines_after_package = 1
ij_java_blank_lines_around_class = 1
ij_java_blank_lines_around_class = 0
ij_java_blank_lines_around_field = 0
ij_java_blank_lines_around_field_in_interface = 0
ij_java_blank_lines_around_initializer = 1
ij_java_blank_lines_around_method = 1
ij_java_blank_lines_around_method = 0
ij_java_blank_lines_around_method_in_interface = 0
ij_java_blank_lines_before_class_end = 0
ij_java_blank_lines_before_imports = 1
Expand All @@ -74,7 +74,7 @@ ij_java_class_brace_style = end_of_line
ij_java_class_count_to_use_import_on_demand = 5
ij_java_class_names_in_javadoc = 1
ij_java_do_not_indent_top_level_class_members = false
ij_java_do_not_wrap_after_single_annotation = false
ij_java_do_not_wrap_after_single_annotation = true
ij_java_do_while_brace_force = never
ij_java_doc_add_blank_line_after_description = true
ij_java_doc_add_blank_line_after_param_comments = false
Expand All @@ -98,7 +98,7 @@ ij_java_else_on_new_line = false
ij_java_enum_constants_wrap = off
ij_java_extends_keyword_wrap = off
ij_java_extends_list_wrap = off
ij_java_field_annotation_wrap = split_into_lines
ij_java_field_annotation_wrap = off
ij_java_finally_on_new_line = false
ij_java_for_brace_force = never
ij_java_for_statement_new_line_after_left_paren = false
Expand All @@ -111,10 +111,10 @@ ij_java_imports_layout = *,|,javax.**,java.**,|,$*
ij_java_indent_case_from_switch = true
ij_java_insert_inner_class_imports = false
ij_java_insert_override_annotation = true
ij_java_keep_blank_lines_before_right_brace = 2
ij_java_keep_blank_lines_between_package_declaration_and_header = 2
ij_java_keep_blank_lines_in_code = 2
ij_java_keep_blank_lines_in_declarations = 2
ij_java_keep_blank_lines_before_right_brace = 1
ij_java_keep_blank_lines_between_package_declaration_and_header = 1
ij_java_keep_blank_lines_in_code = 1
ij_java_keep_blank_lines_in_declarations = 1
ij_java_keep_control_statement_in_one_line = true
ij_java_keep_first_column_comment = true
ij_java_keep_indents_on_empty_lines = false
Expand Down Expand Up @@ -197,8 +197,8 @@ ij_java_space_before_type_parameter_list = false
ij_java_space_before_while_keyword = true
ij_java_space_before_while_left_brace = true
ij_java_space_before_while_parentheses = true
ij_java_space_inside_one_line_enum_braces = false
ij_java_space_within_empty_array_initializer_braces = false
ij_java_space_inside_one_line_enum_braces = true
ij_java_space_within_empty_array_initializer_braces = true
ij_java_space_within_empty_method_call_parentheses = false
ij_java_space_within_empty_method_parentheses = false
ij_java_spaces_around_additive_operators = true
Expand All @@ -216,7 +216,7 @@ ij_java_spaces_around_unary_operator = false
ij_java_spaces_within_angle_brackets = false
ij_java_spaces_within_annotation_parentheses = false
ij_java_spaces_within_array_initializer_braces = false
ij_java_spaces_within_braces = false
ij_java_spaces_within_braces = true
ij_java_spaces_within_brackets = false
ij_java_spaces_within_cast_parentheses = false
ij_java_spaces_within_catch_parentheses = false
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ out/
/.idea/modules/*
/.idea/shelf/*
/.idea/codeStyles/*
/.idea/copilot/*
/.idea/dictionaries/*
/.idea/.name
/.idea/inspectionProfiles/Project_Default.xml
/.idea/libraries/
/.gradle/
/.fleet/
/.vs/
Expand All @@ -22,5 +24,4 @@ lombok.config

/cli-*-all.jar
/tgbot-*-all.jar
imgui.ini
/diagram.uml
52 changes: 7 additions & 45 deletions base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang.
// Copyright (c) 2020-2024 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
import org.aya.gradle.CommonTasks
import org.aya.gradle.GenerateReflectionConfigTask
import org.aya.gradle.GenerateVersionTask

CommonTasks.nativeImageConfig(project)

dependencies {
api(project(":tools-kala"))
api(project(":syntax"))
api(project(":tools-md"))
api(project(":pretty"))
api(libs.aya.guest0x0)
implementation(libs.aya.commonmark)
implementation(libs.aya.ij.core)
// implementation(libs.manifold.delegate.runtime)
// annotationProcessor(libs.manifold.delegate.codegen)
testImplementation(project(":producer"))
testImplementation(libs.junit.params)
testImplementation(libs.junit.jupiter)
testImplementation(libs.hamcrest)
testImplementation(project(":cli-impl"))
testImplementation(project(":ide"))
}

plugins {
id("org.graalvm.buildtools.native")
// testAnnotationProcessor(libs.manifold.delegate.codegen)
}

val genDir = file("src/main/gen")
Expand All @@ -31,42 +21,14 @@ val generateVersion = tasks.register<GenerateVersionTask>("generateVersion") {
}

idea.module.generatedSourceDirs.add(genDir)
sourceSets.main {
java.srcDirs(genDir)
}
sourceSets.main { java.srcDirs(genDir) }

tasks.compileJava { dependsOn(generateVersion) }
tasks.sourcesJar { dependsOn(generateVersion) }
tasks.withType<GenerateReflectionConfigTask>().configureEach {
extraDir = file("src/main/java/org/aya/core/serde")
classPrefixes = listOf("SerTerm", "SerPat", "SerDef", "CompiledAya")
excludeNamesSuffix = listOf("SerTerm\$DeState", "CompiledAya\$CompiledAya", "CompiledAya\$Serialization")
packageName = "org.aya.core.serde"
}

val cleanGenerated = tasks.register("cleanGenerated") {
group = "build"
genDir.deleteRecursively()
}

tasks.named("clean") { dependsOn(cleanGenerated) }

tasks.named<Test>("test") {
testLogging.showStandardStreams = true
testLogging.showCauses = true
inputs.dir(projectDir.resolve("src/test/resources"))
}

tasks.register<JavaExec>("runCustomTest") {
group = "Execution"
classpath = sourceSets.test.get().runtimeClasspath
mainClass.set("org.aya.test.TestRunner")
}

graalvmNative {
CommonTasks.nativeImageBinaries(
project, javaToolchains, this,
false,
true
)
}
63 changes: 0 additions & 63 deletions base/reflect-config.txt

This file was deleted.

47 changes: 10 additions & 37 deletions base/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,49 +1,22 @@
module aya.base {
requires transitive aya.md;
requires transitive aya.pretty;
requires transitive aya.util;
requires transitive aya.util.more;
requires transitive aya.guest.cubical;
requires transitive kala.base;
requires transitive kala.collection;
requires transitive aya.syntax;

requires static org.jetbrains.annotations;

requires aya.ij.parsing.core;
requires org.commonmark;
// requires manifold.delegation.rt;

exports org.aya.concrete.desugar;
exports org.aya.concrete.error;
exports org.aya.concrete.remark;
exports org.aya.concrete.stmt.decl;

exports org.aya.concrete.stmt;
exports org.aya.concrete.visitor;
exports org.aya.concrete;
exports org.aya.core.def;
exports org.aya.core.meta;
exports org.aya.core.ops;
exports org.aya.core.pat;
exports org.aya.core.repr;
exports org.aya.core.serde;
exports org.aya.core.term;
exports org.aya.core.visitor;
exports org.aya.core;
exports org.aya.prettier;
exports org.aya.generic.util;
exports org.aya.generic;
exports org.aya.tyck.tycker;
exports org.aya.normalize;
exports org.aya.prelude;
exports org.aya.ref;
exports org.aya.primitive;
exports org.aya.resolve.context;
exports org.aya.resolve.error;
exports org.aya.resolve.module;
exports org.aya.resolve.salt;
exports org.aya.resolve.visitor;
exports org.aya.resolve;
exports org.aya.tyck.env;
exports org.aya.tyck.ctx;
exports org.aya.tyck.error;
exports org.aya.tyck.order;
exports org.aya.tyck.pat;
exports org.aya.tyck.trace;
exports org.aya.tyck.unify;
exports org.aya.tyck.tycker;
exports org.aya.tyck;
exports org.aya.unify;
exports org.aya.resolve.error;
}
Loading

0 comments on commit 521a9ac

Please sign in to comment.