In our previous episode, Mark Morgan Lloyd said: > Is anybody interested in a PROLOG interpreter written in Turbo Pascal, > plus a couple of typeset articles which outline how it works internally? > > When I found it I was wondering whether it could be usefully used to > handle inference rules in a Delphi/FPC/Lazarus program, in the same way > that MS use Prolog for some of their network configuration stuff. > However it turns out that it is coded explicitly for Turbo Pascal with a > garbage collector on top of the normal heap, which I think implies that > porting it to FPC would need either a mark/release facility or multiple > heaps which could be "thrown away" when no longer needed.
I don't understand why interested people couldn't implement mark/release for the base TP compatible level of FPC ? What is so different between TP and FPC there? Of course it wouldn't scale, but TP didn't scale further than 16MB anyway (64MB with 386 tricks). Basically you only need an own heapmanager that allocates all allocations in-order from a 16MB block, and mark and release procedures that call that heapmanager and are declared in some unit preloaded wiht -Fa? > I was reminded of this by the discussion elsewhere on refcounted > objects, which would obviously be another way to do it. Timothy Budd's > book on Leda gives an interesting example of using the unification > operation which underpins Prolog to process graph structures. Prolog is an interpreter, and I assume its structures are movable. Native languages allocations usually aren't. _______________________________________________ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other