Self-Referential Language?

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 11-14-2006
KickAssClown's Avatar
Game Designer

Join Date: Jan 2005
Location: on the Material Plane (Physical Universe)
Posts: 1,474
KickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of light
Send a message via MSN to KickAssClown Send a message via Yahoo to KickAssClown
Self-Referential Language?

Are there any computer languages that have primitives, or objects which contain not a value, or address, but a expression of the written language itself?

Perhaps I am just having difficulty conceiving of the mechanism of doing this with languages I use.
__________________
"Anymore I am only interested in pets whom can make me coffee." -My Mom

Hyper Physics
Hyper Math
Wikipedia

Member of:
IGDA
YouTube
MySpace
Wikipedia:KickAssClown
The Forge
Reply With Quote
  #2 (permalink)  
Old 11-14-2006
pgrmdave's Avatar
Existing
Hypography Staff Member
Administrator
Re: Self-Referential Language?

I don't know of any, but look into LISP, and read Godel Escher Bach and/or Metamagical Themus by Douglas Hofstader - if you want to learn about self-reference, whether in mathematics, computers, or language, those two books will provide excellent resources.
__________________
Hypography Forum Administrator
Reply With Quote
  #3 (permalink)  
Old 11-14-2006
KickAssClown's Avatar
Game Designer

Join Date: Jan 2005
Location: on the Material Plane (Physical Universe)
Posts: 1,474
KickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of lightKickAssClown is a glorious beacon of light
Send a message via MSN to KickAssClown Send a message via Yahoo to KickAssClown
Re: Self-Referential Language?

Actually, I thought of this in reference to GEB, which I am in the process of reading.

I had been thinking of self-referential languages for the longest time. I just recently have been working on the capability to express my thoughts in this field.
__________________
"Anymore I am only interested in pets whom can make me coffee." -My Mom

Hyper Physics
Hyper Math
Wikipedia

Member of:
IGDA
YouTube
MySpace
Wikipedia:KickAssClown
The Forge

Last edited by KickAssClown; 11-14-2006 at 08:27 PM.
Reply With Quote
  #4 (permalink)  
Old 11-14-2006
TheFaithfulStone's Avatar
Rockin'

Join Date: Jun 2005
Posts: 1,474
TheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to behold
Re: Self-Referential Language?

My all time favorite example of self-reference.

Good url. Will be posted again later.

TFS
__________________
There are no stupid questions, but there are a LOT of inquisitive idiots.
Reply With Quote
  #5 (permalink)  
Old 11-14-2006
Creating
Hypography Staff Member
Administrator
Editor

Join Date: May 2005
Location: Silver Spring, MD, USA
Posts: 4,492
CraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond reputeCraigD has a reputation beyond repute
Post Self-modifying MUMPS code

Quote:
Originally Posted by KickAssClown
Are there any computer languages that have primitives, or objects which contain not a value, or address, but a expression of the written language itself?
Some languages – especially interpreted (as opposed to compiled) one lend themselves better to what I thing you’re describing.

Though LISP is usually mentioned as a language that lends itself to containing expressions of itself, I’m fond of MUMPS (as anyone who’s noted the programs I’ve posted at hypography is likely aware ), which also lends itself to manipulating its own code.

Here’s a very simple example, cut from a MUMPS direct (interactive) mode terminal session (note the “USER>” is a typical direct mode prompt, not actual input or program output):
Code:
USER>r X
w 1 q:'5  s $p(X," ",3)="q:'"_($p(X,"'",2)-1) x X w 2
USER>x X
11111122222
USER>w X
w 1 q:'0  s $p(X," ",3)="q:'"_($p(X,"'",2)-1) x X w 2
USER>
This program counts down from 5 to 0. It’s not a particularly good or clever program, but remarkable in that the code contained in symbol X references no symbol but itself. Note that MUMPS keywords can be and usually are abbreviated (eg: r[ead] w[rite] q[uit] s[et] $p[iece] x[ecute]), leading many to comment that it looks like line noise.

It’s fairly easy to write much more complicated and meaningful self modifying MUMPS programs, such as in the puzzle game-playing program in my post ”Self modifying code in an interpreted language”.
__________________
Moderator: Computers and Technology; Medical Science; Science Projects and Homework; Philosophy of Science; Physics and Mathematics; Environmental Studies
Reply With Quote
  #6 (permalink)  
Old 11-15-2006
moo moo is offline
Questioning

Join Date: Oct 2006
Location: USA
Posts: 218
moo is a jewel in the roughmoo is a jewel in the roughmoo is a jewel in the roughmoo is a jewel in the rough
Re: Self-Referential Language?

One way of doing this (in any language) is have your app write a simple "pseudo" language to a file, then code a simple interpreter to read it. I played around with something like this a few years ago for experimenting with self modifying AI programs. You could use RAM, but a file holds the data for review even if the app crashes.

moo
__________________
"Other friends have flown before...
On the morrow he will leave me, as my hopes have flown before."
Quoth the raven "Nevermore."

~ From THE RAVEN by Edgar Allan Poe ~
Reply With Quote
  #7 (permalink)  
Old 11-15-2006
TheFaithfulStone's Avatar
Rockin'

Join Date: Jun 2005
Posts: 1,474
TheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to beholdTheFaithfulStone is a splendid one to behold
Re: Self-Referential Language?

So Clown, I found this on Wikipedia, are you talking about a quine?

TFS
__________________
There are no stupid questions, but there are a LOT of inquisitive idiots.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
choice with language Help! CHADS Computer Science 27 05-19-2008
Next Big Language alexander Computer Science 3 07-16-2006
Language Forum, do you want it? sanctus Suggestions and Wish List 15 07-20-2005
language system?! Tim_Lou Philosophy and Humanities 96 01-13-2005

» Current Poll
Favorite James Bond?
Sean Connery - 63.64%
7 Votes
George Lazenby - 0%
0 Votes
David Niven - 9.09%
1 Vote
Roger Moore - 9.09%
1 Vote
Timothy Dalton - 9.09%
1 Vote
Pierce Brosnan - 0%
0 Votes
Daniel Craig - 9.09%
1 Vote
Hate 'em all - 0%
0 Votes
Who's James Bond? - 0%
0 Votes
Total Votes: 11
You may not vote on this poll.

All times are GMT -8. The time now is 01:01 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright © 2000-2008 Hypography
Part of the Hypography - Science for Everyone Network