Data as code
started 2/2/2004; 11:31:38 AM - last post 2/5/2004; 7:42:41 AM
|
|
Mike Summers - Data as code
2/2/2004; 11:31:38 AM (reads: 409, responses: 10)
|
|
Does anyone have a pointer to a list of languages that do not differentiate between code and data?
I'm thinking of languages like Lisp and Scheme (and perhaps even Smalltalk with its blocks and compilation).
I'm working on a knowledge management system and it seems like a good idea to be able to represent the knowledge directly as executable "code".
Thanks-- Mike
|
|
Jim Apple - Re: Data as code
2/2/2004; 11:45:23 AM (reads: 401, responses: 1)
|
|
I don't have a link to a list, but I heard TCL does.
|
|
Matt Hellige - Re: Data as code
2/2/2004; 11:50:34 AM (reads: 398, responses: 0)
|
|
Languages that have this property are often said to be "homoiconic." Perhaps a search for that would be productive. I have no idea if there's an accepted nominalization (homoiconicity, homoiconicness, homoiconism?)...
|
|
Peter Van Roy - Re: Data as code
2/2/2004; 12:39:54 PM (reads: 388, responses: 1)
|
|
languages that do not differentiate between code and data
Do you mean, where code and data have the same syntax? The problem
with that is that the code syntax tends to become oversimplified, to fit
a simple data model or a simple parser. This is the case with Lisp and
Scheme. Prolog goes a small step towards fixing this with its dynamic
operator declarations.
It would be nice to see a real fix: where the code syntax is not simplified
yet code can be manipulated as easily as data. I don't know the recent
research in this area; what is the state of the art?
|
|
andrew cooke - Re: Data as code
2/2/2004; 12:54:58 PM (reads: 380, responses: 0)
|
|
i don't think anyone has mentioned xsl.
|
|
Dan Shappir - Re: Data as code
2/2/2004; 1:26:02 PM (reads: 377, responses: 0)
|
|
Yes, TCL is a very good example. Everything, including code, is a string.
|
|
Karl Reitschuster - Re: Data as code
2/2/2004; 10:35:23 PM (reads: 335, responses: 0)
|
|
Hi,
25 years ago, we wrote programs on an NCR 500 in machinecode.
depending how you handle the memory it could be data or code, or both
Karl R. :-)
|
|
Dominic Fox - Re: Data as code
2/3/2004; 2:46:01 AM (reads: 314, responses: 0)
|
|
Indeed, one of the gnarliest old-style machine-code programming techniques involves re-using opcodes (or parts of them) as data values elsewhere in the program. Not that anyone with more than 1K of memory to play with should ever want to do this...
|
|
Frank Atanassow - Re: Data as code
2/4/2004; 8:21:38 AM (reads: 210, responses: 0)
|
|
Does anyone have a pointer to a list of languages that do not differentiate between code and data?
Sure: 6502, 8086, 8088, 80x86, ...
Thankfully most programming languages these days differentiate between the two, as they've recognized that code is a particular kind of data, namely, data which supports an `evaluate', `execute' or `normalize' operation.
|
|
Noel Welsh - Re: Data as code
2/5/2004; 3:57:18 AM (reads: 177, responses: 0)
|
|
If macro systems suit the bill there is Maya, Java Syntax Extender and MacroML to name a few. Of course I don't have a problem with Scheme's syntax so I don't see what the fuss it about ;-)
|
|
Dominic Fox - Re: Data as code
2/5/2004; 7:42:41 AM (reads: 154, responses: 0)
|
|
Are .Net attributes data or code? How about XML deployment files for J2EE components? Or XAML documents? Or postscript documents...?
|
|
|
|