Yes, I also always asked myself how it works.
I came to the conclusion it must be some kind of magic that I will never ever understand and instead of wasting my time to think about how it works I will just accept that it works and use it.
Hi,
note: this is not a question about the difference between interpreter and compiler.
according to wikipedia,
An interpreter generally uses one of the following strategies for program execution:
- parse the source code and perform its behavior directly;
- translate source code into some efficient intermediate representation and immediately execute this;
- explicitly execute stored precompiled code[1] made by a compiler which is part of the interpreter system.
- in which category do thinBasic fall ?
- from a general point of view, what prevent an interpreter to generate a compiled executable ?
ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64
Yes, I also always asked myself how it works.
I came to the conclusion it must be some kind of magic that I will never ever understand and instead of wasting my time to think about how it works I will just accept that it works and use it.
I think there are missing some Forum-sections as beta-testing and support
My understanding is thinBasic executes text code statement by statement.
I think the goal of a BASIC interpreter is to minimize the number of steps to its simplist form for any given task. If raw speed is what you're after, write an extension in a compiled language and call its functions.
I think you missed my point. It has nothing to do with compilers. It's about calling efficient libraries from your interpreter to gain speed.
Last edited by John Spikowski; 18-11-2018 at 00:25.
To me it should be easy to replace, improve or just read the code.
If compiled it would be a problem to me to study other users scripts as well as to use them as a skeleton that I could extend with own ideas and functions.
If the interpreter itself runs at extraordinary speed and maintains a program with the advantages of a flexible, changeable code - why would I want to compile it?
Imagine there's a typo in the UI or small bug to fix, or even you want to try to your needs changed parameters - if compiled you need the sources to do it yourself and probably also the compiler and additional time.
Also your own scripts... you publish them, others read them and can see how you solved a problem. Next time another user writes a script and he will be faster because you did the thinking already and he learned from your solution - do not say copied!
Or even the other way around: another user reads your published script and brings you to the idea to try to solve the problem another way and you learn.
That's what I would call communication, exchange, growth.
Interpreted, readable languages seems to me, are able to progress much faster in efficiency because the ones who are really interested can easily share ideas and discuss problems.
The conditions for any language to be interesting enough, so people will try it out and use it, are that they are able to find working solutions for their own ideas by logic thinking, a good documentation and other users who can give advise or at least understand the problem = a living community.
Compiled... kind of encrypted, unreadable... Hmm, maybe to finalize a project like to create an executable...
If speed were the reason to compile a program then perhaps the programmer as first should check if he can improve his code to run faster without to compile it than to rely on the compiler.
I think there are missing some Forum-sections as beta-testing and support
Let me refocus the discussion...
I am not looking for obfuscation. I am not looking for a speed solution.
I hoped a kind discussion about software.
Or maybe I was not sufficiently eloquent about my thoughts, but can't think of an another way to ask this. Below, I try to reformulate the question:
From a general point of view, why languages that have an interpreter doesn't have a compiler as well, as, from my understanding so far, there is not a so big step from interpretation to compilation ?
ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64
One thing I like about Script BASIC is it runs as a shared object. (DLL, SO, ...) When running in a threaded model having your interpreter always resident in memory helps. SB also precompiles its code in a continuous memory binary format before execution. The script never starts and a error returned if the program is unrunnable.
Bookmarks