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

Pages: 1-4041-

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-24 14:43

>>1
You clearly don't understand Satori, Functional Programming and Lisp.

Name: Anonymous 2011-01-24 14:44

Read MORE SICP. Repeat. Then again.

Name: Anonymous 2011-01-24 14:45

>>2
I guess it's just "2deep4me".

Name: Anonymous 2011-01-24 14:46

liar liar liar

Name: Anonymous 2011-01-24 14:47

>>2
I bet that tripcode bruteforcer wasn't writtin in LISP.

Name: Anonymous 2011-01-24 14:48

SICP is just a very elaborate troll: MIT has replaced LISP with Python YEARS ago

Name: Anonymous 2011-01-24 14:51

>>7
Python is not a real language. It doesn't even have tail call optimization!!

Name: Anonymous 2011-01-24 14:54

>>7
Cause: the Anticudder

Name: Doctor Racket !RACKET/.HY 2011-01-24 14:55

>>6
Actually, yes. I wrote it in Racket and it's based on the tripcrunch's source code.

Name: Anonymous 2011-01-24 14:57

>>10
Post source code or you are a LIAR.

Name: Anonymous 2011-01-24 14:58

>>8
>Scheme
>Optimization

I guess it needs more optimization because its still slow.

Name: Anonymous 2011-01-24 15:01

>>1
You have finally reached satori.

Name: Anonymous 2011-01-24 15:09

>>10
If you didn't implement DES in Scheme it's cheating.

Name: Anonymous 2011-01-24 15:11

>>1
Congratulations! We applaud your completion of SICP. We are sorry to inform you that ``Scheme'' is really a Pyramid-Scheme and has no practical benefit at all. All that remains for you to do is troll at least 5 other people into reading SICP and our Scheme can live on!

Name: Doctor Racket !RACKET/.HY 2011-01-24 15:25

>>11
I'm not open sourcing it. Write your own.

>>14
Racket has a fairly good FFI, and libcrypto's DES implementation is surely better, faster and mature than any hypotetical implementation I could write, either if I code it in C or Scheme.

Name: Anonymous 2011-01-24 15:26

>>12
Well, Racket is utilizing a JIT compiler, of course it's slow.

IHBT?

Name: Anonymous 2011-01-24 15:31

>>16
But it's just a bruteforcer : (

Name: Anonymous 2011-01-24 15:31

>>15 said it all

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

>>17
raco make file.rkt
or raco exe file.rkt for native compilation.

Name: Anonymous 2011-01-24 15:34

>>20
Oh, I didn't know that.
Which is kinda obvious as I don't code in Racket.

Name: Doctor Racket !RACKET/.HY 2011-01-24 15:43

>>21
Still, you don't get too much speed boost, bytecompiling first is some milliseconds slower than JIT compilation, native compilation is some milliseconds faster than JIT compilation, but it needs to embed the needed libraries in the executable.

I have to admit, Racket's JIT compiler (and compiler in general) could generate much more better code.

Name: Anonymous 2011-01-24 16:16

>>18
: (
Your lack of Shift JIS letters makes me sad :(

Name: Anonymous 2011-01-24 18:18

>>15
Oh the humanity! My world is collapsing, I think I'm going to be SICKP

Name: Anonymous 2011-01-24 18:35

Aye Tee Tee: /g/

Name: Anonymous 2011-01-24 18:46

>>22
Does Typed Racket actually help code generation these days? It didn't before, but I've been away from Racket for a while.

Name: Doctor Racket !RACKET/.HY 2011-01-24 18:53

>>26
Yes, Typed Racket generates faster code, when you properly set your types.

Name: Anonymous 2011-01-24 20:52

>>27
Why, is the JIT too dumb to infer types properly?

Name: Doctor Racket !RACKET/.HY 2011-01-24 21:06

>>28
Because of the dynamic nature of Lisp, a variable that initially holds an integer value may also be later changed to contain a string or types.
Typed Racket, instead, is statically typed. A variable declared as integer will hold only integer values.

Name: Anonymous 2011-01-24 21:09

>>29
s/or types/or other types/

Name: Anonymous 2011-01-24 21:13

>>29
So the JIT can't collect statistics about the most likely types (and the resulting correlations) and compile multiple paths? C'mon.

Name: Doctor Racket !RACKET/.HY 2011-01-24 21:28

>>31
I didn't do many tests on how good the JIT compiler is, but I'm sure that it can determine the type of a variable in certain situations, e.g. (cond ((number? x) ...) #|the compiler knows that x is a number|# ...)
However, it is far from being perfect and from the quality of CL compilers.

Name: Anonymous 2011-01-24 21:30

>>32
I wouldn't trust an AOT compiler for a dynamic language, no matter what. Hell, I don't even trust AOT compilers for static languages.

Name: Anonymous 2011-01-24 21:33

>>33
Hell, I don't even trust AOT compilers for static languages.
Settle down, nigger.

Name: >>33 2011-01-24 21:38

Doctor, the patient in cell number 34 is getting nervous! Do something!

Name: Doctor Racket !RACKET/.HY 2011-01-24 21:44

>>35
Take him back to the psychiatrical hospital at boards.4chan.org.

>>33
I wouldn't trust an AOT compiler for a dynamic language
Why not?

Name: Anonymous 2011-01-24 21:53

>>36,35
What are you two, fuckbuddies? Ugh.

Name: Anonymous 2011-01-24 22:53

>>36
Because despite all the type annotations you could possibly give to it, run-time profiling is necessary to determine which code paths are most often taken in order to restructure the program flow around them. And please don't tell me anyone is going to bother including that kind of information by hand. Lisp is about semantic purity, and annotations are just ugly.

Name: Anonymous 2011-01-24 23:02

>>38
Lisp is about semantic purity
What does that even mean?

Name: Anonymous 2011-01-25 0:04

>>8
It can be implemented using decorators

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

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