as i am attempting to make a super minimal in-appl...
# kotlin-native
s
as i am attempting to make a super minimal in-application debugger capable of debugging itself but in order to print certain info, such as the current line, future lines, and others, i need to have access to the application's source code which may not always be available in the case the application is transfered to a seperate machine via executable file or JAR file, and ran
d
Can this be done on JVM?
s
possibly, but at the moment i have no intention of doing so for JVM, as only the core API of my application will be ported to JVM as a plugin
d
I'm not 100% sure what you actually want to do but I'm almost certain it won't be possible with Kotlin/Native.
If a language is "compiled" as supposed to "interpreted" there's no reliable way to programmatically access source code.
s
i mainly need a way of... somehow packaging the source code into the application itself without needing to decompile nor dissassemble, such the information will be accurate enough to determine what line it is on such that both the source and the original source match 1:1
particularly when dealing with import statements
d
Hmm, you could add a gradle task that copies the source code in a string and adds it to the program
Just watch out for recursion.
s
could work, assumes everyone uses gradle though
then again my application is compiled using gradle lmao