bash support

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bash support

Valerio Messina
hi,
I never used Swig and so I'm not sure the following question is relevant or correct.

In the list of supported languages the bash is missing, and at first this is strange to me,
Bash is/has a powerful scripting language, so in my understanding can be supported by swig.
I'm wrong?

OK, bash can call executable generated by C source directly, but passing arguments via command line parameters and main() parsing is cumbersome.
Return of values via 'int return' is ever limiting.
I imagine calling C functions directly has lot more power control.

thanks for clarifications,
Valerio


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bash support

Robert Heller
At Fri, 10 Jun 2016 18:52:10 +0200 (CEST) Valerio Messina <[hidden email]> wrote:

>
>
>
> hi,
> I never used Swig and so I'm not sure the following question is relevant or
> correct.
>
> In the list of supported languages the bash is missing, and at first this is
> strange to me,
> Bash is/has a powerful scripting language, so in my understanding can be
> supported by swig.
> I'm wrong?

I think so.

I don't believe bash has any sort of "C" interface mechanisum.  *ALL* of the
languages SWIG works with have published APIs for adding 'binary extensions',
that is they all have a published API to call "C" functions either compiled
and linked directly into the language interpreter OR as a dynamically loaded
shared library module.

Bash does not has such a mechanisum (AFAIK). The only binary extension
mechanisum for bash (or any of the other basic shells) is via the 'standard'
main program / process interface (eg int main(int argc, char *argv[]) {...})
as you state below.

>
> OK, bash can call executable generated by C source directly, but passing
> arguments via command line parameters and main() parsing is cumbersome.
> Return of values via 'int return' is ever limiting.
> I imagine calling C functions directly has lot more power control.

It is possible to pass results back to bash using 'printf()' as well.

>
> thanks for clarifications,
> Valerio
>
>
> MIME-Version: 1.0
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> MIME-Version: 1.0
>
> _______________________________________________
> Swig-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
>                                                                        

--
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
[hidden email]       -- Webhosting Services
                                                     

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bash support

Valerio Messina
In reply to this post by Valerio Messina
>----Messaggio originale----
>From: "Robert Heller" <[hidden email]>
>Date: 10/06/2016 20.36
>
>I don't believe bash has any sort of "C" interface mechanisum.  *ALL* of the
>languages SWIG works with have published APIs for adding 'binary
extensions',
>that is they all have a published API to call "C" functions either compiled
>and linked directly into the language interpreter OR as a dynamically loaded
>shared library module.
>
>Bash does not has such a mechanisum (AFAIK). The only binary extension
>mechanisum for bash (or any of the other basic shells) is via the 'standard'
>main program / process interface (eg int main(int argc, char *argv[]) {...})
>as you state below.

can you please point me to the Python "C" interface, so I can understand
better with an example.
Maybe I can ask to bash developer add such a feature, or patch myself.

thank you,
Valerio


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: bash support

Robert Heller
At Mon, 13 Jun 2016 13:56:03 +0200 (CEST) Valerio Messina <[hidden email]> wrote:

>
> >----Messaggio originale----
> >From: "Robert Heller" <[hidden email]>
> >Date: 10/06/2016 20.36
> >
> >I don't believe bash has any sort of "C" interface mechanisum.  *ALL* of the
> >languages SWIG works with have published APIs for adding 'binary
> extensions',
> >that is they all have a published API to call "C" functions either compiled
> >and linked directly into the language interpreter OR as a dynamically loaded
> >shared library module.
> >
> >Bash does not has such a mechanisum (AFAIK). The only binary extension
> >mechanisum for bash (or any of the other basic shells) is via the 'standard'
> >main program / process interface (eg int main(int argc, char *argv[]) {...})
> >as you state below.
>
> can you please point me to the Python "C" interface, so I can understand
> better with an example.

I have not worked with Python, but I have worked with Tcl (the *original*
language that SWIG was written to work with way back when).  But from the
python(1) manual page:

DESCRIPTION
       Python is an interpreted, interactive, object-oriented programming lan-
       guage that combines remarkable power with very clear  syntax.   For  an
       introduction  to  programming  in Python you are referred to the Python
       Tutorial.  The Python Library Reference documents built-in and standard
       types, constants, functions and modules.  Finally, the Python Reference
       Manual describes the syntax and semantics of the core language in (per-
       haps  too) much detail.  (These documents may be located via the INTER-
       NET RESOURCES below; they may be installed on your system as well.)

       Python's basic power can be extended with your own modules written in C
       or  C++.   On  most  systems  such  modules  may be dynamically loaded.
       Python is also adaptable as an extension language for existing applica-
       tions.  See the internal documentation for hints.

       Documentation  for  installed Python modules and packages can be viewed
       by running the pydoc program.

And the man page for Tcl_CreateObjCommand() (the main C function for adding
"C" coded commands to Tcl) is here:

https://www.tcl.tk/man/tcl8.0/TclLib/CrtObjCmd.htm

> Maybe I can ask to bash developer add such a feature, or patch myself.

Maybe.  But don't hold your breath...

>
> thank you,
> Valerio
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> _______________________________________________
> Swig-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
>                                                                                                                        

--
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
[hidden email]       -- Webhosting Services
       

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...