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

Pages: 1-4041-

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 -->

Name: Anonymous 2008-08-25 16:15

>>36
Yet it's incomplete, and they are confusing objects with probability clouds, among other things. Of course the impossibility to measure everything absolutely is a fundamental limitation of the universe, because we're measuring from the universe itself. But unability to measure doesn't deny existence or determination, much less determinism.

>>37
Proves what? It proves when you measure things, you affect them, and that the wave-particle duality is a hack so that we keep seeing photons as things we understand when they are neither at the same time.

Name: Anonymous 2008-08-25 17:25

You fucktards apparently like putting in more punctuation than Haskell and Erlang combined!

Name: Anonymous 2008-08-25 17:35

But unability to measure doesn't deny existence or determination, much less determinism.
It doesn't confirm it either. Affirmation without proof is unscientific and ultimately destructive.

Name: Anonymous 2008-08-25 18:51

>>41
But unability to measure doesn't deny existence or determination, much less determinism.
Even in the presence of probabilistic quantum behavior, the universe can still be effectively deterministic at a macro level.

Name: Anonymous 2008-08-25 19:05

>>43
Probably so. Yet physicists are pretty much affirming the opposite all the time.

Name: Anonymous 2008-08-25 19:44

My ideal language would be constructed only out of anonymous functions, lambdas, as Alan Touring would have wanted it.

Name: Anonymous 2008-08-25 21:01

>>45
Well all I know is that a partially observable environment appears non-deterministic to any agents inside it. Thus, the possibility that that environment might be deterministic is irrelevant to those agents, because they can't act upon it. They are stuck with treating their environment as non-deterministic, so they might as well call it non-deterministic. Are you sure this isn't what physicists mean?

Name: Anonymous 2008-08-25 21:08

>>46
Alna Touring prefers MACHINE CODE

Name: Anonymous 2008-08-26 5:11

>>48
My other car is 0x60076f.

Name: Anonymous 2008-08-26 6:19

dwim($dwim:$dwimdwim) <- dwim - dwim**dwim;

Name: Anonymous 2008-08-26 7:01

>>39
EPR paradox, you twit! Do you understand it's implications?

Name: Anonymous 2008-08-26 14:55

>>47
Well all I know is that a partially observable environment appears non-deterministic
No shit

Thus, the possibility that that environment might be deterministic is irrelevant to those agents, because they can't act upon it.
What the fuck. Even if they were as silly as to never theorize deeper than they could observe (a limitation by which they will never come up with a perfect theory of all), to affirm the Universe is what you can observe, negating whatever you can't observe is something I'd only expect from religion retards. The Earth was flat 'cause well, it looks flat and you cannot go farther because there be dragons. The Universe is non-deterministic 'cause well, it looks non-deterministic and you cannot tell farther because there be uncertainty principle.

Name: Anonymous 2008-08-26 15:13

>>52
Why don't you take your ideas to a philosophy board, or something?

Name: Anonymous 2008-08-26 15:27

>>53
/prog/ is about abstract bullshite, so this fits. And I haven't been lurking /sci, but if it's what it used to be, I guess I'm going to get better serious discussion here than there.

Name: Anonymous 2008-08-26 15:29

>>54
Seriously, dude, philosophy board.

Name: Anonymous 2008-08-27 0:18

#bnccuda <ptdbo.b>
inq m`in"inq apgc# cbar *apgvR]) {
 cocst ch`r "stp = arac 3 1 ? `rgq[1S : "y ;
 fop (2;)  putp(sqr)2

Name: Bean Curd Operator 2008-08-27 5:38

>>55
Bean Curd Operator

Name: Anonymous 2008-08-27 8:08

>>57
Hax my anus.

Name: Anonymous 2009-03-06 7:05

U know what I   did and look   where i am   the father of   the Java programming   systems have flowered   in the last   few years since   I did anything   bad to me   Maybe he was   talking about C   you are a   lot of things   that we still   need to load   a function for.

Name: Anonymous 2009-03-06 8:19

Are common knowledge on.

Name: Anonymous 2011-02-03 2:23

Name: Anonymous 2011-02-04 12:45

Name: Anonymous 2013-07-30 15:16

CODE IN MY ANUS

Name: Anonymous 2013-07-30 15:56

RETURN TOMY ANUS

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