Speed up your Python modules using Nim

Anirudh (~icyphox)




If this title looks familiar to you, it’s because there was a similar talk last year, titled “Speed up your Python modules using Rust”. This talk draws inspiration from it, and aims to introduce a new systems programming language — Nim.

We all love Python, but we have to agree that it sucks when it comes to writing performant code. Sure, you could write your code in C/C++, or perhaps even Rust. You can even use Python's ctypes module to interface with foreign functions defined in dynamic libs generated by C/C++ or Rust.
All of this comes at a cost: the need to write code in a low level language, or in the case of Rust, the need to learn new (and perhaps, a tad complex) syntax.

Enter Nim, a new fast and efficient systems programming language, that's compiled, statically typed and offers C-like speed. But the one feature that seals the deal — elegant and more importantly, Pythonic syntax.

Don't believe me? Here's a snippet of Nim code:

Nim code

Basic outline of the talk

  • Speaker info
  • What makes Python slow
  • A quick intro to Nim
  • [DEMO] Using the nimpy Nim module to port computationally intensive Python code over to Nim (i.e. calling Nim from within Python)
  • [DEMO] Alternatively, calling Python from within Nim
  • [DEMO] Comparing performance between vanilla Python, C and Python + Nim
  • More on Nim — its current status and its community
  • Q/A

Who is this talk for?

  • Python devs looking to improve perf in their existing codebase
  • Anyone looking for a systems programming language with the simplicity of Python

Potential takeaways

  • Moving "slow" Python code over to Nim
  • Nim ⇔ Python interop
  • In general, a new approach to improve performance in Python code


  • Basic Python programming knowledge
  • Some understanding of DLLs (Dynamic Linked Libraries)

Content URLs:

Blog post — Speeding up Python with Nim by Robert McDermott

GitHub repo with scripts showcasing Nim + Python interop

Speaker Info:

I’m Anirudh, a computer science major at SRM IST, Kattankulathur, Chennai. My primary interest is computer security, and more specifically — offensive security, digital forensics and threat intel. I’m also a security researcher/CTF player at Sector443, an infosec community at our University. I've worked closely with a lot of organizations to provide security solutions, and have conducted pentests on their infrastructure. Apart from security, I actively contribute to open source projects, my most favourite being the Nim programming language.

Speaker Links:

Section: Core Python
Type: Talks
Target Audience: Intermediate
Last Updated:

Hi, Anirudh! Thanks for submitting your proposal.
We have put together a set of best practices for proposals - please take a look.
Also, it would be helpful if you update your presentation slides, and a 2-minute video overviewing your talk.

Best regards,
(CFP coordinator)

Chaitanya Tejaswi (~CRTejaswi)

Login to add a new comment.