• Welcome to Jose's Read Only Forum 2023.
 

What i am especting from a bare compiler

Started by Patrice Terrier, June 06, 2010, 12:54:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

#15
Mike,

Do you know if "VISUAL C++ 2010 Express" is able to create both plain Win32 and 64-bit DLL?

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Tiziano Magni

Reading here

http://msdn.microsoft.com/en-us/library/9yb4317s.aspx

the answer is yes, but you must install the Windows Software Development Kit (SDK) too.

Mike Stefanik

Tiziano beat me to it, so for sure you can create standard x86 and x64 DLLs. What I'm not sure of is whether or not you have direct access to the 64-bit compiler in the VS IDE (i.e.: whether the express edition supports configuration for x64 projects), but from what you've described earlier, the command line compiler is all you're really interested in anyway.

Also, unless something has changed recently, it's not even really necessary to install the Express edition if you just want the C/C++ compiler. The Windows SDK includes two installer packages, vc_stdx86.msi and vc_stdamd64.msi which are the x86 and x64 command line compilers, respectively. With Visual Studio, what you're really paying for there is the IDE and all of the project management and testing tools; Microsoft has given away their core compiler toolchain for free in various forms for quite a while now.

In terms of creating the DLLs themselves, you could use either C or C++, but I tend to personally prefer using standard C for that; on the other hand, for COM components, you're nuts (or at least have a serious masochistic streak) if you don't use C++ with ATL.

James C. Fuller


Peter Weis

Hi Patrice,
Have a beta version of Visual Studio 2010th Just as it looks it support x64 and x86 code. At least you can set it in the compiler options. But I can not imagine that it is not.
Regards Peter

Peter Weis

Hello James
Have looked at the BCX Converter shortly. He seems to be interesting.
Regards,
Peter ;)

Mike Stefanik

Quote from: Peter Weis on June 13, 2010, 12:55:54 AM
Hi Patrice,
Have a beta version of Visual Studio 2010th Just as it looks it support x64 and x86 code. At least you can set it in the compiler options. But I can not imagine that it is not.
Regards Peter

IIRC, the VS2010 beta builds were effectively the Professional editions, so they had all of the bells and whistles turned on. The Express editions are a little different in that they're geared more towards students and hobbiest programmers.

Patrice Terrier

#22
So far i have used heavily PB, because the syntax is so closed to WinDev running in English mode,
that i can port all my examples between them, in a few days work.

For my DLLs, this is rather much complex, because while i am using exclusively plain SDK style to be 100% compatible with the core API,
there is much more code editing to convert everything to the C syntax.

Idealy I should have first to write a PB to C converter to automate things as much as i can, before to fine tune everything by hand.

I shall give a try to Kev's BCX, or perhaps do you know of another one?

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Mike Stefanik

#23
The link up a few posts here in this thread to BCX is an open source BASIC to C converter. I've never used it, so I couldn't even begin to tell you how well it would work with your PowerBasic code or what kind of C code it generates. In my personal experience, converters in general may get you 80-90% of the way there, but there's always cleanup and stylistically the converted code is usually pretty funky.

Using a converter may be worth checking out in the short-term, but over the long term I think you'd ultimately be better served by rewriting your code, rather than converting it. It's kind of like the difference between using Google to translate your website into German, or actually learning German and performing the translation yourself (or paying someone to translate for you). The first option is fast and easy, but the results are typically poor. The second takes more time, but you end up with a much better result.

Edit: The only other converters I'm aware of are Bacon and b2c for Linux, and I'm pretty sure they'd have no idea what to do with PowerBasic's syntax, particularly when it comes to calling Windows API functions.

Theo Gottwald

I thinkElias is also working on something like that.
His Editor converts all sort of things ... php-BASIC-C, but i don't know the details.

Besides that he seems still be interested in somebody to help him to get it on the market.
Maybe you want to talk to Elias (EGRID32)?

James C. Fuller

I posted the link primarily to make aware of the cross compiling MinGW compilers.(there are even Linux hosted ones).
I slid into the 64bit stuff sideways as I was looking for Linux/Windows single source using wxWidgets. I mostly accomplished that with BcxWx. There is no need to use Bcx if you prefer, and know c/c++. I just found this setup pretty easy to setup and use.
I realize the batch files probably need some work as my knowledge of MinGW g++ is lacking.

James

Charles Pegge


I have been working on a Basic compiler, for the last 30 months or so, which I believe will match Patrice's requirements for a bare bones compiler very closely. The core language is almost complete and it can now produce 64 bit executables and access the Windows API using the x64 calling convention. These executables are currently restricted to assembly code while I adapt the Basic encodings for this platform.

At the present rate of progress, Oxygen should reach its beta mark in about 6 to 9 months time. But if any of you are interested, I can create a board and make alpha postings of the project as I have been doing for thinBasic. The feedback would be very welcome!

Charles

James C. Fuller

Charles,
  Please Do. I am a Basic fanatic and from what I've see of your tboxygen code I know it will also suit my quest for oop.

James

José Roca

#28
 
I don't have a 64 bit OS, but I applaud the initiative.

Charles Pegge


One curiosity of the 64 bit platform: The DLLs still have the same names KERNEL32.DLL USER32.DLL etc. :)

The header declarations look very similar but the underlying calling convention is totally different. And all handles and pointers must be dealt with as full 64bit entities. Apart from these, INTEL/MS have designed the 64 bit scheme to make migration as easy as possible.

Charles