[Cuis-dev] [cuis-slang] OpenSmalltalkVM Header Generation
Philip Bernhart
philip.bernhart at posteo.de
Wed Jun 10 08:17:27 PDT 2020
Luciano Notarfrancesco <luchiano at gmail.com> writes:
> Ok, that means that if my plugin is just a C file I should make sure to
> either regenerate plugins.h, or even better make sure to use the headers
> from the source of the VM I’m running instead of Slang’s plugin.h. Sounds
> right?
Re-generating the headers sounds right.
Using the opensmalltalk-vm headers on the other hand not so much,
is tedious as this is not just one header file. That's what
the plugin.h header file is supposed to solve, that you don't need
to re-write the opensmalltalk-vm definitions. It depends on how much
you want to repeat work which other people like me, already did.
If you are interested here that would the grand master file be
to adapt, copy and change on each new VM+image combination:
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Cross/vm/sq.h
most of the stuff is not needed and actually only the interpreterProxy
definitions in sqVirtualMachine.h are relevant for external plugins.
Still you need the typedefs.
> Or I might end up coding again in Slang like I did for other plugins
> before, I just wanted to test the idea of using plain C because it’s
> natural for dealing with arrays and arithmetic, and also allows more
> optimisations (like inlining some assembly)
Using C directly can be useful. I don't know of how you would
package your plugin, but the general idea is something I would
also agree on doing to in certain situations.
I'll try to get Slang somehow working, but when people want to use it
that way it gives me some inspirations of some design requirements.
So making also possible to just generate a header file and people can
do this too.
Cheers,
Philip
More information about the Cuis-dev
mailing list