LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-11-2022, 10:51 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,120

Rep: Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371

Quote:
Originally Posted by Linux_Kidd View Post
1sec. Scripting languages are interpreted, right? So the scripting itself is not really software, because w/o the interpreter the script can't do anything.
That in contrast to say compiled programs that load (hook) and run (execute) directly on the hardware.

In my view, the interpreters are the items that do things (aka "the software"), by reading the scripting.

Do I have it wrong?
It is not that easy. What is a compiler, what is an interpreted language?
For example python/perl are scripting languages, but are compiled into byte code and that is executed afterward.
Java is not a scripting language, but compiled and executed almost the same way.
C and C++ also first compiled into some kind of byte code and that will be again compiled into binary. What about Jython and CPython?
Java and python (and perl) never (cannot be) executed directly on the hardware, but in a VM (virtual machine). Although there were attempts to make real hardware to directly execute java byte code.
And what about javascript? And what about for example the c64 emulator, where the full hardware is emulated (including video, audio, cpu and other parts)?

Or for example what about embedded code, when you mix two or more languages in one system (file)?
 
Old 05-11-2022, 11:08 AM   #17
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,787

Rep: Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773
Quote:
Originally Posted by Linux_Kidd View Post
1sec. Scripting languages are interpreted, right? So the scripting itself is not really software, because w/o the interpreter the script can't do anything.
That in contrast to say compiled programs that load (hook) and run (execute) directly on the hardware.

In my view, the interpreters are the items that do things (aka "the software"), by reading the scripting.

Do I have it wrong?
Yes, you DO have it wrong. The interpreter is software, that interprets other and higher level software. Firmware is software. Your shell script is software. Any interpreted language is just software that has other software as a runtime requirement. A compiled language that does not compile to native (machine) code is also software that translates higher level software to a different form of software that has a runtime requirement. Generally a macro assembler is software that compiles a higher level language down to native code that may NOT have a runtime software requirement. It is still all software.
 
Old 05-11-2022, 11:54 AM   #18
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Not many C programs will run on bare hardware. Most depend on a loader and runtime C library, so are they interpreted?

If you say that scripting languages are any languages not compiled to native machine code, then Java is interpreted and Common Lisp is compiled, which may start some arguments.

If you say that languages that have separate compilation and runtime steps are compiled languages, then that includes Perl.

I think any definition is going to have some gray areas.
 
Old 05-11-2022, 03:14 PM   #19
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,704
Blog Entries: 19

Rep: Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503Reputation: 4503
One thing that has always puzzled me is that people talk about shell scripts and perl scripts but python programs. Why?
 
Old 05-11-2022, 05:02 PM   #20
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,645

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564

Do they?

I'd say "Python scripts" to reference a plurality of .py files, or "Python application" to reference a piece of software made up of one or more scripts.

A script is explicitly a single file, but an application/program can be multiple files, and the latter are not common with Bash. (Not sure about Perl.)


Last edited by boughtonp; 05-11-2022 at 05:03 PM.
 
Old 05-11-2022, 06:15 PM   #21
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,706
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
Every language system – whether compiled or interpreted – begins its work by transforming the source code into some form of AST = Abstract-Syntax Tree. This is then processed to produce a set of low-level pseudo-instructions that actually drive the runtime of the interpreter. (Or, to produce object code, in a compiler.) The Python language actually saves this into a ".pyc" file.

The process of doing this preliminary step is so fast that we can simply ignore it.

Many languages, including compiled ones, use the "bytecode" approach. Even the original Apple ][, in its "Integer BASIC," did the same. (Steve Wozniak needed a "16-bit processor" but didn't have one, so he invented what he called "SWEET16.") A very lightweight program-loop can carry out a process that is represented in bytecode, which of course is very compact, and the "overhead" of that loop is inconsequential. Microsoft's various "compiled" languages use this approach frequently to produce smaller files.

Languages like Java and Adobe Flash use compilers which produce "bytecode" as their only output. The "JVM" runtime system used by Java is by now quite large, but the bytecode is quite small because a single bytecode instruction can invoke a very large amount of code within the JVM runtime.

All language systems today rely upon the presence of a binary dynamic library: "MSVCRTxx.DLL" in Windows, "glibc" in Linux/Unix, and many more. The compiled code is built to first load this library, then to make calls into it to do a great many things. This is generally considered preferable to "static linking," which produces much larger executables. (A single copy of the dynamic library is also shared by every process that is now using it, which translates to a considerable economy of RAM use.)

Last edited by sundialsvcs; 05-11-2022 at 06:24 PM.
 
Old 05-11-2022, 08:13 PM   #22
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,268

Rep: Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341
Quote:
Originally Posted by Linux_Kidd View Post
1sec. Scripting languages are interpreted, right? So the scripting itself is not really software, because w/o the interpreter the script can't do anything.
That in contrast to say compiled programs that load (hook) and run (execute) directly on the hardware.

In my view, the interpreters are the items that do things (aka "the software"), by reading the scripting.

Do I have it wrong?
You seriously arguing that the PHP that powers Facebook isn't software?
 
Old 05-11-2022, 08:26 PM   #23
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by smallpond View Post
Not many C programs will run on bare hardware. Most depend on a loader and runtime C library, so are they interpreted?
All compilers reduce the source code to machine language. The difference between interpreted compilers and regular compilers is that the regular compiler saves its machine code output on a hard drive so that you don't have to compile the source again the next time you run the program while an interpreted compiler throws away the machine code after each run so that you have to compile the program every time that you run it.
 
Old 05-11-2022, 09:21 PM   #24
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,787

Rep: Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773
Quote:
Originally Posted by jailbait View Post
All compilers reduce the source code to machine language. The difference between interpreted compilers and regular compilers is that the regular compiler saves its machine code output on a hard drive so that you don't have to compile the source again the next time you run the program while an interpreted compiler throws away the machine code after each run so that you have to compile the program every time that you run it.
No, not all compilers reduce to machine code. In fact, the ones that do are in the minority. Java, like p-code compilers, compiles source to an p-code that is then interpreted by a run time engine or interpreter. PERL does the same thing, and in version 4 and early 5 you could output the object code to a file. That file was not human readable, but would run on any platform with PERL installed. (It seems that was tricky to maintain, so they soon disabled that in version 5)

SOME compilers compile to machine code, and that reult then is NOT portable between platforms. V (v-lang) is a native code compiler, and some C compilers are as well. Early FORTRAN and COBOL compiled to machine code, but later engines may not. There are also compilers that compile source in one language (say MODULA-3) and output source in another language (perhaps C) to make it trivial to port the language engine to new platforms. (Such engine sources port and run quickly on any platform where a C compiler has been ported.)
There are special cases such as FORTH that run on a small (about 2K) core and compile to a psudo machine code. This makes it incredibly fast and portable to new hardware, and shockingly efficient and appropriate for embedded devices. It contains a compiler that compiles source code, but the compiler can be modified on the fly to change the nature of the output code! (Software magic! Smalltalk can do something similar at a higher level.)
Pure interpreted language never result in machine code, they result in a lower level source code that is executed by the interpreter runtime. Compilers input source in one form, and output code in a different form machine code being only one valid option.
Confusing the issue, is that there is nothing preventing someone from building a native code compiler for a pure interpreted language syntax! This we have compilers for BASIC and interpreters for C and Pascal.

Bottom line, if the code is instructions that result in execution by the hardware then it is software. Thus the term software applies to the source, interpreter, compiler, compiled source or object equally. This also describes both script source and the script interpreter or shell.

Last edited by wpeckham; 05-11-2022 at 09:28 PM.
 
1 members found this post helpful.
Old 05-11-2022, 11:08 PM   #25
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Linux_Kidd View Post
1sec. Scripting languages are interpreted, right? So the scripting itself is not really software, because w/o the interpreter the script can't do anything.
That in contrast to say compiled programs that load (hook) and run (execute) directly on the hardware.

In my view, the interpreters are the items that do things (aka "the software"), by reading the scripting.

Do I have it wrong?
You have it right in principle (with the caveats mentioned above) - except for the conclusion: it doesn't mean that a script isn't software.
Again, go to my post #5 and see how much of your installed software is at least partly scripted. You might be surprised.
 
Old 05-12-2022, 12:20 AM   #26
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,120

Rep: Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371
Quote:
Originally Posted by jailbait View Post
All compilers reduce the source code to machine language. The difference between interpreted compilers and regular compilers is that the regular compiler saves its machine code output on a hard drive so that you don't have to compile the source again the next time you run the program while an interpreted compiler throws away the machine code after each run so that you have to compile the program every time that you run it.
On ESP8266 (and similar chips, like esp32) you can have microPython installed, that means the OS can directly run python code (and nothing else).

Python (not micropython) can store precompiled code next to the source files, those are the .pyc files.
 
Old 05-12-2022, 11:34 AM   #27
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Quote:
Originally Posted by wpeckham View Post
No, not all compilers reduce to machine code. In fact, the ones that do are in the minority. Java, like p-code compilers, compiles source to an p-code that is then interpreted by a run time engine or interpreter.

And the interpreter creates machine code which it runs on the hardware.

The CPU will only run machine code. It will not run intermediate tables created by a multi-pass compiler. No matter what logic path a compiler takes it must ultimately present machine code to the CPU.

Last edited by jailbait; 05-12-2022 at 11:54 AM.
 
1 members found this post helpful.
Old 05-12-2022, 12:02 PM   #28
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,120

Rep: Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371Reputation: 7371
Quote:
Originally Posted by jailbait View Post
And the interpreter creates machine code which it runs on the hardware.

The CPU will only run machine code. It will not run intermediate tables created by a multi-pass compiler. No matter what logic path a compiler takes it must ultimately present machine code to the CPU.
the "engine" (or VM) will run the bytecode, you can say every bytecode will be "translated" to a function or call of a subroutine (within the engine). The real executed machine code is part of the engine, compiled elsewhere.
 
Old 05-12-2022, 01:41 PM   #29
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,787

Rep: Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773Reputation: 2773
Quote:
Originally Posted by jailbait View Post
And the interpreter creates machine code which it runs on the hardware.

The CPU will only run machine code. It will not run intermediate tables created by a multi-pass compiler. No matter what logic path a compiler takes it must ultimately present machine code to the CPU.
No, the runtime engine does not do a compile or translation on that object code. It interprets it. The only machine code presented to the CPU is that of the runtime engine interpreter. Please look it up, there are excellent descriptions of the p-code compilers, java and it's engines, that serve as excellent examples.
 
1 members found this post helpful.
Old 05-12-2022, 03:56 PM   #30
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,706
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
Today, the use of bytecode techniques – even within "compiled EXEs" – has become quite commonplace because it is compact and because it works. The "bytecode interpreter" is basically a tiny loop and a big switch statement. There is no "overhead" associated with it.

The Java system uses bytecode exclusively, to provide cross-platform portability in what is nonetheless a "compiled" system: the Java source-code is evaluated once to produce a bytecode file that is thereafter run. The bytecode interpreter for this system has become quite large and complicated.

"Compile on the fly" systems like PHP work partly because "compiler technology is so damned fast now." It simply does not add any appreciable delay to execution.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Software update or Add/Remove Software does not work in LXDE debiantu Fedora 2 07-05-2011 04:12 PM
[SOLVED] Some software downloaded with Software Manager (Mint 9-Gnome) does not show in Menu Neyzan Linux - Software 3 09-12-2010 03:30 PM
LXer: Free software not about software in this sense; it's about bringing freedom to LXer Syndicated Linux News 0 01-22-2010 12:10 AM
Add/Remove software & Software Updater not working timelord567 Linux - Newbie 8 06-11-2009 09:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration