[racket-dev] comments on "comments on learning Racket"

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sat Apr 26 19:09:36 EDT 2014

I have been re-reading the notes on Artyom.me's site, taking notes. Few question his comments, some suggest reactions that should come from us, others are personal musings. 

I know this is a bit of a brain dump but I find this person's thoughts worthwhile for us (devs). 

Notes on "Learning Racket" by Artyom 
How to get a Haskellian like Artyom to fall in love with Racket at first sight.

;; -----------------------------------------------------------------------------
** What does it mean to say ", or get guidance"? 

Where should people get guidance? What about? 
Avoid useless words. 

** The REPL section in the Guide must open with (+ 1 1) 

** tab completion must be faster 

** can we force the help corner[1] to show up for "beginners"? 
   (the first five hours of using a raw DrRacket or you pay us 50 bucks.) 

   The WOW #2 should come right away. 
** can we get the help corner to show up for things at the DrRacket repl? 

** How can we get the help corner show anything about module-locally defined
   identifiers ("defined in this module" would be a good start) or imported
   identifiers ("imported from module X") and if it goes thru a contract-out,
   the help corner may even say something ("with contract (-> integer? integer?)")
?? I don't get the "Uniform syntax is harder to read" comment. More
   highlighting, hmph? 

** do we need to get across racket/base more quickly?
   (so that a hello world program executable looks smaller.)

[:~/Tmp] matthias% du helloworld
1664	helloworld

** "This chapter [1 of Guide] was small and boring. Next, please!"
   We need to spice up the first chapter of 

!! HAH! The Undefined value shows up in his blog, not even half way down. 

** Should we provide a 'where' form? 

** He wants an Arc-style lambda function. Hmph. 

?? How did the kid get (apply and ...) to work? Was I asleep? 

(( He doesn't know what type safety is. I understand that C++ers don't get
   it. Why do Haskellians don't get it? ))

** People want overloading. (< "hello" "hello world") should work. Hmph. 

** When we introduce for/list we should explain it directly, in words. 

** I do get jealous when I see 

 [(i, j, k) | i <- [1..10], j <- [i..10], k <- [j..10], i^2 + j^2 == k^2]


(for*/list ([i (range 1 20)] [j (range i 20)] [k (range j 20)] #:when (= (+ (sqr i) (sqr j)) (sqr k)))
    (list i j k))

    (using full width according to Racket style)

** The time-is-not-a-procedure thing is two misunderstandings in one: 
   -- we are in a by-value world 
   -- by the time were to reach the calls to factorial, it's evaluated

   (for ((f (list f1 f2 f3 f4)))
    (time (f 10000))) 


** Do we need to add these to our library? 

;; (X ... -> Y ...) X *-> [List-of Y]
(define (gather-return-values f . s)
  (call-with-values (lambda () (apply f s)) list))

;; Nat (X ... -> Y ...) X *-> Y
(define (nth-return-value i f . s)
  (call-with-values (lambda () (apply f s)) (lambda l (list-ref l i))))

** Printing is brutally expensive in DrRacket. Is there a way to make it

** Why does he think "Performance sucks"? 

** What is this about: 

   "Support for functional paradigm is somewhere in the middle. Everything
   needed is there, but it's not very convenient to use. (I expect to stumble
   upon goodies/fp or haskell-racket module one day, but for now I won't be
   looking for it – I need to understand Racket's main paradigm before
   allowing myself to consciously deviate from it.)"
   I am thinking of Racket as FP. 

** This 

   "Given that reading every chapter of TRG raises lots of questions and
   provokes endless tinkering with not-quite-related concepts, I'll be
   happy if I manage to read as much as chapter 2.4." 

   means the Guide is the wrong kind of introduction for a functional

** quote and friends should not show up in whatever replaces Guide for
;; -----------------------------------------------------------------------------

[1] What do we call the thing that shows up at the top right? 

;; =============================================================================

** "I see." 

   Some of our error messages are, well, real-world error messages. Like all
   compilers, they assume complete knowledge of the languages so when a novice
   makes a mistake, he gets, well, nothing out of it.

   Should we try our hands on a staged approach to learning the API for our
   world of syntax and compilation? (Old people would use the word 'macro'

** "Why, why must everything be Inferior By Default?"

   We obviously need a 'syntax story' that takes readers directly from
   define-syntax-rule to syntax-parse, bringing in hygiene only late, when it
   truly matters to raise expressiveness 

   Further down he writes "But, but... It's wrong to spend a day hopping around
   only to write this. It's unsatisfactory. Things like this turn people into
   Hulks, y'know." Boy is he correct. 

   We need stories. 

** "There's probably some good reason for it, but I've no idea what it could be."
   So do we need to explain why literals in syntax-parse must be pre-bound? 
   I have run into this, read up on it, said "duh", and moved on. 

   In general, how much rationale should be given for features? Do we need a
   more hyper-linked document organization? 

** "Why doesn't DrRacket indent syntax-parse correctly? This is inconvenient."

   Yes. Why? 

** "For some reason I was thinking that indentation information is somehow
   stored with functions/macros themselves. I was wrong." 

   We discussed this years ago. Hmph, he thought so too. 

** Packages worked really well for him. Great! 

** "I'm afraid that with the level of flexibility Racket allows, I'll never get
   to writing an actual program – most likely I'll be spending my time improving
   Racket itself (well, or at least changing it to suit my tastes)." 

   Well, I went there when I was young and saw macros. Who hasn't? 

** *****************************************************************************
   "As a public promise (?), I want to state that in less
   than a year I'll write and open-source some medium-sized project in
   Racket. (And, of course, I'll be documenting the process.)"

   Let's check on him then. 
** *****************************************************************************

Posted on the dev mailing list.