<< 19-03-2019 >>

00:02:55*banc joined #nim
00:11:05*dddddd quit (Remote host closed the connection)
00:14:39FromDiscord<moerm> cu
00:27:34*jugash[m] quit (Remote host closed the connection)
00:27:34*narimiran[m] quit (Read error: Connection reset by peer)
00:27:35*xylef quit (Remote host closed the connection)
00:27:35*Connor[m] quit (Read error: Connection reset by peer)
00:27:37*junk[m] quit (Remote host closed the connection)
00:27:41*Miguelngel[m] quit (Remote host closed the connection)
00:27:46*isaac[m]1 quit (Remote host closed the connection)
00:27:47*pqflx3[m] quit (Read error: Connection reset by peer)
00:27:47*sendell[m] quit (Read error: Connection reset by peer)
00:27:54*dyce[m] quit (Read error: Connection reset by peer)
00:27:56*macsek1911[m] quit (Read error: Connection reset by peer)
00:27:56*GitterIntegratio quit (Read error: Connection reset by peer)
00:27:58*forkbomb9[m] quit (Read error: Connection reset by peer)
00:27:58*federico3[m] quit (Read error: Connection reset by peer)
00:27:59*yglukhov[m] quit (Read error: Connection reset by peer)
00:28:00*xomachine[m] quit (Remote host closed the connection)
00:28:00*sg-james[m] quit (Remote host closed the connection)
00:28:00*lqdev[m] quit (Remote host closed the connection)
00:28:00*Demos[m] quit (Remote host closed the connection)
00:28:01*TheManiac[m] quit (Remote host closed the connection)
00:28:01*zielmicha[m]1 quit (Remote host closed the connection)
00:28:01*serialdev[m] quit (Remote host closed the connection)
00:28:02*ArchieT[m] quit (Remote host closed the connection)
00:28:03*k0mpjut0r quit (Read error: Connection reset by peer)
00:28:03*flaviut[m] quit (Read error: Connection reset by peer)
00:28:04*TheKing[m] quit (Read error: Connection reset by peer)
00:28:04*spymasterd[m] quit (Remote host closed the connection)
00:28:05*libman[m] quit (Remote host closed the connection)
00:28:05*Cadair quit (Write error: Connection reset by peer)
00:33:50*krux02 quit (Remote host closed the connection)
00:35:39*dyce[m] joined #nim
00:44:32*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:50:15*Connor[m] joined #nim
00:50:15*TheKing[m] joined #nim
00:50:15*xylef joined #nim
00:50:16*ArchieT[m] joined #nim
00:50:16*Cadair joined #nim
00:50:16*Demos[m] joined #nim
00:50:17*sendell[m] joined #nim
00:50:17*k0mpjut0r joined #nim
00:50:17*jugash[m] joined #nim
00:50:17*GitterIntegratio joined #nim
00:50:17*serialdev[m] joined #nim
00:50:17*isaac[m]1 joined #nim
00:50:23*narimiran[m] joined #nim
00:50:23*zielmicha[m] joined #nim
00:50:23*TheManiac[m] joined #nim
00:50:23*junk[m] joined #nim
00:50:23*macsek1911[m] joined #nim
00:50:23*flaviut[m] joined #nim
00:50:23*federico3[m] joined #nim
00:50:24*Miguelngel[m] joined #nim
00:50:24*spymasterd[m] joined #nim
00:50:24*forkbomb9[m] joined #nim
00:50:24*xomachine[m] joined #nim
00:50:24*sg-james[m] joined #nim
00:50:24*pqflx3[m] joined #nim
00:50:24*libman[m] joined #nim
00:50:24*lqdev[m] joined #nim
00:50:24*yglukhov[m] joined #nim
00:50:56*stefanos82 quit (Remote host closed the connection)
00:54:04*abm quit (Ping timeout: 250 seconds)
01:00:43*rnrwashe_ joined #nim
01:04:24*rnrwashere quit (Ping timeout: 252 seconds)
01:13:28*I_Right_I joined #nim
01:24:45I_Right_Icould someone look at this and tell me why I am getting an outofbounds with delPeer(-10) in this code https://pastebin.com/UGfNyiDv
01:29:04*lritter quit (Ping timeout: 246 seconds)
01:29:35*rnrwashe_ quit (Remote host closed the connection)
01:30:18I_Right_Inevermind
01:31:40I_Right_Iit was a mistake plus and forgotten savefile
01:39:04*sealmove quit (Quit: WeeChat 2.4)
02:55:22*ryukoposting joined #nim
02:55:29ryukopostingit's real nim hours who up
02:56:12shashlickme
02:56:19ryukopostingcheck this out http://ryuk.ooo/ec2.nim
02:56:34ryukopostinggenerated from the AWS JSON spec
02:56:55shashlickwow awesome
02:56:59ryukopostingnot done yet, but getting there
02:57:26shashlickas long as you didn't hand type that 😄
02:57:47ryukopostingim pretty happy with it, the proc definitions are ugly but it's super easy to use since I added a converter for all the types declared in the module
02:58:51ryukopostinglol i didn't type that by hand
02:58:58ryukopostingthank god
02:59:18ryukopostingI just updated that link, at the bottom of the file there's some sample code
02:59:36ryukoposting100% valid nim btw, you can compile that file if you want, it just doesn't do much yet lol
02:59:41shashlickthat's really cool - I know this was discussed multiple times in the past, glad you are taking it through
03:00:03shashlicki was hoping to write a swagger template
03:00:12ryukopostingyeah, because of limitations (reasonable ones) in nimvm, there just really isn't a good way to generate the SDK at compile time unfortunately
03:00:26ryukopostingthough if the AWS SDK wasn't enormous, it'd be perfectly fine
03:00:26shashlickwhat limitations were problematic for you?
03:00:42shashlicki could do quite a few crazy things in nimterop, but eventually i moved to compiled binary for performance
03:00:45ryukopostingthe compiler has a hard limit on how many times a macro can loop
03:01:11ryukopostingand when you parse 35000 lines of JSON, there's a lot of loops
03:02:54shashlicki see
03:04:54ryukopostingif it were pretty much any other SDK, i.e. any SDK of a sane size, it would be fine
03:06:01*banc quit (Quit: Bye)
03:07:31shashlickso you aren't even able to load the json?
03:11:16*ryukoposting quit (Ping timeout: 255 seconds)
03:16:08*ryukoposting joined #nim
03:23:22*rnrwashere joined #nim
03:27:22*banc joined #nim
03:34:11*noeontheend quit (Ping timeout: 268 seconds)
04:01:35*I_Right_I quit (Remote host closed the connection)
04:20:45*chemist69 quit (Ping timeout: 252 seconds)
04:22:29*chemist69 joined #nim
04:28:37*nsf joined #nim
05:07:28*ftsf quit (Read error: Connection reset by peer)
05:08:09*ftsf joined #nim
05:09:17FromGitter<Varriount> ryukoposting: What I did when working an AWS wrapper was to use a separate binary to parse the json, then use the marshal module
05:36:25Zevvryukoposting: hi, what's that your building?
05:48:23*leorize-otg joined #nim
06:15:42*narimiran joined #nim
06:20:36FromGitter<Varriount> Zevv: AWS library
06:27:15*solitudesf joined #nim
06:42:14*krux02 joined #nim
06:59:24*dom96 quit (Ping timeout: 252 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:20*tensortom quit (Remote host closed the connection)
07:00:38*tensortom joined #nim
07:01:11*dom96 joined #nim
07:01:11*dom96 quit (Changing host)
07:01:11*dom96 joined #nim
07:02:25*ftsf quit (Read error: Connection reset by peer)
07:04:45*gmpreussner joined #nim
07:06:48*rnrwashere quit (Remote host closed the connection)
07:17:46TangerHey folks, I'm trying to populate a 2d array of type array[MAX_ROWS, array[MAX_COLS, bool]] with the `fill` proc from algorithm
07:18:54TangerI'm trying to go through the indexes in a for loop and for each index, execute myArray[index].fill[bool](false)
07:19:38TangerDoes that look correct? Or am I meant to be setting T as array[MAX_COLS, bool], then fill with false?
07:19:52narimiranTanger: isn't that automatically filled with `false`?
07:20:13TangerOh crap, cos bool is non nullable XD
07:20:31TangerHoly hell, thanks, that was silly
07:20:45narimiran:)
07:23:16*PMunch joined #nim
07:35:57*shadowbane quit (Ping timeout: 252 seconds)
07:36:38*shadowbane joined #nim
07:40:12*kapil____ joined #nim
07:44:22FromGitter<mratsim> arrrays are filled with 0 at start anyway
07:48:22TangerHaha, if only I wanted to set all the values to true. I've found it's easy enough with a single loop like `for i in two_d_array.mitems: i.fill(<value>)`
07:48:25TangerWhich I don't mind
07:52:52PMunchYeah all memory in Nim is by default initialized to all nulls, with the type dictatic what that actually means
07:56:40PMunchThis unfortunately means that range types that doesn't include 0 can still be 0 if left unitialized
08:03:31*jjido joined #nim
08:16:36*abm joined #nim
08:33:50*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:47:00*dddddd joined #nim
09:02:35*a_b_m joined #nim
09:17:19*rnrwashere joined #nim
09:18:36*a_b_m quit (Quit: Leaving)
09:20:53*neceve joined #nim
09:21:36*rnrwashere quit (Ping timeout: 252 seconds)
09:46:37*a_b_m joined #nim
09:47:28*abm quit (Ping timeout: 246 seconds)
09:52:36*a_b_m quit (Ping timeout: 246 seconds)
09:59:41FromGitter<SkeneZr> Hello, ⏎ I am a new nim user and I have a issue about usage of "re" in the nim regex library ⏎ function re makes a new memory allocation (https://github.com/nim-lang/Nim/blob/master/lib/impure/re.nim#L76) ⏎ ⏎ So in use like this, you can quickly fill the memory at each loop turn ... [https://gitter.im/nim-lang/Nim?at=5c90bd8c3dd81711491646fa]
10:00:15FromGitter<mratsim> create your re outside of the loop
10:01:10FromGitter<SkeneZr> but if I want a dynamic regex
10:01:16FromGitter<SkeneZr> ?
10:01:53FromGitter<SkeneZr> memory allocation should empty at the end of each loop turn?
10:02:30FromGitter<mratsim> no
10:02:40FromGitter<mratsim> the GC only empties when under pressure or at scope release
10:03:15FromGitter<mratsim> and even then I'm not sure how re is integrated with the GC as it's an external lib
10:09:04*neceve quit (Remote host closed the connection)
10:14:07*neceve joined #nim
10:15:07PMunchSkeneZr, what are you trying to achieve?
10:17:14*stefanos82 joined #nim
10:29:49FromGitter<SkeneZr> (https://files.gitter.im/nim-lang/Nim/r8F1/image.png)
10:30:45*krux02_ joined #nim
10:31:27*krux02 quit (Ping timeout: 252 seconds)
10:31:33FromGitter<SkeneZr> I just wanna try to skip line that I didn't need but on other langue we don't initialize regex out of scope so I wanna understand why nim makes this choose
10:32:08FromGitter<mratsim> in C or C++ you would need to as well, other langs give you a GC
10:32:25narimiranin python it is also recommended that you do it in advance
10:33:09narimiranhttps://stackoverflow.com/questions/452104/is-it-worth-using-pythons-re-compile
10:33:38FromGitter<mratsim> i.e. don't do heavy computations in a loop if you can factor them out. Especially if it's something that the compiler can't analyze and do loop hoisting optimisation (like common math function)
10:33:52FromGitter<SkeneZr> Right, I never do it in C++, or I missed something
10:34:14*leorize-otg quit (Quit: WeeChat 2.3)
10:34:16FromGitter<SkeneZr> of course, yes, your are right
10:36:33FromGitter<SkeneZr> thank you ;)
10:36:35FromGitter<mratsim> now regarding GC collection in loops, I don't know how "re" works unfortunately.
10:36:56FromGitter<mratsim> In my tensor library I don't have that issues even though I create MB or GB of tensor data in a loop
10:38:41FromGitter<mratsim> one thing that can help is to put things in proc so that there is at least scope and Nim can place GC calls at its entrance/exit
10:48:48Araqproc finalizeRegEx(x: Regex) =
10:48:48Araq # XXX This is a hack, but PCRE does not export its "free" function properly.
10:48:48Araq # Sigh. The hack relies on PCRE's implementation (see ``pcre_get.c``).
10:48:50Araq # Fortunately the implementation is unlikely to change.
10:49:02*xace quit (Ping timeout: 250 seconds)
10:49:03Araqlooks like the implementation changed and now it's leaking memory :-)
10:50:04*skelett1 quit (Quit: WeeChat 2.3)
10:50:25*skelett joined #nim
10:56:56FromGitter<SkeneZr> In fact, I work on genomic data, files are big, and also with many lines because bioinformaticians are used to do line by line for base intervals
10:57:46FromGitter<SkeneZr> I will just initialize my regex out of scope like you said before and find a way to make dynamic regex
10:58:33FromGitter<SkeneZr> Yes, araq, I am not sur to understand this part.
10:58:43AraqI'm fixing it
10:59:03Araqthe PRCE wrapper predates pcre_free() believe it or not
10:59:54*abm joined #nim
11:15:09FromGitter<apahl> @SkeneZr: you could also try the Nim native re library: https://github.com/nitely/nim-regex
11:41:25*cgfuh joined #nim
11:45:53*NimBot joined #nim
11:52:59PMunchSkeneZr, it's easier to give you good advice if you give us an example of what you actually want to do. Fixing the pcre wrapper will probably fix your issue, but it might not be the best way to solve your problem
11:58:28FromGitter<mratsim> @SkeneZr you might want to talk with @brentp, he is also a bioinformatician
12:17:26*sz0 joined #nim
12:21:11*xace joined #nim
12:57:37*Vladar joined #nim
13:15:51*abm quit (Ping timeout: 244 seconds)
13:17:52*abm joined #nim
13:27:01FromGitter<SkeneZr> @apahl Yes, I will take a look about native lib ⏎ @PMunch I don't have an example of a dynamic regex, it's just something I thought I might need one day, ⏎ But my problem is solved for the moment, because I initialize my regex outside my scope and I don't need to change it later so everything works normally. ⏎ @mratsim Thanks for the information, in fact, I'm not a bioinformatican, I am programmer working with
13:27:01FromGitter... bioinformatician, but it's a new word for me ^^' [https://gitter.im/nim-lang/Nim?at=5c90ee24a21ce51a20872349]
13:28:24narimiranSkeneZr btw, lots of times when "i should use regex" i grab `scanf` and it works like a charm: https://nim-lang.github.io/Nim/strscans.html
13:32:20FromGitter<mratsim> "Oh I have a problem, i will use regex" "now you have 2 problems" - https://blog.codinghorror.com/regular-expressions-now-you-have-two-problems/
13:32:23Zevvjust wait until I'm done :)
13:33:36*enow joined #nim
13:33:41enowHi
13:33:51enowI want to extract a lot of values from a C header on compile time
13:34:04Zevvnimterop!
13:34:32enowZevv: mm I was thinking about it
13:34:56enowThought I had to extract the values from the header
13:35:00enow175 #define KEY_LINEFEED 101
13:35:01enow176 #define KEY_HOME 102
13:35:01enow177 #define KEY_UP 103
13:35:01enow178 #define KEY_PAGEUP 104
13:35:01enow179 #define KEY_LEFT 105
13:35:03enow180 #define KEY_RIGHT 106
13:35:05enow181 #define KEY_END 107
13:35:08enow182 #define KEY_DOWN 108
13:35:10enow183 #define KEY_PAGEDOWN 109
13:35:13enow184 #define KEY_INSERT 110
13:35:15enow185 #define KEY_DELETE 111
13:35:18enow186 #define KEY_MACRO 112
13:35:19FromGitter<mratsim> var myCvar {.importc:"mycvar", header: "myheader.h".}
13:35:20enow187 #define KEY_MUTE 113
13:35:22Zevvpleas don't dump, use a pastebin
13:35:23enowThey look like this and I really would like to get the name of the definition, getting the number are no problem
13:35:27enowsorry!
13:35:50enowThe thing is I want the define names and not the values, that'd be piece of cake
13:35:58FromGitter<mratsim> ah the #define, I think c2nim/nimgen/nimterop handle that properly and put them in an enum or a distinct int.
13:35:59enowcan you list all the variables that are available in nim
13:36:12Zevvyou could do a readFile() and parse the header yourself at compile time
13:36:14Zevvthis is Nim
13:36:27enowthat's the thing!
13:36:35enowBut I'm thinking of the best way to do so
13:37:05FromGitter<mratsim> staticRead for compile time reading, + a parser like strscans
13:37:06enow I take it that there is already a lot of work going on towards the C AST so I was thinking if anyone had any recommendation on how to do this painless
13:37:38FromGitter<mratsim> do you want to read the file everytime you compile or does it stays the same for a long time
13:37:45enowIt get's a bit messy at times
13:37:49enowI have an example
13:38:20enowBTN_SOUTH = 0x00000130
13:38:30FromGitter<mratsim> can you try running c2nim on it
13:38:30enowBTN_A = BTN_SOUTH
13:38:43enowc2nim works really fine
13:38:45leorizenimterop can handle these like a breeze
13:38:54enowthe thing is that I want to have the variable names as keys in a list
13:39:12enowor is there a way I can list declared varibles in the current scope at run time
13:39:39leorizec2nim can do a bit of transformation
13:39:55FromGitter<mratsim> You can't list declared variable at run-time
13:40:08FromGitter<mratsim> those name do not exist anymore once the compiler has done its job
13:40:24Zevvenow: I'll hack an example
13:40:33FromGitter<mratsim> use https://nim-lang.org/docs/strscans.html
13:40:38FromGitter<mratsim> with staticRead
13:40:45FromGitter<mratsim> and Tables module
13:41:29enowZevv: really good idea with staticread,
13:41:33FromGitter<mratsim> or use an enum with key = value
13:41:41enowbut what happens if a define points to another define
13:42:08Zevvwell, then things break.
13:42:09FromGitter<mratsim> for example: aster/third_party/ale_wrap.nim#L67-L81
13:42:13enowThe thing is that I wouldn't mind going full on AST on this project, even though a regexp would suffice,
13:42:16leorizenimterop uses a helper binary called `toast`
13:42:18FromGitter<mratsim> https://github.com/numforge/agent-smith/blob/master/third_party/ale_wrap.nim#L67-L81
13:42:21FromGitter<mratsim> sorry*
13:42:27ZevvIf your header is simple and you trust what's in there, it is trivial. If you don't, you need to implement all of a c preprocessor to be sure
13:42:31leorizewhich, as the name implies: convert C to AST :)
13:43:02enowah!
13:43:09enowhaha
13:43:41Zevvand important: it uses a real preprocessor to do the preprocessing
13:43:59enowyeah that was really where I wanted to go
13:44:06enoweventhough the staticRead will help a lot
13:44:53Zevvok, good luck!
13:45:36enowthanks I'll need it
13:51:04*abm quit (Ping timeout: 246 seconds)
14:01:42*abm joined #nim
14:08:07*kapil____ quit (Quit: Connection closed for inactivity)
14:08:23*a_b_m joined #nim
14:09:53shashlickI have a working example enow
14:10:02shashlickDon't waste your time
14:10:27*a_b_m quit (Read error: Connection reset by peer)
14:10:41shashlickhttps://github.com/genotrance/feud/blob/master/src/pluginapi.nim
14:10:42*abm quit (Read error: Connection reset by peer)
14:10:51shashlickSee SciDefs
14:11:13shashlickI want all scintilla #defines as a table for the same reason
14:11:36shashlickDone at compile time
14:17:41*nsf quit (Quit: WeeChat 2.4)
14:29:34*abm joined #nim
14:33:18Araqyay I broke devel
14:35:58FromGitter<Varriount> Araq: Did you divide by zero? :{
14:36:27narimiranhe "removed hacks" :P
14:36:38Araqyup
14:36:54Araqbut it's only 'nre' I can rewind
14:37:18*avsej quit (Ping timeout: 252 seconds)
14:39:56*avsej joined #nim
14:39:56*avsej quit (Changing host)
14:39:56*avsej joined #nim
14:43:31Araqah I got it
14:43:58Araqthe PCRE authors do not understand DLLs/shared objects
14:44:06Araqso we should use the hack
14:45:07*a_b_m joined #nim
14:48:19*abm quit (Ping timeout: 255 seconds)
14:49:58*sealmove joined #nim
14:50:28*a_b_m quit (Ping timeout: 245 seconds)
14:53:34*lritter joined #nim
14:56:40*rnrwashere joined #nim
14:58:09*rnrwashere quit (Remote host closed the connection)
15:01:37*rnrwashere joined #nim
15:03:39*leorize quit (Quit: WeeChat 2.4)
15:07:42*leorize joined #nim
15:09:32*rnrwashere quit (Remote host closed the connection)
15:12:40*PMunch quit (Remote host closed the connection)
15:12:56*seni joined #nim
15:14:51*rnrwashere joined #nim
15:17:15*Trustable joined #nim
15:18:56ZevvWe should have native regexps
15:21:41Araqlexim :P
15:23:42*noeontheend joined #nim
15:26:01Zevvnpeg :)
15:26:53shashlickAraq: I've posted the boehm dlls on bintray as well - https://bintray.com/genotrance/binaries/boehmgc/8.0.4#files
15:27:14shashlickwill be pulling them in travis for the editor build
15:27:50*rnrwashere quit (Remote host closed the connection)
15:29:41*Shoozza quit (Ping timeout: 258 seconds)
15:29:53*Shoozza joined #nim
15:34:39*rnrwashere joined #nim
15:34:47*couven92 quit (Quit: Client disconnecting)
15:35:42sealmovewhere do tests for stdlib go?
15:36:23narimiransealmove: https://github.com/nim-lang/Nim/tree/devel/tests
15:36:24Araqtests/stdlib
15:36:40sealmovegreat
15:37:20sealmoveI think I can write a nice macro for interfaces, which translates to what you showed yesterday (Araq)
15:37:37sealmoveShould that be in stdlib or external library?
15:38:27Araqwe wanted to add it to the stdlib but these things always take up precious resources
15:38:41AraqI mean development resources
15:39:01sealmoveyeah I understand, happy to help then :)
15:39:28Araqit's better as an external library for now, but then we already have a couple of these and they are underused afaict because they are not in the stdlib
15:40:10Araqone simply cannot win no matter how you do things they are wrong ;-)
15:41:19sealmovewell, should I make a PR or make my own repo for it? :P
15:41:28shashlickAraq: does putting -d:useGcAssert -d:useSysAssert slow the binary down? not recommended for release?
15:41:31sealmoveI'll do whatever you tell me, haha
15:42:06Araqshashlick, it's super slow, don't use it in production. For production use --stackTrace:off --opt:size
15:42:29shashlicknot -d:release?
15:42:30Araqand only if you need more speed you should use -d:release
15:42:56Araq-d:release throws away array bound checks etc, it's pretty bad
15:43:38shashlickseems like a misnomer then
15:44:10Araqwell I use it all the time because I test my array indexing
15:44:38*stefanos82 quit (Remote host closed the connection)
15:46:32shashlickya but for the average user, but its fair to expect users to understand that speed kills
15:46:36shashlick🙂
15:47:47shashlickAraq: can you please explain how switching to boehm means I can be sloppy with memory across threads?
15:48:32shashlickI'd have thought that the compiler would have had to inform the gc of threads
15:51:59*noeontheend quit (Ping timeout: 250 seconds)
15:57:50*sealmove quit (Quit: WeeChat 2.4)
16:00:43*zahary quit (Quit: Connection closed for inactivity)
16:06:17FromGitter<Varriount> shashlick: I believe boehm uses memory scanning
16:06:36*vlad1777d quit (Ping timeout: 268 seconds)
16:14:52ZevvI believe it just looks at all of your heap and stacks for things that look like pointers it knows about. It assumes that any memory blocks it own for which it does not find any more pointers can cease to exist.
16:15:14Zevvwow, that is a remarkably bad phrased explaination
16:17:29*nsf joined #nim
16:23:47FromGitter<nothratal> Hi, hope someone can answer me a question regarding the usage of libraries vs bindings. If I have a pure Nim library I can easily build my project to c and js right? What happens if I have a c binding in my Nim project? Can I still build it to c AND js? What's about the linking in this case? Do I still get a single binary or do I need the bindings in a form of *.so/*.dll?
16:28:43Araqit all depends.
16:28:56Araqwrapping C can be done in multiple ways
16:29:27Araqand you can import DLLs (that do not necessarily have to be written in C btw)
16:29:58Araqyou can also use {.compile: "foo.c".} and link against C code directly without any static or dynamic library
16:30:43Araqif you compile to JS Nim produces a single .js file that is usually used from your HTML page
16:31:09Araqand then the C wrappers don't work.
16:31:32Araqunless you *don't* compile to JS via Nim but via emscripten or similar
16:32:15Araqnimforum uses 'nim js' to be the SPA frontend and 'nim c' to build the backend server
16:32:35Araqso you can reuse Nim code across these targets if you are moderately careful
16:34:16Zevvenow: in case you're up for early testing, here is a compact solution for your compile time header reading
16:34:19Zevvhttp://paste.debian.net/1073779/
16:34:53Zevvit's dumb though and assumes your #defines are plain and simple
16:37:51FromGitter<nothratal> So by using dll or c code in any ways I'm mostly limiting myself to nim c?
16:38:24*rnrwashere quit (Remote host closed the connection)
16:38:31FromGitter<nothratal> Safest way would be rewriting it to Nim directly right?
16:38:32Zevvindeed, no JS then
16:38:40Zevvso native is the way to go indeed
16:40:17FromGitter<mratsim> Nim C can communicate with Nim JS
16:40:32Zevvoh?
16:40:44FromGitter<mratsim> you just need a backend<->frontend structure
16:41:07Zevvhm yeah ok
16:41:19ZevvQ: What is the general cause for "cannot evaluate at compile time?"
16:41:39FromGitter<mratsim> For example: https://github.com/Vindaar/NeuralNetworkLiveDemo
16:41:59FromGitter<mratsim> it uses Arraymancer as a backend (which only works with C backend)
16:42:08FromGitter<mratsim> and plotly which only works with JS backend
16:43:11FromGitter<mratsim> and connection is done through sockets
16:44:56Zevvnice demo
16:45:04*I_Right_I joined #nim
16:52:23*dddddd quit (Remote host closed the connection)
16:55:57*clyybber joined #nim
17:05:45*ng0 joined #nim
17:09:38*rnrwashere joined #nim
17:19:07*avanderneut quit (Ping timeout: 240 seconds)
17:28:39*sealmove joined #nim
17:29:25*clyybber quit (Quit: WeeChat 2.4)
17:32:31shashlickZevv, not able to see your snippet since its blocked at work, but did you see what I shared earlier?
17:33:21*rnrwashere quit (Remote host closed the connection)
17:39:15*leorize quit (Ping timeout: 258 seconds)
17:40:56*leorize joined #nim
17:43:00*neceve quit (Read error: Connection reset by peer)
17:51:06*stefanos82 joined #nim
17:55:03sealmoveare there procs in macros module for constructing tuple AST?
17:55:19sealmovetuple literals*
17:55:30sealmoveor they have to be constructed more manually?
18:05:33Zevvshashlick: oh sorry, I missed that!
18:09:44*rnrwashere joined #nim
18:21:07*avanderneut joined #nim
18:22:33sealmoveguys, how about this syntax for interfaces? https://termbin.com/574u
18:28:54Araqsealmove, looks good to me
18:30:56sealmoveWill refine it since there are details lacking, but this is the basic idea. I think it's simpler than what other examples I saw (note that a built-in type can implement an interface too)
18:35:45*nsf quit (Quit: WeeChat 2.4)
18:36:31sealmovealso I have another interesting idea for macros (not interface related)
18:40:31*kapil____ joined #nim
18:41:06*natrys joined #nim
18:42:58*tensortom quit (Remote host closed the connection)
18:43:51*rnrwashere quit (Remote host closed the connection)
18:47:30*couven92 joined #nim
19:03:29*rnrwashere joined #nim
19:08:56shashlickAraq: do you prefer the stripped versions of dlls?
19:09:33*Vladar quit (Remote host closed the connection)
19:22:42*jjido joined #nim
19:34:19shashlickboehm has brought on new found stability into feud - opened 70 windows with no issues
19:48:41*noeontheend joined #nim
20:18:52*fredrik92 joined #nim
20:25:47*enow quit (Read error: No route to host)
20:28:22*dddddd joined #nim
20:31:23*noeontheend_ joined #nim
20:31:23*noeontheend quit (Read error: Connection reset by peer)
20:33:16*theelous3_ joined #nim
20:41:03*narimiran quit (Remote host closed the connection)
20:47:48FromGitter<Varriount> shashlick: What are you writing?
20:48:01shashlickGUI text editor based on scintilla
20:48:03shashlick100% nim
20:48:20shashlickhttps://github.com/genotrance/feud/
20:48:56shashlicki can already do most of my coding in it, minor annoyances, but long roadmap to add bells and whistles
20:54:55dom96hah, why is it that so many Nim devs decide to write a Nim editor/ide?
20:55:26Zevvsomething something Vi something Emacs something mumble
21:17:03I_Right_Ihere's a thread pool question I have for you nim guru's, Is it generally safe to, "spawn proc A()" and have A() "spawn proc B()"?
21:17:25I_Right_IHere's an example ----> https://pastebin.com/uW9mam5z
21:20:48I_Right_II know I could have wrote the program to be a bit more verbose
21:20:51shashlickCause Nim is ideal for performant gui coding
21:46:18*Trustable quit (Remote host closed the connection)
21:48:42shashlickAnd I'm personally fed up with bloated 1gb apps
21:50:11*couven92 quit (Disconnected by services)
21:50:16*fredrik92 is now known as couven92
21:50:37*fredrik92 joined #nim
21:53:43*rnrwashere quit (Remote host closed the connection)
21:58:29*lf-araujo joined #nim
21:58:30*banc quit (Ping timeout: 246 seconds)
21:59:48*abm joined #nim
22:01:57*rnrwashere joined #nim
22:08:40*banc joined #nim
22:10:37*rnrwashere quit (Remote host closed the connection)
22:11:45*rnrwashere joined #nim
22:18:54*ng0 quit (Quit: Alexa, when is the end of world?)
22:20:41*rnrwashere quit (Remote host closed the connection)
22:21:33*rnrwashere joined #nim
22:35:07sealmovehow do you create identifiers that are guranteed to not conflict with other identifierS?
22:47:00*vlad1777d joined #nim
22:52:17rayman22201@sealmove https://nim-lang.github.io/Nim/macros.html#genSym%2CNimSymKind%2Cstring
22:52:34sealmovethanks, I have another question
22:52:52sealmoveis there a way to make a scope that is agnostic to top level vars?
22:53:09*stefanos82 quit (Remote host closed the connection)
22:55:56rayman22201what do you mean by agnostic?
22:57:06*natrys quit (Quit: natrys)
22:57:49sealmovetop-level variables not valid in that scope
22:58:25sealmoveprocs become closures automatically...
23:00:07*noeontheend_ quit (Ping timeout: 250 seconds)
23:00:09*lf-araujo quit (Read error: Connection reset by peer)
23:01:03FromDiscord<moerm> hello everyone
23:01:18rayman22201I'm not sure about the first, but I'm quite sure there is no way to do the latter. "procs become closures automatically" would be very expensive in terms of memory use.
23:01:34FromDiscord<moerm> "<shashlick> And I'm personally fed up with bloated 1gb apps" - full ACK
23:02:58*solitudesf quit (Ping timeout: 245 seconds)
23:03:34*lf-araujo joined #nim
23:03:41sealmoverayman22201: maybe my wording wasn't correct, but what I mean is: if you have top-level variables and declare a proc after them, then that proc has access to these variables
23:04:07FromDiscord<moerm> sealmove yes. but it's usually bad practise
23:04:35sealmoveI know, but I am trying to find a way to disallow that
23:04:59rayman22201I think I understand now. No. The top level scope is always global. I don't believe there is a way to "disable" that. The solution is to not use the top level scope.
23:05:09rayman22201You create a "main" function.
23:05:25sealmoveyeah I know about "main" solution... arghh
23:05:35sealmovethis is kind of annoyin
23:08:44dom96maybe use `block: ...`?
23:11:39sealmovedom, you mean wrap top level with a block?
23:13:50FromDiscord<moerm> Why is it annoying? Just don't use top level vars
23:14:22dom96sealmove: yes
23:14:46sealmovemoerm: because it doesn't allow me to create the macro I want :P but I'll find a workaround
23:17:08rayman22201can you share your macro? maybe there is an alternate way
23:17:15FromDiscord<moerm> you can include dom96's tip with "include" (not import)
23:19:43sealmoverayman22201: not yet implemented, it's just an idea I had, but it might be silly. I'll post something that explains it, w8.
23:21:20sealmovehttps://termbin.com/vpln
23:27:14*krux02_ quit (Remote host closed the connection)
23:29:16FromDiscord<moerm> Why not also create a macro to make 'x' mean run the ackermann function?
23:29:28FromDiscord<moerm> Sorry, excuse my hardshness
23:30:44sealmovethat would be fun ^^. just thought being able to specify which variables you are allowed to use in a block would be cool...
23:32:01FromDiscord<moerm> Strange. A post of mine in the forum seems to have vanished
23:38:12rayman22201@sealmove, you can do that for anything except top level scope / globals.
23:39:54rayman22201To be fair, C is the same way. So is Python.
23:41:18sealmovei don't see how it's only top-level. same applies for any scope. what you declare in the enclosing scope is valid below.
23:44:30rayman22201Yes, but your "using x" macro can be implemented such that it does not create a closure.
23:47:27sealmovedo I do that we a pragma?
23:49:11*couven92 quit (Read error: Connection reset by peer)
23:49:40sealmovemmm changing calling convention indeed works
23:54:57sealmoveI guess it's still useful then, thanks rayman22201 :)
23:56:05rayman22201sorry. too many things going on. Yeah, it's about just excluding the "closure" pragma.
23:56:10rayman22201cool. glad it worked