00:05:08 | * | ng0 quit (Ping timeout: 260 seconds) |
00:05:37 | * | zama quit (Remote host closed the connection) |
00:06:00 | * | zama joined #nim |
00:06:16 | * | ng0 joined #nim |
00:08:37 | * | nif quit (Quit: ...) |
00:08:46 | * | nif joined #nim |
00:28:51 | disruptek | i understand how to create .tags. i understand how to invoke .effects. but is there nothing else i can do with tags? can i query them from inside a macro? the manual is pretty damned skimpy here. |
00:33:23 | * | krux02 quit (Remote host closed the connection) |
00:39:12 | * | liam_ joined #nim |
00:40:56 | liam_ | Hi all. I'm trying to wrap the Openssl RSA library for Nim, and I'm having some trouble using c2nim. When I run c2nim on (what I think is) the right header file I get syntax errors. Any ideas? |
00:41:03 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:41:34 | FromGitter | <bung87> how to print c file specific define declaration in nim ? the quike way |
00:42:31 | FromGitter | <bung87> I use emit printf before |
00:42:48 | FromDiscord | <Fern & Simula (They/Them)> liam_: Could you give us the syntax errors and a link to the header file? |
00:43:07 | FromDiscord | <exelotl> liam_: you might have to edit the header file and make a simplified version |
00:47:25 | liam_ | The header file is https://github.com/openssl/openssl/blob/master/include/crypto/rsa.h |
00:47:48 | liam_ | And the error is "/home/liam/openssl/include/crypto/rsa.h(27, 57) Error: token expected: )" |
00:49:16 | FromDiscord | <exelotl> bung87: if you *need* to access a #define from a header file, you can do something like this: |
00:49:19 | FromDiscord | <exelotl> var pi {.importc:"M_PI", header:"math.h".}: cfloat |
00:50:37 | FromGitter | <bung87> can it declare as a const ? |
00:51:11 | liam_ | Declare what? |
00:51:35 | FromDiscord | <exelotl> no, consts only exist at compile time in Nim |
00:52:01 | FromGitter | <bung87> I remember I write the same way but assign to const A = , the editor show syntax error |
00:52:47 | FromGitter | <bung87> ok , I got it , thank you , I will try it later. |
00:53:14 | liam_ | exelotle: Are you suggesting to run c2nim on something other than that header file? |
00:53:43 | FromDiscord | <exelotl> bung87: it's generally recommended to just rewrite the definition in Nim. e.g. `const PI = 3.14159265358979323846` |
00:54:11 | FromDiscord | <exelotl> (at least I think so) |
00:54:59 | FromGitter | <bung87> hmm, I did see the way nim std write like this, just worry about what if the c lib change the define value ? |
00:56:24 | FromDiscord | <Fern & Simula (They/Them)> Different c libs may use different values. best to define it yourself so it never changes |
00:56:33 | FromGitter | <bung87> and it also need to print out the value to make this, the apple source does not have a search input. |
00:56:56 | FromDiscord | <Fern & Simula (They/Them)> also fun times if you're porting to a platform without libm. i've seen those in production |
00:58:41 | FromGitter | <bung87> I’m working on this https://github.com/johnscillieri/psutil-nim/pull/5/commits/bf1e3db9408ea7b95010c808580cf55b1b1a540b |
00:58:42 | disbot | ➥ fix compile error at nim v1.1.1 add psutil_macosx.nim only finished uptime |
00:58:52 | FromGitter | <bung87> dont know about libm |
00:59:18 | FromDiscord | <exelotl> hah I was just using pi/math.h as an example, don't worry |
00:59:23 | FromDiscord | <exelotl> liam_: lol what there's no line 27 in that file |
00:59:49 | FromDiscord | <exelotl> but yeah you might have to mess around with it, what if you remove the include guards? |
01:00:48 | liam_ | exelotl: Oh yeah! Thats because of the modifications I made to it as per the c2nim tutorial. The error came from what is actually line 15 |
01:02:19 | FromDiscord | <exelotl> ah, so it's probably complaining about STACK_OF(BIGNUM). You should figure out what STACK_OF expands to and use that instead? |
01:02:31 | FromDiscord | <exelotl> or you might just be able to cheat and replace it with void* |
01:05:33 | liam_ | I kind of get the feeling that that line and the couple below it are tests or something, so maybe that cheat would work. |
01:11:00 | * | lritter quit (Ping timeout: 265 seconds) |
01:13:24 | liam_ | I don't think that was the correct headerf ile to be using honestly. I'm trying a different one now but getting similar syntax errors |
01:14:11 | liam_ | I'm not very familiar with how c projects are structured |
01:14:38 | liam_ | https://github.com/openssl/openssl/blob/master/crypto/rsa/rsa_local.h maybe? |
01:28:06 | liam_ | Im getting "/home/liam/openssl/crypto/rsa/rsa_local.h(29, 16) Error: expected ';'" |
01:28:17 | liam_ | Maybe it's c2nim's parser? |
01:28:52 | liam_ | Is there a way to do this without c2nim? |
01:49:28 | FromDiscord | <mratsim> c2nim helps but you need to manually intervene for each header in my experience |
01:49:32 | FromDiscord | <mratsim> try nimterop |
01:49:50 | FromDiscord | <mratsim> !package nimterop |
01:49:50 | disbot | https://github.com/genotrance/nimtreesitter -- 9nimterop: 11Nimterop makes C/C++ interop within Nim seamless |
01:50:06 | FromDiscord | <mratsim> wrong one @disruptek :/ |
01:50:24 | FromDiscord | <mratsim> or maybe there is a redirect? https://github.com/nimterop/nimterop |
01:51:29 | liam_ | I'm having some success using Nimgen at the moment |
01:52:01 | liam_ | Someone else used to to wrap parts of openssl, so i'm using their configuration as a baseline for what bits I want to wrap |
01:52:44 | liam_ | Unfortunately they have the nimble package Nimssl despite only wrapping AES and SHA, which is a bit misleading |
01:54:24 | shashlick | Agreed, never got around to it |
01:56:12 | liam_ | "Never got around to it". You made NimSSL? |
01:59:49 | FromGitter | <Asc2011> hi, i need some help with my first macro. It shall give me a 'unless <cond>' which is basically a 'if not( <cond>)'. I can't put the 'else'-part back in the ast ? |
02:01:34 | FromGitter | <gogolxdong> @liam_ no worry, shashlick is making a new nimssl with nimterop. |
02:02:34 | FromGitter | <gogolxdong> which requested by me two days ago :) , we are on the same boat. |
02:02:51 | liam_ | Huh cool |
02:03:18 | liam_ | sashlick: Thanks heaps. Make sure to let us know how you are doing! |
02:09:16 | liam_ | sashlick, gogolxdong: I'm going to continue having a go at making my own wrapper anyway |
02:13:00 | FromGitter | <gogolxdong> with nimgen? |
02:14:03 | liam_ | Maybe interop seeing as I am having some troubles with nimgen |
02:14:13 | liam_ | Ill try some more with nimgen for now |
02:14:19 | FromGitter | <gogolxdong> shashlick said it's obsoloted. |
02:14:34 | shashlick | Got stuck with an issue with tree-sitter |
02:14:42 | shashlick | But I have some ideas |
02:15:07 | shashlick | If you both can prioritize which parts you want wrapped, will help |
02:15:35 | shashlick | You can use nimterop but use c2nImport instead |
02:15:44 | shashlick | Which will use c2nim behind the scenes |
02:17:01 | liam_ | RSA is my priority (which relies on SHA for all practical purposes) |
02:17:13 | FromGitter | <gogolxdong> I for aes, gcm, sha256, pkcs7 |
02:18:22 | FromGitter | <gogolxdong> Is it possible to tranlate entire crypto directory in theory? |
02:18:28 | shashlick | Ok cool |
02:18:48 | shashlick | Should be possible ya, but easier to take small bites |
02:20:33 | liam_ | Fair enough |
02:26:01 | madprops | can nim create a universe? |
02:27:01 | disruptek | i'm gonna go out on a limb here and say, "nope." |
02:32:52 | * | fowl quit (Quit: Connection closed for inactivity) |
02:47:33 | liam_ | shashlick: Btw, make sure you let us know how you are doing :) |
02:58:09 | FromGitter | <perfecto25> hello all, im learning Nim syntax right now sorry for dumb questions, Im coming from Python world and have to readjust how certain elements work in Py vs Nim, ie, Arrays |
02:58:36 | FromGitter | <perfecto25> how can I insert an element into a Sequence in a specific order, ie, seq.add("Bob", 2, 5) |
02:58:46 | FromGitter | <perfecto25> want to add Bob between 2nd and 5th index |
02:59:20 | disruptek | see the sequtils module. |
03:00:09 | disruptek | also, welcome. everyone starts off nim-stupid. |
03:01:01 | FromGitter | <perfecto25> thanks |
03:01:57 | FromGitter | <perfecto25> also, any easy way to tell what module a Proc is from, for example in Py you specify a module namespace or do 'from math import random', but in Nim you just import a module and use a Proc, hard to tell what module a Proc is coming from, is that by design? |
03:02:19 | disruptek | yes. but you can prefix the symbol with its module name if you like. |
03:02:30 | disruptek | eg. sequtils.insert() |
03:02:44 | disruptek | it doesn't change the import syntax. |
03:03:19 | FromGitter | <perfecto25> is that that the recommended way? Ive only seen direct imports w/o specifying module namespace |
03:03:44 | disruptek | as i said, it's optional. i don't personally recommend it. |
03:04:25 | disruptek | it's optional without regard to how the import was made. |
03:04:49 | disruptek | pure syntax. you feel me? |
03:05:21 | FromGitter | <perfecto25> yea, im just wrapping my head around this, python world is my way or the highway when it comes to syntax, this is a different approach |
03:05:50 | disruptek | yeah, it's not the huge problem you may have been led to believe. |
03:06:42 | FromGitter | <perfecto25> cooll thank you, |
03:08:33 | FromGitter | <perfecto25> found some good stuff for people coming over from python |
03:08:36 | FromGitter | <perfecto25> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
03:09:12 | disruptek | coming from python, it's liberating to have the headroom that nim provides. python continues to be a big influence here. |
03:11:21 | FromGitter | <perfecto25> yea thats why Im digging the syntax, some familiar stuff like indent, iterators, loops,etc but also statically typed new stuff like var declaration, types, Proc structure, etc, almost like a mix of python, golang and C |
03:12:55 | disruptek | yep. you get the power and speed of c with the convenience of a dynamic language like python and the metaprogramming of a lisp. |
03:30:06 | FromGitter | <Asc2011> and full macro-power :-) https://play.nim-lang.org/#ix=246q |
04:02:47 | * | endragor joined #nim |
04:33:16 | * | nsf joined #nim |
04:40:05 | * | sammich quit (Read error: Connection reset by peer) |
04:42:03 | * | sammich joined #nim |
04:58:27 | * | chemist69 quit (Ping timeout: 246 seconds) |
04:59:15 | * | narimiran joined #nim |
05:00:36 | * | chemist69 joined #nim |
05:09:33 | * | liam_ quit (Ping timeout: 250 seconds) |
05:23:51 | * | rockcavera quit (Remote host closed the connection) |
05:26:36 | * | ltriant quit (Read error: Connection reset by peer) |
05:26:55 | * | ltriant joined #nim |
06:01:20 | * | ltriant quit (Ping timeout: 276 seconds) |
06:26:48 | FromDiscord | <Rika> the deques module in 1.0.4 seems to be broken, i cannot seem to `addLast` an empty deque |
06:31:12 | FromDiscord | <Rika> ah, you have to initDeque, unlike most other types |
06:34:50 | lqdev[m] | @Rika auto-init is only available for strings, seqs, and Tables |
06:42:09 | Araq | should be done for deques too |
06:49:44 | * | liam_ joined #nim |
06:54:19 | * | solitudesf joined #nim |
06:55:59 | Zevv | and HashMaps? |
06:59:26 | Araq | sure |
07:00:51 | Araq | idiomatic 134.81ms 7.42 |
07:00:51 | Araq | manual 201.99ms 4.95 |
07:00:51 | Araq | cpp 93.62ms 10.68 |
07:00:59 | Araq | surprisingly bad results |
07:01:54 | Araq | (string concat performance) |
07:02:31 | Araq | ^ that's ARC |
07:03:17 | Zevv | so you're there sitting and planning to beat C++ singlehandidly? |
07:03:21 | Araq | idiomatic 91.31ms 10.95 |
07:03:21 | Araq | cpp 93.24ms 10.72 |
07:03:28 | Araq | ^ that's the default GC |
07:03:54 | Araq | we do beat C++ in the benchmark with the old cruft ;-) |
07:06:29 | Araq | and with -d:useMalloc the timings are even worse |
07:07:00 | Araq | 255.67ms 3.91 that's so bad that I am beginning to distrust my benchmark |
07:20:17 | madprops | well with cpp you have to make some weird combination of compile flags to make it fast |
07:20:26 | * | liam_ quit (Quit: Leaving) |
07:25:34 | Araq | nah, I simply use std::string and defeat the SSO |
07:27:01 | Araq | it's fast out of the box, language runtimes are not written by idiots :-) |
07:28:03 | Araq | the problem is not that C++ is faster/slower, the real problem is that I only look at numbers, no insights into the CPU and where the time is spent |
07:29:10 | madprops | i read recently that gnome was improved by canonical by inspecting, not spikes, but cold times where the cpu was doing nothing |
07:29:46 | madprops | also numbers could change on longer tests |
07:30:18 | Zevv | "measure first" |
07:30:30 | Zevv | "complain later" |
07:32:07 | Zevv | but thats quite a difference indeed, 91 to 134 |
07:35:52 | Araq | with cheating I get to 23.93ms 41.79 |
07:45:45 | * | salewski joined #nim |
07:48:31 | salewski | @admins, seems he has eddit in spam links again. Well I have not clicked on the links to proof |
07:48:31 | salewski | https://forum.nim-lang.org/t/5667 |
07:48:31 | salewski | Bye. |
07:50:35 | * | PMunch joined #nim |
07:50:48 | * | salewski quit (Quit: WeeChat 2.6) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:58 | * | gmpreussner joined #nim |
08:06:36 | * | nif quit (Quit: ...) |
08:06:46 | * | nif joined #nim |
08:44:35 | * | aexoxea joined #nim |
08:54:41 | Araq | https://perspectives.mvdirona.com/2012/02/observations-on-errors-corrections-trust-of-dependent-systems/ |
08:58:24 | * | Vladar joined #nim |
09:46:30 | FromGitter | <alehander92> Araq |
09:48:02 | FromGitter | <alehander92> sorry, nevermind |
09:48:06 | Araq | lol |
09:48:34 | FromGitter | <alehander92> thanks for the hints/warnings flags , very useful |
09:49:12 | FromGitter | <alehander92> otherwise is the arc stuff now ready for use in standalone mode |
09:50:57 | Araq | hmm depends, do you have malloc? |
10:04:21 | FromGitter | <alehander92> yes |
10:05:06 | FromGitter | <alehander92> i mean .. a very simple malloc which just increases a global pointer |
10:05:32 | FromGitter | <alehander92> but its there |
10:06:56 | FromGitter | <alehander92> i think i was using newruntime with this toy os the last time actually |
10:08:30 | Araq | what would you think about a .unique pragma? |
10:08:50 | Araq | it's the one thing that --newruntime models that we currently don't |
10:09:28 | FromGitter | <alehander92> dont get me wrong: i was using newruntime, because thats the easiest thing that seemed to work for me |
10:09:39 | FromGitter | <alehander92> what would a .unique pragma do |
10:09:57 | FromGitter | <alehander92> show that something is referred to only by one ref? |
10:10:04 | Araq | yes |
10:10:43 | FromGitter | <alehander92> how would it prove that |
10:10:43 | Araq | the number of pragmas is getting unhealthy though |
10:10:51 | PMunch | Hmm, interesting. Re-implemented some logic from C in Nim and the procedure now takes 44 bytes more than before.. |
10:11:29 | Araq | alehander92: that works much like 'owned ref' |
10:11:34 | FromGitter | <alehander92> well, its either a keyword or a pragma i guess |
10:11:46 | Araq | constructors and 'new' start with .unique and then it bubbles up |
10:12:09 | PMunch | http://ix.io/2478/Nim <- the two procs (second one is cut short because GCC manages to optimise out the other cases and I didn't care to implement those in Nim yet). |
10:12:52 | Araq | PMunch, well you need to tell me where these 44 bytes come from |
10:13:21 | FromGitter | <alehander92> Araq, well sounds useful i guess |
10:13:22 | PMunch | That's what I'm trying to figure out |
10:13:36 | FromGitter | <alehander92> especially if it can mostly reuse the existing logic |
10:15:51 | Araq | alehander92: ideally .unique is also inferred though |
10:30:55 | * | ng0 joined #nim |
10:35:32 | Araq | PMunch, I would start with rewriting it to more idiomatic code via 'ptr UncheckedArray' instead of your ugly manual pointer increments |
10:39:53 | * | lritter joined #nim |
10:42:41 | FromGitter | <alehander92> Araq hm, what do you mean exactly |
10:42:57 | FromGitter | <alehander92> isn't it just a field(type??) annotation |
10:49:19 | * | Mister_Magister quit (Quit: bye) |
10:51:42 | * | krux02 joined #nim |
10:53:09 | * | nc-x joined #nim |
10:56:41 | * | Mister_Magister joined #nim |
10:57:17 | * | Mister_Magister is now known as Guest839 |
10:57:44 | * | Guest839 quit (Client Quit) |
10:58:19 | * | nc-x quit (Ping timeout: 260 seconds) |
10:59:23 | * | Mister_Magister_ joined #nim |
11:00:14 | * | tklohna joined #nim |
11:02:08 | * | Mister_Magister_ quit (Remote host closed the connection) |
11:02:34 | * | nc-x joined #nim |
11:02:47 | nc-x | Araq: regarding https://github.com/nim-lang/Nim/pull/12860 |
11:02:49 | disbot | ➥ Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims |
11:03:17 | nc-x | nimscript.nim has plenty has procs which are actually defined in os.nim |
11:03:36 | nc-x | so what is the criteria for removal from nimscript.nim and moving to os.nim? |
11:03:47 | nc-x | i.e. should I move the other procs too? |
11:05:25 | nc-x | but that creates a problem, because there are new procs with shorter names defined in nimscript.nim which uses those functions https://github.com/nim-lang/Nim/blob/94289161f9dd00b2fc3070b08895a3b6c557ef44/lib/system/nimscript.nim#L186-L273 |
11:05:49 | nc-x | so it would then require to import os.nim |
11:10:27 | * | nc-x quit (Ping timeout: 260 seconds) |
11:10:34 | * | nc-x joined #nim |
11:10:37 | nc-x | but that is a problem because os.nim uses procs defined in nimscript.nim, so it makes a circular dependency |
11:10:58 | nc-x | so my question: what is the criteria for removal from nimscript.nim and moving to os.nim? |
11:12:31 | nc-x | I can move those short named procs to os.nim too, , but I am pretty sure that would break almost everything |
11:12:36 | * | nc-x quit (Remote host closed the connection) |
11:22:00 | * | abm joined #nim |
11:30:12 | * | rockcavera joined #nim |
11:32:08 | * | Vladar quit (Ping timeout: 268 seconds) |
11:37:53 | * | solitudesf quit (Ping timeout: 265 seconds) |
11:39:44 | * | JustASlacker joined #nim |
11:43:00 | FromDiscord | <Stuffe> Is it possible to have an empty mutable table as a default parameter in nim? |
11:43:30 | * | Mister_Magister_ joined #nim |
11:44:13 | JustASlacker | hello peoples of nim |
11:44:39 | JustASlacker | I have a simple script -> https://termbin.com/5yrb in which I try to regex the server_names from nginx |
11:45:05 | JustASlacker | looks pretty bad so far |
11:45:46 | JustASlacker | I wonder why I need to split the result I get in my matches array |
11:46:08 | JustASlacker | and Im unclear how I could output that HashSet as json |
11:47:03 | * | Mister_Magister_ is now known as Mister_Magister |
11:47:46 | JustASlacker | actually no, my regex is broken |
11:59:59 | * | fowl joined #nim |
12:04:11 | * | aexoxea quit (Quit: Goodbye!) |
12:10:42 | leorize[m] | @Stuffle: you can try with TableRef |
12:11:05 | * | couven92 joined #nim |
12:12:43 | * | solitudesf joined #nim |
12:12:53 | PMunch | Araq, yeah that's what I was thinking as well |
12:13:06 | FromDiscord | <Stuffe> leorize[m] thank you. I figured it out, I made two versions of the function, one without that instantiated the default argument and called the other |
12:20:02 | * | Vladar joined #nim |
12:20:51 | * | kungtotte quit (Ping timeout: 268 seconds) |
12:24:17 | * | livcd quit (Quit: leaving) |
12:25:18 | * | livcd joined #nim |
12:26:13 | * | tklohna quit (Ping timeout: 265 seconds) |
12:40:24 | * | tklohna joined #nim |
12:51:29 | PMunch | Araq, yeah changing from cast[ptr uint8](cast[int](bitmapData.addr) + 1)[] to cast[array[2, uint8]](bitmapData)[1] made it drop right down to the same size as the C code |
12:52:02 | * | FromGitter quit (Remote host closed the connection) |
12:52:20 | * | FromGitter joined #nim |
12:54:37 | * | tklohna quit (Ping timeout: 240 seconds) |
13:00:38 | * | tklohna joined #nim |
13:02:51 | * | a_b_m joined #nim |
13:06:20 | * | abm quit (Ping timeout: 265 seconds) |
13:06:48 | FromDiscord | <mratsim> Uh, it seems like this websites supports Nim for code-golfing: https://code-golf.io/ |
13:12:02 | PMunch | Hmm, seems a bit broken though.. |
13:12:18 | PMunch | Try this in the Arabic to Roman hole: import os |
13:12:18 | PMunch | echo commandLineParams() |
13:12:30 | PMunch | The first number is missing.. |
13:19:30 | * | endragor quit (Remote host closed the connection) |
13:19:47 | PMunch | Is there a |= and &= equivalent in Nim? |
13:20:25 | madprops | i've never seen those |
13:20:37 | madprops | how would you normally use them? |
13:21:21 | Zevv | setbits |
13:21:24 | Zevv | clearbits |
13:23:09 | Zevv | bitand bitor |
13:23:26 | Zevv | I added those when I had the same question :) |
13:28:20 | FromDiscord | <exelotl> Meanwhile I'm here typing `foo = foo and FLAG` like a scrub |
13:29:03 | FromDiscord | <Stuffe> Zevv It would have been more consistent with `or=` and `and=` |
13:29:07 | PMunch | Zevv, added them where? |
13:32:26 | FromDiscord | <mratsim> or= and= seem veeerrry weird |
13:32:51 | FromDiscord | <Stuffe> But consistent 😉 |
13:33:00 | * | tklohna quit (Ping timeout: 268 seconds) |
13:33:08 | FromDiscord | <Stuffe> Was trying to use them the other day, had they been there I wouldn't have had to look up how to do it |
13:33:18 | PMunch | That was the first thing I tried to do :P |
13:33:20 | PMunch | or= |
13:33:47 | FromDiscord | <Stuffe> In general it would have been cool if any operator, even self defined ones automatically worked with the `=` added |
13:33:56 | FromDiscord | <Stuffe> but yeah, nitpicking |
13:34:11 | PMunch | That would be cool indeed |
13:35:08 | FromDiscord | <Stuffe> is it plausible to do? |
13:37:37 | PMunch | Hmm, I guess |
13:39:01 | Zevv | pmunch: bitops |
13:50:30 | FromGitter | <alehander92> yeah it sounds cool |
13:52:21 | FromGitter | <kaushalmodi_gitlab> woh, this works! |
13:52:24 | FromGitter | <kaushalmodi_gitlab> !eval echo 3.`+`(1).mod(3) |
13:52:27 | NimBot | 1 |
13:52:44 | FromGitter | <kaushalmodi_gitlab> i.e. ``echo 3.`+`(1).mod(3)`` |
14:01:30 | * | a_b_m quit (Quit: Leaving) |
14:03:23 | FromGitter | <alehander92> yepp |
14:04:08 | FromGitter | <kaushalmodi_gitlab> nim has retained a lot of what I love about lisp :) |
14:09:19 | * | fowl quit (Quit: Connection closed for inactivity) |
14:10:07 | PMunch | Of course it works :) |
14:10:23 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
14:10:48 | * | ng0 joined #nim |
14:11:43 | PMunch | Zevv, wait. `bitand` returns an int? |
14:12:06 | PMunch | So what is the difference between `x = x or 0xF0` and `x = bitor(x or 0xF0)` |
14:19:38 | Zevv | nothing - these are not mine btw, I added the setBit/clearBit thingies, I was confusing stuff |
14:19:41 | Zevv | not that it matters |
14:19:47 | Zevv | bitAnd seems to be {.magic.} |
14:22:00 | FromGitter | <kaushalmodi_gitlab> is there something like this in stdlib: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df0fb88c62ef76b444eb23d] |
14:22:13 | FromGitter | <kaushalmodi_gitlab> above works nicely as an enum looper in either direction |
14:23:48 | PMunch | Define "ensure" |
14:25:48 | disruptek | it's like carnation instant breakfast, but with an eye towards meal replacement. |
14:26:30 | FromGitter | <kaushalmodi_gitlab> hehe, I thought about that.. |
14:26:36 | FromGitter | <kaushalmodi_gitlab> enums can be negatives? |
14:26:39 | FromGitter | <alehander92> this is so confusing |
14:26:42 | FromDiscord | <mratsim> bitor == or @Pmunch |
14:26:51 | disruptek | where are my "may ref" refs? |
14:26:51 | FromDiscord | <mratsim> and it's bitor(x, 0xF0) |
14:27:02 | FromGitter | <alehander92> zevv made that issue |
14:27:14 | disruptek | enums cannot be negatives. |
14:27:16 | FromGitter | <alehander92> for checking enums for invalid values on each convertion |
14:27:26 | FromGitter | <alehander92> disruptek they can currently if you do |
14:27:29 | FromGitter | <alehander92> value.Enum |
14:27:37 | FromGitter | <alehander92> iirc |
14:27:42 | disruptek | yeesh. |
14:27:55 | disruptek | that feels like a bug. |
14:28:09 | FromGitter | <alehander92> so zevv opened an issue about that conversion thing |
14:28:11 | FromGitter | <alehander92> yeah |
14:28:15 | FromGitter | <kaushalmodi_gitlab> so the above getNext should "mostly" work? |
14:28:17 | Zevv | alehander92: what issue? Now *I'm* confused :) |
14:28:30 | FromDiscord | <mratsim> @disruptek, enum can be negative |
14:28:47 | FromGitter | <alehander92> https://github.com/nim-lang/Nim/issues/12815 |
14:28:47 | disruptek | but i actually needed negative enums and couldn't make them work. |
14:28:48 | disbot | ➥ No run time checks on illegal values for enum with gaps ; snippet at 12https://play.nim-lang.org/#ix=23C5 |
14:28:49 | FromGitter | <alehander92> i am not sure |
14:28:53 | FromGitter | <alehander92> why is it for gaps |
14:29:00 | FromGitter | <alehander92> but it should be for any enum imo |
14:29:01 | disruptek | what special incantation do i need to make negative enums? |
14:29:14 | FromGitter | <alehander92> huh so it has checks for that? |
14:29:16 | FromGitter | <kaushalmodi_gitlab> in that case, I can change `numVals = T.high.ord + 1` to `numVals = T.high.ord - T.low.ord + 1` |
14:29:23 | FromGitter | <alehander92> maybe i misunderstood sorry |
14:29:33 | FromDiscord | <mratsim> negative enums: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/blis_api.nim#L17-L52 |
14:30:06 | disruptek | this is nuts. i couldn't do this in my git wrapper. |
14:31:09 | FromGitter | <alehander92> maybe the `()` ?? |
14:31:56 | FromGitter | <alehander92> sorry zevv i probably misunderstood the bug yeah |
14:32:25 | PMunch | mratsim, okay so what is that module for? |
14:33:05 | disruptek | all i can think is that i had something misordered. |
14:33:39 | FromGitter | <kaushalmodi_gitlab> above `genNext` here for further playing: https://play.nim-lang.org/#ix=248c |
14:34:15 | FromDiscord | <mratsim> file too large |
14:34:31 | disruptek | noted. |
14:34:52 | FromDiscord | <mratsim> @PMunch it's a wrapper for a linear algebra library |
14:35:22 | FromDiscord | <mratsim> or where you asking for bitops? |
14:35:31 | PMunch | Haha, I was asking for bitops |
14:35:51 | FromGitter | <alehander92> @kaushalmodi_gitlab |
14:35:54 | FromDiscord | <mratsim> countTrailingZero, firstSetBit, countLeadingZero |
14:36:08 | FromGitter | <alehander92> i think this needs something like dependent typing |
14:36:21 | PMunch | Yeah those are fine, but why is there a bitor when we have or? |
14:36:23 | FromGitter | <kaushalmodi_gitlab> update: nevermind I found a serious flaw in that logic :P |
14:36:23 | FromGitter | <alehander92> actually maybe not, but it needs the concept of |
14:36:31 | FromGitter | <alehander92> proving value >= 0 |
14:36:38 | FromGitter | <alehander92> which i am not sure is easily accesible |
14:36:42 | FromGitter | <kaushalmodi_gitlab> @alehander92 Why did you put gitlab after my handle? |
14:36:53 | FromDiscord | <mratsim> because people complained that `or` for bits and or for bool where clashing and it was bad |
14:37:04 | PMunch | Hmm |
14:37:20 | FromGitter | <alehander92> maybe somehow with ranges not sure |
14:37:30 | FromGitter | <alehander92> well thats your username |
14:37:34 | FromGitter | <alehander92> in gitter |
14:37:43 | FromDiscord | <mratsim> in discord as well |
14:37:57 | FromGitter | <alehander92> probably you logged in with gitlab |
14:42:39 | FromGitter | <kaushalmodi_gitlab> heh, I just noticed my own handle.. I am on Gitter. |
14:43:15 | FromGitter | <zacharycarter> @kaushalmodi_gitlab @kaushalmodi_gitlab |
14:43:18 | FromGitter | <zacharycarter> whoops |
14:44:41 | FromGitter | <kaushalmodi> Now signed in with GitHub |
14:44:45 | FromGitter | <kaushalmodi> good, this is better |
14:48:57 | FromGitter | <zacharycarter> I think we have another spammer on the forum - AmbrusFernas |
14:49:03 | FromGitter | <zacharycarter> https://forum.nim-lang.org/t/2770 |
14:50:23 | disruptek | enums with negatives cannot be used as discriminators. |
14:53:34 | FromGitter | <zacharycarter> maybe he / she is not but they keep posting the same three spammy links at the bottom of their posts |
14:58:10 | FromGitter | <kaushalmodi> ok, this works: https://play.nim-lang.org/#ix=248f |
14:58:19 | FromGitter | <kaushalmodi> got `getNext` working with pos/neg enums |
15:00:17 | * | ng0_ joined #nim |
15:02:04 | * | ng0 quit (Ping timeout: 260 seconds) |
15:03:20 | FromDiscord | <mratsim> @zacharycarter, flagged |
15:03:38 | * | sagax quit (Quit: Konversation terminated!) |
15:04:41 | FromGitter | <zacharycarter> thanks mratsim |
15:09:18 | FromDiscord | <funcmike> Hi, why this is possible in Nim: https://play.nim-lang.org/#ix=248A (implicit cast instead of explicit)? |
15:10:36 | * | nsf quit (Quit: WeeChat 2.6) |
15:10:59 | FromDiscord | <mratsim> it's not an implicit cast, you are creating a type alias |
15:11:03 | PMunch | funcmike, because you have defined it as a simple alias |
15:11:20 | PMunch | If you do `type elo = distinct int` then you have a distinct type |
15:11:26 | PMunch | And it has to be explicitly cast |
15:11:37 | * | ng0_ is now known as ng0 |
15:11:45 | FromDiscord | <funcmike> ok thx |
15:13:26 | * | couven92 quit (Read error: Connection reset by peer) |
15:13:42 | * | tklohna joined #nim |
15:23:23 | PMunch | Hmm, how do I create the byte 0b1001_1111 as an actual byte? |
15:23:57 | PMunch | Oh wait.. |
15:24:01 | PMunch | I was just being tired |
15:24:07 | PMunch | I had it as 0x instead of 0x |
15:24:09 | PMunch | 0b* |
15:26:38 | * | JustASlacker quit (Remote host closed the connection) |
15:33:20 | * | PMunch quit (Quit: Leaving) |
15:36:57 | * | dv^_^ quit (Ping timeout: 268 seconds) |
15:43:52 | * | Vladar quit (Quit: Leaving) |
15:48:50 | FromGitter | <kaushalmodi> who's doing advent of code btw? |
15:49:09 | FromGitter | <kaushalmodi> From here, I know zevv and Solitude are doing it, and me |
15:49:30 | FromGitter | <kaushalmodi> let me rephrase: who's doing advent of code *in Nim* |
15:50:02 | FromDiscord | <mratsim> Narimiran is doing it in Ocaml, the traitor :p |
15:50:18 | * | narimiran hides |
15:50:57 | FromGitter | <kaushalmodi> I know! That's why I rephrased |
15:51:06 | disruptek | it's good. ocaml is a good one. |
15:51:07 | FromGitter | <kaushalmodi> :) |
15:53:27 | * | abm joined #nim |
15:55:11 | narimiran | at least i'm not doing it in rust :P |
15:55:24 | disruptek | that would probably be grounds for a ban. |
15:55:31 | narimiran | at minimum. |
15:56:04 | FromGitter | <Willyboar> no ban. Through him in fire :P |
15:56:12 | narimiran | btw, has anybody tried to optimize day10 part 1? |
15:56:24 | disruptek | i changed the bot so now it just messages pmunch with all the playground links. think he'll notice? |
15:57:49 | * | dv^_^ joined #nim |
15:58:32 | FromGitter | <Willyboar> I guess he is |
15:59:01 | FromGitter | <kaushalmodi> narimiran: I get this (I did not do anything special with optimization): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df11245235bd42f97c021b8] |
15:59:21 | FromGitter | <kaushalmodi> what's an "optimized" speed? |
15:59:22 | FromGitter | <kaushalmodi> I just compiled with danger |
15:59:42 | narimiran | that's similar time to my ocaml solution (which proved to be surprisingly fast) |
15:59:59 | narimiran | (the language in general, not my solution in particular) |
16:00:12 | FromGitter | <kaushalmodi> that's good to know :) |
16:00:26 | FromGitter | <kaushalmodi> I think it's just Table doing all the magic in my code |
16:01:00 | FromDiscord | <exelotl> I was doing aoc in nim but then other stuff came up |
16:01:08 | narimiran | if somebody is interested in some quick nim-ocaml speed comparison, here's my AoC 2017 repo with some results at the bottom of the readme: https://github.com/narimiran/AdventOfCode2017 |
16:01:36 | FromDiscord | <michalm> Hi. How I can run execProcess in an async way without blocking whole program. I've created something like that: https://pastebin.com/cS86hg7U but at the end when I am making myFuture.callback= proc() ...sth... it is still waiting untill os process will exit. |
16:01:46 | FromDiscord | <exelotl> Now I'm motivated to continue with GBA stuff (dialogue system etc.) so I'll spend the rest of the month on that instead |
16:02:33 | FromGitter | <kaushalmodi> narimiran: wow you put in quite some time in aoc2017 |
16:02:43 | FromGitter | <kaushalmodi> the analysis is impressive |
16:02:48 | FromGitter | <kaushalmodi> good I am not using Python :) |
16:02:54 | disruptek | michaelm: there's a pretty clear impl of this in golden. |
16:02:57 | disruptek | !repo golden |
16:02:58 | disbot | https://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 15 9⭐ 0🍴 |
16:03:25 | FromGitter | <kaushalmodi> disruptek: Cool! I will have a look |
16:03:30 | FromGitter | <kaushalmodi> have you tried hyperfine? |
16:03:47 | disruptek | what? |
16:04:06 | FromGitter | <kaushalmodi> disruptek: https://github.com/sharkdp/hyperfine |
16:04:26 | disruptek | no, that's cool, thanks. |
16:04:28 | narimiran | kaushalmodi i've done nim+python at the time the tasks were coming out (2 years ago), then i did ocaml one month ago as a preparation for AoC 2019 — those were my first steps in ocaml |
16:04:34 | disruptek | probably some good ideas here. |
16:04:51 | FromGitter | <kaushalmodi> disruptek: that's how I got the results above (https://gitter.im/nim-lang/Nim?at=5df11245235bd42f97c021b8) |
16:05:56 | * | tklohna quit (Ping timeout: 268 seconds) |
16:06:11 | disruptek | the idea of golden is that we'll store all the data and then use it to roll between different git trees to identify regressions in your codebase. |
16:06:27 | disruptek | it's not finished. |
16:08:03 | FromGitter | <kaushalmodi> disruptek: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df11463c62ef76b444eb2db] |
16:08:12 | FromGitter | <kaushalmodi> git protocol is blocked at work (no idea why) |
16:08:20 | FromGitter | <kaushalmodi> can you change the url to https? |
16:08:35 | FromGitter | <kaushalmodi> I got above when doing nimble install golden |
16:08:47 | disruptek | gah nimble is dumb as a sack of hammers. |
16:09:15 | disruptek | btw, i wish you'd try nimph. give me some feedback. |
16:10:25 | FromGitter | <kaushalmodi> I do have to check that out, will do soon |
16:10:37 | FromGitter | <kaushalmodi> btw that error has to do with the network restriction at work |
16:10:51 | FromGitter | <kaushalmodi> you'll need to change the url to https from git in the packages.json |
16:11:05 | disruptek | really? because it looks like it merely cannot grok it. |
16:11:25 | FromGitter | <kaushalmodi> because.. even after I manually install cutelog, the installation of golden fails with the same error |
16:11:27 | disruptek | try golden now. it was a req in bump, which i also updated. |
16:11:47 | FromGitter | <kaushalmodi> ok, git cloning golden to do local install |
16:12:34 | disruptek | this is a good tip in any event. we have to be careful not to specify reqs using git. |
16:12:38 | FromGitter | <kaushalmodi> ok, seems like nimble install now works |
16:12:43 | FromGitter | <kaushalmodi> I see it fetching https url |
16:12:50 | disruptek | yep, it should be fine. |
16:13:17 | FromGitter | <kaushalmodi> argh, now this: |
16:13:24 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df115a4c428267e21598368] |
16:13:34 | FromGitter | <kaushalmodi> "wanted 0.2.9 got 0.3.0." really? |
16:13:58 | disruptek | i know. i asked him to cut a release to fix this. |
16:14:19 | disruptek | people just refuse to tag stuff. it's infuriating. i think i actually forked his package so i could tag it. |
16:14:32 | disruptek | yep, i did. what does that tell you? it's absurd. |
16:15:05 | FromGitter | <kaushalmodi> somewhere the dep is probably looking for the exact version instead of `>=` |
16:15:20 | disruptek | of course it is. because i haven't tested it with 0.3.0. |
16:15:32 | FromGitter | <kaushalmodi> https://github.com/disruptek/golden/blob/647f8ff0819812674c72d450db36660cfac17f95/golden.nimble#L11 |
16:15:45 | disruptek | right, i did it intentionally. |
16:15:51 | disruptek | but what choice do i have? |
16:16:07 | disruptek | the fault is with the maintainer who refuses to tag the package. |
16:16:18 | FromGitter | <kaushalmodi> so the msgpack4nim hasn't released 0.2.9? |
16:16:25 | disruptek | right. |
16:16:32 | FromGitter | <kaushalmodi> you can replace the package name with url to your fork in the .nimble |
16:16:33 | disruptek | they just need to tag it. |
16:17:01 | disruptek | i know; i just haven't done it yet. my fork is tagged as 0.3.1 and i want to test 0.3.0. |
16:18:09 | FromGitter | <kaushalmodi> Magit (easy) makes tagging so easy.. just these bindings: `t t "tag name" P T` done |
16:18:22 | disruptek | !repo bump |
16:18:23 | disbot | https://github.com/disruptek/bump -- 9bump: 11a tiny tool to bump nimble versions 🍻 15 7⭐ 1🍴 7& 1 more... |
16:18:23 | FromGitter | <kaushalmodi> heh, I meant to type Magit (emacs) |
16:18:36 | FromGitter | <kaushalmodi> that too! I need to try |
16:18:43 | FromGitter | <kaushalmodi> ok, got to sign off for now |
16:18:47 | disruptek | yeah, i sometimes use Magit for commits of individual hunks in vim. |
16:18:52 | FromGitter | <kaushalmodi> I'll try out golden later today |
16:18:57 | disruptek | thanks, boss. |
16:20:48 | FromDiscord | <yewpad> I'm currently in process of configuring a project and I just wanted to know what you guys prefer as max line length for Nim files. I heard that 80 is mostly used in the standard lib |
16:20:59 | disruptek | yep. |
16:22:50 | * | fireglow joined #nim |
16:37:12 | * | tiorock joined #nim |
16:37:12 | * | tiorock quit (Changing host) |
16:37:12 | * | tiorock joined #nim |
16:37:12 | * | rockcavera quit (Killed (sinisalo.freenode.net (Nickname regained by services))) |
16:37:12 | * | tiorock is now known as rockcavera |
16:38:01 | FromGitter | <kaushalmodi> disruptek: golden now installs fine |
16:38:23 | disruptek | thanks, yeah, i pointed it to a special #golden tag in my fork. |
16:38:46 | disruptek | but i appreciate you adding to that ticket. ;-) |
16:39:17 | FromGitter | <kaushalmodi> few requests ⏎ ⏎ 1) Option to do run-only (like you already have compile-only). That will allow me to profile just `./day10 "part1"` etc ⏎ 2) print time in human readable units like ms, ns, etc [https://gitter.im/nim-lang/Nim?at=5df11bb555f95737829940df] |
16:39:30 | * | dddddd joined #nim |
16:39:48 | disruptek | it does 1; just pass it a binary instead. |
16:39:53 | * | tiorock joined #nim |
16:40:40 | disruptek | yeah, we should humanize numbers. |
16:40:45 | FromGitter | <kaushalmodi> this does not work - `golden -i=3 './day10 "part1"'` |
16:41:04 | disruptek | golden -i=3 -- ./day10 part1 |
16:41:11 | disruptek | i think that's the syntax. |
16:41:38 | disruptek | golden -i=3 ./day10 -- part1 |
16:42:13 | disruptek | it'll be hashing that day10 file and stuff, so it needs to know. |
16:42:40 | FromGitter | <kaushalmodi> passing the binary args after `--` worked. thanks |
16:42:48 | * | rockcavera quit (Ping timeout: 252 seconds) |
16:43:00 | disruptek | that was actually kinda hard to do in cligen, relatively speaking. |
16:43:15 | * | rockcavera joined #nim |
16:43:15 | * | rockcavera quit (Changing host) |
16:43:15 | * | rockcavera joined #nim |
16:44:20 | FromGitter | <kaushalmodi> yeah.. |
16:45:00 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/xIJY/image.png) |
16:45:22 | * | tiorock quit (Ping timeout: 252 seconds) |
16:45:50 | disruptek | seems like we're a little more efficient. |
16:46:32 | disruptek | are you on linux? |
16:46:53 | FromGitter | <kaushalmodi> yes |
16:47:04 | FromGitter | <kaushalmodi> can I have just one final table of min/max/mean? |
16:47:08 | disruptek | if you can run kitty, you can play with the graphs-in-console. |
16:47:19 | disruptek | !repo kitty |
16:47:20 | FromGitter | <kaushalmodi> the 0s times are usually not useful |
16:47:21 | disbot | https://github.com/kovidgoyal/kitty -- 9kitty: 11A cross-platform, fast, feature full, GPU based terminal emulator 15 8001⭐ 371🍴 7& 29 more... |
16:47:57 | FromGitter | <kaushalmodi> ok, it's tempting, but I really need to get back to work stuff :) |
16:48:00 | disruptek | i made a ticket for humanizing. |
16:48:15 | FromGitter | <kaushalmodi> *I should have done that instead of pinging here* Thanks! |
16:48:23 | disruptek | !search humanize numbers |
16:48:24 | disbot | https://github.com/disruptek/golden/issues/16 -- 3humanize numbers with units 7& 1 more... |
16:48:31 | disruptek | thanks for playing with golden. |
16:49:16 | disruptek | you get a final table, always, but if you want it briefer, we can add that. |
16:51:49 | * | tiorock joined #nim |
16:51:49 | * | rockcavera is now known as Guest55834 |
16:51:49 | * | tiorock quit (Changing host) |
16:51:49 | * | tiorock joined #nim |
16:51:49 | * | Guest55834 quit (Killed (cherryh.freenode.net (Nickname regained by services))) |
16:51:49 | * | tiorock is now known as rockcavera |
16:54:57 | Araq | so ... turns out the cycle collector had yet another silly bug... |
16:56:25 | Araq | but now the one and only test case that matters is green |
16:56:55 | Araq | quite impressive given that I personally don't really understand the involved topology |
16:57:43 | disruptek | computers ftw |
16:58:14 | Araq | this Lins guy is a mad genius |
16:58:40 | Araq | "The two decade long research path followed by the |
16:58:40 | Araq | author was fundamental to arrive at the new algorithm..." |
16:59:45 | * | tiorock joined #nim |
17:02:41 | * | rockcavera quit (Ping timeout: 265 seconds) |
17:02:54 | disruptek | i really need devel dependencies in my package manager. |
17:03:14 | * | rockcavera joined #nim |
17:03:14 | * | rockcavera quit (Changing host) |
17:03:14 | * | rockcavera joined #nim |
17:04:37 | FromDiscord | <mratsim> Disruptek benchmark are melting and vaporizing CPUs: https://github.com/disruptek/golden/blob/master/src/golden/fsm.nim#L82-L84 |
17:04:54 | disruptek | i know, right? |
17:05:18 | disruptek | i actually found the source to that fsm recently. i should credit it. |
17:07:02 | * | tiorock quit (Ping timeout: 265 seconds) |
17:09:01 | FromDiscord | <mratsim> I need a code generated state machine without any heap memory for my runtime |
17:09:34 | * | LyndsySimon quit () |
17:09:59 | * | LyndsySimon joined #nim |
17:13:10 | disruptek | the problem is, without a devel requirement, nimph doesn't attempt to add --path statements for dependencies, local or not. should it just add anything it finds that is local to the project? |
17:13:26 | disruptek | or should we add the concept of devel dependencies? |
17:13:56 | disruptek | i think the 2nd option is more conceptually pure. |
17:14:15 | * | ponyride1 quit (Read error: Connection reset by peer) |
17:14:21 | * | krux02 quit (Remote host closed the connection) |
17:15:20 | * | d10n-work quit () |
17:16:09 | * | d10n-work joined #nim |
17:17:13 | * | NimBot joined #nim |
17:19:58 | * | nsf joined #nim |
17:23:48 | * | npgm quit () |
17:24:15 | * | npgm joined #nim |
17:24:56 | * | narimiran quit (Ping timeout: 240 seconds) |
17:26:28 | * | tiorock joined #nim |
17:26:29 | * | rockcavera quit (Killed (card.freenode.net (Nickname regained by services))) |
17:26:29 | * | tiorock is now known as rockcavera |
17:26:29 | * | rockcavera quit (Changing host) |
17:26:29 | * | rockcavera joined #nim |
17:28:35 | rayman22201 | I vote devel dependencies. npm does it that way and I like that feature. |
17:40:36 | lqdev[m] | is there a way of determining if a proc {.raises.} in a macro, without having to recursively walk all of the called procs' implementations and seeing if they raise? |
17:41:29 | disruptek | i have the same question wrt tags in general. |
17:42:16 | * | dddddd quit (Ping timeout: 240 seconds) |
17:45:11 | * | Jjp137 quit (Quit: Leaving) |
17:45:19 | * | Jjp137 joined #nim |
17:53:50 | * | nsf quit (Quit: WeeChat 2.6) |
17:54:46 | * | dddddd joined #nim |
18:00:01 | * | sagax joined #nim |
18:01:03 | * | rockcavera quit (Remote host closed the connection) |
18:01:36 | disruptek | procs need to be in global scope to be passed to ffi calls? |
18:25:46 | FromDiscord | <mratsim> they just need exportc afaik |
18:43:55 | lqdev[m] | oh man, what a release. https://github.com/liquid600pgm/euwren/releases/tag/0.8.0 |
18:44:10 | lqdev[m] | disruptek: how do you like my new test suite? ;) |
18:44:38 | disruptek | let's see... |
18:45:09 | disruptek | neat. i bet you have some ideas on how to simplify it. |
18:45:32 | lqdev[m] | not really. |
18:45:49 | disruptek | you might want to see if you can parallelize it with unittest2. |
18:45:58 | disruptek | !repo unittest2 |
18:46:01 | disbot | https://github.com/nose-devs/nose2 -- 9nose2: 11The successor to nose, based on unittest2 15 595⭐ 128🍴 7& 29 more... |
18:46:05 | lqdev[m] | hmm, let's see |
18:46:12 | disruptek | i don't think that's the right repo. |
18:46:18 | disruptek | !repo nim-unittest2 |
18:46:20 | disbot | https://github.com/stefantalpalaru/nim-unittest2 -- 9nim-unittest2: 11fork of the "unittest" Nim module, focused on parallel test execution 15 2⭐ 0🍴 |
18:47:35 | federico3 | another 2? |
18:48:31 | FromDiscord | <exelotl> "nim-unittest2" 2 |
18:48:47 | disruptek | deuce, part deux. |
18:49:53 | lqdev[m] | I might stick to stdlib unittest for the time being, and switch to this if tests take a horribly long time to execute. |
18:50:12 | lqdev[m] | s/take/start taking/ |
18:50:28 | disruptek | the main reason to switch is that the powers that He are currently rather negative on continued unittest support in the stdlib. |
18:51:18 | * | kungtotte joined #nim |
18:52:33 | lqdev[m] | but this repo was updated about half a year ago, that's why I'm worried about switching |
18:52:54 | disruptek | you and me, buddy, we can maintain it. |
18:53:02 | disruptek | nimph fork unittest2 |
18:54:26 | lqdev[m] | sounds like an idea. let's make a unittest3 ;) |
18:57:39 | FromDiscord | <mratsim> just ping @stefantalpalaru. We are considering switching away from unittest for tsting Nimbus |
18:58:23 | disruptek | the only problem i have with unittest is that it hides logging output, presumably stderr. |
18:58:38 | disruptek | mratsim: what do you dislike about it? |
18:59:08 | stefantalpalaru | We are already using nim-unittest2 in https://github.com/status-im/nimbus/ but with parallelism disabled, due to bugs in threadpool. |
18:59:32 | disruptek | oh, so you're switching from unittest to unittest2. |
19:00:15 | disruptek | why not move unittest2 threadpool to yuri's? |
19:00:26 | disruptek | seems unlikely that you're using stdlib threadpool anywhere. |
19:01:01 | stefantalpalaru | I have not given up fixing the stdlib one. |
19:04:31 | stefantalpalaru | Dynamic pool size changes complicate things, but it must be possible to fix it without changing the API. |
19:07:20 | disruptek | fair enough. |
19:13:05 | * | nsf joined #nim |
19:14:52 | planetis[m] | mratsim: hi, take a look at https://github.com/b3liever/macromachining/blob/master/macromachining.nim might be useful |
19:15:00 | * | liam_ joined #nim |
19:17:04 | liam_ | sashlick: Any luck with getting the new OpenSSL wrappers working? |
19:18:09 | federico3 | uh? |
19:18:26 | * | rockcavera joined #nim |
19:26:29 | lqdev[m] | how do you print an exception's stack trace to a string? |
19:26:53 | lqdev[m] | ah, there's `getStackTrace()`. |
19:27:08 | * | tane joined #nim |
19:27:44 | * | clyybber joined #nim |
19:28:25 | * | clyybber quit (Client Quit) |
19:29:04 | * | liam__ joined #nim |
19:29:28 | * | ng0 quit (Ping timeout: 260 seconds) |
19:31:11 | FromDiscord | <Clyybber> @mratsim FYI you shouldnt need to workaround the enum-atomics bug anymore, its fixed in devel |
19:31:38 | FromDiscord | <mratsim> ah yes, thanks for the reminder |
19:31:53 | * | liam_ quit (Ping timeout: 276 seconds) |
19:37:37 | Araq | clyybber: one line and the nice async_prototype works with the cycle collector |
19:40:22 | Araq | hamming.nim still leaks memory though |
19:41:54 | FromDiscord | <Clyybber> Araq: Awesome! |
19:42:54 | * | ng0 joined #nim |
19:43:06 | Araq | thavlak also leaks :-( |
19:45:20 | * | nsf quit (Quit: WeeChat 2.6) |
19:46:29 | rayman22201 | 🎉 |
19:48:38 | Araq | oh wait |
19:48:49 | Araq | it keeps stuff alive, no wonder it leaks |
19:52:50 | Araq | leaks 36MB |
20:13:32 | * | nif left #nim ("Leaving") |
20:20:37 | disruptek | no one will miss 36mb. |
20:21:15 | disruptek | tell them i'll email them an extra 36mb if they need it. |
20:34:35 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
20:34:40 | FromDiscord | <mratsim> @Clyybber, I managed to fix my deadlock, I don't know what I did, I just uncommented everything I stashed before and voilà, it works ... |
20:34:55 | * | krux02 joined #nim |
20:37:28 | * | ng0 joined #nim |
20:38:16 | lqdev[m] | disruptek: how would you mail someone 0.0045 B though |
20:39:09 | disruptek | i'd cut it up with a very small knife. |
20:41:03 | lqdev[m] | sounds like an idea. I think a laser cutter with a very fine resolution would be a better idea. after all, it has better resolution than your hand. (unless you're a robot) |
20:41:45 | disruptek | assume nothing. |
20:41:50 | FromDiscord | <Clyybber> @mratsim nice |
20:44:02 | FromDiscord | <Clyybber> disruptek: sending ram and prayers your way 🚾 |
20:45:11 | disruptek | robots don't need prayer. |
20:45:33 | FromDiscord | <mratsim> they need robots.txt |
21:02:51 | lqdev[m] | how can you check if the build is a debug build? `defined(debug)` doesn't seem to work. |
21:03:26 | disruptek | check that release/danger are not defined. |
21:03:48 | lqdev[m] | I thought so, but I also thought that maybe there's some shortcut |
21:05:53 | * | Kaynatwo joined #nim |
21:06:54 | * | Kanato joined #nim |
21:09:16 | * | Kaynato quit (Ping timeout: 240 seconds) |
21:10:38 | * | Kaynatwo quit (Ping timeout: 265 seconds) |
21:17:23 | * | narimiran joined #nim |
21:19:47 | * | liam__ quit (Quit: Leaving) |
21:21:05 | FromDiscord | <mratsim> ah, defined debug doesn't work? |
21:21:54 | FromGitter | <kaushalmodi> hmm, I have been using `when defined(debug)` to mask debug echoes :P |
21:22:09 | FromGitter | <kaushalmodi> I compile with `-d:debug` to show more verbose echoes |
21:22:34 | FromGitter | <kaushalmodi> .. so it works with `-d:danger -d:debug` too |
21:27:26 | * | tane quit (Quit: Leaving) |
21:35:30 | lqdev[m] | all right. I'm done for now https://github.com/liquid600pgm/euwren/releases |
21:35:36 | lqdev[m] | I'll be working on my game, then |
21:37:49 | * | krux02 quit (Remote host closed the connection) |
21:44:21 | FromGitter | <kaushalmodi> Can I derive a const Table value based off another const Table at compile time? |
21:45:44 | FromGitter | <kaushalmodi> I have this code to populate a table variable, but it's essentially a const, but how can I populate it at compile time: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df163880dc628523e1c5bc0] |
21:49:52 | disruptek | do you see software in 1d, 2d, 3d, or more? |
21:50:45 | FromGitter | <phillvancejr> hello. How can I subclass a C++ object? I'm working with the wxWidgets bindings and want to subclass one of the controls |
21:50:55 | * | narimiran quit (Quit: leaving) |
21:51:15 | disruptek | kaushalmodi: you could init a new table from a retrieval of all values in the old. |
21:55:14 | FromGitter | <kaushalmodi> I didn't quite understand.. the new table is populating fine.. but it's happening at run time |
21:55:29 | FromGitter | <kaushalmodi> I would like to know if the above can happen at compile time |
21:56:00 | disruptek | i think i do this with a .compileTime proc. |
22:01:44 | Araq | phillvancejr: object of Superclass |
22:02:19 | FromDiscord | <Clyybber> Araq: So thavlak leaks because we check the memory before the destroy calls? |
22:02:32 | Araq | what? |
22:02:39 | FromDiscord | <Clyybber> Or why does it leak? |
22:02:54 | Araq | I don't know, sometimes I stop working and watch TV |
22:03:01 | disruptek | gtfo |
22:03:14 | FromGitter | <kaushalmodi> disruptek: Thanks! This works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df167a2e72656230129ed44] |
22:03:20 | FromDiscord | <Clyybber> Araq: Ah, I thought you knew why :p |
22:03:45 | FromDiscord | <Clyybber> "it keeps stuff alive, no wonder it leaks" |
22:04:32 | Araq | ah that |
22:04:36 | disruptek | kaushalmodi: yeah, if you have to do logic, you probably need a proc. but you could pass all the items to a new construction of the table otherwise. |
22:04:39 | Araq | that was caused by globals |
22:04:49 | Araq | but I moved it inside a main and yet it still leaks |
22:05:08 | disruptek | i'm not sure that was caused by globals. |
22:05:18 | FromDiscord | <Clyybber> Araq: Ah ok. |
22:08:12 | disruptek | 14 new aws apis added 🎉 |
22:10:54 | FromDiscord | <Clyybber> 🦀 |
22:14:06 | * | ltriant joined #nim |
22:14:35 | Araq | at least ARC still kicks ass for gcbench on my machines |
22:29:21 | FromDiscord | <yewpad> Is there a way to intercept write/writeLine/echo calls? |
22:38:30 | FromDiscord | <Clyybber> null terminated strings are dumb IMO, but this is a nice trick: https://youtu.be/kPR8h4-qZdk?t=541 |
22:42:59 | FromDiscord | <yewpad> Do I have really have to come up with a unique name? I really love the stake at not having name shadowing but this is just... |
22:42:59 | FromDiscord | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/654453101767426049/unknown.png |
22:43:29 | FromDiscord | <yewpad> That's just unnecessary work for me to think of a new term |
22:43:42 | disruptek | i'll think of one for you. |
22:43:46 | disruptek | how about `goatse`? |
22:43:53 | FromDiscord | <yewpad> hahahahahahhaha |
22:44:56 | FromDiscord | <yewpad> @Araq: whhhyyyyyyyyy?? |
22:44:56 | FromDiscord | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/654453591557537814/unknown.png |
22:46:36 | FromDiscord | <Clyybber> ? |
22:47:14 | FromDiscord | <yewpad> ok nvm, the second one was my fault by not making the type public |
22:47:40 | FromDiscord | <yewpad> but i'd really like to name it `var terminal` and not `var term` |
22:48:19 | disruptek | go ahead. |
22:48:35 | FromDiscord | <yewpad> |
22:48:35 | FromDiscord | <yewpad> https://cdn.discordapp.com/attachments/371759389889003532/654454510592196659/unknown.png |
22:58:29 | * | solitudesf quit (Ping timeout: 268 seconds) |
23:36:52 | FromDiscord | <mratsim> naming your variable the same name as a module is a recipe for headscratching bug |
23:36:59 | FromDiscord | <mratsim> the error messages get really bad |
23:37:06 | disruptek | oh c'mon, it's fun! |
23:37:42 | * | leorize joined #nim |
23:50:35 | * | lritter quit (Quit: Leaving) |
23:55:15 | FromGitter | <phillvancejr> Hello, I ran the scripts/convert file in the wxWidgets bindings to convert some additional headers and got a bunch of errors. I added all the headers from my wxwidgets include directory into the bindings headers hoping it would also compile them. It did compile a lot of them but many of them failed. Should I be passing wx-config to the convert script? I know this is an older library but if anyone has any ideas |
23:55:15 | FromGitter | ... it would be awesome! thanks |