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

/prog/ is moving slowly

Name: Anonymous 2008-07-03 9:53

so I will write fictional nonsensical Haskell code with nice Unicode

— Computes the anus of y
x :: Num a ⇒ a → a
x = λy·y×(y÷2)

— Charlie Brown
foo :: String → String
foo x = case lookup “x” x of
                 Just yy
                 Nothing → x

Name: Anonymous 2008-07-03 9:59

fail.

Name: Anonymous 2008-07-03 10:20

>>2
back to /b/

Name: Anonymous 2008-07-03 14:30

HEREZ AN ALGORTHM I ROTE IN ABC


c c c b c a a b b b b c c b a b b a b b b b a b c b c c a a b a a b b b c b a c
a b c a a b b c b a b a c c a b c a a a a c a b c a b c b c c a c a c b b c c b
a c c c c c b b c b b c b c b c a b c b c b c a b c c b b b a a b b b a a b b a
c a c b c b b b a a b b b b b a c b a a b a b a b c b b b b b b c c c b a b c b
b b a a c a a a b c b a b b c c b a b b c a c b a c a c c a c a a c b b c a b b
c c b a c a b a a b a c c b a a a a b b c b c b c a c c c b c b a c b b a b a b
a b a c a a b a c b a b a b b b b b a b c c b a b b b a a c b b b c a c a c b a
a c c a c b a b c b b b a b b b b b a a c a b a a b b a b a a c b a a b b b b a
a a c a a a b a c c c c a c b c b c b a b c a a b b c a b a a c a b a b a c c a
a a c b c c b c c c a c a a c c c a b c b b b c b b b c b c b c a b a b a c b a
c b a a b b b b c b b c b c a a b c c b a c b a a a c c a b a b b a a a b a b c
a a c c c a a a b b c c c b b a a c a a a a c c b b c b c c b b a c c a c c b b
a a c b b c a b c b b a a a a c c b b a b c b c b a c b a c b b a b c b c c a b
b b c c c c c a b c a b b b a a a b b c b c a a c a a b a a b b a a b a c a a c
c a b a a a c b b a a a b b b b c b a a c b b a c c a b b c a b c c b c a c b a
c b b a b a b b a c b a c a a a c a b c b c a a b b c b b c b b a b a a a a c c
a b c a a c b c c c b a b a b a c a b b a c c c a b a c c b c c a a c a a b b a
b c b a c c c a a a c b c c c a b b b b b a c a b b a c c b c b b c a a a b c a
a a b a c c b c b b a c b c c a a c b c c c c a c b c a a a a b a c c a b b b a
c b c a c c b c b a c b c c b b a a c c c c b a c b b c c a b c b a c c c c a a
c c c a b c c b a b b b a a c b a c a a c a c b c c c a b c c c c c c a b a a b
a c c b b c c a c b a a a c b a b a a c a c a c a a c c c a a a a b a b c b a b
b b c c c c b c a c a c b c b a a c b c a b b b c a b b c a a a c a a b a c b a
a a c a a c b c c a c b c c a a b b c c a a a c c b a c a b c a b a a c b a a a
a a a b b a b a a a b b c b a b a a a b b b c c c c b a c a a a b b a a b a b a
a b b b c c a a b c c b b a b c c c a c c c b a a a c c b a a a b c a b a c a b
c a a a c c c a b a c b b b c b c b c b b c c c a c c b b a a c b b b c c c a b
b a b a a b a c b c c a b c a a c a a b b a a c c c c c a a c c a b a c b a b b
b b c b a b b b b a b b b a b a b b c b c b c c b c a b a b c a c c c a c b b b
c c c a c a a a b b b c b c c b c a b c c c a c c c c b b c b b b a b a c a a c
b c b c a b c c c b c a b c a b b c a b b a a a b b c b a a b c c a b c b b b b
c b b a a a a c b a b b c a a b a a a c a a b b c b c b c a b c b b c b b b a c
c c a a b b a b a a b c b a a a a c b b a c b a a c b b a b a c c b b a c c c c
a a c b b b b a a b c a b c b b c a a c c b a c b b b b c c a c a b a a c a c b
a b c a c a c b c a c b c a b c b b c b c a c c c c a b c c c a c a c c c a c a
b a c b c b b b c b b b b b a b b a b a b c b a a b b b b b c c c b a c c b c b
b a a a b a c c b a b c b a c a b c c a b c a b b a c a c b a b a c a b c b a b
a a c a a a b b c c a a c c b c b c b a b c a b b b c b a b c a a c c c a a c c
b c c a b c a c a c b b a b b c b b c a b c a a a b b a a c b b c b a c c b a c
b c c b b a c c a c c b a c c a b a b b c b a a c b c b b b b a c a c b b b a a
b c c a b c a a b c a c a a c a c b a a a a c b c a c c a b c c c c a a a a b b
c b a c c c a b b b a c b c a c c c c c c a c c b b b c c b a b c c c a a a b c
c b a b c b c a c c a c b b a c c c a b b b a a b c a a a c b a b a c b c b b b
c a c c b a b a b c a a b a c a b a a a c b a a b a b a a b c c a b a b a a b a
a a a c a b b b b a a b b a c a b b a c c a a c a a a c a c a c a c c b a b a a
c a b b c a b a c b c c c c b c b a c a b b a c a c b a c b c c a b a c b a c a
a a a c a b c b b a a b b c a c a b a a c c b c b a c a a a c a c b a a a c c c
b a c b a c a a a a b b b b c b a a b b b b c b a c b b a a a b c c c a c b a b
b b b c b b c c c a c c c b a a b c b c a b b c a a b b b c a b c b c a a b a a
a b b c b c c a b c a c c a c a b c b a c b c a c b b c c a b b b b c b a a b c
a c b a b a c c a c a b c a a c c c c a b b c b b c c a b a a b a b a c a c a a
c b c b a b a b a b b a c c c a a b c a c c b a a c c a c c b c a a c a b b a c
b b c b b a a a b b a a b b a b b c a a a a a c a c b c c c c b c a a c b a b b
b c c b c c a b c a c c a c a c a c b c b c b a b b a a a a b a b a c b a a b a
c c a b a a a c c c a b b c a b a b c c a a b b c c b c a a b c b a a a a b b b
b b b b c b b c c c b a b c a b a c c a a c c b a a c b c b a b b b c c b a b a
a b a c a b b a b c b a c b a c a c b a c a a c b c c b a b c c c a a a b b c a
c a a b a a a a b a b a b a a b b c c b a c c b c b a b a b a c c a a b a a b c
b c a c b b b c a b c b b a b a c c c c a b c a c a a b c a a a b b b c b c c c
b a b c a b a b a c b a b a c c a c b c b a b a c c c a a b c b c c c c b b a c
b b c a a a b c a c c b b c b a a b a b c c c b c c b a b a c a b c c a c a a c
a b b b b b c c a b b a a c b c a c b b a b a a a c b b b b c b a b c a a b b b
b b b c c c b b c c c b c a c b b c c b a b b b c c b a a a b c c b a b a b b a
a c a a c b a b a a c c a a a a c c c b b a c a a c a b a a a c b a c c c c c b
c b c b c b a c b b b b a b a b a c c c c a c a b b c b a b c c a b b a c c b a

b a a c c b b c c c a b b c c b a b c c a a c a c a c a a b a a c b a b a b a b
a a c a a c b b b a b b a c a b c b b b a a b c c c b c b a b a a a b b b b c c
b a b b a b a b a c b c c b c c a b a b b c c b c c a c a c b a c b a b b b a b
c b a a b c a b c c a a a a c b b b b c a c a a b a a b b a c a c a b b a c a b
a a b c b c c c a a a c a c a a b c a c a c a a b b a c c b b a a a b c a c a c
c b a b b c c c b c c b b c c b b c c a c c b a a a b c b a a b b a a a c b b b
b b c b c a c c c c c c c b b c b c a a c a a a b c b a b b b a

Name: Anonymous 2008-07-03 15:27

You seriously need to consider using code tags, >>1

Name: Anonymous 2008-07-03 16:55

>>5
no he doesn't. gtfo.

Name: Anonymous 2008-07-03 18:02

>>4
Is that simply SKI calculus with S renamed to a, K renamed to b and I renamed to c?

Name: Anonymous 2008-07-03 18:06

>>6
He does, posting code in proportional font is ugly.

Name: Anonymous 2008-07-03 18:08

>>8
Since when?

Name: Anonymous 2008-07-03 18:12

>>7
No.

Name: Anonymous 2008-07-03 18:12


— Computes the anus of y
x :: Num a ⇒ a → a
x = λy·y×(y÷2)

— Charlie Brown
foo :: String → String
foo x = case lookup “x” x of
                 Just y → y
                 Nothing → x

Name: Anonymous 2008-07-03 18:13

>>9
Since, like, forever. Please don't tell me that you don't use a monospaced font when coding.

Name: Anonymous 2008-07-03 18:21

>>7
Not at all.  There are two versions of the ABC programming language:

ABC is an esoteric programming language created by Orange. The language is very simple and easy to implement. This language has nothing to do with the real programming language ABC.

Instructions
a - Increment the accumulator
b - Decrement the accumulator
c - Output the accumulator

d - Invert accumulator
r - Set accumulator to a random number between 0 and accumulator
n - Set accumulator to 0

$ - Toggle ASCII output mode.  When on, the C instruction prints the accumulator as an ascii character.
l - Loop back to the beginning of the program.
; - Debug.  Prints out accumulator as a number and ascii character.

Examples
Print out 1337:
acaaccaaaac

Simulate a dice throw:
aaaaarac

Random phone number generator:
ac
naaaaaaaaradc
naaaaaaaaarc
naaaaaaaaarc

naaaaaaaaradc
naaaaaaaaarc
naaaaaaaaarc

naaaaaaaaradc
naaaaaaaaarc
naaaaaaaaarc
naaaaaaaaarc


Hello, World!
$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaa
aaaaaaaaaaaaaaaaaaaaaaacaaaaaaaccaaacbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbcbbbbbbbbbbbbcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaacaaaaaaaaaaaaaaaaaaaaaaaacaaacbbbbbbcbbbbbbbbcbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc


Count to infinity(or until out of memory. What ever comes first)
acl

Constantly Beep using ASCII code 7(bell)
aaaaaaa$cnl


------------

ABC is an imperative general-purpose programming language and programming environment developed at CWI, Netherlands by Leo Geurts, Lambert Meertens, and Steven Pemberton. It is interactive, structured, high-level, and easy to learn and use, intended to be used instead of BASIC, Pascal, or even AWK. It is not a systems-programming language but is good for teaching or prototyping.

ABC has only five basic datatypes. It does not require variable declarations. It has explicit support for top-down programming. Statement nesting is indicated by indentation. It provides infinite precision arithmetic, unlimited sized lists and strings, and other features supporting orthogonality and ease of use by novices. Its designers claim that ABC programs are typically around a quarter the size of the equivalent Pascal or C programs, and more readable.

ABC was originally a monolithic implementation, leading to an inability to adapt to new requirements, such as creating a Graphical User Interface. ABC could not directly access the underlying file system and operating system.

ABC includes a programming environment with syntax-directed editing, suggestions, persistent variables, and multiple workspaces.

ABC is available as an interpreter/compiler, currently at version 1.05.02. ABC has been ported to Unix, DOS, Atari, and Apple Macintosh.

ABC also had a major influence on the design of the Python programming language; Guido van Rossum, who developed Python, previously worked for several years on the ABC system in the early 1980s.

An example function words to collect the set of all words in document:
HOW TO RETURN words document:
   PUT {} IN collection
   FOR line IN document:
      FOR word IN split line:
         IF word not.in collection:
            INSERT word IN collection
   RETURN collection

Name: Anonymous 2008-07-03 18:33

>>13
Looks like the first on then.

HEY LOOK GUYZ I CAN PRINT 'H'
$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac

Name: Anonymous 2008-07-03 18:39

>>13
tl;dr

>>11
awful

>>12
I use monospace fonts because my editor doesn't support editing proportional ones and my compiler doesn't support Unicode. It doesn't mean proportional code is ugly just because it's hard to do.

Name: Anonymous 2008-07-03 18:48

>>15
It's ugly and impractical. The compiler tells you that you have issues at line 42, column 64, so you, used to the constant width of characters, know (approximately), where is the 64rd character. OH WAIT LOL NO YOU DON'T the line is has some vertical bars and semicolons, so 64 is not where you think it is.

Name: Anonymous 2008-07-03 18:51

>>13
What ABC compiler would you suggest?

Name: Anonymous 2008-07-03 18:52

>>17
Sorry, it's N-P complete.

Name: Anonymous 2008-07-03 19:47

>>16
No, my compiler draws me a little picture of the spot with the error, pointing to the problem. And if I really want to, I can make it put my cursor right where it found the error.

Name: Anonymous 2008-07-03 21:14

>>19
which compiler is that?

Name: Anonymous 2008-07-03 21:20

>>17
For which one.  Esoteric or real.

Name: 9 2008-07-03 21:23

>>12
I sometimes don't. I've been thinking about completely getting rid of monospace. A decent variable-width font is much more readable.

>>16
If you're manually reading your compiler output and moving your cursor to the error location, either your editor sucks or you don't know how to use it.

Name: Anonymous 2008-07-03 21:38

So many fucking failing programmers in this thread...
FUCK.

Name: Anonymous 2008-07-03 21:52

>>23
newfag

/prog/ IS fail.

Name: Anonymous 2008-07-03 23:38

>>22
The only good thing about coding in C or Sepples is that there's no particular reason to use a monospace font. Of course, decent languages like Factor buy you the same thing only moreso. But it's a nice change.

Name: Anonymous 2008-07-03 23:54

>>25
The only good thing about coding in C or Sepples is that there's no particular reason to use a monospace font.
How is this specific to C or Sepples? Most languages can be written just fine with proportional fonts. Lisp and Objective-C are some of the rare exceptions, and even with them, the problem could be solved by a slightly smarter editor display formatter.

Name: Anonymous 2008-07-04 2:20

>>26
Let me tell myself there's an upside, okay?

Name: Anonymous 2008-07-04 2:40

>>27
That's what your mother said as I pounded her thighs rhythmically.

Name: Anonymous 2008-07-04 2:46

>>13
It cannot make decisions, so it is not Touring-Complete.

Name: Anonymous 2008-07-04 2:47

>>29
Why were you drumming on his mother's upper legs?

Name: Anonymous 2008-07-04 21:24

>>17
I've never seen an ABC compiler posted here, so I wrote one.

#!/usr/bin/perl

$pre = <<EOF;
#include <stdio.h>

int main()
{
    int acc = 0, asc = 0;
EOF

$pre_rand = <<EOF;
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int acc = 0, asc = 0;
    srandomdev();
EOF

$post = <<EOF;
    putchar('\\n');
}
EOF

$post_loop = <<EOF;
    }
}
EOF

%ops = (
    a => 'acc++',
    b => 'acc--',
    c => 'asc ? putchar(acc) : printf("%d", acc)',
    d => 'acc = -acc',
    r => 'acc = random() % (acc+1)',
    n => 'acc = 0',
    '$'=>'asc = !asc',
    ';'=>'printf("%d%c", acc, (char)acc)'
);

sub compile {
    my ($abc) = @_;
   
    die "Syntax error: unrecognized operator $1 at char $+[1]\n"
        if $abc =~ /([^abcdrn\$l;\s])/;
    warn "Unreachable code detected at char @{[$-[1]+(1)]}: $1\n"
        if $abc =~ /l(.+)/;
   
    $abc =~ s/\s+//g;
    $has_rand = $abc =~ /r/;
    $has_loop = $abc =~ s/l.*//;
    $indent = "\t" . "\t" x $has_loop;
   
    (my $c = $abc) =~ s/(.)/$indent.$ops{$1}.";\n"/ge;
    $c = ($has_rand ? $pre_rand : $pre) .
         ($has_loop ? "\tfor(;;)\n\t{\n" : "") .
         $c .
         ($has_loop ? $post_loop : $post);
}

undef $/;
print compile <>;

Name: Anonymous 2008-07-04 21:28

>>32
Doh.  s/l\(\.\+\)\//l(.+)\/s/

Name: Anonymous 2008-07-04 21:36

>>33
Never mind, that's even worse.  Fixed version below.  Generated code is correct either way.

#!/usr/bin/perl

$pre = <<EOF;
#include <stdio.h>

int main()
{
    int acc = 0, asc = 0;
EOF

$pre_rand = <<EOF;
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int acc = 0, asc = 0;
    srandomdev();
EOF

$post = <<EOF;
    putchar('\\n');
}
EOF

$post_loop = <<EOF;
    }
}
EOF

%ops = (
    a => 'acc++',
    b => 'acc--',
    c => 'asc ? putchar(acc) : printf("%d", acc)',
    d => 'acc = -acc',
    r => 'acc = random() % (acc+1)',
    n => 'acc = 0',
    '$'=>'asc = !asc',
    ';'=>'printf("%d%c", acc, (char)acc)'
);

sub compile {
    my ($abc) = @_;
   
    die "Syntax error: unrecognized operator $1 at char $+[1]\n"
        if $abc =~ /([^abcdrn\$l;\s])/;
    warn "Unreachable code detected at char @{[$-[1]+(1)]}: $1\n"
        if $abc =~ /l\s*(\S+.*)/s;
   
    $abc =~ s/\s+//g;
    $has_rand = $abc =~ /r/;
    $has_loop = $abc =~ s/l.*//;
    $indent = "\t" . "\t" x $has_loop;
   
    (my $c = $abc) =~ s/(.)/$indent.$ops{$1}.";\n"/ge;
    $c = ($has_rand ? $pre_rand : $pre) .
         ($has_loop ? "\tfor(;;)\n\t{\n" : "") .
         $c .
         ($has_loop ? $post_loop : $post);
}

undef $/;
print compile <>;

Name: Anonymous 2008-07-04 21:59

>>32
oh gawd I lol'd.

Name: Anonymous 2008-07-05 0:25

>>35
no.  shut up.

Name: Anonymous 2008-07-08 4:37

>>13
Constantly Beep using ASCII code 7(bell) [br] aaaaaaa$cnl
There's a bug in your program. Should be aaaaaaa$cn$l.

Name: Anonymous 2008-07-08 5:47

Constantly Beep using ASCII code 7(bell)
This should be the new hello world.

Name: Anonymous 2008-07-08 5:48

>>37
There's a bug in your post. Should be
Constantly Beep using ASCII code 7(bell)
aaaaaaa$cnl

Name: Anonymous 2008-07-08 17:33

$echo "acaaccaaaac" | ./>>34.pl | gcc -x c -
$./a.out

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