From pkocmid@praha.czcom.cz  Mon Sep  6 02:26:13 1999
Received: from serverpha.CZCOM.CZ (praha.czcom.cz [195.146.117.2])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id CAA07063
	for <prolog@swi.psy.uva.nl>; Mon, 6 Sep 1999 02:26:12 +0200 (MET DST)
Received: from raxas ([195.146.100.87]) by serverpha.CZCOM.CZ
          (Post.Office MTA v3.5.2 release 221 ID# 0-57399U3000L300S0V35)
          with SMTP id CZ for <prolog@swi.psy.uva.nl>;
          Mon, 6 Sep 1999 02:27:04 +0200
From: "Petr Kocmid" <pkocmid@praha.czcom.cz>
To: "Prolog, list" <prolog@swi.psy.uva.nl>
Subject: SWI-P Win32 port embedding problem
Date: Mon, 6 Sep 1999 02:27:23 +0200
Message-ID: <000a01bef7fe$96dbe5a0$576492c3@raxas>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-2"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2377.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Importance: Normal
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by swi.psy.uva.nl id CAA07063

hello there everybody,

I joined this list 3 days ago, but not receiving any messages since, but it's weekend and maybe only professionals are here :-). Hope it is an active list.

I recompiled 3.2.9 source on win32 with Visual C++ 6/Service Pack3 and it works almost fine. That means prolog works perfectly, but plwin console has some font metrics problem on Windows98: cursor is misplaced by one or several pixels back on every character printed in line, so it is not usable for editing at all. But it does not matter for me since I do not need using it.

Another problem I have is with static embedded system. Here is the description:
PL_halt() calls Halt() which performs engine cleanup and exit(). This is not acceptable, since it prevents application to do something meaningfull after prolog engine has been shut. atexit() is not a solution for me, because 1. I need to embed prolog in Win32 GUI app, which opens and closes prolog session by user interaction (AI solver) and 2. want make C++ class wrapper around the engine, where constructor does PL_initialize() and destructor PL_halt() housekeeping.

I thing either this exit() call should be moved out of the Halt() to C stub code such as pl-ntcon.c and similars on other platforms or some more portable solution retaining backward compatibility will be perhaps PL_terminate() for embedded system doing only housekeeping or Prolog_exit() with callback setting. 
I shall investigate sources more for similar glitches because it prevents multithreading and other things (ANSI C++ exception unwinding for example). 

Perhaps I can help with swi multithreading features on win32. I plan to build COM object around the engine with dual interfaces and type library so it could be used from C++, Java, VBasic, MSOffice apps and so on.

I haven't played with prolog for more than 8 years so I tried about a dozen free implementations last month and must say, "SWI-Prolog is the best I have ever seen". It's portability is fascinating and as a C++ developer, I like the transparent module system very much. I am doing free 3D first person RPG game in C++ with open source 3D engine and want prolog to make automatic 3Dworld/scenario builder, inverse cinematics for digital actors and tactical combat decision AI.

Petr Kocmid
independent developer
pkocmid@atlas.cz (pkocmid@praha.czcom.cz)

