GithubHelp home page GithubHelp logo

vjovanov / graalrepl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lazar-mitrovic/graalvmrepl

0.0 1.0 0.0 36.55 MB

REPL (read–eval–print loop) shell built ontop of JavaFX stack and GraalJS

Java 92.69% CSS 4.48% Shell 2.84%

graalrepl's Introduction

GraalVM REPL

REPL (read–eval–print loop) shell built ontop of JavaFX stack, GraalJS, GraalPython, TruffleRuby and FastR

GraalVM REPL

Building prerequisites

  • Up-to-date GraalVM (for mobile builds this fork might be best since static libraries and relevant patches are added, prebuilt binaries for linux and macOS are provided)

  • GRAALVM_HOME environment variable set (optimally JAVA_HOME=$GRAALVM_HOME, which should help with The import org.graalvm cannot be resolved error)

  • GraalJS, GraalPython, TruffleRuby, FastR. Any combination of those will work, provided that pom.xml is edited accordingly. Those can be added either by gu install (on stable versions) or better by adding them as dynamic mx imports -

    cd $GRAAL_SOURCE/vm # Assuming that GRAAL_SOURCE points to right location
    
    export FASTR_CAPTURE_DEPENDENCIES
    export FASTR_RELEASE=true
    export FASTR_NO_RECOMMENDED=true
    export PKG_LDFLAGS_OVERRIDE="-L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu"
    
    mx --dynamicimports /graal-js,graalpython,truffleruby,fastr build
    
  • Various other Ubuntu 18.04 dependencies (which might or might not be needed):

    sudo apt -y install build-essential curl python git libxml2 ruby libssl-dev zlib1g-dev xorg-dev libcurl4-openssl-dev libgfortran-8-dev libgomp1 gfortran-8 libxml2 libc++-dev libpcre3 libpcre3-dev xz-utils;
    
    sudo apt -y install libgtk-3-dev libgdk3.0-cil-dev libpangocairo-1.0-0 libpango1.0-dev libgl1-mesa-dev libatk1.0-dev libcairo-gobject2 libavcodec-dev libavformat-dev libavutil-dev libasound2-dev libpangoft2-1.0-0 libgdk-pixbuf2.0-dev;
    
  • native-image-agent in order to generate required reflection configuration in JVM mode.

  • native-image

Choosing languages

Go to pom.xml in project root and edit nativeImageArgs so that languages you have installed are uncommented (with ! removed), and that others are commented out.

So if you only have graalpython installed, your configuration would look like this:

                    <nativeImageArgs>
                        <!--<list>-!-language:js</list>-->
                        <list>--language:python</list>
                        <!--<list>-!-language:ruby</list>-->
                        <!--<list>-!-language:R</list>-->
                        ...

JVM workflow

mvn clean javafx:run

(this will generate required reflection configuration - note that native-image-agent is needed)

or if VSCode is used: ctrl+shift+b -> Run JVM

Debug

mvn clean javafx:run@debug

or if VSCode is used: install Debugger for Java extension and then press F5

Native-image workflow

Desktop: mvn clean client:build client:package client:run
Android: mvn -Pandroid clean client:build client:package client:install client:run
iOS: mvn -Pios clean client:build client:package client:install client:run

or if VSCode is used:

ctrl+shift+b -> Build (Platform)

ctrl+shift+b -> Run (Platform)

graalrepl's People

Contributors

jperedadnr avatar lazar-mitrovic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.