Session
Schedule FOSDEM 2022
Nim Programming Language

HPC from Python to Nim

A preliminary introduction to performance optimization
D.nim
Ayman Al Baz
<p>Numpy is considered the go-to library for fast performant python scientifc computing, as it is a heavily optimized scientific computing library written in C. But is it really that fast (spoiler: yes, but not when used with python)? In this talk, I will be covering a real-world example in the domain of genetics, and demonstrating how I was able to out-perform numpy code running on my intel-7700k machine with a raspberry pi running code from the Nim programming language!</p> <p>I will also be providing optimization tips for speeding up your code, with a focus on comparing python with the Nim programming language.</p> <p>The talk can be roughly divided into the following sections:</p> <p>Part 1 (32 min) - Introduction to myself. Describing a computationally expensive problem that I have experienced when working with Python. - My background is in data science and biology - Biologists tend to work with large datasets - One common problem we face is preprocessing of large amounts of data. A common technique used here using distance calculations - Why I decided to learn a different language Part 2 (1 min) - High level introduction to Nim - Nim is a statically compiled programming language - Etc... Part 3 (10 min) - Going through step-by-step on how to write performance optimal code with Nim. Describing common performance pitfalls that Python users may not be aware of. - Inlining - Using the type system to your advantage - Taking advantage of domain knowledge - Multi-threading (openmp) - Bounds checking - Compiler flags - Mathematical and algorithmic optimizations Part 4 (3 min) - Benchmarks and closing statement - Show benchmark comparing the naive python numpy implementation with the highly optimized Nim one - Top tips to keep in mind when writing high performance code.</p> <p>Please note: the purpose of this talk isn't to be an exploration of some new state-of-the-art way of doing performance optimization or some relatively unknown optimization techniques. This is a general introduction for people hoping to use Nim for HPC that are coming from Python. Lots of emphasis will be put comparing the two languages.</p>

Additional information

Type devroom

More sessions

2/5/22
Nim Programming Language
Andreas Rumpf (Araq)
D.nim
<p>This is a talk about Nim's concurrency mechanisms, how the old things worked, how the current things work and what the future holds.</p>
2/5/22
Nim Programming Language
Peter Munch-Ellingsen
D.nim
<p>This talk builds on my previous talks about micro-controller programming in Nim, and my talk on writing a keyboard firmware from scratch in Nim. It outlines how a Nim ecosystem for microcontrollers can be built with zero-cost abstractions which means that the resulting code is almost exactly the same size as pure C code (no Arduino). All this while keeping an interface which is much nicer than anything you'd find in C, maybe even better than that of high-level microprocessor coding frameworks ...
2/5/22
Nim Programming Language
Arthur Rasmusson
D.nim
<p>I'd like to showcase LibVF.IO's new LIME Runtime feature (Lime Is Mediated Emulation) and do a deep dive on open source vGPU technology in general.</p>
2/5/22
Nim Programming Language
Ryan Lipscombe
D.nim
<p>The entity-component-system pattern (ECS) is popular in game development for its ability to model complex dynamic simulations with mechanical sympathy, in an environment where microseconds matter.</p> <p>The pattern is focused on run time composition. Entities are mutable sets of component data types, and systems run for entities with specific sets of components. Many ECS frameworks are oriented around components or entities, and systems use run time queries or filters to match their ...
2/5/22
Nim Programming Language
Scott Wadden
D.nim
<p><a href="https://github.com/dsrw/enu">Enu</a> is a 3D live coding environment that can be used for education, exploration, and light game development. It uses a simple, logo-style Nim DSL, and aims to be accessible to as many people as possible, even those who may not yet be able to read or type. It's still fairly immature, but will eventually be suitable for implementing simple multiplayer 3D games.</p> <p>In this presentation, Enu's creator will walk through creating a simple 3D game with ...
2/5/22
Nim Programming Language
Zach Oakes
D.nim
<p>Reactive programming has become commonplace in many kinds of software, while others, including games, have been slow to adopt it. There is an idea stretching back to the 70s that enables reactive programming in an extremely general way: rules engines. This talk will demonstrate pararules, a breakthrough rules engine for Nim. It will demonstrate how games and other software can define their entire logic as a series of independent rules, and how it decouples your data much like (but more ...
2/5/22
Nim Programming Language
Andre von Houck
D.nim
<p>Metaprogramming in Nim is very powerful. But why would you use it? How is it used in the real world? We will explore the "power levels": starting from generics, continuing to templates and finally arriving at macros.</p> <p>We will first look at generics usage in VMath (Vector Math Library) and Jsony (JSON Parsing Library). Then we will continue on to templates and how they are used in VMath and Windy. Finally we will look macros, the top of the "power levels", and how they are used in Shady ...