[graalvm-users] Managing streams in a Polyglot environment
Chris Seaton
chris.seaton at oracle.com
Sun Apr 28 13:56:10 PDT 2019
The Polyglot Engine.Builder API allows you to set the standard output stream.
https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Engine.Builder.html#out-java.io.OutputStream-
This isn’t always easy to implement in languages though - it’s a Java OutputStream, so the issue is how do low-level Ruby (for example) IO routines interact with that? Ruby doesn’t use this stream therefore, except if you set the --polyglot-stdio option, or disable the native platform option with --platform-native=false, or if you’re using Ruby from Java or from another language. I think there may well still be inconsistencies though even if they’re being used, since they just don’t have a file descriptor.
I don’t know how the other languages use the Polyglot streams.
If those options aren’t doing what you want, please show us what you’re trying to do and what you think should happen and we can debate it.
Chris
> On 28 Apr 2019, at 21:49, Rodrigo Botafogo <rodrigo.a.botafogo at gmail.com> wrote:
>
> When working with many languages, is there a way to manage the streams for all languages together? For example, if I redirected stdout in Ruby to a stream, nothing will happen with R stdout that will still go to the output stream. Is there a 'global' way to manage streams so that if I redirect stdout to a stream, Ruby, R, Python, etc. will all write to this stream?
>
> Thanks
>
> --
> Rodrigo Botafogo
>
> _______________________________________________
> GraalVM-Users mailing list
> GraalVM-Users at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/graalvm-users
More information about the GraalVM-Users
mailing list