You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Xu Pengcheng (Jira)" <ji...@apache.org> on 2023/07/07 00:16:00 UTC

[jira] [Created] (JEXL-399) Needs support more javascript syntax

Xu Pengcheng created JEXL-399:
---------------------------------

             Summary: Needs support more javascript syntax
                 Key: JEXL-399
                 URL: https://issues.apache.org/jira/browse/JEXL-399
             Project: Commons JEXL
          Issue Type: New Feature
            Reporter: Xu Pengcheng


Hi, I am trying ask chatgpt to generate code for some cases, JEXL, as a lightweight, secure, easy to communicate with host solution, I think is the best option for java world.

Unfortunately, chatgpt seems is not familiar with Jexl syntax, so I tried to ask chatgpt to write as javascript, and I had implements most of the javascript build-in objects (like Array, Object, Math, console, etc) for JEXL, and 95% cases generated by chatgpt can run successfully.

However, some syntax error will cause the failure, for example:
 # a === b
 # a !== b
 # a = b ** 2
 # const \{a, b} = x;
 # a = \{x: 1, y: 2,}
 # func = () => (\{"a":1, "b": 2})

These syntax looks very reasonable, It will be great to support these javascript syntax to let both chatgpt and developer easy to use.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)