Re: [Seed7-users] Q&A
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2012-08-01 13:51:14
|
At Mon, 30 Jul 2012 11:16:19 +0300 Kobi Lurie <kob...@gm...> wrote: > Hello, > > I just recently heard of seed7, and have an interest in extensible > programming languages to suit my coding style and requirements. Welcome. > seed7 looks like a fun language to work with and may become a language > of choice for projects and work, or just as a fun hobby, if it is > capable enough. > > so that's why I'm here, and since I just discovered seed7, would like > to ask about what I didn't find yet: > > 1) bindings - does seed7 have a foreign function interface (FFI)? that > is, can I use libraries from c/c++, by creating a wrapper of some > sort? Seed7 can call C library functions, but wrapper functions are necessary to do it. Some of the types used by Seed7 are different from the ones used by C (e.g. strings) In this case conversion functions must be called. I suggest to have two wrapper functions: One that does the type conversion, error checking, etc. and one that provides a so called primitive action for the Seed7 interpreter. The primitive action must also be defined in a Seed7 include library. I started to document the FFI, but it will take some time. In the meantime the existing documentation of the primitive actions at http://seed7.sourceforge.net/manual/actions.htm can be used to see how a foreign function call can be done. > 2) gui - is there a gui library? Seed7 has a graphics library, but currently there is no gui library. Except for the Gtk-server connection library provided by Leonardo Cecchi. I have a plan to have an interface description and to use this description for a web based interface and for stand alone programs. But until I get massive support this will take very long, to be realized. > It seems portability in the language > was a main concern, what do you feel about libraries such as fltk, or > preferrably wxwidgets? (or is there a home-brewn one? do you wish for > everything to be in one ecosystem?) Interfacing with a library is okay. I don't know fltk and I have only little knowledge about wxwidgets. Fitting a gui library fully into the Seed7 ecosystem is probably not easy. Is it possible to base a gui library on the Seed7 graphics library? I would like to avoid event loops in the user program (I hate event loops). I also don't like redraw events. It is just stupid when the program gets told: I just deleted your window and you should redraw it. What would programmers say, when this happens with files? But this are just my wishes. When you do the work you are allowed to ignore them. Feel free to add a cgi library to Seed7. I promise to add it to the release, when it is not buggy and somehow useable. > 3) are functions first class? for example, to define 'map', I would > pass as arguments, the list and a lambda, or a function name. > delegates, quotations, lambdas, it has different names. is this > concept supported? Seed7 supports a 'map' function, but lambdas are not used. Some half prepared 'map' function example for the Homepage exists. I just copy part of this example below. The map function is defined with: const func array integer: doMap (in array integer: anArray, inout integer: aVariable, ref func integer: anExpression) is func result var array integer: result is 0 times 0; begin for aVariable range anArray do result &:= anExpression; end for; end func; To add 1 to each array element the expression doMap(testArray, x, x+1) can be used. The map function looks a little bit like a for-loop. The variable x must be provided as parameter to doMap. > how should the signature definition look like? Signature definitions are not used for the map function. > 4) auxiliary and fancy stuff - > unit testing (and mocks), Currently no special support, but I don't see problems. The functionality of the Seed7 interpreter and compiler is checked with several programs. > design by contract, Currently no special support > ADA's argument ranges, Not sure what you mean with this. Seed7 supports positional parameters and does not support named parameters. > mixins, The functionality could probably be provided with Seed7 templates or abstract data types. > multiple inheritance, Not supported > events, I already explained, that I don't think that event loops are a good idea. But nobody hinders you to process events with Seed7. > fine grained accessibility (not just public private but having syntax > to limit to a function or class or with wildcards), Fine grained accessability is currently not supported. > actors and network programming ... Not sure what you mean with this. Seed7 has support for networking (FTP, HTTP) and CGI. > which of these are supported or intentionally not supported, and to > what degree? (this helps me see which direction the language is headed > to, what it mainly wants to accomplish) > > That's it. sorry for the demanding questions. I understand you work on > this alone, and that's one monumental task. Hope to not take too much > of your time. > > I quite like all your choices so far, and may become an avid user :-) Great. > Thanks in advance, kobi I hope that my answers are detailed enough. Feel free to ask more. Regards, Thomas Mertes |