7 ms·
I keep bouncing off the Scheme language
- gus_massa 5mo agoYou may like Rhombus, all the power of Racket in a Python-like syntax Official docs: https://docs.racket-lang.org/rhombus/index.html https://docs.racket-lang.org/rhombus/index.html Collection of small examples: https://github.com/racket/rhombus/blob/master/demo.rhm https://github.com/racket/rhombus/blob/master/demo.rhm
- sph 5mo agoWith all due respect to the Rhombus authors, this sounds like a downgrade.
- gus_massa 5mo agoI 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 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).
- veltas 5mo agoIs it possible you're too stupid to write scheme? Because that's where I think I am, I've also tried and failed to write it a few times.
- jfengel 5mo agoProgramming languages, like natural languages, are tools for human beings, not computers. They work around the strengths and weaknesses of a human brain. It's not a question of being smart or stupid. It's whether the tool fits the task it's applied to and the affordances it gives the user. Scheme is intended more as a teaching tool than an actual language. Its simplicity is perfect for reasoning about programs. It's less well suited to practical tasks. About the only really difficult lesson of Scheme is if you use it as a purely declarative language. Imperative features are a natural affordance of the human brain. Working with them is beautiful and alien.
- convolvatron 5mo agoI don't know you, but it seems very unlikely. scheme is a little different because it doesn't really encode or enforce 'standard patterns' that serve as mold that we pour code into. that probably means that its not quite as clear where to start. but at least in r4rs-land its based on a very small number of general simple primitives. I think it's refreshing change of perspective, and certainly worth pursuing if you're interested at all in in building programming structures rather than just using them. but if its not at all to your taste I wouldn't beat yourself up about it.
- twoodfin 5mo agoScheme was invented as a consequence of Sussman & Steele’s discovery that lexical closures in the lambda calculus had essentially an identical implementation to a fully elaborated version of Hewitt’s actor model. I do wonder what a language with the same “taste” and minimalism as Scheme but embracing the actor model would look like. Erlang? Even better if someone could figure out how to harmonize them in the same language: “There are exactly two ways to do it, and they’re interchangeable.”
- mepian 5mo ago> I do wonder what a language with the same “taste” and minimalism as Scheme but embracing the actor model would look like. There is Spritely Goblins: https://spritely.institute/goblins/ https://spritely.institute/goblins/
- twoodfin 5mo agoA 98-page PDF on language design for distributed objects in a capability security model? Made my day, thanks!
- bitwize 5mo agoIn terms of modern concurrent actors, in addition to Spritely Goblins there is also Termite, a restricted Scheme with Erlang-like concurrency semantics that now comes with the Gambit distribution.
- cmoski 5mo agoLFE: lisp flavoured Erlang? https://lfe.io/ https://lfe.io/
- jolux 5mo agoWhat do you find insufficiently minimalistic about Erlang? It’s not exactly a shaggy dog of a language.
- varjag 5mo agoI think it's the symptom of inadequate practice rather than some "language neurotype". Consider writing (yeah 2026 I know) a substantial project in Scheme from scratch.
- Pay08 5mo agoTwo websites don't sound like insubstanial projects.
- r14c 5mo agoWith LLMs you can make 20 websites and still not really understand the language. For learning you really do have to type the code out yourself. That's how you build familiarity and understanding. Reading code is a good starting point, but it doesn't really gel until you start writing your own ideas down, fail, and try again until it works and makes sense. Especially if you're working in a new language with unfamiliar semantics.
- Pay08 5mo agoI was the same way (and still am somewhat, I can't get hygenic macros into my head) but due to the differences between Scheme and Common Lisp. What helped me was writing imperative code that Scheme people would surely scoff at, and gradually using more and more Scheme features as I kept writing. Then I refactored the whole codebase to look like the final few hundred lines.
- bitwize 5mo agoOh, kinda like how I learned Emacs: use it "wrong" for years, treating it as a sort of weird archaic Notepad++, then gradually discover features, master the keybindings, and learn to program Emacs Lisp over time until my proficiency, and the utility the editor provided to me, grew. these days i'm seriously considering switching to zed tho
- Pay08 5mo agoThat sounds like a horrible way of learning Emacs, but fair enough. I don't think you need to know elisp as a prerequisite but personally I learnt enough of it to be able to get by without Customize. You might want to read Zed's EULA.
- bitwize 5mo agoWell, I'm sorry for not employing a Hackernews-approved data-driven, spaced-repetition learning technique utilizing Pomodoro, Zettelkasten, and balanced gut bacteria to optimize the time to proficiency. I was frickin' 18 when I discovered Emacs (and Linux), it was 1995, and most of us were just figuring this crap out as we went. I do not use Zed's online services, only the editor itself which is GPLv3. If I need AI I wire in a third-party ACP provider, which is easy enough to configure.
- TFNA 5mo agoThe GP is right to be offended by what you said, because his way of learning Emacs was an extremely typical one for decades. Remember that such informative and inspirational resources like Mastering Emacs didn't exist until the 2010s. I myself got into Emacs around the turn of the millennium because I wanted a free IDE for my programming-language classes at uni, and also I wanted to use Gnus which was such a capable mail and Usenet reader. It was only over years, as I amassed various problems that I needed to solve and tasks to automate, that I began learning all the tricks of Emacs customization and then eventually Emacs Lisp itself.
- kayo_20211030 5mo agoI understand the challenge, but is Graham (OP?) getting too caught up in how the code ought to look, rather that what it ought to do. I don't think it matters much initially how a piece of work looks as long as it does what's intended. Afterwards it does; particularly if you need to involve other developers, and to them, the idioms looks "strange". I'm not convinced that there's an ALGOL neurotype that's distinct from a LISP(?) neurotype. I think it's a bit of a spectrum like everything else.
- iainctduncan 5mo agoStrange that the post makes no mention of the Little Schemer series, because teaching you to "think Scheme" is exactly what those books do. Some people are put off by the weird style (combination of children's book visuals and socratic logic problem presentation), but they work!
- SoftTalker 5mo agoI struggled with The Little Lisper (as it was called at the time) in school but as I approach the other end of my career I've given some thought to working through it again. I think it would come a lot more easily now. Though I looked at Haskell maybe 10 years ago and never got traction with it. Functional or declarative programming styles appeal to me, and I love what I've learned of Erlang but never really had a job where I could use it. Used SQL a lot and quite like it as well.
- fredrikholm 5mo agoI love that book so much, it helped me grokk the more lambda calculus aspect of FP more than anything. A few chapters in I belly laughed when it dawned on me that it's going to be recursion until the cows come home. The authors insistence on working through the steps is endearing and comical. Great book to come back to every once in a while.
- tmtvl 5mo agoThere's something very ironic about an article about bouncing off Scheme on a website called 'SICPers'. OT: I think I'm pretty decent at thinking in Scheme, although I don't quite have the hang of continuations. That said, because I like type declarations I use Common Lisp, which allows me to bounce between a more Scheme-like style and a more Assembly-like style however I see fit.
- senkora 5mo agoI 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 decided to start learning emacs lisp. This is an imperative lisp dialect that’s pretty different from scheme, but I think that the particular language doesn’t matter much for this process. I could a bit biased because I do have prior experience with SML and scheme. I started re-solving the problems a third time in emacs lisp. And I’m still learning but I’ve felt my comfort with the language increase over time, and I expect that if I continue doing this then I will eventually reach parity with C++ and Python. Currently it takes me about 20 minutes to re-solve a problem in emacs lisp, because I usually have to read documentation and/or look up something new.
- deleted 5mo ago[deleted]
- throwaway27448 5mo agoHow 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?
- senkora 5mo agoGood 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.
- epolanski 5mo agoI hope you really do it more as enjoyment (like people do crosswords) with just a very secondary benefit of technical interviews, because otherwise I can't but find this rat race obsession super sad.
- Smalltalker-80 5mo agoI 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 :-).
- NuclearPM 5mo agoI’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.
- leecommamichael 5mo agoDo what works for you.
- chuckadams 5mo agoYou can write entirely imperative OO code in Scheme, it just has syntax that's weirder than you're used to. Not everything has to be functional abstractions, syntax macros, or twisty mazes of call/cc. If SICP is too abstruse, give HTDP a try, but if you know other languages, you already know most of scheme.
- ulbu 5mo agoscheme is great, but the dx of some implementations is not. i’m on guile scheme due to guix, and frankly, i’m hating it a quite bit. stack traces are esoteric and error messages entirely unhelpful, documentation masquerades as deep but is indeed inconsistent and prosaic, mixing styles of reference, explanation, and how-to willy-nilly, (compare with Dybvig’s The Scheme Programming Language, which is focused and consistent, and it takes no time to get your answers; there’s just no method to guile and guix manuals), i hate it big time, there’s big gaps in documentation (especially with Guix – there’s literally zero information about `define-record-type*` which is used everywhere in its codebase; admittedly, not scheme related, but still), the cli requires too much memorization, most modules are not named, but numbered, ie, instead of something like `(base list)`, you get `(srfi srfi-1)`, so you need to either memorize, or go through the info pages for each procedure you need to import, which means you also need to know the exact names for the procedures you need beforehand, there’s like 4 ways to define a record, each with a different feature set and incompatibilities, etc. these are the reasons i find it hard to use. to respond to the content of the article, the different neurotype idea is off, because scheme allows you very well to express sequences of operations; the ecosystem of APIs may not cater to this tho. although if it was rephrased into “scheme emphasizes symbolic manipulations, as opposed to operating a machine”, i would agree
- hilsdev 5mo agoI am only amateur level with scheme but these are common to other scheme implementations. SRFIs are semi-standardized core libraries that work mostly the same in all implementations. I believe the record-type and records generally are one of these SRFIs, and it’s based on a chapter in SICP (several show up as sections of the book where students implement things that would be language feature in a larger env) All the Lisp implementations seem to have pretty cryptic seeming errors, but it also seems to be very informative to those who know how to parse the call stack and how to expand/dig down in the built in debuggers. This is likely because of the same idea as those record-types, much of the language is built in the same lisp you’re running - so the error messages go a few levels lower level than you would expect. It’s not just a C syntax error type explanation, but rather you get some error about a bad call to a function you’ve never heard of running below that feature we normally associate with being a core function
- neilv 5mo ago> Obviously an LLM generated the code, but I felt comfortable following along and understood what it was doing, reading and Trusting the Tests. [...] My difficulty is with thinking the way that lets me write Scheme. There's your problem, right there. Vibe-coding is sabotaging learning before you even start. You can learn some things by reading good code, but there's no substitute for the exercise of thinking through problems yourself. (Also, an LLM won't necessarily give you good code.) First learn paint fence, Daniel-san. Not watch third-hand videos spliced together of other people painting the fence, and thinking you'll understand much of anything about it. > I have the ALGOL neurotype. Good news! Scheme started as a block-structured imperative "algorithmic" language in the spirit of ALGOL. Just with more parentheses. Write as if in ALGOL, but using Scheme's comparable syntax and language features. And lots of parentheses. Don't get confused by CS professors showing you pure-functional features, the metacircular evaluator, recursive programming, syntax extension and language-oriented programming, etc. You can come back to that. Just start coding ALGOL-style in Scheme. You'll accomplish something in an hour. Once you see it's easy, and are comfortable with that part, then the next thing you do, to get more idiomatic is one of the following, then do the other one: * Try to get more functional, by eliminating some of the mutations of variables in your code. For example, if you're using `set!` a lot, can you eliminate them by, for example, making them arguments in a named-`let` recursion. (Or, instead of named-`let`, spell out the recursive functions, like some intro CS professors will want you to do, but that can obscure things that are obvious once you see the named-`let` lexical structure.) * Try to get more language-oriented, by making a little domain-specific language, maybe with `syntax-rules`, `syntax-case`, or `syntax-parse`. One more tip, for anyone coming from C, C++, Rust, etc., who may like trying to know the cost of everything: If you get hung up on high-level language features like GC, and not knowing which of a number of ways of doing something, is the right (performant) way, try not to. But if you want an intuition (that might be a lie), imagine that needless mutations or allocations may be more expensive than finding a different way to do it. And each FFI call has very expensive overhead. At one point that I had to make highly performant code, I made a little tool, to help confirm my intuitions: https://www.neilvandyke.org/racket/shootout/ https://www.neilvandyke.org/racket/shootout/ There's also a statistical profiler in Racket now, and you can even (with work) rig it up in production systems, for measuring real-world workloads, which I used to guide optimizing performance of a large and complicated system.
- wellpast 5mo ago> When I think about a programming problem, I think in terms of the sequence of instructions I need the computer to do, and the memory locations that can hold the information the computer needs to track. You’re almost there. Just stop thinking about the sequence of instructions. Focus on the information half (the values) that you need to produce.
- matheusmoreira 5mo agoI bounced off Scheme so many times I just created my own lisp instead. At some point I just accepted that I wouldn't ever be comfortable in any language other than the one I made myself. I too have the ALGOL neurotype...
- pfdietz 5mo agoYou might try Common Lisp instead.
- vnorilo 5mo agoIf solutions come naturally to you in OOP, why not just roll with it? Personally I find it easiest do design data flows: think about what we need in order to compute the result. The less I have to think about state the better. Functional patterns fall out and it feels simple and easy to me, so I do it. I'm way over the phase I thought that's somehow cooler than the OOP folks, however.
- funkaster 5mo agoI'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 the past 6 months or so, not a huge demo but it proved that it can scale/be good enough for my projects). Best of all, is that the syntax grammar is so simple, that a simple CLAUDE.md + a few review agents lets me move super fast using AI. I spend most of my time anchoring on the design/plan and let AI write the implementation for most of the code.
- volemo 5mo agoBut are you learning programming in Chicken or in Claude?
- anthk 5mo agoNeither. These people don't realize that they are learning ever less skills than not touching Claude ever.
- funkaster 5mo agoIf 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.
- anthk 5mo agoToss AI. Install srfi-203 and srfi-216 for SICP support. Then at ~/.csirc (import scheme) (import (srfi 203)) (import (srfi 216)) Finally, SICP in Texinfo format: https://zv.github.io/sicp-in-texinfo https://zv.github.io/sicp-in-texinfo
- throw310822 5mo agoI've had to go through my Scheme labs when I was studying CS. Even as a hobbyist with a decade of experience in various languages and a decent intuition for coding, I couldn't get my head around it. It's quite telling that a language that is hard to read, unfit for most purposes and that even proficient coders never seem to fully grasp, was chosen as a tool to introduce beginners to coding.
- evdubs 5mo agoAssuming your comment applies to Common Lisp as well, if Scheme (and Lisp) truly was, "hard to read, unfit for most purposes and that even proficient coders never seem to fully grasp," it wouldn't be the language that introduced so many features later implemented in other languages. > Lisp pioneered many ideas in computer science, including tree data structures, automatic storage management, dynamic typing, conditionals, higher-order functions, recursion, the self-hosting compiler, and the read–eval–print loop. So many proficient coders were able to grasp features of Lisp, find the fitness of those features, and implement them in their own languages.
- SilentM68 5mo agoI've had a similar problem. I originally started learning programming with BASIC, assembly, procedural, event-driven, languages, found OOP bloated and thus counter productive, time consuming, still do. Have tried to focus on functional languages, but for some reason none stick. Not sure if it is my brain, or haven't found the right language that will work with my head. I'm trying my luck at Odin to see if that can stick with me.
- jimbob45 5mo agoI went back and forth with ChatGPT on this a while ago. I concluded that my main problem with Lisps (and C) is that types don’t have their core functions associated with them concretely. The only way to know strcat, puts, and strlen exist is…to know that they exist. This vexed me. We lightly mapped out the idea of having traits for types in lisp and then having those traits and their associations frozen at compile time. That way, you could see which traits a given type implements and feel your way around the language more confidently. However, like “If you give a mouse a cookie”, I realized that once I had my traits that I also wanted compile-time attributes à la Rust/C# and there’s no clean way to add those to Lisp’s syntax without seriously cluttering it up (note: yes, function-level attributes would look fine but C# allows attributes on locals, iterators, and usings which just don’t mesh with Lisp’s syntax). I gave up. Lisp is neat but it just doesn’t fit in the future of programming that Rust and C# have shown us.
- gwerbin 5mo agoYou might be interested in the Gauche implementation of Scheme which overall has a Python-like extended standard library, notably including a lot of functions that are generic over sequences and collections which historically in Scheme (and even moreso in Lisp) had a menagerie of special-cased functions for working with them.
- evdubs 5mo ago> types don’t have their core functions associated with them concretely. They do in Racket? You look at the "List" documentation and you find all of the functions for lists. Likewise with hash tables, numbers, strings, sequences, files, etc. > The only way to know strcat, puts, and strlen exist is… ... to look at the documentation on docs.racket-lang.org. The powerful search includes results not only for the standard ("batteries included") library reference, but also the standard guide and 3rd party libraries. > once I had my traits that I also wanted compile-time attributes à la Rust/C# and there’s no clean way to add those to Lisp’s syntax I mean, why are you not able to do (trait whatever) before (define whatever) or (for-each whatever) or (let whatever)? > Lisp is neat but it just doesn’t fit in the future of programming that Rust and C# Have you tried it or did you just try to figure out why you don't think you like it from an LLM?
- incanus77 5mo agoI've been trying to learn Scheme lately by way of schemesh[1], which strikes me as a very clever integration of Scheme into a shell. My favorite parts are that you mix Scheme and shell using () or {} directly, as well as shebang right into one or the other fully as the default when needed. [1] https://github.com/cosmos72/schemesh https://github.com/cosmos72/schemesh
- bsder 5mo agoI'm kind of especially surprised that an OOP person bounces of Scheme. OOP and Scheme both like to atomize things into webs of a zillion little functions. The biggest advice I would give to the author is "If you're doing general programming instead of compiler construction, get off the goddamn lists, ignore recursion and use vectors and loops like somebody civilized. Don't write a macro until you have a gun to your head." Everybody I know who "bounces off" of Scheme/Lisps does so because of the idiotic "List Pedagogy" when the expert programmers almost invariably use vectors everywhere. However, in this day and age, the lack of strong typing is a lot more of an issue. I've been more directing people toward OCaml rather than Scheme/Lisp nowadays--especially since they added multicore. However, similar advice attends: "Ignore the functional crap and type inference. Use vectors and put type signatures on all the things, you savage. OCaml works just fine as an "imperative" language."
- oumua_don17 5mo agoFrom my experience, you become a lisper truly when your Lisp image is running for days on end, you miss the live editing power and loathe the exception handling system in other languages. It takes a while and concentrated effort to get you there. I strongly recommend anyone interested use a Lisp as their prototyping language in their workplace. Another idea is to rewrite a complex component of the software you're working on and rewrite it in Lisp. More importantly ask the questions on Lisp forums especially about using the live editing workflow.
- GregDavidson 5mo agoI 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!
- mattgoupil 5mo agoAfter 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.