9 ms·
Better question: why not Lisp?
by firebaze 5y ago
Better question: why not Lisp?
- deleted 5y ago[deleted]
- Scarbutt 5y agohttps://groups.google.com/g/comp.lang.lisp/c/L5dZ-j6Id-s/m/9tOJorXPdW8J?pli=1 https://groups.google.com/g/comp.lang.lisp/c/L5dZ-j6Id-s/m/9...
- codr7 5y agoPerformance: Getting Lisp to run as fast as C takes major effort when at all possible. Resources: Lisp needs a lot of space to do it's thing; and while it's certainly possible to downsize it, you're left with something that's not really Lisp anymore. Ecosystem: Finding solid libraries is tricky since it's not very popular professionally. Power: Unleashing the full power of Lisp in a diverse team is a recipe for an adventure, if not disaster.
- agumonkey 5y agoIf performance was such a problem python wouldn't have a subreddit. I think a lot of lispers like handling various paradigms in their head and start with basic lisp, and resort to edsl to reach more appropriate semantics/mechanical sympathy. Just like people call out to C wrappers mostly. The social side of lisp I can't say for sure but I'm sure it's fuzzier than it seems. I've just talked to a dude saying his new guy was a clojurist and his thinking is way finer than the current team.
- igouy 5y agoAnd yet there always seems to be another discussion about how to re-implement CPython so that programs run faster.
- bjoli 5y agohehe. i remember a thing posted about python-on-guile, a rather ambitious project implementing python by compiling it to guile sheme. The scheme code it produces is pretty awful. Not because it is bad, but because python is extremely unidiomatic scheme, and if you want to keep python semantics thay is where you have to go. And despite being a one man job, despite being run on a far-from-the-fastest scheme, despite giving the optimizer any chance to do the regular optimizations it was about 1.5x times faster than cpython. It was in numerical code, so beating cpython is maybe not very hard. I found it funny nontheless.
- Mikeb85 5y ago> Getting Lisp to run as fast as C takes major effort when at all possible. But Lisp is faster than almost every widely used language that's not C/C++/Rust, around Java speed. > Lisp needs a lot of space to do it's thing; and while it's certainly possible to downsize it, you're left with something that's not really Lisp anymore Dunno, by modern standards it seems pretty small. > Finding solid libraries is tricky since it's not very popular professionally. Ish. Because it's so mature, lots of code works even it it's not updated constantly. There's code out there for most use cases, at least for back-end-y things. > Unleashing the full power of Lisp in a diverse team is a recipe for an adventure, if not disaster So enforce coding standards. This isn't a negative and lots of us work alone or in small teams. Honestly, the only reason I don't mainly use Lisp is because I use an even slower/easier language because I don't really need a performant language. But if I find a problem where I want more performance Lisp is probably the next stop.
- Zababa 5y ago> There's code out there for most use cases, at least for back-end-y things. I'm not sure about that. These days in the backend you need a lot of libraries for cloud providers and new databases/services. For example, is there a Common Lisp library for AWS/Azure/Google cloud? Is there one for Clickhouse?
- Mikeb85 5y agoI've come across Common Lisp SDKs for AWS, there's Heroku build packs, there's Kubernetes clients listed on Kubernetes' website, etc... Clickhouse doesn't have an official CL client but they have a CLI, TCP and HTML interfaces, C++ interface, etc... all listed on their website. It's not that hard to connect to an API without a library. But yes, there's more Java/Python/Go/Ruby/JS stuff pre-built than Common Lisp. But you'll also find more CL stuff out there than almost any esoteric language, probably because it's easy to build stuff in CL.
- tincholio 5y agoRelated to this, there's an AWS SDK for Clojure [0] (created by the same people who are behind Clojure), which is generated from the AWS specs themselves. Carmine, a popular Clojure library for Redis does something very similar. There's also a library for generating SDKs from Swagger specs [2]. I implemented a similar solution (generating Python bindings for some of our APIs from Postman exports), and it was super simple, really. I suspect doing the same in CL would be similarly simple. [0] https://github.com/cognitect-labs/aws-api https://github.com/cognitect-labs/aws-api [1] https://github.com/ptaoussanis/carmine https://github.com/ptaoussanis/carmine [2] https://github.com/oliyh/martian https://github.com/oliyh/martian
- throw10920 5y ago> Getting Lisp to run as fast as C takes major effort when at all possible. The Computer Language Benchmarks Game shows Lisp Code as generally being between 2x and 10x slower than C++[1]. As fast as C? No. Way faster than Python, and more than fast enough to be used in almost every single application, modulo hard-real-time systems and AAA video games? Yes. > Lisp needs a lot of space to do it's thing; and while it's certainly possible to downsize it, you're left with something that's not really Lisp anymore. Again, while a 13MB SBCL image might be significantly larger than a 100KB C program, given that that's the entire compiler and runtime bundled in, and the size of additional code scales also like C/C++, that still makes it viable for almost every kind of program (and still an order of magnitude smaller than Electron). Same deal with memory usage. > Finding solid libraries is tricky since it's not very popular professionally. This one is so true it's not even funny. (although there are C, C++, and Python FFI's that cover most of the stuff that you want, although that's kind of cheating) > Unleashing the full power of Lisp in a diverse team is a recipe for an adventure, if not disaster. The list of companies using Clojure[2], in addition to the commonly-cited Viaweb/Orbitz/Grammarly, beg to differ. Anecdotally, most Lisps have less footguns than C++ - if people can figure out how to use Stroustrup's monster in massive video games, Lisp is easy. [1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/sbcl-gpp.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... [2] https://clojure.org/community/companies https://clojure.org/community/companies
- mbil 5y ago> Finding solid libraries is tricky since it's not very popular professionally. If we're considering Clojure, then I would argue this point isn't true. Java interoperability in Clojure is really well supported and easy to accomplish, so leaning on the massive Java library ecosystem is possible. Also, anecdotally, a lot of Clojure libraries appear to be defunct, but just actually haven't been updated in so long because of the strong backward compatibility across Clojure versions.
- codr7 5y agoWell, if we're going to venture that far into excuse land Common Lisp has access to every C library in the world through CFFI. Look, I love Lisp, but reality isn't going anywhere.
- hajile 5y agoSBCL is already about as fast as Java and can get most of that speed without very much time optimizing everything. Java has hundreds (thousands?) of developers working on it. SBCL has a handful of part-time devs. What could SBCL become with all those man-years behind it? Custom syntax is hardly the big issue when using Common Lisp. I'll take that any day over the dozens of layers of useless abstraction in Java projects. I'll take it over the C code golf or "what does this undefined behavior do?". I'd even take it over the piles of garbage JavaScript I've waded through over the years.
- igouy 5y ago> What could SBCL become with all those man-years behind it? Whatever stopped that happening in the past, still stops that happening, and will continue to stop that happening in the future.
- leishulang 5y agono popularity, no money.
- 1_player 5y agoCan I be extremely shallow? Because the language feels like it's from the 60s. Like writing Fortran or Ada or Algol in 2021. C is timeless, it doesn't count. I love lisps, but Racket, for example, feels more modern than Common Lisp to me. And for shallow people like me, feel and ergonomics are very important when writing code.
- kevin_thibedeau 5y agoIt's an IR for a never completed language.
- spicybright 5y agoCould you elaborate a few specific points on this? Curious because I'm on the same boat. I was annoyed for a while how ruby convention uses '?' characters at the end of method names that return a boolean. I'm not even that old and I still want to yell `[a-zA-Z0-9_]+` identifier names or get off my lawn.
- Jtsummers 5y agoWhy would you want to limit yourself so drastically in what you can express with function and variable names?
- Zababa 5y agoI don't think this is drastically limiting, it's a sane subset that gets you 99% of what you need from a function name.
- Jtsummers 5y agoWe use punctuation and symbols in typography and writing to provide clarity. Why not use it in our programs?
- Zababa 5y agoPrograms? Aren't we talking about variable and function names? But for the general case, Lisp does use puncuation and symbols. It just tends to use less. The other side of the balance is operators like ~+#>. Most languages are in the middle ground. All of these options are fine and have their uses. I wouldn't like to see stuff like ~+#> every day, but I like being able to implement <.
- jim-jim-jim 5y agoI cut my teeth on Lisp, but I've found that happiness comes from compile time guarantees. Maybe those two things aren't mutually exclusive, but a thoroughly robust type system seems like a big ask in such a dynamic language. None of the solutions I've encountered have satisfied me, but in fairness I haven't looked that hard.
- spicybright 5y agoI have 0 experience here but that's really surprising to me. I'd think out of any language lisp would shine here. You could write as complex of a type system as you wanted that compile time checks, so it's surprising someone hasn't written one that mimics at least java/c++/whatever style types. I do think that is one of the down sides to lisp though. When you can do almost anything it's very hard to agree on what to actually do.
- Jtsummers 5y agoShen is an example of that. In its original form, Qi, it was written for Common Lisp and later written for other languages. http://shenlanguage.org/ http://shenlanguage.org/
- hajile 5y agoWow, I'm glad that they opened up the documentation. I liked what I saw a few years ago, but I'm not getting behind a language where all the usable docs are proprietary.
- Zababa 5y ago> You could write as complex of a type system as you wanted that compile time checks, so it's surprising someone hasn't written one that mimics at least java/c++/whatever style types. There's at least typed racket. > I have 0 experience here but that's really surprising to me. > I'd think out of any language lisp would shine here. I don't think you should be surprised that people don't want to write their typecheckers as macros. A few people might want to do that, but most people don't. And at this point you're not far from just creating a new language, that you could create in ML or a descendant, which have always been one of the most popular options for that.