Visit our site to listen to past episodes, support the show, and sign up for our mailing list
Summary
We got the chance to talk to some of the core developers of Hylang, which is a Lisp dialect that runs on the Python VM! We talked about how it got started, how it works and why you should try it. Of particular interest is our discussion about using Hylang to backport language features, or create entirely new ones due to the power of Lisp and the Python AST (Abstract Syntax Tree). If you need to level up your Lisp knowledge, they gave us a great list of references to help out.
Brief Introduction
- Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.
- Subscribe on iTunes, Stitcher, TuneIn or RSS
- Follow us on Twitter or Google+
- Give us feedback! Leave a review on iTunes, Tweet to us, send us an email or leave us a message on Google+
- I would like to thank everyone who has donated to the show. Your contributions help us make the show sustainable. For details on how to support the show you can visit our site at
- We are recording today on August 27, 2015 and your hosts as usual are Tobias Macey and Chris Patti
- Today we are interviewing Paul Tagliamonte, Tuukka Turto, and Morten Linderud
Interview with Hylang Developers
- Introductions
- How did you get introduced to Python?
- Before we get too far along can you explain what Hy is?
- What inspired you to create Hy?
- What do you recommend as reference material for Python developers to gain familiarity with idiomatic Lisp?
- What are some of the problem domains where implementation becomes easier or more elegant as a result of Hy’s LISP syntax?
- Given the ability to create powerful macros in Lisp, could Hy be used as a way of prototyping or backporting new language features in Python?
- What are some of the most challenging and interesting problems you encountered bringing an alternate syntax to the Python runtime?
- While playing around with the Hy REPL I noticed that it does visual matching of parentheses when closing an expression. What other niceties have been included in the REPL?
- What are your thoughts on adding autocompletion to the REPL as a way of encouraging discovery and exploration of the Hy language?
- Which LISP variant is Hy most similar to, and why?
- How does garbage collection work in Hy, and why?
- How hard would it be to port existing LISP packages to Hy like MACSYMA or CLOS?
- What kind of overhead in terms of runtime performance and memory usage does Hy impose? Has this been a challenge in Hy’s development?
- What are some of the most innovative uses for Hy that you have seen or created?
- What does the future hold for Hy?
- I noticed that there are a large number of core contributors to Hylang and I’m curious how you determine what features to work on?
Picks
- Tobias
- Displacy
- The Golem and the Jinni by Helene Wecker – Read it on Scribd
- Safari Online
- Chris
- Paul
- Tuukka
- Morten
Keep In Touch
Hello, and welcome to podcast.init, the podcast about Python and the people who make it great. You can subscribe to our show on iTunes, Stitcher, or TuneIn Radio, or you can add our RSS feed to your podcatcher of choice. You can also follow us on Twitter. We're podcast Dunder init or Google plus with links in the show notes. And please give us feedback. You can leave us a review on iTunes, send us a tweet, send us an email, or leave us a message on Google plus Providing feedback helps us get found by other people so that other people can enjoy the show as much as you. I would like to thank everyone who has donated to the show. Your contributions help us make the show sustainable. For details on how to support the show, you can visit our site at pythonpodcast.com.
We're recording today on August 27, 2015, and your hosts as usual are Tobias Massey and Chris Patti. Today, we're interviewing Paul Tagliamonte, Tuca Turto, and Morten Lindnerud. We're talking to them about HighLang. So could you please introduce yourselves?
[00:01:14] Unknown:
Yeah. So, I'll go first. My my name is Paul Tagamoni. I go by Paul Tag online. I'm on the board of directors of the open source initiative, the OSI. I'm a Debian developer involved with a couple of random things. Been a long time Ubuntu member and, 1 of the original authors of Hi.
[00:01:35] Unknown:
Yep. I'm. I'm just a random Finnish hacker doing what little I can do with the High Line. In addition to that, I like to play with with as many programming languages as possible.
[00:01:52] Unknown:
I'm Morten Lindero. I'm currently studying my bachelor in information science in Bergen. Quite passionate about open source software, hacking on stuff, and just doing development in general.
[00:02:07] Unknown:
So how did each of you get introduced to Python initially?
[00:02:11] Unknown:
Paul, why don't you go first? Yeah. Python was always 1 of those languages that was sort of in my ecosystem. Oh, it was sort of in my in my sphere. I started out working in PHP and Java back when I was in oh, jeez. Probably it was, middle school. And I really have always admired Python but never really put the time into really getting to know Python closely until probably around college, when I started doing a little bit more in it. I started to explore more and more of the just insane number of, libraries written for the language and I was hugely impressed by the community. And ever since I started just starting to get to know Python, it's just been 1 step after another and it's always just been incredibly, incredibly amazing and engaging. And these days, I'm a regular at PyCon and certainly love the Python ecosystem in the Python developing world.
[00:03:04] Unknown:
Tuca, how about you go ahead and tell us how you got introduced to Python?
[00:03:08] Unknown:
Yeah. It was in the beginning of the 2000 when I was working at the Nokia. And back then, we used to do everything with the pearl. And then there was this 1 guy who was really, really avid Python hacker, and we were doing a internal tools project, basically revamping the whole build build tool chain. And he managed to convince us that let's write it in the Python. And back then, I liked the pro language quite a bit and started using that for my personal project doing little games programming and little bit systems programming with that, and rest is the history.
It's probably 1 of my favorite languages currently.
[00:03:52] Unknown:
I think I was hanging around on some shady RC channels, like, 2, 010, 011. And then I was, like, wondering, yo, programming. How'd you do that? And then someone said, Python is a good start. So I just kind of started with that and been programming Python for my main language for since then I think, like, 5 years now.
[00:04:15] Unknown:
So before we get too far along in the show, can 1 of you explain what hi is?
[00:04:21] Unknown:
Yeah. Gladly. Hi is this really, really interesting idea. It's sort of thrilling on a couple of different levels. It's primarily something that will take s expressions, will take, this sort of parenthesis notation that's used in Lisp programming languages, and translate that under the hood into the Python abstract syntax tree. So it'll read in the data structures, the s expressions that sort of define the Lisp programming language family and turn it into the equivalent Python code that will execute and produce the same result that you're sort of getting at with s expression code. So you can think of it like an alternative syntax for Python. And sort of what you get by doing this is you can start to look at implementing things like macros and start to treat code like data. This is a pretty interesting and powerful concept, and we just sort of wanted to explore what exactly it would look like and what exactly it would mean. And it was also really a a fun way of exploring some of Python's lesser known internals, like PEP 302 import hooks and the Python abstract syntax tree. It was just too irresistible of a project to to not engage with. So what inspired you to create Pie initially?
In college, I had done some research work on decentralized algorithms and emergent behavior. This is sort of looking at how we can program, how we can create systems from the perspective of individual actors rather than from this sort of top down logic rule based kind of approach. This very hierarchical algorithmic approach to solving problems. So instead of trying to program a ant simulator from the perspective of the ground, you sort of program the ant simulator from the perspective of the ant. And by limiting how you actually define the interactions, then you're able to sort of scale up so that running a simulator for 1 ant is just as easy as 10, 000 ants.
And essentially, I was trying to I was working at the Sunlight Foundation at this point. It's a couple years after I graduated, and I wanted to revisit some of my older research. And I was writing some Python, and I was like, man, I wish I had lived to write this stuff because Python is sort of a little bit harder to do from this sort of agent sort of this agent driven programming, this sort of agent perspective. It was sort of awkward to write that in Python, but using lisp for everything was also kind of hard because it's sort of a pain to model things. So I I was wondering how exactly we could combine the 2. So high is actually short for hymenoptera, which is sort of it means membrane wing, and it's stuff like ants and wasp that exhibit this sort of swarm behavior. So the name's a little bit of a nod to that original, sort of creation story.
[00:07:14] Unknown:
So what do you recommend as reference material for Python developers to gain familiarity with idiomatic lisp?
[00:07:20] Unknown:
Currently, you have we have ahighline.org, just currently a list of, like, all the core features, functions, and, some sources. Other than that, you have some pretty great projects like from Algonon. I don't know his real name, but he has project like Hydimatic and mini camera implementation in, which is pretty neat. You also have this, you also can look at the source code for high because lot lots of the core library, contrib modules are written in high. Pretty idiomatic, I'd say.
[00:08:00] Unknown:
And also outside of the high rule, just to expand on that because that's definitely totally right. There are a couple of sort of really popular awesome books about other list variants that aren't high. Particularly The Joy of Closure, Let Over Lambda, and Land of List are all favorites of mine. Yeah. You also have this book called, Closure Programming,
[00:08:22] Unknown:
from is it Chessebroek, I think, which is also pretty neat to read if you were interested in lisps.
[00:08:29] Unknown:
We should we should make a point of, of getting these books into the show notes after the fact because I think that that could be useful for people.
[00:08:37] Unknown:
Yeah. I can get links.
[00:08:40] Unknown:
Cool. K. So what are some of the problem domains where implementation becomes easier or more elegant as a result of Hive's lisp syntax?
[00:08:48] Unknown:
Tika, I think this is you, man. Yeah. It is.
[00:08:52] Unknown:
No. I think it's pretty much anything. I haven't I haven't really found anything. I mean, the thing with the list is that you can instead of just solving the problem, you can first, when you start working with the problem, you can first create the language that you want to express your problem with and solve them with. So first, you create your language, and then you use that that domain specific language to solve your problem. And pretty much anything seems to work as far as I know. I, for example, I haven't had any performance problems with the Harlan, and I have been doing just a little bit of games programming. Nothing nothing serious real time stuff, though, but but, basically, anything.
[00:09:34] Unknown:
Yeah. Also, like, the since HighLang is, this list variant, you also have this, like, this, declarative and functional programming aspect of language. So it's it's pretty neat and powerful than working with, data structures and in general, just iterating of data, which is where, like, the declarative, paradigm really shines, compared to, like, object oriented programming and modeling like objects.
[00:10:01] Unknown:
Yeah. I definitely think Thiago is being a little bit modest there. 1 of his projects, Circulium, is this gigantic, really fantastic DSL for writing roguelikes in high. Yeah. So really, really, like, I think the best way I've heard this described to me, and I have to laugh about it a little bit because, it's just so perfect is sort of like C and Python, and all these sort of all these sort of like well established and and and widely adopted languages are really great once you know the problem that you're solving. Lisp is really good when you have no idea what the problem is yet because you can really alter the language to fit just right. So when you're working and you realize that your problem's actually slightly different, it becomes really easy to quickly prototype and literally change the language sort of this really weird corner case of of computing, sort of sort of this really weird corner case of of computing, sort of where Lisp shines.
[00:11:01] Unknown:
So I've got a couple of points that I wanna tie back into here. So going back to your point, Morton, about Lisp being useful for doing data manipulation, I noticed that there's actually a highlighting kernel for the Jupyter project. And I'm curious if any of you have experience or know of anyone who has used this for doing any sort of analytics or data science applications.
[00:11:27] Unknown:
That's a really great great question. I'm not super sure of any, applications, because, unfortunately, people don't always, report back all the awesome stuff they're working on, every once in a while. Oh, sorry. Go ahead. There's actually,
[00:11:42] Unknown:
I can probably get the link afterwards, but there is, IPython notebook, with highlighting doing some, mash machine learning, linear regression stuff, in a Python notebook, which is pretty neat to look at. We also see the data, datasets, and the results. You can probably get that link. Yeah. That would be great. That is awesome. And wasn't there that
[00:12:07] Unknown:
1 guy who wrote that natural learning, natural language program that you feed some prose Yeah. And and then it generates you a Yeah. Proseites. Yeah. Proseize. Oh, yeah. That was a simulator.
[00:12:23] Unknown:
I'd forgotten about that. Yeah. If we could get a link for that, that would be great.
[00:12:28] Unknown:
There's so there's so many really cool projects in for the high.
[00:12:32] Unknown:
And so given the ability to create powerful macros in Lisp, could Hive be used as a way of prototyping or back porting new language features in Python itself?
[00:12:42] Unknown:
All these questions are just my favorite questions.
[00:12:47] Unknown:
We can take it easy. Yes. We have done that.
[00:12:53] Unknown:
So just just to gotta prove that point, I backported the yield from operator from Python 3 to Python 2, and it basically splats out a gigantic hunk of code. And it's actually super interesting because a lot of people don't sort of know what's going on with yield from under the hood. And I sat there for, like, a couple hours and I went through the CPython interpreter and took a look at what the byte code was doing. And for additional reading, anyone out there, it is actually thrilling and the implementation of yield from is just extraordinarily just graceful and tidy. I really appreciate the way that was written. But, yeah, I backported backported yield from by essentially making this macro splat out a bunch of boilerplate Python code, like, probably about 25 lines that has the same behavior as yield from. It just yield from is able to remove all this redundant code to to make the generator sort of talk correctly. So it's definitely possible to do that stuff. Another 1 that comes to mind would be probably a context manager. I haven't tried this yet but I assume that writing a context manager in a macro would totally be doable even if you didn't have the built in context manager operator in in the AST.
[00:14:02] Unknown:
So what you're saying is that by leveraging the power of highlighting, we could actually get the Python 2.8 that everybody has been clamoring for.
[00:14:11] Unknown:
So long as they're going to port their code to high.
[00:14:15] Unknown:
1, 1 thing we have kind of been brought it's it's it's not it's not complete. It's a kind of a stretch, but, we have been sort of bragging about that Highline is more portable than normal Python code. Because in theory, any high code you write should be compatible with every for free everything from 27 to 35, I think. Mhmm. I think we skipped out, 2 sec 26 recently. Okay. So any high code you write should run on all patent versions, with little to no modification whatsoever.
[00:14:49] Unknown:
And that leads me to another question that I had is what would be involved in porting high to run on alternate Python implementations such as PyPy or Jython or any of the others?
[00:15:01] Unknown:
It it already runs on PyPy, actually. Great. Pretty neat, because, the actually, the only thing Highline needs to be able to run on any Python path platform is that the implementation have just, like, implemented the AST module. Mhmm. And PyPI have done that. Jython have done that now in the recent release, but we are touching upon some pretty strange bugs last time I tried. So we're actually seg faulting the whole, compiler. So, yeah. It's interesting.
[00:15:34] Unknown:
Yeah. That's, that's all completely, yeah, spot on. Some of the, just when I was originally doing the port to pypy, some of the interesting bugs that we did hit are probably worth mentioning. So with pypy, when we were doing the initial port, the AST behaved slightly differently than CPython's AST. In particular, 1 really terrible thing we were doing at the time was running line numbers backwards in some places because it it would be possible for the compiler to insert code before code that was written before that line, basically for stuff like imports. So you had to force some sort of import. It would bring that import up to the beginning of its scope. Unfortunately, what this meant is the compiler would see line 35, line 32, line 33, line 34, line 35. CPython let you do this unless you were running in debug mode, which is pretty hilarious. If you wanted to debug Python, it'd start seg faulting in a different place.
But PyPy just didn't accept this at all and started crashing. And in general with Python, if you give it bad AST and you give it bad code, I mean, like, actual Python bytecode, it'll start to crash in really interesting ways or just seg fault. So so, during initial port, sometimes we'll see quirks in the in the sort of undefined behavior of AST because AST is sort of defined as platform specific. But, yeah, it it's it's really been ported to PyPI, and I'd be interested in someone doing some work on Jython. I think we were having some virtual end issues at 1 point. So
[00:17:08] Unknown:
An interesting thing is that I in the latest release of py, if you just type list comp, it would just say in with no arguments, it would just say, so pie Python. It fixed the master, but it's not released yet.
[00:17:22] Unknown:
I gotta try that now.
[00:17:27] Unknown:
You kinda brought it up in a couple of cases. You brought Closure itself up, talking about books, and you do we're just talking about PyPI and and context manager, various other things. I have to ask, 1 of the cool things about Closure is the fact that its data structures are atomic. Right? Like, Rich Hickey talks about we need to get away from place based programming and into, you know, a more modern I forget what he how he how he refers to closure. So is high are are data structures in high atomic and thread safe in that same way?
[00:17:59] Unknown:
No. Unfortunately, and it's a great source of, I wouldn't say contention, but I think everyone's generally not super happy that we're we're stuck with mutable objects. But we we sort of solved this weird slightly different problem than Closure. So I should prefix this with I'm a huge Closure fan, and I definitely love working in it. And Closure was a big source of in inspiration when we were looking at Hi in the early days. But Python does this weird thing where you can't you you don't you're not just able to call into Python. So you're not able to just do f f I, but Python code can f f I into high as well.
[00:18:41] Unknown:
Interesting.
[00:18:42] Unknown:
So Python can import high modules as if it was Python. And in fact, this works so well that the Python bugger, pdb, is perfectly happy to step through high code. You enter a function call and then keep hitting s s s, and then you're going through s expressions, you're going through Lisp code in your Python debugger.
[00:19:00] Unknown:
It's hilarious. That's pretty awesome.
[00:19:02] Unknown:
It's fantastic, but essentially, hi. It tricks Python at such a low level, at the byte code level, that we're able to get away with murder. And I've been able to implement stuff like Django modules, and Django requires that it's able to import modules in in order to use them. And this is a pretty common pattern with the Python ecosystem. And so we're sort of aiming for bidirectional interoperability. And Right. As as a result of that, it becomes really hard to add immutable data structures because the data structures we receive from those programs are gonna be mutable. And so you start to have to be a little bit more aggressive with how things become immutable, what's immutable, and there's such a headache surrounding that. And because we don't control the run time, because it's actually CPython's run time, it becomes incredibly difficult to use immutable data structures and still seek this sort of bidirectional interoperability that we're looking for.
[00:19:51] Unknown:
That that makes perfect sense. And and in a sense, I feel like I can see why a newbie like myself would have asked the question, but now I can see that the question is stupid in a way because because exactly like what you just said, you know, you're making this alternate syntax that's built atop a completely mutable language paradigm. And so it it wouldn't make, I I can't even imagine how you would bridge that gap. It's a thrilling problem.
[00:20:16] Unknown:
1 argument is essentially that, you could just enable a compile flag or something and just assume. Nodie will, import the I code and just have immutable day structure from get go. It will break probably if, somebody imported the Python, but we could just assume that won't happen. And that would partly solve the problem, and they have been discussing that.
[00:20:40] Unknown:
Okay. So if you were to get rid of the idea of it being bidirectionally usable and only take advantage of the immutable data structures within your high code that doesn't get imported into the Python syntax, then it would function properly. Is that what you're saying?
[00:20:57] Unknown:
It did. We haven't tried it. Okay.
[00:21:01] Unknown:
So it's a theory. It's an untested theory. Yeah.
[00:21:04] Unknown:
Theory, and we have, like, sort of, like, saying, yeah. We could probably try that. So it's just an interesting theory to see if it would work at work or not. Mhmm. Yeah. Some sort of, like, no, really,
[00:21:16] Unknown:
like, Python totally won't be calling me, and I totally accept that everything that I'm gonna be working with is gonna be high code. Yeah, the problem becomes solvable. But, yeah, I think that's that's probably right.
[00:21:27] Unknown:
At that point, you have to question it it almost seems like high becomes something else and and it's almost like you why are you actually writing code that gets translated into Python? Why are you as opposed to just using another language or something like
[00:21:41] Unknown:
that, but Oh, yeah. I I mean, there's a a really beautiful Lisp implementation in our Python called pixie, and if you don't need bidirectional interoperability, check out pixie. I mean, if you don't need to import the Python modules and you don't need Python modules to call your code, yeah, go for go for a language that has like proper scoping and immutable data structures everywhere. That's yeah. That's like I don't think anyone would follow you. But if you need to be working really and totally embedded inside Python, I think that's where list or where high really shines.
[00:22:13] Unknown:
So what are some of the most challenging and interesting problems you encountered bringing an alternate syntax to the Python runtime?
[00:22:20] Unknown:
Yeah. That's that's a good 1. So I'd probably go with the interesting part about this is I think the answer is not 1 based on Python sort of the technology. It's not based on Python the code base, and it's not based on hide the code base, I don't think. I think it's more what your expectations are when you're in a list programming environment. It's sort of a testament to the last question about immutable data structures. I think people would generally assume that in the list. And I think people, when they look at scoping in Python, it's certainly been talked about to death and it's the reason why we have nonlocal in Python 3, but the scoping in Python is definitely not what most people would think of when they think about sort of Lisp scoping. 1 common technique in this technique sort of exists because a lot of Lisp like programming languages don't have objects, is to create a closure around a let. This is sort of called a let over lambda. It's where you return a function that's within another function, and it lets you access variables in the closure outside of yours to maintain state. So in Python, most people would say, oh, create a class for that and then create an attribute x, And then every time you run the function, it would increment self x. In lisp, you would create a let and you'd have let x 1.
And then every time you run the function it would do x plus equal 1. And if anyone knows Python scoping super well, this will lead to a, Python scoping bug where, probably unbound local error, I think, where you try to access something outside your scope before you've assigned to it. So I think that the problems aren't so much technological. I think that Python's AST was really powerful. I think using it properly wasn't all that bad. I think PEP 302 import hooks to actually do the import of high modules from Python was totally exposed and worked great. I think that enough of the compiler was exposed to us that we were able to get this done, but I think that the expectations
[00:24:11] Unknown:
were probably the hardest part to manage. And so this leads into another question that I had as to, if there were any particular aspects of the Python runtime or ecosystem that lent themselves well to creating a Lisp dialect to run on top of the Python VM.
[00:24:30] Unknown:
Python exposes the really neat internals to Python programs that allow Python programs to sort of take a lot of control over the runtime itself. So you look at the way that pdb works by attaching itself to set trace. And Python programs are really able to access the Python VM in pretty impressive ways. So some of the very particular things that we used are PEP 302 import hooks, which were originally designed to facilitate loading from zip archives. Before that was sort of hard coded into the CPython runtime.
But after PEP 302, it was sort of envisioned that that would live as a as a extension written in Python that would actually do the zip file loading so that it didn't have to live in the c code. We took advantage of this. By the way, any intrepid hackers that are thinking about it, you could totally write a PEP302 import hook that would go over the line to maybe Pypi. So if you import 'foo' and 'foo' isn't found, then you could just run a pip install 'foo' and then return the module transparently to the user. I mean, don't do it. That would be horrible. It would be ridiculous. But you could totally do it. Right? That that's exposed to you as the programmer. And so 302 import hooks let us search sys.path as if we were the Python interpreter searching sys path and search for dot high files rather than dotpy files and then do the import and insertion into sys modules and tell Python, Yeah, totally. Yeah, we, like, absolutely found that module. You should just, like, go ahead with it. And Python's incredibly tolerant of it. The Python AST is also just absolutely wonderful. It's a little bit hairy to work with because you can crash the interpreter in tons of really interesting ways, but it's all completely available to Python programs and so we are able to write code. Not unlike, by the way, not unlike lisp macros in fact, because we're writing code that writes code in the way that lisp code writes code. So the things that sort of lisp programmers will commonly talk about being amazing about lisp, which is the idea that code can write code, is sort of exactly what the AST module provides to Python. It allows Python code to write Python code, and you're able to use that code later by availing it or turning it into bytecode or turning it cleverly into bytecode and putting it into a functions done with code object.
You can sort of do whatever you'd like.
[00:26:40] Unknown:
And so I'm curious as to how sort of what level the high binary lives at, so so how it interacts with the Python VM and how it gets loaded in?
[00:26:54] Unknown:
So the high high's compiler is written in a hybrid Python and high. The sort of core compiler is written in Python to avoid bootstrapping problems. Mhmm. And that takes in the sort of model, the s expression model of the code and dumps out a s t. So it sees a form that's parenthesis f n and then the arguments to it, so it knows that it's building a function. And so it dispatches it to the function internal, and then returns an ast.functiondef, and that all goes through the input code. So it goes out to the file, it turns it into, it turns s expressions into Python objects. It goes through those objects, turns it into Python AST, And it takes that AST, and it turns into Python code by using the compile built in in Python, and then it'll execute that. And it kind of it it lives in this sort of weird, both nested and pure position to the CPython runtime.
After a certain point, py is totally hands off. In fact, py can build out py c files, and you don't even need py installed at all really. You actually kind of do these days. But, you can just run Python on the pyc. So so you can think of Hi as a compiler more than a runtime.
[00:28:12] Unknown:
And also, there there is another language that also does the same. It's funnily enough called, dorgylang. It's made by Pios, which is Haskell implementation over CPython, which is pretty neat as well. And it also uses the same import to import Python, and I'm not quite sure if it, does this, bidirectionally, but it at least imports Python modules the same way high does.
[00:28:39] Unknown:
That's very interesting. So while playing around with the high REPL, I noticed that it does visual matching of parentheses when closing an expression, and I'm curious what other niceties have been included in the REPL.
[00:28:51] Unknown:
Yeah. That's a really great great question. So the REPL was 1 of those things that I kinda slapped together before the PyCon talk at PyCon I'm sorry, it wasn't a talk, it was a lightning talk. When was it? 2013, I think. And we slapped together this read line module which did grand matching, I think, tab completion. I've I'm pretty sure it does tag completion for functions that it knows about, probably not macros though. And I can't remember if we put too much else in there. At 1 point, I think someone was looking at colorizing the REPL with pigments. I don't know how far that got, but we've always sort of been having fun with the REPL. I think all of us
[00:29:24] Unknown:
kinda love a fancy REPL. So Yeah. There's also me and a guy named Farhaven have been implementing, originally, it was a closure project called n REPL. Which is just a rappel that communicates through networks. So you can just, like, connect the socket with it or do it through your HTTP. And it's a prob it's it's, like it's, like a standalone repel, and you just were the client for it, like in VIM or emacs, then you can just connect it. Me and Farhaven essentially did this for high. And we're also, like, piggybacking on, like, this, BIM and EMAC clients written for closure. So we just, like, connected up with Harappel, and this field can't just evaluate, evaluate, high line instead of closure.
And, in regards to this, we're also considering implementing a new REPL on top of this,
[00:30:17] Unknown:
with more features because Pyreppel in Pyreppel itself just does a lot more than this current REPL. Along those lines, I was curious about your thoughts on adding auto completion to the REPL as a way of encouraging discovery and exploration of the high language? And also as part of that, on a previous show, we spoke with,
[00:30:37] Unknown:
Chris. Help me with the name. I know. I'm thinking too. Are you thinking of are you thinking of the guy who wrote PT Python? Yes. We're sorry, pt Python author. We've done lots of episodes, and it's hard to remember.
[00:30:51] Unknown:
But, anyway, the, the prompt toolkit, which is a read line replacement. I'm curious how if you have either Jonathan Slenders. Yes. Jonathan Slenders. If you've come across the prompts toolkit and considered using that to facilitate the high lang REPL.
[00:31:07] Unknown:
So I remember coming across that pretty recently and being super interested in it. I haven't had a chance to play around with it. But since the early days of high, 1 of the sort of community folk, people that have always stuck around the IRC channel is Thomas Ballinger, who was at the Recurse Center for a while. And he and I are friends, and he is 1 of the folks behind b Python. And so I've always been interested in adding a b Python driven high REPL to have the sort of drop down auto completion. If anyone out there hasn't seen b Python, I highly recommend checking it out because it's a really cool project. Yeah. I've played around with it. It's very nice. Yeah. I also believe bowling has the Python
[00:31:47] Unknown:
branch where that supports Highline. I'm quite sure it does.
[00:31:52] Unknown:
Oh, man. Even better.
[00:31:56] Unknown:
Yeah. And, I, myself, I'm using just a simple simple stuff that you can do with the Python, the help and deer. They help your loads when you are playing with the code. Just have have a look at the docstrings and the other ports.
[00:32:14] Unknown:
So you mentioned docstrings. I know that the majority of my experience with Lisp has been with emacs Lisp, and I know that that supports, you know, adding a docstring. And so I'm assuming that hylang has that same capability and that it would compile to the dunderdoc function call. Is that correct?
[00:32:31] Unknown:
Yep. That's absolutely correct. And stuff like Python's help built in, will totally work on imported high modules.
[00:32:38] Unknown:
Oh, cool. Yeah. Given the strong focus on documentation as part of your code, it's definitely encouraging to see that highlighting has that same capability.
[00:32:49] Unknown:
Yeah. It was it was 1 of the first things I made sure were there. Yeah. I've always been a little bit of a doc fanatic. So
[00:32:54] Unknown:
So which list variant is Hi most similar to and why?
[00:32:59] Unknown:
There's always kinda been this, constant tugging war between people that does scheme, people that does command list, and people that that does, closure. So we have, from the get go, had these, like, aliases, def, Defen, which is, from closure. And we have Defen, which is from Common Lisp, etcetera. The main is I think 1 of PulseTag's original goals was to be able to just, like, copy paste closure codes straight into Highline and make it work. Nice. Not that realistic today, but, it was I think you mentioned it. So, High Lang itself draws a lot of inspiration from closure, specifically, even though we don't still talk about the immutable structures.
But if you're familiar with closure, higher lang is not that hard to get accustomed to. You got the immutable structures in a few like this quirks and scoping, but it's probably most
[00:33:57] Unknown:
it's probably more close to closure than anything else, to be honest. That's great. And as a follow on, how does garbage collection work in high and why?
[00:34:05] Unknown:
I have the most tongue in cheek response to that question. Oh, go ahead. Do it. You can help me. You you can edit it out if it's too much, but it's like, yeah. Well, we used to see Python, PyPI, run time. So the request is we don't really know. I mean, if it's not our problem, it's c Python, Python does
[00:34:26] Unknown:
Good answer. That's an awesome answer.
[00:34:29] Unknown:
For for what it's worth, if anyone's actually interested in, memory, the garbage collection in c Python or PyPI, there were a couple of really great ones this last PyCon about them. So totally recommend. Cool.
[00:34:40] Unknown:
And, how hard would it be to port existing list packages to high like maxima or close?
[00:34:48] Unknown:
Man, that's a that's a tough question. Because high is so sort of built into the Python world in sort of every aspect, It hosts itself on the Python VM and it behaves exactly like Python code. It's sort of a question of what this code's doing. I I think that list code is generally portable. Algernon, 1 of the high developers, was able to port the reason schema, mini Quran implementation over to high, without too too much problem. But every once in a while you run into weird scoping bugs or maybe something isn't implemented yet. But on the whole, if you sure spend some time looking at it and and porting, generally, yeah, it's portable. But if it's already written in a different language, I don't know. You you should you should do whatever makes you happy. That's that's my philosophy on it. So whatever whatever language is gonna whatever language is gonna keep you happy, that's what you should use. So
[00:35:42] Unknown:
What kind of overhead in terms of runtime performance and memory usage does High impose? Has this been a challenge in High's development?
[00:35:49] Unknown:
There isn't really anything worth mentioning, in terms of memory usage or anything like the laser runtime because the first time you run high, it parses the whole file, and then it can generate the pie the pre compiled byte files, the the dot pick files. And after that, there's nothing no overhead at all. It it just runs just as fast as Python does. The only, like, real problem you notice is that because, it's a string handling in PyPI that's rather slow. So you have, like, this noticeable delay the first time you run the high file because, PyPI, used a little time to read those strings.
But after the initial run, you don't really notice it all that much.
[00:36:34] Unknown:
That's really super cool because when you think about it, you know, I I guess when I wrote this question, I was thinking about language implementations like, as a, for instance, JRuby, where there's this real sort of, like, impudence mismatch between the Ruby object system and the Java object system, and and the language runtime has to do all this heavy lifting to get the 2 worlds to coexist. And it seems like the way you folks did this by hacking the Python AST and import hooks, that is that is totally awesome that you can basically have a lisp in Python with almost no runtime penalty. It's kind of gobsmacking.
[00:37:09] Unknown:
Yeah. But I think you made the comparison to the Python VM just like being LLVM. You can just, like, remove the whole syntax led to Python, implement whatever you want, and not really have any penalties for it because of the bug code. So, like, if you want, we could just do this study or favorite language. Who does not want the PHP like language implemented on top of Python?
[00:37:33] Unknown:
Yes. Thanks. Pretty much anybody who has ever used PHP probably.
[00:37:39] Unknown:
Well, you know, you could do it if you want to. Yeah.
[00:37:43] Unknown:
So what are some of the most innovative uses for high that you have seen or created?
[00:37:48] Unknown:
I really recommend just going to GitHub and just look at trending repositories, under the language high because there's always something, new there. You have this project called, Pineal, which is just if you have ever seen, like, this, overtune or tone or overtune for a closure, which just produces sound, for live coding. Pineal is just like doing a live graphics in high line in real time. So you just, like, edit code, rewrite code, and as you say the file, the graphics would change according to the code you write. So you can have this, this yeah. He he wrote this for doing, I think he does it for live DJ sets where he just dj's and then, edits the graphics according to the music live on the screen. It's called pineal, I think.
You also have, like, as I mentioned before, like, has hydimatic. It just goes over your, high line structures and just simplifies it. It's based on the it's, uses the mini camera and he also implemented, to just like. Like, as an example, we're currently, like, doing a little bit overhaul it comes to syntax in high. And 1 of the goals is having hardomatic to automatically rewrite old high files into the new syntaxes where I've changed it, like removing the extra braces around let's, the for loops as an example. That's not a cool project.
But instead, there's tons of cool projects, really. Just worth checking it out.
[00:39:16] Unknown:
And you mentioned searching GitHub for highlighting projects. So does that mean that GitHub actually recognizes Hialang in its sort of language, overview? Totally. It does. Very cool. That's great. Did you guys work with GitHub to get that implemented, or did somebody at GitHub just do that on their own?
[00:39:35] Unknown:
I think that it was a combination of pull request and someone asked them nicely, and they're like, yeah. Sure. Why not?
[00:39:46] Unknown:
GitHub basically uses, like, these open source libraries, to highlight code and detect code. So you can just, like, submit poll request to their, repository, and they'll just accept it after a while. And then it will just be recognized by GitHub after a while.
[00:40:00] Unknown:
So what does the future hold for high?
[00:40:03] Unknown:
That's yeah. That really interesting question, and I'm not sure there's 1 answer. I I think that in terms of concrete high development, Fox sort of mentioned, alluded to a little bit of a language cleanup that we're doing. There are a number of mistakes that I made early on in high and we're sort of living with them. So I think our near term goal is sorta to get done by September, are to clean up the language so that we can sort of have a 1 0 language interface, sort of a 1 0 standard lib, standard high lib, and really clean up some of the problematic areas of of the high runtime. I think that that's probably the the short term for high's future. For the long term, I'm not sure. I've always sort of let that up to the people that are working on high.
I I think that my role within high is is largely so there's an Italian word for an old man who stands at a construction site with hands behind his back telling people how to do things and it's umeral. And so I see myself as highlighting's Uberall. I'm like mostly standing there with my hands behind my back watching the people do the real work and saying things. So, I think that asking the high community at large what's next is probably gonna get you a better answer. Okay.
[00:41:20] Unknown:
And along those lines, I noticed that there are a large number of core contributors to highlighting listed on the website. And I'm curious how you determine what features to work on or if it's some if it's just everybody pick something that they wanna work on and submits a pull request.
[00:41:34] Unknown:
Yeah. It's usually people work on what's interesting to them. I've sorta come from the Devian sorta software anarchy kind of point of view, where where everyone's sort of driven by things that get them out of bed. And in general, someone will file an issue with some idea that they have, and will sort of gain gain a bit of consensus on the implementation, what it should look like. Then we'll start prototyping some code and get that sent in in a pull request and get some feedback from the from the core contributors. And as soon as 2 core contributors sign off on a change set, that's it. It's in. So if if there was some sort of, you know, complete overhaul and there were 4 people colluding together, that's that's how it would go. So we don't have any sort of long term planning, but usually we'll have someone who sets a milestone and is kind of in charge of getting the release out the door. Currently, Algernon is working on the grand language cleanup.
So most of the changes that we're accepting right now are related to that.
[00:42:32] Unknown:
So are there any questions that we didn't ask that you think we should have or anything that you wanna mention before we move to the picks?
[00:42:39] Unknown:
Super happy. Those were great questions.
[00:42:42] Unknown:
Are there any ways that our listening community can help out with the project, particular areas that you think you guys could use assistance with? Yeah. Sure. I I think that people playing with the language and finding
[00:42:52] Unknown:
corner cases and and getting those in the bug tracker is just immensely helpful. Everyone's very receptive to to issues that come up and everyone sort of loves bugs. So any any any sort of feedback from users out there would be exceedingly welcome. I think hi is a great way to start to get to know a lisp because you're working with the same modules and sort of data structures as you're used to in Python and all your old code works. So if you're at all interested in lisp for the first time, yeah, it's definitely worth playing around with. Or if you have ideas about how high can be better, definitely would appreciate bugs. Bugs, testing, documentation, all the usual suspects.
[00:43:33] Unknown:
Or you can just, like, hang around in the high channel on free node called high and just tell us how awesome highlang is. Alright. Also pretty great.
[00:43:43] Unknown:
Alright. So unless anybody has anything else to add, we will move on to the picks. Sounds good. For my first pick, I came across a Python library called spaCy, which is a natural language processing library that uses Cython to make it very fast. And they actually have a page on their site called displayc, which lets you type in whatever random sentence you want, and then it will step through how it decomposes all of the different elements of the sentence to be able to figure out what they all mean semantically in the context of the sentence. And so it's just a really cool way to explore natural language processing visually and see what's actually happening under covers. So definitely recommend checking that out. My next pick is a novel that I just read by Helene Becker called the golem and the genie. And it's a very interesting story, somewhat historical fiction. It's about a golem and a genie, you know, 1 from Jewish tradition, traditional mythology, 1 from Syrian mythology. And they both end up in New York at the turn of the century of you know, in 18 99 going into 1900. And it's just a story of how they sort of come to get used to living in New York City among all these humans and, you know, define their personalities in terms of how they interact with other people and each other. And it's just very well done, very interesting book. Definitely worth checking out.
And my last pick tonight is going to be Safari online, the O'Reilly subscription service that gives you access to all of the books and a number of the videos that O'Reilly publishes. So it's a great way to get access to a lot of really excellent technical content. So with that, I will hand it over to you, Chris.
[00:45:31] Unknown:
It's funny with regards to your your your last pick there. Those guys just moved in right next door to my company in Downtown Crossing, so it's kinda funny. Their office is cool. So for my first pick, I'm going to pick a a documentation reader app, which I know sounds about as interesting as watching dishes dry, but this thing is really, really awesome. It's called Dash, for OSX and iOS. But there's also a, a kindred spirit version for Linux and Windows called Zeal. And what makes this this thing so amazing, at least to me, is that there is support for it in virtually every editor that exists, Cmax, Sublime, Vim, etcetera, etcetera, to say, bring up documentation under cursor and dash.
And it has doc sets for every programming language and API that is at all popular at, you know, anywhere under the sun. And they add just recently added this really great feature that if you own both the OS X version and the iOS version of Dash, you can actually set your iPad up as a remote so that you bring up documentation. You basically say, I wanna look up the documentation for, you know, all in Python, and it will actually bring up the doc on your iPad, which is kinda neat. So that's my first pick. My second pick is a podcast called Reasonably Sound. It's by, this gentleman named Mike Rugnetta, who is the host of another pick that I'm about to pick in just a second. It is a really interesting podcast. It is all about sound and the different ways that sound, you know, that we interact with it, then it kinda interacts with our world. And I highly recommend there's an episode on echoic memory, which is really neat, and, it's just it's it's very cerebral, which is really interesting because the other pick that he hosts is is kind of very different, a little less cerebral, but it's it's really good.
And my last pick is a YouTube channel called, the PBS Idea Channel, which, you know, again, has kind of a generic sounding name, but it's really great. It's this guy, Mike Rugnetta, And, basically, every episode is a topic from modern it could be from modern pop culture. It could be something in modern society, but it is beautifully produced. It like, you know, they put together all these, video clips and memes and everything else as he's speaking. And it's just it's it's a really great example of some of the excellent content that's on YouTube these days.
[00:48:07] Unknown:
And that's about it for me. So 1 really interesting project that I think is gonna be super important for the world at large is a project going on in Debian right now called the reproducible build project, which is an effort to strip non determinism in creating a binary from c code, so that multiple people can make, make certify that a binary, corresponds to source. And this lets multiple parties say, like, yeah, that binary definitely corresponds to the source that that's being distributed which is gonna be really important as we try to verify integrity in operating systems going forward. You can read more about this at wiki. Debian.org/reproduciblebuilds.
[00:48:53] Unknown:
I also
[00:48:55] Unknown:
totally love modelview culture. So definitely worth a subscription. It's a really fantastic quarterly publication focusing around, diversity and tech culture. Definitely definitely worth subscribing.
[00:49:11] Unknown:
I can second that 1. That's a really good really good newsletter there.
[00:49:15] Unknown:
I have couple ones. The first 1 is this old computer computer science lecture called structure and integration of computer programs. It's available at the YouTube. I think there's a book about book for that too. And that's actually the lecture that I keep rewatching and rewatching now and then, and that's that's what actually, when I was trying to learn at least open the rabbit hole to me. Mhmm. I I had tried tried least couple of times before, but it never never really worked. But this 1 this 1 actually is the 1 that showed me that, oh, this is what this stuff is. It's really super interesting. Even if you are not into the list, it's still interesting to watch.
[00:50:05] Unknown:
It requires some pretty heavy math skills, though, to get all the way through it. Right? No. Not really. Not that not that bad. And you can always rewatch it.
[00:50:15] Unknown:
And the second 1, as I mentioned earlier, I really love to play with different languages. And the most recent 1 that I have been playing playing with is the f sharp that is a dotnetlanguage. It's a functional language, and it's really really neat because you can interact with the ex existing dotnet libraries and programs. And I can throw these links on there in a moment. And and on the air shop, there's this really cool actually, it's in a dot net already, reactive extensions. So what I'm currently trying to wrap my head around is the functional reactive programming, which is about signals and propagate propagating of those signals and reacting those signals. It's super interesting and super different to what I have done before and therefore, kinda hard.
[00:51:12] Unknown:
Yeah. The reactive x libraries are very interesting and very mind bending when you're trying to sort of get your head around it, and it really fits neatly into the whole stream processing renaissance that's been going on lately. And there's actually a ReactFX Extension library for Python, So definitely worth checking that out as
[00:51:31] Unknown:
well. Yeah. That's on my list. When I tried that, I didn't know enough of the RX, so it kinda failed. But Yeah. Taking a detour and trying on the different language and then back to it. Yeah. I first used it in the context of an Android program that I was writing. Ah, okay. And then the third 1 is test this really neat sort of ongoing event called 1 game a month by Christian Kaitlin. He's, McFungie Pants on the Twitter. This is basically just a challenge yourself to write 12 games in a year. So 1 game a month, and there's a huge community supporting that. And you can bounce your ideas and have people to help you out and help other people. And that is pretty neat. I think they have, like, close to 10, 000 games already.
[00:52:26] Unknown:
Wow.
[00:52:27] Unknown:
Yeah. It's it's it's super crazy how people can just go and write 12 games. Yeah. Or some write even more because then they they are doing those shorter shorter challenges.
[00:52:39] Unknown:
That's all from me. Okay. Those are some great picks. Martin, how about you? Pressure.
[00:52:47] Unknown:
No. I'm going to I I'm going to be a little bit boring and pick a movie and, TV series. This should painfully obvious what I'm going to pick, but, if I say 20th anniversary, hackers. So, my pick is hack the movie hackers, 1994.
[00:53:06] Unknown:
It's a great movie. Nothing wrong with that. I just it's an outstanding movie.
[00:53:10] Unknown:
I I I I was with 8 or 9 people on IRC, and we streamed it live. And we had, like, this just ongoing conversation. We're just, like, quoting all the sentences that it was so fun. What is it? I love that movie. My second favorite is just going to be the TV series, Mr. Robot, because it's awesome. I'm not going to say anything else. It's just, like, pure awesome. I actually don't catch anything else at all. Okay. That's totally fine.
[00:53:40] Unknown:
That's fine. No problem. So I would just like to thank all of you for taking the time out of your day and especially Tuca and Morton for staying up at all hours of the night to join us to talk about High Lane. So for any airports.
[00:53:56] Unknown:
I should have done. 1st, people I've been talking to for 5 hours. Oh, my goodness.
[00:54:04] Unknown:
So for anybody who wants to get in touch with any of you or keep track of what you're up to, what would be the what best way for them to do that?
[00:54:11] Unknown:
I'm on IRC and pound high as Paul Tag, and I'm also on Twitter as at Paul Tag. And my website is paulte.ag. I think generally you could just guess a website. I hope for the username, Paultag, and if it's there, it's probably me.
[00:54:28] Unknown:
Okay.
[00:54:31] Unknown:
I'm also at the IRC and on Twitter as not as there because that's my cousin who got the handle before me.
[00:54:46] Unknown:
Okay. Morten, do you have any ways that you would like people to get in touch with you?
[00:54:52] Unknown:
Unusually, I'm Foxporum on plenty of RC networks. I got Twitter on, Morten Lindrud. Yeah. I also got kicked up on Fox Pro on where you can find all my stuff. That's probably, yeah, that's probably the best way.
[00:55:06] Unknown:
Okay. Well, I'm sure our listeners are really gonna enjoy this episode, and we've enjoyed talking to you all. So, again, thank you very much, and I hope you enjoy the rest of your evening.
[00:55:17] Unknown:
Yes. Thank you. Thanks. You too. Thanks for having us.
Introduction and Host Information
Guest Introductions
How Guests Got Introduced to Python
Introduction to HighLang
Inspiration Behind HighLang
Learning Resources for Lisp and HighLang
Problem Domains Suited for HighLang
HighLang in Data Science and Analytics
Prototyping Language Features with HighLang
Porting HighLang to Other Python Implementations
Interoperability and Data Structures in HighLang
Challenges in Bringing Lisp Syntax to Python
Python Runtime Features Beneficial for HighLang
HighLang Compiler and Interaction with Python VM
Features and Enhancements in HighLang REPL
HighLang Documentation and Docstrings
Similarity to Other Lisp Variants
Porting Lisp Packages to HighLang
Runtime Performance and Memory Usage
Innovative Uses of HighLang
Future of HighLang
Community Contributions and Development Process
Picks and Recommendations
Closing Remarks and Contact Information