grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.53k stars 319 forks source link

feature request: ability to compile from stdin #6

Closed mbylstra closed 7 years ago

mbylstra commented 7 years ago

For example, I'd like to be able to do this:

faust < cat ./example.dsp

A bit of background:

At present the only way to read a file is to specify one or more files with file paths (in the current filesystem). Docker makes this awkward as by default it only has access to the container's filesystem (not the host's, where the file you want to compile will reside).

It can be done, but it is awkward. Eg:

docker run -v /home/:/home/ mbylstra/faust /home/michael/code/current/faust-docker/test.dsp

What this does is mount the host's /home/ directory as /home in the container. You then need to use full paths for the file you want to compile (~ or . won't work).

With stdin, you'd be able to do the following, which is nicer:

docker run mbylstra/faust < cat ./test.dsp

Has this been considered?

gierschv commented 7 years ago

Hey @mbylstra,

You can do this:

docker run -i faust /dev/stdin < [path-on-your-host].dsp

For example:

docker run --rm -i faust /dev/stdin < ~/test.dsp

Cheers, Vincent

mbylstra commented 7 years ago

Great idea! Thanks.