Top products from r/ProgrammingLanguages
We found 29 product mentions on r/ProgrammingLanguages. We ranked the 30 resulting products by number of redditors who mentioned them. Here are the top 20.
1. A Retargetable C Compiler: Design and Implementation
Sentiment score: 0
Number of reviews: 2
Used Book in Good Condition
2. Object-Oriented Programming in COMMON LISP: A Programmer's Guide to CLOS
Sentiment score: 2
Number of reviews: 2
4. Compilers: Principles, Techniques, and Tools (2nd Edition)
Sentiment score: 1
Number of reviews: 2
5. Design Concepts in Programming Languages (MIT Press)
Sentiment score: 0
Number of reviews: 2
NewMint ConditionDispatch same day for order received before 12 noonGuaranteed packagingNo quibbles returns
6. Foundations for Programming Languages (Foundations of Computing)
Sentiment score: 0
Number of reviews: 1
7. Mastering Functional Programming: Functional techniques for sequential and parallel programming with Scala
Sentiment score: 0
Number of reviews: 1
8. Modern Compiler Implementation in Java
Sentiment score: 1
Number of reviews: 1
Cambridge University Press
9. The Optimal Implementation of Functional Programming Languages (Cambridge Tracts in Theoretical Computer Science)
Sentiment score: 1
Number of reviews: 1
10. Lisp in Small Pieces
Sentiment score: 1
Number of reviews: 1
Used Book in Good Condition
12. Structure and Interpretation of Computer Programs - 2nd Edition (MIT Electrical Engineering and Computer Science)
Sentiment score: 1
Number of reviews: 1
NewMint ConditionDispatch same day for order received before 12 noonGuaranteed packagingNo quibbles returns
13. Compiling for the .NET Common Language Runtime (CLR)
Sentiment score: 0
Number of reviews: 1
14. Modern C++ Design: Generic Programming and Design Patterns Applied
Sentiment score: 1
Number of reviews: 1
16. The Design of Design: Essays from a Computer Scientist
Sentiment score: 1
Number of reviews: 1
17. Principles of Compiler Design (Addison-Wesley series in computer science and information processing)
Sentiment score: 0
Number of reviews: 1
18. Principles of Programming Languages: Design, Evaluation, and Implementation
Sentiment score: 0
Number of reviews: 1
Used Book in Good Condition
Oh wow, I just went down the rabbit hole of CPS, SSA, and ANF while developing my compiler for a strict Haskell-like functional programming language.
I read the outstanding book by Appel on compiling using CPS, and was all ready to go to refactor my pre-LLVM IR to be CPS. Then I did more research and realized that while a number of optimizations are very natural in CPS, compiling CPS to machine code is not as simple. It felt like a really daunting project, and after wrestling with my CPS transformations for about a week I filed a CPS IR away in the "research again someday" bucket.
The best intermediate representation for a functional language I've found is A-Normal Form (ANF). Here is the original paper on the subject. The argument goes that ANF is much more compact and easier to understand than CPS, and still enables almost all of the same optimizations. Some recent work with join points in GHC and a few other papers/theses I read (linked below) convinced me that ANF was going to be my choice of IR.
I highly recommend sticking with LLVM. It is a very mature ecosystem and it gives you so much "for free". I think it's neat that my optimization pipeline will look like:
Even now, I only have some very rudimentary optimizations implemented for ANF, but turning on
-O3
when compiling to LLVM makes my toy programs just as fast as equivalent programs I wrote in C. I feel like using LLVM gives you the best of both worlds between ANF and SSA; you hand-write your ANF transformations in your compiler, and let LLVM do the neat things that can be done with SSA optimizations. Note: I am no compiler expert. Maybe I'm being naive in thinking the LLVM optimizations after ANF optimizations give me that much. I'd be happy for someone else to chime in here :)Lastly, you mention ease of use and the ability to get started as important criteria. In that case something like ANF to LLVM is the obvious choice.
Good luck!
---
If anyone is interested, I gathered a lot of resources while researching CPS/ANF/SSA. I'll just dump them here:
Andrew Appel wrote a book called Compiling with Continuations
(https://www.amazon.com/Compiling-Continuations-Andrew-W-Appel/dp/052103311X),
where he explains how continuations can be used as the back end of a compiler.
Lots of stuff since then has been written on how using continuations makes lots
of optimizations a lot simpler, and how it is pretty much equivalent to SSA.
More stuff:
https://www.cs.indiana.edu/~achauhan/Teaching/B629/2006-Fall/CourseMaterial/1998-notices-appel-ssa_fnprog.pdf
https://news.ycombinator.com/item?id=7150095
ftp://ftp.cs.princeton.edu/techreports/1988/183.pdf
http://manticore.cs.uchicago.edu/papers/ml16-cwc-llvm.pdf
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/11/compiling-without-continuations.pdf
https://www.microsoft.com/en-us/research/wp-content/uploads/2007/10/compilingwithcontinuationscontinued.pdf
http://code.ouroborus.net/fp-syd/past/2014/2014-08-Sloane-CPS.pdf
https://jozefg.bitbucket.io/posts/2015-04-30-cps.html
ANF and SSA resources:
https://slang.soe.ucsc.edu/cormac/papers/pldi93.pdf
http://mlton.org/pipermail/mlton/2003-January/023054.html
https://www.jantar.org/talks/zadarnowski03languages.pdf
https://www.jantar.org/papers/chakravarty03perspective.pdf
http://www.ccs.neu.edu/home/matthias/369-s10/Transcript/anf-vs-cps.pdf
Code Optimiziations for a Type-Directed Compiler for Standard ML. PhD thesis,
School of Computer Science, Carnegie Mellon University, December 1996
http://www.dtic.mil/dtic/tr/fulltext/u2/a326493.pdf
monorphic code should not be slower simply because the language supports
higher-level code.
functions.
recursive functions.
https://pdfs.semanticscholar.org/55bc/5ceee768223f4b233de568a7181297eb2c4d.pdf
Assignment. (IR'95, published as ACM SIGPLAN Notices, 3(30), March 1995)
http://mumble.net/~kelsey/papers/cps-ssa.ps.gz
Yeah there was nothing in the talk about it.
As far as I can tell, it's a somewhat silly reference to the fact that the influential book "Modern C++ Design" was written in the C++ 98 era.
This 2001 book advocated a clean break from the C heritage in C++:
https://www.amazon.com/Modern-Design-Generic-Programming-Patterns/dp/0201704315
It's heavy on template metaprogramming. I actually prefer "C with classes" for many problems, but it's it's clear that C++11, 14, 17 are going further in this direction.
And I believe that Immer relies on many features from C++11 and 14. Those features enable C++ the language to delegate all its data structures to libraries, rather than being part of the language.
-----
For a completely different and more useful application of the word "postmodern" in programming, I recommend this paper:
http://www.mcs.vuw.ac.nz/comp/Publications/CS-TR-02-9.abs.html
It's very insightful, fun, and in the 15 years since it was written has become more relevant. I haven't blogged about this, but this kind of thinking underlies the shell and the design of the Oil shell in particular. In particular, in large systems, there is "no grand narrative", and it makes sense to opportunistically use models when they are useful, but throw them out when they are not.
There is a tendency among programming language designers to assume that they are at the center of the universe. A big part of shell is about making existing pieces written in different languages work together.
And that includes the operating system. To me, it's obvious that runtime is more important compile time, and too many programming languages are ignorant of the other enormous piece of code that runs when your program runs -- the operating system.
Here's my attempt to be helpful!
Regarding Asperti and Guerrini, there are a few people on this subreddit who are working on cutting edge research compilers for functional languages based on term-rewriting. I've found this subreddit as well as r/Compilers to be very friendly and helpful in general, so I encourage you to take advantage of them. Ask questions, bounce ideas off of people, etc.
I've peeked at this free online book a few times when implementing things. I think it's a pretty solid reference with more discussion of these sorts of things!
Another option is a "real" textbook.
My programming languages course in university followed Programming Languages: Application and Interpretation (which is available online for free). It's more theory-based, which I enjoyed more than compilers.
But the dragon book is the go-to reference on compilers that is slightly old but still good. Another option is this one, which is a bit more modern. The latter was used in my compilers course.
Outside of that, you can read papers! The older papers are actually pretty accessible because they're fairly fundamental. Modern papers in PL theory can be tricky because they build on so much other material.
TPL is great for type theory stuff.
I'm working through Compiling with Continuations right now, and it's pretty good as a practical way to specify semantics that also has a history as useful in compilers. Matt Might's writeup gives a flavor.
All of your questions are pretty much the set of reasons why the Lisp family of languages was invented. Have a look at Common Lisp, Scheme, and the many programming languages books based on these languages. An "introductory" one is here, and advanced one here, and an even more advanced one here.
(Check whether there are newer editions of these. You'll probably want the newest ones so that you can easily type their code into a modern Scheme or Common Lisp implementation.)
I would say go with whatever your computer uses so that you can follow along (unless your computer uses something really obsucre).
As for books, I can only really recommend the places I learned X86 from which would be Hacking: the art of exploitation since it puts assembly the context you'll find it most often (looking through assembled code) so you learn many useful tools along the way. Also the textbook I had in college (you can find it cheaper if you look around) which covers many other topics too relating to computer memory and whatnot.
Though for just learning some basic assembly, look for some simple resources online. It's not too hard to learn generally speaking so you should be fine.
Yes. Here are some papers about it if you're interested: https://web.archive.org/web/20050510122857/http://www.iis.sinica.edu.tw/~trc/languages.html They refer to earlier work which again refers to Lisp and a precursor of CLOS.
The Art of the Meta Object Protocol describes the MOP. If you're looking for a general book about CLOS then you could e.g. have a look at https://www.amazon.com/Object-Oriented-Programming-COMMON-LISP-Programmers/dp/0201175894.
Thanks.
Are MOP and CLOS the same thing?
Now there are three books mentioned
What are your suggestions to read which books in what order? My post started from understanding the different object models in Python and Smalltalk.
Nice list. But how about DCPL, Design Concepts in Programming Languages?
You can get it from amazon: https://www.amazon.com/Mastering-Functional-Programming-techniques-programming-ebook/dp/B07DTF8N58
I suggest you to read the Dragon Book.
Book: Principles of Programming Languages: Design, Evaluation, and Implementation
It's a reskinned second edition: www.amazon.com/Compilers-Principles-Techniques-International-Economy/dp/9332518661
And there's even a GREEN dragon book from 1977: https://www.amazon.com/gp/product/0201000229
Foundations for Programming Languages by John C. Mitchell
A Retargetable C Compiler: Design and Implementation is a book that compiles to a C compiler in C.
I worked on the Windows operating system and Internet Explorer at various points in my career. With very large projects like those, even normally trivial problems become significant engineering tasks when doing so at those scales. Just compiling the core library of IE (allocators, text handling, dom, etc) could take half an hour, so you really came to appreciate incremental builds.
To get a sense of the scale of such problems, I might recommend the book Large Scale C++ Design. I remember finding the book very dry, but in the author's defense, it's a very dry problem space.