Ask HN: Anarki or Racket?
For a new web-baed project, one I'm doing for fun but hope to make a success, I've pretty much decided to write it in Racket or Anarki.
Which one?
The problem domain is Lisp-y: convenient for functional programming, and made easier with macros, DSLs and/or metaprogramming.
I haven't used a proper Lisp since my programming paradigms course at Bryn Mawr many moons ago, so I don't have any strong preferences yet.
Obviously either will do the job, and Anarki is built on top of Racket.
Still, what are the pros and cons (pun intended) of each? As someone who's used Anarki, and contributed to it (for better or worse,) between the two I'd have to recommend just using Racket. All of the web stuff in Anarki just calls Racket libraries sooner or later, and Racket has better facilities for HTML and other language generation. Anarki (IMHO) is really only good if you want a HN clone without changing much, or if you want to experiment, because it's still rough around the edges in places, documentation is spotty, and error handling is still a disaster. Thanks, that’s a very helpful insight. You’ve put my mind a significant ease. I'm not sure what part of your project is web-based and what you mean by "web-based". Do you mean executing Lisp/Scheme code on the browser side or the server side? In any case you should consider Gambit Scheme that has a complete JavaScript backend. For example check out the https://try.gambitscheme.org site to see the online REPL in action. In my case, web-based just means "it is a piece of software you access via the web." Web application, website, SAAS, whatever. And you're right, I should have considered Gambit. Dang, now I have a ternary decision to make. The FFI with JavaScript is nice. Have a look at this paper, in particular the examples that can be copy-pasted to https://try.gambitscheme.org: https://www-labs.iro.umontreal.ca/~feeley/papers/BelangerFee... While I’ve got you… What’s the state-of-the-art story for package management in Gambit? Gambit supports the R7RS module system and has a decentralized module system that can automatically download libraries from git repositories. Take a look at the "Libraries" section of the online REPL's tutorial for a few examples, or just type at the REPL: https://www.iro.umontreal.ca/~feeley/papers/HamelFeeleyELS20... I've tried both. While I enjoyed the setup with Anarki better (in particular using the repl to make live inspections and changes), Racket is vastly more supported by docs and the community. So if you are a CS pro and don't mind figuring out everything for yourself then Anarki is plausible, otherwise it's kinda crazy to go that way. Just to be clear: yes, there are other Lisps. Yes, Clojure is cool. Yes, LFE is a thing that exists. Yes Elixir is Lisp-adjacent. Yes, any of those would give me access to a larger ecosystem and the resources of a well used, well supported VM. I may be an idiot (it's been said), but I'm not a stupid idiot. I've ruled each of those out for good-ish reasons. > I've ruled each of those out for good-ish reasons. And what would those reasons be? LFE lacks it’s own robust web app development stack … and translating between documentation in Elixir (Phoenix) and Lisp all day will make my head hurt. Clojure is a tougher call. For this project it might be good. However, I want to include some CLI scripts … and the JVM adds deployment complexity for those. ClojureScript is tempting, but I don’t see a great story about the server piece for rapid web app development there. Do you want scripts as in "i want text files run by an interpreter" or "i can package my scripts as single executables"? In Clojure land Babashka and Graal native image can do those respectively. Text run by an interpreter. Different strokes. Any reason why Common Lisp is not considered? It’s not in my mix because it’s a fairly “big” language, which is a huge bonus once you’re proficient but makes it a poor choice for me to dive into Lisp(s). For someone else, that might not be true. But I like to be able to hold things in my head. In the long run, CL is a great option. My theory is that it’s a place I could go if/when I’m up and running in another Lisp. FWIW the source of both racket-stories.com as well as mini versions are available.
This paper might be helpful if you want to know why it was designed that way: > (module-whitelist-add! '(github.com/feeley))
> (import (github.com/feeley/roman demo))
If you are looking for a framework, then check out Koyo. https://racket-stories.com/about