ExternalLanguage cells - better/extended examples?

Greetings pals.

ExternalLanguage cells are a super useful addition to the Notebook interface. 99% of the time, one can intuit the functionality of Notebook things, but in this case I can’t quite figure out a few things.

For example - WL’s idea of the current directory is disconnected from anything external which is OK, but it requires some acrobatics especially in portability, e.g., when I try to use notebooks on machines with different mount points / directory layouts.

There doesn’t seem to be a way to ‘slug in’ / escape WL output into the Notebook cells, Ala

cd <<NotebookDirectory[]>> or something similar.

I’m sure there are clever things these cells can do, but there doesn’t seem to be much in the documentation that is aware of ExternalLanguage - which makes sense I suppose since that’s a cell type and not really a language feature, proper.

Any FE people want to chime in for those of us who, say, used to use Emacs as our operating system :slight_smile:

Hi Flip,

I am not entirely understanding your question and am wondering if you can give a specific example?

The Wolfram Language process and external language processes have their own concepts of current directories and this is by design. Which external language are you currently using? (I assume Shell or Python, but maybe it is something more exotic?)

Sorry for the slowness, the outage put me out of sync.

Let’s say we’re using shell/zsh. The idea of being able to compute something in WL and ‘slug’ it in as a parameter to the shell,

bob = 2+2

— shell cell —
echo $$bob
— / —

such that it returns 4. More pragmatic in my case…

listOfDirectories = ComputedSomeHow[];

— shell cell —
ls <listOfDirectories[[1]]>

Yeah, I know I can list the files in WL, so, think instead of ls I’m using the shell command flipCommand

There was a response a bit ago re: these things being handled as Cell / FE so it makes things a little clumsy?

Hi Flip,

Maybe you’re after something like this?

Best,
Kelvin