Go Back   Science Forums > Physical Sciences Forums > Computer Science and Technology
Reply
 
LinkBack Thread Tools
Old 11-14-2006   #1 (permalink)
KickAssClown's Avatar
A Person


Location:
Here and now
 
KickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to all
Send a message via MSN to KickAssClown Send a message via Yahoo to KickAssClown
 



Not Ranked  0 score     
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.


----------------
There are no truths in science, only the falsifiable hypotheses and explanations of the people who test them.

Hyper Physics
Hyper Math
Wikipedia
Reply With Quote
Old 11-14-2006   #2 (permalink)
pgrmdave's Avatar
Existing

Administrator

Location:
New Jersey
 
pgrmdave is a splendid one to beholdpgrmdave is a splendid one to beholdpgrmdave is a splendid one to beholdpgrmdave is a splendid one to beholdpgrmdave is a splendid one to beholdpgrmdave is a splendid one to behold
Send a message via AIM to pgrmdave
 



Not Ranked  0 score     
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
Old 11-14-2006   #3 (permalink)
KickAssClown's Avatar
A Person


Location:
Here and now
 
KickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to all
Send a message via MSN to KickAssClown Send a message via Yahoo to KickAssClown
 



Not Ranked  0 score     
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.


----------------
There are no truths in science, only the falsifiable hypotheses and explanations of the people who test them.

Hyper Physics
Hyper Math
Wikipedia

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


 



Not Ranked  0 score     
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
Old 11-14-2006   #5 (permalink)
CraigD's Avatar
Creating

Administrator
Editor

Location:
Silver Spring, MD, USA
 
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
 



Not Ranked  0 score     
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
Old 11-15-2006   #6 (permalink)
moo's Avatar
moo
Questioning


Location:
USA
 
moo is a jewel in the roughmoo is a jewel in the roughmoo is a jewel in the rough
 



Not Ranked  0 score     
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
Old 11-15-2006   #7 (permalink)
TheFaithfulStone's Avatar
Rockin'


 



Not Ranked  0 score     
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
Old 11-15-2006   #8 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: Self-Referential Language?

you can do it with PHP man. Check out the eval function


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 04-22-2009   #9 (permalink)
KickAssClown's Avatar
A Person


Location:
Here and now
 
KickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to allKickAssClown is a name known to all
Send a message via MSN to KickAssClown Send a message via Yahoo to KickAssClown
 



Not Ranked  0 score     
Re: Self-Referential Language?

I recently learned reflection and generics and Java, and it revitalized my interest in the subject of a self-referential language.

I've been working the past week on designing the basic structure of a fully object-oriented programmable programming language for writing programming languages. Recently, I became cognizant of my disgruntlement with so called object-oriented languages like Java. Java has no object representing the language itself or representing languages in general with which you can operate upon.

What is a strangeloop program/programming-language which produces genetic variants of itself as it's output? A quine is a strangeloop which produces a clone.


----------------
There are no truths in science, only the falsifiable hypotheses and explanations of the people who test them.

Hyper Physics
Hyper Math
Wikipedia
Reply With Quote
Old 04-22-2009   #10 (permalink)
TheFaithfulStone's Avatar
Rockin'


 



Not Ranked  0 score     
Re: Self-Referential Language?

Seems like Smalltalk might be your thing.

Squeak for instance contains a version of itself written in itself.

Plus, you can do foolish things like true := false.

Fun.

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


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

» Advertisement
» Current Poll
Should Hypography have a forum dedicated to Plant Sciences?
Yes - 69.57%
16 Votes
No - 13.04%
3 Votes
Maybe - 17.39%
4 Votes
Total Votes: 23
You may not vote on this poll.


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

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright © 2000-2009 Hypography
Part of the Hypography - Science for Everyone Network