(Compiler Option) In-Memory source files.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

(Compiler Option) In-Memory source files.

Post 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...
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

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

Post 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.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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.
guido
User
User
Posts: 14
Joined: Tue Nov 25, 2003 4:56 pm
Location: Old Europe - Germany

Post 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...
guido
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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.
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post 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:
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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 :)
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post 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
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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 :)
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post 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)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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 :)
SPAMINATOR NR.1
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post 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:

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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 ;)
El_Choni
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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 ;)
SPAMINATOR NR.1
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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.
Post Reply