Description
Hey there truffle-ruby devs and users.
I am not sure if I made this suggestion before or not (I tend
to often suggest more examples and documentation in many
different projects, so it is hard to keep track over all
projects), but either way I'll make this suggestion. You
lot can then decide whether this has merit.
GraalVM is fairly well-documented, but there is one thing
I think is partially missing: and that is ... more examples.
I have gathered a few small examples via ruby + polyglot
and these work for the most part (excluding my older
problem related to GraalVM running out of memory, but
I haven't had this issue yet with the newly released
GraalVM, so perhaps it was fixed).
So simple use cases are covered quite ok-ish, but I am
wondering: what are people doing after the basic steps?
So I would like to ask fore more advanced, somewhat
more sophisticated use cases.
Perhaps this could go into the doc/ subdirectory,
and called examples/ or tutorial/ or something like
that. Or it may be elsewhere, but mentioned via
cross-reference from the main README.md, so that
people can find it. But anyway, this is a detail,
the more important stuff is that a) it can be found
and b) that it exists to begin with.
So, what are these more sophisticated use cases?
Perhaps something like a step-by-step tutorial that
would be useful.
So we start with hello world, but then we add a
few more examples that are more advanced.
What do I mean with advanced? What could be useful
for the end user who is learning to use truffleruby
- native-image?
Well, I think these elements would be useful:
-
Show a larger ruby class and have it call various
methods, and perhaps also work via END and
DATA to show this works. -
Show how to use a gem and different methods in
that gem, residing in different .rb files. In other
words show how to make things work via different
.rb files. Since the GraalVM side requires some
eval, I guess, perhaps show how to read in from
an existing .rb file or something. -
Perhaps try to show how to interact with other
ruby gems too, ideally in a sinatra-app or a
ruby-on-rails app (as a small example) and to
make calls between the two (e. g. the native-image
binary and the ruby on rails app). Note: I really
refer ONLY to basic stuff, e. g. a hello-world
example there. -
Perhaps show one simple GUI, be it via swing
or JavaFX or anything + native-image. This may
not work too easily but I'd love to see a simple
example how this could work via ruby too.
Anyway. These are just some rough ideas. The
basic gist of this is to showcase some examples
people can try to "get up and running quickly".
As always please feel free to close this issue
at any moment in time and thank you for reading
this issue request. Sorry for the formatting -
I typed this in my local editor. For some reason
when I type directly in the textarea here I tend
to make a gazillion typos ...