diff --git a/.idea/libraries/github_hypfvieh_dbus_java.xml b/.idea/libraries/github_hypfvieh_dbus_java.xml deleted file mode 100644 index 9f4782a7d..000000000 --- a/.idea/libraries/github_hypfvieh_dbus_java.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/glassfish_javax_json.xml b/.idea/libraries/glassfish_javax_json.xml deleted file mode 100644 index 00e6491ae..000000000 --- a/.idea/libraries/glassfish_javax_json.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/michael_bull_kotlin_result_jvm.xml b/.idea/libraries/michael_bull_kotlin_result_jvm.xml index 11230d9b2..0d81dcdb8 100644 --- a/.idea/libraries/michael_bull_kotlin_result_jvm.xml +++ b/.idea/libraries/michael_bull_kotlin_result_jvm.xml @@ -1,13 +1,10 @@ - + - - - + + - - diff --git a/.idea/libraries/slf4j_simple.xml b/.idea/libraries/slf4j_simple.xml deleted file mode 100644 index 3a79a9504..000000000 --- a/.idea/libraries/slf4j_simple.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/takes.xml b/.idea/libraries/takes.xml deleted file mode 100644 index 2fe59bf7c..000000000 --- a/.idea/libraries/takes.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 3c685039d..347a298f4 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -10,10 +10,8 @@ - - diff --git a/codeCore/build.gradle b/codeCore/build.gradle index a4a1d97a3..f9a5dd8e0 100644 --- a/codeCore/build.gradle +++ b/codeCore/build.gradle @@ -26,7 +26,7 @@ compileTestKotlin { dependencies { // should have no dependencies to other modules implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" } sourceSets { diff --git a/codeGenCpu6502/build.gradle b/codeGenCpu6502/build.gradle index 7f9ea6ce7..7908120a3 100644 --- a/codeGenCpu6502/build.gradle +++ b/codeGenCpu6502/build.gradle @@ -1,4 +1,3 @@ - plugins { id 'java' id 'application' @@ -27,7 +26,7 @@ dependencies { implementation project(':codeCore') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" // implementation "org.jetbrains.kotlin:kotlin-reflect" - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" testImplementation 'io.kotest:kotest-runner-junit5-jvm:5.8.0' testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' diff --git a/codeGenExperimental/build.gradle b/codeGenExperimental/build.gradle index 7fffb5b8f..9ca1f71ff 100644 --- a/codeGenExperimental/build.gradle +++ b/codeGenExperimental/build.gradle @@ -29,7 +29,7 @@ dependencies { implementation project(':codeGenIntermediate') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" // implementation "org.jetbrains.kotlin:kotlin-reflect" - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" } diff --git a/codeGenIntermediate/build.gradle b/codeGenIntermediate/build.gradle index 70466eea8..7511c96ae 100644 --- a/codeGenIntermediate/build.gradle +++ b/codeGenIntermediate/build.gradle @@ -28,7 +28,7 @@ dependencies { implementation project(':intermediate') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" // implementation "org.jetbrains.kotlin:kotlin-reflect" - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" testImplementation 'io.kotest:kotest-runner-junit5-jvm:5.8.0' testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' diff --git a/codeOptimizers/build.gradle b/codeOptimizers/build.gradle index b5f3b6b5e..4cf1df8dc 100644 --- a/codeOptimizers/build.gradle +++ b/codeOptimizers/build.gradle @@ -27,7 +27,7 @@ dependencies { implementation project(':codeCore') implementation project(':compilerAst') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" // implementation "org.jetbrains.kotlin:kotlin-reflect" } diff --git a/compiler/build.gradle b/compiler/build.gradle index d4c73329d..64a59f261 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -36,7 +36,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" // implementation "org.jetbrains.kotlin:kotlin-reflect" implementation 'org.jetbrains.kotlinx:kotlinx-cli:0.3.6' - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" testImplementation project(':codeCore') testImplementation project(':intermediate') diff --git a/compilerAst/build.gradle b/compilerAst/build.gradle index 8403027c8..15ce16cb6 100644 --- a/compilerAst/build.gradle +++ b/compilerAst/build.gradle @@ -25,7 +25,7 @@ dependencies { implementation project(':codeCore') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" implementation "org.antlr:antlr4-runtime:4.13.1" - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" implementation project(':parser') } diff --git a/dbusCompilerService/build.gradle b/dbusCompilerService/build.gradle deleted file mode 100644 index 4385596c3..000000000 --- a/dbusCompilerService/build.gradle +++ /dev/null @@ -1,84 +0,0 @@ - -plugins { - id 'java' - id 'application' - id "org.jetbrains.kotlin.jvm" - id 'com.github.johnrengelman.shadow' version '8.1.1' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(javaVersion) - } -} - -compileKotlin { - kotlinOptions { - jvmTarget = javaVersion - } -} - -compileTestKotlin { - kotlinOptions { - jvmTarget = javaVersion - } -} - -dependencies { - implementation project(':codeCore') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - // implementation "org.jetbrains.kotlin:kotlin-reflect" - implementation 'org.jetbrains.kotlinx:kotlinx-cli:0.3.6' - implementation "com.github.hypfvieh:dbus-java:3.3.2" - implementation "org.slf4j:slf4j-simple:2.0.9" -} - -configurations.all { - exclude group: 'com.ibm.icu', module: 'icu4j' - exclude group: "org.antlr", module: "antlr4" -} - -sourceSets { - main { - java { - srcDir "${project.projectDir}/src" - } - resources { - srcDir "${project.projectDir}/res" - } - } - test { - java { - srcDir "${project.projectDir}/test" - } - } -} - -startScripts.enabled = true - -application { - mainClass = 'prog8.dbus.DbusserverKt' - applicationName = 'prog8compilerservicedbus' -} - -shadowJar { - archiveBaseName = 'prog8compilerservicedbus' - archiveVersion = '1.0' - // minimize() -} - - -test { - // Enable JUnit 5 (Gradle 4.6+). - useJUnitPlatform() - - // Always run tests, even when nothing changed. - dependsOn 'cleanTest' - - // Show test results. - testLogging { - events "skipped", "failed" - } -} - -build.finalizedBy installDist, installShadowDist diff --git a/dbusCompilerService/dbusCompilerService.iml b/dbusCompilerService/dbusCompilerService.iml deleted file mode 100644 index fd3b86a9d..000000000 --- a/dbusCompilerService/dbusCompilerService.iml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dbusCompilerService/src/prog8/dbus/IrmenDbusTest.kt b/dbusCompilerService/src/prog8/dbus/IrmenDbusTest.kt deleted file mode 100644 index 999c4261a..000000000 --- a/dbusCompilerService/src/prog8/dbus/IrmenDbusTest.kt +++ /dev/null @@ -1,28 +0,0 @@ -package prog8.dbus - -import org.freedesktop.dbus.annotations.IntrospectionDescription -import org.freedesktop.dbus.interfaces.DBusInterface - - -const val serviceObjectPath = "/razorvine/TestService" - - -interface IrmenDbusTest: DBusInterface -{ - @IntrospectionDescription("return some sort of status") - fun Status(address: String): Map -} - - -internal class TestService: IrmenDbusTest { - - override fun Status(address: String): Map { - return mapOf( - 5 to "hello", - 42 to address - ) - } - - override fun isRemote() = true - override fun getObjectPath() = serviceObjectPath -} diff --git a/dbusCompilerService/src/prog8/dbus/clientmain.kt b/dbusCompilerService/src/prog8/dbus/clientmain.kt deleted file mode 100644 index a41d7a804..000000000 --- a/dbusCompilerService/src/prog8/dbus/clientmain.kt +++ /dev/null @@ -1,57 +0,0 @@ -package prog8.dbus - - -import org.freedesktop.dbus.connections.impl.DBusConnection -import org.freedesktop.dbus.exceptions.DBusExecutionException -import org.freedesktop.dbus.interfaces.DBusInterface - -/* - -Inspect the dbus services interactively via the qdbusviewer tool. - - -Command line access is also possible with: - -$ dbus-send --session --dest=local.net.razorvine.prog8.dbus --type=method_call --print-reply /razorvine/TestService prog8.dbus.IrmenDbusTest.Status string:"hello world" - -$ qdbus --literal local.net.razorvine.prog8.dbus /razorvine/TestService Status string:"hello world" - -$ gdbus call --session -d local.net.razorvine.prog8.dbus -o /razorvine/TestService --method prog8.dbus.IrmenDbusTest.Status string:"hello world" - -Or with the dasbus python library: - - from dasbus.connection import SessionMessageBus - from dasbus.identifier import DBusServiceIdentifier - - PROG8_SERVICE = DBusServiceIdentifier( - namespace=("local", "net", "razorvine", "prog8", "dbus"), - message_bus=SessionMessageBus() - ) - - proxy = PROG8_SERVICE.get_proxy("/razorvine/TestService") - print(proxy.Status("hello world")) - - - */ - -inline fun DBusConnection.getRemote(busname: String, objectpath: String): I = - this.getRemoteObject(busname, objectpath, I::class.java) - -inline fun DBusConnection.getPeerRemote(busname: String, objectpath: String): I = - this.getPeerRemoteObject(busname, objectpath, I::class.java) - - -fun main() { - DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use { - - try { - - val obj = it.getRemote("local.net.razorvine.prog8.dbus", serviceObjectPath) - println(obj.Status("irmen")) - - } catch (dx: DBusExecutionException) { - println("DBUS ERROR! $dx") - } - } -} - diff --git a/dbusCompilerService/src/prog8/dbus/dbusserver.kt b/dbusCompilerService/src/prog8/dbus/dbusserver.kt deleted file mode 100644 index 397fcef2c..000000000 --- a/dbusCompilerService/src/prog8/dbus/dbusserver.kt +++ /dev/null @@ -1,24 +0,0 @@ -package prog8.dbus - -import org.freedesktop.dbus.connections.impl.DBusConnection - - -fun main() { - val busname = "local.net.razorvine.prog8.dbus" - - DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use { - it.requestBusName(busname) - println("connection names : ${it.names.toList()}") - println("connection unique name : ${it.uniqueName}") - println("connection address : ${it.address}") - println("connection machine id : ${it.machineId}") - println("bus name for clients : $busname") - println("object path for clients : $serviceObjectPath") - - val service = TestService() - it.exportObject(service.objectPath, service) - - Thread.sleep(100000) - it.releaseBusName(busname) - } -} diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 7be1af753..693cf831a 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,8 +1,6 @@ TODO ==== -replace Takes by Http4k in httpCompilerService project. https://github.com/http4k/examples/blob/master/hello-world/README.md - ... diff --git a/examples/test.p8 b/examples/test.p8 index e0ed6aee1..4a075439b 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -3,25 +3,24 @@ main { sub start() { - monogfx.lores() + monogfx.hires() monogfx.drawmode(monogfx.MODE_INVERT) ubyte tt repeat { ubyte tts=tt - word x1 = math.sin8(tts) / 2 - byte y1 = math.cos8(tts) / 2 + word x1 = math.sin8(tts) + word y1 = math.cos8(tts) tts += 256/3 - word x2 = math.sin8(tts) / 2 - byte y2 = math.cos8(tts) / 2 + word x2 = math.sin8(tts) + word y2 = math.cos8(tts) tts += 256/3 - word x3 = math.sin8(tts) / 2 - byte y3 = math.cos8(tts) / 2 - monogfx.line(160+x1 as uword, 120+y1 as ubyte, 160+x2 as uword, 120+y2 as ubyte, true) - monogfx.line(160+x2 as uword, 120+y2 as ubyte, 160+x3 as uword, 120+y3 as ubyte, true) - monogfx.line(160+x3 as uword, 120+y3 as ubyte, 160+x1 as uword, 120+y1 as ubyte, true) - sys.waitvsync() + word x3 = math.sin8(tts) + word y3 = math.cos8(tts) + monogfx.line(320+x1*2 as uword, 240+y1 as uword, 320+x2 as uword, 240+y2 as uword, true) + monogfx.line(320+x2*2 as uword, 240+y2 as uword, 320+x3 as uword, 240+y3 as uword, true) + monogfx.line(320+x3*2 as uword, 240+y3 as uword, 320+x1 as uword, 240+y1 as uword, true) tt++ } } diff --git a/httpCompilerService/build.gradle b/httpCompilerService/build.gradle deleted file mode 100644 index 9c63cccb5..000000000 --- a/httpCompilerService/build.gradle +++ /dev/null @@ -1,87 +0,0 @@ - -plugins { - id 'java' - id 'application' - id "org.jetbrains.kotlin.jvm" - id 'com.github.johnrengelman.shadow' version '8.1.1' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(javaVersion) - } -} - -compileKotlin { - kotlinOptions { - jvmTarget = javaVersion - } -} - -compileTestKotlin { - kotlinOptions { - jvmTarget = javaVersion - } -} - -dependencies { - implementation project(':codeCore') - implementation project(':compiler') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - // implementation "org.jetbrains.kotlin:kotlin-reflect" - implementation 'org.jetbrains.kotlinx:kotlinx-cli:0.3.6' - implementation "org.takes:takes:1.24.4" - implementation "javax.json:javax.json-api:1.1.4" - implementation "org.glassfish:javax.json:1.1.4" - implementation "org.slf4j:slf4j-simple:2.0.11" -} - -configurations.all { - exclude group: 'com.ibm.icu', module: 'icu4j' - exclude group: "org.antlr", module: "antlr4" -} - -sourceSets { - main { - java { - srcDir "${project.projectDir}/src" - } - resources { - srcDir "${project.projectDir}/res" - } - } - test { - java { - srcDir "${project.projectDir}/test" - } - } -} - -startScripts.enabled = true - -application { - mainClass = 'prog8.http.TestHttpKt' - applicationName = 'prog8compilerservicehttp' -} - -shadowJar { - archiveBaseName = 'prog8compilerservicehttp' - archiveVersion = '1.0' - // minimize() -} - - -test { - // Enable JUnit 5 (Gradle 4.6+). - useJUnitPlatform() - - // Always run tests, even when nothing changed. - dependsOn 'cleanTest' - - // Show test results. - testLogging { - events "skipped", "failed" - } -} - -build.finalizedBy installDist, installShadowDist diff --git a/httpCompilerService/httpCompilerService.iml b/httpCompilerService/httpCompilerService.iml deleted file mode 100644 index a3c2e5708..000000000 --- a/httpCompilerService/httpCompilerService.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/httpCompilerService/src/prog8/http/TestHttp.kt b/httpCompilerService/src/prog8/http/TestHttp.kt deleted file mode 100644 index cb0c50af0..000000000 --- a/httpCompilerService/src/prog8/http/TestHttp.kt +++ /dev/null @@ -1,74 +0,0 @@ -package prog8.http - -import org.takes.Request -import org.takes.Response -import org.takes.Take -import org.takes.facets.fork.FkMethods -import org.takes.facets.fork.FkRegex -import org.takes.facets.fork.TkFork -import org.takes.http.Exit -import org.takes.http.FtBasic -import org.takes.rq.form.RqFormBase -import org.takes.rs.RsJson -import org.takes.tk.TkSlf4j -import prog8.compiler.CompilerArguments -import prog8.compiler.compileProgram -import javax.json.Json -import kotlin.io.path.Path - - -class Jsonding: RsJson.Source { - override fun toJson(): javax.json.JsonStructure { - return Json.createObjectBuilder() - .add("name", "irmen") - .build() - } -} - -class RequestParser : Take { - override fun act(request: Request): Response { - val form = RqFormBase(request) - // val names = form.names() - val a = form.param("a").single() - val args = CompilerArguments( - Path(a), - optimize = true, - writeAssembly = true, - warnSymbolShadowing = false, - compilationTarget = "c64", - symbolDefs = emptyMap(), - quietAssembler = false, - includeSourcelines = false, - asmListfile = false, - experimentalCodegen = false, - splitWordArrays = false, - breakpointCpuInstruction = null, - printAst1 = false, - printAst2 = false, - varsHighBank = null, - varsGolden = false, - slabsHighBank = null, - slabsGolden = false, - dumpVariables = false - ) - compileProgram(args) - return RsJson(Jsonding()) - } -} - -fun main() { - FtBasic( - TkSlf4j( - TkFork( - FkRegex("/", "hello, world!"), - FkRegex("/json", - TkFork( - FkMethods("GET", RsJson(Jsonding())), - FkMethods("POST", RequestParser()) - ) - ), - ) - ), - 8080 - ).start(Exit.NEVER) -} diff --git a/scripts/clean.sh b/scripts/clean.sh index cc8d891d7..ad37a1ad9 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -2,5 +2,5 @@ rm -f *.bin *.xex *.jar *.asm *.prg *.vm.txt *.vice-mon-list *.list *.p8ir a.out imgui.ini rm -rf build out -rm -rf compiler/build codeGenCpu6502/build codeGenExperimental/build codeGenIntermediate/build intermediate/build virtualmachine/build codeOptimizers/build compilerAst/build dbusCompilerService/build httpCompilerService/build parser/build parser/src/prog8/parser +rm -rf compiler/build codeGenCpu6502/build codeGenExperimental/build codeGenIntermediate/build intermediate/build virtualmachine/build codeOptimizers/build compilerAst/build parser/build parser/src/prog8/parser diff --git a/settings.gradle b/settings.gradle index 04a20a70c..c68f1b9b6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,7 +8,5 @@ include( ':codeGenIntermediate', ':codeGenCpu6502', ':codeGenExperimental', - ':compiler', - ':dbusCompilerService', - ':httpCompilerService' + ':compiler' ) diff --git a/virtualmachine/build.gradle b/virtualmachine/build.gradle index 3339d7fd5..2e0158171 100644 --- a/virtualmachine/build.gradle +++ b/virtualmachine/build.gradle @@ -27,7 +27,7 @@ dependencies { implementation project(':codeCore') implementation project(':intermediate') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.18" + implementation "com.michael-bull.kotlin-result:kotlin-result-jvm:1.1.20" testImplementation 'io.kotest:kotest-runner-junit5-jvm:5.8.0' testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' testRuntimeOnly 'org.junit.platform:junit-platform-launcher'