[bug#53765,09/17] gnu: Add clojure-tools-analyzer-jvm.
Commit Message
* gnu/packages/clojure.scm (clojure-tools-analyzer-jvm): New variable.
---
gnu/packages/clojure.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
Comments
Reily Siegel schreef op do 03-02-2022 om 19:25 [-0500]:
> + (synopsis "Additional jvm-specific passes for @code{tools.analyzer}")
Is it jvm-specific, or Java-specific? Also, isn't Clojure based on
Java, so Java-specific seems a tautology here?
Greeting,
Maxime.
Maxime Devos <maximedevos@telenet.be> writes:
> Is it jvm-specific, or Java-specific?
This is JVM-specific, as clojure compiles directly to JVM bytecode,
without an intermediary Java state.
> Also, isn't Clojure based on Java, so Java-specific seems a tautology
> here?
There are also other implementations of Clojure that run on other
platforms, such as the CLR, JavaScript, and BEAM, and one under
development for Flutter.
Reily Siegel schreef op ma 07-02-2022 om 13:04 [-0500]:
> > Is it jvm-specific, or Java-specific?
> This is JVM-specific, as clojure compiles directly to JVM bytecode,
> without an intermediary Java state.
Compiling to Java bytecode does not imply the JVM -- for example,
GCJ can compile Java bytecode to native code, according to
<https://gcc.gnu.org/wiki/GCJ_FAQ>. There is no JVM involved in this
situation.
Greetings,
Maxime.
Maxime Devos <maximedevos@telenet.be> writes:
> Compiling to Java bytecode does not imply the JVM -- for example,
> GCJ can compile Java bytecode to native code, according to
> <https://gcc.gnu.org/wiki/GCJ_FAQ>. There is no JVM involved in this
> situation.
Yes. However, here "Java Bytecode" has nothing to do with the Java
programming language. It could have been produced by any programming
language that executes on the JVM. The Java, as well as Clojure
compilers produce bytecode that is designed to run on the Java Virtual
Machine. The fact that other programs can analyze that bytecode and do
something else with it doesn't seem super relevant to me. We wouldn't
call x86 assembly "C bytecode" because you could theoretically run it in
an emulator and not on an x86 processor. I really don't think this is
worth a huge debate, but my concern is that changing this to Java
implies that it only works with the Java programming language, and not
any other programming language or tool that respects JVM bytecode, of
which there are several (Scala, Groovy, Kotlin, etc.).
@@ -670,6 +670,34 @@ (define-public clojure-tools-analyzer
@code{tools.analyzer.jvm}, @code{tools.analyzer.js}")
(license license:epl1.0)))
+(define-public clojure-tools-analyzer-jvm
+ (package
+ (name "clojure-tools-analyzer-jvm")
+ (version "1.2.2")
+ (home-page "https://github.com/clojure/tools.analyzer.jvm")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1ibvgvfa4618l5d0pff9gjar1s0fwagi029v4allk7z3swb93ibr"))))
+ (build-system clojure-build-system)
+ (arguments
+ '(#:source-dirs '("src/main/clojure")
+ #:test-dirs '("src/test/clojure")
+ #:doc-dirs '("doc")))
+ (propagated-inputs (list clojure-core-memoize
+ clojure-tools-reader
+ clojure-tools-analyzer
+ java-asm))
+ (synopsis "Additional jvm-specific passes for @code{tools.analyzer}")
+ (description "An analyzer for Clojure code, written on top of
+@code{tools.analyzer}, providing additional jvm-specific passes.")
+ (license license:epl1.0)))
+
(define-public clojure-tools-cli
(package
(name "clojure-tools-cli")