Defense of Lisp Macros
The article highlights challenges in automotive software development, emphasizing reliance on C, fragmentation from specialized tools, and advocates for powerful languages like Lisp to improve efficiency and integration.
Read original articleThe article discusses the challenges faced in the automotive software development industry, particularly the reliance on the C programming language and the proliferation of domain-specific languages (DSLs) and tools. It argues that the complexity of modern software projects leads to fragmentation, as various teams create specialized tools to address specific needs, resulting in inefficiencies and increased development time. The author identifies three primary problems that these tools aim to solve: real-time application monitoring, intuitive system comprehension, and effective organization around the main programming language.
In the automotive sector, software is divided into electronic control units (ECUs) that manage different vehicle functions, necessitating communication through a network of messages. Tools like Vector's CANoe are essential for simulating and testing these ECUs, but they also highlight the limitations of C in handling complex interactions. The article emphasizes the need for more powerful and extensible programming languages that can seamlessly integrate with existing systems, reducing the reliance on external tools and languages.
The discussion points to a cycle where the need for better tools leads to the creation of more tools, which in turn complicates the development process. The author advocates for a return to more powerful languages like Lisp, which can handle abstractions and DSLs more effectively, potentially streamlining the development process and reducing fragmentation in the automotive software landscape.
Related
The software world is destroying itself (2018)
The software development industry faces sustainability challenges like application size growth and performance issues. Emphasizing efficient coding, it urges reevaluation of practices for quality improvement and environmental impact reduction.
I Probably Hate Writing Code in Your Favorite Language
The author critiques popular programming languages like Python and Java, favoring Elixir and Haskell for immutability and functional programming benefits. They emphasize personal language preferences for hobby projects, not sparking conflict.
The IT Industry is a disaster (2018)
The IT industry faces challenges in IoT and software reliability. Concerns include device trustworthiness, complex systems, and security flaws. Criticisms target coding practices, standards organizations, and propose accountability and skill recognition.
Why We Build Simple Software
Simplicity in software development, likened to a Toyota Corolla's reliability, is crucial. Emphasizing straightforward tools and reducing complexity enhances reliability. Prioritizing simplicity over unnecessary features offers better value and reliability.
We Build Simple Software
Simplicity in software development, likened to a Toyota Corolla's reliability, is crucial. Emphasizing straightforward tools, Pickcode aims for user-friendly experiences. Beware of complex software's pitfalls; prioritize simplicity for better value and reliability.
- Many commenters acknowledge the power of Lisp macros but express concerns about their complexity and potential for introducing errors.
- There is a discussion about the fragmentation caused by relying on multiple specialized tools and languages instead of a unified approach like Lisp.
- Some commenters highlight the challenges of adopting Lisp in the industry, citing the steep learning curve and the need for better educational focus on functional programming.
- Several users mention the practical limitations of using macros in modern programming, particularly in Clojure, where they are often avoided.
- There is a call for improved tooling and integration to make Lisp more accessible and appealing to developers.
I did a little digging, and it turns out I had it backwards. It's not that Simulink invented a new graphical programming language to do this stuff. Control systems engineers have been studying and documenting systems using Simulink-style block diagrams since at least the 1960s. Simulink just took something that used to be a paper and chalkboard modeling tool and made it executable on a computer.
In Common Lisp, macros also enable a kind of Aspect Oriented Programming. That's because one can dynamically modify macro expansion using the macroexpand hook. It's a way to modify a code base without changing the source files, which has all sorts of uses.
http://clhs.lisp.se/Body/v_mexp_h.htm#STmacroexpand-hookST
One can implement things natively in Common Lisp, like code coverage tools, that require separate tooling in other languages.
There are several Clojure libraries that are cool and completely reliant on macros to be implemented. Eventually, good Clojure programmers seem to stop using them because the trade-offs are worse error messages or uncomfortable edge-case behaviours. The base language is just so good that it doesn't really matter, but I've had several experiences where the theoretically-great library had to be abandoned because of how it interacts with debugging tools and techniques.
It isn't the macros fault, they just hint that a programmer is about to do something that, when it fails, fails in a way that is designed in to the system and can't be easily worked around. Macros are basically for creating new syntax constructs - great but when the syntax has bugs, the programmer has a problem. And the community tooling probably won't understand it.
I've always found this rule suspect.
If it were true you'd have had lispers loudly reimplementing well-known, slowly-and-buggy mid-size C programs in common lisp, at roughly the rateand loudness the Rust people reimplement old C programs in Rust.
Did that actually happen?
If not, this has to be the greatest expression of envy in all of programming language lore.
Book description: https://paulgraham.com/onlisp.html
Download page: https://paulgraham.com/onlisptext.html
The only consistent explanation I've seen that it is about 'easy'. The other languages have tools to make them easy, easy IDE's, the languages 'solve' one 'thing' and using them for that 'one thing' is easier to than building your own in LISP.
You can do anything with LISP, sure, but there is a learning curve, lot of 'ways of thinking' to adopt the brain to in order to solve problems.
Personally, I do wish we could somehow re-vamp the CS Education system to focus on LISP and other ML languages, and train more for the thinking process, not just how to connect up some Java Libraries.
> Replacing Lisp's beautiful parentheses with dozens of special tools and languages, none powerful enough to conquer the whole software landscape, leads to fragmentation and extra effort from everyone, vendors and developers alike. The automotive field is a case in point.
This has been a struggle of mine since day one. Coming from the java world with more formats, tools, IDEs everytime people create a problem was absurd. Lisp was all absorbing.. much reuse on all metalevels.. yet sometimes I believe a bit of "organ"ism is useful.
It's seductive, but there's a steep cost. You bring in a bunch of new notation, which you have to learn and teach and remember. You have to consider all the interactions that happen when you mix notations. You have to implement all the tooling.
Usually what happens is you don't quite remember what things mean after a while, and you have to study it again. You didn't consider all the interactions, so it isn't that well behaved. And you never got around to implement quality tooling - and there's no obvious place to plug that tooling in, either. And then it turns out that the notation wasn't quite right for implementing the changing requirements of the business.
Any kind of code generation setup will have the same characteristics.
Sloppy macros clashing with local names can lead to pretty long debug sessions, but it's the first thing you learn to avoid.
And you're basically inventing your own ad hoc programming language to some extent, the effort spent on error handling tend to not live up to those requirements.
All of that being said, I wouldn't trade them for anything, and I haven't seen any convincing alternatives to Lisp for the full experience.
This completely ignores Haskell.
I've thought all this sloppy side information would be a good target for the currently in vogue AI techniques.
Related
The software world is destroying itself (2018)
The software development industry faces sustainability challenges like application size growth and performance issues. Emphasizing efficient coding, it urges reevaluation of practices for quality improvement and environmental impact reduction.
I Probably Hate Writing Code in Your Favorite Language
The author critiques popular programming languages like Python and Java, favoring Elixir and Haskell for immutability and functional programming benefits. They emphasize personal language preferences for hobby projects, not sparking conflict.
The IT Industry is a disaster (2018)
The IT industry faces challenges in IoT and software reliability. Concerns include device trustworthiness, complex systems, and security flaws. Criticisms target coding practices, standards organizations, and propose accountability and skill recognition.
Why We Build Simple Software
Simplicity in software development, likened to a Toyota Corolla's reliability, is crucial. Emphasizing straightforward tools and reducing complexity enhances reliability. Prioritizing simplicity over unnecessary features offers better value and reliability.
We Build Simple Software
Simplicity in software development, likened to a Toyota Corolla's reliability, is crucial. Emphasizing straightforward tools, Pickcode aims for user-friendly experiences. Beware of complex software's pitfalls; prioritize simplicity for better value and reliability.