<< 03-04-2016 >>

00:02:35*gokr quit (Quit: Leaving.)
00:13:53enthus1astis there a convenient way. while looping through a sequenze. to only append a sperator when its not the last item?
00:13:53enthus1asteg: creating a comma seperated list withouth the last ", " ?
00:34:24*GangstaCat quit (Quit: Leaving)
00:39:09*GangstaCat joined #nim
00:53:59reactormonkenthus1ast, look for join
00:58:41enthus1astreactormonk: a join over a object with an `$` proc requires that i write my own join right?
01:01:20reactormonkenthus1ast, how would you join a list of objects without `$`?
01:05:11enthus1asti would't
01:05:33enthus1astits to late here i should sleep : )
01:21:24reactormonkenthus1ast, I assume you had a typo in there, because otherwise your question makes no sense.
02:21:31*enthus1ast quit (Ping timeout: 244 seconds)
02:41:20*arnetheduck joined #nim
04:22:13*enthus1ast joined #nim
04:34:11*desophos joined #nim
04:41:52*kulelu88 quit (Quit: Leaving)
05:25:50*desophos quit (Read error: Connection reset by peer)
06:15:28*gokr joined #nim
06:27:57*nchambers is now known as shellbot
06:28:54*shellbot is now known as nchambers
06:49:54*kulelu88 joined #nim
06:53:20*zahary joined #nim
07:05:48*yglukhov joined #nim
07:16:00*gokr quit (Ping timeout: 276 seconds)
07:23:27*kulelu88 quit (Quit: Leaving)
07:29:18*endragor joined #nim
07:53:28*yglukhov quit (Remote host closed the connection)
08:12:57*yglukhov joined #nim
08:24:44*chrisheller quit (Remote host closed the connection)
08:25:34*yglukhov quit (Remote host closed the connection)
08:28:45*filcuc joined #nim
08:30:15*gokr joined #nim
08:31:56*Arrrr joined #nim
08:32:06ArrrrWelcome
08:32:17filcuchi all, i'm still debugging my issue with "The application has requested the runtime to exit in an unusual way" with a .dll, nim, dynlib and mingw32
08:32:42filcuci created a really small example with cmake and a one liner .nim file
08:33:41flyxdom96: I'm around now
08:34:46filcucis there someone that would like to give it a look?
08:38:35filcuchttps://gist.github.com/filcuc/03811841ab4f1708ce2e0f8feae9aca4
08:39:04filcucif you want to test it, just replace "_" with a "/" in the gist names. The "_" stands for a subfolder
08:39:58filcuci'm using mingw32 4.9.2
08:40:03filcucon a 64bit system
08:41:51*gokr quit (Ping timeout: 246 seconds)
08:44:01cheatfatefilcuc, do you receive your error on program exit? yes?
08:44:06filcucyes
08:44:13filcuccheatfate: yes
08:44:50cheatfatedo you have some initilization code in DllMain?
08:45:15filcuccheatfate: no
08:45:27filcucyou can see from the gist
08:46:04filcuccheatfate: or at least..i didn't put anything in the .cpp that is part of the shared library
08:46:13*darkf_ joined #nim
08:47:17cheatfatefilcuc, the problem is i dont have cmake
08:47:20flyxfilcuc: dos_qapplication_create doesn't seem to have an implementation
08:48:00filcucflyx: no sorry i'll update the gist my fault
08:48:04filcucflyx: give me a sec
08:48:13*darkf quit (Ping timeout: 268 seconds)
08:48:35filcucflyx: cheatfate updated
08:49:55cheatfatefilcuc, i'm trying to compile it according to cmake rules...
08:50:43filcuccheatfate: thank you
08:51:45cheatfatefilcuc, could you please run your cmake to show what options have been passed to gcc?
08:52:16cheatfatefilcuc, so i can compile it
08:52:50filcuccheatfate: flyx from what i see with dependency walker from inspecting the main.exe and libDOtherSide.dll , the dll links to msvcrt and a dll of mingw32
08:53:00filcuccheatfate: flyx: the exe only msvcrt
08:53:08filcuccheatfate: ok i'll give the command line used by cmake
08:54:09*flyx does not have knowledge about mingw and will be of little help here
08:55:54filcuccheatfate: cd /d E:\Repo\DOtherSide-build\lib && C:\Tools\Qt\Tools\mingw492_32\bin\g++.exe -DDOtherSide_EXPORTS -DWIN32 @CMakeFiles/DOtherSide.dir/includes_CXX.rsp -Wall -Wno-long-long -pedantic -O3 -DNDEBUG -o CMakeFiles\DOtherSide.dir\src\DOtherSide.cpp.obj -c E:\Repo\DOtherSide\lib\src\DOtherSide.cpp
08:56:00filcuccheatfate: for the compiler
08:56:35filcuccheatfate: C:\Tools\Qt\Tools\mingw492_32\bin\g++.exe -Wall -Wno-long-long -pedantic -O3 -DNDEBUG -shared -o libDOtherSide.dll -Wl,--out-implib,libDOtherSide.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\DOtherSide.dir/objects.a -Wl,--no-whole-archive @CMakeFiles\DOtherSide.dir\linklibs.rsp
08:56:46filcuccheatfate: for the linking phase
08:57:15filcuccheatfate: is it enough?
08:57:32cheatfatefilcuc, i dont know i will trying
08:59:11*Demon_Fox quit (Quit: Leaving)
09:00:09flyxmeanwhile, can someone tell me how to work with the I param of arrays? I want to get the index type, the lower and the upper bound an a proc foo[I, V](a: array[I, V])
09:01:56Arrrrdont high(I) and low(I) work?
09:02:52*darkf_ is now known as darkf
09:03:10flyxyes. well that was obvious
09:03:17flyxnow I just need to get the type
09:03:34flyxI seems to be a range, and system.nim doesn't seem to define any proc on this type
09:03:59Arrrrmaybe when I is range?
09:04:26Arrrri think there is a module to get the name of a type
09:06:24cheatfateflyx, its really not easy to make dll with mingw
09:07:23flyxArrrr: yeah, typetraits. but that just gives me range 0..2(int)
09:07:26flyxI want to have "int"
09:07:43*yglukhov joined #nim
09:08:55flyxI tried this, but it doesn't compile: proc rtname[V](T: typedesc[range[V]]) = typetraits.name(V)
09:10:30ArrrrWell, i suppose there is no alternative than to use macros at this point.
09:10:31filcuccheatfate: you were talking to me?
09:11:42filcuccheatfate: *were you*
09:12:01cheatfatefilcuc, i have made dll testing it node
09:13:15filcuccheatfate: ok ;)
09:18:07cheatfatefilcuc, i have modified your nim file and cpp file to get results... and i dont receive any errors
09:18:47cheatfatefilcuc, modified nim file: https://gist.github.com/cheatfate/65daf907be57bfe79f7f99b5ed676ac1
09:19:31filcuccheatfate: :|
09:19:33cheatfatefilcuc, modified cpp file: https://gist.github.com/cheatfate/3773cc4a2ffb388ae846503720e427fe
09:19:48cheatfatefilcuc, include file was not modified
09:20:21cheatfatefilcuc, and how i made dll: https://gist.github.com/cheatfate/e97281134197cf10e60e3789edd8a73d
09:20:24filcuccheatfate: should you change the signature also in the include file...
09:20:32filcuccheatfate: since you changed the return value?
09:20:39cheatfatefilcuc, yes, i have forgot
09:20:51cheatfatechange void to int
09:21:37filcuccheatfate: i'll try to do the same here but seems weird
09:22:03cheatfateseems that some options from cmake makes this error
09:22:41*yglukhov quit (Remote host closed the connection)
09:24:10filcuccheatfate: do you mean that by using the options of cmake you get the same error?
09:24:27filcuccheatfate: and without no error?
09:24:43cheatfatefilcuc, try to make dll in my way... do you still get an error?
09:25:05filcuccheatfate: i'm doing it, give a sec
09:28:14filcuccheatfate: i'm still getting the same error here
09:28:27*yglukhov joined #nim
09:28:38filcuccheatfate: what kind of mingw32 are you using?
09:28:51filcuc(and btw are you compiling 32 or 64bit)
09:29:21cheatfateg++ (GCC) 4.8.3 (amd64)
09:29:36cheatfateand my result dll is amd64 too
09:29:51cheatfatebut my nim compiler is latest devel
09:30:05filcuccheatfate: ok..that's interesting because i'm using mingw 32bit
09:30:16filcuccheatfate: 4.9.2
09:30:31cheatfateso your result.dll is 32bit?
09:30:43filcuccheatfate: yes
09:31:27cheatfateso to be exacly sure: you using 32bit mingw with 32bit nim on 64bit system?
09:31:52cheatfate*exactly
09:32:03filcuccheatfate: g++ (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 4.9.2
09:32:09filcuccheatfate: this is g++
09:32:22filcuccheatfate: Nim Compiler Version 0.13.0 (2016-01-19) [Windows: i386]
09:33:13filcuccheatfate: so it seems everything's fine
09:33:57cheatfatefilcuc, and what is your windows?
09:34:10filcuccheatfate: windows 10
09:34:23cheatfatei386 or amd64?
09:34:28filcuccheatfate: 64bit
09:35:14filcuccheatfate: are you using the mingw bundled with nim?
09:35:32filcuccheatfate: because i'm using the one obtained with Qt 5.6
09:35:33cheatfatenope mingw bundled with nim a little bit broken
09:35:56filcuccheatfate: (and i've also tested with mingw32 obtained by the official website 4.9.3)
09:36:02filcuccheatfate: (same error)
09:36:17cheatfatehttp://mingw-w64.org/doku.php/download
09:36:21cheatfatemy mingw from here
09:36:22filcuccheatfate: i'll try to do the same with a 64bit mingw
09:36:54cheatfatebut you need nim 64 bit too
09:37:29filcuccheatfate: ok, (you downloaded the cygwin or win-builds version?)
09:37:57cheatfatewin-builds
09:38:02filcucok
09:40:12ArrrrThe one from msys (mingw-w64) is 5.3.0
09:40:17Arrrr*msys2
09:40:33filcuccheatfate: maybe there's something broken with dynlib when using 32bit dll on a 64bit system
09:41:16*yglukhov quit (Remote host closed the connection)
09:42:09*yglukhov joined #nim
09:44:49filcucbingo
09:45:11filcucby using nim 64bit with its bundled mingw64 bit env no error
09:45:52filcuccheatfate: i'll try to reinstall nim 32bit with its own mingw32 and see if get the error
09:46:09Araqwooohooo zahary is back :-)
09:46:11cheatfatei think you will get an error...
09:46:46*yglukhov quit (Ping timeout: 252 seconds)
09:47:02filcuccheatfate: with everything 64bit no error..
09:48:35filcuccheatfate: btw thank you for the help
09:48:40cheatfatefilcuc, np
09:49:51cheatfateAraq, i have tried to build nim on solaris, and got a problem with hstrerror function
09:50:05cheatfateAraq, proc hstrerror*(herrnum: cint): cstring {.importc:"(char *)$1", header: "<netdb.h>".} just want to ask you what mean "(char *)$1"?
09:51:22filcucbingo
09:53:14filcuccheatfate: Araq: on a 64bit system, 32bit nim (with its own mingw) if i dynlib a 32bit dll i get "The application requested to terminate the runtime in an unusual way", istead with a 64bit nim (with its own mingw32) if i dynlib a 65bit dll i get no error
09:53:33filcuccheatfate: Araq: should i fill a bug report?
09:55:20cheatfatefilcuc, i dont this is nim problem... its a mingw problem i think
09:56:40Araqcheatfate: it means (char*)hstrerror
09:57:03Araqso that the call that is produced is something like (char*)hstrerror(34)
09:57:05Araqbbs
09:58:17filcuccheatfate: or maybe there's some wrong 64 bit call...who knows...
09:58:52filcuccheatfate: in fact i'm asking if i should fill a bug or not..
09:59:01cheatfatewhen you are running 32bit app on 64bit system you will using wow64 dlls
10:00:13cheatfatefilcuc, its not a nim problem because nim doesn't produce binary...
10:00:32cheatfatefilcuc, and ot looks like binary problem
10:02:01*rok joined #nim
10:06:19*filcuc quit (Ping timeout: 260 seconds)
10:43:40*yglukhov joined #nim
10:47:50*yglukhov quit (Ping timeout: 244 seconds)
10:56:37*darkf quit (Read error: Connection reset by peer)
10:57:07*darkf joined #nim
11:22:20*elrood joined #nim
11:23:04*yglukhov joined #nim
11:29:22*yglukhov quit (Ping timeout: 260 seconds)
11:32:08*Matthias247 joined #nim
11:49:10cheatfateAraq, thanks
11:49:28cheatfateAraq, for some reason solaris could not find hstrerror
12:07:43*darkf quit (Quit: Leaving)
12:08:06*endragor quit (Remote host closed the connection)
12:09:21cheatfateAraq, where i can find os specific compilation/link options?
12:09:47cheatfateAraq, i want to add -lrt for linux and -lresolv for solaris
12:10:17Araqwhen defined(linux): {.passL: "-lrt".} ?
12:12:37*endragor joined #nim
12:12:58cheatfateAraq, yeah but you want me to patch standard library with this pragmas?
12:13:49Araqsure why not.
12:13:54cheatfatetimer_create/delete/settime,gettime is declared in posix.nim
12:14:14Araqbut please add a fucking comment of what '-lrt' and '-resolv' mean and do.
12:14:36Araqoh the realtime specific stuff in posix.nim is mmm
12:14:47Araqbetter move it to its own module.
12:15:07Araqposixrt.nim or something
12:18:30federico3dom96: regarding testing nimscript, is it worth adding https://github.com/FedericoCeratto/Nim/commit/8781fc63b5b72e0526f80b42f704b1d0278e299c ?
12:19:17cheatfateAraq, this posixrt.nim can brake other projects dependencies...
12:19:22dom96federico3: sure, but in the long run it should be added to the tester I think
12:20:22dom96Araq: why the damn swearing?
12:20:28Araqfederico3: what? "This nimscript is used to test if the following modules can be imported"
12:20:46federico3some failing modules include: os, logging, md5, net, parseopt
12:20:47Araqbut most of these modules are not supported for nimscript
12:21:11Araqthe supported modules are documented in nimscript's docs ...
12:21:13federico3then, is there a list of supported modules?
12:21:41Araqhttp://nim-lang.org/docs/nims.html
12:21:51Araqstrutils
12:21:51Araqospaths
12:21:51Araqmath
12:23:08federico3"os" in not meant to be supported anymore?
12:23:10Araqdom96: because the amount of hacks annoys me.
12:23:43Araqfederico3: never was, never will.
12:24:43Araqhttp://nim-lang.org/docs/nimscript.html contains lots of os-like features though.
12:25:06federico3Araq: the modules listed in that file are currently importable. Are there some modules that make sense to test even if they are not listed as supported?
12:25:11*Matthias247 quit (Read error: Connection reset by peer)
12:25:21dom96def- has an example on his blog which import 'os' in a nimscript
12:28:35Araqfederico3: the list should be extended to the collections libs.
12:28:53Araqwhich tend to work unless you hit a sweet VM bug ... :-(
12:29:07Araqthough it gets better with every VM bugfix.
12:29:28federico3e.g. stuff that would be useful in a nimscript: parseutils, pegs, tables, uri
12:31:30Araqdom96: well 'import os' can work and break nilly willy. the problem is that the VM codegen is lazy so what you don't use doesn't immediately cause problems.
12:31:53Araqbut we cannot write in the documentation "oohh, just use what doesn't cause error messages or crashes"
12:32:02federico3how about this subset?
12:32:10Araqso we have a list of what is officially supported.
12:32:28federico3 https://github.com/FedericoCeratto/Nim/commit/b39d43c9e69940f60b14cda4572993e0cdae0d30
12:33:30federico3maybe I can also drop events, typeinfo, typetraits
12:33:43Araqfederico3: that subset is too large.
12:34:07federico3and also pcre and re
12:35:02Araqyeah, these cannot work.
12:35:14Araqand also remove 'locks' you cannot use threads at compiletime
12:35:43federico3https://github.com/FedericoCeratto/Nim/commit/23f71d8ed2a9683a40e188bf4904be512247ef93
12:35:45federico3how about now?
12:38:57federico3IMO not having parseopt, parsecfg and maybe json is quite limiting for nimscript
12:40:46AraqIMO staticExec works good enough for everything more complex that you might want to do with nimscript.
12:41:24Araqnote that we support marshal.nim at compile-time so you can exchange structured data quite easily
12:41:32Araqbbl
12:42:05*BitPuffin|osx joined #nim
12:43:11federico3marshal in nimscript? It doesn't work
12:45:29enthus1astread from stdin should be also possible from nimscript
12:52:10*Kesta joined #nim
12:52:29*arnetheduck quit (Remote host closed the connection)
12:56:50*arnetheduck joined #nim
13:08:34*yglukhov joined #nim
13:12:43*fredrik92 joined #nim
13:13:07*yglukhov quit (Ping timeout: 248 seconds)
13:20:57dom96enthus1ast: agreed
13:26:42*Guest59926isaway is now known as Guest59926
13:27:45federico3I'm looking for examples of a server using socket.recv (not recvline)
13:28:48*couven92 joined #nim
13:31:49*fredrik92 quit (Ping timeout: 250 seconds)
13:48:55Arrrrserver?
13:58:06federico3a TCP server
13:59:27dom96federico3: what's your use case?
13:59:31ArrrrLike this? http://pastebin.com/sP0Vx0EU
14:00:03dom96That's incorrect
14:00:17ArrrrWhy?
14:00:27federico3I want to listen on a TCP port, accept any incoming connection, receive a stream into a largeish buffer, inspect the buffer to extract messages
14:00:33dom96Because you're using the unsafe low-level recv proc
14:00:37dom96not the high-level memory safe one
14:00:43dom96which takes a 'var string'
14:00:47dom96instead of a 'pointer'
14:00:51ArrrrWell, but it works
14:01:30dom96You should be able to just remove the `cstring()`
14:01:59ArrrrI think i was using the unsafe one because the other throws an exception if there is none
14:02:17federico3async + recv is behaving strangely and now leading to a stack overflow
14:03:03dom96Arrrr: if there is none what?
14:03:15ArrrrI mean, if there is nothing to be read
14:03:32dom96it should block if there is nothing to be read
14:03:35*yglukhov joined #nim
14:04:05ArrrrYes, unless you specify a timeout.
14:04:40dom96you're not specifying a timeout though
14:05:07dom96federico3: what protocol are you implementing?
14:05:35federico3it's a binary protocol using msgpack
14:06:48dom96Arrrr: the unsafe version also raises an exception on timeout
14:08:31ArrrrThis one? http://nim-lang.org/docs/net.html#recv,Socket,pointer,int
14:09:23dom96federico3: it is just a case of: var sock = newSocket(); sock.bindAddr(port); sock.listen(); while true: let client = sock.accept(); var str = newString(1024); client.recv(str, 1024)
14:10:09dom96Arrrr: no, because it's the non-timeout version.
14:10:28dom96Arrrr: the safe recv behaves the same way as long as you don't specify a timeout
14:10:57ArrrrMmm, really? I didnt know, i think i tested it. But it was like one year ago
14:11:08ArrrrMaybe something changed or i was using it wrong.
14:15:12*yglukhov quit (Remote host closed the connection)
14:15:37ArrrrAnyway federico3, this is an example i posted some time ago http://pastebin.com/6HLkRNZk it may help somehow
14:16:21federico3Error: unhandled exception: cannot read from stream
14:16:23federico3 processClient's lead up to read of failed Future:
14:16:26federico3more weird errors
14:19:32dom96federico3: show us the code :)
14:19:38dom96and full error
14:23:29federico3thanks, I think I got it figured out - but I'll publish the code in a few
14:33:10*pregressive joined #nim
14:33:47*couven92 quit (Ping timeout: 250 seconds)
14:36:55*yglukhov joined #nim
14:37:32*Trustable joined #nim
14:49:54*yglukhov quit (Remote host closed the connection)
14:52:54*pregressive quit (Remote host closed the connection)
14:57:55*yglukhov joined #nim
15:01:19*yglukhov quit (Remote host closed the connection)
15:22:53*yglukhov joined #nim
15:33:54*arnetheduck quit (Ping timeout: 276 seconds)
15:35:02*yglukhov quit (Remote host closed the connection)
15:41:42*heinrich5991 quit (Ping timeout: 276 seconds)
15:42:50*heinrich5991 joined #nim
15:47:26*aziz joined #nim
15:49:29*couven92 joined #nim
15:56:47*rgv151 joined #nim
16:03:19*rgv151 quit (Remote host closed the connection)
16:06:51*yglukhov joined #nim
16:19:09*Ven joined #nim
16:19:36*yglukhov quit (Remote host closed the connection)
16:21:20*filcuc joined #nim
16:21:45filcucAraq: cheatfate: back again and maybe i found out what's going on
16:21:58filcucAraq: see https://wiki.qt.io/MinGW-64-bit
16:22:01filcuccheatfate:
16:22:15filcuc" If a library that uses DW2 exception handling (e.g. libgcc_s_dw2-1.dll) is loaded using LoadLibrary and FreeLibrary is not called, the program will crash"
16:22:25filcucin particular
16:22:32filcucAraq: cheatfate: http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724
16:22:50filcucso basically this is seems caused by the linking of libgcc_s_dw22-1.dll
16:23:01filcucthis happen when using mingw32 (32bit)
16:23:31filcucand not with mingw (64bit) bundled by nim...probably the 64bit version doesn't use dw2
16:24:29filcucinfact for what i understood dw2 is supported only on 32bit mingw
16:24:37filcucand that's all
16:26:53filcucAraq: cheatfate: hope this help you too in case someone else come here with the same issue :)
16:30:08filcucAraq: cheatfate: solved by explictly linking statically the libgcc -static-libgcc
16:30:46*Matthias247 joined #nim
16:40:53*krux02 joined #nim
17:15:43*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:18:13*Ven joined #nim
17:22:15endragorwhat's the syntax for .this pragma?
17:24:04endragornevermind
17:27:43*endragor_ joined #nim
17:27:43*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:28:16*Ven joined #nim
17:31:01*endragor quit (Ping timeout: 250 seconds)
17:32:23*endragor_ quit (Ping timeout: 268 seconds)
17:34:11*filcuc quit (Read error: Connection reset by peer)
17:39:00krux02are there any gdb pretty printers ready to use?
17:51:17*pregressive joined #nim
17:51:28*silven quit (Ping timeout: 264 seconds)
17:52:06*silven joined #nim
17:55:47*pregressive quit (Ping timeout: 248 seconds)
18:00:01*abbed joined #nim
18:00:08*abbed left #nim (#nim)
18:06:59*enthus1ast quit (Ping timeout: 250 seconds)
18:13:41*enthus1ast joined #nim
18:25:40*BitPuffin|osx quit (Ping timeout: 264 seconds)
18:25:59*Learath2 quit (Quit: ZNC - 1.6.0 - http://znc.in)
18:26:09*Learath2 joined #nim
18:31:32*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:34:15*Ven joined #nim
18:35:32*vqrs_ quit (Max SendQ exceeded)
18:36:21*vqrs joined #nim
18:48:31*silven quit (Ping timeout: 252 seconds)
18:49:25*silven joined #nim
18:50:51nivis there a way to import a C struct from a header without reproducing it manually in nim code?
18:52:05Araq.header pragma?
18:53:30nivoooh. i'll try. thanks!
18:54:37*ephja joined #nim
18:56:14nivhttps://gist.github.com/niv/292a8ff03d4b8bf96eca0e4d2f041736 what am i doing wrong?
18:57:07nivmm, importc: "struct rusage" seems to compile, but then i can't access the fields
18:57:10ephjadom96: so much nim hate from velartrill :p
18:57:31ephjanimscript. how evil amirite
18:58:26dom96ephja: has velartrill tweeted something new?
18:58:58dom96All I saw was the tweet about strong spaces
19:00:56*desophos joined #nim
19:02:32ephjanot really
19:04:58ephjaI just saw that someone retweeted that. it's a fair criticism, but some of the other points seem uninformed
19:05:20dom96when was nimscript criticised?
19:05:54dom96The tweet (https://twitter.com/velartrill/status/713501595430817792) got 128 retweets and 164 likes. And that's good.
19:06:06dom96Even bad PR is good PR :)
19:06:25dom96But it's not even that bad
19:06:50ephjathe identifier equality rules are "remarkably awful" apparently. it's difficult to diverge from industry practices though
19:07:27*filwit joined #nim
19:07:42ephjasure
19:08:13dom96who wrote that?
19:08:27dom96Twitter is remarkably shit at showing a coherent view of the replies
19:16:04ephjahttps://twitter.com/velartrill/status/666164196711772160 what's so bad about this?
19:17:01*gokr joined #nim
19:17:14cheatfateniv, proc getrusage(who: cint; rusage: ptr) but you need proc getrusage(who: cint; rusage: pointer)
19:18:23*BitPuffin|osx joined #nim
19:18:45cheatfateniv, or proc getrusage(who: cint; rusage: ptr C_rusage) or or proc getrusage(who: cint; rusage: ref C_rusage)
19:19:27*Jesin quit (Quit: Leaving)
19:21:22Araqhmmm "fair criticism" about something which is based on pure paranoia? I don't think so.
19:21:27cheatfateniv, about struct you need to c2nim'it because nim compiler can't know what fields in C structure so, to access members you need to declare it fully
19:22:04nivi just defined it manually and that seems to work well enough. though "ptr" and addr() worked just fine, it wrote the fields correctly.
19:25:30ephjaAraq: I'm not sure what paranoia has to do with it
19:26:01Araqis the argument more than "waa waaa waaa error prone?!"
19:28:07*BitPuffin|osx quit (Ping timeout: 244 seconds)
19:29:27*ephja quit (Quit: WeeChat 1.4)
19:29:34*nsf quit (Read error: No route to host)
19:30:19*nsf joined #nim
19:32:40dom96ephja: wow, that's an old tweet. How did you find it?
19:33:13dom96Araq: https://github.com/nim-lang/Nim/issues/4037
19:33:41dom96Let me know if you have anything against me fixing strutils.indent
19:33:53dom96*unindent
19:37:45Araqgo ahead
19:39:18dom96Araq: Thx
19:51:58*Matthias247 quit (Read error: Connection reset by peer)
19:52:18*Demon_Fox joined #nim
19:58:45dom96oh I see. The reason that tweet got so many RTs and Favs is because @comex retweeted it.
20:00:57*Arrrr quit (Ping timeout: 250 seconds)
20:08:39*Arrrr joined #nim
20:23:34*ephja joined #nim
20:23:55*filwit quit (Read error: Connection reset by peer)
20:24:15ephjadom96: I just looked through someone's posts
20:24:25*filwit joined #nim
20:27:31ephjaAraq: I guess one might be frightened if one thinks that such examples might appear in the real world frequently
20:27:46ephjadespite being considered experimental
20:28:13Araqyou mean "might appear" as in "omg, I can look at the code and know the precedences immediately without looking it up in the spec"?
20:30:45Araqfwiw C's precedence rules are fucked up and few programmers know all their details.
20:31:05Araqyet nobody spreads FUD about them.
20:31:59ephjayou're right, it's not that difficult to parse
20:31:59couven92MSDN actually has a quite extensive documentation on ANSI-C...
20:32:26*Jesin joined #nim
20:33:33ephjathat's true. people just don't like change
20:33:33*gokr quit (Ping timeout: 276 seconds)
20:34:47Araqephja: the one guy I know who actually used #! strongspaces in practice complained it's makes the compiler too picky.
20:36:10ephjaok
20:41:29krux02Araq: what do you use to debug nim code on i linux machine?
20:42:05Araqkrux02: 'koch temp', writeStackTrace, 'if n.info ?? "temp"', ...
20:42:16Araqin other words I don't use a debugger if I can avoid it.
20:42:57*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:43:09*Kesta left #nim (#nim)
20:43:27krux02I think that's not the best idea to use, since I know a lot of people who would avoid to use a language entirely, if there is not a comfortable way to debug it
20:43:56*chrisheller joined #nim
20:44:06AraqI agree and debugging support for NimEdit is planned.
20:44:23krux02At the moment I am trying to get used to gdb, and I am trying out several frontends, but already simple things as seq[string] are pretty ugly.
20:45:14krux02I don't want to say it's not possible, but it's also not a nice experience
20:45:15Araqyeah somebody should give GDB some Nim support
20:45:31AraqGDB has a Python scripting layer for these things.
20:45:52Araqshouldn't be too hard, but I don't need it, so I don't write it.
20:45:54krux02I know, it also has a scheme scripting layer
20:46:06couven92krux02, concerning debugging in Windows: Microsoft has realeased their inner workings of their native (PDB) debugging format... If someone could figure out how to use that, we could actually get nim debugging in Visual Studio...
20:46:18*gokr joined #nim
20:46:18thotypousasync should be a nightmare to debug
20:46:26krux02there are actually a lot of things that would help
20:46:56krux02I think if there would be some pretty printers available for nim types, we would already be much further ahead than at the moment
20:47:41krux02https://sourceware.org/gdb/onlinedocs/gdb/Pretty_002dPrinter-Example.html#Pretty_002dPrinter-Example
20:48:16couven92Hmm... with --embedSrc one could actually sort-of debug nim code with step-by-step, since the debugger would show the source code and the nim code would right there :P
20:48:42couven92That's a really really awful debugging experience though :P
20:48:57Araqcouven92: yeah that works already. and it's not really awful either.
20:49:08krux02yes that's what I am using
20:50:11thotypousbut reverse engineering nim code can be really awful
20:50:14couven92well, you wouldn't really get good variable evaluation/watching, call stacks, and so on, do you?
20:50:54krux02as long as the variables are somewhat c like it's possible
20:51:18krux02struct like objects are nice and number types
20:51:31nivis there a pragma to make nim pack structs in memory just like gcc/llvm would? im having a hard time trying to make my ptr-to-c-struct function work
20:51:32krux02but strings are not so nice and seq also not that much
20:52:35Araqniv: use c2nim please. its chances of getting it right are higher than yours if you're new to Nim.
20:52:59krux02niv: isn't nim compiling it's datatypes to c-structs?
20:53:23nivAraq: will try, thanks. krux02: yes, but when im poking at it with sizeof() and similar things dont line up
20:53:53krux02with similar you mean offsetof?
20:54:30nivmm yeah. i'll try c2nim and figure it out, thanks :)
20:55:09krux02and the debugger also does a lot of jumping around in loops, because the iterator functions are normally inlined
20:56:23couven92niv, krux02, you're probably looking for packing pragmas, like #pragma pack <n> in VCC and __attribute(packed) in GCC, right? Do we have these in Nim, I don't remember reading about them in the manual
20:56:28*apotheon quit (Ping timeout: 244 seconds)
20:56:53krux02Araq: I would like to get an environment running, where the road of the least resistance is to just take a debugger, and then doing other things.
20:57:05krux02so I would like to get debugging easy and comfortable
20:57:18krux02I just don't know yet what the best frontend for debugging nim is
20:57:40Araqah ok.
20:57:44AraqI can help with that.
20:57:51Araqimprove GDB.
20:58:09nivAraq: well, c2nim can't deal with rusage. it doesn't translate __kernel_long_t it seems. is there something im missing?
20:58:09Araqthere is no other realistic option except perhaps one day LLDB.
20:58:47AraqLLDB is a PITA to get to compile in my experience.
20:59:02AraqENDB is just a toy and will remain a toy.
20:59:12AraqVisual Studio is MS specific.
20:59:34couven92I was actually planinng on looking into portability between GDB and Visual Studio, when I do that, I could try do see what I can do with the Nim language as well... :D (yeah, I LOVE visual Studio [and I hate it sometimes :P])
20:59:44Araqif NimEdit grows some support it will just be a better frontend for GDB.
21:00:04Araqkrux02: does that help you?
21:04:31gokrkrux02: When it comes to GDB frontends I have used KDevelop and QtCreator quite successfully. But yeah, inspecting data doesn't really work of course. But stepping etc works really nice.
21:04:32krux02Araq: If NimEdit will be a good gdb frontend, I would even pay for it, just for a nice debugging experience.
21:05:08krux02gokr: where is the point of stepping through the code, if you can't inspect the data?
21:05:25couven92control-flow analysis
21:05:31gokrWell, you can still set breakpoints, see where it goes etc.
21:05:38Araqkrux02: you can inspect the data, but it's ... suboptimal :P
21:05:40gokrAnd some data can be seen.
21:06:00krux02and some data can't be seen
21:06:37krux02I will try now to implement a pretty printer for a string
21:06:44gokrYes, but you said "where is the point" - and there is a point. But I would also love great data drilling, and so would Araq - and we have discussed it several times, but its a bit of work :)
21:07:13gokrkrux02: Yeah, pretty printers would probably go a long way.
21:07:37krux02what do you mean with "would go a long way"
21:07:42krux02takes long to implement
21:07:46krux02or help a lot?
21:07:53gokrhelp a lot
21:08:40gokrIIRC when I looked at this... we came to the ideal conclusion about some... protocol to implement. But right now I don't recall.
21:10:25Araqgokr: for some 'we' that excludes me ;-)
21:10:40gokrOk, sorry, my memory is vague.
21:10:59gokrWasn't there some debugger protocol that we could implement?
21:11:22Araqyeah but that boils down to an ENDB-like implementation.
21:11:45Araqwhich I don't believe in. And I wrote ENDB.
21:12:53gokrSo... is the best solution an LLVM backend simply?
21:13:04gokrThat would give debugging for free I presume?
21:13:25Araqno, it would have much of the same issues.
21:13:29gokrok
21:13:45Araqexcept that we could have some less barbaric name mangling.
21:15:56AraqGDB does support a protocol and remote debugging, it's really nice once we teach it a bit about Nim.
21:16:52dom96krux02: would you consider implementing a GDB frontend in Aporia?
21:18:04gokrAraq: So the deal is to dig into the GDB codebase and add "Nim support" in there?
21:18:08*apotheon joined #nim
21:18:22krux02dom96: Not really, or at least not at the moment, because I remember last time I tried to implement a simple petty printer the experience was horrible took a long time and in the end I gave up. So don't expect from me that my effort will result in anything useful.
21:18:42krux02but I am doing my best, I just need to understand the way gdb works better
21:18:55krux02everything seems so complicated if you want to do something simple
21:19:07*ephja quit (Quit: WeeChat 1.4)
21:19:10dom96I have renewed faith in Aporia, now that I successfully got it running on OS X
21:19:55krux02dom96: I like the simplicity of aporia, it reminds me a lot of processing
21:20:13dom96:)
21:20:18krux02I like the most, that I can just write and run without creating a project
21:20:32krux02but getting it to work on linux with autocompletion was not straightforward
21:20:58dom96Autocompletion is still experimental :P
21:21:35dom96I am planning on spending some time on it though
21:21:47Araqdom96: I still need to create 2 PRs for Aporia ...
21:21:50krux02autocompletion is a frontpage feature
21:21:58dom96Go to definition should already work much better
21:22:05krux02so it better be not experimental or you will just disappoint people who try it out
21:22:38dom96indeed
21:22:45krux02btw: what was the main issue with aporia and osx?
21:23:28dom96Compiling GTK successfully on OS X
21:24:02gokrdom96: What are the current efforts being made for Nim and desktop UIs? Obviously you use Gtk2, Stefan does ... Gtk4 i think, and then we have the Qt stuff?
21:24:04krux02I always thought GTK was nicely and platform independant
21:24:18gokrAraq wrapped wx, but... never used it, right?
21:24:46krux02and not to forget, you can write your own ui elements with sdl2
21:24:57gokrI am curious since I am starting to entertain the idea of making a bit of IDE around Ni.
21:24:58Araqgokr: some examples work but we have a better wx wrapper now that we should release ...
21:25:05gokrAraq: Oh, cool
21:25:21Araqin fact ... I also have other stuff I should release ... ugh.
21:25:51dom96gokr: no idea. There are lots of things, Stefan's gtk3 wrapper (which is just a wrapper AFAIK, just like the gtk2 wrapper), yglukhov's nimx, filcuc's DOtherSide which wraps Qt IIRC
21:26:04gokrOn my modest side - I managed to store something in Sophia db last night :) c2nim:ed it.
21:26:49dom96krux02: there was also the problem of making it look nice on OS X
21:27:01gokrAnd oh, I got a Ni REPL up using the Ni interpreter compiled via the js backend. Kinda cool that it actually works.
21:27:14gokrdom96: http://www.krampe.se/ni.html
21:27:24dom96krux02: drawing custom UI elements using sdl2 is a PITA
21:27:35gokrThe Ni interpreter (1600 loc of Nim basically) turns into 91k minified js.
21:27:57dom96gokr: that sounds like a lot
21:28:06dom96You should add a Ni tutorial in there :D
21:28:11gokrI know.
21:28:29gokrI need to write a proper language manual, was going to start tonight I think.
21:28:39gokrAnd I should find a better name :)
21:28:54dom96oh wait, you mean 91kb or 91k LOC?
21:28:56gokrBut I do find it fascinating that it actually works in js.
21:29:05gokr91k bytes.
21:29:13dom96oh, that's not so bad :P
21:29:16gokrNope.
21:29:31dom96did you compile in release mode?
21:29:49gokryeah
21:29:55Araqdom96: doesn't make much difference for JS.
21:30:09AraqJS always performs dead code elimination anyway.
21:30:13gokrIts 163kb before minification.
21:30:40dom96Araq: what 2 PRs do you need to create?
21:30:48krux02dom96: I think wrapping qt for nim just to have three button in the main menu of a game is a PITA and overkill
21:31:10krux02but generally yes ui libraries exist for a reason
21:31:11Araqdom96: I made osproc much better for interactive application control
21:31:15dom96krux02: of course
21:31:21Araqand then my command line handling patch.
21:31:41gokrThe Smalltalk world has made its own widgets/windows for a long time.
21:31:53gokrIt does have its merits - looks and works the same everywhere.
21:31:55dom96Araq: so not PRs to Aporia code?
21:32:10Araqdom96: yes, they are PRs to Aporia code.
21:32:18gokrSo for an IDE its a great approach - it also makes it easy for developers to contribute to the toolset.
21:32:19dom96Factor had/has a nice UI
21:33:00gokrdom96: Pharo is pretty advanced by now: http://pharo.org
21:33:09Araqgokr: from my experience with nimedit I agree completely. The one thing that really sucks is the font rendering, the only thing I didn't write myself.
21:33:12dom96Araq: what does it affect? suggest?
21:33:17Araqdom96: yes.
21:34:10Araqgokr: though getting undo/redo to work properly was remarkably hard. :-)
21:34:22gokrIIRC modern Pharo integrates freetype, but.. there was also pure Smalltalk implementations.
21:34:46gokrIts kinda funny, Pharo is a fork of Squeak which is a fork of the original Smalltalk-80 which introduced the BitBlt stuff.
21:34:52AraqSDL's fonts handling uses freetype.
21:35:17gokryeah
21:35:48Araqdom96: want a cool macro example for your book?
21:37:47dom96of course
21:39:01dom96and please create those PRs, i'm curious what they change
21:39:30Araqlook at tests/macros/typesafeprintf.nim
21:39:31dom96GTK's font handling uses freetype too
21:39:43Araqdom96: no, it uses Pango.
21:39:49dom96which uses freetype
21:39:59AraqPango is much better than Freetype.
21:40:06Araqand does plenty of things on its own.
21:40:26AraqI tried to use Pango with SDL but found no docs on how to do that.
21:40:40dom96hrm, weird, you're right.
21:40:48dom96I wonder why it pulls freetype as a dependency then
21:41:24dom96maybe you could use cairo to do your drawing?
21:41:26Araq"weird, you're right". that's not weird. That's ALWAYS the case.
21:41:35Araq:P
21:41:36gokrhehe
21:43:27gokrBtw... the Red lang just made a new release where they are going graphical/IDE etc. Looks... pretty darn impressive. I bet there is some inspiration in there if one would like to "roll your own".
21:45:43gokrAlthough... its darn dense to grasp.
21:48:07*rok quit (Quit: rok)
21:48:57*izi joined #nim
21:52:50dom96Araq: So where is this macro example?
21:53:07dom96oh, nvm, just noticed your message
21:53:45dom96why not include it in the manual?
21:55:08Araqbecause these larger examples get outdated.
21:55:23Araqso I'd like to use ..include:: tests/foo.nim in the docs.
21:56:18Araqbut surprise. On Unix based systems the tests end up under /etc/shit and the docs under /etc/crap so that will break some ways of "installing" Nim.
21:56:41dom96also, it does actually seem that Freetype can be used as a backend for Pango
21:57:22dom96maybe it's time to once and for all fix this shit so that it just works
21:57:42AraqI cannot fix Unix.
21:58:11dom96then learn to live with its quirks
21:58:24dom96just like everyone else
21:58:45Araq"quirks"? this thing is unusable. and every sane system moved to something like "bundles" 5 decades ago.
22:00:27dom96then stop giving people the option to install into /usr/bin
22:00:33dom96and force them to install into /opt
22:01:09Araqwould love to, but that's not a realistic option either and you know it.
22:02:22dom96Then it's time to fix Nim so that it works perfectly fine when it's installed to /usr/bin
22:02:30*Trustable quit (Remote host closed the connection)
22:02:38Araqit does work perfectly fine.
22:03:04Araqthe only stuff that doesn't work is stuff that we never officially supported in the first place.
22:03:21Araqlike "building all the docs via koch"
22:04:06Araqkoch is a build tool. for us. not for lazy Linux packagers.
22:04:34Araqor people with weird opinions of how to develop the most cost ineffective OS on the planet.
22:07:14krux02so the problem is that the paths have different patters on different operating systems?
22:09:33krux02and what about generating the include command with a macros?
22:10:36Araqkrux02: we cannot generate what we don't know.
22:10:53Araqfor example, packagers can decide to not package tests/ at all.
22:11:20Araqor move docs/ to some place we don't know.
22:13:31couven92shouldn't computer sciency UNIX-lovers usually be comfortable with: ./configure --prefix=some/path; make; make doc; make install
22:15:06Araqyou mean these 40K LOC configure scripts that are generated and impossible to review for security issues? :P
22:15:25couven92YES! Exactly those!!! :D
22:15:42couven92Don't we just love them all? :P
22:16:23krux02I don't understand them, and I don't like what I don't understand
22:16:31Araqhint: a Linux package is something which DOESN'T use ./configure
22:17:08couven92ah, so we're talking about something like: apt-get install nim
22:17:22Araqexactly.
22:19:02couven92ah, right... yeah I seem to remember having issues with finding out where the hell ubuntu installed packages, because a google search usually gives me all the paths where apt-get DOESN'T install stuff...
22:25:45Araqcouven92: that's nothing compared to the joy of having to use ./configure though and having to hunt all the dependencies on your own.
22:27:36Araqbut it can be satisfactory to read messages like "your system doesn't seem to have Irix's memcpy bug that was released in 1984"
22:28:13*filwit quit (Quit: Leaving)
22:29:46couven92Araq! Yeah, tell me about it! I have resorted to rebuilding all kinds off usual tools (OpenSSL, Git, cURL, etc.) on my account on the university server since the stuff there is ages old and I don't have sudo to update :P
22:30:18couven92Good luck finding any of the usual dependencies in the usual places there!
22:33:45*darkf joined #nim
22:35:12krux02the documentation of gdb to write a pretty printer is horrible, basically this it all I have: https://sourceware.org/gdb/onlinedocs/gdb/Writing-a-Pretty_002dPrinter.html#Writing-a-Pretty_002dPrinter
22:35:22krux02it doesn't even tell where those files have to be
22:35:49dom96maybe you could ask #gdb? :)
22:37:52krux02the exaple just tells how I write a matcher for the shared library
22:38:06krux02but there is no shared nim library that gets loaded
22:38:19krux02I have no idea what to do
22:42:45*Guest59926 is now known as Guest59926isaway
22:46:32krux02nobody active in #gdb
22:46:50krux02I really like this chat, it is always somebody active
22:47:02krux02just want to tell you all, you are awesome for being here
22:47:15couven92krux02, totally agree!!! Really nice being here! :D
22:50:49cheatfateAraq, to get the best truetype font rendering you need freetype, because adobe give freetype some closed source algorithms and only freetype can use it... so if you want the best fonts you need freetype
22:52:08cheatfatealso pango is rendering truetype fonts only with freetype... all other fonts can be rendered with xft and bitmap fonts it can render with cairo
22:56:36krux02I hate gdb, when the program loads a shared library gdb has a hook to load the libname-gdb.py file, but the problem is, that a nim program does not link to any nim specific library at all everything in generated in c
22:58:26cheatfateAraq, pango is just a very comfortable wrapper for freetype :)
23:00:03*elrood quit (Quit: Leaving)
23:02:24*vendethiel- quit (Ping timeout: 276 seconds)
23:06:04Araqkrux02: https://sourceware.org/gdb/onlinedocs/gdb/Basic-Python.html#Basic-Python tried the Python console within GDB?
23:06:15*vendethiel joined #nim
23:06:42Araqif we create a frontend for GDB it might as well be a frontend for the 'Python REPL within GDB'
23:06:50krux02no I did not
23:07:40Araqthis way we also don't have to install anything then. we just start GDB and inject some python code at the beginning of the session
23:07:47krux02I want to write a pretty printer, becaues I know an official pretty printer is loaded, when I debug from a frontend, like qt, or kdevelop, that means things will look nice automatically within those ides
23:08:15ArrrrGood night nimroders
23:08:16*Arrrr quit (Quit: WeeChat 1.4)
23:08:32Araqtrue but my idea is a decent Plan B.
23:09:05krux02I might try it, but not today
23:09:18Araqbut hrm ...
23:09:21krux02today I finish my stack overflow question, and then go to bed
23:10:15Araqhow about this: I make NimEdit open source and you promise to add debugger support? ;-)
23:10:56Araqyou don't need to mess with GDB pretty printers at all then :P since it can all be done in the frontend.
23:12:37Araqha! vmgen.preventFalseAlias introduces a false alias. how ironic.
23:28:28*vendethiel quit (Ping timeout: 252 seconds)
23:29:45*gokr quit (Quit: Leaving.)
23:36:17couven92Araq, like: /* This function always returns false */ bool myMagicFunction { return true; }
23:37:13couven92(Quote from the StackOverflow thread on the coolest comments in source code)
23:39:03Araqnah, I was wrong. the bug was somewhere else.
23:44:10*vendethiel joined #nim
23:49:27*krux02 quit (Quit: Verlassend)
23:51:18*aziz quit (Remote host closed the connection)