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

ITT we code in our own fictional languages.

Name: Anonymous 2008-08-23 20:31


func say($s) { echo $s, "\n"; }
class :open Thing {
    var :pub=r :priv=rw $thing;
    func :pub :pure hai() {
        return func () { say "Hai."; }
    }
    func :priv die() { die(); }
}
class :open Thing {
    func hai() {}
}
class :open String {
    func :pub :uses=$var makeAwesome() {
        $var = "Awesome!"; # Or somesuch.
    }
    func __toInt() {
        return 5;
    }
}
Thing::hai()();
(new String("Hai!") == "Hai")
say "Lol"->makeAwesome(); # "Awesome!"
say "Num" + 5; # "10"

Name: Anonymous 2008-08-23 20:38

I like it. Does it have anonymous functions? Also, is there a reason for the Perlish sigils?

Name: Anonymous 2008-08-23 20:38

C-Awesome++.

Integers = the following:

Dear compiler, write the following message on the monitor. "Hello World."

Thanks compiler, I really appreciate it.

Name: Anonymous 2008-08-23 20:42

>>2
Wait, forget that first question. I had a brief attack of the stupid.

Name: Anonymous 2008-08-23 20:45

USE CURL TO GET ANUS FROM >>1
INSPECT ANUS, STORE VULNERABILITIES
USE VULNERABILITIES TO HAX ANUS
RETURN TO OS

Name: Anonymous 2008-08-23 20:51

>>5

Ok...what the fuck does "hax anus" mean?

I cant become a /prog/rammer til I learn the history of that meme.

Name: Anonymous 2008-08-23 20:52

Here's my implementation of >>1. It's the forced indentation of code, without statements and a couple tweaks. I call this language "Understatement", and I fap to it every night. No such thing as public or private access, and I'm guesssing what die does there.

say = print

Thing = class (object):
    __init__ = lambda self, pub:
        self.pub = pub
    hai = lambda: #Static method if no self
        lambda: say('Hai.')
    die = lambda: die() #Note: this hangs, but doesn't run out of stack space

Thing.hai = lambda: pass

str.makeAwesome = lambda self: self = "Awesome!"
str.__int__ = lambda: 5

Thing.hai()()
str('Hai!') == 'Hai'
say('Lol'.makeAwesome())
say(int("Num") + 5)

Name: Anonymous 2008-08-23 20:53

>>2
As you can see, the method hai in the Thing class returns an anonymous function.

class ProgPost
{
    var :priv :pub=r $thread = "http://dis.4chan.org/post/prog";
    var :priv :pub=r $post;
    var :priv :pub=r :customAttr $name;
    func __fromString(String $post) {
        $this->post = $post;
    }
    func :pub post() {
        $p = new HTTP()->setMethod("POST")->setURI($this->thread);
        for $k => $v in $this {
            if ($k->customAttr) $v = "Anonymous";
            $p->setPOSTVal($k, $v); // class Attrib is converted to String.
        }
        $p->post();
    }
}
((ProgPost) "Hello, /prog/!")->post();


It has static typing, but uses automatic type casting when the apropriate method is given. Type casts are performed when a function expects an argument of a different type, or implicit by (Class)-ish casts.

No special reason for the sigils, I've just gotten used to them.

Name: Compiler 2008-08-23 20:58

Hello World.

Name: Anonymous 2008-08-23 21:23

jesus christ /prog/ writes ugly languages

Name: Anonymous 2008-08-23 21:36

main :: IO ()
main = putStrLn "Hello World"

Name: Anonymous 2008-08-23 22:23


main :: IO()
main = puts "Hello World"


It's basically Haskell, but without the weirdly capitalized function names.

Name: Anonymous 2008-08-23 22:51

I liked >>1. The syntax was much nicer than Haskell.

Name: Anonymous 2008-08-23 23:15

Look horribly like Ruby

Name: Anonymous 2008-08-23 23:26

I think >>1 is perl6

Name: Anonymous 2008-08-24 3:29

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Name: Anonymous 2008-08-24 7:13

>>"Hello World\n" println
  Hello World
>>

Name: Anonymous 2008-08-24 9:25

until = fun: (b, c) ->
    while({ not(b()) }):
        c()

Animal = class:
    __init__ = (name) ->
        self.name = name

    make_sound = ->
        print('Generic animal noise.')

Dog = class(Animal):
    make_sound = ->
        print('Woof.')

Cat = class(Animal):
    make_sound = ->
        print('Meow.')

SlashProgSlasher = class(Animal):
    make_sound = ->
        print('Read SICP')

haskell = Dog('Haskell')
haskell.make_sound()

read_sicp = False
days_until_sicp = 10

slash_prog_slasher = SlashProgSlasher('Anonymous')

until({ read_sicp }):
    slash_prog_slasher.make_sound()

    if days_until_sicp == 0:
        print 'SICP read!'
        break

    print('%i days until SICP.' % [days_until_sicp])
    days_until_sicp -= 1


It's FIOC without statements like >>7, but it's more like Scheme because you can pretty much do anything with it. Oh and


foo(...):
    bar


is short for foo(..., {bar}). Not too keen on how while/until look and I'm not sure how to make 'break' work, but I like it.

Name: Anonymous 2008-08-24 9:27

>>18

And -> foo (and (a, b) -> foo) is shorthand for {foo} (and {(a, b) -> foo}) too, which makes it a bit confusing.

Also that if call is wrong, it should be if(days_until_sicp == 0):

Name: Anonymous 2008-08-24 12:19

until = new Function(b:Boolean, c:Block) {
    while(!b)
        yield c;
}

class Animal {
    private var _name:String;

    Animal(name:String) {
       _name = name;
    }

    public function makeSound() {
       print("Generic animal noise");
    }
}

class Dog extends Animal {
    public override function makeSound() {
       print("Woof.");
    }
}

Name: Anonymous 2008-08-24 15:22

Name: Anonymous 2008-08-24 16:54

>>20

Cute. You missed the rest of my code, though. (And I explicitly tried to make user-defined control structures the same as built-in ones, like Scheme, in mine.)

Name: Anonymous 2008-08-24 20:23

haskell = Dog('Haskell')
haskell.make_sound()

lolcode.DeadDogException
        at <interactive>:2:9

Name: Anonymous 2008-08-25 2:57

I made a SNUSP-interpreter with function calls and brainfuck loops once.

Name: Anonymous 2008-08-25 8:36

>>23
;_;

Name: Anonymous 2008-08-25 8:40

>>23
Ah, fuck. I can't believe you've done this.

Name: Anonymous 2008-08-25 8:46

>>23
Congratulations. You got my joke.

Name: Anonymous 2008-08-25 11:23

Due to Haskell's lazy evaluation, make_sound only sounds if there's any human listening, just like if a tree falls in the forest, and no one hears it, it doesn't make any sound¹.

¹: Bullshit, though. The Universe is deterministic and objects exist without the need for the disgustingly anthropocentric observative/conscious bullshite; it's just observation what's not perfect, because it runs from within the system.

Name: Anonymous 2008-08-25 11:30

>>28
It's a good thing that wasn't Haskell, then.

Name: Anonymous 2008-08-25 11:40

>>28
¹: Bullshit, though. The Universe is deterministic and objects exist without the need for the disgustingly anthropocentric observative/conscious bullshite[citation needed]

Name: Anonymous 2008-08-25 12:21

>>30
[ 8=====> ]

I use my penis to sense this. It's as serious as any Wikipedia source, so here is it.

Name: Anonymous 2008-08-25 12:54

>>28
The Universe is deterministic
What's it like, being stuck in 1925?

Name: Anonymous 2008-08-25 13:34

>>31
[ 8=====> ]
What's it like, having a character sequence for a penis?

Name: Anonymous 2008-08-25 14:06

>>32
What's is like, being stuck in "since we can't measure it it doesn't exist, you fuqin angered an expert physicist, godfuckingdamn!" and in "let's keep the shit coming without acknowledging the current theories are broken so we can continue to get government money on this"?

Name: Anonymous 2008-08-25 14:14

>>34
back to /sci/, please

Name: Anonymous 2008-08-25 14:24

>>34
The fact that you don't understand the uncertainty principle is not a limitation of our measuring devices but a fundamental limitation of the universe itself doesn't mean it's not true. That's the entire point of it.
Similarly, the fact that you heard some idiot on /sci/ rant about string theory doesn't mean quantum physics doesn't have immensely accurate predictive power, which is also borne out by experiment.

In conclusion, back to /b/, please.

Name: Anonymous 2008-08-25 15:06

>>34
Double slit experiment et al -- universe is provably non-deterministic etc get the fuck over it.

Name: Anonymous 2008-08-25 15:43

ATTENSIONS FUCKING PHYSICSTS: FUCK OFF.
thank you

Name: Anonymous 2008-08-25 16:00

>>37
Uhhhhh except that's not true at all, since in Quantum Mechanics, the term observe has a different meaning to in the Classic lexicon. All double-slit proves is that we poke things when we measure them.

Name: Anonymous 2008-08-25 16:06

/sci/ is that way -->

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