Lisp

Why should I learn lisp?
are there any benefits?

Attached: Miyamizu_Mitsuha_On_Ownership_And_Borrowing.jpg (1920x1080, 314K)

Other urls found in this thread:

all-things-andy-gavin.com/2011/03/12/making-crash-bandicoot-gool-part-9/
karma-engineering.com/lab/wiki/Bootstrapping1
twitter.com/SFWRedditVideos

you can use emacs I guess

How does it help me with emacs? Also I use vim

It's a different approach to programming. It's always beneficial to try things out from a different perspective.

It won't make you l33t but it won't hurt your chances either.

emacs is basically just one big lisp machine, its more or less an operating system centered around lisp

Helps you learn a different way to think about programming. Also you can emacs.

1) A very simple language, its grammar fits on a postcard. Using such a simple language is a joy in itself. 2) It is really easy to write macros in it, that is functions that take lisp code as input and give lisp code as output. This makes lisp the king of macros and you can do crazy shit with it: The Jak & Dexter series on playstation 2 for example: all-things-andy-gavin.com/2011/03/12/making-crash-bandicoot-gool-part-9/ (Long article, I suggest reading the last two paragraphs first).

The downside - as with every language that does not hold your hands like java - is that one needs higher discipline, otherwise the code get's unmantainable. Also, one should not overdo macros.

Let me tell you something. The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't know what it means for a programming language to be powerful and elegant. Once you learn Lisp, you will see what is lacking in most other languages.

Unlike most languages today, which are focused on defining specialized data types, Lisp provides a few data types which are general. Instead of defining specific types, you build structures from these types. Thus, rather than offering a way to define a list-of-this type and a list-of-that type, Lisp has one type of lists which can hold any sort of data.

Where other languages allow you to define a function to search a list-of-this, and sometimes a way to define a generic list-search function that you can instantiate for list-of-this, Lisp makes it easy to write a function that will search any list — and provides a range of such functions.

In addition, functions and expressions in Lisp are represented as data in a way that makes it easy to operate on them.

When you start a Lisp system, it enters a read-eval-print loop. Most other languages have nothing comparable to `read', nothing comparable to `eval', and nothing comparable to `print'. What gaping deficiencies!

While I love the power of Lisp, I am not a devotee of functional programming. I see nothing bad about side effects and I do not make efforts to avoid them unless there is a practical reason. There is code that is natural to write in a functional way, and code that is more natural with side effects, and I do not campaign about the question. I limit my campaigning to issues of freedom and justice, such as to eliminate nonfree software from the world.

Depends.
Do you already know several functonal programming languages? In that case there is no real reason.
Otherwise it will help you insert pure functional parts into your imperative programs.

after using common lisp i looked at functions in c differently. i now use side effects sparingly and try to avoid writing functions that return primitive types. a function should construct complex types according to the passed arguments and return the result as a new instance of the type. helper functions are the exception to the rule here and should rarely if ever be accessed from outside of a complex type returning function.
i now view functions that return void as utterly useless as void tells me nothing about the state of the computation within the function. did it finish? are there any bugs in there? who knows, it returns literally nothing. it's like having an employee work for you who never turns in his work. is he actually working? is he doing it right? i guess we'll never know because he never reports back to us.
lisp is a very interesting take on computation and you can learn a lot about elegance from it, but it's not very good for creating real applications, it's mostly an academic thing. learning lisp will make learning new and important concepts easier, and then you can apply those concepts to other, more useful, languages.

Based.
Funily my first semester programming course started with scheme, but I only saw it as a nuisance after being self taught for 3 months in Java. Weirdly it clicked for me not with scheme, lisp, or haskell, it clicked when I was doing Verilog. I thank my professor for that insight, reducing global state is one of the best things you can do and if a functional language helps you learn that, that is a great thing.

When I was still very inexperienced I wrote a Java OCR system for some software. It was all over the place, state everywhere. I then extracted all the parts that didn't need to have state, unit tested them and was left with 3-4 variables of global state. I don't know if now I could code it without any global state, but probably not. However reducing state, is great and could even be called a pattern.

> a function should construct complex types according to the passed arguments and return the result as a new instance of the type.

Is it possible to learn this power?

I just want to say that Packt books suck.

Not from a Cnile.

Feels like the type of language you want for coming up with modern programing abstractions.

i meant to say
>a function should construct complex structures according to the passed arguments and return the result as a new instance of the function type.
start by structuring your data in a sane way then write functions around the data structures. mangling data any more than you have to makes messes and hides bugs. types should be transparent and functions should be opaque. the high level functions in a program should take one or more data structures and return a data structure upon success, or useful error messages on failure. creating your own error codes and creating a vector of strings to describe each possible code is a good excuse for using a global variable, much like errno in the standard library. if your working with concurrency you can create a variable in the structure itself and check the structure upon return to see if the error code has been set.

So write a function ser_user name() which takes a struct User and returns a struct User, maybe make the first element an int for returning the status kind of like Go?

If so is that efficient?

You can offset the load on your edge routers so that they only need to process routes relevant to clients behind them. In addition up mobility is greatly improved. This is a great benefit for wireless users that will roam constantly. From a client perspective nothing ever changes and they will not need to get a new ip via DHCP when they roam. From a routing perspective all of the work is being done by the CP so routing updates are seemless.

Attached: Lisp-logo.jpg (763x427, 66K)

First, you should in general bother to learn plenty of languages not from the ALGOL family. Each language will give you a new way to think about problems and express solutions differently. It'll expand your toolbox and your mind.
Now, why you should learn lisp in particular? It has minimal syntax, it's expression based, very elegant, lends itself well to functional programming. Even if you don't write a line of lisp in production your code will be better, but you should aim to write lisp in production as well. Your functions will be easier to test, the systems will be clearer. It's always more pleasant and clearer to work with data than with objects.
I recommend giving Clojure a try, it's really based.

I just find it crazy you can modify the code of running lisp programs. C & C++ can't compete

It's very fast, flexible, and stable. You can write code that performs well and will run 15-20 years from now unchanged.

Oh, that is simple.

The decent schools like MIT used to teach in Scheme because it has no syntax *and types* clutter and nevertheless is a *SAFE* language (all the types are checked at runtime and error are trapped (do not propagate)),

So, by learning Lisp (Racket, Common Lisp) you are learning Highest (possible) Level of programming.

Things like homoiconicity and read macros enlighten you to realizations how important List structures are.

Common Lisp will teach you that everything is possible, including in-place updates when needed.

But the most important thing is, you will never be able to look at PHP, JS or Java otherwise than with utter contempt and disgust.

karma-engineering.com/lab/wiki/Bootstrapping1