Hello folks. I'm very interested in nim and I'd like to get started with it ASAP.
What's the best way to build / install nim and Aporia on OS X?
Thank you.
Getting Aporia working might be tricking, won't be able to help you much here unfortunately. Aporia is a gtk app so you need to get the gtk library working on your Mac.
Installing Nim is much simpler. Just follow the instructions here: https://github.com/Araq/Nim#compiling. I'd recommend adding it to your PATH than using koch install.
Like dom96 said, Aporia is a Gtk app and Gtk apps on Mac OS X do not work to well. You either need XQuarts and install Gtk via brew, or try to build the Quartz version of Gtk (I tried just a few days ago, was too problematic so I dropped it). I would not recommend going to all this trouble.
My recommendation is to get Sublime Text and use Varriount's excellent Nim plugin:
What happened with this thread? It went astray :)
For a long time I could not get gtk to compile on OSX, but so far that part looks ok. I think I have 2.24 compiled.
So I tried to make aporia. Got to linking stage and then following:
curious what I could do (to make it to the final stage)?
That sounds for me not really like a direct Nim problem. Ever tried asking a maschine? http://stackoverflow.com/questions/9200521/why-does-the-name-of-a-source-file-affect-compilation
Generally with 0.10.2 Aporia may not work very well due to the varargs problem. That seems to be fixed in latest 0.10.3 devel. For Aporia, there is one branch available with new nimsuggest, and one without.
If you have spare time, you may test if you can compile my GTK3 wrappers on mac -- it is some work unfortunately due to manually downloading, no nimble support yet. If GTK3 should work, you may test my GTK3 version of Aporia. For Linux it compiles fine and partly works, but my tests with nimsuggest failed.
I mostly get aporia compiled against gtk2-quartz on my mac. It fails loading gtksourceview when started. I did not investigate further because I don't plan to use aporia or gtk2.
You may try to compile the examples from the gtk2 repository first.
Did you use homebrew to get all of gtk2 installed?
"Did you use homebrew to get all of gtk2 installed?"
I did what is described here:
https://wiki.gnome.org/Projects/GTK+/OSX/Building#Prerequisites
I tried to do this couple of years ago and it was failing. But it seems that earlier problems of compiling gtk+/gtk2 on Mac does not seem to be problem anymore.
Aporia, as it looks to me is based on Gedit. I have functional Gedit on OSX (god knows how that is compuled) but it works. Therefore GTK shall be possible. I also have python GTK fynctional.
Seems that I have brew command therefore at some point in time it seems that I explored homebrew, how I can check what I have in terms of prerequisites for nim ?
i tried to setup a simple intellij plugin but the most important part is how to integrate JFlex with the current nim lexer and parser. The point is to reuse the current implementation, since writing a parser/lexer is not trivial.
I still have no idea what that parser is supposed to do... Return an AST? And then you re-implement all of the semantic checking that we do on the AST too? (~60K lines of code!) And if you don't do that (and you shouldn't, that's what we have nimsuggest for), what DO you do with the AST then? And if you don't do anything with the AST you mostly need a lexer.
Here some screenshots:
Yes, that is like GTK was looking 8 years ago on Linux :-(. It can look a bit better, i.e. I found a Wireshark GTK3 example: http://balintreczey.hu/blog/wp-content/uploads/2014/06/Wireshark-gtk3-quartz-adwaita.png http://balintreczey.hu/blog/beautiful-wireshark-on-os-x-using-homebrew-and-gtk3quartz/
Dom: What is the recommended way to install nim-suggest on Linux? Seems not nimble, as I just saw on github tracker. I never manage a pure manually install. Does it work only when I istall your Aporia for GTK2? And the commands? I think there was a other similar tool before nimsuggest, may that help to find out something about available commands?
you should be compiling the nimsuggest in the Nim compiler repo
Ah!. Did not know that, I was only told to move the nimsuggest binary to the Nim dir. Will try tomorrow, thanks.
[EDIT]
Yes, first success!
Latest Nim devel 0.10.3 already contains the nimsuggest directory inside compiler directory. So I compiled it there.
$ pwd /home/stefan/Nim/compiler $ ls nimsuggest/ nimcache nimsuggest nimsuggest.nim nimsuggest.nim.cfg cp nimsuggest/nimsuggest nstest ./nstest --stdin nimsuggest/nimsuggest.nim def nimsuggest/nimsuggest.nim:49:9
And no error messages but useful output :-) (copy seems to be necessary, softlink seems not to work.)
This helped me:
brew install gtksourceview libiconv
cd /usr/local/lib/
ln -s libgdk-quartz-2.0.dylib libgdk-x11-2.0.dylib
ln -s libgtk-quartz-2.0.dylib libgtk-x11-2.0.dylib
Unfortunately I don't remember for sure... Seems like I did not use this option...
$ history | grep 'brew install gtk'
294 brew install gtk
$ brew info gtk+
gtk+: stable 2.24.28 (bottled)
GUI toolkit
http://gtk.org/
/usr/local/Cellar/gtk+/2.24.28_2 (1198 files, 59M)
Poured from bottle
/usr/local/Cellar/gtk+/2.24.28_3 (1198 files, 59M) *
Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/gtk+.rb
==> Dependencies
Build: xz ✘, pkg-config ✔
Required: gdk-pixbuf ✔, atk ✔, pango ✔, gobject-introspection ✔, hicolor-icon-theme ✔
Optional: jasper ✘
==> Options
--with-jasper
Build with jasper support
--with-quartz-relocation
Build with quartz relocation support