News for hackers. Stuff that matters.
Re:Unix as IDE by qwertyuiop924 on Thursday October 06, 2016 @02:29PM (#12654835)
They were also really expensive, and there have always been people who hated Lisp for the syntax.
Re:Unix as IDE by DonaldFisk on Thursday October 06, 2016 @02:43PM (#12654942)
On Symbolics Genera they had the option of using C, Pascal, Ada, Fortran, or Prolog.
Re:Unix as IDE by catnaroek on Thursday October 06, 2016 @03:12PM (#12655206)
Lisp's syntax is okay, but its semantics is absolutely horrendous. Even ignoring the features that make it not so great a high-level language (such as the lack of a workable static semantics, forcing programmers to dynamically test what can be taken for granted in more civilized languages), Lisp is an even worse low-level systems language. In the 80's, the only way one could reasonably hope to use Lisp as a systems language was to run it on hardware explicitly designed to run Lisp. Of course, hardware support for features like dynamic typing and efficient dynamic allocation of lots of small objects doesn't come for free - this is what made Lisp machines expensive.
Re:Unix as IDE by qwertyuiop924 on Thursday October 06, 2016 @03:36PM (#12655392)
Well, some of us like Dynamic Typing. Just because you don't doesn't make it horrendous.

Given, it can be unpleaseant in certain contexts, but Lisp has really good metaprogramming support, so you can add syntax for a runtime type system relatively simply. It's not optimal, and it certaibly isn't the fastest thing, but it works if you want it.

And nowadays, CL (and several of the Schemes) provide more powerful type systems, and sometimes even compile-time typing. All optional, of course.

Re:Unix as IDE by catnaroek on Thursday October 06, 2016 @06:57PM (#12656824)
I don't have anything against the presence of dynamic typing - it's in fact very useful. What's annoying is the absence of meaningful static typing: parametric polymorphism and exhaustive pattern matching help me prove things about what my code does and how it can be used by others, but their usefulness is reduced to zero when dynamically typed code is allowed to break the proofs' assumptions. To be perfectly clear: it doesn't bother me in the slightest that a dynamically typed module can break the internal state of another dynamically typed module, since in most likelihood I'm the author of neither, and I respect other people's right to write their code however they wish. So I'd be fine with a Racket-like contract system, where well-typed modules can't be blamed. But, if I understand correctly, what Common Lisp has is nothing like this.
Re:Unix as IDE by qwertyuiop924 on Thursday October 06, 2016 @07:49PM (#12657086)
I don't know. I'm not a CL user. I understand that they actually do have a type system, which can be used to verify that your inputs are of the correct type and match your assumptions. As for contracts, I wouldn't be surprised if someone wrote a macro for it: they're not exactly rocket science, at their simplest.

Don't ask me: I'm using Chicken Scheme, which provides both (to an extent: The documentation is worryingly vague about how the type system handles failure).

Re:Unix as IDE by catnaroek on Thursday October 06, 2016 @10:45PM (#12657778)
Checking alone isn't the point. As things stand, it's no better than C, where the type checker can approve your code, yet it still has undefined behavior.
Re:Unix as IDE by qwertyuiop924 on Friday October 07, 2016 @05:59AM (#12659384)
So you want exhaustive matching? I don't know if any lisp provides that by default. One of them probably does, somewhere.

But since you don't mind Lisp syntax, and really like type systems, have you tried Shen? (http://www.shenlanguage.org) it's an interesting project.

Re:Unix as IDE by catnaroek on Friday October 07, 2016 @11:06AM (#12661224)
> But since you don't mind Lisp syntax, and really like type systems, have you tried Shen?

I also want:

(0) Type inference. Shen seems to require all typed code to be manually type-annotated.

(1) A decent module system. There seems to be no mention of abstract types in Shen's documentation.

(2) A guarantee that dynamically typed code won't break abstractions defined in statically typed code.

Re:Unix as IDE by qwertyuiop924 on Friday October 07, 2016 @11:29AM (#12661411)
I'm pretty sure shen has limited type inference. There might be ADTs.
Re:Unix as IDE by lispm on Thursday October 06, 2016 @03:52PM (#12655513)
Nice rant, but mostly wrong.

> Even ignoring the features that make it not so great a high-level language (such as the lack of a workable static semantics, forcing programmers to dynamically test what can be taken for granted in more civilized languages)

There are many more high-level features, than static semantics. Lisp is designed for runtime flexibility, not static semantics. Runtime flexibility allows lots of interesting high-level features.

> In the 80's, the only way one could reasonably hope to use Lisp as a systems language was to run it on hardware explicitly designed to run Lisp.

Lisp ran fine on five MIPS machines. Current systems have several hundred times the compute power.

The hardware was explicitly designed for Lisp in the late 70s when nothing comparable was available (single-user powerful workstations for AI/Math researchers developing large systems like Macsyma) and most development took place on time-shared mainframes with many users. The market that demanded this was a high-end market, thus the systems were developed, even though the were expensive.

Starting in the mid 80s, Common Lisp was moved to 1 to 10 MIPS workstations from SUN, SGI, Apollo, DEC, IBM, NeXT, Tectronix, and many others. The main problem at that time was that it would need 10 MByte RAM to run efficiently, which was expensive in the early 80s.

10 Mbyte. Today Lisp runs fine on an modern processor and some people tinker with Lisp-based operating systems, again.

> Of course, hardware support for features like dynamic typing and efficient dynamic allocation of lots of small objects doesn't come for free - this is what made Lisp machines expensive.

What made them expensive was the custom development for a small market, ten to twenty years ahead of their time. It was not the technology complexity of the hardware. People were buying future technology for lots of money, where comparable technology would appear 20 years later - the first Lisp Machines with object-oriented operating systems appeared in the late 70s for $100000 a piece.

Some of Lisp Machines used 8 bit ECC to provide error checking and correction, when memory wasn't that reliable. It made them even more expensive, because ECC memory was even more expensive than normal memory boards. With memory sizes from 4MB to 20MB.

Minor Lisp/Smalltalk support then went into the SPARC chips from SUN. Lisp ran quite well on those.

> dynamic typing and efficient dynamic allocation of lots of small objects

Every iPhone does that now, since Apple's Objective-C and the iOS frameworks are actually that: efficient dynamic allocation, of runtime-typed small and large objects.

If you want to see Lisp on a small machine, buy a Roomba cleaner.

http://www.irobot.com/For-the-Home/Vacuuming/Roomba.aspx

Their software was developed in Lisp already twenty years ago on tiniest hardware.

https://en.wikipedia.org/wiki/Roomba

L – A Common Lisp for Embedded Systems https://www.cs.cmu.edu/~chuck/pubpg/luv95.pdf

It will clean your home, using Lisp on tiny hardware.

Re:Unix as IDE by catnaroek on Thursday October 06, 2016 @07:50PM (#12657088)
> 10 Mbyte. Today Lisp runs fine on an modern processor and some people tinker with Lisp-based operating systems, again.

My main desktop machine has 16 GB RAM, and its processor cycle speed is probably also 1600 times as much as that of a machine from back then. Why can't I get my computer to perform 1600 times as much concurrent work as back then?

> Every iPhone does that now, since Apple's Objective-C and the iOS frameworks are actually that: efficient dynamic allocation, of runtime-typed small and large objects.

That's a luxury that we can nowadays afford. Even the cheapest entry-level smartphone is ridiculously more powerful than an 80's era workstation. But the amount of work computers do for us hasn't grown proportionally to the amount of computing power.

Re:Unix as IDE by lispm on Friday October 07, 2016 @02:52AM (#12658703)
> Why can't I get my computer to perform 1600 times as much concurrent work as back then?

Is that a real question?

> But the amount of work computers do for us hasn't grown proportionally to the amount of computing power.

I don't know about you, but my laptop is much faster than previous machines. Software which used to compile with the Lisp compiler in half an hour, now compiles in a few seconds.

Re:Unix as IDE by qwertyuiop924 on Thursday October 06, 2016 @08:04PM (#12657165)
...exactly. So there's computing power to spare.
Re:Unix as IDE by catnaroek on Thursday October 06, 2016 @10:46PM (#12657781)
To spare, you say? I want to use that computing power for my own purposes. I suddenly decided I want to multiply gigantic matrices.
Re:Unix as IDE by qwertyuiop924 on Friday October 07, 2016 @06:03AM (#12659405)
Okay. Go write some C, or some Asm. It might feel unpleasant to you, but if you use most other langauges, you'll be wasting too many cycles, and you won't be using that computing power for your own puposes. Don't forget to use as few abstractions as possible, and remember: every function call takes valuable time and computation.
Re:Unix as IDE by catnaroek on Friday October 07, 2016 @11:00AM (#12661169)
> Don't forget to use as few abstractions as possible

Huh? I'm perfectly fine with abstractions. Just not with abstractions that are suboptimally designed and implemented.

> Don't forget to use as few abstractions as possible

Maybe you're confusing abstraction with runtime dispatch?

> every function call takes valuable time and computation.

Stroustrup's (whom otherwise I don't regard as a great language designer) principle applies: abstractions must elaborate to the best possibly code you would've manually written.

Re:Unix as IDE by qwertyuiop924 on Friday October 07, 2016 @11:57AM (#12661633)
Every abstraction has a cost somewhere. If you want to use your computer to its full potential, avoid them all.
Re:Unix as IDE by catnaroek on Friday October 07, 2016 @09:49PM (#12665228)
> Every abstraction has a cost somewhere.

It's very simple:

(0) Runtime performance degradation is unacceptable.

(1) Increased compile times are annoying, but they're tolerable in exchange for more exhaustive automatic static analysis. Anything of interest that the compiler can't prove about my code, I would have to prove myself by hand anyway, which would take even more time than the slowest automated static analysis.

Re:Unix as IDE by lispm on Saturday October 08, 2016 @03:45AM (#12666082)
> Runtime performance degradation is unacceptable

Requirements like these are not grounded in real software use.

In economic terms: a cheaper/slower software can be acceptable over a more expensive/faster software. Example: Java-based software vs. the same written in C++.

In reliability terms: a more robust / slower software can be acceptable over a more expensive/faster software. Example: Erlang-based software vs. C++ software on a network switch.

And so on.

Abstract/absolutist requirements like 'Runtime performance degradation is unacceptable' is not often found in actual software development/use.

Software usually has a multitude of different important qualities. Raw performance is just one of these. Especially one then needs to say what performance exactly and how to measure it. Performance can be measured in many ways: throughput, latency, micro-benchmark speed, etc. etc. Optimizing one (say, throughput) then has effects on others (say, latency). To achieve faster throughput, some functionality can be affected.

Re:Unix as IDE by qwertyuiop924 on Saturday October 08, 2016 @04:51AM (#12666195)
All abstractions degrade runtime performance. Even "zero cost" ones, as they get you to think in less efficient ways, about things like encapsulation, and whatnot.

If runtime perf degradation is really unacceptable to you, you shouldn't be writing in functional languages, or even C. You should be writing in raw asm, as low-level as possible.

Re:Unix as IDE by catnaroek on Saturday October 08, 2016 @06:04PM (#12668928)
Encapsulation is making the internal representation of abstract data types not visible to their clients. In other words, it's a discipline for writing programs. Some languages (e.g., ML) just happen to helpfully enforce that discipline for you. It has no runtime impact whatsoever.
Re:Unix as IDE by qwertyuiop924 on Saturday October 08, 2016 @07:11PM (#12669150)
Not true. While the various abstractions themselves may have no runtime impact, they encourage programming in ways that, while they may be good for maintainability, aren't as fast. For example, if you're using ML, you'll likely represent a list of objects (say, structures representing addresses) by establishing a type for the objects, and keeping a list of them. A C programmer might use a statically allocated array, or actually embed a pointer to the next object in the list into the struct. The C program might be less maintainable, but it would be faster because it's doing less pointer chasing. An asm programmer might optimize further.

Now, this is a fairly trivial example, and not too hard for a compiler to optimize out, IIRC, but it's just an example. Other instances of this are far harder to optimize away.

The further up you are from the hardware, the less aware you are of the perf tradeoffs, and the less you can do to fix it. So if you want the best perf, go for asm.

Re:Unix as IDE by catnaroek on Saturday October 08, 2016 @09:18PM (#12669450)
> For example, if you're using ML, you'll likely represent a list of objects (say, structures representing addresses) by establishing a type for the objects, and keeping a list of them.

In ML, most of the time I don't work with objects at all. I work with values. The beauty of programming with values is that the language implementor can represent them however he wishes, as long as he respects the semantics of the operations on said values. For example:

(0) Multiple logical nodes of a recursive data structure can be represented as a single physical node, eliminating the need to store pointers between them. For example, an ML implementation can determine that `List.tabulate (n, f)` always creates a list with `n` elements, and thus always pre-allocate a single large enough buffer before actually computing the elements. In Lisp, this wouldn't be a valid optimization, because Lisp mandates that every cons cell has its own object identity.

(1) Values with large representations can be automatically deduplicated, hash-consed or whatever it takes to reduce their memory footprint. Again, this is only possible because physical identities don't matter in ML (except for mutable cells and arrays).

In other words, values give the language implementation freedom to make useful physical data structure choices. Unlike objects, which come tied to a fixed representation.

There is no tradeoff between abstraction and efficiency, when you use the right abstractions.

Re:Unix as IDE by qwertyuiop924 on Thursday October 06, 2016 @05:06PM (#12656113)
As much as I frequently disagree with you, you hit it on the head here.