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

Pages: 1-

More Anonix Win

Name: Anonymous 2011-08-07 15:31

BEHOLD!



#ifndef __ANONIXWIN_H__
#define __ANONIXWIN_H__

/* Anonix.h - A set of common functions for the Anonix operating system. Copyright: none. Public Domain. Written by Anonymous. United by one. Divided by zero. We do not forgive nor forget. Expect us. */

const int ZERO = 0;

int isequalto(int x,int y){return x==y;}
int isnotequalto(int x,int y){return !isequalto(x, y);}
int islessthan(int x,int y){return x<y;}
int islessthanorequalto(int x,int y){return islessthan(x, y) || isequalto(x, y);}
int isgreaterthan(int x,int y){return x>y;}
int isgreaterthanorequalto(int x,int y){return isgreaterthan(x, y) || isequalto(x, y);}
int isnegative(int x){return islessthan(x, ZERO);}
int ispositive(int x){return isgreaterthanorequalto(x, ZERO);}
int iszero(int x){return isequalto(x, ZERO);}
int isnotzero(int x){return isnotequalto(x, ZERO);}
int dividebyzero(int x){return x/ZERO;}

#endif

Name: Anonymous 2011-08-07 15:36

Symbols starting with __ are reserved for implementations. Non-inline functions really shouldn't be defined in headers. Variables really shouldn't be defined in headers. These functions are useless and counter-productive. The last four sentences of the comment are silly.

Name: Anonymous 2011-08-07 15:39

>>2
Symbols starting with __ are reserved for implementations.
Such as ... ANONIX ?

Name: Anonymous 2011-08-07 15:47

>>2
Thanks anon.

#ifndef BOOLS_H
#define BOOLS_H
#define ZERO 0
/* ANONIX.H - version 1.01 - A set of common functions for the Anonix operating system. Copyright: none. Public Domain. Written by Anonymous. United by one. Divided by zero. We do not forgive nor forget. Expect us. CHANGELOG: deleted excessive whitespace, one of the known leading causes of bloat in the GNU coreutils. Removed symbols starting with __ which are reserved for implementations. Made functions inline. The functions are now useful and productive. The last four sentences
 * in the comments are no longer silly. */
inline int isequalto(int x,int y){return x==y;}
inline int isnotequalto(int x,int y){return !isequalto(x,y);}
inline int islessthan(int x,int y){return x<y;}
inline int islessthanorequalto(int x,int y){return islessthan(x,y)||isequalto(x,y);}
inline int isgreaterthan(int x,int y){return x>y;}
inline int isgreaterthanorequalto(int x,int y){return isgreaterthan(x,y)||isequalto(x,y);}
inline int isnegative(int x){return islessthan(x,ZERO);}
inline int ispositive(int x){return isgreaterthanorequalto(x,ZERO);}
inline int iszero(int x){return isequalto(x,ZERO);}
inline int isnotzero(int x){return isnotequalto(x,ZERO);}
inline int dividebyzero(int x){const int Z=ZERO;return x/Z;}
#endif

Name: Anonymous 2011-08-07 16:09

>>4
anon
You're not an ANONIX DEVELOPER.

Name: Anonymous 2011-08-07 16:13

>>5
I aspire to be. Right now I'm writing echo in Python.

Name: Anonymous 2011-08-07 16:15

gtfo

Name: Anonymous 2011-08-07 17:03

I see you've been reading too much TDWTF.

Name: Anonymous 2011-08-07 17:05

>>
i'm writing cat in ruby

Name: Anonymous 2011-08-07 17:11

>>6,9
Oh boy, because we sure need slow as dog shit versions of the core unix utils that run 50 times slower than the C versions.

Name: Cudder !MhMRSATORI 2011-08-07 17:49

dbz.c

#include <stdio.h>
#include "anonix.h"
int main(int argc,char *argv[]){
 int i;
 if(isequalto(argc,1)){
  puts("Divides arguments by zero.");
  printf("Usage: %s INTEGER [INTEGER, INTEGER, INTEGER, ...]\n",argv[0]);
 }
 for(i=1;i<argc;i++){
  int x=atoi(argv[i]);
  printf("%d\n",dividebyzero(x));
 }
 return 0;
}

Name: Anonymous 2011-08-07 17:50

Isn't there a serious implementation of unix core utils written in Perl? I think they wanted it so that they could have some sort of standard accross a wide variety of OS's.

Name: Anonymous 2011-08-07 17:56

``It is easier to port a shell than a shell script.'' --Larry Wall

Name: CUDDERfan 2011-08-07 18:31

>>10
You have a point. I ditched the Python version and wrote echo[/echo] in Bash.

[code]#!/bin/sh
echo $@


Here are the benchmarks:

GNU

$ time echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.000s
user    0m0.000s
sys    0m0.000s
$ time echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.000s
user    0m0.000s
sys    0m0.000s
$ time echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.000s
user    0m0.000s
sys    0m0.000s
$ time echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.000s
user    0m0.000s
sys    0m0.000s
$ time echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.000s
user    0m0.000s
sys    0m0.000s


Anonix

$ time ./echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.005s
user    0m0.000s
sys    0m0.000s
$ time ./echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.005s
user    0m0.000s
sys    0m0.000s
$ time ./echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.005s
user    0m0.004s
sys    0m0.000s
$ time ./echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.005s
user    0m0.000s
sys    0m0.000s


As you can see, the GNU version is about 5 times faster, but we'll still in the beta phase. Optimization will come later.

Name: Anonymous 2011-08-07 18:52

>>14
Actually it is infinite times faster, besides, you're not really testing the GNU echo implementation, you're testing the echo built-in of the GNU bash implementation (most likely).

Name: 15 2011-08-07 18:57

By the way, if you really want to test the GNU echo implementation invoke the shell with env echo Have you read your SICP today?

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-08-07 18:57

>>15
Actually it is infinite times faster, besides, you're not really testing the GNU echo implementation, you're testing the echo built-in of the GNU bash implementation (most likely).

The bash doc refers built-in command. The built-in's generally run faster than the external commands because the shell doesn't have to do an extra fork()/exec().

Name: Anonymous 2011-08-07 19:04

>>15

Yes, you were right.

$ time /bin/echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.038s
user    0m0.000s
sys    0m0.000s
$ time /bin/echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.003s
user    0m0.000s
sys    0m0.000s
$ time /bin/echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.004s
user    0m0.000s
sys    0m0.004s
$ time /bin/echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.006s
user    0m0.000s
sys    0m0.000s
$ time /bin/echo Have you read your SICP today?
Have you read your SICP today?

real    0m0.005s
user    0m0.000s
sys    0m0.000s


Looks like the Anonix version is faster on average.

Name: Anonymous 2011-08-07 20:04

section    .bss
iobuf:    resb    1024

section    .text
    global    _start
_start:
    pop    ecx
    pop    eax
    mov    ebx, iobuf

    dec    ecx
    test    ecx, ecx
    jz    .fin

    jmp    .argvloop
.SPACE:
    mov    byte [ebx], 0x20
    inc    ebx
.argvloop:
    mov    edx, ecx

    pop    edi
    xor    ecx, ecx
    xor    al, al
    not    ecx
    cld
    repne    scasb
    not    ecx
    mov    esi, edi
    sub    esi, ecx
    mov    edi, ebx
    add    ebx, ecx
    rep    movsb

    mov    ecx, edx
    loop    .SPACE
.fin:
    mov    byte [ebx], 0xa

    lea    edx, [ebx + 1]
    mov    eax, 4
    mov    ebx, 1
    mov    ecx, iobuf
    sub    edx, ecx
    int    0x80
   
    mov    eax, 1
    mov    ebx, 0
    int    0x80

Name: Anonymous 2011-08-07 22:08

ooc.posix.echo

Name: Anonymous 2011-08-07 22:47

>>19
mov ebx, 0
FFFFFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

Name: Anonymous 2011-08-07 23:16

You can have my log(log(O)) Modulo/Exponential Calc.... if i can find it ;)

Windows calc just can't compete//hasn't a hope of being faster

Think it did something like 3^(2^1024) mod ((2^1024)-X) in a couple of minutes [On a 400Mhz max box no less] =)

Name: Anonymous 2011-08-08 6:43

>>21
Read the Intel™ optimization manual.

Name: Anonymous 2011-08-08 7:42

const int ZERO = 0;
#define ZERO 0


Stop using this shit and use
enum { ZERO };

Name: Anonymous 2011-08-08 8:04

>>24
Out of the three, the preprocessor version is likely to give the fastest compile-time.

Name: VIPPER 2011-08-08 8:10

>>24,25
const int ZERO = 0;
Also takes up space of int.

Name: Anonymous 2011-08-08 9:36

>>26
And different because using MEMORY HEX EDITOR you can change value of zero runtime!

Name: Anonymous 2011-08-08 9:53

>>27
you can also change the value of the preprocessor macro using EMACS TEXT EDITOR

Name: Anonymous 2011-08-08 11:08

>>28
pig disgusting! I will use gvim!

Name: Anonymous 2011-08-08 12:22

>>29
Enjoy your ugandese extortionware.

Name: Anonymous 2013-04-20 17:59

Name: Anonymous 2013-04-20 18:09

for the love of god

please

someone

just check them

Name: Anonymous 2013-04-20 18:17

Oh god, you guys fucking suck.
This stupid shit reminds me of that time /g/ tried to write coreutils.

Name: Anonymous 2013-04-20 18:18

WAT DA FUCK IS DIS STUPID SHIT? WHO DA FUCK MAKES FUNCTIONS FOR THINGS DER R ALREADY OPERATORS FOR? FUCK DESE GUYS R A BUNCH OF STUPID STACK BOYS ARENT DEY?

Name: Anonymous 2013-04-20 18:19

AND SINCE WHEN IS ZERO POSITIVE? GET FUCKED. NEGATIVE IS < 0, POSITIVE IS > 0.

Name: Anonymous 2013-04-20 18:21

AND const-QUALIFIED IS DA STUPIDEST THING OF ALL, EVEN FUCKING STUPIDER THAN UR DIVIDE BY ZERO FUNCTION. USE A FUCKING MACRO OR A FUCKING ENUM, OR JUST USE THE FUCKING INTEGER CONSTANT U STUPID STACK BOYS.

Name: Anonymous 2013-04-20 18:40

I mean, jesus, you could at least use camelCase or underscores or something. Why aren't those functions inlined?
When would anyone even call isgreaterthan() anyway?
What's the point?

Name: Anonymous 2013-04-20 23:32



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-20 23:32



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

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