just started reading pic related
are there any uses for LISP other than configuring emacs? does it excel at anything in modern times?
>>62022897
yes(define (even n)
(if (= (modulo n 2) 0)
#t
#f))
(define (!= x y)
(not (= x y)))
(define (X-main pos row num low max)
(if (!= row (+ num 1))
(begin
(if (or (= low pos)
(= max pos))
(begin
(display "")
(display "1")
(display ""))
(display "0"))
(if (= num pos)
(begin
(display "\n")
(X-main 0 (+ row 1) num (+ low 1) (- max 1)))
(X-main (+ pos 1) row num low max)))))
(define (X n)
(if (not (even n))
(begin (display "0")
(X-main 1
1
n
1
n))))
>>62024216
So yes if have nothing to do but shitpost on /g/
>>62022897
That's a Scheme book though
On a side-note Lisp will make you a better programmer, even if you never end up using Lisp
>>62024216
Is the only way to do loops recursion? If so, how do you prevent stack overflows?
>>62022897
Yes, the functional paradigm is essential in becoming a well-rounded programmer. Also languages in general are shifting towards a functional approach, so a familiarity will help you pick up new things that come out.
Also you will learn the sense of smug superiority that programming in a functional language brings.
>>62024323
In Scheme, yes. I think Common Lisp has loops built in. At any rate so long as the language is tail recursive, you won't run into overflows.
https://en.wikipedia.org/wiki/Tail_call
>>62024323
tail call optimization
>>62024334
So you jmp to the start and let the function ret only once since it would only execute a shit-ton of rets aftereards anyways? And if you call another function that needs a larger/smaller stack frame you destroy you frame first? That's pretty neat
>>62022897
SICP gives you an education in computer science. If you just want to learn Lisp, read pic related and do the exercises. It will be much quicker and easier, and Common Lisp is a far more practical language. Scheme doesn't even have exceptions.
>>62024847
Also, don't learn Emacs and Lisp at the same time.
>>62024847
>Scheme doesn't even have exceptions.
https://srfi.schemers.org/srfi-34/srfi-34.html
>>62022897
professional Lisp programmer AMA
>>62024941
What do you work on?
>>62022897
Learn lisp, use haskell.
>>62024966
publications drafting software, content management systems, live event systems, and hardware stuff
>>62024941
How do i start? What do you think about >>62024847
Lisp and regular scripting languages are converging. Classic Lisps like Common Lisp and Scheme are stuck on the obsolete implementation concept of the cons cell. A modern Lisp would be something like Clojure which is implemented in immutable data structures and gives the programmer an open interface to the generic sequence container type and so gives a more unified interface between lists, maps, arrays, etc. Scripting languages like Julia and Ruby give a lot of metaprogramming features which is not quite equal to what Lisp can do with homiconic syntax but is moving in that direction.
>>62024847
>Scheme doesn't even have exceptions.
Fake (or old) news. Since R6RS Scheme has exceptions.
>>62024997
learning emacs is a good introduction, even though the learning curve is high, customize it to where you feel more comfortable with it as an IDE
I would probably agree with learning a more practical approach to Lisp before approaching SICP, but SICP is a must read
another good book is "Practical Common Lisp: By Peter Seibel", there's a free version online
http://www.gigamonkeys.com/book/
>>62025059
implementing immutable data in Common Lisp or Scheme is trivial, the Clojure dev enviornment and library support is generally terrible
>>62024264
>le scheme isn't lisp meme
>>62025098
>Clojure ... library support is generally terrible
Compared to what? I hardly love Clojure, but the selection and maturity of libraries for it is no worse than for CL, and certainly better than Scheme's.
>dev enviornment
That is the real problem with Clojure. The Java stack traces are just pathetic compared to what CL gives you.
>>62025098
>implementing immutable data in Common Lisp or Scheme is trivial
>I am 5 years old, I can make an immutable data structure in Scheme, therefore I win the argument even though I dont know shit about what an implementation actually is
>the Clojure dev enviornment and library support is generally terrible
No, it uses Java environment, its generally awesome, at least for people who actually have a programming job and not sit in their basement and dish out Lisp hype on the internet
>>62025172
>but the selection and maturity of libraries for it is no worse than for CL
Common Lisp has some of the most robust libraries of any language, some of them have been maintained since the 1970s. It is hard to find them all in one place, but clones on github, lisp dedicated forums/subreddits etc are a good place to look for them. MIT CS Alumni who graduated from the 1970s-1990s have treasure hoards of great libraries and technical papers.
>>62025174
>basing your language decisions on being a wagecuck
you're right about getting to sit in my basement all day, but I'm a freelance dev :^)
>>62025282
Can you give some examples of interesting CL libraries that aren't on GitHub or Quicklisp? I am genuinely curious.
>>62025326
https://common-lisp.net/project/mcclim/excite.html
I want to buy LispWorks sometime, all of the heavy duty Lisp engineers swear by it
https://en.wikipedia.org/wiki/LispWorks
all of the Symbolics stuff is proprietary but I've found papers on it on lainchan pre-kalyxgate
http://www.symbolics-dks.com/Macsyma-1.htm
I have a book called "Parallel Distributed Processing" about neural networks and distributed algorithms with similar references and some Lisp code in the appendix, likewise with the book the Expert Systems book I posted as a pic earlier in the thread which was authored by the lead engineer of a company that made lisp machines for the military and aerospace
add fellow CL users on github and you should find everything contemporary that you need for stuff like web development
Just configure your entire system in Scheme. You'll become a master in no time.
>>62025411
when is this going get kernelland binds and we get a GNU Lisp Machine?
>>62025098
>learning emacs is a good introduction
i was planning to dothat anyway, thanks
>>62025406
Do you have a PDF of the expert systems book? I've been meaning to read something about expert systems.
>>62025467
sorry its an actual copy (found it for $5 in a used book store of all places)
>>62025486
Too bad. Thanks anyway.
>>62025059
underrated post
>>62025424
OMFG this needs to happen
>>62025424
Never have I wanted something so badly and never realized it.
>>62024216
>)))))
Why is lisp so good for AI
As someone who does a lot of networking and systems programming, would lisp even be useful to me
>>62022897
Fuck yes, it is really worth it. It's very well written and gives you a great introduction to many problems.
Just take a few hours and work through the first chapters and you'll see:
>https://sarabander.github.io/sicp/
Protip:
Before (or along) SICP there are two ressources, that might be helpful.
1) You can work along SICP with "The little Schemer". It's all about the actual Scheme syntax, but it's much softer than SICP and very well written.
2) Understand the Lambda Calculus.
>https://en.wikipedia.org/wiki/Lambda_calculus
>http://palmstroem.blogspot.de/2012/05/lambda-calculus-for-absolute-dummies.html
The lambda claculus is one of the two fundamental modells of computing. (The other one being the turing machine).
LISP is modelled pretty close arround the Lambda Calculus (as other languages like Haskell are).
It sounds very scary at the beginning , but it's really simple once you got it. Took me one day to understand it, and I'm not THAT smart...
Also it's cool if you look at Scheme/LISP and think "Whoa, it's just a siple Beta reduction here, no big deal.."
And wait untill you see an Omega-Combinator or the end boss, the Y-Combinator.. :)
SICP has been one of the best experiences of my life and is an absolute must read. You will have plenty of small enlightings about the nature of data structures, objects, state, and waht not.
Have fun and git gud.
>>62029114
wrong page idiot
https://mitpress.mit.edu/sicp/
>>62024216
I came tbqh
>>62022897
it's Lisp, not LISP.
lisp is and always will be the official programming language of /g/ (this subreddit was all about lisp between 2008-2012, until normies took over). it's also the only programming language that has been approved by Richard M. Stallman (PhD). lisp being a programmable programming language, you will never need anything else. you can call yourself a programmer only if you are a lisper too.
>>62022897
Yes it is, specially if you're a /pol/ user.
>>62028957
>Why is lisp so good for AI
https://ai.stackexchange.com/questions/2236/why-is-lisp-such-a-good-language-for-ai
>As someone who does a lot of networking and systems programming, would lisp even be useful to me
Maybe. What languages do you program in?
>>62029160
1) The other ressource look better.
2) Go fuck yourself with a cactus.
>>62029204
1) LISP is the historical term. I prefer callign it LISP. Deal with it.
2) The "official" language of /g/ is either C or Haskell (just look at a normal /dpt/ thread).
3) I really love Scheme, but RMS is not a very pleasant person. I like some of the thoughts in "free software, free society", but he got so many things wrong and got bitter, intolerant and arrogant over the years. He thinks he knows it all when he really doesn't undersatnd.
4) Vim > Emacs
5) Clojure > Scheme > Racket
>>62029114
>much softer than SICP
But the sequels get pretty serious.
>>62029311
>caring about looks
>>>/fa/
>>>/v/
>>62029114
>>62029311
anon... easy on the terpris
>>62029204
>you will never need anything else
Wait until you discover type systems. You'll be torn between Lisp and ML forever.
>>62029311
>Scheme > Racket
Why?
>>62029311
>Clojure > Scheme > Racket
do you even know what clojure is?
>>62029311
>5) Clojure > Scheme > Racket
>Clojure
>Lisp
Pick one
>>62029416
>Scheme
>Lisp
>>62029431
scheme still has pair and list has the main data structures.
>>62029399
I'm not him but the fold-left function in Racket is completely wrong.
The one defined in SICP, the one in Haskell or the one built-in in new versions of scheme (R6RS) all work like this:(fold-left f 0 '(1 2 3 4))
gets expanded to(f (f (f (f 0 1) 2) 3) 4)
In Racket(foldl f 0 '(1 2 3 4))
becomes(f 4 (f 3 (f 2 (f 1 0))))
>>62022897
yes, you can use clojure and do web development
>>62029470
No everyone agrees that this is enough.
http://wiki.c2.com/?IsSchemeLisp
>>62029474
what's the difference?
>>62029474
>>62029608
Yeah, why is it so bad? Seems about equal to me.
>>62029608
>>62029621
Not him, but I guess he means that in the "Haskell and SICP version" you have a certain start value (say "0") and then apply each operation f on the result of the previous operation f. It works like the first argument was an accumulator, so to say.
>>62029204
/g/ has always been diversified on favorite programming langues..../prog/ though prefers lisp but its mainly a meme board with some C larpers (FrozenVoid, Cutter)
>>62029958
and how that's different from the racket version?
>>62029300
>What languages do you program in?
Mostly C and C++. For scripts, either Python or bash, though I've been learning Perl lately.
I know x86 but I rarely use it.
>>62022897
well, you can use it as a (((web))) language and write shitty websites in it.
>>62029988
The "accumulator" is always the second argument here..
Maybe it's mroe clear when you think about this:(- 4 3 2 1)
The operator always takes the current result as first argument, therefore (- 4 3 2 1) = (- (- (- 4 3) 2) 1).
>>62030191
>The "accumulator" is always the second argument here..
and?
No you dumb motherfuckers. it is a meme language now used by shitty hipsters to seem relevant. At least C is used in embedded systems and as core for many software, lisp is merely a tool to measure your dick just like some anon in this thread did with his "beautiful LISP code". LISP is literally ((((LISP)))). Get a clue.
>>62030434
lisp has been embedded into satellites that are still in use. you know nothing.
>>62029621
Try foldl'ing a subtraction across that collection and see which one gives you the result you expect. Hint: It isn't the racket version.
>>62030979
So, this is why Racket is shit?
>>62031059
Nobody said that Racket is shit.
>>62031169
Ah nevermind. But to me, this alone is not enough of a reason to claim that Scheme > Racket.
What's a good learning resource for emacs? Any good books or anything?
>>62031360
use built in tutorial
>>62030434
>a meme language now used by shitty hipsters
>taught at MIT as entry level course from 1980 - 2008
Nice b8, m8.
>>62031205
The guy who is annoyed by the fold left isn't even the one who said that Scheme is better..
>>62032640
>2008
So, almost 10 years ago ? Thanks for proving my point hipster pajeet might as well dress up for the antifa rally
>>62029474
https://stackoverflow.com/questions/8778492/why-is-foldl-defined-in-a-strange-way-in-racket
>>62030108
Open source Lisp implementations like SBCL and Racket have the advantage of being more expressive than Python, bash, or Perl, but also much faster. One potential advantage for you is that you could replace both your Python/bash/Perl scripts and your some of your C and C++ programs (daemons that talk over sockets) with shorter code in a single language. Check out https://docs.racket-lang.org/net/index.html. Another, which is not contingent on you actually switching to another language for work, is that learning CLOS will leave you a better object oriented programmer.
>>62035064
>SBCL and Racket
What about Scheme?
>>62035637
CHICKEN Scheme can compete with Racket in terms of third-party libraries, but it lacks Racket's huge built-in standard library, contracts, static typing, etc. Since Racket as a language is almost a Scheme and the Racket platform includes Scheme implementations, I'd suggest going with Racket unless you were trying achieve a specific goal for which some Scheme is better. (This goal could be to maximize your raw performance (Stalin, Chez), embedding (Chibi) or interoperablity with C code (CHICKEN).)
>>62036089
Not the same guy but is SICP worth it since it uses Scheme?
Scheme, CL and Racket are all LISPs so I guess it's quite easy to go from one to another?
>>62036149
>Not the same guy but is SICP worth it since it uses Scheme?
Sure. You skills gains with SICP will translate to a bunch of other languages, not just Lisps.
>>62036169
I see. I actually own a physical copy of SICP as well as Land of Lisp, is the latter decent for learning CL?
>>62024216
>(if ... #t #f)
kys
>>62036403
especially when correctly named function even? already exists
>>62024216
ftfy(define (X-main pos row num low max)
(unless (= row (1+ num))
(begin
(if (or (= low pos)
(= max pos))
(display "1")
(display "0"))
(if (= num pos)
(begin
(display "\n")
(X-main 1 (1+ row) num (1+ low) (1- max)))
(X-main (1+ pos) row num low max)))))
(define (X n)
(unless (even? n)
(X-main 1 1 n 1 n)))
>>62024379
Why do you have to destroy your stack frame when you call another function from a tail call optimized one? The callee doesn't touch the stack frame of the tail call optimized function that calls it right?
>>62024941
Do you use CL?
Is it viable for proprietary software?
How do you organize packages?
Do you use custom macros to hide the horrible default names like "progn" and "terpri"
common lisp is the most superior language in the world
>>62040286
(loop) is awful
>>62040286
It has so many parenthesis it almost looks like a joke. S-expressions exists just because the dude who wrote the parser was lazy as fuck.
How do you even run Scheme. I just want to write it in a file and then run it in console and see results.
>>62040541
>download whatever flavor of scheme you want
>run it
>REPL
it's simple
>>62029114
>The lambda claculus is one of the two fundamental modells of computing. (The other one being the turing machine).
brainlet here
so what would be equivalent of sicp book for turing machine?
>>62040293
So use dotimes or whatever
>>62040382
The parentheses enable the GOAT macro and backtick system so shut your mouth brainlet
>>62040900
TAOCP
>>62041110
kek, several k pages reference books sounds like abuse
>>62039668
>Do you use CL
yes, for most of my stuff actually
>Is it viable for proprietary software?
Yes, I run servers on SBCL.
>How do you organize packages?
I have macros for bundling ASDF or quicklisp packages and build images bundled with dependencies for common things, like webserver images, image editing functions, a big "super" image for having to do all of the above at once
>Do you use custom macros to hide the horrible default names like "progn" and "terpri"
I use an emacs source replacement to turn stuff like that into random greek letters
>>62040900
if you want easy to understand, there is a Pluralsight course on the Turing Machine
https://www.pluralsight.com/courses/alan-turing-wonderful-machine
>>62031360
I would suggest using Spacemacs first to get a bit comfy with configs and emacs-lisp.
>>62024941
>>62041401
how do i git gud
I've gone through some land of lisp and practical common lisp and still feel like a babby.
>>62031360
"Mastering Emacs"
>>62041699
The problem is that most people who think they know Lisp really dont even understand what Lisp is which is a metaprogramming language. Metaprogramming is the ability of a programming language to dynamically generate code at runtime. Amost no Lisp books teach how to use Lisp as a metaprogramming language except for "On Lisp" and "Let over Lambda".
Read this article:
http://www.defmacro.org/ramblings/lisp.html
it explains very well what Lisp is and how it functions down at its core. Once you understand this article then you will be ready to really learn Lisp.
>>62041699
write programs in common lisp, like a personal web server, or a text editor, an image processor
get a book on AI in Lisp and write a spam filter, or an image classifier, try writing a compiler or something more advanced
i think racket has the world's worst documentation
so does common lisp actually
>what is cltl + slimv
>>62029984
>/prog/ though prefers lisp
lisp or haskell*
>>62022897
Clojure and Clojurescript are my main languages now. Lisp changed the way I think about problems and I have so much fun writing it.
>>62025172
Clojure/script in Emacs is unparalleled desu.
Reading & understanding stacktraces honestly took a minute, but I'm VERY happy where I am.
>>62022897
LISP (scheme) is an awesome language that will teach you all the best practices.
>>62022897
Also read the books in the little schemer series.
>>62042318
>>62042348
thanks I'll look into those. Tbh its just fun writing something in CL and running it in sbcl and it just werks and its like the most distilled way you could have written the problem.
>That feeling of contentedness
the meme is that its good for writing compilers
>>62040286
It lacks proper static typing. And no, the type declarations aren't that.
>>62040541anon@gentoo:~$ sudo apt install -y guile
anon@gentoo:~$ echo '(display "Hello, World!") (newline)' > script.scm
anon@gentoo:~$ guile -s script.scm
>>62039668
>Do you use custom macros to hide the horrible default names like "progn" and "terpri"
Reminder that http://cl21.org/ exists.
>>62043580
That would be Haskell.
>>62043396
>>62025172
https://sekao.net/nightcode/
http://nightcoders.net/
http://www.braveclojure.com/
Is the book itself enough for SICP or do I need to watch the video course?
>>62043699
Modernizing CL is a way harder task than it sounds. It's a formally specified language, and its syntax is gross and unwieldy on purpose because the language was meant to be a synthesis of multiple very old Lisp dialects into one mostly-compatible language; hence, "Common" Lisp. This involved accommodating a lot of shitty workarounds to ensure compatibility with legacy systems that were already considered outdated in its time, like using "-p" for predicates because "?" would break things. It sounds insane now, but back then it was necessary to make CL at all viable for adoption, and while they are extremely rare, there are a handful of legacy CL systems still being maintained.
This leaves us with a dilemma. The only way to guarantee universal adoption of a modern CL is to pass a new standard, and for such an unpopular language that will be very hard. Making de facto standard libraries is more feasible, but this could lead to a D-language scenario where the lack of consistency everywhere makes the language unappealing.
>>62041110
Is it true that reading TAOCP (even just the first book) and understanding it makes you a much better programmer?
>>62046719
its a meme, taocp is a reference book, its like asking if reading whole encyclopedia would make you smarter
>>62029114
thx
>>62046810
von neumann memorized a few encyclopedias when he was a child.
>>62047670
von neumann was in in billions
while avg /g/ lurker is nto even avg despite fact that his mommy and aunt said that he is smart but lazy
>>62047713
everyone is a von neumann after taking some modafinil
>>62046810
>>62047713
You type like a fucking retard so it's safe to assume your opinion can be disregarded.
>>62047764
yeah, its only my opinion, you are free to do whatever you want
>>62047749
>amphetamine derivatives increase your iq by 100 points kek
Von neumann greatness come not from eidetic tier memory but from ability to formulate problems out of nothing and then being able to provide solution.
its the difference between being able to solve calculus and being able to invent/proof calculus
>>62047826
>>amphetamine derivatives increase your iq by 100 points kek
yes. don't underestimate science. soon enough we will all have +300 iq. the age of the homo gĕnĭus is incoming.
>>62047891
doubt it
People with high iq are hard to control, merchants around the world would loose way to much, society would be against wars, they would have to close hollywood plastic cinema and pop starts would be homeless
they will not allow society to be smart, dumb people who want to eat, shit, sleep and fuck are more profitable for {{{them}}} and easier to control
>>62047939
please go back to pol.
>>62043672
>gentoo
>apt
kek
Is emacs a meme? If you use emacs is evil mode worth learning?
>>62048198
I think its great and I used to be a vim autist.
Just get vanilla emacs and find out how to tweak your startup script to just install and autostart evil, turn off fringes, then go from there. If you do it right the only emacs keybind you need to learn is M-x, the rest is your usual vim commands. Don't get one of those bloated emacs bundles IMO.