15 ms·
Racket: Lisp for the modern day
- theanonymousone 3y agoIsn't Clojure the literal "Lisp for the modern day(a.k.a JVM)"? I hope I don't get kicked out of HN altogether for this comment :)
- c_crank 3y agoClojure is opinionated against using all the potential features of Lisp.
- masijo 3y agoWhat would be those potential features of Lisp that Clojure is missing?
- c_crank 3y agoMulti paradigm support, low level / C interop capacity, really any sort of native features
- waffletower 3y agoClojure is a multi-hosted language. Clean native interop would be nice to have I agree though.
- fulafel 3y agoIt steers you pretty heavily toward functional programming.
- waffletower 3y agoThat is fair, though not a negative for many. Clojure prefers immutable data structures and functional constructs. Rich Hickey even wishes that he added fewer OOP constructs in the language (such as structs) and leaned more heavily on Clojure rooted functional concepts like 'transducers' which came later in the life of the language.
- mejutoco 3y agoIMHO Common Lisp is the modern one. Using the JVM is nice for certain uses, and clojure is a fine language, but going bare metal from higher abstractions is some power of Lisp that we should not give up. Same with macros and code generation. Luckily all of them can coexist, so we do not need to choose.
- criddell 3y agoHow is code generation handled on modern operating systems and CPUs? Isn't there normally a strict separation between code and data to prevent exploits?
- andsoitis 3y ago> How is code generation handled on modern operating systems and CPUs? Isn't there normally a strict separation between code and data to prevent exploits? You compile code, which is text (data), all the time, don’t you?
- p_l 3y agoAt worst you have to ensure that you separate what needs to be writeable from executable, and then flip mappings RW->RX when generating new code, just like other JIT compilers do.
- 3y ago
- wildermuthn 3y agoUnfortunately, IMHO Clojure’s maintainers hold an iron grip on the language and actively limit the growth of an ecosystem around it. See “Open Source is not about you”. It’s too bad, because itself is really terrific.
- pjmlp 3y agoTo their right, Rich Hickey almost got bankrupted while developing Clojure. The usual "expect all for free, give nothing back" attitude.
- threatofrain 3y agoRich Hickey basically wrote this in response to one of the notable and respected contributors of his ecosystem. If Rich wanted open source to be nothing more than a license and delivery mechanism then he shouldn’t have accepted volunteers. But a language without an ecosystem of volunteers is a dead language.
- pjmlp 3y agoMany languages do quite well as commercial products.
- erichocean 3y agoClojure "the language" is certainly ossified, but Clojure "the ecosystem" is doing very, very well.
- nocman 3y agoI'm genuinely curious. What about the language do you feel is "ossified"? I am interpreting that as being a negative description. Stability is extremely valuable. A lack of change to the core language over extended periods of time can be a very good thing, especially if certain changes would break existing code. Rich has made it clear that he is indeed targeting this kind of stability. Again, I would be very interested to hear what specific changes you think need to be made to 'Clojure "the language"'.
- systems 3y agothe problem with clojure is you have to learn java (or at least some java) same issue i see with F#, you still need to have at least some basic knowledge of C# unfortunately running on JVM actually really means running on Java same for .net it mean running on C# i dont mind learning two languages, its expected from most developers to know more than one, but context switching in a single function between two language is not fun
- pjmlp 3y agoThe curse of guest languages. However F# suffers from a bigger issue, that clojure doesn't, belonging to the platform owner, that behaves as if it was an error to make it part of VS 2010.
- jeremyjh 3y agoIsn't that because F# failed to win any significant market share? I think F#'s problem is that C# is too good and this was true even in 2010, its not like Scala vs. Java in 2010.
- systems 3y agoF# is way nicer than C# (and Clojure is still way nicer than Java) And I dont think F# failed, I just think it needs to find a way to hide C# and OOP better But the language is doing fairly well, tons of educational resources, tons of videos on youtube , several nice projects on github, solid vs code mode, it is part of .net , but still a lot can be improved, and microsoft is far from abandoning, C# is one of MS flagship products , F# is not a flagship product And I also think that Don Syme is a lot more active working for F# and promoting it, than Rich Hickey is currently working for Clojure
- soulbadguy 3y agoBig F# fan here, but i don't really "doing fairly well" is a fair assessment of the F# ecosystem right now. > microsoft is far from abandoning Might has well. When you look at the resources actually being deployed for F#, it's clear that MSFT either don't care or don't really have plan for F#. Most of the work is done by the community. The number of actual paid/full time MSFT dev on F# is very limited. The tooling is extremely limited, there is no official F# libraries for pretty much any MSFT and azure services (have to relie on C# libs.) In leetcode where the have C# (so already have the infra to run .net stuff, and language like elixir and racket (so they do have more niche language), they still don't have F#. The salvation for F# would come from finding a killer app, something akin to pytorch/numbpy or rails.
- LIzzyytujghf 3y ago[dead]
- phtrivier 3y ago"It can generate an executable" ; but how slow will this executable be ? Compared to something compiled with SBCL or a non-LISP ?
- deleted 3y ago[deleted]
- f1shy 3y agoAlso how big will the exe be. Last time I looked the whole interpreter is packed together with the source. Also I‘m not sure if you can obguscate the code, if you do not want to publish it.
- macco 3y agoProbably, it will be fast enough. The new compiler is based in mzscheme.
- ObscureScience 3y agoIsn't Chez Scheme the default runtime by now?
- Jtsummers 3y agoYes. Since 8.0.
- ryanschaefer 3y agoA while ago I wrote an AWS lambda runtime to use Racket. I saw terrible Startup performance at around 500ms for a simple echo program.
- dchest 3y agoYeah, reading all those parentheses on startup is not fast. As an anecdote, I used to host a computationally expensive web app written in Racket (even before Chez version) serving large amount of requests at peak times on a single $10 DigitalOcean droplet. It was pretty fast and didn't crash. No need for awkward modern web scale thingies.
- iNerdier 3y agoI’m slightly confused by the aim of this article. It goes out if it’s way to state in the first few paragraphs how approachable it is to newcomers, then dives into talking about how good it is at making, other programming languages. How big a desire of the average neophyte is to make themselves another language?
- psychphysic 3y agoNew comers 5 years experience systems engineering. Just like your typical entry level job listing.
- deleted 3y ago[deleted]
- Solvency 3y agoSeems pretty common to claim <technology X is both easy to learn yet extremely powerful>.
- andsoitis 3y agoThere’s an elegance to a language that works great for beginners but also scales to very sophisticated use cases.
- p4bl0 3y agoIndeed, Racket is a platform for active academic research in both computer science education and programming language theory.
- ssivark 3y agoIt’s taking about “little languages” (DSLs), somewhat in the spirit of what one thinks of as libraries/APIs (on a continuum, all the way to something with its own syntax… Like regular expressions). https://chreke.com/little-languages.html https://chreke.com/little-languages.html
- err4nt 3y agoThere are a lot of problems where people struggle to simply put the problem into meaningful terms, so they can think about it. If you deal with the same problem space a lot, having a Domain-Specific Language (DSL) can let you execute that vocabulary and work at the level of the terms that fit the problem space best. This is a lot smaller in scope than designing a whole programming language, think of it like a unique vocabulary for solving specific problems and automating specific kinds of work you do!
- maroonblazer 3y agoI've started working through "How To Design Programs" and it calls for using DrRacket. It didn't occur to me to see if there was support for Racket in VSCode. Per this article, there is, via extensions. For anyone who has worked through HTDP: is there any benefit to sticking with DrRacket vs using VSCode? The friction involved in moving around in DrRacket really dampens my enjoyment of the material in HTDP.
- soegaard 3y agoI recommend using DrRacket for the first two weeks. And use it when you are working with picts. Note that you can change the default settings to be more Emacs-like.
- i-am-gizm0 3y agoMy intro CS class was in Racket. Probably 99% of people used DrRacket and were fine with it (to be fair that was the you haven't really programmed before class). I had to use it for some of the graphics assignments and it's... fine? If you're going to keep using it, make your life easier and use a proper monospace font (like Consolas). The default (I think Cambria?) doesn't align parentheses and brackets with each other and it makes it hard to read (at least for me).
- dizhn 3y agoI am getting a weird rectangular box on this website that is not allowing me to read the article in peace. My assumption was they did want me to read it, but it doesn't seem to be the case. It says "Discover more from Deus In Machina" on this box. I would maybe want to discover more except for 2 things, #1 it won't let me read the current thing, #2 i don't know that other things will let me read it either. I think they should fix this quite obvious bug before writing more articles.
- ArchieMaclean 3y agoBeneath the large obvious green 'Subscribe' button there is some low-contrast grey text ('Continue reading') that, when clicked, hides the box. This is on Substack's side, not the author of the article.
- dfan 3y agoThis is an annoying Substack thing. Click on "Continue reading" (if you wish to).
- doodpants 3y agoI use the "Disable JavaScript" extension in Firefox, and created a rule which disables JavaScript for the entire substack.com domain so as to avoid this nonsense. Unfortunately, some sites such as this one use their own domain name despite being based on Substack, so I still have to disable it manually in these cases.
- efficax 3y agojust click continue reading…
- eyelidlessness 3y agoSubstack has a really annoying implementation of this that can be super non-obvious in some cases, because it’s based on a fixed(-ish?) scroll position but blocks before the modal is effectively visible. On my first visit to the article I was convinced that several links on the page were just underlined text because I happened to scroll to just the right place where I had a modal overlay I couldn’t see. I only discovered they were actually links after giving up and scrolling to read more, then second guessing my original conclusion.
- markstos 3y agoLooks great, but didn’t answer the question for me of why to learn this over TypeScript or Rust. The answer seems to be in the title: this of particular interest for those already interested in Lisp or Scheme.
- soulbadguy 3y agoWhat are you looking for in learning a new language ?
- markstos 3y agoTypeScript as a job skill for web work. Rust because it’s the other language I see most often see coders learn to build their own apps. It has a good reputation for developer experience, security and speed. I’ve heard enthusiasm for lisp-based languages for a couple decades and don’t doubt the merits of Racket.
- soulbadguy 3y agoYeah in which case I think you are fine skipping racket or lisp for that matter
- eyelidlessness 3y agoDisclaimer: my lisp experience is largely with Clojure, and not at all with writing Racket, just earnestly reading about it. If you’re picking just one language to learn, and limiting your learning to only that one language for a significant period of time, you’ll probably want to learn Rust. You won’t get all of the benefits of also learning a lisp, but you’ll get a lot of the ones which generalize well. If you’re open to learning 1+N and otherwise lean towards TS, I would say you’re better off learning Racket (or any lisp really) in tandem than learning TS alone. Familiarity with the core concepts and idioms of FP are broadly beneficial in any language, and lisps tend to be a good balance of those with low incidental mental overhead, and reasonable escape hatches to do imperative stuff where it makes sense. Racket is probably a particularly good candidate because its optional typing is another overlapping story between the two. I haven’t written in any lisp for close to a decade now, but I still find that prior experience beneficial every day since. I sometimes miss the simplicity and flexibility of the parentheses. But I can take what I learned—how to reason about state, data flow, data-driven abstractions—anywhere. And those abstractions are particularly useful in a structural type system like TS.
- zsh_89 3y agoAs a pretty experienced programmer, who make a living by writing code for almost 10 year(with a CS master degree), I would like to say something to new learners of CS who need making money by CS skill in the future: + almost everything related with LISP is fun + but they have VERY limited use in industry, for very good reason; + you should try spend at least same amount time (as on LISP topic) to learn something like leetcode(or even higher level of competitive programming, which improve your skill of converting your idea to code fast and basic math thinking; useful in interview), job-oriented CS book. You'll be a better problem-solver and more ready in job market. + If you're very sure you will be financially OK, just learn anything you like and ignore this message.
- waffletower 3y agoI think there are many people reading this thread who develop using a variety of Lisp as their primary language and are more than adequately compensated financially, and yes, in 2023.
- zsh_89 3y agoYes I completely agree. Yet I insist that it is responsible to clearly deliver that message that the numbers of applications/jobs are NOT at the same magnitude. Personally I've spent many hours on LISP related topic; I enjoyed the time; I recommend it as a low priority interesting topic. Things like develop a working distributed KV store(MIT 6.824), solid 1000+hours on competitive programming, those skill&knowledge are not only beautiful&interesting, but also make a person a better practical problem solver.
- glonq 3y agoI will argue against your first point ;) ...but otherwise pretty much agree. I learned LISP in college, way back when expert systems were the future of AI. The worst thing that I could probaby do professionally is to write something in LISP that needs to be adopted and maintained by somebody else in the future.
- dunefox 3y ago> + but they have VERY limited use in industry, for very good reason; And what would these very good reasons be? inb4 "only for single programmers", brackets are difficult for normal programmers, macros can't be understood by mortals, and other non-issues that have been discussed to death.
- NickNaraghi 3y agoThe fundamentals of CS courses in my undergrad program were taught in Racket (with HTDP). At the time this seemed very impractical, because I already knew Java and just wanted to write useful apps. But as I've progressed in my career, I've come to appreciate how it helped me develop a strong foundation for reasoning about programs and their underlying logic (in any language) that continues to serve me to this day. If I was approaching this outside of a structured curriculum, it would be hard for me to justify this long-term intangible benefit relative to being able to move quickly to write something interesting and useful. And I think writing interesting and useful programs is the best way to motivate oneself to keep programming. So I can't strongly advocate for this approach. But I do think there are some worthwhile benefits.
- nkassis 3y agoI think it could be argued that the language used in universities is unlikely to be the one used professionally. I remember when the derogatory term "Java school" was commonly used for schools that shoehorned Java in all courses just to try to match the language of the day in enterprises. It really should be about what is the best pedagogical tool to teach the concepts the student is expected to understand irrespective of future professional tools used. If racket exposes those concepts better without making it onerous on students to learn that's great. When MIT switched from scheme to python for their undergrad classes there was a big debate here aboutit. I think the argument was that python won't make learning the concepts any harder but is less of an issue for students to learn and has some long term value professionally so win-win. I don't fully agree but I can see the logic.
- andtheyrerobin 3y ago> It really should be about what is the best pedagogical tool to teach the concepts the student is expected to understand irrespective of future professional tools used. If racket exposes those concepts better without making it onerous on students to learn that's great. One of the challenges with an approach which doesn't concern itself with "industrial grade" or "production ready" languages is getting buy in from student. Even if there were a perfect language for teaching, if students don't see the applicability of that language they aren't going to learn enough of the concepts to move to such a language later. I think it's very easy for us (and other technically competent folks) to see value in learning how computers work for the sake of that knowledge; however, students, as an over generalization, don't. The fact that relevance and motivation are some of the hardest hurdles to overcome in early computing classes is a perfect example of this. Using languages with a professional pedigree is important because it increases student buy in to what they're being taught. An analogy I like is that you wouldn't give someone new to woodworking a toy hammer and hand saw because they need to learn fundamentals like striking and cutting before they can start using "real" tools, you would provide them with capable, but beginner friendly, tools that allow them to build those skills as they learn.
- truth_seeker 3y agoIs the webassembly story ripe yet ?
- bmitc 3y agoI really wanted to dive into Racket a few years ago and still really like Racket. But this is when they switched focus to the Rhombus project, which killed a lot of interest and personal momentum I had going for Racket. It has also become clear that Racket's maintenance core is too academic. I don't think Racket is too academic, but by the very nature of Racket's primary community being professors and graduate students, it means there is a very small core team with a lot of the interest and use outside of that core being shortlived as students go through PhD programs. There are a few nonacademic core members, but there are few.
- fn-mote 3y agoIMO this part is FUD: > when they switched focus to the Rhombus project, which killed a lot of interest and personal momentum I had going for Racket The language has been "complete" for a long time. If you're actively trying to get something done, I think it's unlikely that some core language work is going to stop you. It isn't clear what domain the parent wanted to work in; I won't say it's impossible they had problems but ... details are everything at this point. The academic part of Racket gave rise to `syntax-parse`, a truely fabulous improvement over the standard Lisp/Scheme/whatever you used to work with way to write macros.
- bmitc 3y agoWhy is it FUD? It's my own feeling. In this specific case I had just spent a week of my and my work's time and money learning Racket at an official Racket school only to find out at the end that they're creating a new "surface" syntax. The split of do I learn and participate with Rhombus or Racket is a concern. The idea that the core maintainers, or really the core maintainer (singular), is busy with Rhombus is a concern. The explanations given at the time for the Rhombus project were primarily dubious and unclear. The uncertainty and doubt were not created by me. It was enough to make me move on. Other languages like F# and Elixir suit my needs. > The academic part of Racket gave rise to `syntax-parse`, a truly fabulous improvement over the standard Lisp/Scheme/whatever you used to work with way to write macros. That's not the academic part I am referring to. My comment is about who the maintainers and users are and how their profession or studies affect how Racket is interacted with. (This is not a complaint or judgement. It's an observation.) > The language has been "complete" for a long time. There are a fair number of bugs in Racket's libraries, including core ones. They aren't discovered because academic users are not touching bits that more industrial-oriented users would find. In particular, I am thinking of the GUI toolkit, and in my experience, only one person is capable of fixing those.
- manicennui 3y agoThe comments section of this submission are the perfect example of how far this site has fallen. Bunch of blub programmers worried about whether Racket is the most popular or can be used for their crappy day job.
- uneekname 3y agoI love Racket, re-wrote my website in it and a few other projects. I'd call myself an advanced beginner, I guess. > Racket excels as a programming language for young learners and beginners. I honestly think Racket could do more to be beginner-friendly. The documentation is excellent, but difficult to understand as a newcomer. There are some great little tutorials that are easy to work through, but the ramp from there to writing your own Racket programs is steep imo. I don't know of any other language with so many batteries included. Racket deserves to see community growth, and hopefully with that will come more resources for folks to get started
- no_wizard 3y agoMy limited use of Racket is purely due to how it has its own IDE and nothing else. Its fine, and its pretty good for Racket code (and its variants, like typed racket) but when I'm working on a real project I have other things I need to write too, like CSS, HTML, TypeScript, bash scripts etc. Its more ecosystem to be more adoptable IMO. I love it for learning though, but turning racket into a production level language w/ proper ecosystem has a way to go
- jimhefferon 3y agoLots of folks use it outside of Dr. Racket.
- nsm 3y agoIMO a couple of cool aspects of Racket that aren't called out in beginner guides, but I think are really useful in real programs: 1. The use of custodians on a per-(green-)thread basis that brings "oh yes, if the thread crashes or is shutdown, racket guarantees that all open files/sockets/resources will be shut down". For example you can use this to ensure that a timed out client doesn't cause unnecessary resource usage. https://docs.racket-lang.org/more/index.html#%28part._.Terminating_.Connections%29 https://docs.racket-lang.org/more/index.html#%28part._.Termi... 2. Events and composable concurrency from Concurrent ML - Unlike Go's channels, concurrent ML events are composable up the stack, and have some nice things built in like "NACK events" (allowing cancellation down the stack). Unfortunately there aren't great primers about using this that I know of apart from the Kill Safe Synchronization Abstractions paper. https://users.cs.utah.edu/plt/kill-safe/ https://users.cs.utah.edu/plt/kill-safe/ 3. Sandboxing - https://docs.racket-lang.org/reference/Sandboxed_Evaluation.html https://docs.racket-lang.org/reference/Sandboxed_Evaluation.... Some of these were added to make it easier for the IDE to manage errant programs that could be written by beginners, but it is also a very "applicable to production" set of tools. Racket internalizes Extra-linguistic mechanisms https://felleisen.org/matthias/manifesto/sec_intern.html https://felleisen.org/matthias/manifesto/sec_intern.html Also the fact that various DSLs can inter-op with each other directly, so that you can use something like a binary parser description, as if it was just another Racket library. For example this description of the format https://github.com/Bogdanp/racket-binfmt/blob/master/binfmt-test/binfmt/basic.b https://github.com/Bogdanp/racket-binfmt/blob/master/binfmt-..., is directly included in another file as a regular library https://github.com/Bogdanp/racket-binfmt/blob/master/binfmt-test/binfmt/basic-test.rkt https://github.com/Bogdanp/racket-binfmt/blob/master/binfmt-... I agree that startup time is not a winning aspect of Racket. My naive understanding is because Racket is not a direct bytecode interpreter like CPython, but actually has to run a compile step to native code, and doing that for programs + their required libraries necessarily takes at least a couple of hundred milliseconds even before anything can start running, while CPython can pretty much start executing from the get go.
- jes 3y agoI'd like to play around a bit with Racket. I have been using Slime with Common Lisp for years. From what I'm reading, it sounds like Geiser[1] might be a Slime-alike package for Emacs. Thoughts or advice? [1] https://www.nongnu.org/geiser/ https://www.nongnu.org/geiser/
- _emacsomancer_ 3y agoThere's Racket Mode[1] for Emacs, which is very nice. [1]: https://www.racket-mode.com/ https://www.racket-mode.com/
- jes 3y agoThanks for the heads up! Looks great, will take it for a spin.
- singularity2001 3y agoThey call #hash[(a . b)] modern? Maps should be a first class citizen with first class syntax and not ... that.
- tgbugs 3y agoI've been using Racket for about 8 years now, and it is now my goto language for anything that needs a gui. It took writing 3 or 4 not-so-little guis to feel comfortable working with Racket's object system, but now it basically goes at the speed of thought. Lately I've been using Racket to prototype the interaction design for a game, and I had written some placeholder text. I had put fake interpolation in for {player-name} and things like that, and then I realized that #lang at-exp would let me just ... do that, as described in the original article. I had to laugh, because I maintain a bunch of Python code, and if Python has batteries included, Racket comes with a retrofittable fusion battery pack. One other little anecdote, is that I've been porting an old plt-scheme codebase to Racket CS. In the second phase I have started replacing an ancient C++ rendering layer with the racket gui canvas functionality. During the process I moved hundreds of runtime type checks in the C/C++ layer to the Racket contract system. It was as if the Racket team had somehow secretly obtained access to the codebase I was working on and had designed the perfect abstractions to solve the problem.
- avindroth 3y agoI have been mostly using clojurescript for prototyping, any pointers on how to get started with Racket?
- tgbugs 3y agoLooks like you're already in Emacs. I strongly recommend racket-mode as mentioned in another thread. With regard to prototyping GUI's I'd suggest taking a look at https://github.com/mfelleisen/7GUI https://github.com/mfelleisen/7GUI. https://github.com/Bogdanp/racket-gui-easy https://github.com/Bogdanp/racket-gui-easy could also be a good place to start. With regard to Racket more generally, I'm probably not the best person to ask since I had a very high friction start where I just banged my head against the wall until things made sense.
- jacknews 3y agoIs it any good for actual games though? I have one kid using scratch now, and one older graduated to godot, roblox/lua, some javascript/web. I would love to get them into lisp (already done a bit of Janet along with me), but it really needs to be something they can write their game ideas in, and share/show-off to friends.
- patrec 3y ago> Racket is probably the finest example of a modern day lisp bar none It's not. There are several nice and unique things about Racket, but it's a pretty poor example of a lisp, to the extent that if you want to understand what's good about lisp you'd probably be better off learning emacs lisp than racket.
- clircle 3y agogo on...
- patrec 3y agoLisps have traditionally been optimized for very smart people solving cutting-edge problems (both in academia and industry) that benefited PL innovation in an interactive, fully malleable and explorable environment. People like Chaitin, Baker, Gosper, LeCun, Minsky, Norvig, Sussman etc. This community has essentially vanished and a large part of the vacuum has been filled up by people who seem to derive their feelings of self-worth by association to past greatness rather than personal accomplishments. But some of the spirit lives on in Julia (which has a much better claim to being the foremost modern lisp), and some cool stuff and people have been "grandfathered in" and continue to do use lisp for fairly sophisticated stuff (a backend example would be google flights/ITA and a end-user app example would be opus modus). Racket is, in my probably slightly biased opinion, a vehicle for doing firmly within-the-box CS research and teaching. It comes with a lot of batteries included and there are some cool an innovative things about it (it has sophisticated support for syntactic abstractions with acceptable error reporting, contracts, non-textual data etc). It's run by people with very respectable academic output, but to the best of my knowledge none of them are particularly appreciative of interactive and malleable computing (even python is much better here), or ever wrote any code that's reallly pushing the state-of-the-art. I'd also say that the racket IDE (despite also having some nice features) is ugly, clunky, sluggish and not something that I can see appealing to very good programmers. I'm also not aware of any impressive industry project done in Racket (although, in fairness I should add that Carmack has said nice things about racket).
- 3y ago