Projects:
- An emacs major mode for the Nim programming language
- Nim wrapper for SDL 2.x
- A wrapper for the zip library (now available in nimble)
Forum:
- KDevelop nim/nimble project A cool video debugging in KDevelop: https://vimeo.com/135918228
- Check type inside macro
- How to debug nim code?
- I’ve put together some macros to work with Python’s cffi, if anyone is interested
- Horizontal parsing
Core development:
Some Fixes:
symbol lookups fix, defer statement fix, conditional declaration inside a template fix, async http server fix, scopes are still broken for generic instantiation fix, static assign to ref fix, generated unions fix
New features:
times
package updated with new functions like getDayOfWeek
, countYears
Example code for this week:
An OpenGL example code, it will show a cube in 3d:
nimble install sdl2
nimble install opengl
wget "https://raw.githubusercontent.com/nim-lang/sdl2/master/examples/sdl_opengl_example.nim"
sudo pacman -S sdl2 # for arch
sudo apt-get install libsdl2-dev # for debian, maybe the dev is an overkill
nim c -r sdl_opengl_example.nim
Now let’s debug the code, there is a function at line 24 with a newWidth
parameter, let’s print that:
nim c --debugger:native sdl_opengl_example
gdb ./sdl_opengl_example
break sdl_opengl_example.nim:25 # setup a breakpoint
run # starts the program
bt # prints the call stack
print newwidth # prints 640
c # to continue