News for hackers. Stuff that matters.

dzpower

Re:Love Letter to Clojure on Saturday October 12, 2019 @08:08AM (#21232402)
This very site — Hacker News — runs on Arc (Paul Graham's Lisp) which is implemented in Racket.

Beating the averages: http://www.paulgraham.com/avg.html

Racket web frameworks: https://github.com/avelino/awesome-racket#web-frameworks

Re:Love Letter to Clojure on Saturday October 12, 2019 @07:58AM (#21232341)
The ClojureScript example is great.

Clojure and by extension ClojureScript has a lot of tasteful and pragmatic design decisions, e.g. the use of the threading form and implicit lambda illustrated with the "+ 2").

By contrast Racket has been extended to include a Clojure-inspired threading as a library, showing off just a little of its awesome linguistic extensibility, leading in this case to ergonomically similar code.

Clojure/Script is a wonderful opinionated modern Lisp; Racket is a more linguistically extensible modern Lisp. There's considerable cross-fertilisation going on.

If you love Clojure, it's worth keeping an eye on Racket.

* * *

You can spell λ out as lambda in Racket (and Scheme).

Re:Love Letter to Clojure on Saturday October 12, 2019 @02:57AM (#21231151)
I feel similarly to Gene Kim about Racket. Here's a comparison ...

Gene Kim's Clojure example:

  ; input is JSON string: "{foo: 2}"

  (defn xform [s]
    (-> (js/JSON.parse s)
        js->clj
        (update "foo" + 2)
        clj->js
        js/JSON.stringify))

Racket equivalent:

  #lang racket

  (require threading json)

  ; input is (xform "{\"foo\" : 2 }")

  (define (xform s)
    (~> s
        string->jsexpr
        (hash-update 'foo (λ (x) (+ 2 x)))
        jsexpr->string))
Re:Ask HN: Companies using Racket? on Saturday November 03, 2018 @05:24PM (#18372549)
It does sound like you were expecting a full Lisp and instead were greeted with one of the Beginner Languages, intended to teach first time programmers in a very structured way. See https://docs.racket-lang.org/drracket/htdp-langs.html

The example that you give is not an error in full Racket:

  Welcome to DrRacket, version 6.12 [3m].
  Language: racket, with debugging.
  > (cons 'foo 'bar)
  '(foo . bar)
Similarly, full Racket has multiple, powerful macro systems, and more besides, deliberately excluded from the Teaching Languages.

* * *

I'm not an academic, but the community and core Racket team are incredibly supportive, and any Comp Sci professor running into difficulties teaching a Racket-based course can easily access plenty of support and guidance, starting by contacting the user mailing list.

Re:The Girl with the Brick Earring on Saturday November 25, 2017 @01:08AM (#15774662)
On a similar theme, what began as a weekend hack to help my wife design a patchwork quilt based on an image of Groucho Marx ended up as https://www.youpatch.com.

In this case, the aggregation algorithm not only creates rectangular areas, but also avoids the need for the quilter to have to sew Y-seams.

Here's my talk from RacketCon: https://www.youtube.com/watch?v=8psnTEjYIEA

Re:Ask HN: Learning to code, without a computer? on Saturday October 08, 2016 @04:19PM (#12668552)
For self-guided study, HTDP (How to Design Programs) is more accessible than SICP.

https://www.amazon.com/How-Design-Programs-Introduction-Prog...

Re:Racket v6.2 on Saturday June 20, 2015 @11:42PM (#9752068)
I got a fair way through SICP using DrScheme (now DrRacket) a few years ago without any special compatibility modes, and found the set-up to be pretty great.

Now there's better compatibility thanks to

#lang planet neil/sicp

http://www.neilvandyke.org/racket-sicp/

Re:Why we hate Lisp on Wednesday June 17, 2015 @05:05AM (#9730688)
Racket (a Scheme descendant) might be a good fit. It has teaching languages, which are simplified, and a nice IDE (DrRacket), and books (HTDP/2e (free online), Realm of Racket, etc.)

Close match to the Python above:

(apply + (range 1 11))

Re:How to Program Racket on Sunday February 15, 2015 @05:53AM (#9052315)
My craft + tech startup www.youpatch.com uses Racket for the clever bits: image-processing, pdf generation, and I find it's great for prototyping and R&D. Here's my talk wide-ranging talk about it (video and slides) http://agile-jitsu.blogspot.com.au/2015/01/my-talk-at-racket...

Also at RacketCon 2014 Brian Masterbrook talked about using Racket at www.airstash.com for testing hardware: links at con.racket-lang.org