Related articles |
---|
Language Design 81282ed9a88799d21e77957df2d84bd6514d9af6@myhashism (Billy Mays) (2011-07-18) |
Re: Language Design usenet@rwaltman.com (Roberto Waltman) (2011-07-18) |
Re: Language Design sinu.nayak2001@gmail.com (Srinivas Nayak) (2011-07-18) |
Re: Language Design anton@mips.complang.tuwien.ac.at (2011-07-19) |
Re: Language Design zwinkau@kit.edu (Andreas Zwinkau) (2011-07-20) |
Re: Language Design acolvin@efunct.com (mac) (2011-07-23) |
Re: Language Design christophe.de.dinechin@gmail.com (Christophe de Dinechin) (2011-07-23) |
Re: Language Design osesov@gmail.com (Oleg Sesov) (2011-07-23) |
Re: Language Design gene.ressler@gmail.com (Gene) (2011-07-26) |
Re: Language Design thomas.mertes@gmx.at (tm) (2011-07-27) |
Re: Language Design usenet@rwaltman.com (Roberto Waltman) (2011-07-28) |
Re: Language Design s_dubrovich@yahoo.com (s_dubrovich@yahoo.com) (2011-08-04) |
Re: Language Design torbenm@diku.dk (2011-08-08) |
[1 later articles] |
From: | Christophe de Dinechin <christophe.de.dinechin@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Sat, 23 Jul 2011 08:17:37 -0700 (PDT) |
Organization: | Compilers Central |
References: | 11-07-027 |
Keywords: | design |
Posted-Date: | 24 Jul 2011 18:09:40 EDT |
On Jul 18, 10:16 pm, Billy Mays
<81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com> wrote:
> I am trying to design a programming language for a simple processor
> (16 bit, ~10 instructions, 16 registers). I am not sure what a
> language actually needs in order to be more useful than pure assembly,
> but is also reasonable to implement.
Bill,
Is your objective to invent a language, or have a language that works
on that simple processor? You may be interested in XL (http://
xlr.sf.net). The XL2 portion of it is very easy to retarget, and it is
a high level language which you can then tweak to explore various
language or CPU design ideas.
Basically, say you want to add a 16-bit unsigned type and the
associated multiply-add, where the assembly syntax is "fma16 target =
src1, src2, src3", all you need to do is:
- Modify xl2/native/library/runtime/C/xl_builtins.xs with the required
language declarations:
type uint16 is XL.BYTECODE.uint16
function FusedMultiplyAdd(X, Y, Z: uint16) return uint16 written
X*Y+Z is XL.BYTECODE.fma_uint16
- Add the corresponding target syntax in the bytecode file
fma_uint16 "fma16 $1 = $2, $3"
If that approach works for you, you can create your own "runtime" by
replicating the "C" directory (which targets standard C compilers) and
creating a directory for your target, say "myproc". Then, you run the
compiler with "nxl -r myproc foo.xl" and it will compile using this
runtime.
Hope this helps
Christophe
Return to the
comp.compilers page.
Search the
comp.compilers archives again.