182 pointsby roman01la2 days ago10 comments
  • apignotti4 hours ago
    Shameless plug: CheerpJ is our solution to run any JVM language in the browser, including Clojure. Reflections, Multithreading and Swing / AWT apps are all supported.

    https://labs.leaningtech.com/blog/cheerpj-4.0

    And yes, it can run Minecraft :-)

    https://browsercraft.cheerpj.com/

  • nzoschke16 hours ago
    GraalVM is neat.

    I used it to make a program that logs all activity happening on the Pioneer CDJs. The best reverse engineering of the Pioneer protocols is a Java project, but I wanted to write the rest of my application in Go.

    GraalVM plus a GitHub action spits out native binaries that I can exec and interact with over stdio from Go.

    If/when the WASM backend supports UDP networking and threads I'd love to run it as WASM instead of a binary.

    - https://github.com/nzoschke/vizlink

    - https://github.com/nzoschke/vizlink/blob/main/.github/workfl...

  • tiffanyh18 hours ago
    > Starting from v25 GraalVM added support for WASM

    GraalVM is so amazing technically, but gets so little love by HN.

    • gavinray2 hours ago
      Just to clarify -- GraalVM had support for RUNNING WASM for quite a long time.

      This post references the ability to compile programs via native images to WASM as an output format.

    • sureglymop17 hours ago
      When I tried it it was great but also not easy to use. Things become hard quickly, e.g. If your jvm code uses something like reflection.
      • perrygeo15 hours ago
        Clojure code ends up using a lot of reflection if you're doing generic Java interop. Most code destined for the GraalVM will add `(set! warn-on-reflection true)` and get repl warnings and you can set type hints accordingly.
      • hocuspocus5 hours ago
        Native images are just one feature though. Many people would benefit from the Graal JIT even if they don't care about anything else.
      • 90s_dev17 hours ago
        I vaguely remember using it about 10 years ago for work, can't remember what for, or anything about that situation, but the one takeaway that I do remember is that it was neat and innovative, but ultimately not good enough to overthrow whatever we were using instead.
        • piranha6 hours ago
          First release happened in 2019
    • hardwaresofton13 hours ago
      Does it have to do with the somewhat complicated licensing?
      • hocuspocus5 hours ago
        Current licenses for Oracle JDK and GraalVM are essentially the same terms. It's pretty straightforward.

        https://www.oracle.com/downloads/licenses/graal-free-license...

        • hardwaresofton5 hours ago
          So for shops that are already open to using the JDK they're obviously already used to the legalese/implications for companies built on this software.

          Everyone else in the world probably does not see this as "straight forward".

          So Step 0, be a lawyer.

          • hocuspocus5 hours ago
            Oracle has specifically reworked its license to make terms clear after the bad press around the initial release of Oracle JDK 17:

            https://blogs.oracle.com/java/post/free-java-license

            Any company using Java should be willing to read and understand Oracle's terms, whether they use third party OpenJDK distributions or Oracle's builds.

            If you're leaving significant performance gains on the table because you can't read, that's on you.

      • amelius6 hours ago
        And Oracle's army of lawyers.
      • kokada2 hours ago
        Not really, but one thing that bothers me is how unreproducible GraalVM is. AFAIK every distro that has binaries for it just repacks the binaries released from Oracle, and the last time I searched I couldn't find instructions on how to build from scratch (I was the maintainer of GraalVM in nixpkgs, not anymore because I just got fed-up with it).
    • pjmlp9 hours ago
      That is how people lose out on great technology, while worshiping the ways of 1980's server room computing.
  • gitroom2 hours ago
    yes sir, i kinda love seeing all the different ways folks mash stuff together to get dev setups working, so much trial and error that never gets seen - you ever feel like the real blocker is always some weird little detail nobody warns you about?
  • 15 hours ago
    undefined
  • croemer15 hours ago
    The analysis of the benchmark is wrong. Native is faster than JVM for 2 out of 4 operations. The 2-3x vs 5-12x are hence not correct.
  • dlachausse18 hours ago
    > The output WASM of this simple program is 5.6MB binary, which can be pruned a bit via wasm-opt tool, just make sure that it doesn't break anything for you. Luckily when compressed (gzip, brotli, etc) the binary becomes just ~2.5MB in size.

    That’s much better than I expected! Very impressive work here. It actually looks viable for certain applications.

    • sjrd18 hours ago
      It's acceptable. Meanwhile 5.6MB of Wasm is about the size of the entire test suite of Scala.js. :-p

      GraalVM is excellent technology, but when it comes to targeting Wasm, I believe the core language compilers will always have an edge.

  • rgyams19 hours ago
    Nice, I will revisit closure to try this out
    • millerm19 hours ago
      Clojure. ;)
      • tomjakubowski18 hours ago
        For quite some time (maybe even still today?), ClojureScript was compiled to JS using the Google Closure Compiler. I felt sympathy for anyone who had to discuss that out loud.
        • sjrd18 hours ago
          The trick is to call the latter GCC. Much less confusing. ;-)
          • tonyarkles17 hours ago
            And now I've got coffee in my sinus. Thanks for that :D
        • superhoops5407 hours ago
          Would have been good to create a pamphlet to inform on the differences. A Clojure/Closure Brochure, if you will
        • shawn_w17 hours ago
          Imagine the pain of talking about Clozure Common Lisp.
      • 90s_dev18 hours ago
        You have no idea how many times I typed clojure when I meant to type closure throughout my career. Bizarrely backwards.
  • zusammen17 hours ago
    [dead]