News for hackers. Stuff that matters.
Re:Lispers by Fej on Sunday August 20, 2017 @03:04AM (#15057309)
Lisp is a beautiful language (or, to be more precise, set of languages). It is absolutely essential to a computer science education.

It also gets unwieldy when programs get complex.

Re:Lispers by lispm on Sunday August 20, 2017 @09:51AM (#15058397)
That depends. Several mildly large programs have been written in Lisp. There should be code bases for applications reaching or surpassing ten million lines of Lisp code. There also should be code bases with relatively complex code, which have been maintained for more than a decade. For example the Cyc system is under continuous development since the mid 80s.

A dialect like Common Lisp was designed such that applications in the large are possible. As any large program it needs a bit thought how to make a scalable architecture and how to best use and extend the facilities provided by rhe development environment and the language.

Re:Lispers by vram22 on Sunday August 20, 2017 @12:41PM (#15059091)
>A dialect like Common Lisp was designed such that applications in the large are possible.

Interesting. Can you mention some of the Lisp language or other features that help with that?

Re:Lispers by lispm on Sunday August 20, 2017 @01:25PM (#15059270)
Note that in a large Lisp system you need certain features at compile time, but some will help at runtime (like the error handling system) to make large software debuggeable, more robust, or both.

* namespaces for symbols, in earlier days Lisp had a flat namespace

* compilation of files, means in a large system you can use 'ahead of time' compilation, where the compiler might give a lot of diagnostic messages. There is very little penalty to that, basically one can compile always and interactively.

* type declarations/hints which can be used for optimization, type checks -> see SBCL and CMUCL, and documentation

* lots of declaration forms which can be checked at compile time or runtime

* macros which can be expanded at compile-time. This can create early warnings/errors.

* function arglists, where the usage can be checked at compile-time (missing arguments, added arguments, ...)

* keyword arguments, which makes code more readable

* a very elaborate error handling system, which can not only catch errors, but which can be used to interactively or automatically repair some errors. Thus you don't get 'program crashed', but a handler gets called in the error context, which than can use provided explicit restarts. Errors types can be organized in an ontology with inheritance.

* runtime assertions and type checks work with the error system

* documentation features included: many declarations allow documentation strings

* robust runtimes which by default prevent corrupting the running Lisp as much as possible. Some earlier Lisps created unsafe compiled code. By default I would expect a Common Lisp system to detect all kinds of wrong access to data structures at runtime.

* optimizations, which can be restricted to certain code blocks

Plus

* an object system which can be used to provide extensible software, typically used to structure larger software. Also provides multi-methods which prevent being called with arguments of wrong types at runtime. Multiple inheritance. This allows a lot explicit structure in larger applications, which also can explored by reflection and which can be tailored for specific needs.

* features like macros and reader macros can increase the code density in larger software -> fewer lines of code and domain level code. By default Common Lisp favors larger identifies, but in larger codebases macros can significantly reduce code size and make external tools like preprocessors obsolete.

A different development methodology:

In static languages you tend to statically compile a program, build it, start it, test it. May be in some debug mode or with some kind of extension language interface.

In Common Lisp one may develop with a build while it is running and then make sure that these builds can be reproduced by compiling/loading the whole thing. This can reduce the typical development cycle time drastically. But different development models are possible: fully batch, pre-compiled + interactive, fully interactive.

Re:Lispers by vram22 on Sunday August 20, 2017 @02:07PM (#15059487)
That's a lot of points. A few of them are there in other languages (e.g. compilation, keyword arguments, etc.) but I can see that there are many points which I am not aware of in some other languages. Thanks for the detailed reply.
Re:Lispers by lispm on Sunday August 20, 2017 @02:11PM (#15059510)
Many things (like compilation) are not that special, but having it in a dynamic (-> at runtime changeable) language with a lot of flexibility is slightly different.
Re:Lispers by vram22 on Sunday August 20, 2017 @05:51PM (#15060422)
Interesting. I think I've read about something like this in an article by Paul Graham - I think he said that Lisp is a language which can read and compile code at run time, and the other two combinations too (e.g. read and run at compile time, and so on). If this is what you meant, can you give a practical example of the use of compiling code at run time?
Re:Lispers by lispm on Sunday August 20, 2017 @06:20PM (#15060528)
If one develops a Lisp application, it is common to develop the application while it is running. This is enabled by a compiler available at runtime.
Re:Lispers by vram22 on Sunday August 20, 2017 @06:42PM (#15060605)
Got it, thanks. I was thinking it might be useful for certain kinds of cases only (maybe only certain advanced types of functions or use cases), but now I see that it is generally applicable, in the example you gave.
Re:Lispers by sds2 on Sunday August 20, 2017 @06:40AM (#15057849)
No, it shouldn't be. Lisp is not practical(try to prove it otherwise, there's no evidence) and it's only a thing now because some ppl likes its esoteric syntax. It's way too overhyped.
Re:Lispers by Risord on Sunday August 20, 2017 @08:44AM (#15058186)
Real apps has been built with lisp so therefore it's at least some what practical. On the other hand I just cannot see anything fundamental which makes lisp lot less practical from many commonly used business languages. Well ecosystem size may not same but on day one most languages haven't Hugo ecosystem.

There are lot of schools and if you are "be a cool web app developer"-school where you learning direct skills reauired most common web dev jobs today... Yeah lisp is not essential. But if you are "computer SCIENCE"-school and you targeting variety of fundamental cocepts of field I say that lisp is quite essential.

Re:Lispers by sds2 on Sunday August 20, 2017 @09:17AM (#15058292)
> But if you are "computer SCIENCE"-school and you targeting variety of fundamental cocepts of field I say that lisp is quite essential.

I'm sure you've nothing to do with compsci because lisp is a useless language family. If anything is recommended than it's rust, c and idris.

Re:Lispers by shakna on Sunday August 20, 2017 @01:35PM (#15059323)
> I'm sure you've nothing to do with compsci because lisp is a useless language family. If anything is recommended than it's rust, c and idris.

Scheme is particularly suited to parsing, interpreting and compiling.[0][1] There's a reason GCC's internals often look like Lisp.

If you exclude language design from computer science, then maybe Lisp becomes a "useless language family", but there's a reason MIT Scheme was created.

[0] https://mitpress.mit.edu/sicp/

[1] https://en.wikipedia.org/wiki/Lisp_in_Small_Pieces

Re:Lispers by sds2 on Sunday August 20, 2017 @01:48PM (#15059385)
You can do that more efficiently with any ML language.

> There's a reason GCC's internals often look like Lisp.

Dude, that notation is not original to lisp...

Re:Lispers by shakna on Sunday August 20, 2017 @02:15PM (#15059531)
> You can do that more efficiently with any ML language.

So first you say Lisp is useless in compsci because of the existence of "rust, c and idris", and now its pointless to use it because of ML?

> Dude, that notation is not original to lisp...

Firstly: Have you actually looked at an MD file? [0] RTL is a Lisp dialect.

Secondly: The first paper on S-Expressions appeared in November, 1997. McCarthy's first paper on what would become Lisp in 1982. I'm aware of no language, and can find reference to no language, that used that notation before Lisp did, so yes it is original to Lisp.

[0] https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=gcc/config...

Re:Lispers by sds2 on Sunday August 20, 2017 @06:09PM (#15060485)
> So first you say Lisp is useless in compsci because of the existence of "rust, c and idris", and now its pointless to use it because of ML?

Idris and Rust are ML descendants and C helps you to learn the basics of low-level programming. Lisp on the other hand won't teach you anything. How hard is this to understand?

> Secondly: The first paper on S-Expressions appeared in November, 1997.

That was just a draft of an RFC which never got approved. S-Expressions are MUCH older - it's "Polish Notation" invented by Jan Łukasiewicz in 1924

> McCarthy's first paper on what would become Lisp in 1982.

Lisp was specified in 1958.

> I'm aware of no language, and can find reference to no language, that used that notation before Lisp did, so yes it is original to Lisp.

1. It's not about who used that notation but who invented it - not McCarthy; 2. that notation is practically useless for programming languages but they're good for ASTs.

Re:Lispers by shakna on Sunday August 20, 2017 @08:29PM (#15061072)
> Lisp on the other hand won't teach you anything. How hard is this to understand?

Difficult when the definitive compsci course, Structure and Interpretation of Computer Programs starts, and ends, with Lisp.

> S-Expressions are MUCH older - it's "Polish Notation" invented by Jan Łukasiewicz in 1924

No. Polish notation, as described by Łukasiewicz, is:

> I came upon the idea of a parenthesis-free notation in 1924

Polish notation has a strict set of precedence rules, and no parentheses. At all.

S-Expressions contain Polish notation, but is a superset that allows you to specify arguments in a less painful precedence than Polish notation, and with variadic arguments, which is not possible in Polish notation.

> that notation is practically useless for programming languages but they're good for ASTs.

Several decades of computer science disagree with you.

Re:Lispers by progman on Sunday August 20, 2017 @08:39AM (#15058171)
You find many practical examples at planet.lisp.org.
Re:Lispers by webkike on Sunday August 20, 2017 @04:32AM (#15057524)
Lisp is the best language for any task that does not require types.
Re:Lispers by progman on Sunday August 20, 2017 @04:45AM (#15057553)
You can add static type checking in Lisp anytime if you want. Consider the discussion at [1].

[1] http://compgroups.net/comp.lang.lisp/static-type-checking-in....

Re:Lispers by threatofrain on Sunday August 20, 2017 @06:35AM (#15057840)