In no particular order, here's the list of things I'd like to see come from the compiler end of things in REALbasic.
- More data types. I want UInt32, UInt64, UInt16, UInt8, SInt32, SInt64, SInt16 and SInt8. I don't want to monkey around with confusing names like Integer, I want them to be specific so I know what I am working with.
- Native link formats for PE32 and ELF files. We have PEF and Mach-O natively, so all the Mac zealots are appeased ;-). But there's no reason for us not to have native link formats for Windows and Linux.
- To make the above possible, I want to have the ability to resolve shared libraries in memory. This means that the plugins wouldn't be written out to disk anywhere, but kept as string resources in the executable, read into memory, and then resolve the function pointers from there.
- Also going with the above, we need a resource compiler for Windows.
- As I've mentioned before, I want the ability to declare into data just like I currently can with functions.
- The ability to specify a function as inlined.
- Macros like #define is in C. Basically, a true pre-processor find/replace.
- The ability to have a callback function contained within a class scope. So I can write a wrapper class that's self-contained and doesn't need a module to handle the callback function.
- Classes within classes (and modules). Again, it lets me encapsulate my code in a much better manner. For example, I could have the SystemParameters module contain the helper classes so that when I give the user the SystemParameters module, they get all the classes along with it. This would require better namespace support (obviously).
- An optimizer. I won't even bother going into what it was that I want optimized. That list is rather long. ;-)
- Bitwise operators. While I agree that an optimizer can (and should) turn Bitwise.BitAnd into a single instruction, I still think the methods are ugly as sin. They're too verbose. Example:
foo = Bitwise.BitAnd( Bitwise.BitOr( bar, 12 ), Bitwise.BitXor( Bitwise.OnesComplement( 88 ), 15 ) )
-vs-
foo = (bar | 12) & (~88 ^ 15)The first one is just as unreadable as the second one. But I can tell you which I can type faster and parse quicker in my brain.
- Delegate function pointers.
- The ability to create static libraries. This can be for RB-only to use, or, perhaps for C if it's not too hard. Along with this comes the ability to statically link in C and RB libraries.
- Introspection. But I want it to be an option whether I include RTTI information in my built application because it adds a bunch of overhead to the compiled application that I won't use in 95% of my projects. What would be best is a way for the IDE (or possible a pre-processor) to flag that I am using RTTI and then turn the flag on for me (otherwise the flag stays defaulted to off).
- User-defined data types. Not that I mind using MemoryBlocks (I would probably still use them, just out of habit!), but it's mostly for fly-weight classes. Whenever I have a class with only properties and perhaps a constructor that sets them up, I get annoyed that I have to make an entire class for that purpose. I just want a neat little data wrapper that I can hand to a caller and not worry about overhead from vtables and all the extra stuff that classes can do (after all, it's just a data storage wrapper, no method calls [I can live without the constructor]). I want to have the option to pass it ByVal if I want, or ByRef if I want as well.
As you can see, I have some big dreams. But that never hurt anyone!
1 - Native link formats for PE32 and ELF files? I don't understand - these are already supported, aren't they? I thought that PE32 was Win and ELF was Linux - what more is needed?
2 - As for resolving shared libraries into memory - that would be much neater (although, doesn't windows and linux already do that?). Would it mean we could include DLLs and dylibs in the executable? It would be nice to consume all the plugins of an app into the executable. Mach-O builds have an annoying 'rbframework.dylib' file which I'd like to get rid of, especially for console apps.
3 - What about a nice smart-linker to reduce the size of the framework? Is that even possible or am I just dreaming? Jon suggested the easiest way to do that would be to rewrite most of the framework in RB.
1) No, we take a pre-built Win32 stub application and append your application's compiled executable code to it. When the app is launched, it's that stub that's executing. It then loads your application's executable code and executes it. Same thing happens for Linux.
2) No, Windows does not provide a way for you to resolve DLLs in memory. You can have the system loader load one from disk (with LoadLibrary) and use GetProcAddress on the loaded module, but you can't use GetProcAddress from a DLL in memory if the loader wasn't what put it there. We basically need to write our own loader, then it'll work. Then the DLLs can live in the resource fork of the application, be loaded with standard Win32 APIs and then resolved in memory.
3) Honestly, I don't think the smart linker is nearly as important as everyone makes it out to be. Yes, it'd be neat, but I don't require it. And the smart linker *is* in place for any code written in RB. So writing more of the framework in RB is a good deal since it will be smart linked. But smart linking the C++ framework is slightly harder (and requires some of the other things on my list before it's possible), and something I feel we'll end up not needing as much in the future *because* we'll write more in RB itself.
Your wish-list is essentially a mirror of mine:D
shit , all I want is when you run a windows app and its doing something really complicated for about 20 seconds and the user clicks on the screen somewhere, so that it doesn't come up with "Not responding" in the title bar of the RB app, because you know the users going to CTRL-ALT-DEL the app. But the other stuff is good too.
TA
Damon
Then service the event loop. That has nothing to do with the compiler, and what you're seeing is what happens when you run tight loops in any application -- it's standard OS behavior.