Sorry but I have been away for a while...
There is an idea that has been in my head for a whole day long.
I started thinking about this: what if ZGE created C++ source code (or something like that that can be compiled with something small and portable, like maybe even FreePascal) and compiled the binary instead of interpreting everything? We would really give a cut to a lot of problems...
I think this would be great...
EG: if compiled in C/C++, one could place ZExpressions directly in source code. If a particular function is found, than the right headers are added to the code, so only needed functions are in the executable. (Plus, we get Arrays, Functions and so on for free )
How much work could it take??? Months, more?
What is your opinion about that?
Mad Idea
Moderator: Moderators
Mad Idea
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
It is a good idea.
Benefits:
- full power and performance
- no need to invent a new language or compiler
However there are also some drawbacks:
- every ZGE user needs to install a compiler on their computer. No more a simple unzip-to-install installation of the ZGE-environment.
- the installed compiler also needs to be able to compile cross-platform which usually means having lots of extra files and configuration
- it will take longer to generate the zge applications, and previews inside zdesigner won't be possible
- pascal/c++ are powerful but also difficult. It is easy for users to cause crash-bugs and memory leaks. With a scripting language you can protect against those problems.
I do want to be able to use an existing compiler instead of writing one myself. The dotnet C# compiler can be called in-memory without the need for generating files on disk, so this could be used within zdesigner even for previews. What would be needed is a runtime engine in zge for executing compiled dotnet bytecode.
Benefits:
- full power and performance
- no need to invent a new language or compiler
However there are also some drawbacks:
- every ZGE user needs to install a compiler on their computer. No more a simple unzip-to-install installation of the ZGE-environment.
- the installed compiler also needs to be able to compile cross-platform which usually means having lots of extra files and configuration
- it will take longer to generate the zge applications, and previews inside zdesigner won't be possible
- pascal/c++ are powerful but also difficult. It is easy for users to cause crash-bugs and memory leaks. With a scripting language you can protect against those problems.
I do want to be able to use an existing compiler instead of writing one myself. The dotnet C# compiler can be called in-memory without the need for generating files on disk, so this could be used within zdesigner even for previews. What would be needed is a runtime engine in zge for executing compiled dotnet bytecode.
Correct me, but C# needs dotnet, right? so no "single file" again... Or the executable can be made self-sufficient? what would be the dimension of the file?
BTW: I'm looking for small C++ compilers, some are as little as 3 MB but do need some extra libraries I think. FreePascal is 20 MB download, don't know how much for installed vers
BTW: I'm looking for small C++ compilers, some are as little as 3 MB but do need some extra libraries I think. FreePascal is 20 MB download, don't know how much for installed vers
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
Many (most?) users already have dotnet on their computers. Microsoft wants it to be there so you almost have to actively choose not to have it to avoid it. But yes it would be a dependency that ZGE currently does not have. The generated exe-files would still be self-contained without external dependencies and need not be larger than today, so still 64kb.
Small C++ compilers that can be redistributed are interesting, post links here if you find any.
Small C++ compilers that can be redistributed are interesting, post links here if you find any.
Hi guys,
My primary reason for working with & on ZGE is the real-time preview. This saves heaps of time compared to libraries that need to be compiled every time you want view any changes. As Ville mentioned, the only sane way of pulling this off is through interpretation.
+ Slightly off-topic, but since Arrays where mentioned again I've been using a temporarily? solution for this in the form of three components. Even though the created Arrays cannot be accessed directly from ZExpressions ( yet ) .. which would be nicer, it does the job for now.
K
My primary reason for working with & on ZGE is the real-time preview. This saves heaps of time compared to libraries that need to be compiled every time you want view any changes. As Ville mentioned, the only sane way of pulling this off is through interpretation.
+ Slightly off-topic, but since Arrays where mentioned again I've been using a temporarily? solution for this in the form of three components. Even though the created Arrays cannot be accessed directly from ZExpressions ( yet ) .. which would be nicer, it does the job for now.
K
- Attachments
-
- Array.gif (6.28 KiB) Viewed 8909 times
idea should be: pass the address of array incremented of the index to the parser, right? I wanted to give it a try but it was quite difficult and I did not try playing with the ZGame "virtual machine" :/ Plus I have had some serious problems with my graphic video card recently and my PC needed mantainance...
BTW: the tiny C++ compiler is the one from http://www.digitalmars.com/
BTW: the tiny C++ compiler is the one from http://www.digitalmars.com/
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
you have my love,.
interesting discusion,. more power is always apealing! however I do agree that the realtime previewing is a danm fine thing.
The actual implementing of any of this is way outside of my interests (makin' games!) so I leave these things to those who are interested,. and quite able,. of course I will adopt the things you guys come up with that allow me to easily access more power and features,. godspeed and good luck!
The actual implementing of any of this is way outside of my interests (makin' games!) so I leave these things to those who are interested,. and quite able,. of course I will adopt the things you guys come up with that allow me to easily access more power and features,. godspeed and good luck!
iterationGAMES.com
Yes a new component for the zge expression runtime, something like a LoadArrayPtr. The array itself is a property on the component, the indices are popped of the stack. It then calculates the actual adress (array + indices), and push onto stack. This address can then be used for assign or load value. That's the idea anyway, I haven't checked the source to see if I remember correctly.kattle87 wrote:idea should be: pass the address of array incremented of the index to the parser, right?
Digitalmars makes interesting products. I've been looking at the D compiler a couple of times, it is quite impressive.