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

Pages: 1-4041-

Clojure vs Racket

Name: Anonymous 2011-01-31 6:28

Is Clojure a better language than Racket?

Name: Anonymous 2011-01-31 6:54

Saying no doesn't imply that Racket is better than Clojure.

Name: Anonymous 2011-01-31 6:56

JVM has no TCO

Name: Anonymous 2011-01-31 7:02

No: if you're going to use a language with a (l(i(s(p)))) syntax, it should be Racket.

ask yourself this: suppose you want to create a online game with a persistent virtual world in which players control little groups of robots by writing AI programming code... what platform would already have 90% of the code ready for you?

Name: Anonymous 2011-01-31 7:04

>>4
Racket HAS NO MACROS

Name: Anonymous 2011-01-31 7:05

Macro in LISP.

(defmacro aif (cond then else)
  `(let ((it ,cond))
     (if it ,then ,else)))


"Macro" in Scheme/Racket.

#lang racket
(require racket/stxparam)
 
(define-syntax-parameter it (lambda (stx) (raise-syntax-error 'anaphora "missed context" stx)))
 
(define-syntax-rule (aif cond then else)
  (let ([temp cond])
    (syntax-parameterize ([it (make-rename-transformer #`temp)])
                         (if temp then else))))

Name: Anonymous 2011-01-31 7:11

Where's the smug CL weenie when we need him? Did my favourite /proggles/ poster morph into that autistic Racket beast?

Name: Anonymous 2011-01-31 7:17

(define it ">>6")

(aif (sucks? it)
  (string-append it " sucks")
  (string-append it " still sucks"))

Name: Anonymous 2011-01-31 7:23

Clojure was created by seasoned hacker to write real world software.

Racket was created by PhDs from academia to teach little children CS and publish papers.

/thread

Name: Anonymous 2011-01-31 7:36

>>6
(require mzlib/defmacro)

(defmacro aif (cond then else)
  `(let ((it ,cond))
     (if it ,then ,else)))


Or if that library didn't exist:

(define-syntax (defmacro stx)
  (syntax-case stx ()
    ((defmacro <name> <args> . <body>)
     #`(define-syntax (<name> stx)
         (syntax-case stx ()
           ((<name> . <<args>>)
            (datum->syntax
             #'<name>
             (apply
              (lambda <args> . <body>)
              (syntax->datum #'<<args>>)))))))))


Though neither solve the problem that defmacro is BROKEN AS FUCK.

Name: Anonymous 2011-01-31 7:54

Racket feels like scheme trying to be C++ and it sucks, I miss my r6Rs

Name: Anonymous 2011-01-31 8:12

>>10
Wow! Shit is really bloated! I'd be better off sticking with my nice minimalistic SBCL.

Name: Doctor Racket !RACKET/.HY 2011-01-31 8:21

>>6,8,10
If you don't know how to write decent macros, please just don't try to.
(define-syntax (aif stx)
  (syntax-case stx ()
    ((~ p t f)
     (with-syntax ((it (datum->syntax stx 'it)))
       #'(let ((it p)) (if it t f))))))


Also,
(define-syntax (with-identifiers stx)
  ((~ stx (ids ...) . body)
   #'(with-syntax ((ids (datum->syntax stx 'ids)) ...) . body)))


>>10
Someone posted a define-macro some time ago.
It appearead to be more powerful than defmacro, it was hygienic and all, and also had syntax-case's pattern matching, but I prefer to just break the hygiene myself.

>>11
#lang r6rs
You're welcome.

Name: Anonymous 2011-01-31 8:25

>>12
Please, post the source of the loop macro.

Name: Doctor Racket !RACKET/.HY 2011-01-31 8:28

>>13

(define-syntax (with-identifiers stx)
  (syntax-case stx ()
    ((~ stx (ids ...) . body)
     #'(with-syntax ((ids (datum->syntax stx 'ids)) ...) . body))))

Name: Anonymous 2011-01-31 8:32

>>14
I hate loop macro. It shouldnt be in CL.

Name: Anonymous 2011-01-31 8:32

>>13
!r6rs is preferred, as it is portable.

Name: Doctor Racket !RACKET/.HY 2011-01-31 8:38

>>17
Racket supports #!r6rs, it is just a shorthand for #lang r6rs, of course, it works with all the other #langs. #!/ is treated as a comment for shell scripts.

Name: Anonymous 2011-01-31 8:50

>>1-18,20-
But can they tuna fish?

Name: Anonymous 2011-02-10 12:31

too lisp; didn't read

Name: Anonymous 2011-02-10 14:30

>>21
he should have said: too lisp; didn't read

Name: Doctor Mario!TRiP/.FAG 2011-02-27 11:26

>>13
>>15
>>18
LOL U MAD NIGGA

Name: Anonymous 2011-11-19 5:51

Is Arc a better language than Clojure?

Name: Anonymous 2011-11-19 9:06

Is Clojure a better language than Clojure? No, both fucking suck.

Name: Anonymous 2011-11-19 9:16

Chicken

Name: HAXUS THE ANII HAXOR 2011-11-19 13:53

dont forget that Lisp in infected with THE GA
Y

Name: Anonymous 2011-11-19 13:59

>>27

Chicken is a bit slow for a compile-down-to-c implementation.

Name: Anonymous 2011-11-19 14:22

Clojure = A LISP that works on top of the JAVA VM. Think (javax.swing.JOptionPane/showMessageDialog nil "Hello World" )

Racket = A SCHEME that used to be known as PLT-Scheme. Has the best possible documentation you can imagine (HTDP).

Arc was never really a thing; it's a set of macros for (then) PLT-Scheme released by PG and used to implement Hackernews (but not much more). He says it's a new LISP dialect, but I fail to see how it made any impact. Seems to have quietly died now.

Name: Anonymous 2011-11-19 14:32

no TCO
lol clojure

Name: Anonymous 2011-11-19 15:05

>>31
Is this even true?

Name: Anonymous 2011-11-19 15:05

Lisp is shit.

Name: Anonymous 2011-11-19 15:06

Since Clojure uses the Java calling conventions, it cannot, and does not, make the same tail call optimization guarantees. Instead, it provides the recur special operator, which does constant-space recursive looping by rebinding and jumping to the nearest enclosing loop or function frame. While not as general as tail-call-optimization, it allows most of the same elegant constructs, and offers the advantage of checking that calls to recur can only happen in a tail position.

LOL

racket = teh supreme scheme

Name: Anonymous 2011-11-19 15:15

cons pairs are shit. Lambdas are the ultimate construct.

Name: Anonymous 2011-11-19 15:56

>>35
IAWTP

Name: Anonymous 2011-11-19 16:37

>>32

for the moment, yes. The java virtual machine doesn't support a mechanism for doing tail calls.

Name: Anonymous 2011-11-19 17:25

>>37
Which is really shameful because OO and tail calls go hand in hand.

Name: Anonymous 2011-11-19 17:33

>>37
Why do people bother targeting the JVM? The CLR is right there and it's better in almost every way.

Name: Anonymous 2011-11-19 17:45

>>39
Because windows is for faggots.

Name: Anonymous 2011-11-19 23:33

We clojure the spirits of the JVM with our spells

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