Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39686

Re: Looking for a JavaScript interpreter

Path csiph.com!weretis.net!feeder8.news.weretis.net!news.mb-net.net!open-news-network.org!.POSTED.178.197.205.169!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Looking for a JavaScript interpreter
Date Thu, 18 Mar 2021 05:47:29 +0100
Organization PointedEars Software (PES)
Lines 85
Message-ID <1930786.oMNUckLgyt@PointedEars.de> (permalink)
References <20210317154200.2f685719d07aa0270fea6a3c@g{oogle}mail.com>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
Injection-Info gwaiyur.mb-net.net; posting-host="178.197.205.169"; logging-data="14157"; mail-complaints-to="abuse@open-news-network.org"
User-Agent KNode/4.14.10
Cancel-Lock sha1:YjW6NbhwZZ2g6uxEDG7dY4CIGmg=
X-User-ID U2FsdGVkX1+3sNTAa9gF8RAy2aM+khhATavCBWIOgjLBb95p7Mxa2Q==
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Xref csiph.com comp.lang.javascript:39686

Show key headers only | View raw


Anton Shepelev wrote:

> What interpreters can you suggest for learing JavaScript?

First I would strongly recommend that you familiarize yourself with the 
subject matter.  You have several misconceptions there to clear before you 
can begin developing (ECMAScript-based) software successfully:

You will NOT be learning one programming language named ”JavaScript”, but 
basically several programming languages, some of which have “JavaScript” in 
their name, that are very similar because they are based on, or are 
implementations of, the same language standard, ECMAScript.

In which programming language your program is considered to have been 
written will mostly be determined *at runtime* and depends on the runtime 
environment and the implementation that it supports.

Therefore, you will have to learn to write code in a way that is most 
compatible without sacrificing too much efficiency.  Since there are many 
different editions of ECMAScript, and several implementations whose many 
versions implement them partially or not at all, the standard leaves some 
wiggle room (implementation-dependent behavior), and not all language 
features can be detected, doing this robustly *and* efficiently is *hard*, 
and requires a lot of experience.  Expect that process to take several 
*years*, and you will have to keep up as changes are introduced into the 
standard every year.

While writing the code, one uses code checkers like ESLint, which can be 
integrated into an IDE, to avoid major pitfalls.

Second, there is no interpreter as such.  In all relevant cases, programs 
written in ECMAScript-based programming languages are JIT-*compiled*.  
Scripting engines like Mozilla SpiderMonkey (used to) compile them to 
bytecode which is then interpreted; scripting engines like Google V8 compile 
them to machine code which is executed directly.

> I can't seem to find a light and simple stand-alone
> interpreter, not developed by a mega-corporation and
> distributed as a small executable,

That probably has to do with the fact that you are searching for a 
*standalone* *interpreter*, which for the reasons mentioned above does not 
exist.  The only interpreter I know would have to be one that interprets 
bytecode, and it is usually contained in the code of the virtual machine of 
the scripting engine.

> so that I can develop JavaScript programs in my favourite general-purpose
> IDE or text editor, without reliance upon a browser or huge specialised
> IDE.  I need something like the Tiny C Compiler for the C language -- a
> standalone minimalistic tool.

The main difference between ECMAScript-based programming languages and 
languages like C is that the former are *scripting* languages: They are 
general-purpose programming languages, but standalone they are useless:  
Always there has to be a *runtime environment* that has to provide an API 
such that its features can be accessed using the languages.

See also the ECMAScript Support Matrix referred by my signature.
 
> Such scripting languages as Lua and Python provide official
> open-source interpreters

Actually, Python source code is JIT-compiled to bytecode (.pyc files), and 
then *the bytecode* is interpreted by a VM, too.  In many cases (for another 
example: Perl) this is how scripting languages actually work.

> with ready binaries for all major OSes. Does JavaScript has anything like
> that?

There are some implementations with “JavaScript” in their name whose 
scripting engine is provided as a binary.  One of them is Google V8 
JavaScript.
 
> I looking for a Windows interpreter,

No problem, although you may have to compile it first.

> preferably supporting Windows XP.

A very bad idea.
 
-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Looking for a JavaScript interpreter Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-03-17 15:42 +0300
  Re: Looking for a JavaScript interpreter "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-17 06:33 -0700
    Re: Looking for a JavaScript interpreter Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-03-17 18:24 +0300
      Re: Looking for a JavaScript interpreter "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-17 11:50 -0700
  Re: Looking for a JavaScript interpreter Jon Ribbens <jon+usenet@unequivocal.eu> - 2021-03-17 15:39 +0000
  Re: Looking for a JavaScript interpreter JJ <jj4public@gmail.com> - 2021-03-18 01:43 +0700
  Re: Looking for a JavaScript interpreter Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-03-18 05:47 +0100
  Re: Looking for a JavaScript interpreter Jean-Francois Moine <moinejf@free.fr> - 2021-03-18 09:36 +0100
    Re: Looking for a JavaScript interpreter Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-03-18 12:07 +0100
      Re: Looking for a JavaScript interpreter Jean-Francois Moine <moinejf@free.fr> - 2021-03-18 15:28 +0100
        Re: Looking for a JavaScript interpreter Anton Shepelev <antonius@freeshell.de> - 2021-03-18 18:56 +0300
  Re: Looking for a JavaScript interpreter Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-03-18 15:57 +0300
  Re: Looking for a JavaScript interpreter "dcwh...@gmail.com" <dcwhatthe@gmail.com> - 2021-07-27 17:51 -0700
    Re: Looking for a JavaScript interpreter "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-07-28 08:26 -0700

csiph-web