Live data from Hacker News

Anonymous recursive functions in Racket

github.com

11–20 of 65 posts

Re: Anonymous recursive functions in Racket

#11

A relevant article to the domain name of this site.

If you look at the code, you'll be (unpleasantly) surprised, I think. The author does not seem to have known what Y combinator is.

These are my favorite types of comments on hn

Re: Anonymous recursive functions in Racket

#12
post #7

This isn't specific to racket, any implementation of R6RS scheme should fully support this, although the define-syntax form is slightly different. I checked this with my R6RS implementation and it works just as you would expect ( https://github.com/maplant/scheme-rs )

How close are you to getting a "full" implementation of R6RS? I've been thinking of picking either your project or Steel[0] for a Rust Scheme thing [0] https://github.com/mattwparas/steel

I’m hoping by the end of the year. All of the “difficult” things are finished (control flow, syntax transformers, call/cc, dynamic wind, exceptions, libraries, etc) and it’s just a matter of filling missing base library functions. If there’s something in particular that you need you’re welcome to file and issue or post a message on the discord and I’ll prioritize it.

That being said, Steel is excellent and I highly recommend it if you just need R5RS with syntax transformers

Re: Anonymous recursive functions in Racket

#13

A relevant article to the domain name of this site.

If you look at the code, you'll be (unpleasantly) surprised, I think. The author does not seem to have known what Y combinator is.

https://en.wikipedia.org/wiki/Shriram_Krishnamurthi

Re: Anonymous recursive functions in Racket

#15

A relevant article to the domain name of this site.

If you look at the code, you'll be (unpleasantly) surprised, I think. The author does not seem to have known what Y combinator is.

If it helps, you will find the Y-combinator described (indeed, derived) in the first edition (https://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-0...) of the author's programming languages book (https://www.plai.org/). (Page 228, if that helps, though the derivation begins on page 223.)

For added fun, the day he teaches it in class, he wears a t-shirt from Y-combinator the startup accelerator (and explains what its name means).

Now that we've gotten that out of the way, it remains unclear what is surprising or unpleasantly surprising about the code.

Re: Anonymous recursive functions in Racket

#16
post #13

Earlier quoted context omitted.

If you look at the code, you'll be (unpleasantly) surprised, I think. The author does not seem to have known what Y combinator is.

https://en.wikipedia.org/wiki/Shriram_Krishnamurthi

Don't see Y-combinator mentioned anywhere on that page.

Re: Anonymous recursive functions in Racket

#17

A relevant article to the domain name of this site.

If you look at the code, you'll be (unpleasantly) surprised, I think. The author does not seem to have known what Y combinator is.

In addition to the general sibling comments, I can personally attest that Shriram knows what the Y combinator is and has been teaching students about it for at least 25 years. My own lecture notes from one of his classes about the lambda calculus and the Y combinator were for a long time on the front page of google results for info about either!

Re: Anonymous recursive functions in Racket

#18
Tangential, but I've been wanting to dive back into FP for quite sometime; for context I used Haskell at a payments corp ~10 years back, working mostly with Typescript, Zig and Nim for the past couple of years, realizing I am basically trying to do FP in most of these languages.

Is Racket a good language to pick up and re-learn my concepts + implement some tools? Or are there some other languages that would be better to both brush up and learn the syntax of, I do not want to fight the syntax but rather express functions as seamlessly as I can.

Re: Anonymous recursive functions in Racket

#19
post #18

Tangential, but I've been wanting to dive back into FP for quite sometime; for context I used Haskell at a payments corp ~10 years back, working mostly with Typescript, Zig and Nim for the past couple of years, realizing I am basically trying to do FP in most of these languages. Is Racket a good language to pick up and re-learn my concepts + implement some tools? Or are there some other languages that would be better…

Racket is a rich and powerful language, but it is also designed with certain specific ideas in mind. You can learn more about the "zen" of Racket here:

https://cs.brown.edu/~sk/Publications/Papers/Published/fffkb...

That might help you decide whether Racket will help you with what you're trying to brush up on.

Re: Anonymous recursive functions in Racket

#20
post #7

This isn't specific to racket, any implementation of R6RS scheme should fully support this, although the define-syntax form is slightly different. I checked this with my R6RS implementation and it works just as you would expect ( https://github.com/maplant/scheme-rs )

Wow — scheme-rs is such a neat project! Hadn't heard of it before!
Post reply on HN