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

Just finished SICP with Racket

Name: Anonymous 2011-01-24 14:42

And I'm not convinced about anything other than that Racket is slow as shit in a funnel. Explain this satori thing to me.

Name: Doctor Racket !RACKET/.HY 2011-01-25 7:43

>>38
You've got a point.

Name: Anonymous 2011-01-25 9:02

racket sucks. use python, it should be much faster than that antiquated lisp crap

Name: Anonymous 2011-01-25 10:51

>>42
alas, it isn't.

Name: Anonymous 2011-01-25 11:01

>>40
I haven't seen any that works with mutually recursive calls, like the ones you would use to implement state machines. Of course, in that case you would be told to use ``pythonic'' endless loops with exception throwing/catching to switch states.

Name: Anonymous 2011-01-25 11:24

>>44
state machines
python

elif:
elif:
elif:
elif:
elif:
elif:

Name: Anonymous 2011-01-25 12:07

>>45
fuck you nigger

Name: Anonymous 2011-01-25 12:38

>>46
The truth. It hurts

Name: Anonymous 2011-01-25 13:22

FUQIN EXPERT PROGRAMMER here, what's going on in this thread?

Name: Anonymous 2011-01-25 14:15

>>45
def state_loop(state, args):
    while True:
        state, *args = state(*args)

Name: Anonymous 2011-01-25 14:32

>>49

(define (state-loop state args)
  (let-values (((state args) (apply state args)))
    (state-loop state args)))

Name: Anonymous 2011-01-25 14:36

>>50

(define (state-loop state args)
  (call-with-values (apply state args) state-loop))

Name: Anonymous 2011-01-25 17:11

How would you code a state machine?
1) >>49
2) >>50
3) >>51 (faggot)

Name: Anonymous 2011-01-25 17:16

4) Cudder

Name: Anonymous 2011-01-25 18:03

>>52
Google "swine before perl"

Name: Anonymous 2011-01-25 19:02

>>52
GO(TO)'s and labels.

Name: Anonymous 2011-01-25 19:09

>>55
>>50 gets optimised to jmps due to TCO.

Name: Anonymous 2011-01-25 23:27

>>56
yes. the total cost of ownership is especially optimizable.

Name: Anonymous 2011-01-26 3:03

>>42
http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php

According to that page, the great python has 41.79 points while poor racket has 4.42. Indeed, python is much faster!

Name: Doctor Racket !RACKET/.HY 2011-01-26 9:44

>>58
According to the last GIT commits, they have improved the shootout benchmarks, they are all > 1.5x faster.

Name: Anonymous 2011-01-26 10:20

>>59
According to my python interpreter, You're an anus!

Name: Anonymous 2011-01-26 10:48

>>58
According to this graph: http://shootout.alioth.debian.org/u32/racket.php

Racket in half of the cases is more verbose than Java. Can you fucking believe it? More verbose than Java!

Lol at Scheme's "elegance".

Name: Anonymous 2011-01-26 11:08

>>58
those aren't points, they're seconds.

Name: Anonymous 2011-01-26 11:17

>>62
Excellent work, inspector.

Name: Doctor Racket !RACKET/.HY 2011-01-26 11:28

>>61
In Java, most of the code is type declaration, access specifiers and such, in Racket, like in Scheme and Lisp, it's 99% actual code. The code length is not the same as verbosity, or would you say that C is verbose because of all those mallocs and frees making the code look bigger?

Also, it is comparing Racket to Java. Racket's code length is ½ of the Java one in the majority of cases.

Racket is also faster in that benchmark.
A fair comparition would be, though, comparing Racket with Java -server: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=racket&lang2=java, which is known to be faster than the client one (but being a resource hog) and, in fact, also faster than Racket.

Name: Anonymous 2011-01-26 12:55

>>64
In Java, most of the code is type declaration, access specifiers and such, in Racket, like in Scheme and Lisp, it's 99% actual code.
That only shows that the ``actual code'' of Lisp is even more bloated than it would otherwise appear.

Name: Doctor Racket !RACKET/.HY 2011-01-26 13:05

>>65
That only shows how much you are confused about the words ``bloated'' and ``verbose''. I explained that immediately after the phrase you quoted, read the rest of my post.

Name: Anonymous 2011-01-26 13:08

oh sweet sweet mary dubs O__O

Name: Anonymous 2011-01-26 13:28

>>66
Hey Doc, what do you think about that guy who customized his Lisp interpreter (I have no idea whether it was Scheme/CL/whatever) so that it imported various constructs from ML/Haskell and other?

Name: Doctor Racket !RACKET/.HY 2011-01-26 14:09

>>68
From the source he posted some time ago (http://dis.4chan.org/read/prog/1293351605/27,28), it was CL.
I have no problems with him implementing a DSL, it's fun and a good exercise, every Lisper has made at least a simple DSL in his career.
I envy his DSL, it seems to have done a really good work with it and should be proud of it, but he shouldn't post his code written in it and say ``I wrote x in Lisp'', when it's clearly a DSL.
What makes him appear like a stupid is his stubborness on the fact that that's just Lisp, plain Lisp, giving reasons like ``it has lists and sexps''. Of course, a DSL have to give a way to communicate with the underlining language/system, that's the purpose of its existence, the fact that his language can communicate with the underlining CL implementations only strengthens the motivations to call it a DSL.

He should just post the complete implementation and then saying ``I wrote x in my Lisp DSL''.

Name: Anonymous 2011-01-26 15:05

>>69
I disagree, but only slightly. The problem is that it's hard to tell what is a DSL and what is the original language, especially if the original language allows (and even encourages) macros. After how many macros does a Lisp stop being a Lisp and become a DSL? Does removing the parentheses and putting something else in place (do/end, {}/[], etc.) automatically makes the language a DSL?

Personally, I'd say that the only way to tell apart a DSL from the original is whether you can still escape into the original language. I'm not sure though...

I think that the fact that he can say ``I wrote x in Lisp'' should not anger /lisp/ers; quite on the contrary, they should feel proud of the power and extensibility of their favourite language. I think the real reason why some are angry is because that guy still refuses to publish his macros and documentation. The frustration experience by the aforementioned is akin to that of showing a child a very interesting toy then taking it away from them.

Name: >>70 2011-01-26 15:05

*experienced

Name: Doctor Racket !RACKET/.HY 2011-01-26 15:33

>>70,71
The difference between a Lisp macro and a DSL is, IMHO, that a Lisp macro has its syntax and all, but it's still under the domain of the Lisp reader (with the exception of a reader macro, whose purpose is to extend the reader instead of the language), whether a DSL needs its own parser.

The loop macro is a perfect example of the extensibility of Lisp, but it's just a macro, its parser parses a list of symbols with car and cdr and generates code, it can't have something like f(x, y, z), it would be parsed as 'f '(x ,y ,z) and would also be a syntax error, because , has already a special meaning for the reader.

In a macro, you can't know if after the foo symbol there was a space, a newline or a tab, because your macro is just a piece of Lisp code that runs at compilation/expansion time.

His DSL seems to not respect the reader, a piece of code could be written without any space (http://dis.4chan.org/read/prog/1293689458/1), and I doubt he would just take a big symbol, transform it to string, do the parsing and fight with the reader at every parser iteration. As seen in http://dis.4chan.org/read/prog/1293689458/37, he calls a repl function (macro?) and passes his code as string. He does all the parsing and calls the Lisp reader when necessary.

A nice work indeed, but it can't be called ``Lisp'', parsing a string at compile time and generating code can also be done with D mixins/templates, something like loop still can't be done in other languages.
But this is just a speculation, we don't really know how the DSL and its parser works, it could be anything.

Name: Anonymous 2011-01-27 19:47

Name: Anonymous 2011-01-27 19:59

>>73

(define cons
  (lambda (x y)
    (lambda (c)
      (c x y))))

(define true
  (lambda (x y) x))

(define false
  (lambda (x y) y))

(define car true)
(define cdr false)

(define-syntax list
  (syntax-rules ()
    ((~ x l ...) (cons x (list l ...)))
    ((~) '())))

Name: Anonymous 2011-01-27 21:13

>>70
The frustration experience by the aforementioned is akin to that of showing an autist a very interesting toy then taking it away from them.
FTFY

Name: Anonymous 2011-01-27 21:25

>>75
go fuck a goat you cock sucking niggerfaggot

Name: Anonymous 2011-01-27 21:31

>>76
Well, I can't really say ``go back to board'', now.

Name: Anonymous 2011-01-27 21:39

u liek my codan? http://pastebin.com/FTAGv0Kx

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