12 ms·
Racket Is an Acceptable Python (2019)
- throwamon 4y agoSee also: Pyret, a Python-inspired functional language by the creators of Racket - https://www.pyret.org/ https://www.pyret.org/
- phyrex 4y ago(2019)
- Labo333 4y agoSee a previous thread: https://news.ycombinator.com/item?id=20392448 https://news.ycombinator.com/item?id=20392448
- dang 4y agoThanks! Macroexpanded: Racket Is an Acceptable Python - https://news.ycombinator.com/item?id=20392448 https://news.ycombinator.com/item?id=20392448 - July 2019 (168 comments)
- dark-star 4y agoWe used Racket in the early 2000's at university, in the first year of CS. Everyone (including me) was appalled by it (we already knew C, Pascal, Java, etc.) After a few weeks it "clicked", and since then I've been a huge fan of Scheme. When other students went out of their way to write C-to-Scheme converters to keep coding their homework in C, if you fully embraced the language it felt something close to enlightenment ;-) I used Scheme later to teach programming to absolute non-science people and they all simply "got" how it worked, even though they had previously struggled doing even very basic things in Excel Macros and the like. Scheme is a perfect tool for learning how to program, and it is even useful later to write complex programs in production. Yes, C might be faster, and Python might have more hits on StackOverflow, but to really understand the concepts behind polymorphism, recursion, lazy evaluation, oop, etc. Scheme helps a lot with it's simple syntax.
- agumonkey 4y agoThe surface reduction really helps grasping ideas on many dimensions [0]. Also some scheme impl are probably running circles around python perf. [0] see python talks about not using classes for single method cases which are just fat closures. Yet it's still often used.
- rytill 4y agoCan you share an example of such a talk?
- agumonkey 4y agoiirc that's this talk https://www.youtube.com/watch?v=o9pEzgHorH0 https://www.youtube.com/watch?v=o9pEzgHorH0
- ModernMech 4y ago> Also some scheme impl are probably running circles around python perf. I have an abacus that has better perf than Python, so I’d say this is a safe bet :P
- mbrodersen 4y agoNot much of a challenge. Python is super slow when not simply calling C code.
- giraffe_lady 4y agoRacket was also my first exposure to lisp and I recoiled from it as well. Shortly after I ended up working in clojure for a while, which I felt "fixed" a lot of the things I thought I didn't like about racket. I still think the clojure syntax and immutability semantics are prettier than racket's but that's just my own vanity. I'm back on racket for the reasons mentioned in the article pretty much: good fundamental language, big and practical standard library, plus every freak academic CS thing you could ever want to play with available as well. The tooling and community also encourage you to think of problems in terms of DSLs, something it partially shares with ruby as well. That approach isn't always a good fit, or one you can get buy-in for, but when it works it works well for me.
- zestyping 4y agoThis part was counterintuitive for me: > We found the age-old belief that "lisp syntax is just too hard" is simply false; the main thing that most people lack is decent lisp-friendly tooling with a low barrier to entry, and DrRacket provides that. If the syntax requires special tooling to make it usable, isn't that a sign that the syntax is hard? Are there many people who believe Lisp syntax is as easy as Python or other non-Lisp languages? If that's true for you, I'd be interested in hearing more about your experience.
- petre 4y agoNo, the syntax is easy. Aligning the paranthesis is the annoying part where the tooling comes in.
- sigzero 4y agoRacket is up there for something I want to learn so I poke around in it. I don't find the syntax as easy as Python myself.
- metroholografix 4y agoI find it's better to think in terms of "familiar" vs "not familiar" rather than "easy" / "hard". Lisp syntax to me is the easiest -maybe with Forth and Smalltalk- syntax around, certainly orders of magnitude easier than Python's. And I don't mean just semantics, but also conceptual beauty. There's something about it that feels so elegant that other languages do not possess (again with Forth / Smalltalk exceptions). I can take a young curious kid with no previous exposure to programming, and teach Lisp syntax in under 5 minutes. But a kid with no previous exposure to programming is nothing like your average developer with strong pre-existing conditioning about how programming languages must look like. And this is the issue I feel with a lot of folks complaining about Lisp syntax. It's easy but it's not _familiar_ and some find it harder than others to get used to this discrepancy.
- baq 4y agoas the saying goes, the only intuitive user interface is the nipple.
- deleted 4y ago[deleted]
- kkfx 4y agoHum... Python have a simple advantage: easy to learn, being mostly imperative, especially for those who have a background (even very little) in such languages (most students) and it's quick to fire up and also present almost everywhere with pip and venv to help. Racket is a far more powerful tool, but also less immediate to learn, especially for those who have a background with imperative languages, not fast at all to fire up and not easy to use as a glue for anything else. Python is a kind of bridge from unix shell scripts not so many nowadays have practice with and a script-versed programming language. Racket is about programming in classical terms, with an unique ecosystem. In that sense probably Smalltalk with Pharo or classic (old) Lisp with Emacs are more acceptable Python since they do not act as a glue but they are FAR more immediate to use and have a purpose on it's own behind programming: they are end-users programming environments, as Python is an end-user scripting tool.
- truncate 4y agoMy ex who wasn't from stem background was learning Python. Its very anecdotal, but few things I very well remember was: (1) Here getting confused with scopes. E.g. assigning variable in one function and using it somewhere else, mixing global/local scope, assign/use order. Looking at that I was thinking a language that has more explicit and strict way to declare variables and look at scopes is probably better for beginners. The alternative with Python is that it can be somewhat confusing, and at times you see them only if they get executed. Racket definitely doesn't have that problem. It is as obvious as it can be. (2) If your introduction is through some kind of project (data science, web app ...) you'll likely be using some object oriented features from very beginning. I saw her getting confused with `foo()` vs `foo.bar()` vs `foo.bar`. There was definitely a big gap in her understanding, but I think Racket's focus on functional paradigm and most libraries being that way -- is somewhat a nicer experience for beginners. Overall, Racket is a simple language but can get fancy as far you'd want it to, so I think the barrier of entry is probably better than Python.
- AtlasBarfed 4y agoMuggles think in dynamic scope: they accumulate facts or locations and then refer back to them. Local/lexical scoping is really a code structure/management/scaling thing. A name management system if you like. As the joke goes, the two biggest problem in CS are naming and caching.
- messe 4y agoI always liked the variation that the two biggest problems in CS are naming, cache invalidation, and off by one errors.
- brundolf 4y agoThe problem is that Python doesn't make the explicit distinction between declaring a new (shadowed) variable, and assigning to an existing variable from an outer scope
- strbean 4y ago
- bmitc 4y agoI sometimes like to imagine a world in which .NET was cross-platform and open source from the start such that when F# was introduced it took over everywhere Python was popping up. It's a fantastic world to imagine but a depressing reoccurring dream.
- 2mol 4y agoI love F#, but honestly Microsoft really hadn't built up the kind of trust back then (and maybe even now) to make this an even remotely realistic scenario.
- lynndotpy 4y agoTrust is one issue, another mah be perception. I know Microsoft has been embracing and extending open source recently, but I didn't know F# was open source. Even then, I still have the impression it's very much "Microsoft stack" and not worth investing energy in unless I'm doing "Microsoft stack" stuff.
- bmitc 4y agoF# has been open-source since the beginning or at least for a long time (before .NET Core).
- einpoklum 4y ago> It's a fantastic world to imagine How so? Link? Many people have never seen an F# program.
- brundolf 4y agoI'm not even sure Python is an acceptable Python
- musicale 4y agoI'm not either, but even with syntactic quirks like significant indentation Python seems to have provided a wider onramp than Lisp has.
- bb88 4y agoPascal was the preferred language for original Mac OS development. Ada was used in DoD (and elsewhere) for more than a decade. Both use a lot of "english" phrases which makes it easier for the novice to understand basic control structures.
- musicale 4y agoPersonally I hate it that Python has given up on backward compatibility. I don't love Java/C++/JavaScript but I do like their backward compatibility (though JavaScript packages/libraries are often quicksand.)
- musicale 4y agoI was being serious in case it's not obvious. I really do not like Python's disregard for backward compatibility.
- matheusmoreira 4y agoIt's the libraries that make Python acceptable. There's just too much technological wealth built on top of it.
- maximilianburke 4y agoAny time saved using Python libraries is lost when trying to manage Python environments and versions.
- knoebber 4y agoGrinnell alum here - our first CS class is in Scheme. I expected the class would be a breeze because I already had a few years of programming experience in Java/Python in highschool. Turns out that lisp is way different, and I was about as challenged as people with 0 programming experience. At first most of us were annoyed at having to learn an esoteric language without real 'industry' use, but by end of semester we all were super into it. It helped that our curriculum focused on fun problems like using recursion to draw things using a faculty/student developed scriptable gimp library.
- bb88 4y agoI remember a talk from a Michigan State professor at one Pycon a ways back that taught Python for their intro to CS. What I remember is that for the first time ever, he had people call him after the class and wanted to switch majors. I think Scheme is awesome as long as it's not your first language, but I think if Scheme is your first introduction to CS particularly in college, it can be pretty brutal depending upon the instructor. I think a lot of higher learning institutions were trying to copy MIT's use of SICP for their intro courses.
- kazinator 4y ago> wanted to switch majors To what, Art History? Poli Sci?
- paroneayea 4y agoAuthor of this blogpost here. I think the post is good, though it's mostly aimed at the perspective of "Racket is a very practical Lisp, for getting things done, akin to how Python is a very practical lisp" and also "DrRacket gives an accessible entry-point for Lisp for newcomers." Unfortunately I don't think Racket quite took this to be the rallying cry I hoped them to, to embrace Racket's lispiness as "The Python of Lisps" (which was the other alternate title I was debating between when I wrote it). But in the comments here and as with most articles about Lisp, the conversation moves to... can newcomers understand Lisp's syntax? My spouse and I gave a talk about this very topic: "Lisp but Beautiful; Lisp for Everyone". https://fosdem.org/2022/schedule/event/lispforeveryone/ https://fosdem.org/2022/schedule/event/lispforeveryone/ There's a lot in there (including demonstrations of representations of lisp which don't have parentheses at all). But the biggest point in the talk is that lisp isn't scary for new programmers... it's scary for experienced programmers. As we talk about in the video, my spouse and I co-ran introductions to programming using Racket aimed at humanities students with no required prior programming experience whatsoever. What we found was that the students who had no prior programming experience, after just a few minutes, had no problem with the syntax (and DrRacket made it easy enough to pick up the language). But we did have complaints in the class about lisp's syntax... from those who already knew how to program. They already had a frame, and within that frame, lisp's syntax looked alien. Without a frame, students just accepted it and did fine with the syntax... great, even. (Many of them praised its clarity; like any decent lisp editor, DrRacket helps identify the kinds of parentheses-oriented errors that users think they're going to encounter.) Anyway, I do more work in Guile these days than Racket, but both are really great systems with great communities. The thing I miss most about Racket though is that DrRacket gave an easy entry point for students which wasn't "and now start learning Emacs". (Guix is pretty great, however.)
- mark_l_watson 4y agoI read your article when it was first published and agree with the sentiment. Off topic (sorry) but one thing Racket is missing is great Python interop to mix in deep learning and other libraries. Common Lisp and Clojure have this support. Years ago I tried saving trained Keras weights and using them in Racket with the Matrix support: it works, but not very fun to use.
- rg111 4y ago> I dreamed in parentheses. I'm not kidding, the only dreams I've ever had in code were in lisp Every time I dreamed of code, I could never actually get what language I was writing in. But, each time, the code text was wrapped thin and was long. The theme was just perfect. I have looked at a lot of themes and color-schemes for vim (and terminal) and VS Code, but could not match the one from the dream. It was just perfect. And although I write a lot of Python, I think the code I dreamt of was typed.
- zitterbewegung 4y agoRacket is trying to make itself an acceptable Python at this time [1]. Also I used to use Racket and the biggest issue was the lack of batteries either were included or I could find a library that would work. But the biggest issue is the community itself [2] and that isn’t going to change any time soon. 1. https://github.com/racket/rhombus-prototype/blob/master/resources/state-of-rhombus.md https://github.com/racket/rhombus-prototype/blob/master/reso... 1. https://beautifulracket.com/appendix/why-i-no-longer-contribute-to-racket.html https://beautifulracket.com/appendix/why-i-no-longer-contrib...
- rscho 4y agoHow is the Racket community an issue when the "issue" is that one guy bullies (some very particular) people? I've regularly posted reaaaally stupid things on the Racket forums and lists and people (including the core team) have always been super patient and welcoming. I really don't understand that "holier than thou" sentiment. I guess most people really shouldn't go eat in fancy restaurants or seek care from well-known hospitals either, then? Because many well-known chefs, lead doctors, etc. are really no nice people. How is that the community's problem?
- Semiapies 4y agoBetween s-expressions in Racket and indentation in Python, this thread really turns out all the people who whine about code that doesn't look like Java.
- wraptile 4y agoWeird that a hacker forum would be complaining about language fit for _hacking_ and instead yearn for corporate ideology. huh.