dzpower

Joined 11 years ago

Karma
31
Submissions
9
Member since
Feb 15
I'm in Melbourn, Australia.

My sites: pragerslaw.com, youpatch.com

Agile/Lean consulting, coaching, training (including technical XP and beyond), facilitation.

Also functional programming (mainly Racket).

View on Hacker News

Recent submissions

Comment · 7 years ago
Comment · 7 years ago
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).

Comment · 7 years ago
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))
Comment · 8 years ago
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.

Comment · 9 years ago
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

Comment · 10 years ago
Comment · 11 years ago
Comment · 11 years ago
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))

Comment · 11 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton