00:02:55 | * | banc joined #nim |
00:11:05 | * | dddddd quit (Remote host closed the connection) |
00:14:39 | FromDiscord | <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:45 | I_Right_I | could 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:18 | I_Right_I | nevermind |
01:31:40 | I_Right_I | it was a mistake plus and forgotten savefile |
01:39:04 | * | sealmove quit (Quit: WeeChat 2.4) |
02:55:22 | * | ryukoposting joined #nim |
02:55:29 | ryukoposting | it's real nim hours who up |
02:56:12 | shashlick | me |
02:56:19 | ryukoposting | check this out http://ryuk.ooo/ec2.nim |
02:56:34 | ryukoposting | generated from the AWS JSON spec |
02:56:55 | shashlick | wow awesome |
02:56:59 | ryukoposting | not done yet, but getting there |
02:57:26 | shashlick | as long as you didn't hand type that 😄 |
02:57:47 | ryukoposting | im 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:51 | ryukoposting | lol i didn't type that by hand |
02:58:58 | ryukoposting | thank god |
02:59:18 | ryukoposting | I just updated that link, at the bottom of the file there's some sample code |
02:59:36 | ryukoposting | 100% valid nim btw, you can compile that file if you want, it just doesn't do much yet lol |
02:59:41 | shashlick | that's really cool - I know this was discussed multiple times in the past, glad you are taking it through |
03:00:03 | shashlick | i was hoping to write a swagger template |
03:00:12 | ryukoposting | yeah, 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:26 | ryukoposting | though if the AWS SDK wasn't enormous, it'd be perfectly fine |
03:00:26 | shashlick | what limitations were problematic for you? |
03:00:42 | shashlick | i could do quite a few crazy things in nimterop, but eventually i moved to compiled binary for performance |
03:00:45 | ryukoposting | the compiler has a hard limit on how many times a macro can loop |
03:01:11 | ryukoposting | and when you parse 35000 lines of JSON, there's a lot of loops |
03:02:54 | shashlick | i see |
03:04:54 | ryukoposting | if 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:31 | shashlick | so 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:17 | FromGitter | <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:25 | Zevv | ryukoposting: hi, what's that your building? |
05:48:23 | * | leorize-otg joined #nim |
06:15:42 | * | narimiran joined #nim |
06:20:36 | FromGitter | <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:46 | Tanger | Hey 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:54 | Tanger | I'm trying to go through the indexes in a for loop and for each index, execute myArray[index].fill[bool](false) |
07:19:38 | Tanger | Does that look correct? Or am I meant to be setting T as array[MAX_COLS, bool], then fill with false? |
07:19:52 | narimiran | Tanger: isn't that automatically filled with `false`? |
07:20:13 | Tanger | Oh crap, cos bool is non nullable XD |
07:20:31 | Tanger | Holy hell, thanks, that was silly |
07:20:45 | narimiran | :) |
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:22 | FromGitter | <mratsim> arrrays are filled with 0 at start anyway |
07:48:22 | Tanger | Haha, 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:25 | Tanger | Which I don't mind |
07:52:52 | PMunch | Yeah all memory in Nim is by default initialized to all nulls, with the type dictatic what that actually means |
07:56:40 | PMunch | This 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:41 | FromGitter | <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:15 | FromGitter | <mratsim> create your re outside of the loop |
10:01:10 | FromGitter | <SkeneZr> but if I want a dynamic regex |
10:01:16 | FromGitter | <SkeneZr> ? |
10:01:53 | FromGitter | <SkeneZr> memory allocation should empty at the end of each loop turn? |
10:02:30 | FromGitter | <mratsim> no |
10:02:40 | FromGitter | <mratsim> the GC only empties when under pressure or at scope release |
10:03:15 | FromGitter | <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:07 | PMunch | SkeneZr, what are you trying to achieve? |
10:17:14 | * | stefanos82 joined #nim |
10:29:49 | FromGitter | <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:33 | FromGitter | <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:08 | FromGitter | <mratsim> in C or C++ you would need to as well, other langs give you a GC |
10:32:25 | narimiran | in python it is also recommended that you do it in advance |
10:33:09 | narimiran | https://stackoverflow.com/questions/452104/is-it-worth-using-pythons-re-compile |
10:33:38 | FromGitter | <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:52 | FromGitter | <SkeneZr> Right, I never do it in C++, or I missed something |
10:34:14 | * | leorize-otg quit (Quit: WeeChat 2.3) |
10:34:16 | FromGitter | <SkeneZr> of course, yes, your are right |
10:36:33 | FromGitter | <SkeneZr> thank you ;) |
10:36:35 | FromGitter | <mratsim> now regarding GC collection in loops, I don't know how "re" works unfortunately. |
10:36:56 | FromGitter | <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:41 | FromGitter | <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:48 | Araq | proc finalizeRegEx(x: Regex) = |
10:48:48 | Araq | # XXX This is a hack, but PCRE does not export its "free" function properly. |
10:48:48 | Araq | # Sigh. The hack relies on PCRE's implementation (see ``pcre_get.c``). |
10:48:50 | Araq | # Fortunately the implementation is unlikely to change. |
10:49:02 | * | xace quit (Ping timeout: 250 seconds) |
10:49:03 | Araq | looks 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:56 | FromGitter | <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:46 | FromGitter | <SkeneZr> I will just initialize my regex out of scope like you said before and find a way to make dynamic regex |
10:58:33 | FromGitter | <SkeneZr> Yes, araq, I am not sur to understand this part. |
10:58:43 | Araq | I'm fixing it |
10:59:03 | Araq | the PRCE wrapper predates pcre_free() believe it or not |
10:59:54 | * | abm joined #nim |
11:15:09 | FromGitter | <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:59 | PMunch | SkeneZr, 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:28 | FromGitter | <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:01 | FromGitter | <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:01 | FromGitter | ... bioinformatician, but it's a new word for me ^^' [https://gitter.im/nim-lang/Nim?at=5c90ee24a21ce51a20872349] |
13:28:24 | narimiran | SkeneZr 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:20 | FromGitter | <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:23 | Zevv | just wait until I'm done :) |
13:33:36 | * | enow joined #nim |
13:33:41 | enow | Hi |
13:33:51 | enow | I want to extract a lot of values from a C header on compile time |
13:34:04 | Zevv | nimterop! |
13:34:32 | enow | Zevv: mm I was thinking about it |
13:34:56 | enow | Thought I had to extract the values from the header |
13:35:00 | enow | 175 #define KEY_LINEFEED 101 |
13:35:01 | enow | 176 #define KEY_HOME 102 |
13:35:01 | enow | 177 #define KEY_UP 103 |
13:35:01 | enow | 178 #define KEY_PAGEUP 104 |
13:35:01 | enow | 179 #define KEY_LEFT 105 |
13:35:03 | enow | 180 #define KEY_RIGHT 106 |
13:35:05 | enow | 181 #define KEY_END 107 |
13:35:08 | enow | 182 #define KEY_DOWN 108 |
13:35:10 | enow | 183 #define KEY_PAGEDOWN 109 |
13:35:13 | enow | 184 #define KEY_INSERT 110 |
13:35:15 | enow | 185 #define KEY_DELETE 111 |
13:35:18 | enow | 186 #define KEY_MACRO 112 |
13:35:19 | FromGitter | <mratsim> var myCvar {.importc:"mycvar", header: "myheader.h".} |
13:35:20 | enow | 187 #define KEY_MUTE 113 |
13:35:22 | Zevv | pleas don't dump, use a pastebin |
13:35:23 | enow | They look like this and I really would like to get the name of the definition, getting the number are no problem |
13:35:27 | enow | sorry! |
13:35:50 | enow | The thing is I want the define names and not the values, that'd be piece of cake |
13:35:58 | FromGitter | <mratsim> ah the #define, I think c2nim/nimgen/nimterop handle that properly and put them in an enum or a distinct int. |
13:35:59 | enow | can you list all the variables that are available in nim |
13:36:12 | Zevv | you could do a readFile() and parse the header yourself at compile time |
13:36:14 | Zevv | this is Nim |
13:36:27 | enow | that's the thing! |
13:36:35 | enow | But I'm thinking of the best way to do so |
13:37:05 | FromGitter | <mratsim> staticRead for compile time reading, + a parser like strscans |
13:37:06 | enow | 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:38 | FromGitter | <mratsim> do you want to read the file everytime you compile or does it stays the same for a long time |
13:37:45 | enow | It get's a bit messy at times |
13:37:49 | enow | I have an example |
13:38:20 | enow | BTN_SOUTH = 0x00000130 |
13:38:30 | FromGitter | <mratsim> can you try running c2nim on it |
13:38:30 | enow | BTN_A = BTN_SOUTH |
13:38:43 | enow | c2nim works really fine |
13:38:45 | leorize | nimterop can handle these like a breeze |
13:38:54 | enow | the thing is that I want to have the variable names as keys in a list |
13:39:12 | enow | or is there a way I can list declared varibles in the current scope at run time |
13:39:39 | leorize | c2nim can do a bit of transformation |
13:39:55 | FromGitter | <mratsim> You can't list declared variable at run-time |
13:40:08 | FromGitter | <mratsim> those name do not exist anymore once the compiler has done its job |
13:40:24 | Zevv | enow: I'll hack an example |
13:40:33 | FromGitter | <mratsim> use https://nim-lang.org/docs/strscans.html |
13:40:38 | FromGitter | <mratsim> with staticRead |
13:40:45 | FromGitter | <mratsim> and Tables module |
13:41:29 | enow | Zevv: really good idea with staticread, |
13:41:33 | FromGitter | <mratsim> or use an enum with key = value |
13:41:41 | enow | but what happens if a define points to another define |
13:42:08 | Zevv | well, then things break. |
13:42:09 | FromGitter | <mratsim> for example: aster/third_party/ale_wrap.nim#L67-L81 |
13:42:13 | enow | The thing is that I wouldn't mind going full on AST on this project, even though a regexp would suffice, |
13:42:16 | leorize | nimterop uses a helper binary called `toast` |
13:42:18 | FromGitter | <mratsim> https://github.com/numforge/agent-smith/blob/master/third_party/ale_wrap.nim#L67-L81 |
13:42:21 | FromGitter | <mratsim> sorry* |
13:42:27 | Zevv | If 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:31 | leorize | which, as the name implies: convert C to AST :) |
13:43:02 | enow | ah! |
13:43:09 | enow | haha |
13:43:41 | Zevv | and important: it uses a real preprocessor to do the preprocessing |
13:43:59 | enow | yeah that was really where I wanted to go |
13:44:06 | enow | eventhough the staticRead will help a lot |
13:44:53 | Zevv | ok, good luck! |
13:45:36 | enow | thanks 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:53 | shashlick | I have a working example enow |
14:10:02 | shashlick | Don't waste your time |
14:10:27 | * | a_b_m quit (Read error: Connection reset by peer) |
14:10:41 | shashlick | https://github.com/genotrance/feud/blob/master/src/pluginapi.nim |
14:10:42 | * | abm quit (Read error: Connection reset by peer) |
14:10:51 | shashlick | See SciDefs |
14:11:13 | shashlick | I want all scintilla #defines as a table for the same reason |
14:11:36 | shashlick | Done at compile time |
14:17:41 | * | nsf quit (Quit: WeeChat 2.4) |
14:29:34 | * | abm joined #nim |
14:33:18 | Araq | yay I broke devel |
14:35:58 | FromGitter | <Varriount> Araq: Did you divide by zero? :{ |
14:36:27 | narimiran | he "removed hacks" :P |
14:36:38 | Araq | yup |
14:36:54 | Araq | but 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:31 | Araq | ah I got it |
14:43:58 | Araq | the PCRE authors do not understand DLLs/shared objects |
14:44:06 | Araq | so 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:56 | Zevv | We should have native regexps |
15:21:41 | Araq | lexim :P |
15:23:42 | * | noeontheend joined #nim |
15:26:01 | Zevv | npeg :) |
15:26:53 | shashlick | Araq: I've posted the boehm dlls on bintray as well - https://bintray.com/genotrance/binaries/boehmgc/8.0.4#files |
15:27:14 | shashlick | will 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:42 | sealmove | where do tests for stdlib go? |
15:36:23 | narimiran | sealmove: https://github.com/nim-lang/Nim/tree/devel/tests |
15:36:24 | Araq | tests/stdlib |
15:36:40 | sealmove | great |
15:37:20 | sealmove | I think I can write a nice macro for interfaces, which translates to what you showed yesterday (Araq) |
15:37:37 | sealmove | Should that be in stdlib or external library? |
15:38:27 | Araq | we wanted to add it to the stdlib but these things always take up precious resources |
15:38:41 | Araq | I mean development resources |
15:39:01 | sealmove | yeah I understand, happy to help then :) |
15:39:28 | Araq | it'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:10 | Araq | one simply cannot win no matter how you do things they are wrong ;-) |
15:41:19 | sealmove | well, should I make a PR or make my own repo for it? :P |
15:41:28 | shashlick | Araq: does putting -d:useGcAssert -d:useSysAssert slow the binary down? not recommended for release? |
15:41:31 | sealmove | I'll do whatever you tell me, haha |
15:42:06 | Araq | shashlick, it's super slow, don't use it in production. For production use --stackTrace:off --opt:size |
15:42:29 | shashlick | not -d:release? |
15:42:30 | Araq | and only if you need more speed you should use -d:release |
15:42:56 | Araq | -d:release throws away array bound checks etc, it's pretty bad |
15:43:38 | shashlick | seems like a misnomer then |
15:44:10 | Araq | well I use it all the time because I test my array indexing |
15:44:38 | * | stefanos82 quit (Remote host closed the connection) |
15:46:32 | shashlick | ya but for the average user, but its fair to expect users to understand that speed kills |
15:46:36 | shashlick | 🙂 |
15:47:47 | shashlick | Araq: can you please explain how switching to boehm means I can be sloppy with memory across threads? |
15:48:32 | shashlick | I'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:17 | FromGitter | <Varriount> shashlick: I believe boehm uses memory scanning |
16:06:36 | * | vlad1777d quit (Ping timeout: 268 seconds) |
16:14:52 | Zevv | I 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:14 | Zevv | wow, that is a remarkably bad phrased explaination |
16:17:29 | * | nsf joined #nim |
16:23:47 | FromGitter | <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:43 | Araq | it all depends. |
16:28:56 | Araq | wrapping C can be done in multiple ways |
16:29:27 | Araq | and you can import DLLs (that do not necessarily have to be written in C btw) |
16:29:58 | Araq | you can also use {.compile: "foo.c".} and link against C code directly without any static or dynamic library |
16:30:43 | Araq | if you compile to JS Nim produces a single .js file that is usually used from your HTML page |
16:31:09 | Araq | and then the C wrappers don't work. |
16:31:32 | Araq | unless you *don't* compile to JS via Nim but via emscripten or similar |
16:32:15 | Araq | nimforum uses 'nim js' to be the SPA frontend and 'nim c' to build the backend server |
16:32:35 | Araq | so you can reuse Nim code across these targets if you are moderately careful |
16:34:16 | Zevv | enow: in case you're up for early testing, here is a compact solution for your compile time header reading |
16:34:19 | Zevv | http://paste.debian.net/1073779/ |
16:34:53 | Zevv | it's dumb though and assumes your #defines are plain and simple |
16:37:51 | FromGitter | <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:31 | FromGitter | <nothratal> Safest way would be rewriting it to Nim directly right? |
16:38:32 | Zevv | indeed, no JS then |
16:38:40 | Zevv | so native is the way to go indeed |
16:40:17 | FromGitter | <mratsim> Nim C can communicate with Nim JS |
16:40:32 | Zevv | oh? |
16:40:44 | FromGitter | <mratsim> you just need a backend<->frontend structure |
16:41:07 | Zevv | hm yeah ok |
16:41:19 | Zevv | Q: What is the general cause for "cannot evaluate at compile time?" |
16:41:39 | FromGitter | <mratsim> For example: https://github.com/Vindaar/NeuralNetworkLiveDemo |
16:41:59 | FromGitter | <mratsim> it uses Arraymancer as a backend (which only works with C backend) |
16:42:08 | FromGitter | <mratsim> and plotly which only works with JS backend |
16:43:11 | FromGitter | <mratsim> and connection is done through sockets |
16:44:56 | Zevv | nice 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:31 | shashlick | Zevv, 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:03 | sealmove | are there procs in macros module for constructing tuple AST? |
17:55:19 | sealmove | tuple literals* |
17:55:30 | sealmove | or they have to be constructed more manually? |
18:05:33 | Zevv | shashlick: oh sorry, I missed that! |
18:09:44 | * | rnrwashere joined #nim |
18:21:07 | * | avanderneut joined #nim |
18:22:33 | sealmove | guys, how about this syntax for interfaces? https://termbin.com/574u |
18:28:54 | Araq | sealmove, looks good to me |
18:30:56 | sealmove | Will 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:31 | sealmove | also 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:56 | shashlick | Araq: 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:19 | shashlick | boehm 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:48 | FromGitter | <Varriount> shashlick: What are you writing? |
20:48:01 | shashlick | GUI text editor based on scintilla |
20:48:03 | shashlick | 100% nim |
20:48:20 | shashlick | https://github.com/genotrance/feud/ |
20:48:56 | shashlick | i can already do most of my coding in it, minor annoyances, but long roadmap to add bells and whistles |
20:54:55 | dom96 | hah, why is it that so many Nim devs decide to write a Nim editor/ide? |
20:55:26 | Zevv | something something Vi something Emacs something mumble |
21:17:03 | I_Right_I | here'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:25 | I_Right_I | Here's an example ----> https://pastebin.com/uW9mam5z |
21:20:48 | I_Right_I | I know I could have wrote the program to be a bit more verbose |
21:20:51 | shashlick | Cause Nim is ideal for performant gui coding |
21:46:18 | * | Trustable quit (Remote host closed the connection) |
21:48:42 | shashlick | And 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:07 | sealmove | how do you create identifiers that are guranteed to not conflict with other identifierS? |
22:47:00 | * | vlad1777d joined #nim |
22:52:17 | rayman22201 | @sealmove https://nim-lang.github.io/Nim/macros.html#genSym%2CNimSymKind%2Cstring |
22:52:34 | sealmove | thanks, I have another question |
22:52:52 | sealmove | is 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:56 | rayman22201 | what do you mean by agnostic? |
22:57:06 | * | natrys quit (Quit: natrys) |
22:57:49 | sealmove | top-level variables not valid in that scope |
22:58:25 | sealmove | procs 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:03 | FromDiscord | <moerm> hello everyone |
23:01:18 | rayman22201 | I'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:34 | FromDiscord | <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:41 | sealmove | rayman22201: 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:07 | FromDiscord | <moerm> sealmove yes. but it's usually bad practise |
23:04:35 | sealmove | I know, but I am trying to find a way to disallow that |
23:04:59 | rayman22201 | I 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:09 | rayman22201 | You create a "main" function. |
23:05:25 | sealmove | yeah I know about "main" solution... arghh |
23:05:35 | sealmove | this is kind of annoyin |
23:08:44 | dom96 | maybe use `block: ...`? |
23:11:39 | sealmove | dom, you mean wrap top level with a block? |
23:13:50 | FromDiscord | <moerm> Why is it annoying? Just don't use top level vars |
23:14:22 | dom96 | sealmove: yes |
23:14:46 | sealmove | moerm: because it doesn't allow me to create the macro I want :P but I'll find a workaround |
23:17:08 | rayman22201 | can you share your macro? maybe there is an alternate way |
23:17:15 | FromDiscord | <moerm> you can include dom96's tip with "include" (not import) |
23:19:43 | sealmove | rayman22201: 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:20 | sealmove | https://termbin.com/vpln |
23:27:14 | * | krux02_ quit (Remote host closed the connection) |
23:29:16 | FromDiscord | <moerm> Why not also create a macro to make 'x' mean run the ackermann function? |
23:29:28 | FromDiscord | <moerm> Sorry, excuse my hardshness |
23:30:44 | sealmove | that would be fun ^^. just thought being able to specify which variables you are allowed to use in a block would be cool... |
23:32:01 | FromDiscord | <moerm> Strange. A post of mine in the forum seems to have vanished |
23:38:12 | rayman22201 | @sealmove, you can do that for anything except top level scope / globals. |
23:39:54 | rayman22201 | To be fair, C is the same way. So is Python. |
23:41:18 | sealmove | i 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:30 | rayman22201 | Yes, but your "using x" macro can be implemented such that it does not create a closure. |
23:47:27 | sealmove | do I do that we a pragma? |
23:49:11 | * | couven92 quit (Read error: Connection reset by peer) |
23:49:40 | sealmove | mmm changing calling convention indeed works |
23:54:57 | sealmove | I guess it's still useful then, thanks rayman22201 :) |
23:56:05 | rayman22201 | sorry. too many things going on. Yeah, it's about just excluding the "closure" pragma. |
23:56:10 | rayman22201 | cool. glad it worked |