U4IA++ Compiler Update (ie. No, I'm *not* dead)

new topic     » topic index » view thread      » older message » newer message

Just wanted yall to know that i'm not dead and no I don't intend to fly off
to a distant country and glue my compiler on my ass (lol).

I'm currently fighting with DPMI dramatically!
I decided to change the syntax a bit.
For one the syntax will be more like Euphoria than I had planned.
This includes changing the way Classes are created.
I thought of replacing the current hierarchical "type" definition (ie. type
procedure end procedure end type) to:

collection myclass
integer count
procedure drawcrap(flat sequence what)
   for i = 1 to count do puts(wnd,chat) end for
end procedure
end collection

myclass writer
writer.count = 50
writer.drawcrap("hi yall!")

This does mean throwing another variable type into the language, but it's
more robust then just taping some procedures inside a user-defined type.
I figured that compiling into a C++ lib with U4IA++ can make you export
"collections" as structures and classes.

Reminds me of two things.
One, did yall know that "regular" Euphoria can create variables that perform
actions once initialised just like in VB?
Try this:
type pixel(sequence data)
pixel(data[1],(data[2],data[3])
return 1
end type

pixel mypix
mypix = {15,320,200}  -- color,x,y

Chique huh?

The second thing is that I wanted to let yall know about a new "header"
statement I find exiting, and, the way you "compile" your apps.

The New Header Statements
-------------------------

as [what]  -- Compile your program "as" eighter:

[what] can be the following.

- "com"    (A .com file, if the source is smaller then 64k)
- "exe"    (A standard executable, .exe on most platforms)
- "control" (Win32 only, and Active X control)
- "dll"    (Win32 and Linux, A "dynamic link library")
- "static_library" (A static C or C++ library, ie .lib)
- "c_source" (Compile into C source code)
- "cpp_source" (Compile into C++ source code)

Example:

-- This application compiles into a .dll

as dll

include windows.ew

universal procedure mb()
message_box("You suck!","Warning...",MB_OK);
end procedure

-- "mb()" is now exported through the DLL, and can be called on Win32


That's it.
If you're woundering what a "universal procedure" is, it's
just a way to export certain routines so other (read: C/C++) applications
can call it. That way you can write APIs for C/C++ programmers to use, using
Euphoria.

Not to worry, Euphoria applications can still be compiled in U4IA++.



And a question to get you going.
Does Euphoria (ie. RDS's language) interpret Machine Code routines, or  does
it simply let the CPU execute it when you state "call()"?

ie. Like this: (interpretted)

switch(opcode)
{
case 0x?:
   __asm OPCODE; break;
case ...
}

or this:

__asm MOV ip,[next opcode];

Shown in VC++ style.

Because if Euphoria does *not* interpret the Machine Code, then
A. Why the hell are those Machine Code routines I download so slow?
B. I see many ways to let Euphoria run "compiled" C/C++/U4IA++ code in-line.


Mike The Spike
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu