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

Pages: 1-4041-

Racket or Clojure?

Name: Anonymous 2010-11-16 15:45

I'm going to invest a decent amount on time on further learning a Lisp dialect. I'm not learning it just to achieve Satori which I more or less already did, but I want an actual development platform to write my shit in, one that is library-rich, useful for a lot of things, multi-platform, and a state-of-the-art Lisp with support for functional programming, macros and decent programming. Furthermore, I wanted something clean, nice, modern, and a Lisp-1 above all else because of spiritual equilibrium and peace of mind. Considering these requirements, I'm left with Racket or Clojure (did I overlook anything else?). Now, /prog/, which should I invest time on?

Name: Anonymous 2010-11-16 15:49

perl6

Name: Anonymous 2010-11-16 16:20

We Clojure the Spirits of the Computer with our Spells.

Name: Anonymous 2010-11-16 17:00

You should probably get over yourself and program in Common Lisp.

Name: Anonymous 2010-11-16 17:08

haskell

Name: Anonymous 2010-11-16 20:31

Come on, only one half-serious answer so far?

>>4
I know it has the best compilers, but it's messy and I can't stand symbols having more than one value depending on context, it's blasphemously aberrant and makes my mind feeble and uneasy.

Name: Anonymous 2010-11-16 20:35

Clojure is retarded. If you have to pick between those two, Racket is the obvious choice.

Name: Anonymous 2010-11-16 21:24

MIT/GNU Scheme48

Name: Anonymous 2010-11-17 0:22

it's messy
That won't be a problem.

and I can't stand symbols having more than one value depending on context, it's blasphemously aberrant and makes my mind feeble and uneasy.
Deal, feeb.

I don't have anything against Scheme or Clojure, but wow. Get over it.

Name: Anonymous 2010-11-17 0:45

>>9
You oughtn't be so lenient towards bad language design.

Name: Anonymous 2010-11-17 0:55

Clojure has better multi-core possibilities, BUT, it's built to run in Java AND a specific module from the .Net series (check wikipedia).

Racket is all systems, has lots of cool features, and can compile to Java bytecode anyways, as well as it can incorporate c headers at least, if not C++ stuff.

I don't think Clojure has an interpreter, but Racket does, and includes it's own gui system.

Ironically, here's a site on your two things exactly:

http://programming-puzzler.blogspot.com/2010/08/racket-vs-clojure.html

P.s. Here's a sample using OpenGL, 1.3 I think:

#lang racket/gui

(require (lib "gl.ss" "sgl")
         (lib "gl-vectors.ss" "sgl")
)

(define (resize w h)
  (glViewport 0 0 w h)
  #t
)

(define (draw-opengl)
  (glClearColor 0.0 0.0 0.0 0.0)
  (glClear GL_COLOR_BUFFER_BIT)
  (glColor3d 1.0 1.0 1.0)

  (glMatrixMode GL_PROJECTION)
  (glLoadIdentity)
  (glOrtho 0.0 1.0 0.0 1.0 -1.0 1.0)
  (glMatrixMode GL_MODELVIEW)
  (glLoadIdentity)

  (glBegin GL_QUADS)
  (glVertex3d 0.25 0.25 0.0)
  (glVertex3d 0.75 0.25 0.0)
  (glVertex3d 0.75 0.75 0.0)
  (glVertex3d 0.25 0.75 0.0)
  (glEnd)
)

(define my-canvas%
  (class* canvas% ()
    (inherit with-gl-context swap-gl-buffers)

   (define/override (on-paint)
      (with-gl-context
        (lambda ()
          (draw-opengl)
          (swap-gl-buffers)
        )
      )
    )

    (define/override (on-size width height)
      (with-gl-context
        (lambda ()
          (resize width height)
        )
      )
    )

    (super-instantiate () (style '(gl)))
  )
)

(define win (new frame% (label "OpenGl Test2") (min-width 200) (min-height
200)))
(define gl  (new my-canvas% (parent win)))

(send win show #t)

Name: Anonymous 2010-11-17 1:46

>>11
Please refreain from posting this badly formatted code. Especially without [code] tags.

Name: not >>1-11 2010-11-17 1:53

>>6
I can't stand symbols having more than one value depending on context, it's blasphemously aberrant and makes my mind feeble and uneasy.
It's kind of the opposite here. It makes more sense for me to have a value and function namespace (of course, you can always access either one as you wish, from any place you want), but in CL, you don't really have 2 namespaces, but n namespaces, as you also have symbol properties, class names, method names (and many others) and the user can also easily define their own namespaces (to be fair, you can also do that in Scheme and Closure, but I have no idea how common the practice is). Oh, and of course, there's also packages and uninterned symbols. I find that they're pretty useful tools in large projects. In some Schemes you do have module systems, which are slightly similar in some regards.

Name: Anonymous 2010-11-17 2:31

>>10
I'm not being lenient toward bad design. Scheme and Clojure may not be my favorite languages, but they aren't badly designed.

Name: Anonymous 2010-11-17 4:07

>>11
Thanks for your post. From the article you linked to, I could extract some pros and cons:

Racket pros:
- State of the art features for macros, continuations, contracts, others
- Good IDE with integrated debugger and profiler, specialized macro debugger
- Very cudder-oriented, which is good for functional programming

Racket cons:
- Shitty built-in data types beyond numbers and cudders; fixed-size vectors; shitty dictionary library and syntax; no built-in lazy list
- Library lacking control structures and library to deal with arrays and dictionaries

Clojure pros:
- Excellent built-in data types and syntax, including accessors
- Standardized iteration through all built-in data types (as in the FIOC)
- More polymorphic approach (this is very important to me)
- Runs within the Java ecosystem, which means perhaps I can sell it to enterprise idiots in the future, it has extensive built-in and third-party libraries, and is probably going to get a larger community around; perhaps this is going to be the Lisp that makes it to the general public (wishful thinking)

Clojure cons:
- Runs within the Java ecosystem, which means eventually dealing with ENTERPRISE shit, and the library may be huge but it's also shitty
- Suboptimal IDEs (this is not important to me)
- Debugging difficult, shitty stack traces
- No TCO (though I think it had some hack for it)
- Methods aren't true closures (incurs in loss of Buddha power)

Name: Anonymous 2010-11-17 4:10

>>13
I can't fathom to think functions are special or different kinds of values; that ((lambda () (display "lol")) isn't going to work as is, and I don't like code that names variables after functions even if it's possible to do so; not only because it feels queer, but because it implies shitty documentation: don't call your list of anus list, call it anii.

Name: Anonymous 2010-11-17 4:38

>>16
((lambda () (display "lol")) works just fine in CL, if you have a display function or macro. One could list the advantages and disadvantages of each approach, but in the end it boils down to personal preference.

Name: Anonymous 2010-11-17 4:56

>>16
Clojure has the best of both worlds:
It's a Lisp-1, but if you shadow a function you can still call it with some Java module/package/whatever-was-it-called magic.

Name: Anonymous 2010-11-17 7:16

Clojure is a fucking piece of shit. I find it hard to understand how anyone can take that pile of misfeatures seriously.

>>16
http://docs.racket-lang.org/data/index.html
http://docs.racket-lang.org/srfi/srfi-41.html
http://docs.racket-lang.org/reference/sequences.html
http://docs.racket-lang.org/reference/for.html
http://docs.racket-lang.org/reference/control.html
http://docs.racket-lang.org/reference/eval-model.html#%28part._.Tail_.Position%29

The only point that makes sense is that you don't like Racket's syntax, but to me it is quite clean and easy to read compared to Clojure's ``explosion in an ASCII factory''.

Name: Anonymous 2010-11-17 7:44

>>19

Okay, so we have growable vectors (with 1/20th of Python's standard library though), streams and sequences look good enough (and yay, generators), for and company seem good enough (I knew about them), and there are real TCO and continuations. I somehow trust the Racket community a bit more, considering it's Scheme, it has the Sussman's seal of approval, it's backed by and used in Universities, and it's full of Satori, except that I don't think they'll manage to make Racket widespread and usable for bread-making (though I wish they did!).

BTW:

A growable vector (gvector) is a mutable sequence whose length can change over time. A gvector also acts as a dictionary (dict? from racket/dict), where the keys are zero-based indexes and the values are the elements of the gvector.

Sounds disturbingly similar to PHP. Just kidding.

The only point that makes sense is that you don't like Racket's syntax, but to me it is quite clean and easy to read compared to Clojure's ``explosion in an ASCII factory''.

I alt-tabbed to the Racket manual page I was reading, and saw this right in the middle of my screen:

((any/c) () #:rest list? . ->* . any/c)))

Also, I'd rather take a decent literal dictionary syntax like {:k v :k2 v2} over #hash((k . v) (k2 . v2)) .

I suppose I could write some reader macros. I also value generics and polymorphism, and need a powerful array and dictionary library that includes all sorts of operations from splicing multiple elements to scanr. I wonder how long it would take me to turn Racket into what I want over turning Clojure into what I want.

Name: Anonymous 2010-11-17 13:28

I can testify that Racket’s contract system is pretty powerful: you can add contracts to procedures in many ways, and of course you always have the option to use no contracts at all.

The module system, with require, provide and the likes is also quite flexible, as it
allows you to import arbitrary bindings from a module renaming them on the fly.

Can’t say for Clojure, though.

Name: Anonymous 2010-11-17 14:08

>>16
They aren't different. You just don't understand the difference between names and values.

don't call your list of anus list, call it anii.
Don't you ever write generic code?

Name: Anonymous 2010-11-17 16:46

>>22
generic code is escapism

Name: Anonymous 2010-11-17 18:14

>>22
Yes. For multiple body parts, use bodyparts. For multiple items, use items. But not list.

Name: Anonymous 2010-11-17 19:34

>>24
What about for lists?

Name: Anonymous 2010-11-17 19:43

>>25
lists

Name: Anonymous 2010-11-17 19:55

>>24
What about for xs?

Name: THE COLLISION 2010-11-18 4:41

What's wrong with Croma Lisp? It's perfectly cromulent.

Name: Anonymous 2010-11-18 5:42

Arc.

Name: Anonymous 2010-11-18 6:42

>>28
Please stop using that word.

Name: Anonymous 2010-11-18 6:52

Name: Anonymous 2010-11-18 6:54

>>27
For x:xs I can use x and xs, though I don't necessarily refer to them by name as they are often results returned by car and cdr.

>>29
Is it real now? Finished standard, good support for it (on top of Racket, I suppose), community for it, etc.?

Name: Anonymous 2011-01-31 20:53

<-- check em dubz

Name: Anonymous 2011-07-21 5:31

more of this

Name: Anonymous 2011-07-21 5:58

>>34
I concur. Is a good thread.

Name: Anonymous 2011-07-21 8:22

>>6
So don't write variables which has the same names as your functions?


I'm going to learn Clojure now, I also hope that I can learn enough Racket so that I can understand hygienic macros.

Name: Anonymous 2011-07-21 14:05

>>36
I also hope that I can learn enough Racket so that I can understand hygienic macros.

http://www.cs.utah.edu/plt/slideshow/macro-slides/talk.pdf

Name: Anonymous 2011-07-21 14:12

>>36
I'm going to learn Clojure now
I'm saying this for your sanity: don't. It has some good ideas, but it's misdesigned.

Name: Anonymous 2011-07-21 14:13

>>17
only as a bullshit special case for lambda literals.

Name: Anonymous 2011-07-21 14:47

>>37
don't bother. They were a bad idea.

Name: Anonymous 2011-07-21 18:42

>>40
Go back to russia.

Name: Anonymous 2011-07-22 0:31

What is there to learn about hygienic macros? 99% of what people use macros for is a little sugar they probably shouldn't consume anyway and syntax-rules and define-syntax-rule are downright trivial to use for that purpose. If you need to do something more troublesome than that, you should already understand enough perils of programming that understanding how to break hygiene in a controlled manner will be absolutely no problem.

Name: Anonymous 2012-04-20 17:20

>>20
Also, I'd rather take a decent literal dictionary syntax
Write your own fucking syntactic mess any way you want. That's what readers and syntax-case are for. Also, while on the topic of syntax you like, fuck off, by the way.

Name: Anonymous 2013-01-18 22:53

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

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