Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming

Journal Elwood P Dowd's Journal: What are those programs called that output their own source? 2

Has anyone heard of the excercise of writing an application that outputs its own source code? I remember first hearing about it when reading about the Haskell programming language, and I haven't heard of it since then. I forget the word for this kind of application.

I want to write one, but for practical reasons not for intellectually stimulating ones. I spend my time writing TSQL and VB6. I'm not a very good programmer. So I'm interested in any kind of pointers that will help me along my way.

It'll be in Javascript, which I've never used before.

Edit 8/22 #2: Here it is. It validates XHTML 1.0 strict. Works in Firefox and IE6. Now I want to add some features to it so that it's self-descriptive.

This discussion has been archived. No new comments can be posted.

What are those programs called that output their own source?

Comments Filter:
  • But in Mozilla's javascript implementation you have every object has toSource()
  • The shortest possible quine in Scheme is:

    ((lambda (x)
    (list x (list (quote quote) x))
    )
    (quote (lambda (x) (list x (list (quote quote) x))))
    )

    where
    (lambda (x) (list x (list (quote quote) x)))
    is a sort of inline function
    and
    (quote (lambda (x) (list x (list (quote quote) x))))
    is the value passed into the function.

    Substitute the parameter for x everywhere in (list x (list (quote quote) x)) and you should get the original statement.

Systems programmers are the high priests of a low cult. -- R.S. Barton

Working...