Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
jonas-w4264111dThank you very much.
What i still don't understand:
Lisp is not like c, c++ or something like that right?
Maybe this sounds fucking stupid:
How does this compile to an executable?
Like c, c++ have their compilers that do that stuff.
Has common lisp also a compiler that does it or is common lisp only how code is written and then later you choose how you want to compile it and then for example use clojure?
Please don't kill me my brain just can't handle all that information.
Like if i want to learn c. I learn how to code is written and then use that magic compiler and bam an executable.
But after reading some stuff for lisp and so on, there wasn't a clear answer.
Sorry I think i'm a bit lost lol
@jonas-w you're good man! Lisp is strange, but not so much if you compare it with certain other things.
1. Can Lisp be compiled into an executable? yes, most modern common lisp compilers (as a starting point I recommend SBCL) have a way to compile your entire project into an executable, supported in a lot of architectures (at least the top 4 ones) Is this common? depends on the project.
So what is the way? Lisp had a REPL similar to Python, Ruby, JS etc before it was a thing really.
Projects are generated and either evaluated by the interpreter/compiler such as SBCL or interacted with through the REPL as it is hooked to the files in question.
To try something easy, you can put this into a file.
(format T "Well, hello there!~%")
save it as hello.lisp, and with sbcl installed you can run it a-la-python by typing in the terminal (inside of the directory in which you have the file of course)
$ sbcl --script hello.lisp
2. Clojure and Common Lisp have different targets. Lisp is a family of language dialects. So while Clojure shares some similar attributes to Common Lisp, something like the SBCL Common Lisp compiler will not work with Clojure code, these have different language schematics and targets.
Technically speaking, you can open up a folder with lisp code in VS code, write your code, and then use sbcl with the --script flag to run your code without much fuss. The thing is, by going that route you sort of lose the benefit of the live interactive environment that exists within Emacs.
As I mentioned before, emacs is pretty much the biggest hurdle when starting with Lisp, and while it is not strictly necessary it does help a lot more when developing larger projects since you can type some code, evaluate it with the emacs chord C-c-C-c and experiment with the code on the repl. Do not worry too much about this though, if you want to type away in VS Code goforit
@jonas-w Fair warning though, much like one needs to learn multiple things in other languages (maven and builds in Java, makefiles for large projects and header files in C/C++, etc etc) one might need time adjusting to the tooling in Common Lisp, or most Lisp variants to be completely honest.
Expect to be frustrated for a bit. Also, if the example for the book that I posted proves a bit too annoying at the beginning, there is a different version of the book (you can find it in the index of the page) which targets Emacs Lisp, the Lisp dialect that lives within the Emacs text editor. Do not feel scared from trying that one out if you wish, all you need for that one is Emacs itself (Emacs Lisp does not compile, it is just interpreted by the Emacs engine itself, it is a language that lives just inside of Emacs)
homomorphicanus244111dBased and Lisp pilled
fruitfcker937111dSo sorry. I stopped reading after "emacs".
@jonas-w I would never man, I am not the kind of person (or dev for that matter) that would just crap on people for trying to learn something new or asking questions :D
If you got any additional questions or want more pointers then let me know. Lisp is pretty cool and there are lots of cool things to learn about it out there.