<<15-07-2012>>

06:14:48Araqfowl: http://nimrod-code.org/c2nim.html#def-directive
06:14:57Araqto get the "remove identifier" feature
06:15:18Araqand I don't think you can import variables from a DLL ... :-/
06:15:32Araqyou need to do that the hard way via
06:16:14Araqhttp://nimrod-code.org/dynlib.html
08:28:28dom96good morning
09:14:36*SchalaZeal joined #nimrod
09:16:31SchalaZealwoot
09:16:53Araqha good timing ;-)
09:17:27SchalaZealI tried my best but const C vars are getting the finger from Nimrod
09:18:10SchalaZealhad to comment them out for the time being
09:19:04AraqI saw it, make the 'addr' expressions templates instead
09:19:15Araqand 'dynlib' doesn't support yet vars ...
09:19:20Araqbut I'm working on it
09:19:53SchalaZealah ok
09:20:14SchalaZealErr, how do I make addr expressions templates?
09:29:27Araqtemplate constFake: expr = addr(someGlobal[1])
09:31:07Araqbtw c2nim now generates proper Nimrod types like 'culong'
09:31:33SchalaZealI saw :D
09:32:36Araqso now it's true when I say: c2nim often does a better job than a human being :P
09:32:36SchalaZealAlthough, in the case of culonglong, might want to map it to __int64 when Windows is targetted
09:32:55Araqyou can do:
09:33:02Araq#mangle culonglong __int64
09:33:24SchalaZealhm
09:34:29SchalaZealwhat's a PEG pattern, by the way?
09:36:01Araqa "better" regex
09:36:11Araqfor some definition of "better" ...
09:36:43AraqI don't like them as much anymore as I used to ;-)
09:37:14SchalaZealRegex gives me a headache when I try to learn it
09:41:51SchalaZealI really can't wait for C++ interfacing to improve. I'd love to make a wxWidgets wrapper
09:46:46SchalaZealor alternatively ObjC so I can do Cocoa interfacing
09:48:06Araqhu?
09:48:15Araqoh you mean c2nim support for c++?
09:48:34SchalaZealwell I'd like to get started on either a wxWidgets wrapper or Cocoa wrapper
09:48:40SchalaZealyeah
09:50:20AraqwxWidgets please
09:50:42AraqI had some wxWidgets wrapping code btw
09:50:55Araqit's very old and used a C intermediate binding
09:51:29Araqyou could also take over 'claro'
09:51:40SchalaZealWhat's that?
09:52:12Araqhttps://github.com/Araq/Claro
09:52:33Araqit's a simple UI toolkit that works on mac, windows and linux
09:52:41Araqusing cocoa, gtk and win api
09:52:47Araqso you get native widgets
09:53:15AraqI tested it with some examples and it works
09:53:27Araqneeds cleanup though and a better nimrod interface
09:53:39SchalaZealwhy not rewrite it in Nimrod?
09:53:51Araqtoo much work
09:54:02SchalaZealhm
09:54:23Araqplus with the C/objective C combo you can always access the most recent headers
09:54:41Araqnimrod has no cocoa wrappers yet
09:55:12SchalaZealYeah but I feel if I wrap C++/ObjC, I'd have to do it by hand
09:55:48Araqyeah c2nim can't parse that yet
09:56:01SchalaZealbummer
09:56:39Araqyou could patch swig so that it supports nimrod
09:56:41SchalaZealI'd really like to learn the internals better so I can try my luck at Java or .NET backends
09:56:59SchalaZealI don't even know how to use SWIG
09:57:16Araq.NET backend is possible
09:57:22Araqjust forget about Java
09:57:34Araqit can only be done inefficiently
09:57:42Araqas the JVM is a piece of crap
09:58:33SchalaZealhm
09:58:48SchalaZealhow so?
09:58:57SchalaZealI mean... not that I'd touch it
09:59:30Araqno support for: value based datatypes, unsigned integers, 'cast'
09:59:47SchalaZealit can't even cast?
09:59:50Araqfirst class functions
10:00:10SchalaZealfirst class functions? what are they?
10:00:23Araq"pointer to function" (roughly)
10:01:01Araqit really only supports java ...
10:01:13SchalaZealit?
10:01:30SchalaZealoh the uhm
10:02:01SchalaZealwell, Oracle's only gonna teabag it further I think
10:05:00SchalaZealC++ I would use but the compiling is dreadful, C# I really like but it doesn't recognize \0, \1, etc and if you want to use a different library based on the host system, you're screwed
10:07:59SchalaZealcompiling in C is dreadful because you have to specify not only dependencies, but dependencies of dependencies
10:08:36SchalaZealtake for example wxWidgets.... it's a slew of dependencies
10:11:32SchalaZealOne of the reasons why I hate static libraries... \
10:12:04Araqwell yeah, wxwidgets is not nice
10:12:50SchalaZealC/C++ isn't nice
10:14:01SchalaZealyou'd figure if the dependencies had info on their own dependencies, they could just implicitly link them like Nimrod does
10:15:23Araqbut then you'd have to admit that there is a problem
10:15:55SchalaZealhm
10:16:10Araqpeople instead pretend that autoconf works ;-)
10:17:16SchalaZealCMake is more my thing... but their FindWX module is fussy about wx-config's presence or not
10:21:17SchalaZealWell, 3:20 AM here... guess I'll do a Claro wrapper tomorrow
10:22:00SchalaZealas for working on the actual library....... as I said, algorithms are my weakness
10:22:34Araqbut the claro wrapper already exists
10:22:51SchalaZealoh
10:22:54Araqit just needs a more nimrodic interface on top of that
10:22:58SchalaZealI... didn't see it
10:23:01Araqand more examples
10:23:04Araqand more docs
10:23:13Araqand somebody who tests it
10:24:12SchalaZealI guess I could try in testing/examples
10:25:08SchalaZealyeah, looking over the wrapper, I think I could definately use this
10:25:41SchalaZealmaybe an impure module that exposes it in a friendlier manner
10:27:10Araqyeah and make the callback system use closures :-)
10:27:40SchalaZealClosures I still need to grasp myself... heh
10:31:19SchalaZealick.....SCons.... I'm terrible with that
10:33:32Araqhey, it doesn't use scons anymore
10:34:44SchalaZealgood heh
10:35:02SchalaZealwell, see you later... going to bed
10:35:37*SchalaZeal quit ()
13:01:58zaharyAraq, I've ran into a problem with dynamic libs. during initialization, some functions from nimRtl are called before they are loaded which leads to crashes
13:02:27zaharyfor example the first line in NimMain is initStackBottom(); which is supposed to come from nimRtl, but won't be loaded until systemInit()
13:04:03zaharyshould I move the library loading code in nim_datInit() and have this at the first line in NimMain - this sounds the most sane fix to me
13:41:14zaharyit would be nice to add support for the more traditional style of dynamic linking to nimRtl too (e.g. where dependency walkers and other tools will see the dependency) - I can add another define for that
13:43:56*fowl quit (Ping timeout: 248 seconds)
13:48:39*Trix[a]r_za is now known as Trixar_za
14:31:08Araqzahary: I'm puzzled why the test suite did not detect this
14:33:51zaharywhere were the dynlib tests? I can look at the compiled sources to see what's different there
14:34:20Araqtests/specials.nim, runDLLTests
14:35:55Araqapparently they are not run
14:36:07Araqfrom koch
14:37:40Araqand I know what's different
14:37:57AraqI changed the setStackBottom initialization
14:38:11Araqas sometimes it would miss 16 bytes or so
14:38:21zaharyyeah, I noticed
14:38:28zaharywhat about the proposed fix?
14:38:53Araqdunno, sounds bad to have it in another stack frame
14:38:58zaharymy reasoning is that it's dangerous to call systemInit before setStackBottom, because we may introduce a GC call there (unlikely tho)
14:39:05zaharyand nimdat is safer in this regard
14:39:20Araqnimdat is a call from NimMain
14:39:32Araqand as such is likely to reintroduce the bug
14:39:53Araqthat I fixed by moving setStackBottom to NimMain()
14:40:02zaharywhich bug? the incorrect stack bottom bug?
14:40:05Araqyes
14:40:54zaharyI don't want to move setStackBottom - it will remain in NimMain, but it will be on the second line after the nimdat call, where dynamic libraries were loaded
14:41:28Araqah I see
14:41:44Araqspeaking of which
14:41:56Araqhow come that masking the stack bottom to a page boundary does not work?
14:42:16Araqthat would make this code way less fragile
14:42:28Araqsomehow it doesn't work ...
14:43:57zaharywell, what do you mean by "doesn't work" here? I guess it computes the masked address, but it fails in some other way?
14:44:36dom96Araq: I had this idea... would it be possible to convert a regex pattern to a pegs pattern?
14:44:37Araqwell it didn't fix the bug
14:45:00Araqdom96: yes for a subset of regexes, in general it's not possible
14:45:11zaharydom96, not always - the biggest difference is that peg patterns are always greedy
14:45:30dom96oh. Pity.
14:46:26Araqhrm nim__datInit could call the GC
14:46:35Araqor maybe not
14:46:37zaharyhmm, how?
14:46:44Araqdunno :-)
14:46:54AraqI guess it's safe
14:46:56zaharyit's just setting values in the data section there, right?
14:47:21AraqI think it set someting else too but can't remember :D
14:47:34Araqwell ... we'll see about that
14:47:39Araqyour fix sounds good
14:47:57AraqrunDLLTests(r, options) is disabled in specials.nim
14:48:23AraqI suppose I disabled it because the test machines never set LD_LIBRARY_PATH
14:48:30Araqand thus it would fail anyway
14:48:48Araqwhich is annoying
14:49:38zaharybtw, nimrod probably doesn't support the so called "rpath" in mac executables, which indicates in which directories to look for libraries?
14:50:52Araqnever heard of it, so no ... :-)
14:52:52zaharyI'm a bit annoyed by the details of shipping dynamic libraries on mac - problem is, you're supposed to keep them in some weird adjacent directories
14:52:53zaharyhttp://www.mikeash.com/pyblog/friday-qa-2009-11-06-linking-and-install-names.html
14:54:02zaharyalso, http://en.wikipedia.org/wiki/Rpath
14:55:55Araqit's only sane on windows IMHO
14:56:29AraqLD_LIBRARY_PATH has obviously never been designed with testing in mind
14:56:52Araqand of course on macosx they have 2+ different ways
14:57:00Araqas they never got rid of the unix cruft
15:03:57Araqbtw I noticed that compile times of nim__dat.c are pretty bad
15:04:10Araqespecially if you use symbol files
15:04:32Araqas this requires the compiler to merge multiple nim__dat.c files ...
15:04:42AraqI wonder what we can do to prevent that
15:09:54Araqsee you later
16:01:35*Zerathul joined #nimrod
16:03:08*Zerathul quit (Client Quit)
16:48:14*Zerathul joined #nimrod
18:48:48*Trixar_za is now known as Trix[a]r_za
20:20:30*fowl joined #nimrod
21:17:27*Zerathul quit (Ping timeout: 255 seconds)
21:41:05*pmros joined #nimrod
21:42:15dom96hello pmros
21:42:27pmroshello
21:47:19Araqhi pmros
21:47:25pmrosdom96, have you written a kernel in nimrod?
21:47:30pmroshi, Araq
21:47:43pmrosI wanna see it!
21:48:35dom96pmros: It's not as good as you think. It barely shows text.
21:48:45dom96And I need to go to sleep right now.
21:48:57pmrosit's enough for me
21:49:10dom96I'll put it on github later. See ya later.
21:49:11pmroskernel bare bone
21:49:26pmrosok
21:49:30pmrosthanks
21:49:53pmrosi'm excited
21:50:35pmrosi've to go
21:50:42Araqalright bye
21:50:47pmrossee you!
21:50:57*pmros quit (Quit: Saliendo)