News for hackers. Stuff that matters.
Re:Of Lisp Macros and Washing Machines (2011) by GhotiFish on Saturday March 30, 2013 @08:21AM (#5465192)

   "But no thank you Microsoft.  No thank you spreadshi^Heets.  No thank you 
    Unix.  No thank you C++.  No thank you unmodifiable syntax.  No thank you 
    von Neumann architectures.  No thank you unrepentant snake oil industry 
    that has lured us into performing the same old menial tasks by mouse instead 
    of by lever and duped almost everyone involved into thinking of this as some 
    kind of progress."
Wow, did he ever go off the rails on that paragraph.

spreadsheets? Unix? C++? Unmodifiable syntax? The theory behind every single one of these concepts was to save time.

Faster calculations, an OS with a simple concept applied everywhere, a language implementing an interesting design pattern, a style designed to reduce bugs.

I don't think I follow this story.

Re:Of Lisp Macros and Washing Machines (2011) by robmil on Saturday March 30, 2013 @08:33AM (#5465221)
Not that I'd necessarily agree with it, but I think you're missing his overall point there: he's arguing that those things are time savers, but only for tasks within the domain they were designed to tackle, whereas macros allow more general and more automated solutions, saving time across all domains.
Re:Of Lisp Macros and Washing Machines (2011) by brudgers on Saturday March 30, 2013 @09:22AM (#5465320)
"I don't think I follow this story."

The author's ultimate reference point is the Lisp Machine. Being Lisp "all the way down," the user could modify running code even at the OS level upon encountering an error or other undesirable result.

Re:Of Lisp Macros and Washing Machines (2011) by Guvante on Saturday March 30, 2013 @02:04PM (#5466149)
The idea of someone updating the kernel due to an undesirable result makes me fear for my life. "That's odd, why is it failing when I deref 0, that is an odd check, I will just remove it"
Re:Of Lisp Macros and Washing Machines (2011) by ScottBurson on Saturday March 30, 2013 @02:11PM (#5466173)
That's why Lisp Machines were single-user workstations :-)
Re:Of Lisp Macros and Washing Machines (2011) by lispm on Monday April 01, 2013 @01:29PM (#5474520)
With minor exceptions.

The LMI Lambda 3x3 was kind of a three user machine.

Re:Of Lisp Macros and Washing Machines (2011) by brudgers on Saturday March 30, 2013 @06:33PM (#5466900)
https://kernel.org/

Be very afraid.

Re:Of Lisp Macros and Washing Machines (2011) by victorh on Saturday March 30, 2013 @12:13PM (#5465809)
Under the assumption that Lisp is the best programming language that will ever be created and the x86 processor is a horribly flawed piece of garbage the author is correct.
Re:Of Lisp Macros and Washing Machines (2011) by jff on Saturday March 30, 2013 @12:24PM (#5465842)
Hey, one out of two ain't bad.
Re:Of Lisp Macros and Washing Machines (2011) by betterunix on Saturday March 30, 2013 @01:33PM (#5466049)
Both are pretty good, actually. Lisp is a great language, and its features have been highly influential (and Lisp-influenced features have generally been good things). x86 is a terrible architecture, and it has only survived because of the need for binary compatibility.
Re:Of Lisp Macros and Washing Machines (2011) by victorh on Saturday March 30, 2013 @10:36PM (#5467463)
I agree but still find the blog author to be a ridiculous caricature. There are also other interesting languages and x86 isn't preventing anyone from hot loading bug fixes.
Re:Of Lisp Macros and Washing Machines (2011) by holri on Saturday March 30, 2013 @06:12AM (#5464969)
Washing Machines did not save time!

This is because with the advent of these machines also our hygiene habits changed. We wash a lot more than before, and therefore there is no time saving but cleaner clothes.

The same is true for computers. They did not save time, they changed the way we treat information. We have a lot more than before to process.

Re:Of Lisp Macros and Washing Machines (2011) by coldtea on Saturday March 30, 2013 @07:33AM (#5465101)
>Washing Machines did not save time! This is because with the advent of these machines also our hygiene habits changed. We wash a lot more than before, and therefore there is no time saving but cleaner clothes.

That's not true. The ratio is not at all the same. Except if you take something like 17th century hygiene habits (and for the poor classes, at that) and compare it to modern day habits.

But we had the frequent clothes washing far before the advent of the washing machine. Not to mention that what you said could also be solved with bigger washing machines and more clothing (so that you can still wash at longer intervals, but you have stuff to wear in between).

Re:Of Lisp Macros and Washing Machines (2011) by arh68 on Saturday March 30, 2013 @10:46AM (#5465534)
Surely you don't mean to refute Hans Rosling's testimony that his mother had more time to read to him? I think you have an interesting viewpoint. If these technologies don't actually save any time, it follows that we spend as much doing X before the technology than after. So 4 hrs/wk washing 1 loads/wk + washing machine => 4 hrs/wk washing 4 loads/wk.

What if you reverse this and apply it to computers? I spend maybe 2-3 hours in Excel every week. If I were born 100 years earlier, would it follow that I'd also spend 2-3 hrs/wk making spreadsheets, albeit at a much slower work pace? It seems doubtful. I've got only a few dozen sheets, tops. Lots of time spent in Excel is tweaking, making things line up / look right, updating kludges, etc. Busywork, basically. Maybe this is my fault; the 'math' tells me I should have lots of sheets, but I get caught up doing busywork on this machine that's supposed to automate the whole ordeal. What a scam!

Re:Of Lisp Macros and Washing Machines (2011) by fractallyte on Saturday March 30, 2013 @03:14PM (#5466339)
Regarding spreadsheets: Excel (and similar) is a great toy for doodling, but for serious work one would want the 'real thing'. In the 80s there was Javelin Plus, then Lotus Improv in the 90s. Now there's Quantrix.

With endemic spreadsheet errors (since the 80s), and far better solutions being ignored (also since the 80s), there's certainly something to rant about! ;-)

Re:Of Lisp Macros and Washing Machines (2011) by holri on Saturday March 30, 2013 @11:32AM (#5465677)
Another example: The advent of the car or plane did not reduce the live time spent on traveling but expanded the ways. People and their priorities and motivations for giving a slice of their live time to a particular kind of activity do not change greatly because of technology.
Re:Of Lisp Macros and Washing Machines (2011) by PhineasRex on Saturday March 30, 2013 @01:02PM (#5465970)
Have you ever flown across the country?
Re:Of Lisp Macros and Washing Machines (2011) by holri on Sunday March 31, 2013 @12:18AM (#5467689)
Since some inhabitants of one country think their country is the world I can imagine which one of the 194 countries you think of.

The answer therefore is yes.

Re:Of Lisp Macros and Washing Machines (2011) by norswap on Saturday March 30, 2013 @06:42AM (#5465009)
So either save time or improve hygiene. A win in either case, no?
Re:Of Lisp Macros and Washing Machines (2011) by holri on Saturday March 30, 2013 @07:06AM (#5465059)
It depends. There are rumors that allegies of our days are caused by exaggerated hygiene.

You have to wait of few hundred years to see all the consequences of technology in retrospect.

Re:Of Lisp Macros and Washing Machines (2011) by yummyfajitas on Saturday March 30, 2013 @08:19AM (#5465188)
There are rumors that the lack of infectious disease in modern society is also caused by exaggerated hygiene.
Re:Of Lisp Macros and Washing Machines (2011) by eckzow on Saturday March 30, 2013 @12:24PM (#5465841)
There are rumors the current lack of infectious disease is really just an intensely selective breeding ground for much more effective infectious disease.
Re:Of Lisp Macros and Washing Machines (2011) by holri on Saturday March 30, 2013 @11:09AM (#5465603)
no this is a fact
Re:Of Lisp Macros and Washing Machines (2011) by seanmcdirmid on Saturday March 30, 2013 @07:08AM (#5465064)
Depends. People smell better though, but then we were probably desensitized to that before anyways.
Re:Of Lisp Macros and Washing Machines (2011) by codewright on Saturday March 30, 2013 @06:26AM (#5464987)
To be a Lisper is to know sorrow and pain.

Our best hope is a slave to an alien runtime.

Re:Of Lisp Macros and Washing Machines (2011) by fractallyte on Saturday March 30, 2013 @07:38AM (#5465109)
"Everybody complains about the weather, but nobody does anything about it." -- Charles Dudley Warner
Re:Of Lisp Macros and Washing Machines (2011) by a_p on Saturday March 30, 2013 @11:31AM (#5465674)
That's a nice quote, but it's not really true. Check out cloud seeding [1].

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

Re:Of Lisp Macros and Washing Machines (2011) by codewright on Saturday March 30, 2013 @07:40AM (#5465113)
I do my share of spreading the good word. :)
Re:Of Lisp Macros and Washing Machines (2011) by ynniv on Saturday March 30, 2013 @11:25AM (#5465652)
When surveyed about a different runtime, I wrote in "common lisp". Not sure they took that one seriously.
Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Saturday March 30, 2013 @05:45AM (#5464931)
I would at least blame the security issues we have nowadays on UNIX by getting C widespread for systems programming, instead of more suitable languages.
Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Saturday March 30, 2013 @06:57AM (#5465038)
I'd actually blame it on idiots writing C myself.

You can't really have a totally safe systems programming language (correct me if I'm wrong here).

Re:Of Lisp Macros and Washing Machines (2011) by b6 on Saturday March 30, 2013 @07:29AM (#5465094)
> idiots

This is a million times wrong. It's not about humans being smart or stupid, it's about humans being bad at being careful millions and millions of times without error.

The answer isn't to tell them to be more careful. They can be more careful, but they are human, so they will still make mistakes. The answer is for them to use higher level languages that eliminate whole classes of errors.

Re:Of Lisp Macros and Washing Machines (2011) by S4M on Saturday March 30, 2013 @08:52AM (#5465250)
I think the GP is calling them "idiots" not because they use C in a dumb way, but because they keep using a language that is error-prone.
Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Saturday March 30, 2013 @02:30PM (#5466236)
You are wrong: I'm calling them idiots because they use C in a dumb way and don't stick it through valgrind etc.
Re:Of Lisp Macros and Washing Machines (2011) by mikeash on Saturday March 30, 2013 @09:40AM (#5465363)
"You can't really have a totally safe systems programming language (correct me if I'm wrong here)."

He doesn't seem to think that others would be better.

Re:Of Lisp Macros and Washing Machines (2011) by jdboyd on Saturday March 30, 2013 @07:42PM (#5467072)
A type system that isn't 100% safe can still be a massive improvement over C or even C++.
Re:Of Lisp Macros and Washing Machines (2011) by mikeash on Saturday March 30, 2013 @10:13PM (#5467417)
Sure, but from the overall tone of the comment, it seems clear that he's blaming the "idiots", not the "C", because his only statement about alternatives to C is that they'll have similar problems.
Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Monday April 01, 2013 @05:13AM (#5472116)
You are correct :)
Re:Of Lisp Macros and Washing Machines (2011) by yoklov on Saturday March 30, 2013 @08:51AM (#5465247)
You can't really have a totally safe systems programming language (correct me if I'm wrong here).

It depends what you mean by totally safe, but Cyclone (http://cyclone.thelanguage.org/) is a type and memory safe dialect of C. It works by adding additional information to the type of every pointer, e.g. if it can be NULL, if it's NUL terminated, if you know the length, the scope it was allocated in, the location on the stack it's from, etc...

This all happens at compile time, and it runs about the same speed as C, so I think it qualifies.

From what I've read, this has had more of an influence on programming language designers/implementers (rust, possibly c++11, probably more), than on anybody else, though.

edit: NULL -> NUL

Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Saturday March 30, 2013 @02:32PM (#5466240)
This sort of stuff works until you need to poke some registers in a graphics card or the language's MM has a bug or you need C's dynamic nature.
Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Saturday March 30, 2013 @06:37PM (#5466907)
What dynamic nature does C have that every other systems programming language in the world lacks?
Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Sunday March 31, 2013 @12:54PM (#5469226)
dynamic loading, arbitrary casts (it is what I tell you it is) etc etc.
Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Sunday March 31, 2013 @02:20PM (#5469571)
I can do that in Ada, Turbo Pascal, Delphi, Modula-2, Oberon, Oberon-2, Component Pascal, Active Oberon, Modula-3, Cyclon and many others, what is so special about C?
Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Sunday March 31, 2013 @05:30PM (#5470255)
It's not Ada or Pascal-like :)
Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Monday April 01, 2013 @01:52AM (#5471684)
You mean easy to write security exploits?
Re:Of Lisp Macros and Washing Machines (2011) by betterunix on Saturday March 30, 2013 @10:53AM (#5465554)
Sure, but there are two major classes of bugs we need to worry about these days:

* "Mechanical" issues like dangling pointers, buffer overflows, integer overflows, etc.

* Design errors

Unfortunately, C makes the first class exceedingly easy to create, and makes the second class exceedingly hard to prevent.

Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Saturday March 30, 2013 @02:26PM (#5466223)
C also makes memory access and device driver code very easy. The mechanical issues are a side effect of that.

As for design errors, they are hard to prevent anywhere.

Re:Of Lisp Macros and Washing Machines (2011) by betterunix on Saturday March 30, 2013 @03:02PM (#5466309)
"C also makes memory access and device driver code very easy. The mechanical issues are a side effect of that."

I have two problems with this reasoning. First, C is being used for more than writing device drivers; most programs written in C are not device drivers. Second, and more important, is that low-level memory access and the sort of bit-twiddling you are talking about can be done in Common Lisp, and I doubt that you would be shocked to know that the operating systems written in Lisp for Lisp Machines had device drivers. It is possible for any high-level language to expose a low-level pointer type, and doing so will not force programmers to use such low-level constructs in higher-level code.

"As for design errors, they are hard to prevent anywhere."

While true, they are much harder to prevent in C because of the complicated semantics, the enormous amount of undefined behavior, and the plethora of edge cases one must account for. When something as simple as incrementing a counter forces you to deal with edge cases and potentially undefined behavior, it is pretty hard to verify that a C program actually implements a design, even when that design was formally specified and checked. The lack of high-level features and constructs worsens this situation by inflating the number of lines of code in an implementation.

Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Monday April 01, 2013 @01:53AM (#5471690)
> C also makes memory access and device driver code very easy.

Like any systems programming language, nothing special about C.

Re:Of Lisp Macros and Washing Machines (2011) by coldtea on Saturday March 30, 2013 @07:37AM (#5465106)
>I'd actually blame it on idiots writing C myself.

Couldn't be more wrong though.

The people that wrote UNIX and its whole C userland were far from idiots -- more like geniuses. People like K&R, Bill Joy, etc (and until the 90s they weren't even that many, mainly people from elite computing schools and research centers).

It's not like some moron high school dropout, "Learn C in 24 hours"-reading people wrote UNIX and the common server stuff we use (Bind, Sendmail, etc).

Re:Of Lisp Macros and Washing Machines (2011) by miloshadzic on Saturday March 30, 2013 @09:14AM (#5465295)
I like that Unix, Smalltalk and Lisp have a similar idea of smaller things getting composed. They are all different but I wouldn't judge the ideas based on what we have today.
Re:Of Lisp Macros and Washing Machines (2011) by hp50g on Saturday March 30, 2013 @02:37PM (#5466250)
Agree here. My statement perhaps could be better written. I'm saying not that idiots write C, but idiots can write C badly and often do. Much as anyone can cross a road, idiots can do it and reliably get squashed every time.

I disagree about sendmail though - that was a stinking turd and I have been ever grateful since postfix arrived on the scene :)

Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Saturday March 30, 2013 @06:38PM (#5466911)
Problem is the majority of developers in the world are not elite, thus the security pain we have to endure nowadays.
Re:Of Lisp Macros and Washing Machines (2011) by alberich on Saturday March 30, 2013 @07:43AM (#5465117)
Totally safe I doubt there is. It seems there are safer languages (and OS designs).

However, there are pratical considerations (e.g performance impact and stuff like that) which make such approaches unattractive for production use.

Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Saturday March 30, 2013 @06:35PM (#5466902)
This is more FUD than anything else.

Languages like Ada and Modula-2, just to cite two examples from many, allow for safer coding while having similar performance.

The people that cite the performance impact of bound checking and other features, usually tend to ignore that they can be disabled if required for performance reasons, because it suits their arguments that no other language can achieve C like performance.

Or they like to forget that the industry has invested more in optimizing compilers for C than for other languages. So they end up discussing languages without regard for the implementations.

Re:Of Lisp Macros and Washing Machines (2011) by alberich on Sunday March 31, 2013 @10:11AM (#5468654)
I was referring to operating systems architectures, not only programming languages.

While I believe you could write an operating system in Haskell, for instance, I don't know nothing about it's performance. However, microkernels, even though are safer, have some performance drawbacks.

Re:Of Lisp Macros and Washing Machines (2011) by pjmlp on Sunday March 31, 2013 @03:05PM (#5469757)
And yet, one of the best real time operating systems (QNX) is micro-kernel based.
Re:Of Lisp Macros and Washing Machines (2011) by MichaelMoser70 on Saturday March 30, 2013 @08:55PM (#5467229)
I think the problem with macros is that they do not always compile and do not always work fine. Debugging macros is hard by any definition, because you have to reason about both what is written and what goes on behind the scenes. A macro is great if the same genius is both writing the macro and using it, otherwise it sucks, in practical terms. With a function things are much easier – one know what gets in, and you can tell the author of the function what has gone wrong; much easier then trying to understand how the macro did unwind; with macros the additional complexity is that one has to understand what the user of the macro was trying to do.
Re:Of Lisp Macros and Washing Machines (2011) by DanWaterworth on Saturday March 30, 2013 @10:30AM (#5465504)
But as soon as you need to express new domain concepts in a language that does not natively support them, macros become essential to maintaining good, concise code.

There are good arguments for macros, but this is not one of them. Macros are certainly not essential for this purpose.

Re:Of Lisp Macros and Washing Machines (2011) by projectileboy on Saturday March 30, 2013 @10:57AM (#5465562)
No, but helpful. In addition to data abstraction and functional abstraction, it's nice to have syntactic abstraction as yet another tool for reducing code duplication.
Re:Of Lisp Macros and Washing Machines (2011) by aartur on Saturday March 30, 2013 @08:08AM (#5465171)
No, functions do the washing. Macros where used in the factory by a designer only.
Re:Of Lisp Macros and Washing Machines (2011) by cmpitg on Saturday March 30, 2013 @10:59AM (#5465571)
Not really. Macro makes your washing machine a "generic" one, where you could wash your clothes and your cups (even at the same time) :-).