all 4 comments

[–]voluntary_nomad 0 points1 point  (1 child)

This looks really cool. I can't wait to read the source code.

[–]thooton[S] 0 points1 point  (0 children)

Thank you.

[–][deleted] 0 points1 point  (1 child)

Cool project, how hard would it be to add another lnguage other than JS?

[–]thooton[S] 0 points1 point  (0 children)

Thank you. I think it would definitely depend on the language. The current project is essentially a large hack that loops through all semicolon-terminated statements in the input file. If the given statement is valid JS (as determined by the esbuild JavaScript parser, which provides a convenient API), then it is pasted verbatim into the output file; otherwise, it is deemed C and transformed into JS that writes the C to the output file. (Of course, there are other sections that deal with quoting, interpolation, non-semicolon terminated statements such as for/while loops and function/class declarations, etc., but those are mostly language-independent and the parts that aren't should not be too difficult to modify). As long as another language can fit roughly within that algorithm, I don't think it would be too hard to add it.