Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!xdos!doug From: doug@xdos.UUCP (Doug Merritt) Newsgroups: comp.sys.amiga Subject: Re: YALW Message-ID: <426@xdos.UUCP> Date: 8 Jul 89 16:50:12 GMT References: <19248@louie.udel.EDU> Reply-To: doug@xdos.UUCP (Doug Merritt) Organization: Hunter Systems, Mountain View CA (Silicon Valley) Lines: 47 In article <19248@louie.udel.EDU> MROBINSON@wash-vax.bbn.com writes: > > Plus, I hear most astrophysicists like Forth for some reason. Forth was originally invented as a low level control language for (something like) telescope tracking control hardware at an observatory. >The language that made it quickest for me to get complicated things done >quickly was Quintus Prolog (a damn fine implementation, guys!). The nice >thing about Prolog is that IF you are of a logical turn of mind, AND you can >find a coherent model for the optimal algorithm for your problem, Prolog allows >you to express that model in a short program (and I mean SHORT!) that works in Yes. Case in point: a friend of mine, Paul Baclaski (who also happens to be an Amiga enthusiast) was working on an integrated incremental compiler/editor environment. The goal was to have the editor notice changes made to the program, and pass info about them to the compiler, which would know about interdependencies in the program, note which ones were affected by the changes, and recompile the smallest possible subset of the program. I.e. if you changed the type of a variable X from short to long, it would recompile only those parts of the program that used X. (It used a novel output file format which allowed compilation of units smaller than a function.) He prototyped the hard part that had to refigure interdependencies in Prolog. It took something like twenty lines of Prolog to specify the logic of the interdependences and when something should be recompiled. Fiddling with this Prolog prototype allowed him to find bugs in his design, fix them, and produce a flawless algorithm in something like one day. Lacking a C/Prolog interface, he then recoded this module in C, which required several hundred lines compared with the original 20 lines. He estimated that it saved him several weeks of development (tricky code that would have required several complete rewrites of this multihundred line module per experiment), even though he had to rewrite it in C once it was debugged. BTW it worked correctly on the first try once recoded in C. > The drawback to Prolog is that >one really can't use it very well for interacting with the operating system; >I always used their C language interface to do sockets and the like. Yep. Every language has its drawback, and it makes more sense to simply switch to C when appropriate than to try and add systems programming features to Prolog. Doug -- Doug Merritt {pyramid,apple}!xdos!doug Member, Crusaders for a Better Tomorrow Professional Wildeyed Visionary