Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

It's Time for Meta/prog/

Name: Anonymous 2012-02-20 11:55

I've been thinking, wouldn't posts be much simpler if we had some sort of /prog/ specific language to create metaposts? Writing a few lines of code to generate the content of a post is much more efficient than writing the actual post itself.


print backTo(/g/)  // Prints "Back to /g/, please!"
print isShit(Lisp) // Prints "Lisp is shit"

//This can be extended further, to use information
//obtained from the specific thread
foreach (x; thisThread.langs)
    print isShit(x) //For every language x mentioned in the
                    //the thread, prints "x is shit"

//Also has powerful mechanisms for
//parsing the content of other posts
foreach (p; thisThread.posts.mentions(Python))
    print p.num newln backTo("toilet scrubbing") //For any post that mentions Python, reference it and print "Back to toilet scrubbing, please!"


Of course, this is just a small subset of what such a language could do. I'm just laying out the basic idea.

Name: Anonymous 2012-02-20 12:01

NO EXCEPTIONS

Name: Anonymous 2012-02-20 12:15

>>2
True. A special print statement will never fly.

Name: Anonymous 2012-02-20 12:25

foreach (x; thisThread.langs)
most retarded syntax i have ever seen

Name: Anonymous 2012-02-20 12:26


use ACME::prog;
print $_.$/ foreach (@progusers);


OUTPUT:
Me
You
The Sussman

Name: Anonymous 2012-02-20 12:44

>>1
Why bother having a print statement? Every program outputs a string, and functions should be composable. Just have every block return the value of its last statement, and have the interpreter print the return value of the main function to stdout.

If you need finer control over what goes where, then include built-in support for some kind of string builder/text stream data structure. Reserve a keyword or special syntax for the "append to current stream" operation.

Name: Anonymous 2012-02-20 13:19

>>6
print backTo("whence you came") newln
print "We don't take kindly to Python-loving mental midgets here"

Name: Anonymous 2012-02-20 15:32

>>6
No need for special syntax if you have string buffers backed by immutable strings.

How important is to have random-access strings? Most [useful] processing is done with pattern matching or simple iteration anyway.

Name: Anonymous 2012-02-20 15:55


let a := "hax my anus"
for i from 0 -> 10 do
  a


Outputs:

"hax my anus"
"hax my anus"
"hax my anus"
"hax my anus"
"hax my anus"
"hax my anus"
"hax my anus"
"hax my anus"
"hax my anus"
"hax my anus"

Name: Anonymous 2012-02-20 15:56

You could do this with D

Name: Anonymous 2012-02-20 15:59

print 9.refNum //Prints ">>9"
for a=0..10
    print "fuck off " + fagQuotes(faggot) newln newln
print backTo(/g/)

Name: Anonymous 2012-02-20 16:12

>>11

let a := "Fuck off faggot with your hipster language that looks like shit\nBack to /g/ with you faggot."
for i from 0 -> 100 do
  a

Name: Anonymous 2012-02-20 16:21

lol it's almost like programming!! we EXPERT PROGRAMMERS now!!!

Name: Anonymous 2012-02-20 16:50

>>8
Yeah, I can't remember the last time I saw random access of strings. And special syntax isn't necessary anyway. The syntax could be the same as a function call. It doesn't matter. I just thought it would be neat to have an "append this to the current output buffer" ability, especially if there's an output buffer particular to the local scope.

Name: Anonymous 2012-02-21 10:38

>1 is shit

It works!

Name: Anonymous 2012-02-21 10:58

Inb4 we could actually do this with Perl or Javascript.

Name: Anonymous 2012-02-21 11:00

>>16
Or, y'know, Lisp.

Name: Anonymous 2012-02-21 11:50

Haha, like anyone here knows how to use that POS lang.

>>16 Name: Anonymous : 2012-02-21 10:58
Javascript

Name: Anonymous 2012-02-21 13:37

What the hell are you doing with your quote system? Do you think this is late 90s USENET or some shit?!

>>18 Name: Anonymous : 2012-02-21 11:50
Haha, like anyone here knows how to use that POS lang.

>>16 Name: Anonymous : 2012-02-21 10:58
Javascript

Name: Anonymous 2012-02-21 13:40

>>19
What the hell are you doing with your quote system? Do you think this is /prog/ kindergarten or some shit?!
Oh, it is.

Name: Anonymous 2012-02-21 13:46

[quote="Anonymous"]/PROG/ KINDERGARTEN TAIMU DESU~~[/quote]

Name: Anonymous 2012-02-21 13:48

Also, niggers

Don't change these.
Name: Email:
Entire Thread Thread List