What is always missing for me in these lists is a tutorial for knocking together a small lambda calculus + dependently typed interpreter in C. Not ML, Not Ocaml, not, Haskell, not any language that has _already_ got lambdas in it! Always when I read these I see, "get your Haskell compiler and..." and I'm like, if I knew Haskell well enough to do that I wouldn't be doing this tutorial in the first place. Case in point…
And a great many fine suggestions have been made. To add one more, you might take a look at CHICKEN Scheme. It's written in C, and compiles to C. The CHICKEN website and user manual contain a wealth of info re: theory and implementation of the compiler. The development team has always been friendly and willing to answer questions. See http://www.call-cc.org/
A Path to Enlightenment in Programming Language Theory
51–60 of 99 posts
Re: A Path to Enlightenment in Programming Language Theory
#52What is always missing for me in these lists is a tutorial for knocking together a small lambda calculus + dependently typed interpreter in C. Not ML, Not Ocaml, not, Haskell, not any language that has _already_ got lambdas in it! Always when I read these I see, "get your Haskell compiler and..." and I'm like, if I knew Haskell well enough to do that I wouldn't be doing this tutorial in the first place. Case in point…
That's something I liked about jonesforth ( https://raw.githubusercontent.com/AlexandreAbreu/jonesforth/... ) ! but its not a lambda calculus interpreter I guess.
Re: A Path to Enlightenment in Programming Language Theory
#53How much does algebra contribute to learning Type theory ? I'm currently working on the How to prove it book. I thought, I would jump to TAPL after finishing that.
Knowing how to prove things and express your self rigorously is very helpful though, but its generally helpful for any part of computer science, not just programming languages.
Re: A Path to Enlightenment in Programming Language Theory
#54What is always missing for me in these lists is a tutorial for knocking together a small lambda calculus + dependently typed interpreter in C. Not ML, Not Ocaml, not, Haskell, not any language that has _already_ got lambdas in it! Always when I read these I see, "get your Haskell compiler and..." and I'm like, if I knew Haskell well enough to do that I wouldn't be doing this tutorial in the first place. Case in point…
There is no point in doing such things in C, since C is just too low level. What is normally done is a very simple and stupid, but extensible language bootstrapped with C (or whatever else), and then grown up to a level when it's convenient to implement a functional language compiler (i.e., at least higher order functions and some pattern matching). I wrote about such a bootstrap some time ago: https://combinatorylog…
Re: A Path to Enlightenment in Programming Language Theory
#55In practice, most programming languages are not purely or even mostly functional. So why is everything on this list about functional programming?
Re: A Path to Enlightenment in Programming Language Theory
#56Earlier quoted context omitted.
There is no point in doing such things in C, since C is just too low level. What is normally done is a very simple and stupid, but extensible language bootstrapped with C (or whatever else), and then grown up to a level when it's convenient to implement a functional language compiler (i.e., at least higher order functions and some pattern matching). I wrote about such a bootstrap some time ago: https://combinatorylog…
That's a bit defeatist, we don't know until we try!
Re: A Path to Enlightenment in Programming Language Theory
#57Earlier quoted context omitted.
Here's a famous reddit comment about bootstrapping a language: http://www.reddit.com/r/programming/comments/9x15g/programmi... Also this was here not long ago https://news.ycombinator.com/item?id=9699065
Ha, I remember that from not long ago. That's a _bit_ extreme though. Let's start with C, the portable assembly language. Having said that, now that WebAssembly is on the cards (boo, hiss), we'll have many more of these from-the-ground-up affairs. re: reddit thread: that Kragen, name is familiar...
If you want to make things really low level, then make a compiler that targets assembly language and then bootstrap it. Coding the first version of the compiler in assembly or C instead of something more suitable for the task is just unnecessary pain.
Re: A Path to Enlightenment in Programming Language Theory
#58Earlier quoted context omitted.
Not just that, but we still don't really know how to combine subtyping and generics very well. The soundness question when considering variance is still quite open, and it shows in the poor support for type inference in OO languages (in spite of heroic efforts made in languages like Scala). Much of this has to do with the root: most of our PL theory was basically designed for FP, and applying them to OOP has been pre…
soundness question when considering variance What is this question? Have you got a reference?
But I thought that was pretty well understood, so I don't know what he thinks is open...
Re: A Path to Enlightenment in Programming Language Theory
#59Earlier quoted context omitted.
You can also implement an interpreter in Haskell/ML without using closures to implement closures. It would still be a lot less painful than C.
Of course. But it's still reasonable to ask how you'd write a compiler that implements such features in a free-standing way, without depending on either the built-in tools of the language you're writing an interpreter in or a black box run-time environment/VM that does all the tricky stuff for you by magic. With a relatively low-level language like C, you don't have any choice but to confront such issues head-on, whi…
Re: A Path to Enlightenment in Programming Language Theory
#60Earlier quoted context omitted.
> The flip side of this is that if you're writing something in C, you actually do have to understand how details like closures are implemented on real hardware. If you're writing a compiler targeting real hardware and not a high level virtual machine, you'll need to learn how to implement closures regardless of the "host" language you write your compiler in. But you're correct, when implementing an interpreter, it's…
If you're writing a compiler targeting real hardware and not a high level virtual machine, you'll need to learn how to implement closures regardless of the "host" language you write your compiler in. Right, but a lot of the tutorial material in this area doesn't really consider that issue, even though it's rather fundamental to practical applications. Instead the explanation often settles for some sort of indirect de…