For the execute-external-file script, here is one of my test files, a tiny Julia file (of course, install Julia first):
headline: @file julia-1.jl
# function to calculate the volume of a sphere
function sphere_vol(r)
# julia allows Unicode names (in UTF-8 encoding)
# so either "pi" or the symbol π can be used
# return (4/3)*pi*r^3
return (4/3)*π*r^3
end
vol = sphere_vol(3)
# @printf allows number formatting but does not automatically append the \n to statements
using Printf
@printf "volume = %0.3f\n" vol
For the command to find the Julia processor, you have to create an @data settings node named @data run-external-processor-map, like this one (.py scripts are hardcoded in, of course, and don't need to be included here):
EXTENSIONS
.jl: julia # Trailing comments are allowed
.lua: lua
.rb: ruby
.nim: nim
PROCESSORS
julia: julia
lua: lua
nim: nim
# Originally, ruby was not on the PATH, so we needed its full path:
# ruby: C:\Ruby27-x64\bin\ruby.exe
# After ruby was added to the PATH, we could use its bare name:
ruby: ruby
This command is supposed to open a new terminal window and run the command in it. The terminal *must* stay open after the external program ends so that the user can read any output (especially error messages!). The trickiest part of the command is figuring out the terminal launch command for Linux that will launch and stay open at the end, since there is no one standard method good on all Linux distros. My script uses some heuristics to try to get it right. These can include scanning the --help output of the candidate terminal, IIRC.