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-07 21:55

>>39
McCarthy provided m-expressions because he thought they read better, s-expressions were only there for self-terminating data. If you read the limits of mathematics by chaitin he makes a pure lisp capable of evaluating arbitrary data and it leans toward m-expressions, too. (Because randomly balancing parentheses is homogay.)

Name: Anonymous 2011-12-07 21:58

>>37-38
Were I to write such a language, my target demographic would obviously not be lispers (who seem to have somehow already grown accustomed to the, um, syntax). The point of writing such a language would be to basically sell all of Lisp's awesome features, minus the Sexps, to regular people who don't want to twist their mind (regardless of their text editor) into mentally parsing lisp code into something meaningful.

I find it quite ironic that Lisp's semantics are so liberating, yet the syntax is so frustratingly constrained.

Name: Anonymous 2011-12-07 22:08

>>39
In practice nobody whose interested in Lisp is interested in hiding the parens. McCarthy originally provided M-expressions as  a cover over the Sexps but nobody used it and worked directly with sSxps. Theres been a few other attempts. In Schemeland there was SRFI 49 which creates a FIOCScheme but that obviously never caught on.
Sorry, you didn't understand the intent in my post and it's probably my fault. Both M-expressions and ``FIOCScheme'' are just mappings of one uniform syntax to another uniform syntax. That's not what I'm talking about. I'm talking about a real, heterogeneous syntax, like Haskell or Javascript have, with of course the option of dropping into Sexp mode (mostly to get things like macros right).

Nobody is interested in your ScalaLisp ideas, `fagstorm'.
Scala is statically typed shit.

Name: Anonymous 2011-12-07 22:12

>>42
I don't know why other people like lisps. I doubt anyone made a poll or anything. Personally I like it because it is like... um, the bare metal of languages, as C is often described as "close to the bare metal" of er, silicon. Anyway, strained analogies aside, that's what draws me to lisps.

Name: Anonymous 2011-12-07 22:31

>>35

sexps have their uses. It's essentially equivalent to xml, and xml is pretty popular for expressing data that is in the form of an arbitrary tree structure. If one was going to create a macro assembler with macros that operated on a tree structure, rather than just flat textual substitution, then you would need to encode the program as an arbitrary tree. You could not define certain visual cues or certain rules for precedence, because this would restrict the macro system, or make it very confusing at least. Although you could always write a parser in lisp and have it parse a flat list of symbols, but I guess that isn't sexps.

Name: Anonymous 2011-12-08 16:55

>>45
Come on, you seem fairly intelligent, I'm sure you could figure it out how to make heterogeneous syntax perfectly compatible with Lisp-grade macros.

Name: Anonymous 2011-12-09 1:19

>>46

yeah, it's difficult. I think any attempt at replacement would suffer from the same readability problems. I think it is a consequence of staying close to something that easy for a computer to read, but not necessarily easy for a person to read.

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

Calling eval to process XML trees of arbitrary executable code.
>Incredibly elegant, should be easily optimized.
Using function attributes to specify parameters or internal structure.
>Messy and suboptimal. We should avoid using it at all costs, since writing an extra couple of words or a macro to abstract out the attributes/parameters will be above our paygrade.

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

>>41
M-Expressions sound an order of magnitude more sane than LISP notation.
An M-expression could also use operator names, meta-variables, and argument lists. Operator names and meta-variable names were in lower case, to show that they were not symbols (i.e., not data). Argument lists were delimited by brackets, [], and their elements were separated by semicolons. For example:
car[cons[(A . B); x]]
compared to Lisp syntax function soup this is actually usable.

Name: Anonymous 2011-12-09 3:52

>>49

but mexps are so close to sexps, the difference is just a matter of taste and what you are used to.

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

>is just a matter of taste
Its whole another class of language. Have ever wondered why Lisp is so unpopular outside the very small "people with acquired Lisp taste" circle?

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

Hint: Its not perfomance, plenty of scripting languages are much slower than Lisp, yet remain more popular.

Name: Anonymous 2011-12-09 4:03

goddamn frozenvoid learn to quote properly

Name: Anonymous 2011-12-09 4:09

>>49-51
“The project of defining M-expressions precisely and compiling them or at least translating them into S-expressions was neither finalized nor explicitly abandoned. It just receded into the indefinite future, and a new generation of programmers appeared who preferred internal notation to any FORTRAN-like or ALGOL-like notation that could be devised.”John McCarthy, History of Lisp

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

>ALGOL-like notation
Because dealing with raw AST forms is much superior. Trains the brain to compile Lisp.
I suggest moving to raw hex, and compiling it into opcodes mentally, to achieve maximum purity.

Name: Anonymous 2011-12-09 4:14

>>51

but really, it isn't:


(define (fact n)
  (letrec ((helper (lambda (n acc)
                     (if (= n 0)
                       acc
                       (helper (- n 1) (* acc n))))))
    (helper n 1)))



define [[fact; n];
  letrec [[[helper; lambda [[n; acc];
                     if [= [n; 0];
                       acc;
                       helper [- [n; 1]; * [acc; n];]]]]]
    helper [n; 1]]]

       

It isn't ugly because it's like (this) instead of this[], but because everything is so deeply nested into nests of nests of nestedness.

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

>>56
>define [[fact; n];
using such convoluted code to express  for( c = 1 ; c <= n ; c++ ) fact = fact*c;
Typical braindead Lisp design.

Name: Anonymous 2011-12-09 4:23

>>57

for [[ =[c;1]; <=[c;n]; ++[c]]; =[fact;*[fact;c]]]

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

>>58
That is much better, now can you see how C version(of >>58) is more elegant, because notation is syntax-based rather than bound to functions?

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

Thats why ALGOL-languages won:
1.they are fast
2.they don't shove the ASTs into your face
3.the notation is more human oriented
4.they don't require ALGOL-machines since they run everywhere equally fast

Name: Anonymous 2011-12-09 4:33

>>58
hahahahaha

No.

Name: Anonymous 2011-12-09 4:37

>>57
>RAW POWER OF ITERATIVE LOOP
>blah blah blah
where is the fact function, FrozenRetard?

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

>>62
You don't need any function. You calculate the factorial in place.
main(){
int x=4;
int c;for(c=x-1;c;c--)x*=c;//"function"
printf("%d",x);
}

Name: Anonymous 2011-12-09 4:44


(define (for-fn init condition increment body)
  (letrec ((loop (lambda ()
                   (if (condition)
                     (begin (body)
                            (increment)
                            (loop))))))
   (init)
   (loop)))

(define n 10)
(define c '())
(define fact 1)

(for (lambda () (set! c 1)) (lambda () (<= c n)) (lambda () (set! c (+ c 1)))
  (lambda ()
    (set! fact (* fact c))))

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

same code with function abstraction;
int c;
#define fact(x) ;for(c=x-1;c;c--)x*=c;
main(){
int x=4;fact(x);
printf("%d",x);
}

Name: Anonymous 2011-12-09 4:47

>>64
 actually, I normally do it like this:


(define (while-fn condition body)
  (letrec ((loop (lambda ()
                   (if (condition)
                     (body)))))
    (loop)))

(define (for-fn init condition increment body)
  (init)
  (while condition (lambda ()
                     (body)
                     (increment))))

Name: Anonymous 2011-12-09 4:48

>>60
1. No, languages don't make programs fast, implementations do.
2. No, to learn a language you must learn the syntax, AST, BNF or whatever.
3. No, math, programming and science are not human oriented.
4. No, ALGOL family is just abstraction over asm.

Name: Anonymous 2011-12-09 4:50

curse my typos! If I wasn't so mad at all you people trashing lisp, I would not have made them!


(define (while-fn condition body)
  (letrec ((loop (lambda ()
                   (if (condition)
                     (body)
                     (loop)))))
    (loop)))

(define (for-fn init condition increment body)
  (init)
  (while-fn condition (lambda ()
                        (body)
                        (increment))))

Name: Anonymous 2011-12-09 4:51

>>65
Thats actually neat. I can't fathom why Lispers write such ugly heaps of parens to do the same.

Name: >>60-san 2011-12-09 4:51

But somewhat I do like FrozenVoid.

Name: Anonymous 2011-12-09 4:59

>>69
because they're writing C code with LISP

(define fact
  (lambda (n)
    (if (= n 0) 1
        (* n (fact (- n 1))))))

Name: Anonymous 2011-12-09 5:01

if you want output
(print (fact 4))

Name: Anonymous 2011-12-09 5:09

fac n = product [1..n]

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

its not like i can't write stack-raping code in C too.
Its easy, and is more elegant then LISP
int fact(int n){return n?n*fact(n-1):1;}
main(){printf("%d",fact(4));}

Name: Anonymous 2011-12-09 5:14

>>74

your C style isn't even elegant C. heard of spaces?

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

>>75
If you care about the representation of code as text, why don't switch to Python?

Name: Anonymous 2011-12-09 5:24

PYTHON:Representing code better then LISP, since 1991.

Name: Anonymous 2011-12-09 5:35

>>74
raping
boner

Name: Anonymous 2011-12-09 5:49

i dreamed my cat turned into a human-sized nekomimi and i sucked her breasts and then we fucked
weird

Name: Anonymous 2011-12-09 5:54

>>74
I love you!
(define fact
  (λ (n r)
    (if (= n 0) r
        (fact (- n 1) (* r n)))))
(define factorial
  (λ (n) (fact n 1)))

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