Fork me on GitHub
#data-science
<
2019-09-14
>
stathissideris09:09:10

I’ve been playing around with GraalVM… would vega and vega-lite wrapped as a native executable be useful?

David Pham11:09:21

My opinion, but as long as the non native version runs under 500ms I think you don’t need that speed for visualisons? Unless you make tons of them?

David Pham11:09:06

If you play with GraalVM, did you try the interop with R? I would love to write clojure code that compliles to R xD

stathissideris16:09:08

I think the interop would allow you to run R code in the JVM, not transpile Clojure code into R code

✔️ 4
stathissideris12:09:09

@neo2551 for me it’s more about being able to run it without a browser in a self-contained executable without dependencies

David Pham12:09:48

Which uses case would it be?

stathissideris13:09:30

so for example, in emacs there is a mode that allows you to write graphviz in a buffer and press a key to preview the result within emacs. It’s very convenient making diagrams like that. I’d love to have something like that for vega

zane18:09:41

Here's my attempt at something like that: https://github.com/zane/vega.repl

zane19:09:14

Please share any feedback you might have. 🙂

zane19:09:01

Obviously the result won't show up within Emacs, but I've found that a floating window provides a pretty good experience.

stathissideris16:09:34

I also did that at some point (with java-fx as well!)

stathissideris16:09:00

I think it’s useful, but I still think there is a place for a command line utility

zane00:09:49

I agree.

stathissideris13:09:27

@U06C63VL4 nope, I just used graalvm

jsa-aerial13:09:22

If so, and your idea is to generate pngs (or svgs) via native calls to VG generator for those, then there are some people who have said that is something they would like

jsa-aerial13:09:59

So, does plain graalvm work well with native (NPM...) JS libs?

stathissideris14:09:29

I didn’t even use npm, I just got the code from cdn js

stathissideris14:09:07

the code in the tweet has a flaw: I should have used a Clojure promise instead of an Atom

stathissideris14:09:32

I need to fix this and then figure out how to release the native image via brew

jsa-aerial18:09:23

Sorry, I missed this @U050AACJB. If the plan is to have a cmd line tool that eats VG/VGL specs and outputs pngs/svgs, some people have said they would like that. Actually, if it is nicely contained via graalvm, I might even use it in place of ggplot2!! 😄

David Pham04:09:18

This is really cool!

David Pham05:09:13

I wonder if you can write CLJS with Truffle

stathissideris14:09:36

there is a non-released truffle clojure, it’s someone’s master thesis

David Pham20:09:35

But would it be useful? CLJS can tap into JS world, so we could have seamless interop

David Pham20:09:42

With GraalVM

zane22:09:10

Compiling ClojureScript to JavaScript that is then run (as JS) on GraalVM is different from a version of Clojure that implemented as a Truffle language. They both seem like interesting avenues of exploration to me.

David Pham20:09:13

Why would we build Clojure in Truffle? I can understand CLJS, but not Clojure as it is already a JVM language.

zane21:09:00

As an experiment, basically. Would it yield any performance improvements? Would it be easier to maintain and extend than the current Clojure compiler? You also get access to the tools that come from being an official GraalVM language. See "5. Tools that work across all languages" here: https://chrisseaton.com/truffleruby/tenthings/