Syntax trees from strings

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax trees from strings

Søren Hauberg
Hi All

I just had a very interesting chat with a researcher doing machine learning in collaboration with Coursera, trying to build large scale grading systems. They are working on tools for grading the quality of a code submission by students (i.e. a student submit a piece of code as an answer to an exercise, and now they want to grade that piece of code).

As they use Octave as their main teaching language they also hook into the Octave code to build these grading systems. In particular they use the Octave parser to generate syntax trees. Right now they get the code submission through a database, then they write the code to a file and run the parser on that file. He was curious if there are ways of to avoid writing the code to a file in order to parse it. Do we have such functions?

Thanks
Søren

Reply | Threaded
Open this post in threaded view
|

Re: Syntax trees from strings

Juan Pablo Carbajal-2
On Fri, Jun 28, 2013 at 1:41 PM, Søren Hauberg <[hidden email]> wrote:
> Hi All
>
> I just had a very interesting chat with a researcher doing machine learning in collaboration with Coursera, trying to build large scale grading systems. They are working on tools for grading the quality of a code submission by students (i.e. a student submit a piece of code as an answer to an exercise, and now they want to grade that piece of code).
>
> As they use Octave as their main teaching language they also hook into the Octave code to build these grading systems. In particular they use the Octave parser to generate syntax trees. Right now they get the code submission through a database, then they write the code to a file and run the parser on that file. He was curious if there are ways of to avoid writing the code to a file in order to parse it. Do we have such functions?
>
> Thanks
> Søren
>

That's kind of cool. Is their development available for the community?
Are they releasing this upgrades/extensions under GPLv3 or compatible?
Reply | Threaded
Open this post in threaded view
|

Re: Syntax trees from strings

Søren Hauberg

On Jun 28, 2013, at 1:45 PM, Juan Pablo Carbajal <[hidden email]> wrote:

> On Fri, Jun 28, 2013 at 1:41 PM, Søren Hauberg <[hidden email]> wrote:
>> Hi All
>>
>> I just had a very interesting chat with a researcher doing machine learning in collaboration with Coursera, trying to build large scale grading systems. They are working on tools for grading the quality of a code submission by students (i.e. a student submit a piece of code as an answer to an exercise, and now they want to grade that piece of code).
>>
>> As they use Octave as their main teaching language they also hook into the Octave code to build these grading systems. In particular they use the Octave parser to generate syntax trees. Right now they get the code submission through a database, then they write the code to a file and run the parser on that file. He was curious if there are ways of to avoid writing the code to a file in order to parse it. Do we have such functions?
>>
>> Thanks
>> Søren
>>
>
> That's kind of cool. Is their development available for the community?
> Are they releasing this upgrades/extensions under GPLv3 or compatible?

As it is now this is purely research (i.e. not production code), which I doubt they will release. I don't know if they will release code once they have something for production.

I do doubt that such would be of value to others as it is bound to be very specialised to their particular infrastructure, but I don't know.

Søren

Reply | Threaded
Open this post in threaded view
|

Re: Syntax trees from strings

Juan Pablo Carbajal-2
On Fri, Jun 28, 2013 at 1:52 PM, Søren Hauberg <[hidden email]> wrote:

>
> On Jun 28, 2013, at 1:45 PM, Juan Pablo Carbajal <[hidden email]> wrote:
>
>> On Fri, Jun 28, 2013 at 1:41 PM, Søren Hauberg <[hidden email]> wrote:
>>> Hi All
>>>
>>> I just had a very interesting chat with a researcher doing machine learning in collaboration with Coursera, trying to build large scale grading systems. They are working on tools for grading the quality of a code submission by students (i.e. a student submit a piece of code as an answer to an exercise, and now they want to grade that piece of code).
>>>
>>> As they use Octave as their main teaching language they also hook into the Octave code to build these grading systems. In particular they use the Octave parser to generate syntax trees. Right now they get the code submission through a database, then they write the code to a file and run the parser on that file. He was curious if there are ways of to avoid writing the code to a file in order to parse it. Do we have such functions?
>>>
>>> Thanks
>>> Søren
>>>
>>
>> That's kind of cool. Is their development available for the community?
>> Are they releasing this upgrades/extensions under GPLv3 or compatible?
>
> As it is now this is purely research (i.e. not production code), which I doubt they will release. I don't know if they will release code once they have something for production.
>
> I do doubt that such would be of value to others as it is bound to be very specialised to their particular infrastructure, but I don't know.
>
> Søren
>

Generating parse trees from code would be very useful for automated
code generation as well...and research in general of course.
I would like to know what is their stand in relation to releasing
their developments back to the community. In Octconf the speaker from
Coursera politely avoided my question in this regard.
Reply | Threaded
Open this post in threaded view
|

Re: Syntax trees from strings

Søren Hauberg

On Jun 28, 2013, at 1:57 PM, Juan Pablo Carbajal <[hidden email]> wrote:
> Generating parse trees from code would be very useful for automated
> code generation as well...and research in general of course.
> I would like to know what is their stand in relation to releasing
> their developments back to the community. In Octconf the speaker from
> Coursera politely avoided my question in this regard.

I don't have an answer for this question (I'm not the one working one this, I'm just passing on a question I was asked in the hallway).

But if anybody knows if we are able to generate syntax trees from a string (rather than a file) then I'd be interested to hear about it.

Søren
Reply | Threaded
Open this post in threaded view
|

Re: Syntax trees from strings

John W. Eaton
Administrator
On 06/28/2013 08:24 AM, Søren Hauberg wrote:

>
> On Jun 28, 2013, at 1:57 PM, Juan Pablo Carbajal<[hidden email]>  wrote:
>> Generating parse trees from code would be very useful for automated
>> code generation as well...and research in general of course.
>> I would like to know what is their stand in relation to releasing
>> their developments back to the community. In Octconf the speaker from
>> Coursera politely avoided my question in this regard.
>
> I don't have an answer for this question (I'm not the one working one this, I'm just passing on a question I was asked in the hallway).
>
> But if anybody knows if we are able to generate syntax trees from a string (rather than a file) then I'd be interested to hear about it.

The eval function generates a parse tree and then evaluates it.  Look at
eval_string in oct-parse.in.yy in the current sources.

jwe

Reply | Threaded
Open this post in threaded view
|

Re: Syntax trees from strings

Søren Hauberg

On Jun 28, 2013, at 2:53 PM, John W. Eaton <[hidden email]> wrote:

> On 06/28/2013 08:24 AM, Søren Hauberg wrote:
>>
>> On Jun 28, 2013, at 1:57 PM, Juan Pablo Carbajal<[hidden email]>  wrote:
>>> Generating parse trees from code would be very useful for automated
>>> code generation as well...and research in general of course.
>>> I would like to know what is their stand in relation to releasing
>>> their developments back to the community. In Octconf the speaker from
>>> Coursera politely avoided my question in this regard.
>>
>> I don't have an answer for this question (I'm not the one working one this, I'm just passing on a question I was asked in the hallway).
>>
>> But if anybody knows if we are able to generate syntax trees from a string (rather than a file) then I'd be interested to hear about it.
>
> The eval function generates a parse tree and then evaluates it.  Look at eval_string in oct-parse.in.yy in the current sources.

Wonderful, thanks!

Søren