Path: news.daimi.aau.dk!news.uni-c.dk!newsfeed.sunet.se!news00.sunet.se!sunic!mn6.swip.net!plug.news.pipex.net!pipex!tube.news.pipex.net!pipex!lade.news.pipex.net!pipex!tank.news.pipex.net!pipex!newsfeed.internetmci.com!news.mathworks.com!fu-berlin.de!zrz.TU-Berlin.DE!marie!wpp From: wpp@marie.physik.TU-Berlin.DE (Kai Petzke) Newsgroups: comp.lang.beta Subject: Re: [Q]GuiEnv canvas.scan Date: 30 Jan 96 12:39:27 GMT Organization: Technical University Berlin, Germany Lines: 92 Message-ID: References: <4eg2mv$ra9@glitnir.ifi.uio.no> <4ejqer$2p7@glitnir.ifi.uio.no> NNTP-Posting-Host: marie.physik.tu-berlin.de olag@solva.ifi.uio.no (Ola Fosheim Grøstad) writes: >In article , > wpp@marie.physik.TU-Berlin.DE (Kai Petzke) writes: >Great! Are you planning to do the fragmentsystem as well? In my >opinion, the fragmentsystem is what makes Beta tick. The fragment system has already been implemented. As with the Mjolner system, Attributes, ObjectDescriptor and DoPart slots are implemented. I am thinking about adding another slot type: MainPart. In the BETA grammar, MainPart contains all the parts of a pattern, except for the prefix. MainPart slots would allow you to define an abstract SuperPattern-hierarchy, and filling that hierarchy with "flesh" or contents elsewhere: file 1: (# pattern1: <>; pattern2: pattern1 <>; pattern3a: pattern2 <>SLOT P3a: MainPart>>; pattern3b: pattern3 <>; x: ^pattern3a; y: ^pattern2; do x[]>y[]; (* legal assignment *) y[]>x[]; (* assignment with run time Qua check *) y; (* object evaluation *) #); file 2: --- P1: MainPart --- (# <> do <> #) and so on. >A matter of curiosity: Are you basing this solely on the Beta-book >or do you use research-reports/inside-info as well? So far, I have only used the BETA-book, and my experiments with the Mjolner BETA system. The later were mostly used to answer questions like "Should this code compile?" or "What should this code do?" For example, this is a legal BETA code fragment: A: @P; B: A.X (# X: (# value: @integer do 1->value exit value #) do value+1->value #); while this is not legal: A: @P; B: A.X (# X: IntegerValue (# do 1->value #) do value+1->value #); >>However, the generated C or C++ is UGLY. So, if you think about something, >>which takes your BETA source tree, and outputs a C++ source tree, which >>can be used for further development, well, I don't think, that such a >>program could be written. >No, what I had in mind was a simple compiler that didn't worry about >optimization at all, but would leave that to the commercial compiler. >And more importantly to allow simple interfacing to C++ modules >and libraries, with virtuals and all. Adding a BETA <--> C++ interface is a task, which is quite different from tranlating BETA to C or C++. I would definitely like a more general and easier-to-use BETA <--> C interface then the one, what Mjolner provides. The best thing, IMHO, might be, that the BETA compiler can actually parse C or C++ header files, and allow direct calls to the functions contained in it, and allows direct access to all structures/unions defined in it. Kai -- Kai Petzke, Technical University of Berlin, Germany http://www.physik.tu-berlin.de/~wpp/ to learn about Linux, Postgres and BETA. wpp@marie.physik.tu-berlin.de for regular e-mail How fast can computers get? -- Warp 9, of course, on Star Trek.