• 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

It must give me full access to the underlaying API of the OS i am targeting without restriction.
It must not write the code for myself.

Thus the list is very short:


  • It must be able to create native EXE and DLL for the current Windows platform (at this time 32 and 64-bit).
  • It must be able to create static Library.

Support for managed code, is a plus, but not a mandatory, everything else i don't care.

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

Theo Gottwald

Let me add few things:
- it must be reliabel and if i have bugs in my code i must be sure its not bugs in the compiler.
- it must under all circumstnaces help me on compile-time errors to fix them
- at least tell me in which file and in which line these errors are.
- i would love to have a unlimited Macro nesting depth
- ASM support may not be needed for everybody, but is for me a YESYES if its there and a NONO if its missing.

Patrice Terrier

#2
Theo,

I also need a few in-line ASM, thus consider it is in my "short" list. ;)

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

Peter Weis

Hi,
you should be able to register directly transferred
Z.B call sub (eax, ebx, ecx, edx)
There should be no scaffolding functions as with Free Basic.

Example:

sub test naked ()

end sub

Regards,
Peter

James C. Fuller

64bit ASM support?
Granted my 32bit asm was not great but I could not get my head around 64bit. I finally just gave up and resolved myself to polishing up my 32bit knowledge.

James

Patrice Terrier

#5
James,

By all means i am not an ASM expert, i am just using it in some critical section of my code.

Like this simple matrix function from GDImage, that was given to me by one of the ASM Guru floating around here:
SUB MatrixMul5x5FPU(BYREF mr() AS SINGLE, BYREF m1() AS SINGLE, BYREF m2() AS SINGLE )
DIM p AS SINGLE PTR

p=VARPTR(m1(0))
! mov ecx,eax
p=VARPTR(m2(0))
! mov edx,eax
p=VARPTR(mr(0))

block:
! call column
! call column
! call column
! call column
! call column
EXIT SUB

column:
! call cell
! call cell
! call cell
! call cell
! call cell
! add edx,20
! sub ecx,20
! ret

cell: ' row A * column B
! fld   dword ptr [ecx   ]
! fmul  dword ptr [edx   ]
! fld   dword ptr [ecx+20]
! fmul  dword ptr [edx+04]
! fld   dword ptr [ecx+40]
! fmul  dword ptr [edx+08]
! fld   dword ptr [ecx+60]
! fmul  dword ptr [edx+12]
! fld   dword ptr [ecx+80]
! fmul  dword ptr [edx+16]
! faddp st(1),st(0)
! faddp st(1),st(0)
! faddp st(1),st(0)
! faddp st(1),st(0)
! fstp  dword ptr [eax]
! add   eax,4
! add   ecx,4
! ret
END SUB


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

James C. Fuller

Patrice,
  I don't know who your guru was but if was Hutch I don't think he is doing much with 64bit??
His baby is Masm32.
You may just have to hire out  :)

James

Theo Gottwald


Mike Stefanik

#8
Patrice,

I'd say your best bet for a professionally supported compiler for x64 code would be Visual C++, and if you get Visual Studio 2010 Professional (which is actually quite nice) you'll basically get everything you wanted there including the ability to generate managed code. The only thing that you won't get is the ability to write inline x64 assembly, but you can use a tool like Yasm for that if you're really interested in porting over some over x86 assembly.

There's also Pelles C, LCC and WPG (MinGW) if you're looking for something on the cheap(er) end of things, but given that what you're doing is commercial development, I'd argue that Visual Studio is the way to go here if you need x64 support right away. Of course, the caveat to all of that is how comfortable you are with C/C++.

Edit: I'm not exactly sure what you mean by "it must not write the code for myself" but I thought I'd mention that although VS does have wizards and code templates, using them is completely optional. You're free to create an empty or skeleton project as you wish and code everything from the ground up.

Patrice Terrier

#9
Mike,

QuoteI'm not exactly sure what you mean by "it must not write the code for myself"

For me that would say:
"a compiler is not a third party addon, nor a code editor, nor a form designer, and it must avoid using a proprietary syntax to encapsulate the low level API".

For me a compiler must support the current technology of the platform it is running on, nothing more, nothing less.

But, when i write "current technology" i have a tolerance of say: 3 or 4 years maximum. Go figure  :)

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

Mike Stefanik

#10
Well, you could just use the command-line compiler, but I have to ask: why the issue with any compiler that comes with an IDE? Or to be more specific, have you ever worked with an IDE like Visual Studio or Eclipse? If you're just used to PB and maybe some 3rd party code editors, it might take a little bit of getting used to, but once you've started getting comfortable with it, I'd bet you would find yourself being a lot more productive than using a bunch of different tools (and that scales up as your project becomes more complex).

Of course, as far as encapsulating the API, that's pretty much a non-issue with any C compiler. With C++ there's MFC, but again, there's absolutely no requirement that you use it (just as you don't have to use any of the DDT stuff in PB).

Edit: Then again, I have to say that I think it's a bit odd that you're talking about encapsulating the API and managed code in the same breath. I mean, managed .NET code is nothing but a massive encapsulation of the API along with a ton of other high-level classes. Anyway, if you haven't worked with VS2010, I still say you should try it (their eval is 60 days) and give yourself some time to really work with it and get over any initial learning curve. Join the Borg collective with the rest of us.. resistance is futile! ;)

Patrice Terrier

#11
Mike,

I am using already VISUAL STUDIO (see my C# corner section), and I am also using a RAD tool when i need one (see my WinDev section).
However i do not espect from a bare compiler to be a RAD tool nor something as complex as VS.
I don't like managed code, because it is a black box, and i don't like either the obscurification of the C++ classes.

However "resistance is futile", and perhaps it is time for me to leave my compiler of choice.  :(

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

Mike Stefanik

If you're already using Visual Studio, then you have your 64-bit solution right there. And keep in mind that you don't need to use C++ and MFC. You can easily create DLLs using plain 'ol C and the Visual C++ command line compiler (cl.exe) if you want. So if building everything by hand using your favorite text editor, creating makefiles and all that good stuff is what you prefer, that's completely doable with what you've already got.

Patrice Terrier

Mike,

I shall probably come back to you, to learn more about the use of C++ and un-managed code, because i mostly used VISUAL STUDIO with Dot.NET and C#.

Thanks for the heads up.

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

Mike Stefanik

Sure, feel free to post or send me a PM or email (you have my address right?) and I'm happy to help however I can.