Live data from Hacker News

I keep bouncing off the Scheme language

sicpers.info

81–90 of 91 posts

Re: I keep bouncing off the Scheme language

#81
post #74

Earlier quoted context omitted.

As far as I know, Racket docs are entirely human-generated. The functions aren’t tied concretely together to types by anything. In C#, types and their member functions are automatically tied and inspectable in code. That’s what I feel is missing. Also, I don’t want to take away from the phenomenal Racket docs. They’re a real treat to work with.

If you're referring to C# (and Java) being the Kingdom of Nouns where a type like ArrayList is defined and contains its methods, sure, Lisp is not exactly like that, but I feel like conventions give you a similar experience. For example, functions related to hash tables all have `hash` in their name and are either constructors or they take a `hash` argument. They are contained in their own file (hash.rkt). Also, does…

> I assume Racket contracts can handle your concern about relating functions and types

contracts are not real types enforced by the compiler/runtime. that means you need to keep them in sync manually and you dont get performance benefits from typed vm instructions. you also lose a big safety net that makes sure you always call a function that can handle the values you pass in. the whole industry has been moving towards ml style strong types for the last 10 years and its for a good reason

Re: I keep bouncing off the Scheme language

#82
post #78
post #64

Earlier quoted context omitted.

Relatedly, I've noticed the strange infatuation that a lot of C++ programmers have with Python specifically. I have no idea why that is.

Both have `class` keyword

So does JS, yet it's not the scripting language du jour in the C++ world.

Re: I keep bouncing off the Scheme language

#83
post #73

You may like Rhombus, all the power of Racket in a Python-like syntax Official docs: https://docs.racket-lang.org/rhombus/index.html Collection of small examples: https://github.com/racket/rhombus/blob/master/demo.rhm

With all due respect to the Rhombus authors, this sounds like a downgrade.

I still prefer S-expressions, so I go to the Rhombus mailing list every few months to give an opinion for or against one feature that I think is interesting.

Anyway, making Rhombus forced a few general enhancements in the Racket ecosystem, like more support for not-s-expression languages in the editor, filters in docs for languages families, and some new "backported" libraries like Treelist that behaves closer to a list in Python.

My main concern was how to make good macros without s-expressions. There is a nice video by Matthew Flatt in RacketCon 2023. The first 6 minutes and 20 seconds are internal stuff, so skip to the 380s that I added in the link: https://www.youtube.com/watch?v=OLgEL4esYU0&t=380s He takes like another 6 minutes to explain the general idea and make some wishes, and then at the 12m mark he defines macros and makes the wish real in just 2m (with some enhancements later).

Re: I keep bouncing off the Scheme language

#84

I studied Scheme in CS around 1990, but also found it hard to grasp and to apply to real world problems. And all those parethesis, brrr... :) The idea that "everying is an object and classes are nothing special" is neat, but it does not fit the way people (okay, I) think about real world problems. So I stuck with Smalltalk/OOP and am stil there :-).

I’m playing with creating a language where everything is an object and a function. Calls are just method missing per object or fields/slots are just canned responses to calls.

Re: I keep bouncing off the Scheme language

#85
post #57
post #14

I think that it helps a lot to have a daily practice of using a language for small things. In much that same way that many people do the daily wordle or crossword, I do the daily leetcode. I flip a coin and solve it first in either C++ or Python, then re-write my solution in the other one. Usually it takes me around 20 minutes to solve it in either language, and 5 minutes to re-solve it in either language. Recently I…

Do you find yourself programming a solution in the second language in the style of the first? Or are they both similar enough to you that it is effectively the same style of solution?

I typically do the same algorithm for each solution, but I do try to write it in an idiomatic way to each language.

I usually look at the editorial after the first solve to see if I missed any tricks or other approaches, and sometimes I’ll write the second solution differently if there was something interesting that I missed.

Re: I keep bouncing off the Scheme language

#86
I started with Fortran 2 which has subroutines which don't behave as black boxes. It took me months of frustrated study to understand procedure calls in decent languages as delegation. That opened up the world of high-level computing. Later I would teach this using problems that were a good fit for "recursion". Recursion is not a feature, it's just an obvious pattern of the more general and important nature of delegation. While recursion is occasionally a useful technique, it's tremendously valuable as a tool for learning how to think about procedures as black boxes!

Re: I keep bouncing off the Scheme language

#87
post #58

I've been forcing myself to stay within the CHICKEN ecosystem for the past 6 months. So far, the whole ecosystem moves really slow, but CHICKEN is such a good design that adding/rolling your own library for whatever you need is so simple. I ended up creating a bunch of eggs (CHICKEN libs) and even rolling my own web framework with its own ORM and background job processing that I rolled out to prod (1000+ users for th…

But are you learning programming in Chicken or in Claude?

If I was new to programming, I would stick to just scheme for a while. I've been doing this for 20+ years professionally. Right now I'm treating claude as my junior engs, and I carefully review what it builds. If you treat them as your E3/E4 engs and you play the role of a TL *AND* assuming you know what you want to build, then things can move pretty fast.

Re: I keep bouncing off the Scheme language

#88
After working with C++, I spent years embedded in Scheme. Have you worked with any other functional languages, like Haskell, ML, or even Lean? Intellectually, the value of Scheme is it's an untyped lambda calculus, while the rest dump mountains of typing and syntactic sugar on top. The other interesting aspect of Scheme is call/cc - call with current continuation, which you can learn a lot from.

Re: I keep bouncing off the Scheme language

#90
post #34

Earlier quoted context omitted.

How did you arrive at C++ and Python? Yes I'm aware they have many structural and aesthetic differences, but why would you not choose a language with a different paradigm—functional, logical, even procedural, etc?

Good question. I chose them because they are the languages that I use professionally and would choose for technical interviews. I expect to be asked to solve problems in either language in any given interview. Technical interviews are different enough from day-to-day work that I still find it valuable to practice in them.

Brother. Easy interviews are no basis for your own practice.
Post reply on HN