help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OctDev] Automatic code generation


From: Juan Pablo Carbajal
Subject: Re: [OctDev] Automatic code generation
Date: Fri, 4 Nov 2011 19:26:05 +0100

On Fri, Nov 4, 2011 at 6:46 PM, Sergei Steshenko <address@hidden> wrote:
>
>
>
>
> ----- Original Message -----
>> From: Martin Helm <address@hidden>
>> To: Sergei Steshenko <address@hidden>
>> Cc: "address@hidden" <address@hidden>; Octave Forge <address@hidden>; octave 
>> maintainers mailing list <address@hidden>
>> Sent: Friday, November 4, 2011 5:58 PM
>> Subject: Re: [OctDev] Automatic code generation
>>
>> Am Freitag, 4. November 2011, 08:27:35 schrieb Sergei Steshenko:
>>
>>>  'maxima' has a scripting language of her own, and it wasn't too
>> dificult for
>>>  me to learn some basic things about it.
>>>
>> Which is suitable for symbolic manipulation and not so much for creating
>> source code for other languages. maxima is programmed in common lisp and it 
>> is
>> one of its documented and supported features that you can write your own user
>> defined functions in common lisp.
>>
>>>  I am using 'maxima' for symbolic manipulations, and some Perl after
>> it to do
>>>  some "replication" (I need to convert two similarly looking
>> expressions, so
>>>  I do the conversion for one and generate the other from the first one) and
>>>  name substitution.
>>>
>> I see your point, which is something I would like to avoid - to have yet
>> another layer of scripting language which acts as an intermediate layer
>> between the systems. Of course ymmv and obviously it does, nothing wrong with
>> your way doing it.
>>
>>>  The later can be done in 'maxima' herself, but I know Perl much
>> better than
>>>  'maxima'.
>>>
>> As I tried to indicate  above, in maxima's own scripting language it will be
>> a
>> pain to do that as far as I can see (but I will have to look at it again,
>> amybe it only looks at the moment like that and turns out to be easier) and I
>> look for quite some time now for an excuse to code something in lisp again :)
>>
>
> Revisit 'maxima' documentation ( 
> http://maxima.sourceforge.net/documentation.html ) - there is I/O, there are 
> string manipulation functions, there are I/O format control features, there 
> is even a package which deals with regular expressions - in my case it is
>
> maxima-5.24.0/share/maxima/5.24.0/src/nregex.lisp
> .
>
> Overall I think 'maxima' scripting language can be used in imperative, 
> functional and OO way.
>
> Regards,
>   Sergei.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>

Thanks for the heads up.
However I think i would like to keep this development slightly more
general than attached to Maxima. It would be great if somebody wants
to do that for Maxima as well. Also, I like an extension to Octave,
not to Maxima :D

As you can see in the function I sent before, the idea is to produce
functions that do what we do when we write a function. There are some
atomic methods that are needed (probably I will start with this, so
bottom-up), like the function I sent, it just generates the
"decorations" needed to make a body of code a function.

I guess the best approach is to try to come with a structure of a
function in an abstract form, something like a DOM. And then define
the "octave_function" class that is able to put things in the proper
places. This is what I had in mind when I did that function.

In pseudo meta language

<function inputs="" outputs=""><body></body></function>

The functions has properties, like its inputs arguemnts, output
arguements, etc... it has a child body, which I guess yould have other
childs like <forloop>, <whileloop> <functioncall>, etc....

Just an idea.


-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]