Discussion:
Runtime
(too old to reply)
Kari Laine
2008-05-20 13:12:23 UTC
Permalink
Hi,

I don't understand much about compilers - so I ask...

Benoit, why you decided to use runtime instead making Gambas a "true"
compiler without the need for a runtime?

Best Regards
Kari Laine
Leonardo Miliani
2008-05-21 17:21:04 UTC
Permalink
Post by Kari Laine
Hi,
I don't understand much about compilers - so I ask...
Benoit, why you decided to use runtime instead making Gambas a "true"
compiler without the need for a runtime?
Best Regards
Kari Laine
Interesting question...
I'm curios too ;-)
--
Ciao.
Leo.

Web: www.leonardomiliani.com
E-mail: ***@leonardomiliani.com
Scegli software opensource - Choose opensource software

Co-fondatore di Gambas-it.org
Il sito di riferimento della comunità italiana degli utenti di Gambas
www.gambas-it.org
Benoit Minisini
2008-05-21 20:41:55 UTC
Permalink
Post by Leonardo Miliani
Post by Kari Laine
Hi,
I don't understand much about compilers - so I ask...
Benoit, why you decided to use runtime instead making Gambas a "true"
compiler without the need for a runtime?
Best Regards
Kari Laine
Interesting question...
I'm curios too ;-)
1) Writing a compiler (like gcc) is too complex for me. Well, not really, but
I don't have the time to do that.

2) Writing an interpreter is easier, and allow more freedom. Writing its own
interpreter is a bit like writing its own CPU. The runtime is that CPU. The
last sentence is a shortcut, it is more complex, of course.

3) A program written in C/C++ has its "runtime" too, but you don't see it. gcc
links it to your program by default. The only difference is that the gcc
runtime (let's use that name for libc.so or libgcc_s.so) is always installed
by default. Not the Gambas runtime.

4) Installing the runtime would not be a problem with binary packages
correctly done and a modern packaging system.

Other questions?
--
Benoit Minisini
Epíleg
2008-05-22 11:35:05 UTC
Permalink
Post by Benoit Minisini
Post by Leonardo Miliani
Post by Kari Laine
Hi,
I don't understand much about compilers - so I ask...
Benoit, why you decided to use runtime instead making Gambas a "true"
compiler without the need for a runtime?
Best Regards
Kari Laine
Interesting question...
I'm curios too ;-)
1) Writing a compiler (like gcc) is too complex for me. Well, not really, but
I don't have the time to do that.
2) Writing an interpreter is easier, and allow more freedom. Writing its own
interpreter is a bit like writing its own CPU. The runtime is that CPU. The
last sentence is a shortcut, it is more complex, of course.
3) A program written in C/C++ has its "runtime" too, but you don't see it. gcc
links it to your program by default. The only difference is that the gcc
runtime (let's use that name for libc.so or libgcc_s.so) is always installed
by default. Not the Gambas runtime.
Very interesting but, if the Gambas runtime is writen in c/c++, this mean that Gambas add another abstraction layer between compiled gambas program and the hardware. In other words, Gambas runtime has also it's runtime too, the gcc one. Isn't it?

Best regards,
Epíleg.
Post by Benoit Minisini
4) Installing the runtime would not be a problem with binary packages
correctly done and a modern packaging system.
Other questions?
Benoit Minisini
2008-05-22 11:41:59 UTC
Permalink
Post by Epíleg
Post by Benoit Minisini
Post by Leonardo Miliani
Post by Kari Laine
Hi,
I don't understand much about compilers - so I ask...
Benoit, why you decided to use runtime instead making Gambas a "true"
compiler without the need for a runtime?
Best Regards
Kari Laine
Interesting question...
I'm curios too ;-)
1) Writing a compiler (like gcc) is too complex for me. Well, not really,
but I don't have the time to do that.
2) Writing an interpreter is easier, and allow more freedom. Writing its
own interpreter is a bit like writing its own CPU. The runtime is that
CPU. The last sentence is a shortcut, it is more complex, of course.
3) A program written in C/C++ has its "runtime" too, but you don't see
it. gcc links it to your program by default. The only difference is that
the gcc runtime (let's use that name for libc.so or libgcc_s.so) is
always installed by default. Not the Gambas runtime.
Very interesting but, if the Gambas runtime is writen in c/c++, this mean
that Gambas add another abstraction layer between compiled gambas program
and the hardware. In other words, Gambas runtime has also it's runtime too,
the gcc one. Isn't it?
Best regards,
Epíleg.
Of course.
--
Benoit Minisini
Emil Tchekov
2008-05-22 12:26:59 UTC
Permalink
There was (from the begining of modern computing on) the same discussion -

1) do you need the last quant of speed, efficience, whole controle over
ressources etc.

or

2) do you wish fast and uncomplicated RESULTS


You will pay for the first one with long hard work until you can get useable
results.
(Remember the best efficience is only reachable on machine level - I have
heard /may be fairy tale/ that in the ROM of the spaceship Voyager /which is
on trip trough the Milky Way with some demo of us - mankind/ there was round
about 280 Bytes free after installing the OS. SO.. one of the programmers
was able to write a Star-Light orientation routine (image recognition for
star constelations) which fits in those 280 Bytes... In 2 Years...


You will pay for the second one with some resources und may be with some
unefficience or even need of runtime environment, but you can get working
results within minutes...

Packing the runtime with the executable is space wasting from that moment
on, after you have more than one app on your HDD...


Very best regards

Emil

P.S. I will be the first user of language, that combines RAD with code&space
efficience of Assembler ;-), but I am realist enough to know, that you can
NOT have everything together...




-----Ursprüngliche Nachricht-----
Von: gambas-user-***@lists.sourceforge.net
[mailto:gambas-user-***@lists.sourceforge.net]Im Auftrag von Epíleg
Gesendet: Donnerstag, 22. Mai 2008 13:35
An: mailing list for gambas users
Betreff: Re: [Gambas-user] Runtime
Post by Benoit Minisini
Post by Leonardo Miliani
Post by Kari Laine
Hi,
I don't understand much about compilers - so I ask...
Benoit, why you decided to use runtime instead making Gambas a "true"
compiler without the need for a runtime?
Best Regards
Kari Laine
Interesting question...
I'm curios too ;-)
1) Writing a compiler (like gcc) is too complex for me. Well, not really,
but
Post by Benoit Minisini
I don't have the time to do that.
2) Writing an interpreter is easier, and allow more freedom. Writing its
own
Post by Benoit Minisini
interpreter is a bit like writing its own CPU. The runtime is that CPU.
The
Post by Benoit Minisini
last sentence is a shortcut, it is more complex, of course.
3) A program written in C/C++ has its "runtime" too, but you don't see it.
gcc
Post by Benoit Minisini
links it to your program by default. The only difference is that the gcc
runtime (let's use that name for libc.so or libgcc_s.so) is always
installed
Post by Benoit Minisini
by default. Not the Gambas runtime.
Very interesting but, if the Gambas runtime is writen in c/c++, this mean
that Gambas add another abstraction layer between compiled gambas program
and the hardware. In other words, Gambas runtime has also it's runtime too,
the gcc one. Isn't it?

Best regards,
Epíleg.
Post by Benoit Minisini
4) Installing the runtime would not be a problem with binary packages
correctly done and a modern packaging system.
Other questions?
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Epíleg
2008-05-22 13:02:23 UTC
Permalink
Post by Emil Tchekov
There was (from the begining of modern computing on) the same discussion -
1) do you need the last quant of speed, efficience, whole controle over
ressources etc.
or
2) do you wish fast and uncomplicated RESULTS
You will pay for the first one with long hard work until you can get useable
results.
(Remember the best efficience is only reachable on machine level - I have
heard /may be fairy tale/ that in the ROM of the spaceship Voyager /which is
on trip trough the Milky Way with some demo of us - mankind/ there was round
about 280 Bytes free after installing the OS. SO.. one of the programmers
was able to write a Star-Light orientation routine (image recognition for
star constelations) which fits in those 280 Bytes... In 2 Years...
You will pay for the second one with some resources und may be with some
unefficience or even need of runtime environment, but you can get working
results within minutes...
Packing the runtime with the executable is space wasting from that moment
on, after you have more than one app on your HDD...
Very best regards
Emil
P.S. I will be the first user of language, that combines RAD with code&space
efficience of Assembler ;-), but I am realist enough to know, that you can
NOT have everything together...
I'm realist about this too, but we are talking about this because somebody has asked why Benoit chose bytecode compiling style.

Best regards,
Epíleg.
Post by Emil Tchekov
-----Ursprüngliche Nachricht-----
Gesendet: Donnerstag, 22. Mai 2008 13:35
An: mailing list for gambas users
Betreff: Re: [Gambas-user] Runtime
Post by Benoit Minisini
Post by Leonardo Miliani
Post by Kari Laine
Hi,
I don't understand much about compilers - so I ask...
Benoit, why you decided to use runtime instead making Gambas a "true"
compiler without the need for a runtime?
Best Regards
Kari Laine
Interesting question...
I'm curios too ;-)
1) Writing a compiler (like gcc) is too complex for me. Well, not really,
but
Post by Benoit Minisini
I don't have the time to do that.
2) Writing an interpreter is easier, and allow more freedom. Writing its
own
Post by Benoit Minisini
interpreter is a bit like writing its own CPU. The runtime is that CPU.
The
Post by Benoit Minisini
last sentence is a shortcut, it is more complex, of course.
3) A program written in C/C++ has its "runtime" too, but you don't see it.
gcc
Post by Benoit Minisini
links it to your program by default. The only difference is that the gcc
runtime (let's use that name for libc.so or libgcc_s.so) is always
installed
Post by Benoit Minisini
by default. Not the Gambas runtime.
Very interesting but, if the Gambas runtime is writen in c/c++, this mean
that Gambas add another abstraction layer between compiled gambas program
and the hardware. In other words, Gambas runtime has also it's runtime too,
the gcc one. Isn't it?
Best regards,
Epíleg.
Post by Benoit Minisini
4) Installing the runtime would not be a problem with binary packages
correctly done and a modern packaging system.
Other questions?
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Leonardo Miliani
2008-05-22 13:29:14 UTC
Permalink
This is similar to the discussion about compiled/interpreted about
BASIC, did you remember? :-)
In the beginning, BASIC was born as a compiled language.. Then, in the
second half of 70s' the interpreted versions raised and began more
popular than the original one.
This has been until mid 80s', when the quest for more speed of the BASIC
programs (trying to reach the performances of TurboPascal & C.) was the
spin to come back to the beginning, proposing compiled versions again
(QuickBASIC and similars).
VisualBASIC changed the things another time, reusing an interpreted
version of the language... and the new languages have followed this
trend... Python, Ruby, Java etc... all of these ones use a runtime
interpreter to translate the source code in bytecode and let it to be
executed by an interpreter. First of all, because of the speed of the
modern CPUs... nothing to compare with the old ones! Today a modern CPU
is able to do the work of thousand old PCs in less time.

Personally, if I should choose I preferred to choose speed against other
features but I have to admit that the interpreter solution is very easy
--
Ciao.
Leo.

Web: www.leonardomiliani.com
E-mail: ***@leonardomiliani.com
Scegli software opensource - Choose opensource software

Co-fondatore di Gambas-it.org
Il sito di riferimento della comunità italiana degli utenti di Gambas
www.gambas-it.org
Rob
2008-05-22 14:41:54 UTC
Permalink
Post by Leonardo Miliani
Personally, if I should choose I preferred to choose speed against
other features but I have to admit that the interpreter solution is
very easy
I ported a customer's application from VB to Gambas several years ago
(circa Gambas 1.0) and the Gambas version was noticeably more
responsive on the same hardware despite the VB version being compiled
into native code (or at least that's what the VB IDE calls it.)

It could have been that my optimization skills were better than the
author of the original program, or it could have been Linux acting
more responsively than Windows, but if there is a performance hit for
using bytecode, it's really not that much. "Native code compiler"
when speaking of high-level languages is often just a euphemism
for "our compiler copies the same routines that our interpreter uses
into your executable," resulting in little if any difference in
performance.

Further, writing a C program with a modern, mainstream compiler, even
with all the optimization switches turned on, even if you were to use
a compiler that doesn't rely on a widely available runtime as gcc
does, doesn't give you anywhere near the speeds you get by writing
assembly code from scratch. Just as with Gambas, the C compiler and
all the libraries give you a huge amount of convenience (and
maintainability) at the expense of raw performance.

And even if you were to write your application in an assembly
language, as soon as you want to do any kind of I/O or show something
on the screen, you're making calls to someone else's code, written in
C and dependent upon a whole lot of other code written in C. An mp3
encoder written in Gambas using liblame (assuming that's possible
with API calls) will be exactly as fast as an mp3 encoder written in
C or even assembly language using liblame, because all the heavy
lifting is done by a library.

It may be that if you're writing something in Gambas to generate
fractals in real time, it'll be slower than it would be in C, but if
you're the kind of person who writes real-time fractal generators,
you're probably going to end up writing for an assembler anyway.

Rob

Continue reading on narkive:
Loading...