Page 1 of 2

(Compiler Option) In-Memory source files.

Posted: Thu Jan 15, 2004 2:37 am
by Shannara
I would love the ability to have an option to compile in-memory source code files as well as the regular on hard-disk source codes. This would be definately helpfull for those of us who are creating a complete IDE (not just a visual designer...), and have certain sources/features that we would not like the pb source released.

Right now, it does the following:

PBCompiler file1.pb, file2.pb, file3.pb

Why not add on the following?

PBCompiler file1.pb memoryaddress file3.pb memoryaddress


etc... would it not be faster to compile directly from/in memory? Would be quite helpful for those of us making IDEs :) Especially since PB libraries for Linux and Windows are not interchangable, we could just create PB code, plug it into memory to simulate a library, and pass the code to the compiler, on compile...

Re: (Compiler Option) In-Memory source files.

Posted: Thu Jan 15, 2004 6:51 am
by PB
Why not just install one of many free RAM disks and get the compiler to
load the sources from there? RAM disks have a ton of other handy uses,
such as web browser caching and so on.

Posted: Thu Jan 15, 2004 7:23 am
by Shannara
A couple of reasons. You write to the ram disk, and people can still see the sources. Ive already thought of that :) Right now, it spits out my custom code into a pb file before compile, and run the code with the user's code through the compiler, and then deletes the custom code. This is a huge risk not worth taking. If we can do this all in memory and such, that risk would not exist.

Posted: Thu Jan 15, 2004 4:18 pm
by guido
Shannara wrote:A couple of reasons. You write to the ram disk, and people can still see the sources. Ive already thought of that :) Right now, it spits out my custom code into a pb file before compile, and run the code with the user's code through the compiler, and then deletes the custom code. This is a huge risk not worth taking. If we can do this all in memory and such, that risk would not exist.
I see the same good arguments as PB. Your security argument is not really striking. If the bad guy is able to read the disk, what should prevent him from prying the main memory? How do you guarantee, that the memory is not swapped out and again landing on the disk? I suspect, that a solution for your problem (what's the application excatly?) might be in a different direction than you are searching...

Posted: Thu Jan 15, 2004 10:39 pm
by Shannara
Anybody can do as you said with any compiler, not just PB. That's just the inherit risk with using any compiler out there. As mentioned before, my proggie is an IDE (I have yet to see any IDEs for PB yet, only code editors and dialog editors, unless you count HelloBasic, but I havent used that yet).

Anyways, that can happen with any compiler by anybody who really want to check things out. But it does deter quite a bit of people out there who is looking for an easy access to the sources.

Posted: Fri Jan 16, 2004 1:11 am
by Berikco
Ha, now i understand what you want to do, compile some internal only PB procedures in an IDE.
Maybe you can compile your 'libs' to commented ASM and use it as inline asm in your generated *.pb file? You can't prevent users from compiling to commented ASM so....

An IDE, sound interesting, i have some experience in that area, i'm hacking a Visual Designer together from time to time, so if you need any help, i'm on IRC ;)

Doing such big project in PureBasic is fun, only problem is finding enough betatesters in IRC, Rings is mostly in the pub :twisted:

Posted: Fri Jan 16, 2004 1:37 am
by Shannara
I never visited the IRC channel yet :) I should do that sooner or later. As for the commented ASM, that is an awesome idea. The only thing I can think of that would make that evil... :D is .... when passing commented ASM to the pb compiler, will it take a mix? Ie, both my commented ASM files and the user's PB source files? If so, then this would do nicely for awhile :)

Posted: Fri Jan 16, 2004 2:46 am
by Berikco
Shannara wrote:...when passing commented ASM to the pb compiler, will it take a mix? Ie, both my commented ASM files and the user's PB source files? If so, then this would do nicely for awhile :)
Of course, its some work to prepare the commented ASM , and use it as inline ASM, but compiler takes it all :)
Inline ASM is just a PB source for the compiler

Posted: Fri Jan 16, 2004 3:19 am
by Shannara
Grr. gotta love the forums, either the posting rights of everybody was removed earlier today, or just mine.. grr..


Anyways, there is still a problem. I the code in my IDE has my own format, when they want to compile, I have to adjust the code so that it's PB readable, print it out into ta file, feed it to PB. then delete the files. Extremely ineffecient, risky, but gets the job done. If this can be all done in-memory... it would be much much better.. and a bit safer :)

Posted: Fri Jan 16, 2004 1:22 pm
by Edwin Knoppert
PBDev is also an IDE which uses a termp dir for code generation.
While this is not meant to be safe, during compile it's hard to look such a dir up and copy contents your IDE already might have removed.

(speed issue)

Posted: Fri Jan 16, 2004 1:54 pm
by Rings
Edwin Knoppert wrote:during compile it's hard to look such a dir up and copy contents your IDE already might have removed.
With a real debugger like OllyDebug this can easily be done.
Lazy Berikco wrote: only problem is finding enough betatesters in IRC, Rings is mostly in the pub
uups i missed something :)
weekend reached, so feel free to ask if i should delete my purebasic-directory with newest vd-beta :)

Posted: Fri Jan 16, 2004 2:02 pm
by LarsG
Rings wrote:
Edwin Knoppert wrote:during compile it's hard to look such a dir up and copy contents your IDE already might have removed.
With a real debugger like OllyDebug this can easily be done.
Lazy Berikco wrote: only problem is finding enough betatesters in IRC, Rings is mostly in the pub
uups i missed something :)
weekend reached, so feel free to ask if i should delete my purebasic-directory with newest vd-beta :)
ROFL! :lol: :twisted:

Posted: Fri Jan 16, 2004 2:35 pm
by El_Choni
weekend reached, so feel free to ask if i should delete my purebasic-directory with newest vd-beta
This feature is only available in my apps, and it is copyrighted, so watch out ;)

Posted: Fri Jan 16, 2004 7:32 pm
by Rings
El_Choni wrote:
weekend reached, so feel free to ask if i should delete my purebasic-directory with newest vd-beta
This feature is only available in my apps, and it is copyrighted, so watch out ;)
maybe Berikco grabbed your code ;)

Posted: Fri Jan 16, 2004 9:29 pm
by Shannara
PBDev, that's what I was talking about earlier. The only publicly available IDE for PB. heh. Mine looks almost the same but has more of a VB feel.. hrm.