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

__volatile__ __asm__

Name: Anonymous 2011-12-06 21:57

volatile is a C keyword, and programmers know better than using asm as an identifier. Why do people insist on using double underscores around them, especially Linux kernel developers?

Also, why do people use things like __attribute__((aligned(n))) instead of defining a macro ALIGNED(n)?

Name: Anonymous 2011-12-09 5:58

>>79
Great, now we have two furries on /prog/: FrozenAutist and >>79.

Name: Anonymous 2011-12-09 6:04

>>81
>FrozenAutist
Is he a furry, for real?

Name: Anonymous 2011-12-09 6:04

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 6:06

What? i don't deny being furry. I just don't like people concentrating on what subculture i belong to.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 6:09

Now lets get back on topic: is LISP syntax is deficient or not compared to C.

Name: Anonymous 2011-12-09 6:46

>>84
shut up you disgusting filthy furry scum

Name: Anonymous 2011-12-09 7:49

>>85
I don't think LISP or C would be called “deficient”.
It's a matter of how easily you can put your computations in them, which is closely related to the way you design your programs, and the objectives you may need to meet.

Like the factorial program from before, the mathematical definition is clearly a recursion. Both languages have ways to clearly represent this problem. But it's when machine/implementation issues come to haunt our clean and concise programs.

You need to optimize, even if you don't need, but you'll want because it's cool enough. Then you have two ways: iteration and tail-recursion. Let's take a look at code (forgetting about fact(n) for n <= 0):

int fact(int n) {
    int c;
    for (c = n-1; c > 0; c--)
        n *= c;
    return n;
}

(define fact
  (λ (n r)
    (if (= n 0) r
        (fact (- n 1) (* r n)))))
(define factorial
  (λ (n) (fact n 1)))


Both forms give a good layer of abstraction over actual hardware instructions, but they still make you warned about machine stack limit. With LISP, it stops here. But with C, the abstraction level is more closely tied to hardware details, and you can see int types and increments, things really not strictly necessary to our problem.

Anyone could say this is a “braindead simple” example, but most real code are. The problem is just that such trivial code is often overlooked, and a simple overflow or wrong conversion can have dangerous consequences (in memory of Apollo 1 crew), because the language put these nasty details in your hands.

You talked about “human readability” but in fact what C does is showing you more machine stuff. I really think you know a lot about machine instructions, caching, memory access and stuff, so it's clearly obvious that you know how things should work if you need the maximum speed. Because you know this all, every optimization trick you do seems natural and easy, and you'll start to bend your designs to specific decisions. This is what I call premature optimization.

But really, I don't care about #include <void.h> neither (define x ((let ((...))))))))))). What I really care is about how difficult or spending is to understand what someone's code does. No matter if it's written in LISP, Python, C++ or whatever. But there's some stuff that seems to help me when I'm studying algorithms, or deducing them while reading some implementation:
 - meaningful but short names;
 - proper spacing (implying indentation is a must, and FIOC is better than one-line programs);
 - more comments = less readable code;
 - analogies with common knowledge.
And none of them is about objects, first class functions, templates, garbage collection and shit. They're cool features but that's all, they will not explain what is your program going to do!

Enough boredom, I'll get back to work and become a better programmer.

Name: Anonymous 2011-12-09 7:52

>>84
it's fucking obvious you enjoy the attention you get. you are probably right now yiffing right there with your fursuit

you disgust me

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 8:24

>>87
I can't even imagine someone optimizing LISP with all these layers of lambdas and recursion.
C is orders of magnitude more free to choose the algorithm at its lowest level, even stepping down to inline assembler.
LISP follows this "top-down abstraction" model, which i find deficient(beyond computer science) and inherently limited in design(i find such functional-class languages resembling circular logic system)

Name: Anonymous 2011-12-09 8:43

>>89
It's exactly like I said. You are premature optimization personified. While you want the freedom to choose the most optimized implementation, I want the freedom to not choose any implementation.
This way I can focus on my problem and write programs which are completely free of implementation limitations, ultimately leading to more natural and understandable code.
With your optimizing thinking, you need to know every fucking detail before using a library function, because you couldn't rest in peace without knowing if it's going to raise your cache misses or “waste” memory with runtime information.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 8:48

>completely free of implementation limitations, ultimately leading to more natural and understandable code.
For prototyping i'd rather use JavaScript

Name: Anonymous 2011-12-09 9:07

>>89
I'd like to see you write something useful in lisp before I accept the fact that you know enough to judge it in any way.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 9:12

>>92
No, i'd rather let you write things for me to judge, since i'm not a code monkey in your LISP project.

Name: Anonymous 2011-12-09 9:14

>>93
I don't know anything about lisp at all
FTFY

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 9:20

>>94
I don't need to eat a ton of shit to become an expert on the subject of taste of shit.

Name: Anonymous 2011-12-09 10:02

>>95
[happy gilmore]You eat pieces of shit for breakfast?![/happy gilmore]

Name: Anonymous 2011-12-09 10:02

>>91
Agree.
C < JavaScript < LISP

>>95
If you don't taste shit, you won't know how it's like.
If you taste black gluey shit, you just know how black gluey shit is like.
If you taste black gluey shit only, this will be bad for you, and you will become addicted. Oh no, you already are.

Name: Anonymous 2011-12-09 10:25

>>94
Since he is an "expert" JavaScript programmer, and JavaScript is a form of Scheme we can assume he knows something about Lisp, but is too retarded to comprehend Lisp syntax.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 10:34

>>98
I don't want to rape my mind by mentally compiling ASTs. I won't use lisp until
1.it replaces the braindead "syntax"(human readable syntax like C, or at least M-expressions)
2.the lisp have normal native hardware types support. not this "tagbits" inside an int bullshit
3.at least optimized GC which at worst can be turned off dynamically, or replaced with free/malloc(managing own byte array) and remove the fucking tagbits.

Name: Anonymous 2011-12-09 10:52

>>99
sexps aren't human-readable
They're more readable than your C code. Though that's damning with faint praise, I realize.

Name: Anonymous 2011-12-09 13:38

>>99
M-expressions are shit.

Name: Anonymous 2011-12-09 14:36

>>98
Lisp syntax is shit, which causes the entire language to be shit.

Name: Anonymous 2011-12-09 14:38

>>102
No.

Name: Anonymous 2011-12-09 15:30

Lisp originally used both sexps and mexps, but mexps fell out of use. Implementing mexps in a lisp would be a trivial exercise.

Name: Anonymous 2011-12-09 15:37

Name: Anonymous 2011-12-09 16:20

>>74
its not like i can't write stack-raping code in C too.
Tail position calls in Scheme are reduced to goto btw.

Name: Anonymous 2011-12-09 16:39

>>93
No, i'd rather let you write things for me to judge, since i'm not a code monkey in your [...] project.
>Volunteers to optimize and pastebin JavaScripts all day.
lol

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-09 21:42

>>107
1.JavaScript has human-readable syntax
2.i choose what to optimize, if i want to make a version of some algorithm i could easily write it in javascript
3.writing in javascript is not meant for complete concrete apps, its more of a testing abstract implementation(algorithms, approaches,etc)
Its a pasttime which is actually enjoyable. Its not a form of work.  Hacking JavaScript all day is not that mentally demanding(if you know your algorithms)
the syntax is nice and the language can be translated mentally to blocks of C anytime you want(since its syntax is the same).
As for the "volunteer" part you're very mistaken, i don't suddenly become controlled by your code, i just copy it and hack it as much as i like,
if i don't like your javascript, i could modify it to my version and won't care about your rules, indentations, syntaxes or some abstract bullshit you follow in your code. Its no longer your code, and will be a part of directory of scripts i hack for leisure.

Name: Anonymous 2011-12-15 3:49

>>105
Goodness, please post a warning before posting these kinds of images.

Name: Anonymous 2011-12-15 4:38

>>108
You disgusting code-rapist!

Name: Anonymous 2011-12-15 11:30

>>109
Goodness
Hairy Goodness!

Name: Anonymous 2011-12-15 11:43

>>108
The syntax for Javascript isn't the same as C you fucking idiot. Oh geeze, I don't know why I bother to you correct you. You're the same fucking braindead jew that wants to implementation defined shit into standard C. And I'm still not convinced you understand how to make non portable C code portable.

Name: Anonymous 2011-12-15 11:46

>>112
You're the same fucking braindead jew
Stop denigrating jews! They maybe evil, but not retarded.

Name: Anonymous 2011-12-15 11:49

>>113
This person is totally clueless about C, and like, programming in general. I really think this homo needs to stop acting like some dumbass wanna be hacker, and like, actually take a few computer programming classes at the local community college.

Name: Anonymous 2011-12-15 12:30

>>114
He, like, believes that classes and even books actually indoctrinate and like ossify your mind. He's kinda sorta like an ultimate foolproof dumbass, really.

Name: Anonymous 2011-12-15 12:58

>>115
Has this idiot even written one noteable piece of software? I guess when I think of real hackers, I think of people like JWZ. Aka the person that helped write the early Unix versions of netscape, xemacs, screensavers, etc.

Name: Anonymous 2011-12-15 14:15

>>116
JWZ
jew.

Name: VIPPER 2011-12-15 15:00

>>117
JEWS

Name: Anonymous 2011-12-15 15:09

>>116
Jew helped early Unix
If it wasn't for jews, Unix would have die long ago.

Name: Anonymous 2011-12-15 17:47

>>116
He wrote the greasemonkey /prog/ fixer.

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