Are there ways to tweak the output of the JavaScript backend?
For me the resulting code looks at the moment like this:
function formatValue_24995001(result_24995004) {
console.log("Show:", result_24995004);
}
formatValue_24995001("hallo");
I would like to emit JavabScript where the identifiers are more readable _when there are no clashes with other identifiers on the same scope. In the example I'd liek to reduce it to something like:
function formatValue(result {
console.log("Show:", result);
}
formatValue("hallo");
Are there knobs for this in the compiler?
Thanks @xigoi. I use this for the top level functions where I can.
In my case (the JS code gets checked in and should be as readable by humans as possible) it would be nice to have the other parts a bit more readable too...
I totally understand that this is no Nim project priority. I'm just asking whether there are some knobs.
This is super cool @juancarlospaco!
What does the output of this look like?
So it works only with a 2022 version of Nim, right? Will then need to install this version from on another machine (one with internet access) to test.
I've installed and now played around with @juancarlospaco's Pretty-Printed JavaScript backend. And from my first trys I can say that it certainly makes the long number at teh end of every idnetifier much shorter.
For example, the code from the question at the top of this thread would look similar to this:
function formatValue_0(result_0) {
console.log("Show:", result_0);
}
formatValue_0("hallo");
Much better, isn't it? :-)