Hacker News new | past | comments | ask | show | jobs | submit login
Let's Write an LLVM Specializer for Python (2015) (stephendiehl.com)
271 points by Cieplak on Oct 16, 2019 | hide | past | favorite | 19 comments



I recommand David Beazley's talk from a recent PyCon India on a similar subject : https://youtu.be/r-A78RgMhZU

Mostly live coded, it really is pretty amazing but also quite insightful.


> In this talk, I live-code a simple stack machine and turn it into an interpreter capable of running Web Assembly. I then use that to play a game written in Rust.

Wow. This is mind blowing. Thanks for the pointer.


He has a lambda calculus talk in python[0] that is just as good. Just a great educator.

[0] https://www.youtube.com/watch?v=pkCLMl0e_0k


U of Chicago, I believe, denied him tenure, when he was an assistant prof there.


How good of an educator you are may not even be in the top 5 most important things to get tenure, unfortunately.


If you like this you might also like http://terralang.org


Whoa, I've had this idea kicking around in my mind for a looong time (specifically something for dynamically generating Go code). Was wondering if anyone actually built this out, but could never find anything. Thanks for sharing!


Cool! Aside from the Python JIT portion, this was a pretty decent dive into LLVM. One question: was this a notebook, or it it just CSS that's making the code look like that?



As others have noted, this is a somewhat dated article. Indeed, the github page for llvmpy (https://github.com/llvmpy/llvmpy) recommends to use llvmlite (https://github.com/numba/llvmlite) instead.

See also http://llvmlite.pydata.org/en/latest/user-guide/index.html and in the context of the original article, in particular these two pages:

http://llvmlite.pydata.org/en/latest/user-guide/ir/examples....

http://llvmlite.pydata.org/en/latest/user-guide/binding/exam...

Hope this helps! :-)



Nice, compressed LLVM overview...


Anyone got a benchmark for the LLVM'd code?


Am I being daft, or is there not much sbout specializers on the web? Any links much appreciated.


I'm wonder why llvmpy depends on llvm3.2 or 3.3, it's so a lot behind current version.


The article is from 2015. Many of the jits (eg numba) have moved to llvmlite.

https://github.com/numba/llvmlite


Why not just use Nim?


I like Nim. I am learning it now. However, Nim is not Python and this post is about Python.


Use nim to create an LLVM specializer for python and call numpy functions with it?




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: