Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:

Does it mean we could target C++ using Clojure haha?


Graalvm protip: you can always shell out to the jar you are trying to run πŸ™ˆ


(defn from-yaml-via-jar [jar-path s]
  (let [{:keys [exit out err]} (sh "java" "-jar" jar-path "generate" "--input-format" "yaml" :in (<|>.StringReader. s))]
    (if (zero? exit)
      (cheshire/parse-string out)
      (throw (ex-info "" {:type :exit
                          :exit/code exit
                          :exit/message (str out err)})))))

(defn from-yaml [fallback-jar input]
  (let [s (slurp input)]
        (cfn/parse s)

        (catch org.yaml.snakeyaml.error.YAMLException e
          (if fallback-jar
            (from-yaml-via-jar fallback-jar s)
              (println "Did you consider using the --fallback-jar option to be able to read custom AWS tags?")
              (throw e)))))))

borkdude 2020-03-12T10:03:12.324100Z

shelling out to java: that's also what the GraalVM compiled deps.clj does πŸ™‚. it's kind of the entire of point of the tool, to create a classpath and then launch a JVM πŸ™‚


yeah nice πŸ™‚ I’m not doing the same though if that’s what you mean. I’m shelling out to the uberjar I’m trying to run via Graalvm in the first place. The yaml parsing fails in Graal, but succeeds in the jar ..

borkdude 2020-03-12T10:06:06.325800Z

haha yeah, that's a nice fallback πŸ˜›


It’s really my last resort. I gave up this yaml parsing thing

borkdude 2020-03-12T10:06:59.326500Z

it really is a rabbit hole, isn't it.


yeah and I only really wanted to use it for importing cloudformation templates. So it started as nice to have this yaml file importing part. Now time for some real features with Sci 😎

Nico 2020-03-12T14:37:55.328700Z

can you use core.spec within something graalvm-compiled with clojure 1.9.0?

borkdude 2020-03-12T14:48:42.329Z

you can also use it again now with 1.10.2-alpha1

Nico 2020-03-12T15:02:16.329200Z

oh, awesome!