2
\$\begingroup\$

It would appear to have been decided that the use of non-standard libraries is permissible (unless the question specifies otherwise), on the condition that the library being used is freely available and predates the asking date of the question.

Would requiring a non-standard preprocessor be permissible under the same set of conditions?

| |
\$\endgroup\$
  • \$\begingroup\$ Can you give an example? \$\endgroup\$ – Alex A. Oct 25 '15 at 20:02
  • \$\begingroup\$ Well, I'm in the process of writing a Java preprocessor that would allow aliasing imports. (The preprocessor would automatically replace the specified aliases with the fully qualified class names.) But this question would likely cover other situations as well. \$\endgroup\$ – SuperJedi224 Oct 25 '15 at 20:04
  • \$\begingroup\$ I may not be understanding correctly, but to me it sounds like you're in a way creating an interpreter for a golfed Java. \$\endgroup\$ – Alex A. Oct 25 '15 at 20:05
  • \$\begingroup\$ It would convert it into standard java source, which would then be compiled and run normally. \$\endgroup\$ – SuperJedi224 Oct 25 '15 at 20:05
  • \$\begingroup\$ Right, that's what some interpreters do. :) \$\endgroup\$ – Alex A. Oct 25 '15 at 20:24
  • \$\begingroup\$ some interpreters \$\endgroup\$ – Alex A. Oct 25 '15 at 20:26
  • \$\begingroup\$ But it does not (at least in the current version) handle the rest of the compilation automatically. I suppose I could write a windows batch wrapper to do that though. \$\endgroup\$ – SuperJedi224 Oct 25 '15 at 20:28
  • \$\begingroup\$ It's also not exclusively for code golfing, it has other uses (for example, when you need to import two distinct classes which have the same simple [unprefixed] name.) Also, it's sometimes convenient to be able to refer to one specific List implementation as simply "List" \$\endgroup\$ – SuperJedi224 Oct 25 '15 at 20:46
  • \$\begingroup\$ As long as the code you're writing follows the Java spec, it seems to me that it's valid Java code regardless of what preprocessor you use. \$\endgroup\$ – lirtosiast Oct 25 '15 at 22:36
  • \$\begingroup\$ Standard java does not support aliased imports, so this custom preprocessor would convert java code which uses aliased imports into standard java code. \$\endgroup\$ – SuperJedi224 Oct 26 '15 at 0:43
5
\$\begingroup\$

It's the compiler of a new language that compiles into Java.

Just like CoffeeScript:

CoffeeScript is a little language that compiles into JavaScript.

And the other steps are handled by a JavaScript interpreter.

The "new language" can be a language under a different name based on Java, or a dialect of Java. As your language doesn't likely match the Java specification, and probably won't be accepted by other Java users, it's safer to call it a language under a different name. You can still call it something like Preprocessed Java, though.

| |
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .