Live data from Hacker News

A Friendly Introduction to Racket

geometridae.bearblog.dev

131–140 of 195 posts

Re: A Friendly Introduction to Racket

#131
post #44

Earlier quoted context omitted.

It looks more like a "program" for an HP15c pocket scientific calculator. Not necessarily a bad thing but also not exactly what I would call "expressive". You may be able to build anything you want --- which may be efficient when communicating with the machine. But I wonder about now well this would communicate with other programmers.

It's not a program, it is (obviously) a totally unrealistic hodgepodge expression for a list of constant values that simply demonstrates the literal syntax for a variety of types of values (real numbers, dotted pairs, rational numbers, complex numbers, polar coordinates, etc. -- Racket is unusually expressive in the types of literals). Your comment demonstrates something typical of HN, and it's not a good thing. It's…

I think in this case it is probably justified, as the claim of "no special syntax" is unfortunately not true. To convey the amount of special syntax, it got crammed into one brief example snippet.

Still, far less than most other programming languages, virtue of having parentheses making things unambiguous. Outliers are Smalltalk and maybe (?) Forth.

Re: A Friendly Introduction to Racket

#132
post #93

Earlier quoted context omitted.

Yeah, there's a toggle for it in read-syntax mode. https://docs.racket-lang.org/reference/Reading.html#%28def._...

How do you get that to work? #lang racket (read-syntax-accept-graph #t) (let ((a '#0=(0 . #0#))) (display (car a))) ...which of course doesn't work, because `(read-syntax-accept-graph)` is a run-time thing, and the circular-list structure is a `read`-time thing. I couldn't figure it out with this either: https://stackoverflow.com/questions/51942188/read-syntax-for... ...just to make sure I wasn't going crazy, this: (…

It's ugly and probably fragile and prone to break, but I found a way. Added it as an answer on that Stack Overflow question: https://stackoverflow.com/a/79997503/9952196

Re: A Friendly Introduction to Racket

#133

> no special syntax for anything. (list '(1. . #\#) -5/6+7.s-8i `(1 ,@2) 1@1 ;hmmm, no unquote splicing comma ;-) 10# ;surprised? (list #i+1 +1i 1+i) ;complicated or complex? #e-1e10i ;Old MacDonald? "(* 9 10)" #())

I think you clearly exposed one of the things that I couldn't never describe why I wasn't dragged into Racket/scheme. It's not only annoying is hard to remember all these differences.

Obviously the more you use the language these go away but still at least to me it doesn't seem to be a coherent syntax.

Re: A Friendly Introduction to Racket

#134
post #99

> Emacs Lisp — millions of people run Lisp every day without knowing it, because their editor is a Lisp interpreter. Are there seriously any emacs users who are completely unaware of elisp? Isn't elisp the entire point of picking emacs?

Most Emacs users I personally know simply treat it as an editor. They're not really aware how it works under the hood.

Still doubt, that they are unaware of Elisp. Bare bones vanilla Emacs is maybe a bit much to get used to these days, so anyone wanting to configure their Emacs will have opened their init.el or so file and will have put some Elisp snippets there.

Re: A Friendly Introduction to Racket

#135
post #16

While the language is interesting, sadly, nobody is using it in the wild. Maybe due to cumbersome deployment options? The ability to produce native standalone executables would boost its usage I believe.

It is not due to deployment options. People put all sorts of stuff in docker containers every day. It is rather that few people make an effort to learn a lisp, and fewer still who choose to learn Racket. The few universities teaching good computer programming basics using Racket don't really make a dent. You simply don't have coworkers who know this stuff. Are you going to be the one person making a decision at the company, to use something no one but you knows? Not gonna happen.

I have not had a single coworker, who has even started to learn these things, even after I have presented a Scheme on a Friday afternoon, and showed off some cool threading/pipeline syntax-rules macro, and showed how this compared to Python, showing how it reduces boilerplate in a way impossible to do in Python.

Granted, this is in Germany, where CS education is not really all that great, and most universities teach boring Java or C++ or something.

At least we had a RacketCon in Berlin some time ago, and I was fortunate enough to have a prof at university, who at least introduced Dr.Scheme. His motto was: "I am not here to teach you C, Java, or Python. I am here to teach you computer programming." (translated) He went on to introduce languages of various paradigms, from Prolog, to Dr.Scheme (predecessor of Racket), to C, and Python. Thank you Prof. von Löwis.

Re: A Friendly Introduction to Racket

#136
post #16

While the language is interesting, sadly, nobody is using it in the wild. Maybe due to cumbersome deployment options? The ability to produce native standalone executables would boost its usage I believe.

Naughty Dog uses Racket for all their scripting...

Re: A Friendly Introduction to Racket

#138

> no special syntax for anything. (list '(1. . #\#) -5/6+7.s-8i `(1 ,@2) 1@1 ;hmmm, no unquote splicing comma ;-) 10# ;surprised? (list #i+1 +1i 1+i) ;complicated or complex? #e-1e10i ;Old MacDonald? "(* 9 10)" #())

Isn't at least one of them undefined? `(1 ,@2)

It's always surprising to me how many things Scheme leaves undefined. Other examples are evaluation order (in some rather surprising places) or the value of: (make-bytevector 4)

Re: A Friendly Introduction to Racket

#139

Earlier quoted context omitted.

It looks more like a "program" for an HP15c pocket scientific calculator. Not necessarily a bad thing but also not exactly what I would call "expressive". You may be able to build anything you want --- which may be efficient when communicating with the machine. But I wonder about now well this would communicate with other programmers.

I actually wrote an audio sequencer in HP RPL as a kid. It was far less complex to code, and human readable. Unicon was pretty cool also, but never became popular. Erlang/Elixir will probably become more relevant as people move into massively parallel constraint solvers. The monolith centric languages are simply no longer appropriate for many classes of problems. =3

Unicon was pretty cool also, but never became popular.

Like it or not, popularity is a significant attribute if you have to work with others.

Re: A Friendly Introduction to Racket

#140

> no special syntax for anything. (list '(1. . #\#) -5/6+7.s-8i `(1 ,@2) 1@1 ;hmmm, no unquote splicing comma ;-) 10# ;surprised? (list #i+1 +1i 1+i) ;complicated or complex? #e-1e10i ;Old MacDonald? "(* 9 10)" #())

Isn't at least one of them undefined? `(1 ,@2) It's always surprising to me how many things Scheme leaves undefined. Other examples are evaluation order (in some rather surprising places) or the value of: (make-bytevector 4)

    > `(1 ,@2)
    '(1 . 2)
This is a pair. The notations is called "dotted pair".
Post reply on HN