HARLEQUIN DYLAN and C FFI 
Author Message
 HARLEQUIN DYLAN and C FFI

    Does anyone know how to add a c lib to the dylan IDE so that it can be
linked and called ? Can you also call a DLL written in another language the
same way ?

Thanks

Shawn



Tue, 16 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI

Quote:

> Does anyone know how to add a c lib to the dylan IDE so that it can
> be linked and called ?

In the Dylan libraries where I need to link to a c library I added the
following entry in the .hdp file:

c-libraries:    c:\some-directory\thelib.lib

I had to put an explicit path in. I think I edited the .hdp file
directly to do it but I can't recall why. This was in a HD 1.1 project
so just adding from the IDE may work in later versions.

Quote:
> Can you also call a DLL written in another language the same way ?

If you have an import library to link against or you use
GetProcAddress and LoadLibrary then you should be able to.

Chris.
--
http://www.double.co.nz/dylan



Tue, 16 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI
    Thanks Chris, is this the same with COM if I would like to use DX7 ?

Shawn



Tue, 16 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI

Quote:

> Thanks Chris, is this the same with COM if I would like to use DX7 ?

Using the various COM stuff included with HD you can create the
DirectX 7 objects, call methods, etc. I don't think you'll need to
link to any libraries to use DX7. You will need to create wrappers
using the ffi and COM libraries for all the DX 7 objects and methods
you want to call. That would be a large job.

I tried using the wizard to import the DX7 Visual Basic type library
but it failed with an error (unknown variant type 28). I've reported
it to functional objects so hopefully FD 2.0 will be able to
work. That would save a lot of work.

I have used the library linking with HD with dx-creator, a game
library for windows (http://www.dx-creator.com). This worked fine.

Chris.
--
http://www.double.co.nz/dylan



Wed, 17 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI
    Chris have you used Dolphin Smalltalk ?

Shawn



Sat, 20 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI
    Thanks Douglas:

    Yes I thought that Harlequin Dylan would allow me to step away from
using C/C++ for my development (PC Games) but it seems to have floated off
into obscurity. I chanced acrossed Dolphin Smalltalk and was amazed at how
easy it appears to be.  I need a language that can replace C/C++ but still
use the available SDK's out there for graphics and music, like FMOD. I am
currently looking at squeak now. Does Smalltalk come in like a bazillion
flavors ?

Shawn



Sat, 20 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI


Quote:
>     Chris have you used Dolphin Smalltalk ?

Okay, so, my name's not Chris, but ... at comp.lang.smalltalk there's a
thread talking about the merits of Dolphin.  Are you asking your
question because you have a question about COM or C FFI using Dolphin?
Or, are you asking because you want to try out Smalltalk for your
solution and are wondering if you should use Dolphin?

Either way, perhaps the folks over in comp.lang.smalltalk can give you
a hand.

<!giving-in-and-voicing><smalltalk-preferences>
(Me, I'm quite a fan of Squeak (free from www.squeak.org, and on more
platforms than you can name, probably, and connects to C code quite
easily if it's a DLL (windows) or shared library (other platforms)),
and of VisualWorks (free non-commercial version, comes with an ORB that
lets you modify interfaces remotely and dynamically ... very cool), but
I've never used Dolphin, and the people who do seem very happy with it.)
</smalltalk-preferences>

Sincerely,
Douglas M. Auclair

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI


Quote:
>     Thanks Douglas:

>     Yes I thought that Harlequin Dylan would allow me to step away from
> using C/C++ for my development (PC Games) but it seems to have floated off
> into obscurity.

That would be a shame because we're still here.

Quote:
> I chanced acrossed Dolphin Smalltalk and was amazed at how
> easy it appears to be.  I need a language that can replace C/C++ but still
> use the available SDK's out there for graphics and music, like FMOD. I am
> currently looking at squeak now. Does Smalltalk come in like a bazillion
> flavors ?

[ Ironically, "Dolphin" was one of the candidate names for Harlequin's Dylan
that we were bandying about a couple of years ago... ]

I don't want to dis' Smalltalk since it will be better than C/C++ (as will
Common Lisp, OCAML, or even Java). However, Dylan is a modern fusion of the
best ideas from languages like Smalltalk and Common Lisp. E.g. Smalltalk has no
multiple inheritence or multiple argument dispatch. I personally think that
these are very useful attributes for modelling agents and environments -- the
kinds of entities you get in games programming.

E.g.

// Dylan

define method engage (agent ::  <agent>, target :: <agent>)
  move-to(agent, position-of(target));
  attack(agent, target);
end method;

define method engage (agent :: <mouse>, target :: <cat>)
  squeak("Not likely!");
  move-to(agent, position-of($mouse-hole);
end method;

// Java

class Agent {
  void engage (Agent target) {
    moveTo(target.positionOf);
    attack(target);
  }

Quote:
}

class Mouse extends Agent {
  void engage (Agent target) {
    if (agent instanceof Cat) { // oops no multi-arg dispatch in Java
      squeak("Not likely");
      moveTo(Location.MOUSE_HOLE.positionOf());
    }
    else {
      super.engage(agent);
    }
  }

Quote:
}

__Jason


Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI

Quote:



> >     Thanks Douglas:

> >     Yes I thought that Harlequin Dylan would allow me to step away from
> > using C/C++ for my development (PC Games) but it seems to have floated off
> > into obscurity.

> That would be a shame because we're still here.

Jason,
    I was under the impression that Harlequin Dylan was no more and that
the rights were sold to Functional Objects, Inc. Could you expand on your
statement a little? The Dylan situation is confusing (as well as tragic
:-() and since the FO web site isn't very informative it isn't surprising
that people suspect the worst.

Quote:
> > I chanced acrossed Dolphin Smalltalk and was amazed at how
> > easy it appears to be.  I need a language that can replace C/C++ but still
> > use the available SDK's out there for graphics and music, like FMOD. I am
> > currently looking at squeak now. Does Smalltalk come in like a bazillion
> > flavors ?

> I don't want to dis' Smalltalk since it will be better than C/C++ (as will
> Common Lisp, OCAML, or even Java).

It depends on the kinds of games and the kinds of processing that your
game programs are doing. I don't think dynamic languages can give you the
same small memory footprint or high performance as static languages. That
was supposed to be the point of the type declarations and sealing in
Dylan, right?

-- Brian



Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI
What was the rumour about sections of Banjo-Kazooie being written in LISP? :-)

One of Dylan's earliest demos was the OpenGL animation on the cover of the
Harlequin book.

The rush to write highly-optimized games for consoles in C++ is a bit like the
rush to make houses out of fudge...

- Rob.

Quote:

> It depends on the kinds of games and the kinds of processing that your
> game programs are doing. I don't think dynamic languages can give you the
> same small memory footprint or high performance as static languages. That
> was supposed to be the point of the type declarations and sealing in
> Dylan, right?

> -- Brian



Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI

Quote:

> What was the rumour about sections of Banjo-Kazooie being written in

LISP? :-)

Not a Rumour.  Don't know nuthin' 'bout no Banjo-Kazooie, but two
different companies use Common Lisp for game development, see
http://www.franz.com/apps/gd.main.html

Sincerely,
Doug Auclair

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI

Quote:




> > >     ... I thought that Harlequin Dylan would allow me to step away
> > > from using C/C++ for my development (PC Games) but it seems to have
> > > floated off into obscurity.

> > That would be a shame because we're still here.

> Jason,
>     I was under the impression that Harlequin Dylan was no more and that
> the rights were sold to Functional Objects, Inc. Could you expand on your
> statement a little? ...

I believe I may do that for him: "we" here is roughly "Functional Objects
and some ex-Harlequin-Dylan people helping out" (including Jason, who's
still at Hqn, and me, who's not :-).  HD has effectively become FD, which
is still in beta, but is equally still alive.

Quote:
> ... The Dylan situation is confusing (as well as tragic :-() and since
> the FO web site isn't very informative it isn't surprising that people
> suspect the worst.

I'm not in an official position to give anything like release dates, I can
only repeat that "we're still here".  But we'll all be happier when the
2.0 release actually arrives :-)

Quote:
> ...  I don't think dynamic languages can give you the same small memory
> footprint or high performance as static languages. That was supposed to
> be the point of the type declarations and sealing in Dylan, right?

I suppose you're broadly right, though I haven't seen any numeric
comparisons beyond simple benchmarks.  Dylan is supposed to be able to
improve speed and space over Lisp (and Smalltalk?), but not necessarily
get quite as small as C++ (certainly not as C).  OTOH, it definitely
improves expressibility over C (and I'd say over C++).

The theory is that you can do high-level stuff in a dynamic language like
Dylan and low-level stuff in C etc.  As for the practice, I believe "Crash
Bandicoot" (or similar) on the PlayStation has its high-level map and
actor control written in a home-grown Lisp interpreter ... and I'm sure
someone at Harlequin had an "interacting with DOOM" demo ;-)  But we've
yet to see large-scale performance comparisons in any app area (unless you
count HD/FD itself -- vs. JBuilder/MSVC++, anyone?), let alone
high-performance areas like games.

HTH,
Hugh



Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI

Quote:


> > ...  I don't think dynamic languages can give you the same small memory
> > footprint or high performance as static languages. That was supposed to
> > be the point of the type declarations and sealing in Dylan, right?

> ... I believe "Crash Bandicoot" (or similar) on the PlayStation has its
> high-level map and actor control written in a home-grown Lisp
> interpreter ...

Aha!

  http://www.gamasutra.com/features/19990813/languages_01.htm

(contains GOOL, a pseudo-Lisp compiler, not an interpreter) and, following
up the "OCamlDoom" reference:

  http://pauillac.inria.fr/~pessaux/

(but I don't have a PS-viewer handy for the relevant paper).

Hugh



Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI


Quote:
>     I was under the impression that Harlequin Dylan was no more and that
> the rights were sold to Functional Objects, Inc. Could you expand on your
> statement a little? The Dylan situation is confusing (as well as tragic
> :-() and since the FO web site isn't very informative it isn't surprising
> that people suspect the worst.

What I meant was that Fun-O is now supporting what used to be Harlequin Dylan
so there's no need to run off. Personally, I still work at Harlequin, but I
help Fun-O in my spare time.

Quote:
> > > I chanced acrossed Dolphin Smalltalk and was amazed at how
> > > easy it appears to be.  I need a language that can replace C/C++ but still
> > > use the available SDK's out there for graphics and music, like FMOD. I am
> > > currently looking at squeak now. Does Smalltalk come in like a bazillion
> > > flavors ?

> > I don't want to dis' Smalltalk since it will be better than C/C++ (as will
> > Common Lisp, OCAML, or even Java).

> It depends on the kinds of games and the kinds of processing that your
> game programs are doing. I don't think dynamic languages can give you the
> same small memory footprint or high performance as static languages. That
> was supposed to be the point of the type declarations and sealing in
> Dylan, right?

Its true that it depends on the sort of games you are writing, but loads of
games seem use a hybrid of an optimized core engine and a more dynamic scripted
part. The latter is a candidate for being written in a existing dynamic
language rather than a custom scripting language.

__Jason



Sun, 21 Jul 2002 03:00:00 GMT  
 HARLEQUIN DYLAN and C FFI

Quote:



> >     I was under the impression that Harlequin Dylan was no more and that
> > the rights were sold to Functional Objects, Inc. Could you expand on your
> > statement a little? The Dylan situation is confusing (as well as tragic
> > :-() and since the FO web site isn't very informative it isn't surprising
> > that people suspect the worst.

> What I meant was that Fun-O is now supporting what used to be Harlequin Dylan
> so there's no need to run off. Personally, I still work at Harlequin, but I
> help Fun-O in my spare time.

I think that Scriptics (the company behind Tcl/Tk) has 40 people.  If a
language as bad and as blatantly cheesy as Tcl can survive, there is hope
for Dylan.

------------------------------------------------------------------

Dylan... the high-performance dynamic language
 * open-source Unix version:  http://www.gwydiondylan.org/
 * free Win32 version: http://www.functionalobjects.com
-------------------------------------------------------------------



Mon, 22 Jul 2002 03:00:00 GMT  
 
 [ 19 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Harlequin Dylan FFI access to <buffer>?

2. (fwd) harlequin's dylan-corba mailing list switching to MIT's info-dylan

3. Dylan and Java [was: Harlequin Dylan - Update]

4. swig'ing a C-FFI in Dylan

5. Dylan C-FFI tools

6. FFI->Dylan?

7. FFI->Dylan?

8. Small d2c and Harlequin Dylan incompatibility

9. first attempt at Harlequin-Dylan

10. Functional Objects to take over Harlequin Dylan

11. Harlequin Dylan 2.0 beta 2 is now available

12. Future of Harlequin Dylan

 

 
Powered by phpBB® Forum Software