light and fast JavaScript engine

For discussions about programming, and for programming questions and advice


Moderator: Forum moderators

Post Reply
puppy-2020
Posts: 12
Joined: Sun Oct 18, 2020 9:12 am
Has thanked: 16 times

light and fast JavaScript engine

Post by puppy-2020 »

I want to learn JavaScript, but Firefox is a bit heavy in my old 32 bit PC (Pre-installed 'Light Web Browser' does not run in my PC. Illegal Instruction error. Although I do not try installing it with the Puppy Package Manager). I just need a light JavaScript engine for running my code.
I use BionicPup32.
trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: light and fast JavaScript engine

Post by trister »

Javascript support is usually better on chromium. Since you have an low-end PC, I would suggest to try older version of chromium (or any other browsers based on it (eg Slimjet,SW Iron,Iridium etc...). Chromium v61 browser has a very decent support for javascript .
I specifically use the old SW Iron v61-32bit browser and (to me) it seems that it has very good support for JS-it has run every JS site&script I've tried. For example, I found that Cisco Webex caused less problems in v61 that in the latest Chromium...

You can find the older browsers .deb files and install them manually or you could search the forums for older browsers SFS.

If you plan to learn the latest JS frameworks (angular,react etc) my suggestion will be to use latest google chrome or latest chromium-based browsers -even if they are slow on your PC. You will need a faster PC for them eventually.
User avatar
Wiz57
Moderator
Posts: 494
Joined: Fri Dec 13, 2019 3:54 pm
Location: Chickasha, OK USA
Has thanked: 74 times
Been thanked: 78 times

Re: light and fast JavaScript engine

Post by Wiz57 »

Which Puppy? Any info as to your systems specifications?
If you tried the Light browser, I'm assuming you are trying one of peebee's creations (uPupBB, ScPup, etc)
Light browser may be looking for SSE2, and if your CPU doesn't have those instructions, it will fail.
You might have to settle for an OLD browser, such as Opera 12.16 (last Presto release), which while it
handles older javascript OK, newer stuff chokes it and it also will probably fail security checks for TLS2.
Others you can look for are an older version of Palemoon 27 (27.4, I think) compiled for CPUs w/o SSE.
Wiz

Signature available upon request

trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: light and fast JavaScript engine

Post by trister »

trister wrote: Mon Oct 19, 2020 6:34 pm
I specifically use the old SW Iron v61-32bit browser and (to me) it seems that it has very good support for JS-it has run every JS site&script I've tried. For example, I found that Cisco Webex caused less problems in v61 that in the latest Chromium...
I forgot to mention that some of the machine I run SWiron are P4s with 512MB-728RAM. It runs at decent speeds with one or two tabs open.

Palemoon is the browser I use the most for surfing but it'w support for JS is not good (eg I post this message from the latest palemoon but some sites -like github-function very poorly in it).
puppy-2020
Posts: 12
Joined: Sun Oct 18, 2020 9:12 am
Has thanked: 16 times

Re: light and fast JavaScript engine

Post by puppy-2020 »

CPU and Memory of my PC:

Code: Select all

# lshw -class processor,memory -short
H/W path       Device      Class       Description
==================================================
/0/0                       memory      128KiB BIOS
/0/4                       processor   AMD Sempron(tm)   2600+
/0/4/9                     memory      128KiB L1 cache
/0/4/a                     memory      256KiB L2 cache
/0/1b                      memory      512MiB System Memory
/0/1b/0                    memory      DIMM [empty]
/0/1b/1                    memory      512MiB DIMM
/0/1b/2                    memory      DIMM [empty]
/0/100/0.1                 memory      RAM memory
/0/100/0.2                 memory      RAM memory
/0/100/0.3                 memory      RAM memory
/0/100/0.4                 memory      RAM memory
/0/100/0.5                 memory      RAM memory
trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: light and fast JavaScript engine

Post by trister »

Try iron-linux_61.tar.gz (http://download1.srware.net/old/iron/li ... _61.tar.gz - taken from here : http://download1.srware.net/old/iron/linux/) . Unzip it and try it (hoping you have its dependencies).
I recommend starting at v61. You can try and go down (or up) of v61 for faster/lighter/less compatible.

You could try the one I made & use for myself (I don't know if it will work in your puppy version) : https://1fichier.com/?wenkzsg0gd0wdo7s3195 (name of the file is iron32_flash_v61.deb_v02b-wflash.squashfs -rename it to *.sfs)

If you prefer to go the firefox way : http://ftp.mozilla.org/pub/firefox/releases/.
puppy-2020
Posts: 12
Joined: Sun Oct 18, 2020 9:12 am
Has thanked: 16 times

Re: light and fast JavaScript engine

Post by puppy-2020 »

trister wrote: Thu Oct 22, 2020 1:54 pm Try iron-linux_61.tar.gz (http://download1.srware.net/old/iron/li ... _61.tar.gz - taken from here : http://download1.srware.net/old/iron/linux/) . Unzip it and try it (hoping you have its dependencies).
I recommend starting at v61. You can try and go down (or up) of v61 for faster/lighter/less compatible.

You could try the one I made & use for myself (I don't know if it will work in your puppy version) : https://1fichier.com/?wenkzsg0gd0wdo7s3195 (name of the file is iron32_flash_v61.deb_v02b-wflash.squashfs -rename it to *.sfs)

If you prefer to go the firefox way : http://ftp.mozilla.org/pub/firefox/releases/.
I test iron linux 61 and 53. Both of them give Illegal instruction error.
So I test iron linux 31 and this error appears.
./iron: error while loading shared libraries: libgcrypt.so.11: cannot open shared object file: No such file or directory
find / | grep libgcrypt command in my system

Code: Select all

# find / | grep libgcrypt
find: ‘/proc/5201’: No such file or directory
/usr/bin/libgcrypt-config
/usr/share/aclocal/libgcrypt.m4
/usr/share/man/man1/libgcrypt-config.1.gz
/usr/lib/libgcrypt.a
/usr/lib/libgcrypt.so
/var/packages/builtin_files/libgcrypt
/lib/libgcrypt.so.20
/lib/libgcrypt.so.20.2.1
User avatar
Wiz57
Moderator
Posts: 494
Joined: Fri Dec 13, 2019 3:54 pm
Location: Chickasha, OK USA
Has thanked: 74 times
Been thanked: 78 times

Re: light and fast JavaScript engine

Post by Wiz57 »

I think you'll run into similar "errors" no matter which "newer" browser you try...
the AMD Sempron CPU you have is probably based on the old K7 microarchitecture,
which means it only supports SSE, not the newer SSE2, SSE3 etc. As I mentioned
above, this is going to restrict your choice, which is why I suggested Opera 12.16,
you might be able to get something like QtWeb to run (may need some QT libs)
or maybe Dillo (only partial javascript enabled). Another reason I suggested Opera
is those old versions had Dragonfly built in, which helped debugging javascript.
You won't be able to test, debug, or run newer javascript but for the basics it
may help. If you can't find it let me know, might be able to find something on
my old netbook in a tarball somewhere.
Wiz ;)

Signature available upon request

puppy-2020
Posts: 12
Joined: Sun Oct 18, 2020 9:12 am
Has thanked: 16 times

Re: light and fast JavaScript engine

Post by puppy-2020 »

Wiz57 wrote: Thu Oct 22, 2020 3:57 pm I think you'll run into similar "errors" no matter which "newer" browser you try...
the AMD Sempron CPU you have is probably based on the old K7 microarchitecture,
which means it only supports SSE, not the newer SSE2, SSE3 etc. As I mentioned
above, this is going to restrict your choice, which is why I suggested Opera 12.16,
you might be able to get something like QtWeb to run (may need some QT libs)
or maybe Dillo (only partial javascript enabled). Another reason I suggested Opera
is those old versions had Dragonfly built in, which helped debugging javascript.
You won't be able to test, debug, or run newer javascript but for the basics it
may help. If you can't find it let me know, might be able to find something on
my old netbook in a tarball somewhere.
Wiz ;)
It seems that the latest palemoon version which is compatible with SEE is palemoon-27.9.4SSE.linux-i686
http://li969-200.members.linode.com/puppy/viewtopic.php?p=1027003

https://forum.palemoon.org/viewtopic.php?f=40&t=13530&start=180

When I try to download palemoon-27.9.4SSE.linux-i686.tar.bz2 from the ftp server:

Code: Select all

wget -c ftp://contrib:get@ftp.palemoon.org/SSE-Linux/palemoon-27.9.4SSE.linux-i686.tar.bz2
--2020-10-22 20:26:46--  ftp://contrib:*password*@ftp.palemoon.org/SSE-Linux/palemoon-27.9.4SSE.linux-i686.tar.bz2
           => ‘palemoon-27.9.4SSE.linux-i686.tar.bz2’
Resolving ftp.palemoon.org (ftp.palemoon.org)... 80.255.0.190
Connecting to ftp.palemoon.org (ftp.palemoon.org)|80.255.0.190|:21... connected.
Logging in as contrib ... 
Login incorrect.
User avatar
Wiz57
Moderator
Posts: 494
Joined: Fri Dec 13, 2019 3:54 pm
Location: Chickasha, OK USA
Has thanked: 74 times
Been thanked: 78 times

Re: light and fast JavaScript engine

Post by Wiz57 »

puppy-2020 wrote: Thu Oct 22, 2020 4:58 pm
Wiz57 wrote: Thu Oct 22, 2020 3:57 pm I think you'll run into similar "errors" no matter which "newer" browser you try...
the AMD Sempron CPU you have is probably based on the old K7 microarchitecture,
which means it only supports SSE, not the newer SSE2, SSE3 etc. As I mentioned
above, this is going to restrict your choice, which is why I suggested Opera 12.16,
you might be able to get something like QtWeb to run (may need some QT libs)
or maybe Dillo (only partial javascript enabled). Another reason I suggested Opera
is those old versions had Dragonfly built in, which helped debugging javascript.
You won't be able to test, debug, or run newer javascript but for the basics it
may help. If you can't find it let me know, might be able to find something on
my old netbook in a tarball somewhere.
Wiz ;)
It seems that the latest palemoon version which is compatible with SEE is palemoon-27.9.4SSE.linux-i686
http://li969-200.members.linode.com/puppy/viewtopic.php?p=1027003

https://forum.palemoon.org/viewtopic.php?f=40&t=13530&start=180

When I try to download palemoon-27.9.4SSE.linux-i686.tar.bz2 from the ftp server:

Code: Select all

wget -c ftp://contrib:get@ftp.palemoon.org/SSE-Linux/palemoon-27.9.4SSE.linux-i686.tar.bz2
--2020-10-22 20:26:46--  ftp://contrib:*password*@ftp.palemoon.org/SSE-Linux/palemoon-27.9.4SSE.linux-i686.tar.bz2
           => ‘palemoon-27.9.4SSE.linux-i686.tar.bz2’
Resolving ftp.palemoon.org (ftp.palemoon.org)... 80.255.0.190
Connecting to ftp.palemoon.org (ftp.palemoon.org)|80.255.0.190|:21... connected.
Logging in as contrib ... 
Login incorrect.
Hmm, OK, try this...open a terminal, but instead of using wget, see if you can just use plain ftp
At commandline type ftp ftp.palemoon.org/SSE-Linux/palemoon-27.9.4SSE.linux-i686.tar.bz2 then press enter key,
if it allows anonymous ftp you should begin to download the file.
Wiz

Signature available upon request

User avatar
Wiz57
Moderator
Posts: 494
Joined: Fri Dec 13, 2019 3:54 pm
Location: Chickasha, OK USA
Has thanked: 74 times
Been thanked: 78 times

Re: light and fast JavaScript engine

Post by Wiz57 »

Here's a link to Palemoon pets with just SSE, thanks to Watchdog at Murga forum!
At the bottom of his post is latest.

http://murga-linux.com/puppy/viewtopic. ... 676#973676

Wiz

Signature available upon request

puppy-2020
Posts: 12
Joined: Sun Oct 18, 2020 9:12 am
Has thanked: 16 times

Re: light and fast JavaScript engine

Post by puppy-2020 »

Wiz57 wrote: Thu Oct 22, 2020 6:19 pm Here's a link to Palemoon pets with just SSE, thanks to Watchdog at Murga forum!
At the bottom of his post is latest.

http://murga-linux.com/puppy/viewtopic. ... 676#973676

Wiz
Now another error

Code: Select all

# palemoon 
XPCOMGlueLoad error for file /usr/lib/palemoon/libxul.so:
/usr/lib/palemoon/glibc219/lib/libc.so.6: version `GLIBC_2.25' not found (required by /lib/libexpat.so.1)
Couldn't load XPCOM.
User avatar
Wiz57
Moderator
Posts: 494
Joined: Fri Dec 13, 2019 3:54 pm
Location: Chickasha, OK USA
Has thanked: 74 times
Been thanked: 78 times

Re: light and fast JavaScript engine

Post by Wiz57 »

Now another error

Code: Select all

# palemoon
XPCOMGlueLoad error for file /usr/lib/palemoon/libxul.so:
/usr/lib/palemoon/glibc219/lib/libc.so.6: version `GLIBC_2.25' not found (required by /lib/libexpat.so.1)
Couldn't load XPCOM.

Top
Hmm, this one MIGHT be solvable via the PPM, look for glibc2 and see if an update is in the repo.
If not, maybe one of the Mikes will drop by, they have a good handle on this one I think!
Wiz ;)

Signature available upon request

User avatar
OscarTalks
Posts: 609
Joined: Tue Jul 14, 2020 10:11 pm
Location: London UK
Has thanked: 1 time
Been thanked: 232 times

Re: light and fast JavaScript engine

Post by OscarTalks »

NetSurf browser is much smaller and lighter than any of the big browsers and it contains a JavaScript engine called duktape.
Be aware that you need to go into Preferences (Content tab) and enable JavaScript.
I don't know if it would be suitable for purpose or indeed if it will run on older SSE hardware, but if you want to give it a try there is one compiled in BionicPup32 here:-
http://smokey01.com/OscarTalks/netsurf- ... bionic.pet
User avatar
mikeslr
Posts: 2821
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 852 times

Re: light and fast JavaScript engine

Post by mikeslr »

puppy2020 "# palemoon
XPCOMGlueLoad error for file /usr/lib/palemoon/libxul.so:
/usr/lib/palemoon/glibc219/lib/libc.so.6: version `GLIBC_2.25' not found (required by /lib/libexpat.so.1)
Couldn't load XPCOM."

Well, this Mike dropped by. But I don't know why the palemoon specially constructed to use glibc219 would be trying to use glibc225. Perhaps there was a prior palemoon (builtin? subsequently installed?) and the installation of watchdog's tweaked version didn't completely overwrite it. Suggest uninstalling/removing builtins of any existing palemoon, make certain no trace remains, shutdown/reboot updating your SaveFile/Folder to 'lockin' those changes; then re-install wathdog's pet.

Alterntively, again after making certain that your system is 'palemoon-free', try jrb's palemoon_portainstall-27.9.4SSE-0.4.pet, from here, http://www.murga-linux.com/puppy/viewto ... 47#1027747. Read the "caution" on that post. [I only know of this pets existence; have never tried it].
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

Re: light and fast JavaScript engine

Post by sc0ttman »

DO NOT USE PALEMOON as your main browser for testing JavaScript applications.. It's Javascript engine falls over on all sorts of things - evidenced by the fact many sites don't work on it.

If you want a lightweight JS REPL, install NodeJS .. There is very little alternative, unless you wanna learn a weird, more complex, subset of JS (ducktape, as mentioned above).

Install NodeJS.. Just get version 10 or later.

Optionally, manage it's versions with `nv` (on github, a simple, single shell script), or the much more famous and bloated `nvm` (also on github).

Then, once you have node installed, write file.js, and just do

Code: Select all

node file.js
Use this in your JS to print to the terminal:

Code: Select all

console.log("foo", var1, var2);
Or even more of a "one liner", do this:

Code: Select all

FOO=bar; node -e 'console.log(`FOO is ${process.env.FOO}`)'
Or

Code: Select all

FOO=bar
export FOO
node -e 'console.log(`FOO is ${process.env.FOO}`)'
---

I wrote a JS based teste suite, which is small and hackable - http://github.com/sc0ttj/tea

It contains a nice little logger function which can log in colour to terminal or the browsers "dev tools" console

It also contains a nice little functions for parsing/using command line options passed into your .js scripts, like:

Code: Select all

node myscript.js --cool-option=yes --fail=never --always
User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Re: light and fast JavaScript engine

Post by puppy_apprentice »

Try those:
PhantomJS - Scriptable Headless Browser
https://phantomjs.org/

Jsi is a javascript-ish interpreter with builtin websocket-server, sqlite and C-extensibility.
https://jsish.org/fossil/jsi/doc/ckout/README.md
https://en.wikipedia.org/wiki/Jsish
My attempts (3 years old on version 1.0)

Code: Select all

#!/usr/local/bin/jsish
var string;
console.log("Write your name: ");
string = console.input();
console.log("Hello World to You " + string);

console.log("What kind of fruits do you like?");
string = console.input();
switch (string)
{
	case "bananas": console.log("Are You monkey?");
			break;
	case "oranges": console.log("I like them too!");
			break;
	default: console.log("Yum, yum ;)");
}

Code: Select all

#!/usr/local/bin/jsish
for (var i in console.args) {
   puts(console.args[i]);
}

Code: Select all

var now = new Date(),
    weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
    months   = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
    fmt1 = now.getFullYear() + '-' + (1 + now.getMonth()) + '-' + now.getDate(),
    fmt2 = weekdays[now.getDay()] + ', ' + months[now.getMonth()] + ' ' + now.getDate() + ', ' + now.getFullYear();
console.log(fmt1);
console.log(fmt2);

Code: Select all

console.log("What is you name");
var name = console.input();
console.log("Hello " + name + "!");

Code: Select all

console.log(Math.abs(-1));
console.log(Math.acos(-1));
console.log(Math.asin(-1));
console.log(Math.atan(-1));
console.log(Math.atan2(-1,-1));
console.log(Math.ceil(-1.2));
console.log(Math.cos(0));
console.log(Math.exp(1));
console.log(Math.floor(-1.2));
console.log(Math.log(10));
console.log(Math.max(-1,0,4));
console.log(Math.min(-1,0,4));
console.log(Math.pow(-1,2));
console.log(Math.random());
console.log(Math.round(-1));
console.log(Math.sin(1.578947));
console.log(Math.sqrt(9));
console.log(Math.tan(1));

Code: Select all

var string1 = new String(" The quick brown fox"); // or string1 = " The quick brown fox"
var string2 = new String(" jumps over the lazy dog ");
var string = string1.concat(string2); // or string = string1 + string2

console.log("1.", string);

//stringObject.charAt(index)
console.log("2.", string.charAt(1));

//error?
console.log("3.", string.charCodeAt(1));

//fromCharCode(code)
console.log("4.", string.fromCharCode(84));

//stringObject.indexOf(string)
console.log("5.", string.indexOf("e"));

console.log("6.", string.lastIndexOf("e"));
console.log("7.", string.match(/[A-Z]/g)[0]);
console.log("8.", string.replace(/[A-Z]/g,"t"));
console.log("9.", string.search(/[a-z]/g));
console.log("10.", string.slice(0,6));
console.log("11.", string.slice(6));
console.log("12.", string.split(" ")[0]);
console.log("13.", string.substr(0,6));
console.log("14.", string.substring(0,6));
//toLocaleLowerCase()
//toLocaleUpperCase()
//toLowerCase()
//toTitle(?chars?)
//toUpperCase()
console.log("20.", string.trim(" "));
console.log("21.", string.trimLeft(" "));
console.log("22.", string.trimRight(" "));

JSDB is JavaScript for databases, a scripting language for data-driven, network-centric programming on Windows, Mac, Linux, and SunOS. JSDB works with databases, XML, the web, and email. It is free and open-source. Use it as a JavaScript shell, to run CGI programs, or as a web server.
http://www.jsdb.org/

sanjupawar
Posts: 1
Joined: Mon Dec 07, 2020 12:48 pm

Re: light and fast JavaScript engine

Post by sanjupawar »

Thanks...........

Know all the gossip, upcoming movies, web series at one place and get all the updates. upcoming web series hindi

Post Reply

Return to “Programming”