[ 
https://issues.apache.org/jira/browse/PIG-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12590125#action_12590125
 ] 

Alan Gates commented on PIG-206:
--------------------------------

I do not think there is a consensus answer to your question at this point.  I 
have heard people advocate two possible tracks:

1) There's no reason to invent another scripting language, there is no lack of 
scripting languages.  It's better to embed pig in one or more of the existing 
ones.  This could be done in a way similar to DBI in perl.  Another suggestion 
of how to do it is a tighter integration with the actual parser of the 
language.  In python there are hooks into the parser that you can attach to, so 
that if the python parser can't understand a line of code it will hand it off 
to your module to interpret.  In this way pig could embed itself into python, 
make use of their constructs and syntax, etc.

The pros to this approach are that pig gets all the features of a scripting 
language for (nearly) free.

The cons are:
        A) Passing up certain optimization opportunities (eg loop unrolling) 
that you can do if you control the entire syntax tree.
        B) Risk getting tied to one language.  It may be difficult to maintain 
embeddings in multiple languages, leading to best support for only one.  This 
could lead to alienating users who don't know/like that one scripting language.
        C) Risk getting tied to an old version of a language.  If we embed in 
python, how much work is it for us when the next python version comes out and 
the interfaces change?  Are we going to be forever playing catchup?

2) We should make pig into a Turing complete language.  

Pros:
        A) Total control, we can design the language the way we want, optimize 
anything, etc.
        B) Self containment, users can write UDFs in pig directly rather than 
needing to go to a second language.
        
Cons:
        A) Pile of work!
        B) Usability.  Users don't want to learn a new syntax for while, if, 
etc.  It's easier for users to stick with already popular scripting languages. 




> Right granularity for a pig script
> ----------------------------------
>
>                 Key: PIG-206
>                 URL: https://issues.apache.org/jira/browse/PIG-206
>             Project: Pig
>          Issue Type: Wish
>            Reporter: Mathieu Poumeyrol
>
> I'd like to understand what people have in mind when they picture pig 
> scripts...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to