So, my name is Jason Vegley, work at Bashow where I'm an Erlang developer and I work on the React database there, maybe you've heard of that. Pretty cool stuff. Today I'm going to be talking about Dialyzer, which is a type checking tool for Erlang and Elixir. And I'm going to lead into that topic by first talking about technology, holy wars. These are these incredibly productive online discussions that usually result in someone being compared to Hitler in some way or another. If you're old enough to be on Usenet back in the day, maybe you participate in or at least witness some of these discussions. I guess it's moved to Reddit nowadays, but Granddaddy of them all, of course, is the old Emacs versus VI Holy War or VIM. You've got people on both ends of the spectrum here. You've got really strong adherence to both these tools. I'm a VIM guy. I love my VIM. Yes, and I know there are many Emacs people in the crowd too, so no offense. So you hear the loud people on either side of this extreme here, but you've also got some people in the middle who are trying to take the best of both worlds here. And they've created things like vial and evil and more recently, space max that kind of try to give you the best of both worlds, the nice modal editing power of VIM with a nice runtime and Lispy environment of Emacs. So it's not everybody is on the extremes of this issue. Another one that used to be an argument was the old tabs versus spaces debate. How do you format your source code for your programs? If anybody watches the TV show Silicon Valley, you may remember an episode that hinged on this debate here. Pretty funny. In any case, this battle is actually one. I think space is pretty much one out this battle. I don't think anybody really formats their code intentionally with tabs anymore. So we have a clear victor there, I think. And then another one I remember participating in back in the day was the old KDE versus GNOME debate. If you used the Linux desktop environment, these were your two big choices. There were some other niche players, but this basically boiled down to those two. And I guess the sad fact is that this argument kind of became irrelevant because the year of Linux on the desktop never happened, despite being promised every single year. And I'm sorry, there's probably some adherents out in the room to Linux and I mean no offense. Now, in programming circles, one of the big debates is the old static versus dynamic typing debate. People still argue about this one to this day and there are lots of strong arguments on both sides. Do you want a strong static typing system where the compiler checks everything ahead of time for you? Or do you want the looseness and flexibility of a dynamic type system where you can have the freedom to code as you like and not worry about appeasing your compiler? And last year I was at Strange Loop and saw this talk by Gary Bernhardt that kind of crystallized the differences between the two extreme positions here. So his talk was called Ideology and it was about the ideological reasons underlying a lot of our beliefs. In terms of static typing and dynamic typing, he classified them as either type bigots or test bigots. He said that type bigots believe that correctness comes exclusively from categories and categories is just another word for types, right? So these are maybe your Haskell programmers or ML programmers who maybe you've heard him say, well, it compiles, ship it, it works, right? On the other hand, you have the test bigots that believe that correctness comes exclusively from examples, meaning like your unit test. You have tests that prove that the code behaves correctly, at least given these example input conditions. These might be your Ruby programmers. I'm sure we got a lot of current and former Ruby programmers in this room and it also probably includes a lot of us Elixir developers, too. But like I said, these are kind of the extreme polar opposite viewpoints and today I want to talk about the sort of middle of the road approach here where we kind of compromise and maybe get the best of both the static and dynamic typing worlds. And that's in the form of gradual typing. So gradual typing is a type system where some but not all of your variables and functions can have type declarations associated with them. It's up to you as the programmer to decide which ones it makes sense to do that for. Now why might you want to do this is to kind of combine the benefits of static typing such as, you know, you have a tool or a compiler that checks your program ahead of time before it ever runs for correctness and consistency of usage. And maybe even more important than that, having type declarations in your code can make it that much easier for other developers to read. On the other hand, there are some drawbacks and burdens to static typing systems such as the fact that you kind of have to get all of your types correct upfront. And you have to kind of have all this figured out in your head and translated to a form that the compiler can check for you before you can get any real work done. So that's a big burden that kind of hinders productivity a lot. And in gradual typing, since you don't have to get all the types correct upfront, you can kind of use a more incremental and sort of laissez-faire development approach. So you can still do your prototyping and kind of figure out the shape of your code before you really have to figure out all the details of the type system, please, your compiler. And of course, with gradual typing, duck typing is still an option. So I'm sure a lot of us here have utilized duck typing for its advantages in the past, and gradual typing doesn't take that option away from you. So that's gradual typing, what I'm going to be talking about today. But I want to take a little quick detour into the history of type checking in Erlang first. So we know that Elixir is based on the beam, and Erlang is a strong foundation for Elixir. So I just want to give a little instructional historical overview of how we got to where we are today. So Erlang, like Elixir, is a dynamically typed language. But I'm going to argue that it's also a strongly typed language. Different people mean different things when they say strongly typed or weakly typed. All I mean when I say it is that it doesn't allow you to combine types in incompatible manners. Like the example up here, you cannot add the number five to the string containing the digit two. That's an error. It's not some nonsense like you get in JavaScript where you can add an array to a number and expect to get something and depending on which order you put them in, it might be something else. So that's what I mean when I say it's a strongly typed system. So in Erlang, like in Elixir, you have pattern matching and guard sequences. And these do provide some rudimentary form of type checking for your programs. But it's important to note that it happens at runtime, not compile time. So you actually have to execute your code in order to have the type checks done for you. So there's no sense of a type check at compile time. Now over the years, there have been several attempts at adding a true static type system into Erlang. The most famous of which was in 1997, Simon Marlowe and Philip Waddler of Haskell fame. That's up there is a Waddler in his land demand costume. They spent a year or two trying to build a strict static type system into Erlang. And it was ultimately a failure for a couple of different reasons. And one of them was that Erlang was already a dynamically typed language. And they're trying to bolt on the static type system on top of it. And the type system they came up with cannot express all the types that are important to use in an Erlang program such as processes and messages between processes. But more important than that was the fact that at this time, 1997, Erlang had already been around for what, 10 or 12 years. And there are already really large systems running in production for a long time and running flawlessly. We know about Erlang's reputation for building robust systems. And what happened was they came along with this grafted on type system. And it's throwing all types of errors at programmers who say, well, my program is running flawlessly all this time. And now there's type checkers telling me everything's wrong. So clearly something wasn't right there. And it never really took off because it wasn't an aid to the program. It was really just a hindrance. But not everything was a failure because we learned a lot in that process. And what ultimately it resulted in was a tool called the dialyzer. The name I won't try to defend, it's a bit of a stretch. But what it is, it's a static analysis tool that performs type checking. So a static analysis tool, it's not part of the compiler. It's not part of the runtime. It's a separate tool maybe like find bugs or lint if you use one of those that you run separately. But it performs type analysis on your code and will print warnings and errors that you might need to address. It features type inference. So it will analyze your code and try to determine what types of values you're using in your code by your usage patterns. But you can also perform or insert optional type specifications for your functions and your variables. And that's the idea of gradual typing coming into play. So you add those as needed. Now unlike the Marlowe and Wadler type system which was very strict pessimistic system, the authors of the dialyzer decided they wanted an optimistic type checking system based on this concept called success typing. So what is that? All right, the authors of the dialyzer system wrote a paper describing the type model in there. There's a whole bunch of words that will tell you what success typing is. So if you're the academic type, you wanna look up that paper. There's a lot more math and cryptic vocabulary in there if that's your thing. But basically it boils down to it's an optimistic system. Meaning that it never cries wolf. So if dialyzer emits an error, it means it's really something wrong with your code. It's optimistic in the sense that if it cannot prove that your code is definitely wrong, that it's going to assume you knew what you were doing and just basically move on silently without flagging an error. So that's in stark contrast to other type systems which are very strict and they know better than you do. This is the opposite in dialyzer. Okay, all right, so we've been talking a lot about history and Erlang and I thought we were at Elixir Conf, why aren't we hearing more about Elixir? Well, I mentioned before that I'm an Erlang programmer and like Clint Eastwood here, we tend to be a bunch of grumpy old men. We resent all you Elixir programmers with your shiny new tools. And the real reason is of course is in order to understand the things that dialyzer can do for you it's important to understand the historical context out of which it grew. And to understand why it uses an optimistic model rather than the pessimistic model or the strict model that most people are used to in type systems. So from here on out, we're going to be talking strictly about Elixir. You can forget all the history if you want. And I mentioned before the dialyzer does type inference. So even if you don't add any type specs to your code, you can get a lot of value out of using the tool because it will analyze your code and try to determine what types of values you're using. And it can actually flag inconsistent usages of variables, even if you've never added a type spec to your code at all. So let's take a quick look at how that might work. So here we have a few different Elixir functions. The first one is an add function. Simply takes in two parameters X and Y and adds them together using the plus operator. Now in Elixir, like in Erlang, the plus operator is defined by the language to mean addition of two numbers. There is no operator overloading. It's not used for string concatenation or anything like that, like you might see in other languages, which means that if you see a plus sign in your code, the things to either side of it must be numbers, either integer or floating point numbers. So using that language rule, Dialyzer is able to infer the types involved in this function. So I've added that as a comment below what Dialyzer infers the types to be. So we've got numbers as your two parameters, and the result of the function is also a number. The next function divide is very similar, except rather than adding the two numbers together, it's doing a division operator. And again, the language definition states that this is valid operation only on numbers, but it also says that the result is always a floating point number. So even if you divide two integers, the result of division is always a floating point number. So Dialyzer is able to infer a slightly more specific type signature for this one. You can see that it infers you're returning a float from this function. Okay, so one more slightly trickier example of type inference at work. Here we've got an and function defined. So let's pretend that Elixir didn't already have a built-in and operator, and we wanted to define our own and function to do a logical and. This is a very reasonable way to do it. What we're doing is we're providing three different function heads and doing pattern matching on the arguments passed in to determine whether the result should be true or false. So the first one, by definition, and false and anything else is false. So that's what the first function head tells us there. Second one says any value ended together with false is also false. And it's only when you pass in true is both arguments that the result is true. Okay, so that makes sense, but what does type inference do with this? Well, we know that the result is always going to be a boolean because in all three variants of this function, we're returning either true or false, which are both boolean values. But if you look at the way the functions defined, we've got these like wildcard, the underscore there says we can pass any value as that because we're not really using it. So we could pass false and the number 42 to this and function, and it would work perfectly fine. That's perfectly valid usage of this function, but it kind of throws a wrench into the type inference mechanism because it can no longer be certain that you're only passing boolean values to this function. So it throws its hands up and says, well, you can pass any type of arguments to this function. So maybe that's not our intent. Maybe we want to write our end function this way, but we really want to insist that only boolean values be passed to it. Well, that's where type specs can come into play. So in Elixir, you can add type specs to any function just by prefixing it with a line that says at spec, the name of the function, and then the types of the parameters, and finally the result of the function, the result type of the function. So let's skip down to that end function we were just talking about. Here we've just added a type spec to the end function, and all we did is say that we want to insist that any arguments passed to this end function must be boolean values. So now this doesn't change the behavior of the function in any way. The function is still defined as it was previously, but now since we've added a type spec when we run dialyzer across our code, it will look at any invocations of this end function. And if any invocation involves anything other than a boolean value, it will flag an error in that case. So that's how you add type specs to functions. What are the things that you can put inside of your type specs? Well, there's a wide variety of them. So you've got all your basic built-in types. We've already seen some booleans. You've got types for characters, binary strings, PIDs, ports, references, things that the original Marlowe and Wadler type system could not represent are represented in dialyzer. You can even include literal values in your type specs. So if you have a function that always returns okay, you can incorporate that into your type spec. Or if you have a function that always returns the number 42, that could be part of your type spec for that function. And you've also got different range of numeric types that you can incorporate into your type specs. You've got, of course, integers and floats. You've also got a kind of super type of those as number. So number refers to anything that is either an integer or a float. Or you can be more specific about the range of values you want for your numbers. So you can say you only want positive integers, negative integers, non-negative integers, or you can even incorporate a range of integers. Like say you have a set of functions that deals with calendar dates and you want to say that they accept months. You might encode that as a range from one to 12. And the type system will enforce that insofar as it can. Of course, it doesn't know if you're pulling a value out of a database, what that value might be. But if it can tell that you're using an integer value that's not in the range, it will flag that as a type error. And by the way, I know I'm flying through these really, really quickly. And I don't expect you to remember all the details of what these type specs look like.  And then if you want to use them, then you can look up the documentation about how the details work. So your type specs can include lists and tuples. So you can either use the keyword list to represent a list or just the square bracket notation like a list literal in Elixir. If you want to say that your list expect a specific type of value to be contained therein, you just specify that in your type spec. And you can even say that you want the list to be non-empty either using the non-empty list keyword or the square brackets with the triple dots in there. So that's actually the real notation, those are three dots. And that will say that the list must be non-empty. Can also express tuples in your type specs either using the keyword tuple or the curly brace syntax. And if you want to say what the types of the individual elements of the tuple are, the syntax for doing so is right there. We just say that the first element must be an atom, second must be a binary, etc. Type specs can also represent maps, instructs, and even compound collection types. So there's a whole range of different ways of representing a map in a type spec depending on how specific you want to be about what you expect the keys and the values in your maps to look like. The simplest case is just say map or using the map literal syntax, the percent followed by curly braces. But you can also say that this map should have this particular key and the value associated with that key should be of this specific type. And you can even do the same thing with structs. So if you have a function that expects a particular struct as an argument, the syntax for expressing that in your type spec is the same as it is a struct literal in Elixir. And you can combine all these things in arbitrarily complex ways. So if you want to have a list of tuples of maps or whatever nesting you want to provide, it maps the Elixir literal syntax one to one. And of course Elixir is a functional language, which means that functions are first class citizen in the language. You can pass them as arguments to functions or return them as results for other functions and of course you can represent them in your type specs. And the syntax for doing so is basically the list of argument types followed by an arrow and the result type that you expect for that function. So if you have a callback function that you use and you want to provide a type spec so that users know what the shape of the function should be that they pass in, you can use the function type to do that. Okay, so that's basically all of the built in types. And you can see it's a pretty expressive type system even just using the built in types but to be truly useful you have to be able to define your own custom types. And so I just wanted to show an example of how that works with this module here. It's called playing cards just to represent a standard deck of playing cards. And we have a few types defined in this module. So you define your own custom type using the at type syntax. You give your type a name, double colon, and then the definition of what that type is. So let's look at the first one, it's a type to represent the suit of the card. And what we're saying here is that the type suit must be one of the four atoms either spades, hearts, diamonds, or clubs. So that vertical bar is sort of an OR operator there. Algebraic data type if you're into type theory is what we're kind of looking at here. So that's how you represent your suit. Of course, a card also has a value. It's a number in the range of two to ten, or it's one of the atoms Jack, Queen, King, or Ace. So this is how we're deciding to represent our cards. We've got a type for a suit, a type for a value. And now that we've got those two things defined, we can define the type for a card itself. And here we're representing that as a tuple where the first element of the tuple is of type suit, which we defined above. And the second element is of type value, which was also defined above. And the final type example is a deck of cards, which is just a list of cards. So we use the list type syntax to say that decks are lists and that the elements contained therein should be cards. And the triple dot notation, of course, means that that list should not be empty. Okay, so that's our type definitions for playing cards. Let's see how these are used in type specs for functions. We have a function called suit here. And the intent of that is that it takes a card as an argument and just extracts the suit component of the card and returns it. So we're just using simple destructuring pattern matching to do that. And you can see the type spec describes what I just said. So the argument should be of type card and the return type is of type suit. So that all works fine, but let's jump down and take a look at this function called broken here. Called a broken for a reason. It's calling the suit function with what looks like a card. But if you look closely, you might notice that the elements inside the tuple are flip flopped compared to our type definition for what a card is. So the type spec for a card says that it's a tuple with a suit as the first element and a value as the second element. But the way we're calling the suit function in broken has the value first and the suit second. And this will actually be flagged as an error by dialyzer, right? So I said that dialyzer is an optimistic system. It's not going to flag any errors unless it can definitively prove that there is an error in the code. And this is one case in which it can do so. It says there's no way this could possibly unify with the type specs that we provided for our function. So that's nice that it catches that error for you at compile time or at least at dialyzer time. Okay, so I'm going to jump into a demo or two here. I think in the interest of time, I'm probably going to skip the function composition demo, but at least we'll get to take a look at another example of using type specs in Elixir and also how you utilize the dialyzer tool in your Elixir projects, all right? So here I've got a stack module. And this is just your basic bread and butter last and first out stack. And so before looking at the type specs for this, let's just do a quick overview of what the functions are that are provided by this stack module. We've got a new function, a push function, and a pop function. These are your standard stack operations. And you can see by looking at the implementations of these functions that they all use lists as their representation of the stack. That's a very natural way of doing things. So if you were doing this in an object oriented language such as Ruby, you would define your stack as a class and this list would be sort of like an internal instance variable for that class. Now, we don't have such facilities in functional languages like Elixir. So what we end up doing is we pass the data representation around to functions. That works fine, but what it does mean is it kind of limits your ability to providing encapsulation. And it means that other parts of the code that are not your stack module might use the stack as if it were a list. And if you decide to change your representation of the stack in the future, you'd have to worry about all that other code out there that you might break by doing so. So what we would like to have here is the ability to encapsulate our implementation details to the stack module and still be able to use it in a convenient manner. And the way to do that is to use this concept of an opaque type. So we've got this at opaque declaration here. And this is almost just an alias for at type. So it's a way to define a new type. And the type we're defining here is called t. When you, since it's defined in the stack module, it's fully qualified name is, of course, stack.t. Common Elixir convention to do that. And we're defining that type to be a list of values. And value up here is just an alias for the any type. We don't really care about what types you're putting into the stack. We just want to say that the stack is being represented as a list of those values, all right? And so now that we've got this opaque type, all of our type specs can refer to it and say, so for example, the new function says that it returns a stack.t type. And the push and pop functions say that they take stack.t types as their arguments. And also as part of the return values, okay? So we use it just like any other type declaration. But let's see how it differs from regular type declaration by looking at example usage of the stack. All right, so here I've got another module called stack user that just uses the stack module that we just looked at, all right? So here we are creating a new stack calling stack.new. And then we're through our pipeline here, we're pushing three elements onto that stack. So after this pipeline, the stack will be a list of three, two, one, all right? Here's just an example usage of the pop function. So pop takes a stack as an argument and what it returns is the top value of that stack combined with the rest of the stack as a tuple. So this is all just standard usage of the stack module. Let's see how the opaque type comes into play here. So on this line here, line 13, we are pattern matching, kind of destructuring the stack variable, which is a list. So this should work, we're pattern matching. So this syntax will grab the top element of the stack and put it in top and the rest of the stack will be referred to in the rest variable there. That all works perfectly fine, it's valid elixir code and nothing will happen at runtime or compile time if you choose to use the stack this way, because a stack is a list, remember, as we saw it was implemented. However, because we declared the stack type as being opaque, Dialyzer will actually flag this as an error. So we can use Dialyzer as a tool to kind of help us enforce the encapsulation of our data types into the modules that kind of own them here. So let's see what that looks like when we actually use it. And I'm going to show Dialyzer in action in an elixir project here. So we've got an elixir project and of course we have generated with mix. Since Dialyzer is a command line tool that ships with Erlang, if you have elixir installed, you already have Dialyzer installed on your system. But it's a lot more convenient to use it if you use this mix plugin called Dialyzer here. All right, so this is available on GitHub. You just put that in your dependencies for your project, and you'll be able to use that. And what that does is adds a couple of mixed tasks and makes them available to you so that you can use Dialyzer in your mix-based projects. So let's take a look at how that works. Okay, so the first time you run Dialyzer, you have to run this test called dialyzer.plt. PLT stands for Persistent Lookup Table. And what it basically is, it's a cache database where Dialyzer will go in and analyze and scan all of the built-in Erlang and elixir library code. And so those are really big code bases. It can take a long time to scan through and analyze all that for type information. So you only have to do this once to build that database. And it takes maybe five or ten minutes, depending on how fast your machine is. So you have to do that once when you first run Dialyzer, and once each time you upgrade elixir on your system, which is a little bit unfortunate. But at least the mix task is friendly enough to tell you when you need to do it. So you don't need to remember, it'll yell at you if you haven't done it. But every time you upgrade elixir, you have to run this dialyzer.plt test to update that database. But I've already done that, so I'm not gonna make you sit here and watch it run for five or ten minutes. Now we'll jump into the dialyzer task itself. And this is the one that analyzes your code and flags any potential type errors in there. So Dialyzer, as a tool, understands Erlang source code and bean files. It does not understand elixir source code, all right? So having it integrated in the mix means that your code will first be compiled down the beam, and then Dialyzer can transparently use those beam files for an output, so that's what's happening behind the scenes here. If code is first being compiled in the beam, and then the analysis is running on those beam files. And what comes out here, remember we had in our example code, we had a line in there that was using the stack as if it were a list. And we, since we declared the stack type as being opaque, we said we didn't want that. So this is the kind of error that you'll get out of Dialyzer in this case. We're actually getting two errors here. The first one says has no local return. That's kind of like a generic message that means this function had a problem and details are to follow. So you can usually ignore this has no local return error message and look at the one immediately below it. Which is usually the real cause of that error. And this one is a little bit tricky, but it says the attempt to match a term of type stack.t against this pattern breaks the opaqueness of the term. Believe it or not, this is one of the friendlier Dialyzer error messages. If you've used Dialyzer before, you've probably been quite bewildered. But this one is actually being pretty specific about what's going on here. So it tells you what line the problem is occurring on and the nature of the problem, which is this pattern here is using the type in a way that breaks the opaqueness that you had declared for that type. Make sense? Okay, so as I said, just in the interest of time, I'm gonna skip past the other demo I had in place, which was about function composition. And just kind of bring things to a close here. There's a lot of features in Dialyzer that I didn't wanna take the time or the depth to go into here. But if you do use Dialyzer, and I suggest you do, these are some things you might wanna look up on your own time. So you've got overloading of type specs. So in Elixir, you can have multiple function heads for your function and differentiated based on guard sequences or pattern matching. And the type spec syntax allows you to express that in your type signatures as well. So that's what overloading of type specs refers to. And you've also got parameterized and polymorphic types. So if you've done some C++ template metaprogramming, this might mean something to you. If not, maybe don't worry about it. You've got type variables, tag tuples in type specs for structs or some things that you might wanna check out. So you can actually add type specs to your structs as well. But just to kind of bring things to a close, I'm gonna offer my personal assessment of what Dialyzer brings to the table, both positive and negative. So first and foremost, I wanna say that I do believe gradual typing is really a good compromise compared to people banging heads over whether you should use static typing or dynamic typing. They both have their benefits and drawbacks. And gradual typing kind of allows you to incorporate them into your own development style in a nice easy and effective way. And without a doubt, type specs make the code easier to read.  You don't even have to read the documentation to know that this thing returns a tuple and the first element is a list or whatever the case may be. So it makes code a lot easier to read and maintain. And it really does find real errors in your code. So at Bashow, it's kind of our policy to put type specs on all of our public functions at least and as many functions as we can really. And it has definitely been the case where Dialyzer has flagged errors in my code that my unit tests failed to find. So it can really surprise you in the types of errors that it can find in its analysis. On the other hand, it can really surprise you on the things it doesn't find too. So it finds some real errors, but it can't find all real errors. And that's just due to the optimistic nature that they chose for this tool. And we talked about the reasons that they chose that approach and why those are good reasons for relying on Elixir Universe. And also, as we alluded to before, the error messages can sometimes be a little bit tricky to read, but you kind of get used to that. You start to notice the little quirks in the output and you're able to figure out what it's trying to tell you. And if it is telling you something, you know that it's a real problem that you should definitely address. And finally, I think the Elixir integration is a little bit lacking. So Dialyzer is a tool that came out of the Erlang Universe and is very well integrated into that workflow. And just by virtue of building on top of that, Elixir gets to take advantage of that. But there are some integration points that could be improved. So I mentioned that type specs for structs are a thing that you can do, but they're very verbose and repetitive, so you're basically repeating your struct definition but just inserting type specs instead of default values. And even worse is the fact that since that information is not compiled into the beam file, it's basically just documentation. Dialyzer tool will never see it. So you can add type specs to your structs, but it's really just for documentation purposes at this point. And the other unfortunate consequence of the fact that it's working on beam files rather than Elixir source code is that if you have Elixir script files, the .exs files like your unit tests and maybe many other things, they can't participate in the Dialyzer game because they don't get compiled to beam files. So those are all some kind of slight disadvantages to Dialyzer as it stands today. But that said, there's really no downside to using Dialyzer. Even though some things could be improved, it's definitely going to help your project by incorporating type specs into your code and Dialyzer into your workflow. So I would encourage you to use it despite the fact that it's not a perfect tool. And so that's my assessment of it, and that's all the material I have. So I just want to say thank you for your time and I'll open it up for questions if we have a few minutes for that. Thank you for this, it's a great speech. Thanks. So I've worked in Node, so I haven't used Dialyzer, but I've been looking into it and I've also been looking into Credo. Do you have any experience with that? I do not unfortunately. I don't know if it's between the two that well. Yeah, I'm sorry. All right, thank you. Do you have any tips for overlapping domain errors? Overlapping domain errors. Can you expand on that a little bit? Sometimes that's a message that Dialyzer gives and it means that somehow the types built in the types you're using have some overlap somewhere. Yeah, so it's hard to answer in general. Usually, it means that you're saying something that you probably didn't mean to say, but the type that you're specifying is, I believe, a super type of the type that didn't inferred. So you're probably doing a disservice by adding your type spec with a less specific type declaration than the type inference mechanism inferred on its own. Is my understanding of that? The other thing is I've weirdly fixed them by moving them all up to be all together instead of them being separate at specs. And I was wondering why Dialyzer cared about the difference. Yeah, I'd have to see a specific example of that. I can't answer that off the top of my head. Sorry, but yes, I think there are some bugs or maybe misfeatures in the implementation so that I've come across cases where just expressing the types differently, like you said, using the OR syntax rather than having a separate type spec with a name by putting the ORs in the function type spec itself rather than in a type spec had different results. And I don't know the reasons for that. Might just be an implementation misfeature, or there might be something that I don't understand is causing that. But I've noticed the same unfortunate behavior that different ways of expressing what should be the same idea lead to different results. And going back to the Holy Wars, there's another package just called Dialyze that also does the same stuff. But it saves the PLTs in your underscore build, so it's nice if you're switching between Erlang versions because it keeps separate copies for each version of Erlang and Elixir. That's good to know. I'll look into that. Thank you. Is there any work being done or that has already been done with compiler optimization and this type spec information? I don't believe so. Now, it does require some cooperation on the part of the compiler just to have the type specs be interpretable. So even though those type specs must be parsed by the compiler, the compiler currently doesn't do anything with it, and it's done by a separate Dialyzer tool. That's not to say that nothing could be done with it, but I'm not aware of any work being done in that direction. Would be a fun project though. Is there a way to view the specs that Dialyzer infers for a function or better yet, to auto-generate those? Almost. Well, the answer is yes and no. The answer is yes if you're working in Erlang, no if you're working in Elixir. So there's a tool called Typer that ships with Erlang, and it will analyze your Erlang source code and spit out the type inferences as type specs in Erlang syntax, which is slightly different from the Elixir syntax. And if you have Erlang source code, you can use that. But it doesn't operate on Beam files, unfortunately, so you can't use it for Elixir. So, quick question. If you define a type, let's say, T is any, and then you have a function, and you say it's T to list of T, is T going to be the same in both cases, or is it really just an alias for any? All right, so this is a very good and deep question. I was struggling with this one myself, so it's basically you're saying whether the two instances of T are kind of constrained to being the same type, and unfortunately in the current implementation, not really, no. If you do a Google search for Elixir parameterized polymorphic types, you'll probably come across the question I asked on Stack Overflow about this, and you'll get a lot more in-depth answer about it, but it's not interpreted as strictly as it should be, I think. Where would one find more information about dialyzer in general, like in Learn You Some Erlang and Erlang in Anger, is there any other resources? Yeah, so Learn You Some Erlang is a really good reference, at least if you're comfortable enough with Erlang to be able to read the Erlang type specs. The Elixir documentation includes a type spec section in it, but they moved it outside of the, like the main module documentation and into like a separate section of the docs that don't seem to be picked up by Google, so it's in the Elixir docs somewhere, but I can't point you directly to where, because they recently moved it, and that covers the syntax for type specs and all the available options there. It doesn't really get into the dialyzer tool itself so much, but it will tell you what you can do with type specs, including like polymorphic types and all the things that I kind of had to gloss over here are available in the Elixir documentation, but you might have to be a little diligent in searching for those. Anyone else? So dialyzer is strictly a static analysis tool, right? It doesn't do anything at run time. Correct. Is there any, when the types are defined, is there ordnality to the definition, like when you had two through 10, Jack, Queen, King, Ace, is there any sort of analysis it does around the work, like you can have Ace two through 10 or? So like it can only analyze what it knows at the time it's running, right? So I hope I'm answering the question you're asking here, but like if the data that's being passed into these functions is outside of its domain of knowledge, it can't do anything with that, so it assumes that you know what you're doing. And that only happens at run time anyway, so yeah. Yeah, correct. Any advice for running dialyzer just on some of one's code? Like we have a Phoenix project, where Phoenix just like does not like dialyzer, so is there any tips of how to set things up to skip all the Phoenix code? So to run dialyzer on a subset of your code, you would probably not use that dialyzer mix plugin that I mentioned, what you would probably do is run the dialyzer command line tool itself, it supports arguments for running against a particular directory or against specific beam files or whatnot, so but as I mentioned, you first have to compile your elixir code down to beam files and then run the dialyzer tool against the resulting beam files from there and then you can constrain it to whichever files you want to. I have a dialyzer running on Erlang 18.3, but when I upgraded to 19, there's a whole lot more new errors and stuff to fix. Do you know what all changed? No, I do not because I work at Bashow and we're still on Erlang 16, so I can't help there. Thank you so much. Thanks everyone.


Spanning 170 kilometers from the Neal Mountains through desert valleys to the Red Sea is what will be the line in Saudi Arabia. An architectural marvel that reaches a towering height of 500 meters above sea level yet maintains a space efficient width of 200 meters. The line reshapes the idea of urban advancement and offers a glimpse into a futuristic city. Representing a revolutionary shift in civilization, its unmatched quality of life is now to explore at the Line Exhibition, inviting visitors in Riyadh to experience its wonders firsthand. In 2022, Saudi Arabia revealed plans for its ambitious urban endeavor known as the Line. Conceptualized as a singular vertical city within the desert, projected to extend across 106 miles and accommodate a population of 9 million people.  Prospective futuristic metropolises propose for placement in the northwestern region of the Gulf Nation, beside the shores of the Red Sea as announced by Crown Prince Mohammed bin Salman. The line plans propose a vertical city with a width of 200 meters designed to rise to an elevation of 500 meters above sea level. Encompassing a sprawling area of 34 square kilometers as outlined in the official press release, this innovative concept aims to redefine urban development. In recent years, Saudi Arabia has embarked on this ambitious journey to transform its cities and urban landscape with the flagship project known as the Line, taking center stage. Throughout all of history, we've actually seen people, dreamers, thinkers who've wanted to create those visions of how we might live in the future. The line aims to redefine urban living, sustainability and technology in a truly groundbreaking manner. The line was unveiled as part of Saudi Arabia's broader development initiative, the NEOM project, which aims to create a futuristic, sustainable and technologically advanced urban environment in the northwest region of the country. The line serves as a pivotal piece of NEOM's vision. At its core, the line is envisioned as a 170 kilometer long urban linear development set amongst a stunning natural landscape. The project aims to address several key challenges faced by traditional cities such as congestion, pollution and inefficient. By creating a purpose-built linear urban space, the line would strike a harmonious balance between human needs and environmental preservation. One of the line's defining features is its commitment to sustainability. Project aims to achieve a carbon-neutral footprint by relying on renewable energy sources and advanced technologies. The line's transportation system will be fully autonomous, empowered by clean energy, reducing the reliance on traditional vehicles and minimizing air pollution. Additionally, the city's infrastructure will be designed to conserve water, minimize waste and integrate nature seamlessly into the urban fabric. The design philosophy of the line centers around walkability and accessibility. The city will be built around a 20 minute walkable radius and sharing that residents have easy access to their workplaces, schools, healthcare facilities and recreational spaces. This design approach not only promotes physical well-being but also fosters a sense of community and connection among its residents. There's a good chance that it won't work at all. Another aspect of the line is that it's set to be a pioneer in the integration of smart technologies. It's going to serve as a testing ground for emerging technologies such as AI, IoT and 5G networks aiming to enhance the quality of life for those who live here. Smart sensors and data-driven systems will optimize energy usage, traffic flow and public services, creating an efficient and responsive urban landscape. Its emphasis on technology also hopes to showcase Saudi Arabia's broader goals of becoming a global hub for innovation and technological advancement. Each day it has to be excitement to finish your work and go and enjoy it and new. So we are competing with Miami. If the line actually works out and goes to plan, its focus on sustainability, technological innovation and holistic urban design sets a precedent for other urban projects to follow in the future. As the line emerges as a model for sustainable living, it could inspire cities around the world to rethink their approaches to urbanization, especially in the face of mounting environmental challenges. However, critics have cast doubt on whether the project is technologically feasible while others have described the vision was unveiled in a flashy promo as dystopian. The line is proposed as part of a Saudi rebrand plan called Vision 2030 to rival its Gulf neighbors including Dubai and Abu Dhabi as travel hotspots and reshape the kingdom's economy. Aiming to reach a hundred million annual visitors by the close of the decade, they're hoping the surge would boost the local economy billions of dollars. While there are many doubters, in June 2023 some satellite images of the line's progress were revealed, showing that construction was indeed underway. It's being built in the Tabuk province of northwestern Saudi Arabia and two new images analyzed by SOAR and online digital atlas show new developments here. In one image which shows the central part of Neom, there appears to be a significantly expanded work around the main construction base of the project, including several new buildings in the base village. There is also excavation activity and ground movement, according to SOAR, in comparison to Google Maps satellite images taken before the project's construction when the desert area was untouched. This activity appears to be in the shape of a horizontal line. Furthermore, there appears to be a mining operation in Earthworks near what will be Neom's tourism visitor center. The second image taken from the eastern part of Neom on the plateau heights showed Earthworks that clearly resembled a straight line. This could be deep excavation to prepare access to basement rock in the western areas of the new city. The new developments pictured in 2023 include the removal of a tower on a power line in the area, likely part of the new city's continued expansion. While specific completion dates for the line haven't been provided, the Neom initiative seems to be advancing at a rapid pace, so it's expected that various phases of the line will be completed in the coming years. The line is not supposed to be just a city, it's a paradigm shift in urban living. With its commitment to sustainability, smart technology, and harmonious integration with nature, the line sets the stage for a new era of urban development. Well, if all goes to plan, while exact completion dates may evolve over time, the journey toward creating this revolutionary urban environment is well underway. And the world is eagerly watching to witness the birth of a future forward cityscape that redefines what's possible. Thanks for watching, I'm Kara The Vampire Slayer and I'll see you all in another video. Bye!


Good evening everyone. It's so lovely that you came to see me. You're so kind. So bless you all. It's a pleasure to be in the space with all of you and in Ken Ellingwood and also Tanya Stone and today we have an event called a book reading and discussion with Ken Ellingwood who wrote First of Fall and this is the book that you can see right up here. And also the book is outside the hall if you're interested in purchasing one by Phoenix, which is one of our local bookstores and there will be a signing right after I was told. Yes, okay. Thank you Ken. So I'll also thank you to those who are Zoom on Zoom. It's a pleasure to have you here as well. This event is sponsored by EHS in the library, CCM and the core. We thank you very much for making this happen with us and also new, which is the naming educational whiteness, which is a group is comprised of a few faculty and staff who are invested in examining the genealogy of whiteness within higher education but also outside of other spaces and disciplines. So tonight's event, just to give you a rundown of what you can expect, tonight's event will begin with a dialogue between Ken Ellingwood, author of First of Fall and Champlain Professor, Program Director, Professional Writing and author Tanya Stone and there will be time after for discussion and questions, so please hold on to those. And who is Ken Ellingwood? Well, according to this bio, Ken is a writer and a long time, former correspondent for the Los Angeles Times. During a career for the time spanning two decades, Ken wrote stories for more than a dozen countries, including from zones of armed conflict in Iraq and Gaza Strip in the Israeli-Lebanese border. He has covered earthquakes in Iran and Haiti, palpable visit to Cuba and three protests in Lebanon and devastating drug war in Mexico. Ken has won numerous journalism awards and is also the author of Hard Line, Life and Death on the U.S.-Mexican border, an account of his years covering immigration. He spent early years as a reporter in Waterville, Maine near the childhood home of Elijah Lovejoy, the subject of First of Fall. And after 20 years of life overseas, Ken now resides in Burlington with his wife, Monique Taylor, or our provost, Dr. Taylor, and their daughter, Anselm, now for Tanya Stone. Tanya Stone is on the faculty on Champlain College and is the program director of our professional writing program. She is the author and best known for narrative nonfiction books that focus on telling over looked histories such as Her Courage Has No Color, which earned an image award from an AACP, and also is the author of Girl Rising. Not sure if folks are familiar with that, but that was a pretty prolific book and story. And with that, I'm going to cue Professor Stone and Ken and have them in dialogue. Okay, great. Thank you, Faith.  I had the pleasure of meeting Ken on their very first night at the welcome reception, and we quickly kind of discovered that we both do similar things outside of teaching, so I'm really, really happy to be here with you. I'm happy to be able to talk to you about your new book. So diving into this book led me into all sorts of questions, of course, but might we start off by simply establishing the genre this book belongs to, called by a variety of names? Creative nonfiction, narrative nonfiction, literary nonfiction. Can you speak to that a little bit and to your expertise as both a journalist and a writer of narrative nonfiction? Sure. Yes, thank you, Tanya. And I'd like to first thank everyone who was involved in setting up this event, the folks at Champlain, and in particular those in the library. Emily Christ and Erica have helped out a great deal in terms of getting me here and getting this event. I also want to thank Phoenix for co-sponsoring the event. They've got some books outside and we'll do a signing after, so that's not unimportant. And I'd like to thank anyone who's watching this via Zoom. I appreciate as well all of you who braved the rain to come out and spend an hour or so with us tonight. As to the question of the genre, I have always referred to this as a narrative nonfiction. It is the same, we're talking about the same animal, whether it's creative nonfiction. Some people have referred to literary journalism in the past, a form that was kind of emerged in the 1960s through magazine writing, people like Tom Wolfe, Truman Capote. There are various forms of it. The way I look at it is that it is true, first of all. Every fact, every assertion, every quotation, every description is true. And I know it's true because I researched it and I then went back through the book with a pen after I had a manuscript in hand and underlined every single fact and went back and double checked the facts. But the point here is that it is nonfiction that reads like fiction. It should feel like a movie, in my opinion. And that's the way I've approached this story. I think it does in that it has movement, it has characters, it has complexity and texture in the same way that good fiction has all of those elements. In a way, it's harder to write this kind of narrative because it is true. And when you're looking at somebody, we're talking in this, the subject of this book is Elijah Lovejoy, who lived in the story, takes place in the 1830s. So one has to find the sources in order to make that story feel real and urgent. Exactly. And to those journalism students in the room, you've already heard us talk about this ad nauseam, but you can never hear this too much because people mistakenly think that these narrative nonfiction books that read so beautifully like a story are fictionalized or they're historical fiction, etc. But yes, tons and tons and tons of research look in the back matter of his book. So now to the themes of first to fall. Would you like to start just by talking a little bit about and grounding the audience about freedom of the press? But yes, the book, the book is essentially a work about freedom of the press. And it is set during the age of slavery as the subtitle indicates. And it has very much to do with the protagonist Elijah Lovejoy's campaign against slavery as a newspaper editor. So I'll talk a little bit more later about him and his biography. What we put up here is the text of the First Amendment. You all know the First Amendment, but it's never a bad thing to be reminded of what it says, right? The actual words. This is the oxygen of our democracy. Without the First Amendment, we would have essentially an autocracy in many ways that resembles those in places like Russia, China, and other places that I could keep listing. In terms of the press, which is the main focus for us today, it's interesting to, we all think, well, First Amendment, freedom of the press. Look at how little the First Amendment says about freedom of the press, right? Congress shall make no law respecting an establishment of religion or prohibiting the free exercise thereof or abridging the freedom of speech or of the press. That's it. There is no further mention of the press anywhere else in the Bill of Rights. There is no further explanation of what is meant by this. And I should add, the First Amendment, we all think of it as the First Amendment, that must be because it's so important. The First Amendment actually started off as the Third Amendment. There were two others that were discarded in the course of the tussle over getting the Constitution ratified. And the First Amendment rose to two spots to become the First Amendment. But we all rely on the First Amendment. When I say we, in particular, I mean journalists. Without the First Amendment, we can't do our work. This becomes important in the story of Lovejoy because he was operating at a time in American history when the power of the First Amendment and the limits on the First Amendment had never really been tested. And I think we'll have an opportunity to talk a little bit more about that. But at the moment, I just wanted to, you know, kind of put the First Amendment in your mind and then we can discuss what it means to the Lovejoy story. Great. I really found your origin story regarding why you decided to write this story about Lovejoy. Really interesting. Can you talk a little bit about how you were inspired by your students in China and perhaps also how your location at that time affected your research? So after about 20 years at the LA Times where I had a number of assignments, I set off on a new direction carried along by my lovely wife to another life in all, but still overseas in China. And I was named as a visiting fellow at a Chinese university in Nanjing called Nanjing University. And they wanted me to teach about American journalism, believe it or not. And they wanted me to teach practice like technique, you know, reporting. They also wanted me to teach a class on history, history of American journalism. And I love the idea of that because I thought what a great way to learn about American history, you know, with journalism as kind of a character. So I did a section talking about abolitionism and slavery and journalism's role in dealing with both of those. And Lovejoy comes up and he's not a very big, you know, he wasn't the focus of my presentation. I didn't really think much about him at the time. I had heard of Lovejoy, but he wasn't somebody I knew much about. But in the course of talking to the students about him and what he did, and the fact is that I'll tell you now, he is known as the first American martyr to the Free Press. He's killed for his writing. That's not a spoiler. I think we pretty much know how his life goes. And the students that were in front of me, Chinese students, were really moved by his story. They really loved this guy and wrote about him in ways that I found very, very moving myself. And I said, this is really interesting. This story really carries, right? It can go overseas to a place that doesn't know freedom of the press and still have resonance and decided then that I would try to dig into his story a bit more. And I did so, but I'm living in China, which is not a great place to do research on an American who grew up in New England, met his death in the Midwest, or which was then the frontier, and have materials scattered all over library collections everywhere. And so I, facing those obstacles, I set out any way to do what I could. And I found ways to, first of all, mine the internet for an amazing amount of material. I was able, for example, to find letters that his family wrote to each other in the 1820s by hand. And they were collected in boxes and digitized, they were scanned at Texas Tech University. So there I am sitting in my living room in Wenjing, China, on my computer reading letters that were housed in Texas. And then when I came home on HomeLeave, I tried to make it to collections and archives and got a lot of help from very kind librarians all over the country who scanned documents for me, helped me locate things that I needed. And when I was in the States, I moved around and looked as much as I could into whatever collections there were. Any non-fiction writer will tell you, right? The librarians are the real rock stars. The librarians are the real rock stars. It can't be said enough. It really, they're amazing. And they're always up for this challenge. That's impossible. No, it's not. Here's what we'll do. And I was amazed by that. I never get tired of like asking a librarian a question and they say, yeah, we can do that. And every time I'm like, really, you can do that. That's amazing. Yeah, it's really, really marvelous. Well, down in my extra set of questions that I have, if we have, you know, infinite amount of time, I have more primary source questions for you, but I'll let those lie for now. Can you discuss one of the big questions, big with a capital B that you wanted to tackle that you told me about, which was, how can you have a country discuss its greatest problem when you're not allowed to talk about it? Elijah Lovejoy was a newspaper editor at a moment in American history when, and this surprised me greatly, I would say of the things that I learned in researching this book, one of the most striking things that I learned was that in the period leading up to the Civil War, and I'm talking now about the 1830s, which is well before the Civil War, it was not only taboo to discuss slavery or debate slavery, it was actually outlawed in much of the United States of America. People who wanted, like Lovejoy, to write in public in opposition to slavery were in the South not allowed to. There were laws throughout the South that punished up to, including death, anyone who would write what was called incendiary commentary about slavery, that is to say anything that might be construed as provocative or that might inspire what was then called servile insurrection or rebellion by enslaved people. But it didn't stop there. This sort of ban against discussing or criticizing slavery, what I call in the book a vast suppression campaign, the likes of which this country had never seen before during peacetime and has not seen since during peacetime, included a ban on discussing slavery in the halls of the U.S. House of Representatives. It's a remarkable, it's a remarkable act of censorship when the very people we send to Congress, or the people at that time sent to Congress, could not discuss one of the most, if not the most profound and problematic issues of the country's history. That gag rule lasted for eight years. And then there was another thing which Lovejoy eventually experienced personally. The 1830s, pardon me, was a period of a lot of mob activity. And so people like Lovejoy faced violence. And the climate was obviously very, very restrictive. Yeah. Well, that'll lead us sort of into, if you could paint a general picture of who Elijah Lovejoy was, including, you called him an accidental and a reluctant abolitionist in the book. And it was interesting to me because his transformation was gradual, even though he was certainly dogged in that slow march, right? Can you talk about the significance of that? And also kind of expound a little bit more on the vastness of anti-abolitionism in places all over the North, which people may find surprising. Yeah. Yeah. Among the another one of the surprises to me in researching the book. So Elijah Lovejoy was a New Englander born in Maine in 1802, grew up in a religious household in Central Maine. His father was a sort of itinerant preacher, not a very successful guy actually. His mother was more the glue of the family, had been brought up in a very strict religious family as well. And the Lovejoys were sort of imbued with this kind of stern Calvinism of the time that dominated. They were very aware of their religious duties and all of that. He was a great student. He went to the school that is now known as Colby College and graduated at the top of his class, really quite a brilliant young man, a very good writer, and decided to make his way into newspapering as a way to exercise his writing talent. And when I say that he became a reluctant abolitionist, Elijah Lovejoy, one of the things I love about his story is that he was not a very nice person when we first encounter him and he goes through these changes. One of them is that when he begins to write about slavery, he has been ordained as a minister, so he's got this double job. He's a preacher and he's a newspaper editor at the same time. He blends those two things together to use the written word to do God's work. And this is a period of time, the 1820s, the 1830s, of great flowering of religious energy in the country. It's called the Second Great Awakening. There were these revival meetings all over the country where thousands of people would show up at these camp revivals and they'd heave and scream and they'd do all these kind of theatrical things, but be converted at the end of it all. So he emerges during this period of great religious energy which commanded people to be active, to solve the country's sins. And that's the approach that he took, was to find sin wherever it resided. Drinking, for example, he was part of the temperance movement, which is to stop drinking, right, or stop people from drinking. And one of the causes that caught his eye as a church man and as a newspaper editor was the issue of slavery. He moved to St. Louis, which is in Missouri, a slave state, and for the first time in his life actually saw the institution of slavery all around him. He believed still that abolitionism, that is the organized movement to abolish slavery, which was at that time championed by people like William Lloyd Garrison in Boston, were too radical. They were too militant that if we freed all of these humans who had been held in bondage, what would happen to them? How would they possibly be absorbed into American society? And he took a much more sort of religious based at first, a much more religious based attitude, which is to worry after the souls of enslaved people and not so much about their lives. And then he would later evolve and to the point where he became very concerned about their lives and about the conditions that they were living in and the whole idea that there could be people in this country who were held in bondage. And so he becomes by the end a committed abolitionist and he adopts many of the views that were held by people that he had seen as wild-eyed radicals. Now it wasn't just Lovejoy who saw abolitionists as wild-eyed radicals, most of the country saw abolitionists as wild-eyed radicals. And there's a really kind of a, I don't know, I think it's a, I think it's a heartening lesson in all of this, which is that what one day seems really radical and crazy is another day vindicated, right?  But in fact, that isn't true. It took a great deal of courage for anyone to stand up against the institution of slavery. For some of the reasons I mentioned earlier, mob violence and the laws that existed to prevent that, but also the American public didn't really want to hear about it. And including, you know, the North, where, you know, people believe with a great deal of smugness that, you know, we didn't have those problems up here. The North was against slavery. The South was, you know, was in, was practicing. And that's really not true. Much of the resistance that abolitionists encountered was in the North. And it's, you know, worth remembering that, knowing that. Wouldn't be true to my own feminist roots if I didn't throw in a shout out here to all the women who signed all those petitions, right? Because the women made up a huge number of those signatures on those petitions. And we're sort of like out in the trenches getting it done. Correct. Can you talk a bit about Lovejoy's death as well as your view of how he, I think in your view or words even created a modern perception of journalism? Lovejoy was, as he evolved and his writings evolved, he was using a religious newspaper, his religious newspaper called The Observer, to talk about slavery and criticize it. He was under great pressure, both in St. Louis and to, he was under great pressure in St. Louis to stop writing about slavery. He was harassed. He was threatened. His, his, his, his press was destroyed by mobs. He was chased out of the state of Missouri and took refuge across the Mississippi River in the state of Illinois, which was, you'll all remember from your history, ostensibly a free state, right? Well, he didn't have to worry about this sort of stuff anymore, but he was wrong. He in fact did have to keep worrying about it because the southern part of Illinois shares much of the southern sensibilities. And the audience was no more, you know, accommodating of his viewpoint than they were in, in St. Louis. He's for months terrorized. His family is, is terrorized. His, their home is attacked. He meets, you know, mobs on darkened roads and who are all threatening him and trying to get him to stop publishing his articles criticizing slavery, saying that he was a disruptive force in the community. Even community leaders in both places in St. Louis and across the river in, in Alton, Illinois, were organizing in meetings to try to get him to stop. And ultimately, he refused. And he took the two, you know, passions of his life, the crusade against slavery and his deep and abiding belief in freedom of the press. And he, he kind of welded them together into a, into a cause that became kind of where the two were inseparable from each other. And he eventually is chased down in defending one of his presses from a mob is killed by the mob in a, in a, in a riot in Alton, Illinois. When I say that he was in some ways, you know, the force, powerful force forward for modern journalism. What I mean is that Lovejoy believed that journalism, that newspapers should tackle the issues of the day. And that would be, you know, even in, in, even when that, when those, when that writing of those pieces that he was writing were unpopular. And after that, I think we can see that same sensibility dominating in, in journalism, the idea that the public interest must be served by addressing any and all issues, you know, in the public realm. That was, that's a very modern conception. That's not how Americans necessarily thought of, of things before that time. There were state libel laws, for example. You know, we looked up earlier about at, at the First Amendment. Well, the First Amendment is all well and good. But the view that the country had at the time of Lovejoy was that the federal government's protections were not as important as state laws that existed. So you essentially had a federal guarantee of rights that was superseded by whatever was happening at the state level. And the, that problem, and it really, it really was a problem for, for a lot of people, wasn't really addressed until after the Civil War with the, with the passage of the 14th Amendment, in which case the protections in the Constitution were effectively nationalized. But when I say that, you know, he was sort of the, that moment was, was a turning point for modern journalism. I'm talking about his, you know, concern for public issues to be discussed publicly. Hi. I think it was also note, notable that by the time he was killed, he had also escaped attempts on his life many times, including one riveting story where he literally was surrounded by a mob and kind of quelled them a little bit by saying, can you please take this medicine to my ailing wife? Right? Kind of amazing tactic. Yeah.  It wasn't a very sophisticated or, or, or daunting kind of piece of machinery, but, and so easily destroyed. And he had three separate printing presses destroyed.  And then he would get another one. And they'd have it shipped, you know, to him.  And then he'd get another one. And he was just not going to be stopped. When he met a mob or a group of men on a darkened road, while he was out getting medicine for his wife, they were going to tar and feather him. Which is a very painful, yeah, it's a very painful act of violence.  And, and they eventually, they let him go. They didn't, they didn't tar and feather him. Okay, so we have two questions left. I'm going to let you pick things. We're running out of time. So this question is, what are some of the parallels of this story to today? Um, as a, as a, as a, as a journalist, one always wants to be relevant, right? I never intended this book to be relevant. I only intended it to be a really good story, which it is. And then about halfway during, in the process of my research, I realized that, oh my God, the attack on the U.S. press is becoming worrisome. And I guess I can say the name out loud, Donald Trump, and his attacks on the news media became to me a very worrisome trend. And I think to a lot of journalists who now detect that the climate in which they operate is in the United States, at least, is much more fraught, is much more dangerous than it was before. I spent much of my professional reporting life abroad in fairly, sometimes in fairly perilous places, but you don't usually have to worry about that reporting, you know, on U.S. soil. The lessons I think of lovejoy, that is killed by a mob who wanted to shut them up, and then to look at a campaign that derides the press as the enemy of the people, and denigrates their reporting as fake news, leads to moments that look like this. We all remember January 6th of 2021. What people don't tend to pay much attention to, pardon me, is that before the mob of that day actually arrived on the steps of the U.S. capital and started bashing it and knocking the doors in and breaking windows, they attacked the news media first. And there's a quotation that goes with this where one of the members of the mob is boasting in a text message to a friend how much damage they did to CNN's equipment. You can see AP equipment here. And I think that this is an example of what a lot of us have been talking about in the last several years in terms of expressing worry over the state of press freedom in the United States. One of the points that I hope to get across in the book is that people like lovejoy had to fight to defend the freedom of the press that we have in this country. We have a First Amendment. It's up there. But you know what? It was kind of half baked. It wasn't fully cooked by the time lovejoy lived and practiced. And those rights had to be established. And they were over the next century and more through various Supreme Court rulings. To illustrate, again, a little bit more about the mood, this is a t-shirt that's actually being sold out there. So it's funny ha ha, I suppose, to some people. But this is a worrisome piece of evidence. And I hope that the lessons of lovejoy help to remind us that freedom of the press isn't a given. We don't have it just because. We have it because people fought for it, died for it, and tried to defend it against attack and erosion. And that it's fragile. And it can go away. And I'm going to know many of you in this room are students of writing and students of journalism. And you hopefully think about these things. But even a broader audience, I hope, will think about those issues in reading the book. Is it time to move to the next? Is it 7.40? 7.38? Okay. Do you want to move to the reading? Sure. So Ken is now going to share a short reading and then do some Q&A. So please, when he's done with this brief reading, please ask your questions. I know a lot of the journalism students have questions. And we have worked in plenty of time for that, so don't be shy. I'm going to. Please do. Please do. Okay. I'll go up there. Can you hear me? Let me set this up just a little bit. How's the audio? Okay. I mentioned earlier that Lovejoy was under various types of pressure in the communities in which he lived to stop writing about slavery. That campaign went on for months and months as the book details. Near the end, and you can see it's getting close to the end of the book. Near the end, there's a critical meeting. It's kind of a do or die moment for Lovejoy. A meeting at which he is being told by the leaders of the community of Alton that he basically needs to stop publishing his newspaper. And there's not a lot of wriggle room left. He believes he's exhausted most of his options. He's tried to defend himself and defend freedom of the press. And he has one last chance to persuade this group to let him continue. What I'm going to read you is a section that describes that attempt. He appears at this meeting, and this is what happens. A racket of voices had swamped Alton during the previous eight days. But one voice had been conspicuously missing from the din, Lovejoy's. His moment had come. The sturdily built minister raised his frame and strode calmly to the front of the room. His round face gave away none of the strain that had enveloped him and his family for weeks, nor of the sentiments he was about to reveal. When Lovejoy spoke, his tone was, quote, deep, tender, and subdued, end quote.  He struck a deferential note at first, but soon was working his way up and down a scale of emotions that passed through indignation, sorrow, and defiance. I feel, Mr. Chairman, that this is the most solemn moment of my life, Lovejoy began. The editor said he meant no disrespect, but he was prevented by his conscience from saying the words that he knew the men before him wanted to hear. Lovejoy did not know Edwards, one of the leaders, but he expressed surprise that the senator could have placed such a set of resolutions on the table. Mr. Chairman, I do not admit that it is the business of this assembly to decide whether I shall or shall not publish a newspaper in this city. I have a right to do it, Lovejoy said. What I wish to know of you is whether you will protect me in the exercise of this right. Lovejoy argued that presenting the problem as one of insufficient compromise was specious. There was really only one legitimate side here, not two. The only question was what would prevail, the law or the mob's impulses? What have I to compromise, Lovejoy asked? It was true that he had offered to give up control of the observer, but it was one thing to do so voluntarily and quite another to yield to the demand of a mob. The latter be assured, I never will do, he said. Lovejoy was aware that he stood alone against larger, more powerful forces. I am but one, and you are many, he told the group. You can crush me if you will, but I shall die at my post, for I cannot and will not forsake it. Why should I flee from Alton? Is this not a free state? As Lovejoy continued, his remarks gained urgency. The editor said it was not the group's job to indulge him with its mercy. He did not need or desire its purported compassion. Lovejoy was making his final appeal to the jury, while at the same time signaling to the panel that he was above whatever verdict it might render. He had broken no laws, deserved no punishment. Will conduct like this stand the scrutiny of your country, of posterity, above all of judgment day? He asked. His speech now seemed directed to a wider audience than the men seated in Hogan's store. In his seething comments, Lovejoy might easily have been responding to the accumulation of indignities that had been heaped upon him during the previous two years in St. Louis and Alton. The attacks on his presses and his character, the roadside harassment, the siege of his home, the unceasing threats, the utter failure of anyone in a position of authority to intercede on his behalf. You may burn me at the stake, as they did Macintosh at St. Louis, or you may tar and feather me, or throw me in the Mississippi as you have often threatened to do, Lovejoy challenged. But you cannot disgrace me. I and I alone can disgrace myself. Lovejoy's poise broke away in pieces as he ticked off a catalog of woes. He finally yielded to tears while recalling the threats on his life, and the heavy told that the months of ravages had taken on Celia, that's his wife. I am pursued as a partridge upon the mountain. I am pursued as a felon through your streets, he accused. And to the guardian power of the law, I look in vain for that protection against violence, which even the vilest criminal may claim. Lovejoy's audience, which also included some of his friends and the confounding Mayor Crumb, was wrapped by this figure before them. The hard faces of several were wet with tears, even those of his enemies. Beecher would recall this later. Lovejoy had laid bare his beliefs, unfurled his final appeal. He concluded on a note that could best be described as a determined resignation. He was going nowhere, but ready to pay the price.  No, sir, the contest has commenced here, and here it must be finished, Lovejoy vowed. If I fall, my grave shall be made in Alton, and not very many days after this, Lovejoy was dead. I think now would be a great time to take any questions you might have, or points you would like to offer, or comments, or really anything. I'm here to answer. Yes, my biggest challenge was nobody was alive. I'm used to interviewing people, right? I mean, I spent a whole career finding people to talk to, and going to places where they are, where the story is, and seeing it, and talking to people. And this is a whole different, and my previous book was about the US-Mexico border, which I reported on the ground. And I'm used to doing it that way. So what was difficult for me was dealing with a world, trying to recreate a world where there's nobody around who I can talk to and say, is this so? Yeah, but what about that? And then I had to answer those questions in the material that I could dig up in the research. I did go to the city of Alton, and partly, I mean, obviously, you kind of have to, right? But part of my impulse in going there was just to have that sensation of place. As a writer, I've always really loved stories that have to do with place, that set you in a location. And I guess that's why I like being a foreign correspondent. You go to a place, right? And being in Alton helped me see, I could see the river. I know what the Mississippi looks like there. I know that there are these limestone bluffs along the river that are very beautiful. And I could see where his printing shop was once located. And that all really helped, but I never found anybody to interview. Thank you. So, okay. You were saying that Lovejoy's writings were deeply rooted in scripture. I was wondering if, just kind of based on the passage that you were giving us, if the Bible and scripture in any way influenced your style of writing in your work? I guess the question was whether the scripture informed my style of writing at all. I guess I would say no, in that I'm not really a Bible expert. I didn't approach this initially from a religious point of view. I had to actually learn a lot. But that's not unusual for a journalist. I mean, you go into most stories without knowing anything about it, or many stories without knowing anything about it. And you learn about it. And one of the things that I really enjoyed about doing this was learning about religion and learning about the different strains of religious belief in America at that time. And how lively it was. It was a very lively moment of American history. We don't think much about the 1830s. I bet you could rack your brain right now and not think of a single thing that happened in the 1830s. And yet it was wild. There was all kinds of really fascinating stuff going on at the time in terms of religion, in terms of construction in the country, roads being built, canals being completed, movement. People were migrating all over and religion was one of the great areas of energy at the time. What was the business of journalism like in the 1830s? And a follow-up question to that is, would a person like Elijah Lovejoy do any actual reporting? Did he actually visit enslaved people or was he writing more from an editorial stance? The question was about what was journalism like in the 1830s. It's a great question. Because journalism in the 1830s really had very little to do with what we now think of as journalism. There wasn't a great deal of he didn't do reporting. He assembled the newspaper often from stories or newspapers that he received through the mail. The 1820s and 1830s was an era that people in journalism history called the party press. Newspapers were very partisan. You might find parallels to today when I tell you that a person read the newspaper that aligned with his or her political party. So you have a very divided, atomized sort of news reading public. Americans at the time loved news. They read a lot. When foreigners came and wrote about America, Alexis de Tocqueville wrote about this often in democracy in America. There was a Scottish writer named Thomas Hamilton who came and wrote about the manners of Americans. They all were blown away by how much Americans loved news in the newspaper and how much of a glue the newspaper was in American society. But it was very opinionated, very much a product of the editor's own personal views and it was done on the cheap. Most of the news was borrowed as I said. So these wagons would show up with giant 200 pound bags and they would be with mail and they would be largely filled with newspapers of all things. And news editors would share these newspapers around in a kind of a collective that we would later kind of recognize as the Associated Press, a news collective.  And you can imagine the creation then of a national story being formed here. So newspapers became the sort of vehicle for creating a national narrative. When something happened in Virginia, people on the frontier, which was then states like Missouri and Illinois would read about it. And somebody like Lovejoy cut his teeth initially in St. Louis on a newspaper and it was very opinionated and and then he would take that kind of passion and then he turned it into his anti-slavery writing when he went to when he opened his own newspaper. So it was a very it was very much, in my opinion, it was very much like a blog might be a good way to think of it. Very personalized, very idiosyncratic and editors would fling insults back and forth at each other. They would fight in the street over what one wrote about the other, you know, in that week's newspaper. So it was a real kind of rough and tumble world. There was no training for it. They just did it. He just did it because he wanted to do it. We have several online questions. So a first one here is, did Lovejoy have any working relationships with black abolitionists of his day? No. Lovejoy was not really part of any abolitionist movement. He was and this is what one of the things that I find remarkable about Lovejoy is he was kind of this lone operator out there, as I say, on the frontier when most of the energy of the organized white abolitionist movement was located on the east coast. So and in the northeast because there was really no abolitionist movement of that sort that existed in the south. So Lovejoy was not only had really nothing to do with any black abolitionists. He didn't really have much to do with white abolitionists either. He would read the publications that white abolitionists were producing, the American Anti-Slavery Society, which was in New York. He would read them. He would reprint things in his newspaper. But what is really quite interesting about Lovejoy is that he was really just a person acting out of his own sense of principle, whatever that was, rather than as an agent or, you know, the wing of any particular movement. So I have a question kind of pertaining to like, if you look back to like the history of slavery in a sense, how do you think Lovejoy kind of was able to be still committed to like his identity as a preacher, even though like at the times well before then slavery was kind of justified by religion as well as like involved religion in the works of like disarming the argument behind everything and like his work to the end point. Do you understand what I mean? Yeah, I do. Lovejoy was really critical of the conventional Christian defenses of slavery that were issued from the pulpit in churches all over, right? People, you know, at the time, defenders of slavery and it became more pronounced sort of in the 1830s than before when it was relatively, the discussion about slavery was much more open in the 1820s even than it was in the 1830s and as the South became more threatened by criticism of slavery and even proposals to abolish slavery, those who supported the slavery system fought back by trying to convince the American public that slavery was a quote unquote positive good, right? That there's this whole narrative that we all know about now about, you know, the welfare and the happy slave. The problem for Lovejoy and the church and the churches was that religious people, clergy people, were using the Bible to justify slavery and he wrote very passionately against that. He criticized very harshly that viewpoint and called it appalling and said it was, you know, it was awful. Lovejoy's own religious beliefs led him only so far though down the path. He believed, for example, that enslaved people should be allowed to go to church. He worried about the condition of their, you know, eternal soul and he spoke initially largely in terms that are almost theoretical really, like it's about, you know, their soul needs to be nourished and so that's why we should allow religious instruction. Only later did his religious beliefs push him to the next stage which is to say there shouldn't be slavery. It's wrong. It's not only a sin, it should be dismantled and that was a step that he went to but he was very aware and very critical of this religious justification that had long existed to uphold slavery. I could follow up to that question. It might be this one. Do you know what the church's response was to Lovejoy's death or his abolitionism? The church was, now Lovejoy was a Presbyterian and the Presbyterian church essentially split in two at the time of Lovejoy's death. Not because of his death but because in part of the divisions within the church over slavery. Slavery was the issue that drove a wedge into the Presbyterian church that was already sort of fracturing on theological lines for other reasons but it ended up splitting in two as to the reaction to his abolitionism. So there was part of the church that was obviously dead set against his sort of activism. There was no part of the church at the time that really embraced his abolitionism. The Presbyterian church was a very conservative institution. In fact, it was the Presbyterian church that was instrumental in creating a program that was called colonization. Colonization was an approach to the slavery question that emerged around 1816, 1817. Essentially, the approach of the church at that time was that the answer to this problem is that enslaved people once freed should be put on a ship and sent to Africa. And the country of Liberia is the product of that movement. That sort of sounds horrifying to us today. That was the reasonable position at the time. That was a kind of a that was a kind of an almost progressive position to hold at the time. So to give you a sense of the scale of things of where the American of white America's mindset was, the church was in favor for a number of years of this approach which is to deport freed blacks to Africa. So the church, let's say, was not, in the case of the Presbyterian church, was not a force for an emancipation movement. We often think of the First Amendment as a protection from state censorship, but Lovejoy's story and perhaps the Trump era press intimidation seem to point how the state can also be an indirect actor in these encroachments. Could you speak more about the degree to which the government incited or enabled the mob violence against Lovejoy? Yes. The interesting dynamic here is that in the Lovejoy case and perhaps in the dangers that exist today that face the press, what's interesting in the Lovejoy case is that the people who were trying to shut him down were largely acting privately and not as an organized government. In other words, there was no government body that was censoring him. The community leaders where he lived were very much in favor of shutting him down, but they were not the ones who were censoring him. So he had, he lived in this weird position where he was being censored and he defended his right to publish based on the First Amendment, but remember the First Amendment really has to do with laws and Congress.  So he is in a position where who does he go to for help? There have been no court rulings. The Supreme Court had never until this time had made a ruling on freedom of the press, what it meant, how far it extended, who gets protected, who was the press, how is that defined. In fact, the only ruling in the 1830s that really had anything to do with the limits of the Bill of Rights went in the other direction. The Supreme Court ruled in a case involving Baltimore that basically the Bill of Rights don't apply to the states. So Lovejoy really inhabited a moment where there were no effective protections, even though it's there in the First Amendment. And ultimately who he has to appeal to is the American public. The feeling, the sensation that this is a right, a fundamental right that Americans have, he believed he was free to publish and therefore he acted free to publish. He created the freedom for himself in a sense. And it bears remembering that it was American sort of public opinion after his death that reacted in horror to the killing of an editor over his writings. And there was a great deal of public reaction to his death. Abraham Lincoln spoke about it. John Quincy Adams called it an earthquake that would shake the country. And when I said earlier that I think Lovejoy contributed to a modern conception of modern journalism or a modern notion of what journalism should be, it was largely the reaction to his death that caused people to say we can't let this suppression campaign continue. And he energized the abolitionist movement somewhat. I don't want to overstate the case. But more important I think was the contribution he made to press freedom through that. Well, thank you so much. On behalf of all of us here at Champlain College, thank you so much to Ken and to Tanya. If you are part of the Champlain College community, I just wanted to let you know that we do also have the book available in the library as well as copies that are here for sale if you're interested through Phoenix Books or through their website. Thank you. I will repeat that question. Can we have somebody who wants to know what are you working on now? What have you done for me lately, right? The bane of the journalist's life. That was a great story. What are you doing today? I'm exploring stories. I can say that. Meanwhile, I'm dipping my toe a bit into the world of journalism here in Burlington and doing some editing at seven days. So I really feel that it's the duty, kind of essential to promote good journalism. And I think they're producing good journalism. And so I'm doing a sort of collaborating with them a bit and waiting for the next project to finish percolating in my head. Thank you. Thank you all.