From 3ccd55497729377f7319a1e6d33acc92219260c9 Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Thu, 6 Feb 2025 15:49:11 -0500 Subject: [PATCH] HPCC-33344 Remove references to Javascript from docs Signed-off-by: Jim DeFabia --- .../ECLR_mods/BltInFunc-IMPORT.xml | 16 ++- .../ECLR_mods/SpecStruc-EMBED.xml | 14 +-- docs/EN_US/HPCCClientTools/CT_Mods/ECLCC.xml | 9 +- .../Installing_and_RunningTheHPCCPlatform.xml | 67 +---------- initfiles/examples/embed/javascript-catch.ecl | 19 --- .../examples/embed/javascript-simple.ecl | 109 ------------------ .../examples/embed/javascript-simple2.ecl | 21 ---- 7 files changed, 21 insertions(+), 234 deletions(-) delete mode 100644 initfiles/examples/embed/javascript-catch.ecl delete mode 100644 initfiles/examples/embed/javascript-simple.ecl delete mode 100644 initfiles/examples/embed/javascript-simple2.ecl diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-IMPORT.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-IMPORT.xml index b69ce609dd9..0bcd645d08e 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-IMPORT.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-IMPORT.xml @@ -13,7 +13,7 @@ - + @@ -43,10 +43,10 @@ Specifies the name of the external programming language whose code you wish to embed in your ECL. A language support module for that language must have been installed in your plugins directory. - Modules are provided for languages such as Java, R, Javascript, and - Python. You can write your own pluggable language support module for - any language not already supported by using the supplied ones as - examples or starting points. + Modules are provided for languages such as Java and Python. You can + write your own pluggable language support module for any language + not already supported by using the supplied ones as examples or + starting points. @@ -75,10 +75,8 @@ The IMPORT declaration allows you to call existing code written in the external language. - This may be used to call Java or Python code, but is not usable with - Javascript or R code (use the EMBED structure instead). Java code must be - placed in a .java file and compiled using the javac compiler in the usual - way. All Java classes used must be thread safe. + Java code must be placed in a .java file and compiled using the javac + compiler in the usual way. All Java classes used must be thread safe. WARNING: This feature could create memory corruption and/or security issues, so great care and forethought are diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/SpecStruc-EMBED.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/SpecStruc-EMBED.xml index be2855e42f6..4764479e3f8 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/SpecStruc-EMBED.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/SpecStruc-EMBED.xml @@ -62,9 +62,9 @@ The name of the programming language being embedded. A language support module for that language must have been installed in your plugins directory. Modules are provided for languages such - as Java, R, Javascript, and Python. You can write your own pluggable - language support module for any language not already supported by - using the supplied ones as examples or starting points. + as Java and Python. You can write your own pluggable language + support module for any language not already supported by using the + supplied ones as examples or starting points. @@ -94,10 +94,10 @@ to add in-line language code to your ECL. This is similar to the BEGINC++ structure, but available for any language with a pluggable language support module - installed, such as Javascript and Python. Others may follow or people can - write their own using the supplied ones as templates/examples/starting - points. This may be used to write Javascript or Python code, but is not - usable with Java code (use the IMPORT function for Java code). + installed, such as Java and Python. Others may follow or people can write + their own using the supplied ones as templates/examples/starting points. + This is not usable with Java code (use the IMPORT function for Java + code). The parameter types that can be passed and returned will vary by language, but in general the simple scalar types diff --git a/docs/EN_US/HPCCClientTools/CT_Mods/ECLCC.xml b/docs/EN_US/HPCCClientTools/CT_Mods/ECLCC.xml index 0a43c59b48f..b2d06b1cd64 100644 --- a/docs/EN_US/HPCCClientTools/CT_Mods/ECLCC.xml +++ b/docs/EN_US/HPCCClientTools/CT_Mods/ECLCC.xml @@ -442,7 +442,7 @@ Allow use of named feature. (e.g., cpp, pipe, all)cpp: Allow embedded - code within ECL (e.g., c++, JAVA, Javascript, Python, R, + code within ECL (e.g., c++, JAVA, Python, etc.)pipe: Allow the PIPE command to send data to an external program.userECL: @@ -517,10 +517,9 @@ Disallow use of named featurecpp: Disallow embedded code within ECL - (e.g., c++, JAVA, Javascript, Python, R, - etc.)pipe: - Disallow the PIPE command to send data to an external - program. + (e.g., c++, JAVA, Python, etc.)pipe: Disallow the PIPE command to send + data to an external program. diff --git a/docs/EN_US/Installing_and_RunningTheHPCCPlatform/Installing_and_RunningTheHPCCPlatform.xml b/docs/EN_US/Installing_and_RunningTheHPCCPlatform/Installing_and_RunningTheHPCCPlatform.xml index 396505c93b4..cf72ada2d83 100644 --- a/docs/EN_US/Installing_and_RunningTheHPCCPlatform/Installing_and_RunningTheHPCCPlatform.xml +++ b/docs/EN_US/Installing_and_RunningTheHPCCPlatform/Installing_and_RunningTheHPCCPlatform.xml @@ -2180,10 +2180,6 @@ sudo /etc/init.d/hpcc-init -c esp start Java - - JavaScript - - Python (full support is already built-in) @@ -2194,9 +2190,9 @@ sudo /etc/init.d/hpcc-init -c esp start In addition to these languages, you can add support for additional languages by creating your own plugin. This is not very difficult to do. - For example the JavaScript plugin is about 500 lines of C++ code. You - can use that as a template to write your own and, if desired, you can - contribute it back to the open source initiative. + For example the Java plugin is about 500 lines of C++ code. You can use + that as a template to write your own and, if desired, you can contribute + it back to the open source initiative. Java @@ -2304,63 +2300,6 @@ add1(10); url="https://github.com/hpcc-systems/HPCC-Platform/tree/master/testing/ecl/embedjava.ecl">https://github.com/hpcc-systems/HPCC-Platform/blob/master/testing/regress/ecl/embedjava.ecl - - JavaScript - - To enable JavaScript support within the HPCC - Systems® Platform: - - - - Install the appropriate dependencies for your - platform. - - RPM-based systems: - - On an RPM-based system (CentOS/Red Hat) install v8embed. - - Debian-based - systems: - - For a Debian-based system (Ubuntu) install the libv8-dev package. - - - - Test the JavaScript integration. - - JavaScript does multi-thread, as a result this can be the - fastest of the currently supported embedded languages. - - You can now execute some JavaScript code either in your ECL - IDE or the ECL Playground. - - For example: - - //nothor - -IMPORT javascript; - -javascript.Language.syntaxcheck('1+2'); - -integer add1(integer val) := EMBED(javascript) val+1; ENDEMBED; - -data testData(data val) := EMBED(javascript) val[0] = val[0] + 1; val; ENDEMBED; -set of integer testSet(set of integer val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -add1(10); -If this successfully executes, you have correctly set up - JavaScript to work with your HPCC Systems platform. - - - - Python diff --git a/initfiles/examples/embed/javascript-catch.ecl b/initfiles/examples/embed/javascript-catch.ecl deleted file mode 100644 index 71358c5b486..00000000000 --- a/initfiles/examples/embed/javascript-catch.ecl +++ /dev/null @@ -1,19 +0,0 @@ -IMPORT javascript; - -/* - This example illustrates and tests the use of embedded JavaScript -*/ - -// Mapping of exceptions from JavaScript to ECL - -integer testThrow(integer val) := EMBED(javascript) throw new Error("Error from JavaScript"); ENDEMBED; - -d := dataset([{ 1, '' }], { integer a, string m} ) : stored('nofold'); - -d t := transform - self.a := FAILCODE; - self.m := FAILMESSAGE; - self := []; -end; - -catch(d(testThrow(a) = a), onfail(t)); diff --git a/initfiles/examples/embed/javascript-simple.ecl b/initfiles/examples/embed/javascript-simple.ecl deleted file mode 100644 index ef0d38f18cc..00000000000 --- a/initfiles/examples/embed/javascript-simple.ecl +++ /dev/null @@ -1,109 +0,0 @@ -IMPORT javascript; - -/* - This example illustrates and tests the use of embedded JavaScript - */ - -// Scalar parameters and resuls - -integer add1(integer val) := EMBED(javascript) val+1; ENDEMBED; -string add2(string val) := EMBED(javascript) val+'1'; ENDEMBED; -string add3(varstring val) := EMBED(javascript) val+'1'; ENDEMBED; -utf8 add4(utf8 val) := EMBED(javascript) val+'1'; ENDEMBED; -unicode add5(unicode val) := EMBED(javascript, U' val+\' at Oh là là Straße\';'); - -data testData(data val) := EMBED(javascript) val[0] = val[0] + 1; val; ENDEMBED; - -// Sets - -set of integer testSet(set of integer val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of unsigned2 testSet0(set of unsigned2 val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of string testSet2(set of string val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of string testSet3(set of string8 val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of varstring testSet4(set of varstring val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of varstring8 testSet5(set of varstring8 val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of boolean testSet6(set of boolean val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of real4 testSet7(set of real4 val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of real8 testSet8(set of real8 val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -set of integer2 testSet9(set of integer2 val) := EMBED(javascript) -t = val [1]; -val[1] = val[2]; -val[2] = t; -val; -ENDEMBED; - -// Now run the tests... - -add1(10); -add2('Hello'); -add3('World'); -add4(U'Oh là là Straße'); -add5(U'Стоял'); - -add2('Oh là là Straße'); // Passing latin chars - should be untranslated - -testdata(D'aa'); -testSet([1,2,3]); -testSet0([30000,40000,50000]); -testSet2(['one','two','three']); -testSet3(['uno','dos','tre']); -testSet4(['un','deux','trois']); -testSet5(['ein','zwei','drei']); -testSet6([false,true,false,true]); -testSet7([1.1,2.2,3.3]); -testSet8([1.2,2.3,3.4]); -testSet9([-111,0,113]); diff --git a/initfiles/examples/embed/javascript-simple2.ecl b/initfiles/examples/embed/javascript-simple2.ecl deleted file mode 100644 index ec2616869eb..00000000000 --- a/initfiles/examples/embed/javascript-simple2.ecl +++ /dev/null @@ -1,21 +0,0 @@ -import Javascript; -/* - This example illustrates and tests the use of embedded JavaScript. - In this example the javascript that is embedded is more complex, including a definition of a function - */ - -string anagram(string word) := EMBED(Javascript) - -function anagram(word) -{ - if (word == 'cat') - return 'act'; - else - return word; -} - -anagram(word) -ENDEMBED; - -anagram('dog'); -anagram('cat'); \ No newline at end of file