[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why is Lisp so reviled, despite so much evidence showing

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 214
Thread images: 17

File: new-window.png (8KB, 541x437px) Image search: [Google]
new-window.png
8KB, 541x437px
Why is Lisp so reviled, despite so much evidence showing it's value?
>>
>>58771804
((((((((((((((((((((((((((())))))))))))))))))))))))))))))))
>>
because literally every implementation is slower than even you
>>
>>58771804
The way variables are declared in most LISP code is pure cancer, stop doing that in the mid of the code dip shit.
>>
>>58771804
I challenge both of those statements.
>>
>>58771819
Try SBCL sometime. It's pretty amazing
>>
>>58771819

> 2017
> Emacs still takes eons to load.

Like Jesus Christ we aren't even talking about some crazy emacs setup basically the bare minimum to make it a okay editor.
>>
-it has obnoxious syntax
-it's slow
-it's cryptic
-no one uses it for anything because it sucks
>>
>>58771804
I actually kind of like lisp when working on a private project, and I think once you've learned the basics of programming in any other language, lisp has some of the best materials for learning more advanced logic structures and/or work with higher mathematics. But if you want to work with someone else's code it's a nightmare in terms of readability, even when the developer uses good style. Good for research, bad for collaboration.
>>
languages that cannot handle memory directly is just hobby language for memers
>>
>>58771804
Cuz it's ugly, mang
>>
>>58772018
Clojure is pretty fast.
I know it's a cool meme to shit on the JVM, but it's actually blazing fast.
>>
>>58771804
>m-muh parantheses 2hard4me
If there was a lisp with inferred typing and no GC (nor manual memory management), it would be the best language ever made.
>>
>>58772125
All mainstream implementations of lisp languages are fast as shit m8, and it's less cryptic than, say, c. Tons of people use it. It's the scripting language for gimp, solidwork, maya and guix among others, as well as being heavily used in all naughty dog games.
>>
>>58772403
>It's the scripting language
that's all you should have to read to know it's shit
>>
(((LISP)))
>>
>>58772403
>gimp, solidwork, maya and guix
>naughty dog games

thx anon, I never realized why these were all steaming piles of shit
>>
>>58771804
It's not reviled, just different. I don't know anybody who actually HATES Lisp. It's just that they're mostly busy people and learning new languages (and new paradigms) takes a lot of time, especially if it's something as simple as Lisp and requires you to "unlearn" a decade of Java-tier cruft about how you need factories and generators and complex classes for simple functions. Given that, most people want to put in the effort to learn new things that they feel have been proven to add more monetary value to their skillset.

My guess is that it kind of becomes a self-fulfilling prophecy.
>not enough people doing commercial work with Lisp
>people see not enough people using it for commercial work and decide it won't add value to their portfolio
>not enough people...
etc.
>>
>>58771804
It's very good for scripting actually because its syntax makes it pretty logical and easy to follow. I used a dialect called SKILL which is for EDA tools and it was cool.

Don't see it going anywhere for general purpose programming though, what are its values that you speak of?
>>
>>58773209
homoiconicity is a huge one.
the macro system and native support for multiparadigm (functional, procedural, OO, logic, and so on) as well as its incredible power for defining DSLs makes it extremely easy to adapt to any domain to make it extremely powerful and concise in that domain.
>>
>>58773290
>homoiconicity
This was what I was referring to without knowing what it was called. It was cool following the scripts easily.
>>
>>58771804
why does it have to have ;defun
isn't it obvious from the (defun
that the () block is a function
q about lisp
>>
>>58774093
i suppose its so you keep track of the brackets? closing bracket is for function
>>
>>58772259
Takes literally a minute to start Hello World.
>>
>>58771819
SBCL is roughly comparable to C.

https://news.ycombinator.com/item?id=2192629
>>
>>58772065
>Emacs still takes eons to load.
The fuck are you running on, a ten year old toaster?

$ time emacs -nw -Q --eval '(kill-emacs)'
emacs -nw -Q --eval '(kill-emacs)' 0.09s user 0.02s system 98% cpu 0.111 total
>>
>>58771811
>>58771819
>>58772125
>>58772248
>>58772251
>>58772252
>>58772416
>>58772554

ITT People regurgitate memes about something they know nothing about.
>>
>>58774093
>why does it have to have ;defun
Author is a Lisp noob. It's like someone writing

x++  // Add 1 to x
>>
>>58774199
why else are you here?
>>
>>58774220
ah. it's a comment
>>
File: 1435113446210.png (200KB, 700x715px) Image search: [Google]
1435113446210.png
200KB, 700x715px
>>58774235
To be smug.
>>
>>58772554
>>58771811

Underrated
>>
>>58771811
since there isn't actually anything in the center i guess that means no jews were involved with LISP

but if that's the case why do they hate-

oh...
>>
Hate the syntax for declaring type.
(let ((x 0))
(declare type (fixnum x))
x)

when it could be just something like
(let ((x :int (get-int-val))) x)


Hate the syntax for accessing objects.
(let ((x (make-array 3)))
(setf (aref x 0) 1))
; instead of something like
(let ((x (make-array 3)))
(setf x[0] 1))


Also you really don't want to fuck with readers macros because then you editor can't handle them well and it's nightmare for anybody using your library.
>>
>>58772392
Python compiles with type information.
But given the object system it's somewhat limited in what automated inferences it can make.
>>
>>58772403
Of course that piece of shit Gimp is LISP, what else could it have been. Well, maybe brainfuck
>>
>>58771811
>>>/pol/
>>
File: Symbolics-7.jpg (56KB, 544x713px) Image search: [Google]
Symbolics-7.jpg
56KB, 544x713px
>>58771804
Lisp was part of a much bigger idea. (pre-microsoft)

Lisp machines are general-purpose computers designed to efficiently run Lisp as their main software and programming language, usually via hardware support. They are an example of a high-level language computer architecture, and in a sense, they were the first commercial single-user workstations. Despite being modest in number (perhaps 7,000 units total as of 1988[1]), Lisp machines commercially pioneered many now-commonplace technologies – including effective garbage collection, laser printing, windowing systems, computer mice, high-resolution bit-mapped raster graphics, computer graphic rendering, and networking innovations like Chaosnet.[citation needed] Several firms built and sold Lisp machines in the 1980s: Symbolics (3600, 3640, XL1200, MacIvory, and other models), Lisp Machines Incorporated (LMI Lambda), Texas Instruments (Explorer and MicroExplorer), and Xerox (Interlisp-D workstations). The operating systems were written in Lisp Machine Lisp, Interlisp (Xerox), and later partly in Common Lisp.

https://en.wikipedia.org/wiki/Lisp_machine
>>
File: lisp.jpg (14KB, 480x360px) Image search: [Google]
lisp.jpg
14KB, 480x360px
>>58776967
a whole OS / "information architecture" of Lisp.
Imagine what the world would have been like if these machines had become the "office micro" (PC). Microsoft regressed everything.
>>
File: Symbolics3640_Modified.jpg (154KB, 308x608px) Image search: [Google]
Symbolics3640_Modified.jpg
154KB, 308x608px
>>58771804
The Bitsavers' PDF Document Archive[32] has PDF versions of the extensive documentation for the Symbolics Lisp Machines,[33] the TI Explorer[34] and MicroExplorer[35] Lisp Machines and the Xerox Interlisp-D Lisp Machines.
>>
(write-line "Hello 4chan.")

(write-line "I am learning LISP!")
>>
File: clisp-win32.png (47KB, 677x342px) Image search: [Google]
clisp-win32.png
47KB, 677x342px
>>
File: ll.png (389KB, 1053x529px) Image search: [Google]
ll.png
389KB, 1053x529px
>>58777074
all the keys ... (just 1 file here) http://www.textfiles.com/bitsavers/pdf/symbolics/
what you are using now was invented by these people
>>
wen u tryina defun fun
>>
(loop for y from -1 to 1.1 by 0.1 do
(loop for x from -2 to 1 by 0.04 do
(let* (
(c 126)
(z (complex x y))
(a z))
(loop while (< (abs(setq z (+ (* z z) a))) 2)
while (> (decf c) 32))
(princ (code-char c))))
(format t "~%"))
>>
>>58771804

You know why Java and C# are so popular?
Because they're similar enough to C++ that C++ programmers can pick them up quickly.

You know why C++ got its popularity?
Because it was similar enough to C that C programmers could pick it up quickly.

You know why... fuck it you get the point.

And the thing is that Lisp is different. It is a new language. A different language that demands, unapologetically at that, that you learn a new way of thinking about things.

SQL does something similar. And you know how many developers have problems doing simple joins? Or who don't understand how the language works? I mean, that's why MongoDB became a thing. Just send in JSON, get out matching JSON. Simple. Oh, what relations lol, you don't really need those.

Python got on because it looked a lot like pseudocode.
Haskell has a niche because it looks a lot like mathematics. Which is sad, because mathematical notation looks like dogshit.

Once you UNDERSTAND why (+ 1 2 3) makes more sense than 1 + 2 + 3, you start to get lisp. But most won't get there until they've implemented a parser or two. Which is kind of funny and kind of sad.

So you have a system that is different from others, and that you have to learn from scratch and doesn't look like the things you've already learned. Now are these languages better? No.

But you already know them.
>>
>>58771804
Lisp is HOMOICONIC

"If a language is homoiconic, it means that the language text has the same structure as its abstract syntax tree (i.e. the AST and the syntax are isomorphic). This allows all code in the language to be accessed and transformed as data, using the same representation.
In a homoiconic language, the primary representation of programs is also a data structure in a primitive type of the language itself. This makes metaprogramming easier than in a language without this property, since code can be treated as data: reflection in the language (examining the program's entities at runtime) depends on a single, homogeneous structure, and it does not have to handle several different structures that would appear in a complex syntax. To put that another way, homoiconicity is where a program's source code is written as a basic data structure that the programming language knows how to access"
https://en.wikipedia.org/wiki/Homoiconicity
>>
>>58774195

Try loading some elisp.... Like I said other than the minimum it's super fucking slow.

I specifically run server-mode and do emacsclient to deal with this.

Startup times are most certainly a ongoing issue with emacs and why we have stuff like use-package and why it comes up often on emacs-devel.
>>
>>58772125

That's what you would think. But lisps are used all over the place in specialized domains. I believe a lot of aircraft control systems use a lisp. Some financial systems use it, It's quite popular in AI (or was) it's frequently used as a scripting/plugin/config language due to ease of implementation and power.

Seriously go look at where lisps are used and you will be quite surprised at the number of commercial/industry applications it's used for. We aren't even talking about legacy code, new stuff is being developed in lisp dialects.

It's obviously not a ultra popular language like c/Java/Python etc, but it is used in certain problem domains.
>>
>>58777473
It's slow but when compare it to something like eclipse then it doesn't that seems that slow.

There is project old project to try to implement emacs in guile that should support parallel threads. It runs but there's some problems with encoding so it's slow. Things should be better when guile 2.2 comes out but not sure if they are still developing it.

The ecl(embedded common lisp) developer is trying to revive mcclim, gui library for cl. There exists climacs common lisp implementation of emacs but not sure if he's planning to do something for it because the project is also dead.

There actually is some guy doing new common lisp implementation, clim3 standard and reference implementation of that standard and project called second-climacs but it has been in development for few years and I think it's still not usable.
https://github.com/robert-strandh/Second-Climacs

State of emacs is kind of poor but there really is nothing better.
>>
>>58777565

Yeah don't get me wrong, I use emacs for a editor, and use zile on servers and small systems, but the state of emacs is not okay. It's not perfect there are some huge issues with it (you know freezing emacs while it does something slow like access a remote system with tramp)

Emacs-devel is constantly blocked by rms's objections and and requests, developer infighting, total lack of understanding on what new people expect of a editor. I hope someone does a hardfork and pushes GNU Emacs forward like xemacs did in the 90s.
>>
>>58771804

(
(
(
(
(
(((((((((((kys))))))))))
)
)
)
)
)
>>
>>58777242
>Lisp is HOMO
yeah we know
>>
>>58776784
Use chicken, noob.
>>
>>58776841
>Python compiles
>>>/tumblr/
>>
>>58777879
It has as retard syntax as cl
>>
>>58777894
>literally couldn't be arsed to google being spouting the most retarded comment in the entire thread
really makes you think.
>>
>>58772003
>>58777675

/thread
>>
>>58777893
Python is the name of a Common Lisp compiler used in SBCL. Since this is a LISP discussion I assumed some familiarity with it.

http://www.sbcl.org/manual/sbcl.pdf
See page 21.
>>
>>58772403
>>58776883
Gimp uses python, not lisp.
Come to think of it none don't all of those programs use python?
>>
>>58778188
t. inbred too dumb to google.
>>
>>58771804
pajeets forced shitty languages into our throats.
>>
>>58771811
Hey I am professional JavaScript webdeveloper programmer I know this code
{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}
>>
>>58771804
>Why is Lisp so reviled

It's not obvious and intuitive -- for example, it has puzzling contractions like "setq" and "defun", and when you look at a "while" statement it's not obvious what the various parts of it do.

Sure, you can memorize that stuff -- but that's not the point. You could also use Chinese characters for all the keywords too (you can always memorize them, right?) but there's a reason we don't stuff like that: applying that transformation becomes a continual source of extra mental work to extract meaning from it.

Now look at a normal programming language:

"if (x < 0) print 'illegal value';"

Even non-programmers could look at that and immediately get the idea what it's doing. In fact, for that particular statement, I don't think it would even be possible to design it to be any more universally understandable to someone who speaks English.
>>
>>58778704
(if (< x 0) 
(print "illegal value"))

That's pretty fucking clear and intuitive in sense that all () are either lists or the first thing is function call.
>>
>>58774135
This is just nonsense, Clojure may have its issue with being hard to access and not being approachable for new users. But there is a reason it['s used a lot by huge companies hanging mega data. In some instance its been faster than java while avoiding get() set() hell.

People who think Lisp is not used need to get out of their bubble. In back-ends it's everywhere. From Amazon to Netflix. Even NASA have used it on many probes and satellites because of the ability to edit in runtime. It's just never made the jump to normie land as firing up a python ide and looking at the millions of tutorials for every single thing is just easier, and people like easy.
>>
File: Screenshot_2017-02-02-08-16-52.png (219KB, 720x1280px) Image search: [Google]
Screenshot_2017-02-02-08-16-52.png
219KB, 720x1280px
is pic related right?
>>
>>58778188

I think kicad and gEDA use a lisp for part of their file format and configs.

It's less common these days, before Python it was tcl, now is Lua .

Lot of gnu tools use a lisp.
>>
>>58778791

This. It's really quite amazing how many things have some connection to lisp.
>>
>>58771811
])))]]}}}}}}}}}}}};}}
>>
>>58778972
no
>>
>>58771804
more brackets than junior high.
>>
>>58777179
>Python got on because it looked a lot like pseudocode.
pseudocode is generally pascal syntax
>>
>>58779159
ok ok .. lisp could be used as pseudocode as it is minimal in that it has no fat, the language subset is small .. java could not be used as "pseudocode" ... why the hell they use java in teaching.

"As the name suggests, pseudocode generally does not actually obey the syntax rules of any particular language; there is no systematic standard form, although any particular writer will generally borrow style and syntax; for example, control structures from some conventional programming language. Popular syntax sources include Fortran, Pascal, BASIC, C, C++, Java, Lisp, and ALGOL. Variable declarations are typically omitted. Function calls and blocks of code, such as code contained within a loop, are often replaced by a one-line natural language sentence."
>>
>>58777565
eclipse is an IDE behemoth ... it is hugely bloated, buggy ... eclipse has nothing to with the language
>>
>>58771804
Baby ducks
C niggers, Java niggers, and ML niggers judge a language solely upon how much it resembles their nigger language
>>
>>58779207
He was talking about elisp and it's generally run only on emacs even though kawa and guile support it to some extend. You don't generally write elisp to develop standalone application but to extend emacs to be more IDE like.
>>
I feel like the paradigms of Lisp are cool when you're actually writing functions, but it's very annoying in others. I generally like it when I'm writing a function, but when I actually have to call a function, it gets really convoluted.

For example, I tend to use Scheme as a calculator when I do my homework, and while I can write a pretty elegant function to calculate equivalent resistance of a list of resistances, anything other than the simpler cases results in a difficult to comprehend expression.

(define (eqres lst)
(define (iter lst sum)
(if (null? lst)
sum
(+ (/ 1 (car lst)) (iter (cdr lst) sum))))
(/ 1 (iter lst 0)))

(+ (/ 3 7) (eqres (cons (/ 16 7) (cons (/ 16 7) '()))))
#| or |#
(+ 12 25 (eqres (cons 20 (cons (+ 15 (eqres (cons 24 (cons (+ 20 (eqres '(12 60))) '())))) '()))))


Maybe part of it is just Scheme making it hard to make lists with expressions inside them, but I think at least part of it is Lisp in general.
>>
>>58779526

instead of consing you could just do
(list (something) (something2) ....)
>>
>>58779851
Shit, I forgot about that. I use scheme pretty infrequently, so I forgot there was a way to make lists other than cons or list literals.

I guess that makes the function calls a bit more readable.
>>
>ctrl f
>2 "macro" results
>lisp thread
Does anybody really use Lisp here?

>>58779189
That's the good part about lisp, you can write your "pseudo-code" first and then implement the language (or function+macros interface) that transforms it to lisp code. This is what really makes lisp so powerful.

>>58772416
>scripting
Depending on the implementation Lisp can be intrepreted as a scripting language.
Talking about SBCL you can build to native code your program and then use its lisp compiler to build your "script" and use it (your JIT built native code) at runtime. I think few languages support it. Maybe C through LLVM JIT compiler, but its interface is not as elegant lisp's.
>>
>>58777473
Of course interpreting elisp is slow, you're literally parsing and compiling code on the fly. That's why you compile elisp and autoload it.

Interpreted any high level language is going to be slow.
>>
File: 000144.png (58KB, 585x599px) Image search: [Google]
000144.png
58KB, 585x599px
>>58776419
>i guess that means no jews were involved with LISP
>>
>>58777179
>Once you UNDERSTAND why (+ 1 2 3) makes more sense than 1 + 2 + 3, you start to get lisp. But most won't get there until they've implemented a parser or two. Which is kind of funny and kind of sad.
why not (+ + 1 2 3)
>>
>>58779526
Calling functions is almost the same in Lisp and other languages.

foo(bar)
(foo bar)
>>
>>58776784
pretty sure you can do (setf (car x) 1) and it will actually work, lisp is black magic I'm pretty sure
>>
>>58780519
>why not (+ + + + + + + 1 2 3 4 5 6 7 8)
fagmachine
>>
((lisp))
>>
>>58780694
rude, i was just asking a question
i don't know how lisp works, educate me
>>
>>58780693
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node80.html

Basically Lisp let's you define lvalues ad hoc. Like how C-like languages can do:

x[10] = y

(car x) = 1
(third-item-in-nested-list x) = 1
>>
>>58780710
well
(* (+ 1 2) (* 3 4))
= 36

intuitive and KISS/DRY as fuck
read an intro tutorial or something
>>
>>58780519
>>58780710
Basically, '+' is the name of a function, and it takes a variable number of arguments. (+ + 1 2 3) doesn't make sense because there's only ever one function name per pair of parentheses; everything else inside the parentheses is an argument passed to that function.

You can, however, nest functions, so something like (+ (+ 1 2) 3) would be valid, since this is calling a function with the result of another function as one of its arguments.

However, since '+' can take multiple arguments, and addition is commutative, we can just give the outer function 3 numbers.

Basically, the benefit of (+ 1 2 3) over 1+2+3 is that it's clear exactly what arguments are being passed to the plus function, and the order in which things should be evaluated is unambiguous.
>>
>>58781984
And when you understand "apply" you can:
(apply #'+ my-list)
>>
>>58781984
>we can just give the outer function 3 numbers
u wot nigga
>>
>>58782373
Right, yeah, apply is neat.
For example, the function in >>58779526 can be translated to just:
(define (eqres lst) (/ 1 (apply + (map (lambda (x) (/ 1 x)) lst))))


That involves map and lambda as well, but with some pretty simple tools, you can write some complex functions with not a lot of code.

>>58782435
By "outer function" I mean the outer '+'

(+ 1 2 3)
instead of
(+ (+ 1 2) 3)
>>
File: forth.png (38KB, 816x653px) Image search: [Google]
forth.png
38KB, 816x653px
>>58780694
That's kind of like how forth works

but it's postfix instead
>>
Tell me is string manipulation in clisp as big a pain as it looks?
>>
>>58780694
>>58782915

stacks are mathematical cancer
>>
>>58782919
If they're painful for you, take them as atoms and write your owns.
BTW clisp is an CommonLisp implementation, for abreviation use CL.
>>
>>58782919

no but why are you writing your own string tools in the first place
>>
>>58782966
I'm reading practical lisp, a tutorial and searching and I see basically no useful string manipulation. Even J had a way to split strings.
>>
>>58783276

duckduckgo is your friend
http://www.cliki.net/SPLIT-SEQUENCE
>>
>>58783296
>install a community package so you can split strings
hahah oh wow
>>
>>58783375
>LISP : 1958
please
>>
>>58783375
>>58783488
https://gist.github.com/siguremon/1174988
>>
If I wanted to learn a lisp dialect with support/a community which should I pick up?
>>
>>58783667
Define community.
Define support.
>>
File: 1448770950671.jpg (45KB, 510x768px) Image search: [Google]
1448770950671.jpg
45KB, 510x768px
>seepuls-tards hate lisp because it's "too different"
>the same seepuls-tards love c++11 because it's more "algorithmic"
>all of a sudden, c++11, and c++ is literally turning into a shitty lisp now
>yfw seepuls-tards ironically prefer a c++ that's more like lisp than c


https://chriskohlhepp.wordpress.com/advanced-c-lisp/convergence-of-modern-cplusplus-and-lisp/
>>
>>58772403

So Crash Bandicoot runs off a bunch of parenthesis shimmed into everything?
>>
>>58785670
Crash bandicoot especially (it's all lisp right down until the metal), but all their games in general even to this day use lisp code.
>>
File: crash.jpg (34KB, 930x523px) Image search: [Google]
crash.jpg
34KB, 930x523px
>>58785694

Thats actually pretty bitchin'
>>
>>58785828
http://all-things-andy-gavin.com/video-games/making-crash/
Enjoy the read.
>>
Lisp is beautiful and elegant, but lacks constructs to aid humans in the writing of code
>>
>>58786716
what do you mean? you mean like a way to deal with the syntax?

emacs has stuff like smartparens
>>
>>58771846
>declaring variables in the middle of code
Do you always declare your variables at the top of your function?
>>
>>58786716
That's basically the opposite of true though.
>>
>>58782919
lol what?

Lisp is about as good as it gets for parsing, splitting things.

Strings are just lists lad.
>>
>>58773209
I'd say the quality of implementations is a huge plus for Lisp.

SBCL is awesome, and I would love to try out LispWorks' stuff someday.
>>
>>58786768
Then you've never for example, done high maths in it. It's really quite elegant. But like hell if I'd want to participate with other people writing a real project in it
>>
>>58778787
> Picks the one and only statement in lisp that's kind of intuitive.
>>
>>58786855
I'm so sorry for not 420 blazing it while doing math. What have I done with my life.

Kids these days.
>>
>>58786894
That's
That's not what that means
>>
>>58771811
>>58772554
>>58780432
>>58776419
>jews

>John McCarthy (September 4, 1927 – October 24, 2011) was an American computer scientist and cognitive scientist. McCarthy was one of the founders of the discipline of artificial intelligence.[1] He coined the term "artificial intelligence" (AI), developed the Lisp programming language family, significantly influenced the design of the ALGOL programming language, popularized timesharing, and was very influential in the early development of AI.
>John McCarthy was born in Boston, Massachusetts on September 4, 1927 to an Irish immigrant father and a Lithuanian Jewish immigrant mother
>>
>>58776784
(defun let-binding-type (let-binding)
(if (= (length let-binding) 3)
(nth 1 let-binding)
'*))

(defun regular-let-binding (let-binding)
(if (> (length let-binding) 2)
(cons (car let-binding) (cddr let-binding))
let-binding))

(defun let-variable (let-binding)
(car let-binding))

(defun typed-let-helper (let-bindings)
(loop for let-binding in let-bindings
collecting (regular-let-binding let-binding) into new-let-bindings
collecting (list 'type
(let-binding-type let-binding)
(let-variable let-binding))
into type-bindings
finally (return (values new-let-bindings type-bindings))))

(typed-let-helper '((x number 5)))

(defmacro typed-let (let-bindings &rest actions)
(multiple-value-bind (let-bindings type-bindings)
(typed-let-helper let-bindings)
`(let (,@let-bindings)
(declare ,@type-bindings)
(progn ,@actions))))

(typed-let ((x number 10) (y (integer 0 *) 20))
(+ x y))


You were saying?
>>
>>58771804
Because it's used as an instrument of torture in SICP against innocent fresh-faced 18 year olds who should be learning to wire-wrap 6502's & program in assembly.
>>
>>58781984
>and the order in which things should be evaluated is unambiguous

(+ 1 2 3) doesn't make it clear whether 1, 2, or 3 is evaluated first. Obviously it doesn't matter in this case, but it can matter if any procedure takes a side-effecting procedure call.
>>
>>58786937
>Irish immigrant
>Lithuanian Jewish

Woah. That's like a double-decker of the #1 and #2 most culturally corrosive Second Wave immigrant groups.
>>
>>58787218
In Lisp, things are evaluated left-to-right.

It's poor taste to rely on this, though.
>>
>>58783667
Hopefully this post doesn't eat my formatting.

I quite enjoy Common Lisp. SBCL is a good implementation. Regardless of which implementation you use, I recommend using quicklisp to load libraries.

http://www.sbcl.org/
https://www.quicklisp.org/beta/

If you prefer Scheme, Andy Wingo has a nice guide to Scheme implmentations here: https://wingolog.org/archives/2013/01/07/an-opinionated-guide-to-scheme-implementations. While not strictly speaking a Scheme, I'd recommend Racket if you think you'd prefer scheme.

Clojure is opinionated about immutable data, and is pretty popular. I'm given to understand you still get ugly Java stack traces when things explode, but I think this is improving.
>>
>>58787280
>In Lisp, things are evaluated left-to-right.

I suppose that depends on what you mean by "Lisp". The Common Lisp hyperspec (and thus, I assume, the ANSI standard) specifies that operands are evaluated in left-to-right order. R4RS, at least, specifies that operator and operand are evaluated in an unspecified order, and even says, "The order of evaluation may be chosen differently for each procedure call."

So yeah, definitely not something to count on in Scheme.
>>
File: 1462207993915.png (127KB, 240x240px) Image search: [Google]
1462207993915.png
127KB, 240x240px
>>58774195

Using "-Q" is downright misleading, b-be honest anon, how long does it take for your site-lisp and init.el to finish executing?

  ~  time emacs -nw -Q --eval '(kill-emacs)'
emacs -nw -Q --eval '(kill-emacs)' 0.13s user 0.04s system 50% cpu 0.329 total
~ time emacs -nw --eval '(kill-emacs)'
emacs -nw --eval '(kill-emacs)' 1.35s user 0.15s system 91% cpu 1.631 total
~ time emacs -Q --eval '(kill-emacs)'
emacs -Q --eval '(kill-emacs)' 0.27s user 0.03s system 85% cpu 0.354 total
~ time emacs --eval '(kill-emacs)'
emacs --eval '(kill-emacs)' 1.51s user 0.07s system 91% cpu 1.729 total
>>
emacs uses elisp. is there a text editor that uses scheme? mit scheme seems to fuck up after opening a couple files.
>>
>>58787502
sissy
>>
>>58787755
There's a branch of emacs that uses guile, and another that uses common lisp.
>>
>>58777114
post lisp coding music

https://www.youtube.com/watch?v=HHgxOXEQaFU
>>
>>58787218
Really it varies with the individual functions. It's just the basic math operators that are specified as going in left to right order.

Generally we have functions that have a fixed number of parameters, and each parameter is clearly defined, so this is not an issue. But I guess the language should have a standard for binary operations (ops with 2 inputs) taking a variable number of inputs.
>>
File: out.png (174KB, 1280x1024px) Image search: [Google]
out.png
174KB, 1280x1024px
>>58777144
sweet mother of christ thats cool
>>
>>58788267
For some reason seeing that code pissed me off. Like it ruined my fucking day. Is this normal halp
>>
>>58774135
t. average /g/ neet who can't even write hello world
>>
>>58788386
I wouldn't say it ruined my day but it made me feel really disappointed about my own pajeet code. I also don't know math very well so I could never pull that off myself. I've only been writing lisp for a few months though.
>>
>>58788386
well common lisp's LOOP is a piece of shit
>>
>>58788441

it's really not, if it has too many features for your tastes then use the iterate package
>>
>>58786781
>strings are just lists
not in Scheme or Common Lisp. Which meme variation has strings as lists?
>>
>>58788512

Common Lisp strings are sequences which are lists but with methods that are treated differently during compilation
>>
>>58788543
That's a pretty autistic distinction you are trying to make.
>The value "faggot" is not of type LIST
>>
>>58788628

k
>>
>>58772065
Let me guess, you don't even know about -nw?

>>58772403
>scripting language
Which means it doesn't do the heavy lifting (which is probably done with C++). It has its uses, but if it's best known for being good as a scripting language, that doesn't imply it would work well for general application development.

>>58772554
That's not even coherent syntax. Lisp uses prefix notation, but otherwise follows the same general rules as math, there's absolutely no point in having a set of parentheses containing nothing other than a single other set of parentheses.

If you did something like
(Lisp (was-made-by (the jews)))
That would at least make some kind of sense.

>>58786750
I do, but that's only because I keep forgetting it's not 1977 anymore.
>>
>>58788645
>using -nw
That being said, my personal setup takes just under a second to load. I consider that to be acceptable.

>there's absolutely no point in having a set of parentheses containing nothing other than a single other set of parentheses.
Well, (LISP) could return a lambda expression. It'd only make sense for a LISP-1 though.
>>
>>58788457
>too many features
what, they're like 12 at most
>>
>>58787786
Source?

>>58787764
What the shit?
>>
>>58789386
https://www.emacswiki.org/emacs/GuileEmacs
>>
>>58787386
If evaluation order is important, you would use progn or let*
>>
>>58771804
Because they don't understand it. I almost hate the fact that I found CL because now I don't like anything else other than CL/Scheme + C. C++ is ridiculous and getting worse every revision. Why use Java when there's Clojure or ABCL? The whole thing with both is you have devs getting all excited that some syntax got added in the language (don't worry it'll just take a few years to get to you), praising all these "new features" when they don't realize they could've done everything they wanted to in Lisp whenever they wanted instead of waiting for some committee to come up with yet another thing that's easy in Lisp and making a trash syntax to express it. I thought originally Greenspun was wrong but the more time goes by, the more true it gets. The development cycle with SLIME makes everything else look like primitive trash. And then SBCL lets me optimize when I want and be lazy when I want with full disassembly to see how things are going (though Disaster for C lets me do this also), live redefining of functions, garbage collection (that's easy to turn off along with any safety overhead), and an excellent FFI if you really need C. There's literally no reason to use anything besides a Lisp and C unless you can only use C for embedded (and even then you could write a Lisp that'll emit native code or compile to C). There's even a Lisp that works with Python if you want all those nice Python libs too and there's tons of translators so you can write Lisp and it'll spit out a language of your choice. The fact that so few people get it means that you're stuck using substandard crap if you actually want a job. You can even do fucking web programming in this shit (and be as fast or faster than Node) and modify running applications on a server without any restarts but nope, if you want a job you have to do everything in JS, PHP or Python. The only language so far that gets a pass is Haskell and ML but only because I haven't got that deep into them yet.
>>
dogshit dynamic typing

seriously it's 2017 and finally people are learning types are good again (typescript, etc.)
>>
>>58789824
You can add type hints to lisp
>>
>>58789766
>There's even a Lisp that works with Python if you want all those nice Python libs too

For anyone wondering, thats Hy.
https://github.com/hylang/hy

Hy and Emacs Lisp helped me get interested in Common Lisp. I share a lot of the same feelings as you but I don't have very much experience to back it up.

One thing I would like to say is that writing lisp is FUN. I like reading other people's lisp too. I havent found another language that I feel that way about.
>>
>>58771804
Because your choice of development environments slims down to emacs.
>>
>>58789841
Yeah that's the one. The only issue is I think I remember the devs giving a talk and saying that they rely on some internal AST representation when interacting with Python or something and that it's not guaranteed unlike the external language.

It's definitely more fun than other languages since I get to see immediate results and I can write my code and evaluate it at the same time (i.e. with SLIME I'm not just stuck with a REPL only or file only like in other languages). Also sucks for Windows users since they don't get native and foreign threading support by default in SBCL though you could probably use FFI and get around that anyway. People be like
>but all those ()'s
but then they don't realize that proper indentation (easy in emacs) makes it so that you don't even really pay attention to them anyway. Then quicklisp is a fucking godsend. Some might say that CL is missing certain things but it never comes down to the language in the cases I've seen, more the lack of devs and if you really NEED something a commercial Lisp likely has it for you anyway (but they're expensive).

>>58789865
Being a user of both vim and emacs, I've just migrated to spacemacs (so fucking kill me fgt). But there's SLIME for vim too I think. If you use an IDE though I'm not sure.
>>
library support is more important than language features

syntactic macros are a just a solution looking for a problem
>>
>>58789960
t. inbred
>>
>>58791677
This is why no one likes Lisp.
>>
>>58771804
lol this syntax is joke
disgusting
>>
>>58789766
>C++ is ridiculous and getting worse every revision
Not a fan of C++ but I think they are making it less shitty each version.
They added cool stuff like shared/unique pointers. And they are working on adding more functional features like pattern matching.
Sadly they can't change the syntax.
>>
>>58777179
python hardly looks like pseudocode with all lambdas and one-liners

but yeah newbie python code may look like pseudocode
>>
>>58789931
>Being a user of both vim and emacs
Oh dear.

>>58791765
>Sadly they can't change the syntax.
Sadly they can't change the fact that one can't write
union u {
std::string s;
int i;
}


Too bad D is a failed language, they fixed it.

>>58791782
>python hardly looks like pseudocode with all lambdas and one-liners
More important, pseudocode should be something easy to write on paper/whiteboard.
Indenting stuff on that medium sucks.
>>
>>58791892
>tfw we will never get a good, safe and high performance industry standard language
>>
>>58791765
I think your last line
>Sadly they can't change the syntax.
is probably the worst part really. Yeah I guess you could learn all the new features they're going to try to strap on to it and the new syntax to accommodate it, but it just makes me like Lisp more because you don't have that issue when you have homoiconicity. Eventually the committee is going to paint themselves into a corner because adding new things needs to be backwards compatible syntax wise. I'll admit, sure there's some nice things in C++ vs C (constexpr I guess?), but the divide between compile time and runtime is still going to be there while Lisp will continue to let you blur that line however you want with macros and evaluation (even in the case where you want to be more traditional, macros still give you the power of Lisp at compile time). I actually had a C++ guy who gives corporate training give me a presentation (because if there's something good in there please let me like C++ a little more), but I don't think there's anything left that other languages (either separately or in combination) can't do better. C covers me for all the bit twiddling and exporting libraries with it is dead simple (as well as accessing C libraries from other languages). One thing that frustrated me more is the thing about OOP that C++ likes to say it has over C, when object orientation can be done in C (although no one teaches that to you, there's articles though and the Linux kernel that you can use as a reference). Lisp to my understanding can also do OOP better but I still have more investigation to do with that aspect.

It really just comes down to Lisp giving me everything I like about other languages in one package and letting me choose what I want to use and when. I'm not saying it's perfect by any means (debugging macros, all the different implementations though I consider that more a strength) or the be all end all, but compared to most languages it's pretty comfy and deserves a chance.
>>
>>58791907
Memes aside, that is what Ada, Rust and some proprietary, semigraphical industry PLs no 4chink pleb ever heard about are for.
They have what D lacked from the start: A clear direction what to archive.

Not much fun, but I hope Jai becomes the fun language.
>>
>>58791892
Vim for dem quick edits, spacemacs for everything else. It's funny how that happened. I started in emacs because the idea of it was nice, but the keybindings weren't intuitive. Vim keybindings are what I prefer on pretty much everything now, but knowing the emacs keybindings helps sometimes too when programs are made with readline support or when I need to do something in spacemacs but there's no binding for it.
>>
>>58791982
Ada usage is fallin. But I hope Rust gets more traction.

Not crazy about Jai as it mostly seems like Blow tailors it specifically for him and adds features as he goes along.
I think it would have been better if he had designed it for more general use, but we'll see.
>>
>>58789766
>The only language so far that gets a pass is Haskell

u mena F#?
>>
>>58792034
>Not crazy about Jai as it mostly seems like Blow tailors it specifically for him and adds features as he goes along.
>I think it would have been better if he had designed it for more general use,
Maybe. However, it's already better than C and C++ and even probably Rust to create interpreters in thanks to its metaprogramming abilities.
I hope he doesn't create the standard libraries on his own, though.
>but we'll see.
This, I'll give it five or ten years to stabilize, as that is usually what it takes.
>>
>>58792060
I meant Haskell. I'm not too big on .NET though so it might be better for your situation. I guess I should bring up I haven't looked into Erlang also but it seems interesting.
>>
>>58791907
>what is rust
>>
>>58791982
Problem with ada is that you either manually manage the memory, use the gc, or leak memory. Also it's ridiculously verbose, even more than java. Other than that it's a really solid language for sure, I was really surprised the first time I looked around.

Problem with jai is that it's a rust ripoff without the things that make rust good, and with go syntax (i.e. literal cancer) tacked on.
>>
>>58789766
>(and even then you could write a Lisp that'll emit native code or compile to C).
That's what the bandicoot devs did by the way, their lisp emits native PS instructions.
>>
>>58789766
Honestly, haskell and ML are no better than java when compared to lisp. They really don't have any advantage over anything else, it's just a different paradigm (I enjoy it but it's purely a flavor thing instead of having distinct advantages without equivalent disadvantages as counterparts - haskell in particular).
The only reason why I don't use lisp is because there's no good lisp that doesn't need memory management and at the same time doesn't use a GC, while also having non-shit syntax for static typing. The latter is available in many lisps, but then you get other sets of problems, such as 64bit types actually being 61bits with indicator bits (most lisps, including chicken), or the type system being chuckfull of bugs (racket), or undocumented yet undefined behavior permeating the language (guile), or shitty syntax and a stagnant standard (common lisp)
>>
>>58792162
I don't get the love for Haskell at all. It's as hard to read as Perl but without the excuse of being a hacker language.
>>
>>58779010
this is 10x worse desu
god bless python
>>
>>58792242
>rust
>industry standard
>>
>>58792328
>
>
>^ invalid syntax
>>
>>58792280
And that's what made me take a second look at it. With Lisp I think it's important for people to realize that there's a difference between the language (of which there are many dialects but 2 main ones CL and Scheme), and the implementations of those dialects. It's not like other languages like C where you only really have 1 spec that everyone uses (unless you're counting those people who use C89, C99, C11 separately because their compiler doesn't support one or the other). For the most part I think we can agree that everyone can at least use C99. Because the language syntax is so minimal you can make tools if you want to fit your needs (or adapt existing implementations). You can't say
>Lisp is slow
and then turn around and see fucking Andy Gavin running games on constrained hardware using Lisp (and beating out other games at the time in performance) and tell me it's still slow. The implementation you might be pointing to is slow and if you want something else then Lisp syntax is so easy to parse that you should be writing something else for your constrained purposes (just look at all the 6502 assemblers out there in Lisp which could likely have more abstractions built on top of them if you want to make it easy for you). That motherfucker had live reloading going on with the PS2 and I think that development should be that way. If you really have to use C then just FFI on to it and reload it as a shared lib with all your variables sitting in Lisp. You have motherfuckers live coding audio and graphics
https://www.youtube.com/watch?v=PqwuIfl-G1w
and people be like
>na I don't want that, there's too many ()'s
The possibilities are crazy and it needs more recognition in the dev community so we can leave behind things like C++.
>>
>>58792262
>Problem with jai is that it's a rust ripoff without the things that make rust good, and with go syntax (i.e. literal cancer) tacked on.
I don't see too much safety cancer in Jai and whole compile time execution in Rust. And the syntax isn't even decided. Looks like you are wrong, m8.
>>
>>58792446
(You)
>>
>>58792477
Don't worry, I'm not going to spend all my (You)s at once, I'm somewhat responsible when it comes to actual values.
>>
>>58792316
I messed with Chicken for a bit but I needed foreign native threading so CL on SBCL filled that. I didn't find the syntax to be all that bad (but then again I came from C++ -> C -> Lisp). Certainly there were some things that were uglier than Scheme but the practicality for me made it worth it.
>there's no good lisp that doesn't need memory management and at the same time doesn't use a GC
I'm probably not aware of how, but I imagine there's a way where you could do something similar to how C++ does destruction of memory (if that's what you mean by memory management w/o a GC). There's also different GC's around and maybe one or the other could fit your particular use case. In the case of SBCL, I think you can make the GC more or less aggressive. There's always going to be that trade though and when I really don't want anything in my way, I just fall back to C with Valgrind and a strict style. Certainly most of the other things you mentioned can be fixed if more devs come around (other than I guess the indicator bit thing but who knows, I'd need to read more about it).

>>58792325
Yeah the amount of symbols in the language are overbearing. If they didn't go down that path I'd probably be more motivated about it. I think it's type system is nice though (in the limited scope that I know about it) and there's likely something that I could carry back with me when programming in other languages. I like getting new perspectives. I'm also interested in how they address their metaprogramming issue (with so many symbols, they probably need a clever solution).
>>
File: practical-clojure[1].jpg (5KB, 150x198px) Image search: [Google]
practical-clojure[1].jpg
5KB, 150x198px
>>58778791
>knew CL beforehand
>learned Clojure back when the most current language version was 1.2 and liked it then
>1.3 introduces sweeping changes
>now out of the loop with whatever massive differences there are now
Are there any recommended books for learning a more up-to-date version of the language?

Also just wanted to say pic related was a shitty book even back then, why did I buy this
>>
>>58780432
>windows
why haven't you killed yourself yet?
>>
>>58787865
you are dumb
>>
>>58792495
>I'm probably not aware of how,
There are actually several toy implementations, like carp, prescheme or linear lisp, but they're nowhere near ready for prime time. Prescheme in particular is all but abandoned.
>>
>>58778562
I think you mean ({()=>{()(()=>({},{{},{}},(()=>{({})}),()),({},{})=>({{}})):{():()})
>>
> despite so much evidence showing it's value
>it's
my favorite memory of the lisp meme is when paul graham made leddit founders build the site on lisp

and they had to recode the whole thing in a proper language because it went tits up the moment the usercount exceeded 1000 no matter what
>>
>>58778188
Gimp uses both Lisp (script-fu) and Python for plugins.
>>
>>58793385
https://redditblog.com/2005/12/05/on-lisp/
http://www.aaronsw.com/weblog/rewritingreddit

Lispers BTFO
>>
>>58788645
>That's not even coherent syntax.
Sussman specifically explains why your statement is false in the SICP lectures.
You might want to evaluate the result of calling a function, in which case you'd use ((func)). And if you want to evaluate the result of that call, you could use (((func))).
>>
>>58793473
>The Python version had less code that ran faster and was far easier to read and maintain.
SAVAGE
>>
>>58793616
Maybe he was a lisp noob and wrote a horribly inefficient program.
>>
>>58793638
This. Even the shittiest lisp implementation is an order of magnitude faster and more concise than the equivalent python.
>>
>>58793638
sure champ
>>
>>58793616
>>58793473
Probably this: >>58793638
>he was a lisp noob and wrote a horribly inefficient program.

When Fontaine migrated pgloader from Python to Common Lisp, the new version blew the old one out of the water
http://pgloader.io/
>>
>>58793473
Notice how on the entire blog, jwarz avoids answering the question of why they switched from lisp, yet responds to questions about why they didn't use other python frameworks, regardless of the order in which the questions were asked. Really makes you think, huh?
>>
>>58793795
That's why I linked the reddit blog entry. In fairness, though, their stated reason is kind of retarded.
>>
>>58793902
So you're saying he lied about the development speed and runtime speed in his personal blog.
>pythontards
>>
>>58793473
>I develop on a Mac
wew lad
>>
>>58794060
Many such cases!
>>
>>58794021
Can you read? The official reasons reddit gave for switching were "muh mac development" and "muh libraries".
>>
>>58794103
(You)
>>
>>58794120
Y-(You) too.
>>
>>58794141
>>58794120
Get a room, (Jew) two
>>
>>58771804
because Python exists
>>
>>58788645

Of course I do, starting in terminal mode makes no difference, it's not x11 that is slow it's the elisp.

There is no asynchronous stuff in emacs which makes it so you can't even fake it loading fast
>>
>>58794397
Python is shit
>>
>>58793473
>2005
Surely over a decade things have changed between then and now. Also you can use Python under Lisp now.
>>58789841
>>
File: 1477209517690.png (371KB, 832x868px) Image search: [Google]
1477209517690.png
371KB, 832x868px
>>58787386
Why is order of argument evaluation important? Think about it. It isn't.

If you find you need to force the order of evaluation, there are letrec and let* in scheme.

>>58791976
You're missing the point of lisps. The idea is to remove complicated and (clearly optional) syntax and have one useful syntax, the s-expression... If you can't read what each applied procedure does by its name, your code is probably too dense anyway.
Thread posts: 214
Thread images: 17


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.