Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.glorb.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end From: tm Newsgroups: comp.compilers Subject: Re: Looking for volunteers for XL Date: Tue, 3 Jan 2012 09:28:24 -0800 (PST) Organization: Compilers Central Lines: 71 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <12-01-003@comp.compilers> References: <11-11-048@comp.compilers> <11-11-053@comp.compilers> <11-11-054@comp.compilers> <11-11-058@comp.compilers> <11-11-060@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1325862044 98337 64.57.183.58 (6 Jan 2012 15:00:44 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 6 Jan 2012 15:00:44 +0000 (UTC) Keywords: design Posted-Date: 06 Jan 2012 10:00:44 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:402 On Nov 27 2011, 11:24 pm, "BartC" wrote: > A self-extensible language sounds like a good idea and might well > work. I admit I've never used one ... Really? AFAIK you tried Seed7 a little bit (Thank you four your fannkuch-redux benchmark program). So you tied an extensible language without noticing that it is extensible. :-) > (although I did play with designing > one once, then gave up), The trick is: You need to restrict the possibilities somehow to "reasonable" features. I know that this depends on the point of view... > and have no idea what is and isn't possible; > could you create a language that has C syntax for example, then add in > a few Cobol-like statements or APL expressions? Funny, such things were the original idea, which lead to Seed7. Later I found that some restrictions really make sense. BTW: Seed7 could do this, when APL operators are restricted to ASCII. :-) The braces of C would conflict with existing braces in the predefined Seed7 language (Seed7 uses them to define set literals). So some of the existing Seed7 definitions need to be omitted, which I did for the following example. The example defines a C if-statement: $ include "seed7x_05.s7i"; # Define the syntax of a simple C if-statment: $ syntax expr: .if.().{.().} is -> 25; # Define the semantic of a simple C if-statement: const proc: if (in boolean: cond) { (in proc: statement) } is func begin if cond then statement; end if; end func; const proc: main is func begin # Use the C if-statement: if (TRUE) { writeln("okay"); } end func; I left out COBOL and APL, but you should see the principle. BTW: I don't think that such a brutal mix of language features (C, COBOL, APL) makes sense. > Or is the syntax it's > capable of rather more limited? Seed7 is not overengineered, and other extensible languages should also avoid this pitfall. Greetings Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows.