7 ms·
Considering Lisp was here first, shouldn't the real question be "why use Rust/C++/Python when there's Lisp?" You can't even create a real closure in Rust. I'd
by jlarocco 4y ago
Considering Lisp was here first, shouldn't the real question be "why use Rust/C++/Python when there's Lisp?" You can't even create a real closure in Rust.
I'd love to see 10 lines of Rust that showed me something that:
1. I can't easily do in Lisp.
2. Actually matters in practice.
- jahewson 4y agoThis a trick question because 10 line programs are trivial. Please show me a high performance hardware-accelerated 3D game engine written in lisp. Or a web browser.
- vzaliva 4y agoHow about IDE with base codebase of 1.5M loc and tons of 3rd part packages? (emacs)? Most modern programming is not about performance, it is about managing complexity.
- deleted 4y ago[deleted]
- japanuspus 4y agoEmacs? [0]: https://www.gnu.org/software/emacs/manual/html_mono/eww.html https://www.gnu.org/software/emacs/manual/html_mono/eww.html
- merlincorey 4y agoLisp has a rich history in games and graphics that you are not apparently aware of yet -- here's a few mostly Common Lisp Game Engines and resources to get you started (though GOAL was a Scheme variant): 1. https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp 2. https://elliottslaughter.com/2011/06/blackthorn-3d https://elliottslaughter.com/2011/06/blackthorn-3d - Last updated in 2020 https://bitbucket.org/elliottslaughter/blackthorn-engine-3d/src/master/ 3. https://github.com/gregcman/sucle https://github.com/gregcman/sucle 4. https://github.com/BradWBeer/clinch https://github.com/BradWBeer/clinch 5. https://github.com/Shirakumo/trial https://github.com/Shirakumo/trial - This has games released on Steam built in it 6. https://www.cliki.net/game https://www.cliki.net/game 7. https://github.com/lispgames/lispgames.github.io/wiki https://github.com/lispgames/lispgames.github.io/wiki
- medo-bear 4y ago> Or a web browser https://nyxt.atlas.engineer/ https://nyxt.atlas.engineer/
- abdulhaq 4y agothis uses a C++ rendering engine
- medo-bear 4y agoso what ? the parent asked for a web browser. nyxt is rendering-engine agnostic by design otoh how much rust is there in firefox? a: https://4e6.github.io/firefox-lang-stats/ https://4e6.github.io/firefox-lang-stats/
- abdulhaq 4y agothe hard part about a web browser is the rendering engine, which is why it was raised as a challenge. Sticking a Lisp front end over an existing rendering engine doesn't answer the challenge.
- medo-bear 4y agothen he didnt ask the right question. nyxt is a browser in every sense of the word. anyway there is no reason lisp cant be used for making a good rendering engine
- jlarocco 4y agoHere's a browser written in pure Common Lisp: https://closure.common-lisp.dev/ https://closure.common-lisp.dev/ These questions are so silly. Nobody's written a web-browser in Rust, Python, Ruby, Java, Clojure, Haskell, Erlang, Typescript, Javascript, etc. but that hasn't stopped anybody from using them. Just admit you don't want to learn Lisp.
- bitwize 4y ago
- tmtvl 4y agoThis a trick question because 10 line programs are trivial. I mean, OP asked for a 10 line program showing something that can't be done easily in Rust and actually matters, so he seems to believe 10 line programs aren't trivial. That said line counts are an awful metric because I could just cram an entire library definition in a single line as if it were minified JS.
- mejutoco 4y agoJak and Daxter and Crash Bandicoot (not sure how much of The last of us) are good examples in lisp. There are a lot of video interviews with the creators. I found them extremely interesting. https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp https://www.reddit.com/r/lisp/comments/fayhw2/how_crash_bandicoot_hacked_the_original/ https://www.reddit.com/r/lisp/comments/fayhw2/how_crash_band...
- lispm 4y agoor a CAD program... https://www.ptc.com/en/products/creo/elements-direct https://www.ptc.com/en/products/creo/elements-direct that's C + several million lines of Lisp
- Jach 4y ago(Tongue-in-cheek) #![allow(arithmetic_overflow)] fn main() { let x = 1073741823; println!("x = {}", x*3); } # cargo build && cargo run thread 'main' panicked at 'attempt to multiply with overflow', src/main.rs:4:24 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace To be fair, Rust is improving over time, as of I think last year you now have to explicitly have that first line to allow the overflow? This behavior is somewhat annoying to replicate in Lisp if you aren't familiar with type declarations and suppressing the debugger: (defun main () (let ((x 1073741823)) (declare (type (signed-byte 32) x)) (format t "x = ~a~%" (the (signed-byte 32) (* x 32))))) (handler-case (main) (simple-type-error (e) (format *error-output* "Panicking because of ~a~%" e) (uiop:quit 1))) # sbcl --script main.lisp ; file: /tmp/main.lisp ; in: DEFUN MAIN ; (THE (SIGNED-BYTE 32) (* X 32)) ; ; caught WARNING: ; Derived type of (* COMMON-LISP-USER::X 32) is ; (VALUES (INTEGER 34359738336 34359738336) &OPTIONAL), ; conflicting with its asserted type ; (SIGNED-BYTE 32). ; See also: ; The SBCL Manual, Node "Handling of Types" ; ; compilation unit finished ; caught 1 WARNING condition Panicking because of Value of (* X 32) in (THE (SIGNED-BYTE 32) (* X 32)) is 34359738336, not a (SIGNED-BYTE 32). A bit more work and you could muffle the compilation time warning too. As for how important this is, I'unno, personally I prefer to have my math Just Work by default -- (expt (expt 2 64) 64) or #I((2^^64)^^64) -- and I like by default being given the chance to fix things and continue/restart via the debugger rather than panic.