4

I'm looking to use nim in an upcoming project, but I'm not sure where to start. I've worked on a fair few webapps over the last two years and I'm pretty good with python. I'm also very good with Linux.

Now I want to make a GUI app for linux, maybe using qt. I looked up qt how tos but they use c++ or python mostly and qt creator. How can I tie nim to qt?

bluenote10
  • 23,414
  • 14
  • 122
  • 178
Ananth
  • 848
  • 11
  • 26

2 Answers2

4

You can use qt as the UI for your Linux app and then build the logical backend of your app in Nim, export it as a C library and call it from the user interface layer. That's what I did for Seohtracker, the UI is done in ObjectiveC for OSX or IOS, but the backend is implemented in Nim exported through a thin C API.

In theory you can grab that logic module, slap a qt UI layer and have a Linux client. The Nim backend integration guide explains how you can do this trickery of mixing and calling different languages together.

Grzegorz Adam Hankiewicz
  • 7,349
  • 1
  • 36
  • 78
  • This is great. So if I'm getting this right, I should be able to make one back end in nim and create UIs in other languages/frameworks that call into my back end. That sounds neat! – Ananth Feb 05 '15 at 13:20
  • @Ananth yes, in theory you could even use Nim to generate js and run your app in a web browser – Grzegorz Adam Hankiewicz Feb 05 '15 at 16:03
0

While there is no Qt binding for Nim yet, you can use Qml: http://forum.nim-lang.org/t/692

def-
  • 5,275
  • 20
  • 18