hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Racket / Scheme / Lisp

Reply to topic    hacker.org Forum Index » The Hacker's Server View previous topic
View next topic
Racket / Scheme / Lisp

Do you use Racket / Scheme / Lisp?
 71%  [ 10 ]
 21%  [ 3 ]
My favourite!
 7%  [ 1 ]
Total Votes : 14

Author Message

Joined: 07 Jan 2009
Posts: 34

Post Racket / Scheme / Lisp Reply with quote
Anyone here who uses Racket as their favourite programming language?
After a struggle with VB, Java and C# I switched to Racket and fell in love with it. Expressive, clean and beautiful code, fast compiler, vast API ...

What are your opinions?
Mon Oct 05, 2015 6:45 am View user's profile Send private message
Forum Admin

Joined: 28 May 2011
Posts: 494
Location: Germany

Post Reply with quote
Eh... no, I don't use it. Should probably give it a try. Then again, that is true for many languages.
Seems like I am stuck with C/C++/Java and the like. Neutral
Thu Oct 08, 2015 8:51 am View user's profile Send private message

Joined: 07 Jan 2009
Posts: 34

Post Reply with quote
Seems like almost most people don't use Racket or they don't know it ...
Maybe it's time for some advertising Very Happy :

Most of coding is about transforming data. You have input that you give to a function and you get some results back. You don't need much more to build a turing complete language and that leads to lisp (Racket is just the newest dialect of LISP).

In C(++)/Java/Python/JS ... there are multiple ways of calling a function. You can directly call print(), you can use a index-functions: array[], there are infix-operators like +, -, and you have syntax-forms: if, while, case ...

What about unifying all these ways into one? Instead of
3 + 4
if (x>0) {return "pos"} else {return "not-pos"}

you write
(print "hello")
(vector-ref array 4)
(+ 3 4)
(if (> x 0) "pos" "not-pos")

*Every* concept can be expressed in the form (operator arg1 arg2 arg3 ...) and why not making this resemblance obvious?

We are hackers, aren't we? Most of the challenges of this sites force you to think differently and to overcome habits. We can feel comfortable with something like 12+ for the HVM, so we can with (+ 1 2) and (print "hello").

When you are interested I can explain some more basic concepts of Lisp.
Thu Oct 08, 2015 11:51 am View user's profile Send private message

Joined: 04 Jan 2015
Posts: 21

Post Reply with quote
I definitely see the semblance to HVM, and I'm willing to adjust my mind to it, but I personally don't feel the need to shift Smile, thanks for the example though! I wouldn't have checked it out without it!

At least for project-euler like problems, I'd hate to have to keep track of math operations like that, and it also doesn't seem to cater nicely to 'oneliners' for math.

However, I do like the If, Else construct Smile
Also the difference with 12+ being 3, versus 1+2, is I can understand the advantage in the 12+ construct from a circuitry perspective, but I can't see the particular advantage +12, since why would the + operand be leading, the ALU wouldn't go into a new 'mode', and you'd need an end databyte(extra memory) to tell when this operator should execute/terminate and return value. Apologies if this seems like an attack on the language that you like, I don't mean it to be that, and Thank you for suggesting it! It made me think more about it, and am gonna try it out this weekend Smile
Thu Oct 15, 2015 1:27 am View user's profile Send private message

Joined: 07 Jan 2009
Posts: 34

Post Reply with quote
I'm glad to hear your opinion. Don't be afraid of criticizing lisp - I'm NOT a missioner on some holy ... Smile

You are completely right in your two points: Doing arithmetic maths often awkward and the efficiency on hardware-level is low. In both cases I would prefer another tool, maybe Matlab/Mathematica or C.

So what are the highlights of lisp? As a functional language you can define functions on-the-fly. In maths, you write f(x)=4*x and in lisp you write (lambda (x) (* 4 x)). To square the elements of a list '(1 2 3 4) you can write:
(map (lambda (x) (* x x)) '(1 2 3 4)) -> '(1 4 9 16)

You can also filter them:
(filter even? '(1 2 3 4)) -> '(2 4)

Thu Oct 15, 2015 4:51 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » The Hacker's Server All times are GMT
Page 1 of 1

Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.