Re: Building a Android App in NIM ?

2016-12-18 Thread Libman
That will depend on what technique and GUI library you'll be using.

**_My understanding of this is extremely tenuous_**, but — just to help get the 
ball rolling — here's a high-level outline of the various mobile software 
development options and how they relate to Nim. I hope that someone more 
knowledgeable will come along to fill in the gaps and correct me as needed...

* * *

**Android *N*DK (C/C++) Based Apps:**

  * [nimx](https://github.com/yglukhov/nimx), the "cross-platform GUI framework 
in Nim". "Nimx officially supports Linux, MacOS, Windows, Android, iOS, 
Javascript (with Nim JS backend), and Asm.js (with Nim C backend and 
Emscripten)." I think it uses Android's Java SDK (via jnim, see below) for just 
a few things, and NDK / sdl2 for everything else. This option will limit you to 
just the things supported by nimx, but this is **probably the easiest 
approach** and you're not married to just Android.
  * Using [sdl2](https://en.wikipedia.org/wiki/Simple_DirectMedia_Layer) 
directly. An example of this approach is "[NimES: NES Emulator in 
Nim](https://github.com/def-/nimes)". This makes sense for things like games, 
but you'd have to "reinvent the wheel" when it comes to drawing widgets.
  * There's [Qt for 
Android](http://forum.nim-lang.org///doc.qt.io/qt-5/android-support.html) and 
there are Nim bindings for 
[Qt5](https://github.com/philip-wernersbach/nim-qt5_qtsql) / 
[qml](https://github.com/filcuc/nimqml), but I don't know if ever the twain 
shall meet... (Disclaimer: being an [anti-GPL 
zealot](http://forum.nim-lang.org///copyfree.org/standard/rejected), I am 
highly biased against Qt.)



* * *

**Android SDK (Java) Based Apps:**

This would mean a bridge between Nim and Android's rich habitat of UI widgets, 
libraries, and everything else offered by its Java SDK. If you go this route, 
your app will lack nothing compared to Android apps written entirely in Java, 
but it'll be married to just Android and would need an emulator to run on PC or 
iOS. (See also: [a recent "nim4android" thread on this 
forum](http://forum.nim-lang.org///forum.nim-lang.org/t/2613).)

  * [jnim](https://github.com/vegansk/jnim) \- "Native language integration 
with Java VM has never been easier!" claims this library - but it seems like a 
cutting-edge effort, and you'll be blazing a new trail with Android bindings... 
I can't find any examples of anyone using this in production just yet, but it 
seems to be in active development. "The documentation is coming soon."



* * *

**Web-Based Apps:**

An important question to ask is whether your projects actually needs to be an 
"app". It's amazing what can be accomplished inside the Web browser these days! 
Technologies to research include: the latest HTML5 advances, IndexedDB, SSE, 
and various in-browser front-end frameworks (ex. bootstrap). There are 
different approaches to this (some very new), which involve Nim in varying 
capacities and to varying degrees:

  * **Client-Server App**: Nim can definitely be used for a highly scalable 
server end of the app. The client end can be written in Nim and compiled to 
JavaScript. Nim's [dom](http://forum.nim-lang.org///nim-lang.org/docs/dom.html) 
module provides only very basic bare-bones functionality, but it's a start. 
This 
[XHR](https://github.com/yglukhov/async_http_request/blob/master/async_http_request.nim)
 module proviles an example of the vision for creating Nim libraries that work 
both in a native C program as well as an in-browser JS. And soon 
[wasm](https://en.wikipedia.org/wiki/WebAssembly) will provide yet another 
client-side option.
  * **On-Phone-Server App**: This is a variation of a traditional client-server 
model where part or all of the web server functionality runs as a native app on 
the phone. You can easily build such Web server app on top of a Nim web 
framework like [jester](https://github.com/dom96/jester). Simple Web servers 
that don't use large databases can easily run even on my puny $30 phone - using 
something like SQLite for storage, and generating an HTML5 UI with little or no 
need for client-side JS. A local Web server can be accessed by pointing the 
mobile Web browser to localhost:port, or via a minimal app that embeds Chrome 
without the user knowing it. With the former approach, you can avoid all 
Android-specific packaging overhead and just scp executable files to the phone 
(I use 
[SSHelper](https://play.google.com/store/apps/details?id=com.arachnoid.sshelper&hl=en)).
  * **Serverless P2P App**: this is a fairly new idea in the JavaScript world 
that does not yet connect to Nim, but it could. Technologies to research would 
include the in-browser JS implementations of [IPFS](https://ipfs.io/), 
[IPLD](https://github.com/ipld/js-ipld-dag-pb), and 
[libp2p](https://github.com/ipfs/js-libp2p-ipfs-browser). It would be awesome 
if Nim's JS target functionality evolved beyond just the current dom module and 
connected to these technologies to allow serverless in-b

Re: GTK 3.20 Nim wrapper

2016-12-18 Thread Stefan_Salewski
I have only the epub and pdf version of the book, I got it for 20 $ in manning 
discount. And I can not imagine why someone would buy the real paper version in 
these days -- why kill trees for it, waste energy for printing and generate 
waste? (Of course for some books, which you study hundreds of hours paper is 
fine still.)

Ints are not converted to cint automatically by default. On a 64 bit system 
Nim's int is 64 bit, while cint may be only 32 bit, so you would lost 
information. You may use a converter if you really want automatic conversion. 
But I generally use cint when that data type is needed for a C library.


Re: GTK 3.20 Nim wrapper

2016-12-18 Thread vlad1777d
Thank you. Do you mean the  book, not the  one? Because if you 
mean paper, I'm afraid that it'll be hardexpensive to send it into Ukraine.

About cint, I thought, that int is automatically converted to cint for C-type 
procs, as it's for strings, in manual andor tutorials I have not found 
information about cint. I'll look more today.


Building a Android App in NIM ?

2016-12-18 Thread Mennohexo
Hi ,

when i have a little program in NIM , with GUI included ,and want

to make that for android mobile , is that possible ?


Re: Aporia IDE unable to compile

2016-12-18 Thread Stefan_Salewski
Well, it seems to be easy guessing the problem: He posted "E:New 
folderbinnim.exe" and ""E:New'. OS er..." so the problem may be the space in 
the path name for the nim.exe. At least I heard of that type of problems years 
ago -- I really wonder if that can be an unknown fact for a serious windows 
developer? But of course I am not sure, have newer used Windows in the last 10 
years. But when he would be seriously interested in finding the problem, he 
would have tested with a path without spaces. But maybe he is cross compiling 
for ARM, see 
[http://forum.nim-lang.org/t/2664](http://forum.nim-lang.org///forum.nim-lang.org/t/2664)


Re: Aporia IDE unable to compile

2016-12-18 Thread Krux02
I know it does not really help, but I am not an Aporia developer, nor a windows 
user. But on Linux it does work, and if something goes wrong it would be much 
more likely that I could help.


Aporia IDE unable to compile

2016-12-18 Thread Atlas
When I wrote my program in Aporia, I clicked on "Compiler & run current file", 
this error occurred:

> "E:New folderbinnim.exe" c --run C:UsersDELLDesktopFirst Error: Problem 
> occurred during execution: The system cannot find the file specified.

Additional info: Requested command not found: '"E:New'. OS error: > Process 
terminated with exit code 1