Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Or are there specific aspects of Racket that in your view repel [competent programmers]?

This is anecdotal and over a decade ago, but quite specific: my first exposure to Racket was with a version of the language (I think it was some pragma-type thing like `#lang`, but it's been a while) allegedly intended for CS classes, and included something along the lines of [exact spelling and phrasing almost certainly differ]:

  > (cons 'foo 'bar)
  error: cons: 'bar is not a list
I immediately deleted the Racket installation and added it to the same set of blacklists as the Java Virtual Machine (and hypothetically any COBOL implementations I ever encounter). That any version of the language would behave that way, much less one purportedly intended for people who are only just learning LISP in the first place, is a insult to everyone who ever bothered to actually learn LISP in the first place.

This is the sort of "Dangling by a Trivial Feature"[0] thing that there's just no excuse for, like trying out a new text editor and discoving that pressing backspace inserts the text "^H", except it was clearly deliberately aimed at people who didn't know any better and would 'hopefully' not realise there was a problem, rather than just being a local idiosyncracy[1], because cons did work correctly under other dialect settings.

Actively trying to fuck over newcomers who are only just learning LISP (or programming in general) deeply offends me.

0: https://prog21.dadgum.com/160.html

1: In which case I still wouldn't use Racket myself, but I wouldn't be actively opposed to anyone else doing so.



It is indeed the case that the student languages in Racket use cons only for lists. Improper lists are an extra complexity that people just learning to program don't need.


I've dabbled in a few lisps and definitely a noobie but I have absolutely no idea what you're talking about


That language behavior fundamentally misrepresents how a proper cons should actually work. It's a link between any two values, represented as essentially two joined pointers, one to each value. It represents a linked list when cons cells are nested, but that's just something that falls out of the far more beautiful and fundamental core axiom of the cons cell, not all of what cons cells are. Thus claiming cons cells must be nested (which is what requiring the second argument of cons to be a list (I.e. more nested cons cells or nil) implies) is actually bastardizing what a cons cell is, reducing it to a menial operation for producing lists that means the same thing as "prepend" instead of an elegant core abstraction you can derive further things from. Bastardizing it like this, honestly especially in a language for teaching CS, in the name of talking down to students, is unforgivable. I learned Common Lisp at 12 partially from Land of Lisp and partially from a Lisp 1.5 manual and experimentation. Properly learning the core abstractions was vital.


Just to be clear: The teaching languages aren't Racket. The teaching languages consists of a series of small languages designed for beginners. The idea is that a beginner can get more precise error messages.

Analogy: On a calculator, what should the result of sqrt(-4) be?

Depends: If the user is a third grader, then maybe "error, can't take square root of -4". If the user knows complex numbers, then "2i".

The teaching languages does just that. They are linked to the book, which tells you when to "level up".

Conflating the teaching languages and Racket is not helpful.


> "error, can't take square root of -4"

That has nothing to do whether the user knows better than to trust such a answer; it's because they (likely implicitly, which is admittedly unfortunate) asked for a real-valued result, which indeed can't be done. Eg, in python:

  >>> import math,cmath
  >>> math.sqrt(-4)
  ValueError: math domain error
  >>> cmath.sqrt(-4)
  2j


I remember the first time I ever used Python, the very first thing I did was type that exact thing. When I saw that error I immediately deleted Python, wiped my hard drive and drop-kicked my Dell Vostro computer all the way into the sun. It was so infuriating to me that that any programming language lie to people about basic math, deliberately keeping them ignorant and stupid, and actively preventing them from understanding the simple beauty of complex numbers.


> requiring the second argument of cons to be a list

A language called ISLisp (ISO Standard Lisp) also does this nasty thing.


To be scrupulously fair, that seems to fall under

> just being a local idiosyncracy

albeit a stupid one; whereas Racket actively targets beginners in particular.

Also, this is ISO we're talking about here; we probably shouldn't expect anything technically competent from them that isn't just a rubber-stamped version of someone else's specification, and they didn't call it "ISO Standard Common Lisp" or "ISO Standard Scheme", presumably for good reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: