jArchi development environment

Started by rchevallier, April 30, 2020, 09:33:19 AM

Previous topic - Next topic

rchevallier

Hi all,

Is there any trick to facilitate the development of a jarchi script? (debugging, etc.)
I spend myself logging about every step to see whats happening thru the console, quite frustrating
Is there any better way ?

Thanks

Phil Beauvoir

What do you think is the main problem? Is it that the jArchi wiki documentation needs improving and so you are trying things out in the script and running it to see what happens? Is it because you have a bug and want to debug it? Or something else? As far as debugging/breakpoints/etc goes this is not really possible in Archi itself.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

rchevallier

Hi Phil,

Most of the frustration comes from that I'm not a Javascript developer, and I'm quite frustrated with this language, and even more with the poor implementation in Nashorn, quite incomplete compared to it's standard ES6. So after looking up to the web for help on JS, trying to use the syntax/verb found, often I get the not implemented in Nashorn (eg: Object prototypes functions like keys(), class keyword, etc...)

As I reported somewhere, a REPL (Read Eval Print Loop) functionality available in Archi would be useful for understanding what's going on, and will quicken a lot "the write JS code in editor, save, run, look at console the problem" loop

IMHO, the documentation for jArchi  is complete enough, although more example and a FAQ would be always useful. But as you or JB said, the user can update the wiki and improve on the doc.

Right now, I'm using VsCode for writing the .ajs.
I'm thinking about creating a mockup .js to simulate jarchi and add typing (as either jsDoc or maybe typeScript definition file) to facilitate writing proper .ajs. Anyone interested by that ?



Phil Beauvoir

I'm not a JS developer either, so I have a similar workflow - edit in VS Code, try something out, see if it works.

As for Nashorn, we have to take it for what it it is - it won't be getting any upgrades. An alternative to Nashorn is apparently GraalVM but so far I haven't figured out how it can be deployed as simply as shipping some library files with a Java app.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Thomas Rischbeck (ITMC.ch)

Hi Phil

I'm using the script plugin v1.1.0 and the Graal engine -which is great!

Just coming back to the original question of @rchevallier around debugging.
My .ajs scripts tend to get large and complicated. Debugging with console.log statements is a pain.

Is there any way to use the (remote) debugging functionality of GraalVM? I've read something about this here, but I'm not sure if and how this applies:
https://stackoverflow.com/questions/59053234/can-you-remotely-debug-graal-js-script-running-inside-graal-jvm

Kind regards, Thomas.
ITMC AG • Bahnhofstrasse 10 • CH-8001 Zürich
Dr. Thomas Rischbeck
PhD in Computer Science
Managing Partner   
rischbeck@itmc.ch
www.itmc.ch

Phil Beauvoir

February 08, 2021, 17:06:28 PM #5 Last Edit: February 08, 2021, 17:35:55 PM by Phil Beauvoir
Quote from: Thomas Rischbeck (ITMC.ch) on February 08, 2021, 16:57:21 PM
Is there any way to use the (remote) debugging functionality of GraalVM? I've read something about this here, but I'm not sure if and how this applies:
https://stackoverflow.com/questions/59053234/can-you-remotely-debug-graal-js-script-running-inside-graal-jvm

Kind regards, Thomas.

I don't know if that's possible or not. I suspect not because we only use part of GraalVM runtime in Archi. And I doubt that things like breakpoints would work given the way that scripts work in Archi. However, if someone wants to investigate please do so, as I am not really that familiar with the inner workings of GraalVM (it was hard enough just figuring out how to ship the correct jars and working around some other issues.  :) )
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate