00:35:22 | FromGitter | <Milerius> Hey, everyone is sleeping ? :p |
00:35:50 | * | pbb joined #nim |
00:37:00 | * | Hideki_ joined #nim |
00:39:02 | * | seni quit (Quit: Leaving) |
00:39:34 | * | sknebel quit (*.net *.split) |
00:39:47 | * | sknebel joined #nim |
00:44:53 | shashlick | Ya is midnight for many |
00:44:56 | FromDiscord | <Fern & Simula (They/Them)> Yes |
00:45:00 | * | Hideki_ quit (Remote host closed the connection) |
00:45:03 | shashlick | But still some folks on here |
00:46:57 | * | Hideki_ joined #nim |
00:51:35 | * | Hideki_ quit (Ping timeout: 265 seconds) |
00:52:09 | blackbeard420 | only 19:52 here |
01:06:24 | * | icebattle quit (Ping timeout: 246 seconds) |
01:09:20 | * | Tanger joined #nim |
01:27:18 | * | leorize joined #nim |
01:32:46 | disruptek | #12818 |
01:32:48 | disbot | https://github.com/nim-lang/Nim/issues/12818 -- 3inheritance and generics and ambiguous error message ; snippet at 12https://play.nim-lang.org/#ix=24K1 |
01:56:27 | FromGitter | <gogolxdong> @disruptek /mnt/d/nimph/src/nimph/git.nim(706, 16) Error: undeclared identifier: 'git_clone_options_init' |
01:56:37 | disruptek | you need a newer libgit2. |
01:56:47 | FromGitter | <gogolxdong> how to |
01:56:48 | disruptek | (ie. master) |
01:57:05 | disruptek | see the src/nimph.nim.cfg |
01:57:06 | FromDiscord | <exelotl> wow it's super cool that you can do newLit(object) |
01:57:33 | disruptek | --define:git2SetVer:"master" |
01:57:43 | FromGitter | <gogolxdong> --define:git2SetVer:"master" |
01:58:02 | FromGitter | <gogolxdong> It is. |
01:58:12 | disruptek | hmm, you're right. |
01:58:20 | disruptek | and actually, i have a `when` in there to handle that. |
01:58:28 | disruptek | what os is this? |
01:59:11 | FromGitter | <gogolxdong> WSL ubuntu18.04 |
02:00:01 | disruptek | shashlick just added ci to nimph and it tests on windows, and i test on linux. but we don't test on wsl. |
02:00:30 | disruptek | did you use the bootstrap.sh? |
02:01:00 | FromGitter | <gogolxdong> I tried nimble install and ./bootstrap.sh both. |
02:01:25 | disruptek | you get the same error when you run the bootstrap, right? |
02:01:33 | FromGitter | <gogolxdong> yes. |
02:01:56 | disruptek | and you also have --define:git2Git in that file, right? |
02:02:00 | disruptek | in the nimph.nim.cfg? |
02:02:13 | FromGitter | <gogolxdong> yes, I have. |
02:02:36 | disruptek | can i see the rest of the output? |
02:02:54 | disruptek | it feels like it's not linking correctly, but i don't know why that would be. |
02:03:27 | disruptek | maybe because nimterop stores the .so in a .cache and wsl is puking on that? |
02:03:53 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=24K7 |
02:04:20 | FromGitter | <gogolxdong> How do you handle nimgit2? |
02:04:53 | * | lkw quit (Ping timeout: 245 seconds) |
02:04:58 | disruptek | nimterop does its magic. |
02:06:19 | disruptek | this is nim-1.0.4? |
02:06:22 | FromDiscord | <Rika> Does the bridge support images? |
02:06:23 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/656678612790935562/Screenshot_20191218-110554.jpg |
02:06:28 | FromGitter | <gogolxdong> latest devel |
02:06:33 | FromDiscord | <Rika> https://dev.to/zaiste/programming-languages-to-learn-in-2020-to-boost-your-career-as-a-software-developer-56ll |
02:06:33 | FromDiscord | <Rika> |
02:06:33 | FromDiscord | <Rika> Found an article talking about Nim |
02:07:59 | disruptek | can i see the output from the bootstrap? |
02:09:03 | * | lkw joined #nim |
02:10:17 | FromGitter | <gogolxdong> the same when I paste to playground. |
02:10:19 | disruptek | 0.4.2 passed windows ci and it just uses nimble for installation. |
02:10:47 | FromGitter | <gogolxdong> nimterop building failed on Windows btw. |
02:10:59 | disruptek | ah, well that's a problem. |
02:11:03 | FromGitter | <gogolxdong> ` Error: unhandled exception: cannot open: C:\Users\lxdon\nimcache\nimterop\nimterop\treesitter_c\src\api.h [IOError]` |
02:12:01 | disruptek | your error message from nimph compilation seemed to suggest that you have a libgit2 library, though. |
02:12:08 | disruptek | did you build that with nimterop? |
02:14:06 | FromGitter | <gogolxdong> built once with nimterop in WSL. |
02:14:42 | FromGitter | <gogolxdong> Just got the debug output of git2.h . |
02:15:16 | disruptek | oh, you built nimgit2 once. |
02:15:54 | disruptek | my guess is that you build a 0.28.3 version, which is the default for nimgit2 iirc. |
02:16:09 | disruptek | but you'll need to build a master for nimph. |
02:16:35 | FromGitter | <gogolxdong> What to do next? |
02:16:52 | disruptek | you have to get nimterop building. try installing 0.3.3. that one was very stable. |
02:17:21 | disruptek | then you should be able to build nimph and it'll build a new libgit2 so and link correctly. |
02:17:33 | FromGitter | <gogolxdong> WSL nimteop works, failed on Windows. |
02:17:42 | disruptek | make sure you remove any nimterop-0.3.5. |
02:19:16 | * | MightyJoe quit (Ping timeout: 248 seconds) |
02:19:50 | * | cyraxjoe joined #nim |
02:19:55 | shashlick | Is 0.3.5 broken? |
02:20:14 | disruptek | he's having trouble with it on wsl/ubuntu. |
02:20:53 | shashlick | I see, don't have that to try |
02:21:00 | shashlick | Ubuntu proper works though |
02:21:52 | shashlick | Can you isolate - git clone and run nimble test just for nimterop |
02:22:18 | FromGitter | <gogolxdong> which version |
02:23:06 | shashlick | Latest |
02:26:55 | disruptek | we're gonna have to add a lib target somehow so we can localdeps nimgit2; that's really the source of the problem here. |
02:26:55 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=24Ka |
02:28:49 | shashlick | Do you have git, curl, wget? |
02:29:25 | FromGitter | <gogolxdong> yes |
02:34:00 | disruptek | nimph-0.4.3 (now) builds with 0.28.3, so that might solve part of the problem. |
02:35:38 | disruptek | but, lockfiles won't work. it'll explain that you need a newer libgit2... |
02:36:19 | disruptek | also tagging. ๐ข |
02:37:45 | FromGitter | <gogolxdong> --define:git2SetVer:"v0.28.3" results the same. I didn't see how nimph use nimterop to get git_checkout_options_init identifier , as nimgit2.nim seems only get what's included in git2.h. |
02:38:27 | disruptek | i thought you have a 0.28.3 libgit2? |
02:39:45 | shashlick | disruptek: why not always download libgit2 yourself instead of searching the standard path |
02:39:59 | disruptek | i do. |
02:40:14 | shashlick | ya just saw your cfg |
02:40:20 | disruptek | gogolxdong was able to build it only once, so i just thought maybe i could get him running with it. |
02:42:24 | FromGitter | <gogolxdong> nimgit2 downloaded 0.28.3 to /root/.cache/nim/nimterop/nimgit2/ |
02:43:03 | * | abm quit (Read error: Connection reset by peer) |
02:43:25 | FromGitter | <gogolxdong> I think 0.28.3 has no difference with master regarding git_checkout_options_init identifier. |
02:43:52 | disruptek | it does. it's git_checkout_init_options in one and git_checkout_options_init in the other. |
02:44:35 | FromGitter | <gogolxdong> ok, I cloned master to another directory. |
02:45:09 | FromGitter | <gogolxdong> Am I supposed to replace 0.28.3 with it under /root/.cache/nim/nimterop/nimgit2/? |
02:46:45 | shashlick | okay i still don't have enough info to debug any nimterop stuff here |
02:47:58 | * | leorize quit (Quit: WeeChat 2.6) |
02:48:29 | disruptek | well, i'm pushing another change to support 0.28.4 and to merely warn (instead of crashing) when you have an old libgit2. |
02:49:48 | disruptek | can we see more of the nimterop test failure? |
02:53:52 | shashlick | anyone wanting to setup travis CI for your nim package across win/lin/osx and multiple nim versions, check https://gist.github.com/genotrance/fb53504a4fba88bc5201d3783df5c522 |
02:58:09 | * | leorize joined #nim |
03:08:39 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=24Kg build failed for 0.4.3 nimph |
03:09:46 | disruptek | you'll have to tell it that you want libgit-0.28.3 to try to use the 0.28.3 lib you have. |
03:10:08 | disruptek | for some reason, your git cannot checkout stuff. |
03:10:14 | disruptek | are you behind the great firewall? |
03:10:21 | FromGitter | <gogolxdong> I'm using master, is it right |
03:10:36 | FromGitter | <gogolxdong> git works |
03:11:03 | disruptek | that error is saying that it cannot git pull. |
03:11:20 | disruptek | but, you can skip all that and use the nimgit lib you built if you tell nimph you want 0.28.3. |
03:11:27 | disruptek | in nimph.nim.cfg |
03:12:20 | disruptek | that might help you get a working setup from which you can build a master libgit2 and then build a fully-working nimph. |
03:15:44 | FromGitter | <gogolxdong> That might be out of timeout while cloning, but I cannot see more details. |
03:15:59 | disruptek | it looks like a directory issue. |
03:16:14 | disruptek | permissions, maybe? |
03:17:02 | * | adelrune joined #nim |
03:18:58 | sealmove | is "index out of bound" a catchable exception? |
03:19:20 | disruptek | welcome to the debate. |
03:19:26 | aeverr[m] | What |
03:19:28 | adelrune | Hi ! Can any one of you point me to some information on the current state of list comprehension in nim ? All the information I'm finding is either outdate or very vague. I know the compiler is telling me that lc is deprecated and I found a reddit thread about for expressions but I can't find anything in the documentation. Thanks ! |
03:19:33 | aeverr[m] | I don't get why it wouldn't |
03:20:00 | aeverr[m] | Lc was removed from the standard library as far as I know |
03:20:15 | FromGitter | <gogolxdong> ah, it's permissions , lastest nimph works with lastes nimgit2 and latest libgit2 |
03:20:18 | disruptek | !rfc defect tracked |
03:20:18 | disbot | https://github.com/nim-lang/RFCs/issues/77 -- 3[RFC] Exceptions that inherit from `system.Defect` should not be tracked |
03:20:25 | disruptek | !issue defect |
03:20:26 | disbot | https://github.com/nim-lang/Nim/issues/12862 -- 3The Defect exceptions are not consistently tracked 7& 13 more... |
03:20:37 | disruptek | gogolxdong: yay! |
03:20:50 | aeverr[m] | adelrune, https://github.com/nim-lang/graveyard |
03:21:02 | disruptek | lc should be in a nimble package now. |
03:21:27 | disruptek | !package comprehension |
03:21:27 | disbot | https://github.com/nim-lang/graveyard/tree/master/lc -- 9list_comprehension: 11List comprehension, for creating sequences. |
03:21:34 | sealmove | disruptek: I am running a unittest file with many tests. some throw exception and because of this the remaining tests don't run :( what can I do? try ... except obviously doesn't work... |
03:21:47 | disruptek | disbot: there's really nothing you can't do, amiright? |
03:21:48 | disbot | yep. ๐ |
03:22:21 | FromGitter | <gogolxdong> I kind of get the point of nimph, you are using git2 protocols to maintain versions, right? |
03:22:22 | disruptek | there are mechanisms to test for exceptions in unittest. |
03:22:26 | adelrune | so the answer is "it was removed but you can import it from the graveyard" ? |
03:22:44 | disruptek | gogolxdong: that's one feature, yes. |
03:23:35 | disruptek | it's awesome to be able to `nimph clone foo` and then decide to fix foo: `nimph fork foo; cd (nimph path foo); echo fix > foo.nim; git push` |
03:23:53 | sealmove | adelrune: https://github.com/alehander92/comprehension, https://github.com/b3liever/comprehension |
03:24:17 | disruptek | that's pretty comprehensive. |
03:24:39 | adelrune | ok, I'll try that, thanks |
03:24:40 | FromGitter | <gogolxdong> Very close to what I'm trying to do, to improve git2 protocol in Nim. Do you know how to translate git2 into Nim as a whole? |
03:24:42 | * | adelrune left #nim (#nim) |
03:25:04 | disruptek | why do you want to do that? for git-inside-javascript? |
03:25:56 | FromGitter | <gogolxdong> One reason is QUIC, another is to improve Merkle DAG. |
03:26:59 | disruptek | it feels like a poor return on investment, but the code is pretty modern. have you tried c2nim? |
03:27:12 | disruptek | libgit2 is pretty clean, i mean. |
03:28:22 | FromGitter | <gogolxdong> not yet, does c2nim translate a whole C project? I thought it handles single files. |
03:28:51 | disruptek | yes, you will have to translate all the files one at a time. |
03:30:15 | FromGitter | <gogolxdong> Do they process recursively or manually? |
03:30:23 | disruptek | manually, most likely. |
03:30:57 | FromGitter | <gogolxdong> I need something automatically. |
03:31:05 | disruptek | write a shell script? |
03:32:20 | FromGitter | <gogolxdong> with c2nim ? I'm conceiving a tool translates C projects to Nim. |
03:33:17 | disruptek | you should investigate it. i haven't used it and i could be mistaken. you might be able to just slurp up everything and output a single .nim file. |
03:33:20 | sealmove | disruptek: unittest doesn't help. it provides a macro called `expect` for testing against exceptions, but I want to mark test as failed in case of an exception, and carry on with the rest of the tests, which is very different. |
03:33:26 | shashlick | nimterop has some code in cimport.nim to automate it but translating even headers is a challenge, let alone complete code |
03:33:42 | disruptek | sealmove: expect Failure: check false |
03:33:55 | sealmove | :O |
03:35:10 | FromGitter | <gogolxdong> yes, I can feel the difficulties. |
03:35:23 | disruptek | cue the intern. |
03:37:13 | FromGitter | <gogolxdong> I think have to look into gcc source code to find way out. |
03:39:30 | * | icebattle joined #nim |
03:40:35 | sealmove | eh, `expect` doesn't work like that, you pass it the "test" to run, and it succeeds in cases it raises the specific exception. yep, unittest procs won't help. |
03:40:54 | disruptek | no, i'm using it that way successfully. |
03:41:08 | disruptek | i just have to remember where. |
03:41:57 | disruptek | see bump's tests. |
03:42:00 | disruptek | !repo bump |
03:42:01 | disbot | https://github.com/disruptek/bump -- 9bump: 11a tiny tool to bump nimble versions ๐ป 15 8โญ 2๐ด 7& 1 more... |
03:42:14 | * | ltriant quit (Quit: leaving) |
03:42:51 | * | icebattle quit (Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac) |
03:42:52 | disruptek | hmm, yeah, it succeeds if the exception is raised. so? |
03:43:20 | disruptek | are you saying you cannot catch IndexError? because, you can. |
03:44:18 | sealmove | for some reason it's not catch :( |
03:44:37 | sealmove | I use `except:` without specifying exception (should catch anything?) |
03:45:05 | disruptek | maybe i'm wrong, but i thought Defects were catchable (which is a bug, afaic). |
03:45:33 | aeverr[m] | Some are right now yes |
03:45:59 | disruptek | sealmove: maybe you should not produce exceptions that are not catchable. ๐ |
03:47:50 | sealmove | but I have a test suite with 132 tests |
03:48:17 | sealmove | some of them will produce exceptions, the suite shouldn't crash |
03:48:18 | disruptek | cue the intern. |
03:50:04 | * | endragor joined #nim |
03:51:55 | sealmove | Nim/lib/system.nim(4025, 14) Error: index out of bounds, the container is empty |
03:54:49 | sealmove | ok I found the issue, apparently you can't catch an exception that happens in a macro, outside of it |
03:55:20 | disruptek | wow, exceptions cannot traverse macro boundaries. |
03:56:16 | sealmove | https://play.nim-lang.org/#ix=24Kp |
03:56:40 | sealmove | disruptek, not sure if you are making fun of me :P |
03:56:51 | disruptek | no, that's surprising. |
03:57:35 | sealmove | well, this limitation is painful for me... |
03:57:58 | disruptek | exceptions should be exceptional. |
03:59:46 | FromDiscord | <Rika> Just as exceptional as how bad that joke was |
03:59:56 | disruptek | nimph is >7k lines and i have like 25 try:s in the whole project. |
04:00:04 | disruptek | it's no joke; i don't use them. |
04:00:58 | sealmove | ok but... in testing, exceptions are not exceptional |
04:01:12 | shashlick | voltist just converted nimssl from nimgen to nimterop and wrapped almost all of libssl and libcrypto |
04:01:20 | disruptek | voltist? |
04:01:31 | disruptek | sealmove: if you can catch them, you should. |
04:01:33 | voltist | Yo |
04:01:44 | disruptek | neat. |
04:02:16 | disruptek | sealmove: don't use exceptions for control flow. if you're going to handle an exception in a test, you can bother to write a codepath for it in your code. |
04:02:38 | disruptek | if you can handle the error at all, it's not exceptional, is it? |
04:02:54 | voltist | It was mostly the doing of my bodged trial-and-error wrapper generator script :) |
04:03:12 | disruptek | all hail shashlick. |
04:03:14 | disruptek | PRAISE |
04:03:59 | sealmove | erm, I just want my test suite to continue running and not crash |
04:04:17 | sealmove | i can't take care of exceptions in 132 tests right now |
04:04:28 | sealmove | i want them to all run and see what passes |
04:05:01 | disruptek | write a shell script to run each test individually. |
04:05:35 | shashlick | voltist: i'm sure it was a lot of work |
04:05:39 | sealmove | unittest doesn't support multi-file suite :( |
04:05:54 | sealmove | it's really limited, maybe I should give testament a try |
04:05:58 | disruptek | you run the suite with arguments to indicate which test you want. |
04:06:27 | sealmove | hmm |
04:06:39 | sealmove | that's good, good idea |
04:07:29 | disruptek | maybe i'll write a quality test framework next. |
04:07:51 | disruptek | that's the kind of dead-simple code i'm good at writing. |
04:07:58 | disruptek | something i can design with a crayon. |
04:08:43 | disruptek | why can't exceptions escape macros? |
04:09:01 | sealmove | dunno, should we open an issue? |
04:09:38 | disruptek | there's probably a good explanation (or an open issue). i'm just struggling to understand why it's a problem. |
04:10:43 | sealmove | because exceptions happen during runtime? |
04:10:57 | sealmove | and macros execute at CT |
04:11:00 | disruptek | so? macros don't exist at runtime. |
04:11:32 | sealmove | yeah, the exception happens in a sub-program in a sense |
04:11:58 | sealmove | the sub-program being the VM execution that expands macros |
04:12:37 | disruptek | it expands them to normal code, though. when the code is fully-expanded, there's no more macro processing. |
04:12:43 | disruptek | it should be equivalent. |
04:13:36 | disruptek | it's like the exception gets tainted. |
04:13:46 | disruptek | bit by a radioactive spider, it becomes immortal. |
04:14:57 | * | nsf joined #nim |
04:14:58 | disruptek | i think it needs an issue at a minimum. the docs need to explain this, if it's desired behavior. |
04:15:09 | aeverr[m] | How do I make a converter? Are converters for implicit or explicit conversion? |
04:15:20 | sealmove | agreed #12923 |
04:15:22 | disbot | https://github.com/nim-lang/Nim/issues/12923 -- 3Exceptions can't escape macros ; snippet at 12https://play.nim-lang.org/#ix=24Kz |
04:15:29 | disruptek | implicit, but they only allow for a single conversion. |
04:15:45 | disruptek | replace `proc` with `converter` and return the type you want to convert to. |
04:15:45 | aeverr[m] | What do you mean |
04:16:04 | disruptek | you cannot implicitly convert to C from A via B. |
04:16:23 | aeverr[m] | So it has to have a direct converter |
04:16:24 | aeverr[m] | Okay |
04:16:25 | disruptek | A->C or A->B or B->C but not A->C. |
04:16:28 | aeverr[m] | Thanks |
04:16:35 | disruptek | yeah, something like that. |
04:17:03 | disruptek | they are rarely a good idea, btw. |
04:17:25 | disruptek | or, at least, rarely a good idea to export. |
04:17:31 | aeverr[m] | Yeah, I thought they were for explicit conversion |
04:17:52 | disruptek | proc provides explicit conversion. |
04:18:37 | aeverr[m] | But then I have to name it `to{type}` |
04:18:53 | disruptek | nah, you can name it anything you want. |
04:19:07 | aeverr[m] | I mean that I cannot use the type name |
04:19:24 | aeverr[m] | Okay |
04:19:28 | aeverr[m] | It connects with me |
04:19:34 | aeverr[m] | I understand why not now |
04:19:41 | sealmove | aeverr they are for implicit, the name exists just cause |
04:19:57 | sealmove | for explicit just use the type name |
04:20:27 | sealmove | (without defining a convertor) |
04:20:38 | disruptek | you can call them, too, just like procs. |
04:21:08 | disruptek | i usually call them explicitly. i just like the alternative color in my syntax highlighting; it just makes it more obvious. |
04:26:12 | * | chemist69 quit (Ping timeout: 248 seconds) |
04:26:39 | sealmove | it's one of those feature which should be removed for making the language smaller imo |
04:26:57 | FromDiscord | <has1> Hi, is there something like this for nim? In c# I can create a class library and load the dll at runtime into my app. This allows me to have plugins for my app and add functionality to it that it would not have otherwise |
04:27:32 | disruptek | yeah, i think implicit stuff is generally more trouble than it's worth. that's why i'm not a fan of items/pairs. |
04:28:02 | disruptek | has1: there's a neat plug-in system in feud. |
04:28:05 | disruptek | !repo feud |
04:28:07 | disbot | https://github.com/genotrance/feud -- 9feud: 11Fed Ep with UDitors 15 20โญ 0๐ด |
04:28:23 | * | chemist69 joined #nim |
04:33:46 | * | marmotini_ joined #nim |
04:38:34 | FromDiscord | <has1> Can I get a quick explanation of how it works? |
04:39:46 | FromDiscord | <has1> Does him have something built in? Like phps eval? Does nim have a plug-in system like c# that allows you to do something like assembly load a dll and call methods on it? |
04:47:29 | shashlick | has1: there's a plugin.nim in the src directory that builds and loads the plugin dlls |
04:47:37 | shashlick | there's also the pluginapi.nim that plugins can use |
04:48:28 | shashlick | you'll need to extract it out of feud, it isn't standalone yet |
04:58:35 | disruptek | added `nimph graph` ๐ |
05:04:49 | sealmove | how can I know if the command executed with staticExec was successful? |
05:05:10 | sealmove | what does nimph graph do? |
05:09:45 | sealmove | oh there is gorgeEx |
05:13:10 | disruptek | nimph graph just dumps detail about the packages/projects/requirements of dependencies. |
05:13:45 | disruptek | i needed some way to inspect the dependency tree as i work on clashes, etc. |
05:14:01 | sealmove | nice |
05:14:31 | disruptek | just another little thing. |
05:14:37 | sealmove | hmm, if `x` is a ref object, then `var y = x` does aliasing/ |
05:14:40 | sealmove | ?* |
05:14:53 | sealmove | how do you hard copy? |
05:15:05 | disruptek | dereference with [] |
05:16:22 | disruptek | it's not "aliasing"; think of it as copying the pointer. |
05:16:45 | disruptek | ie. copying the value of the pointer to another pointer, so they both point to the same memory. |
05:17:30 | sealmove | yup, i thought this was synonymous with aliasing |
05:17:56 | disruptek | maybe that's what the kids are calling it these days. ๐ |
05:19:08 | sealmove | i need ref semantics though.. if i deref then I have an `mytypeObj` instead of a `mytype` |
05:20:24 | sealmove | oh got it: https://nim-lang.org/docs/macros.html#copy%2CNimNode |
05:24:28 | FromGitter | <gogolxdong> @disruptek how to set github OAuth token, is it necessary? |
05:57:11 | * | narimiran joined #nim |
06:05:42 | * | couven92 quit (Read error: Connection reset by peer) |
06:06:06 | * | couven92 joined #nim |
06:06:33 | * | marmotini_ quit (Remote host closed the connection) |
06:06:50 | * | marmotini_ joined #nim |
06:09:43 | * | NimBot joined #nim |
06:18:14 | FromGitter | <gogolxdong> `please add a GitHub OAUTH token to your $NIMPH_TOKEN` I have added to ~/.bashrc, but still |
06:19:11 | * | gour joined #nim |
06:20:26 | * | marmotini_ quit (Remote host closed the connection) |
06:23:15 | * | marmotini_ joined #nim |
06:28:15 | * | dddddd quit (Remote host closed the connection) |
06:32:29 | * | marmotini_ quit (Remote host closed the connection) |
06:41:33 | * | marmotini_ joined #nim |
06:42:47 | * | marmotini_ quit (Remote host closed the connection) |
06:59:28 | * | sealmove quit (Quit: WeeChat 2.6) |
06:59:31 | * | marmotini_ joined #nim |
07:11:32 | * | fredrik92 quit (Ping timeout: 248 seconds) |
07:15:24 | * | solitudesf joined #nim |
07:36:47 | * | fredrik92 joined #nim |
07:43:48 | * | couven92 quit (Quit: Client Disconnecting) |
07:44:19 | FromDiscord | <Rika> How do I make a daemon in nim |
07:44:52 | FromDiscord | <Rika> Or maybe a better question is what approach should I take |
07:47:17 | * | PMunch joined #nim |
07:48:04 | FromGitter | <wibisono> Hi all, nim beginner here, haven't used it much but very intrigued to use it. What I noticed is that it lacks popularity and backing/funding. So maybe this info is relevant and can be explored. โ Community funding from RIPE NCC for internet resiliency: โ https://www.ripe.net/support/cpf โ โ So maybe, just maybe if there are interesting NIM based proposal for the good of the internet, it will help produce |
07:48:04 | FromGitter | ... mature libraries. Example accepted proposals from previous periods: ... [https://gitter.im/nim-lang/Nim?at=5df9d9b4b1701e50ca43faf5] |
07:48:58 | Araq | well ok, good idea, but is says "The 2019 call for applications is now closed." |
07:49:07 | FromGitter | <wibisono> Yeah sorry :( |
07:49:10 | Araq | and for 2020 there is nothing opened |
07:49:19 | FromGitter | <wibisono> so maybe for the next round, but I think it will open again |
07:49:36 | Araq | bookmarked it |
07:49:53 | Araq | Rika: I don't know, same as you do it in C? |
07:51:29 | Araq | I wouldn't use daemons though because of Araq's rule 137: OSes suck and most features they offer are misdesigned. |
07:51:35 | * | Vladar joined #nim |
07:53:43 | * | marmotini_ quit (Remote host closed the connection) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:00 | * | marmotini_ joined #nim |
08:01:19 | * | lritter joined #nim |
08:05:02 | * | gmpreussner joined #nim |
08:09:29 | * | vesper11 quit (Ping timeout: 265 seconds) |
08:14:19 | * | vesper11 joined #nim |
08:25:33 | * | voltist quit (Quit: Leaving) |
08:27:16 | FromGitter | <Milerius> Hello ! |
08:27:40 | FromGitter | <Milerius> I finally managed made my stuff work, I'm so so happy, there is the last step to do with nimterop and I got a question about it |
08:30:22 | FromDiscord | <Rika> Okay noted |
08:32:22 | FromGitter | <wibisono> @Araq I will notify you when the CPF is open, meanwhile here's another source of fund https://nlnet.nl/propose/ also internet related. โ โ https://nlnet.nl/themes/ |
08:32:42 | FromGitter | <wibisono> not sure how all this will fits together but somehow it might |
08:42:54 | PMunch | I actually just contributed some code to NLNetLabs project Unbound in order to be able to use Nim with it :) |
08:43:27 | PMunch | By the way, one of the speakers in our FOSDEM room just recently got a grant from NLNet for his project |
08:49:52 | FromGitter | <wibisono> Yup, they seem to have plenty of funding for open source |
08:49:56 | FromGitter | <wibisono> (https://files.gitter.im/nim-lang/Nim/FhlG/image.png) |
08:50:31 | FromGitter | <wibisono> Took that one from this NGI0 presentation: https://ripe79.ripe.net/wp-content/uploads/presentations/72-NGIZero-RIPE_OpenSourceWG.pdf |
08:50:35 | FromGitter | <wibisono> slide 24 |
08:57:17 | * | jjido joined #nim |
09:07:03 | * | ldlework quit (Quit: co'o ro do) |
09:10:36 | FromGitter | <bung87> ```type ContextFactory* = proc(): net.SslContext``` โ โ in another proc, i pass it as arg , and call `var ctx:net.SslContext = contextFactory()` , compiler throw `Error: expression 'contextFactory()' has no type (or is ambiguous)` [https://gitter.im/nim-lang/Nim?at=5df9ed0cc0c8ef301bd15329] |
09:12:24 | * | ldlework joined #nim |
09:20:39 | PMunch | bung87, do you have a longer example? |
09:22:11 | FromGitter | <bung87> um, hold on itโs in a lib |
09:22:56 | PMunch | Because this works just fine: https://play.nim-lang.org/#ix=24Lm |
09:26:42 | FromGitter | <bung87> https://github.com/bung87/cero , run nimble test |
09:27:33 | FromGitter | <bung87> I check your exmaple , cant figure it out. |
09:33:22 | FromGitter | <bung87> because itโs in generic ? |
09:34:42 | FromGitter | <bung87> `proc startTLS[T](transport:ConnectionMixin[T], contextFactory:ContextFactory, normal:bool, bypass:type) =` I call it inside this proc |
09:34:46 | * | letto quit (Remote host closed the connection) |
09:35:23 | * | tyler569 quit (Ping timeout: 250 seconds) |
09:35:44 | PMunch | Try to create a minimal example |
09:36:18 | * | letto joined #nim |
09:38:39 | FromGitter | <Milerius> Hey |
09:38:47 | FromGitter | <Milerius> It's possible to enable verbose for nim command line ? |
09:39:17 | FromGitter | <bung87> ok, I found another proble, I โll fix it first. |
09:41:18 | * | tyler569 joined #nim |
09:42:48 | PMunch | Milerius, what do you mean? |
09:43:21 | PMunch | You do have "--verbosity:0|1|2|3 set Nim's verbosity level (1 is default)" from "nim --fullhelp" |
09:52:26 | FromDiscord | <gingerBill> In Nim, how often are ranges used to define the index type in an array? e.g. instead of `array[3, string]`, `array[0..2, string]` |
09:53:06 | FromDiscord | <gingerBill> I know this is from Pascal but I never particularly used this feature whatsoever. I was wondering if anyone else did use this feature. |
09:53:25 | FromDiscord | <gingerBill> I know this is from Pascal but I never particularly used this feature whatsoever in Pascal. I was wondering if anyone else did use this feature. |
09:57:07 | PMunch | You will see it sometimes |
09:57:20 | PMunch | But for the 0..n case it's most normal to just use a number |
09:58:45 | PMunch | However you can of course also do [4..10, int] |
09:59:17 | PMunch | That will create an array with valid indices [4] through [10] |
09:59:54 | PMunch | Like so: https://play.nim-lang.org/#ix=24Lv |
10:01:51 | * | letto quit (Quit: Konversation terminated!) |
10:03:16 | * | letto joined #nim |
10:10:06 | FromGitter | <Milerius> @PMunch Thanks! |
10:10:22 | FromGitter | <Milerius> Is it possible to use an environment variable inside a pragma ? |
10:12:04 | PMunch | Milerius, sure `getEnv` works on compile-time |
10:12:20 | PMunch | From the os module |
10:13:21 | FromDiscord | <mratsim> @gingerBill I did, for registers for example |
10:14:06 | FromDiscord | <mratsim> See: https://github.com/mratsim/chirp8/blob/91f737d8395b89085d841643b30d6f3ecc99366d/src/datatypes.nim#L11-L20 |
10:14:22 | FromDiscord | <mratsim> I can directly index with 'A'..'F' registers |
10:15:35 | PMunch | Oh yeah, I've also used it for enums |
10:16:50 | PMunch | Like so: https://play.nim-lang.org/#ix=24Ly |
10:18:19 | PMunch | Oh by the way gingerBill, try to not edit your messages on Discord. They are sent as a brand new mesage on IRC which can be quite annoying |
10:18:45 | PMunch | ex: https://irclogs.nim-lang.org/18-12-2019.html#09:53:06 |
10:19:15 | PMunch | Hmm, irclogs reference links are by timestamp |
10:19:24 | FromDiscord | <Rika> Bridge that can diff with 4 character context when |
10:19:32 | PMunch | So you could theoretically link to something that hasn't happened yet |
10:20:03 | PMunch | https://irclogs.nim-lang.org/18-12-2019.html#10:20:00 |
10:20:10 | PMunch | https://irclogs.nim-lang.org/18-12-2019.html#10:20:15 |
10:20:13 | PMunch | https://irclogs.nim-lang.org/18-12-2019.html#10:20:15 |
10:20:15 | PMunch | https://irclogs.nim-lang.org/18-12-2019.html#10:20:15 |
10:20:15 | PMunch | https://irclogs.nim-lang.org/18-12-2019.html#10:20:15 |
10:20:19 | PMunch | Hey! |
10:20:37 | PMunch | A self referencing message! |
10:21:16 | PMunch | (And yes, I realise the irony in saying that repeat messages are annoying and then following up with spamming links to the irclogs..) |
10:21:20 | FromGitter | <kayabaNerve> Lol. Congrats PMunch :P |
10:25:42 | FromGitter | <Milerius> @PMunch what is the idiomatic way to concatenate at compile time ? โ โ I'm trying something like: โ โ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df9fea6e0131f50c9647f37] |
10:26:36 | PMunch | Milerius, the string concatenation operator in Nim is `&` not `+` |
10:27:50 | FromDiscord | <gingerBill> @mratsim The register example seems to be using it as an enumerated index (e.g. have an enum representing the indices). I can see the benefit there but not necessarily the general ranges. |
10:29:06 | FromDiscord | <mratsim> AFAIK it's not buggy and doesn't require maintenance o I don't mind |
10:29:07 | FromGitter | <Milerius> Yeah that's work ! Thank's a lot @PMunch ! |
10:29:17 | PMunch | No problem :) |
10:29:57 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
10:30:48 | * | ng0 joined #nim |
10:35:56 | FromGitter | <Milerius> https://image.noelshack.com/fichiers/2019/51/3/1576665315-foo.jpg โ โ Say Hello to Nim + Imgui + High DPI + Viewport and Docking :D |
10:40:52 | PMunch | Neat! |
10:41:54 | FromGitter | <Milerius> For people interested the code look like that: |
10:42:04 | FromGitter | <Milerius> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dfa027ce0131f50c9649853] |
10:42:41 | FromGitter | <Milerius> (You can code your whole program between pre update and update) |
10:44:34 | FromGitter | <Milerius> I may have a really specific question now if someone can guide me |
10:44:39 | FromGitter | <Milerius> I finished OSX and Linux support |
10:44:55 | FromGitter | <Milerius> I would love to add Windows support Through MSVC or Clang (no mingw). โ โ Is it possible ? |
10:45:41 | FromGitter | <Milerius> how i can force nim to pickup clang on windows for example |
11:07:00 | * | jjido quit (Quit: Connection closed for inactivity) |
11:21:53 | * | Vladar quit (Quit: Leaving) |
11:42:39 | * | thomasross quit (Ping timeout: 268 seconds) |
11:45:58 | * | thomasross joined #nim |
11:48:47 | * | thomasross_ joined #nim |
11:48:47 | * | thomasross quit (Killed (rajaniemi.freenode.net (Nickname regained by services))) |
11:48:47 | * | thomasross_ is now known as thomasross |
11:49:59 | FromGitter | <Willyboar> @Milerius do you want nim to recognize the current OS? |
11:56:20 | * | thomasross quit (Ping timeout: 248 seconds) |
11:56:31 | * | abm joined #nim |
11:58:11 | FromGitter | <Milerius> It's ok i find the solution |
11:58:15 | FromGitter | <Milerius> But i come with another question |
11:58:32 | FromGitter | <Milerius> Is it possible to change "\\" to "/" at compile time using getEnv ? |
12:01:44 | FromGitter | <Milerius> i tried normalize path but that doesn't work at compile time |
12:03:38 | lqdev[m] | why'd you want to do that? |
12:06:55 | * | nsf quit (Quit: WeeChat 2.6) |
12:08:51 | FromGitter | <Milerius> for passL pragma |
12:09:09 | FromGitter | <Milerius> `{.passL: "-L" & os.getEnv("ProgramFiles(x86)").normalizedPath() & "/ui_workflow/lib" & " -lui_workflow" .}` |
12:22:05 | * | Hideki_ joined #nim |
12:26:17 | PMunch | import strutils and do .replace("\\", "/") is certainly an option |
12:28:31 | * | ponyrider joined #nim |
12:29:36 | * | Mister_Magister quit (Excess Flood) |
12:30:03 | * | Mister_Magister joined #nim |
12:46:17 | * | endragor quit (Remote host closed the connection) |
12:46:46 | * | endragor joined #nim |
12:51:41 | * | endragor quit (Ping timeout: 250 seconds) |
12:52:01 | PMunch | Hmm, I want to run a thread with an asyncloop to send network requests. And then have it read from a channel and then send them over the async sender |
12:54:03 | PMunch | Currently I have something like this http://ix.io/24Mc/nim but it obviously ends up with pegging the CPU at 100% |
12:55:12 | dom96 | Why are you using drain? |
12:55:28 | Araq | dom96, just accept it, drain is awesome :P |
12:55:33 | * | Araq is kidding |
12:55:55 | * | Araq wrote 'drain' and still isn't sure about its usefulness |
12:55:56 | * | krux02 joined #nim |
12:56:06 | dom96 | You should put this while loop in an async proc and use `await sleepAsync(AN_ACCEPTABLE_TIME)`. Yes, it sucks, but until we get support for channels/FlowVars in async that's the best you can do |
12:56:06 | FromDiscord | <mratsim> @Pmunch, add exponential backoff when there is nothing to read |
12:56:37 | dom96 | Araq, from what I've seen it's only ever useful for some specific use cases when testing async |
13:00:28 | PMunch | Hmm, wouldn't a better solution be to tryRead while hasPendingOperations. And when it doesn't have anything pending do a blocking read? |
13:00:42 | PMunch | And then call poll in the tryRead scenario? |
13:02:02 | * | Hideki_ quit (Remote host closed the connection) |
13:02:09 | dom96 | doubt it :) |
13:02:37 | PMunch | Why? |
13:02:38 | dom96 | it all depends on what you're doing though |
13:03:36 | PMunch | I'm logging some stuff |
13:05:47 | PMunch | Or rather I'm sending some stuff to a log, but it isn't super critical if I miss some stuff |
13:06:40 | * | Hideki_ joined #nim |
13:10:05 | FromGitter | <Milerius> There is something to convert automatically a Json to a Nim structure ? |
13:10:24 | FromGitter | <Milerius> Something like: https://app.quicktype.io |
13:10:25 | PMunch | The json module? |
13:10:33 | FromGitter | <mratsim> Use % |
13:10:42 | FromGitter | <Milerius> I mean a raw json to a nim struct |
13:11:06 | FromGitter | <mratsim> Use to(yourJson, TheTargetType) |
13:11:18 | FromGitter | <mratsim> It's in the json module |
13:11:38 | FromGitter | <Milerius> No i mean generate the target type |
13:11:40 | FromGitter | <Milerius> from the json |
13:11:50 | PMunch | Or you could call it like `yourJson.to TheTargetType` which reads a bit better :P |
13:12:07 | PMunch | Milerius, on runtime? |
13:12:11 | FromGitter | <Milerius> No |
13:12:12 | FromGitter | <Milerius> A tool |
13:12:17 | FromGitter | <Milerius> that generate the nim struct |
13:12:20 | FromGitter | <mratsim> If the json is not specified at compile time, there is no way because typesonly exist at compile-time |
13:12:31 | FromGitter | <Milerius> Please check: https://app.quicktype.io |
13:12:46 | FromGitter | <Milerius> You can type your json and it's generate the structure that you will need to use for the to_json stuff |
13:13:19 | aeverr[m] | So basically nim-protobuf but json |
13:13:25 | PMunch | Ah, nothing that I know of |
13:13:36 | FromGitter | <Milerius> It's just to gain some time |
13:13:56 | FromGitter | <mratsim> AFAIK @deech has something like this because he presented it at Strange Loop conference |
13:13:58 | FromGitter | <Milerius> May be we can ask them to add nim :p |
13:14:02 | PMunch | I mean I wrote this: https://github.com/PMunch/jsonschema |
13:14:08 | PMunch | But it's not quite what you want I think |
13:14:30 | PMunch | Milerius, should be a fairly simple macro to write |
13:14:40 | PMunch | A perfect first macro project :) |
13:14:47 | FromGitter | <Milerius> https://gist.github.com/jiro4989/a59e751c20a34f2be3aee858961cda3c i find this |
13:15:43 | FromGitter | <Milerius> Is your json schema handling optional value ? seem's really cool |
13:17:04 | FromDiscord | <mratsim> See: https://github.com/deech/LambdaWorldCadiz2019-WhatFPCanLearnFromStaticIntrospection/blob/master/json_reflection.nim |
13:17:04 | PMunch | Yeah, it was written to take the TypeScript input that the Language Server Protocol specification offers |
13:17:12 | PMunch | I use it like this: https://github.com/PMunch/nimlsp/blob/master/src/nimlsp.nim#L52 |
13:17:16 | FromDiscord | <mratsim> and: https://github.com/deech/LambdaWorldCadiz2019-WhatFPCanLearnFromStaticIntrospection/blob/master/json_printwithtype.nim |
13:17:32 | FromDiscord | <mratsim> you can read the slides to see example usage |
13:18:09 | PMunch | So it checks if the data is valid, then it casts it to that schema type which then allows you to directly access any of the fields (and nothing else) with type conversions done automatically |
13:18:20 | PMunch | But without actually marshalling the whole thing over to a new representation |
13:18:30 | FromDiscord | <mratsim> ah the video has the demo not the slides |
13:18:35 | FromGitter | <Milerius> seem's really cool |
13:20:13 | PMunch | Thanks, works pretty well :) Makes working with JSON easy and type-safe |
13:21:23 | FromGitter | <Milerius> I may be interested |
13:21:29 | FromGitter | <Milerius> but i feel i'm to rookie for this advanced library ahah |
13:22:48 | * | yglukhov[m] quit (Ping timeout: 246 seconds) |
13:22:48 | * | lqdev[m] quit (Ping timeout: 246 seconds) |
13:22:48 | * | Mat42 joined #nim |
13:22:54 | * | meff[m] quit (Ping timeout: 250 seconds) |
13:23:00 | * | vycb[m] quit (Ping timeout: 252 seconds) |
13:23:08 | FromDiscord | <mratsim> THere is no way to not be a rookie with Nim macros, unless maybe you worked with Abstract Tree before (like html, xml, json) |
13:23:17 | * | salotz[m] quit (Ping timeout: 248 seconds) |
13:23:18 | * | BitPuffin quit (Ping timeout: 248 seconds) |
13:23:30 | * | spymasterd[m] quit (Ping timeout: 246 seconds) |
13:23:30 | * | Demos[m] quit (Ping timeout: 246 seconds) |
13:23:30 | * | LEdoian[m] quit (Ping timeout: 264 seconds) |
13:23:32 | * | pigmej quit (Ping timeout: 250 seconds) |
13:23:32 | * | k0mpjut0r quit (Ping timeout: 250 seconds) |
13:23:39 | * | zielmicha[m]1 quit (Ping timeout: 245 seconds) |
13:23:39 | * | nc-x[m] quit (Ping timeout: 245 seconds) |
13:23:43 | * | zacharycarter[m] quit (Ping timeout: 246 seconds) |
13:23:47 | * | macsek1911[m] quit (Ping timeout: 252 seconds) |
13:23:47 | * | Manny8888 quit (Ping timeout: 252 seconds) |
13:23:47 | * | xomachine[m] quit (Ping timeout: 252 seconds) |
13:23:47 | * | skrylar[m] quit (Ping timeout: 252 seconds) |
13:23:47 | * | lasso[m] quit (Ping timeout: 252 seconds) |
13:23:49 | * | TheManiac[m] quit (Ping timeout: 250 seconds) |
13:23:49 | * | aeverr[m] quit (Ping timeout: 250 seconds) |
13:23:49 | * | Connor[m] quit (Ping timeout: 250 seconds) |
13:23:49 | * | isaac[m]1 quit (Ping timeout: 250 seconds) |
13:23:51 | * | Balu[m] quit (Ping timeout: 248 seconds) |
13:23:51 | * | d-nice2[m] quit (Ping timeout: 248 seconds) |
13:23:51 | * | Miguelngel[m] quit (Ping timeout: 248 seconds) |
13:23:52 | * | GitterIntegratio quit (Ping timeout: 248 seconds) |
13:23:55 | FromDiscord | <Lantos> It would be awesome if pmunch did a tutorial on YouTube ;) |
13:24:03 | FromDiscord | <Lantos> About nim macros |
13:24:04 | * | planetis[m] quit (Ping timeout: 264 seconds) |
13:24:04 | * | nergal[m]1 quit (Ping timeout: 264 seconds) |
13:24:04 | * | leorize[m] quit (Ping timeout: 264 seconds) |
13:24:36 | PMunch | I have considered it, but it's a big topic |
13:24:45 | PMunch | I've written quite a bit about it though: https://peterme.net |
13:27:08 | Mat42 | hello, exist there a tutorial or some documentation about cross-compilation for embedded systems, peferably with disabled garbage collection? |
13:27:42 | FromDiscord | <Lantos> Good resource but YouTube videos are really good for learning. Videos give you the feeling your stepping through the problem with a teacher |
13:27:50 | FromDiscord | <Lantos> Just my opinion |
13:28:56 | PMunch | Mat42, well yes and no |
13:28:59 | FromDiscord | <Lantos> I've thought about trying to learn from your blog and try to make. YouTube series out of it. Just haven't had the time |
13:29:11 | PMunch | But you're in luck, because I'm currently working on cross-compiling for Arduino |
13:30:00 | PMunch | Lantos, never cared much for YouTube tutorials myself, always find myself pausing/unpausing them or scrubbing to the interesting bit |
13:30:08 | Mat42 | PMunch: That's nice. I have ESP32 as target in mind |
13:30:12 | FromDiscord | <Lantos> Bluepill also? |
13:30:19 | FromDiscord | <Lantos> Nice |
13:30:21 | PMunch | Bluepill? |
13:30:29 | FromDiscord | <Lantos> Smt32 |
13:30:43 | PMunch | But as I said, I have considered it, if I only had the time.. |
13:30:48 | FromDiscord | <Lantos> Stm* |
13:31:05 | FromDiscord | <Lantos> Yeah watching at 2x speed. And scrubbing |
13:31:08 | PMunch | Mat42, I think federico3 was compiling stuff for the ESP8266 |
13:31:28 | federico3 | yep |
13:32:10 | federico3 | STM32? |
13:32:11 | PMunch | Lantos, this is what I use to compile and run Nim on an Arduino Leonardo (specifically the Arduboy): http://ix.io/24Mj |
13:32:20 | FromDiscord | <Lantos> Also these style of videos are great |
13:32:20 | FromDiscord | <Lantos> https://youtu.be/lleyT7oL_og |
13:33:02 | * | Vladar joined #nim |
13:33:04 | FromDiscord | <Lantos> It's rust but you can have them running in the background at 2x and when something interesting comes up you can go back and view it |
13:33:05 | PMunch | With something like this at the beginning of my file: http://ix.io/24Mk/nim |
13:33:19 | Mat42 | federico3: No, ESP32 |
13:33:46 | FromDiscord | <kodkuce> i frogot how do i wtie terary operator, i really have to start wrting a list of things i frogot |
13:33:54 | PMunch | All those flags I've gotten from the Arduino IDE (shift+verify to see the full log with gcc commands, or change your settings to always show them) |
13:33:54 | federico3 | I was asking about the bluepill |
13:34:12 | federico3 | I have an esp32 but I haven't tried targeting it yet |
13:34:24 | PMunch | And I was taking hints from this on the way: https://disconnected.systems/blog/nim-on-adruino/ |
13:34:34 | federico3 | we should really have a nim CI on microcontrollers |
13:34:51 | FromDiscord | <Lantos> I'll have a go at it tonight. I've got something in mind for an Arduino projecy |
13:34:53 | * | dddddd joined #nim |
13:34:59 | PMunch | On actual microcontrollers? Or just the compilation part? |
13:35:14 | Zevv | run it on an emulator, should be fine for this |
13:35:47 | FromDiscord | <kodkuce> nim terary spoon me,, var some = "pera" if 1==1 else "zika" |
13:36:03 | Mat42 | federico3: if it is ok for you, I will share my experiences here and ask some questions (or at some stage write a blog) |
13:37:10 | FromDiscord | <kodkuce> solve it nim playground helps |
13:40:39 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dfa2c5749314a1d459c9066] |
13:41:16 | FromGitter | <bung87> have idea about this? |
13:41:59 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dfa2ca7cf771f7708eca5a5] |
13:46:33 | FromDiscord | <niv> hi! if i instance a string with `newStringOfCap(20)` and then do `setLen(10)` on it, will it truncate the backing memory to 10 bytes? |
13:47:09 | FromDiscord | <niv> alternatively, is there a way to create a string view into a char array? i need to wrap a incoming recv buffer into a readonly string |
13:56:00 | FromGitter | <Willyboar> https://www.youtube.com/watch?v=XHosLhPEN3k&feature=youtu.be |
13:57:24 | federico3 | Mat42, PMunch: want to contribute to a dedicated repo for microcontrollers and sensors? |
13:59:57 | FromDiscord | <kodkuce> hmm how to check if index of sequence invalid or empty , https://play.nim-lang.org/#ix=24Mr |
14:00:11 | FromDiscord | <Milerius> Hey ? |
14:00:12 | FromDiscord | <Milerius> |
14:00:12 | FromDiscord | <Milerius> How we download stuff in a Nimble scripts ? We cannot use http client alright ? |
14:00:16 | FromDiscord | <Milerius> What do you use ? |
14:01:10 | Mat42 | federico3: As my project continues, yes |
14:01:57 | FromGitter | <Willyboar> https://www.youtube.com/watch?v=LJvEIjRBSDA @Araq 2:18 is for you |
14:03:46 | FromDiscord | <kodkuce> @Milerius wtf you just asked, nimble install package is normal way duno what you meant exactly |
14:04:22 | FromDiscord | <Milerius> I don't want to download packages, but files for my current project '_' |
14:04:34 | FromDiscord | <Milerius> I depends on specific zips stuff |
14:05:02 | * | Hideki_ quit () |
14:05:38 | FromDiscord | <Milerius> I need for example to download: `http://195.201.0.6/mm2/mm2-latest-Darwin.zip` from my nimble |
14:05:54 | FromDiscord | <Milerius> Because my project will be multiprocess, so i need to launch an external process that i download here. |
14:06:31 | FromDiscord | <kodkuce> oh you mean you are pacakign your project with nimble and you want to have dependecy of that file http://195.201.0.6/mm2/mm2-latest-Darwin.zip , then duno i newer ever nibled anything ๐ |
14:07:01 | FromDiscord | <Milerius> My need is as follows: |
14:07:02 | FromDiscord | <Milerius> |
14:07:02 | FromDiscord | <Milerius> I have to download three different files depending on my platform, and put them in the asset folder of my binary. |
14:07:16 | FromDiscord | <Milerius> I don't mind deploying with nimble, i'm writting a binary for the company |
14:08:18 | FromDiscord | <Milerius> I could write 2 different script (bash, powershell), and call exec from nimscript |
14:08:18 | FromDiscord | <Milerius> |
14:08:18 | FromDiscord | <Milerius> But if i can do directly from nim scripts i would love to know about. |
14:10:48 | FromDiscord | <Milerius> According to : https://nim-lang.org/docs/nims.html |
14:10:48 | FromDiscord | <Milerius> |
14:10:48 | FromDiscord | <Milerius> We cannot download, unzip stuff for the moment from nimscript |
14:11:09 | stefantalpalaru | How do I define a proc's name on the compiler's command line? I want to do `nim c -d:foo=bar ...` and then call `foo()` inside the Nim file. Any way to get there with {.strdefine.} or some template tricks? |
14:12:24 | PMunch | Milerius, you could do staticExec with wget or curl.. |
14:12:45 | PMunch | Eer, not static exec, but exec I guess it is |
14:12:49 | PMunch | Or include a script that does it and run that |
14:13:01 | FromDiscord | <Milerius> @PMunch Yeah but it's a bit dirty, i need to be sure that binary are present in the operating system |
14:13:01 | PMunch | Or a Nim program that does it and then compile and run that :) |
14:13:17 | FromDiscord | <Milerius> yep i will do that |
14:13:27 | PMunch | federico3, yeah I could contribute to a repo like that |
14:13:39 | PMunch | So far I've very specifically targetted the Arduboy though |
14:14:02 | FromDiscord | <Pebaz> [Nimporter](https://github.com/Pebaz/nimporter) lets you compile Nim extensions for Python on import! |
14:14:19 | FromDiscord | <Pebaz> Nimporter lets you compile Nim extensions for Python on import! https://github.com/Pebaz/nimporter |
14:14:21 | * | tribly quit (Ping timeout: 268 seconds) |
14:14:21 | * | crem quit (Ping timeout: 268 seconds) |
14:14:49 | * | tribly joined #nim |
14:15:31 | Mat42 | ciao and thanks |
14:15:42 | * | Mat42 left #nim ("https://quassel-irc.org - Komfortabler Chat. รberall. ") |
14:15:49 | * | Hideki_ joined #nim |
14:15:51 | * | crem joined #nim |
14:16:33 | * | Hideki_ quit (Remote host closed the connection) |
14:17:07 | * | Hideki_ joined #nim |
14:23:14 | FromDiscord | <sealegs> hey guys, whenever I'm trying to disconnect websocket I get an error saying that index 6 not in 0 .. 5, but how can I prevent it from crashing and handle the error? I tried using the `try` block statement, but it didn't work. |
14:24:29 | FromGitter | <bung87> maybe you just need check length first |
14:24:45 | FromDiscord | <kodkuce> @sealegs for start use https://github.com/treeform/ws |
14:25:12 | FromDiscord | <kodkuce> i guessing you were using that old one thats in docs page |
14:25:30 | FromDiscord | <sealegs> I'm using niv websocket |
14:26:03 | FromDiscord | <kodkuce> ^^^ is up to date for of nivs one |
14:26:06 | FromDiscord | <sealegs> https://github.com/niv/websocket.nim |
14:26:20 | FromDiscord | <kodkuce> niv last update 2 year ago, this 15days |
14:26:52 | FromDiscord | <kodkuce> i head too some issues i dont remember right exactly, but this newer works for me np |
14:27:18 | FromDiscord | <sealegs> I'll try the new version and see if it doesn't show this error |
14:27:19 | * | sealmove joined #nim |
14:28:59 | FromDiscord | <kodkuce> somone should change in docs to point to this inste nivs |
14:35:26 | * | endragor joined #nim |
14:41:19 | FromDiscord | <sealegs> okay so I've tried the latest version and now I can't seem to handle the new error (Exception message: The network connection was aborted by the local system.), I tried the `try` block statement again, but it seems quite unpreventable. |
14:41:19 | FromDiscord | <sealegs> |
14:41:19 | FromDiscord | <sealegs> How can I prevent it from crashing? |
14:41:31 | FromDiscord | <sealegs> Okay, so I've tried the latest version and now I can't seem to handle the new error (Exception message: The network connection was aborted by the local system.), I tried the `try` block statement again, but it seems quite unpreventable. |
14:41:31 | FromDiscord | <sealegs> |
14:41:31 | FromDiscord | <sealegs> How can I prevent it from crashing? |
14:42:45 | PMunch | Oh nice, nimlsp now has 100 stars :) |
14:43:28 | PMunch | sealegs, do you have some code for that? |
14:43:57 | * | nsf joined #nim |
14:44:13 | FromDiscord | <sealegs> yes |
14:46:10 | FromDiscord | <sealegs> https://play.nim-lang.org/#ix=24MB |
14:46:34 | PMunch | Lantos, just had a look at that link you sent. I could definitely try to live stream myself writing a macro. Maybe the quicktype thing that Milerius posted would be a good candidate :) |
14:48:25 | PMunch | sealegs, are you sure that it is an OSError? |
14:48:42 | PMunch | Try with just Except and see if that works |
14:48:49 | PMunch | Without the error type |
14:49:09 | * | clyybber joined #nim |
14:49:46 | PMunch | You've also got some weird indentation in the playground snippet, but I assume that was just a copy-paste error |
14:51:45 | disruptek | gogolxdong: it's not necessary, but the README.md explains your options. |
14:51:49 | * | PMunch quit (Quit: Leaving) |
14:52:03 | FromDiscord | <sealegs> I removed the identation, and yes I am sure it is an os error, because that's the new error |
14:53:16 | FromDiscord | <sealegs> I removed the identation, and yes I am sure it is an os error, because that's the new error and it says it is |
14:54:00 | Araq | https://github.com/nim-lang/Nim/pull/12887 we could use some help here, feedback about how to evolve sequtils would be appreciated |
14:54:01 | disbot | โฅ add more utilities to `sequtils` |
14:54:39 | sealmove | is there a way to get number of items/pairs of an iterator? |
14:56:09 | FromGitter | <mratsim> only if the iterator has a way to know its end before starting |
14:56:28 | FromGitter | <mratsim> or if you return a counter besides the item/pair |
14:56:51 | disruptek | maybe we can just add to stdlib a way to It-ify a proc. seems fairly straightforward. |
14:57:14 | Araq | disruptek, but that would be an abstraction inversion |
14:57:20 | FromGitter | <mratsim> sequtils should become range utils |
14:57:45 | disruptek | i'd also question the wisdom of making an exception to test-in-the-crucible-of-3rd-party-libs-and-then-bring-into-stdlib. |
14:58:14 | Araq | ideally we only have the It versions and then you can extract the FP versions with its callbacks from it |
14:58:47 | disruptek | that would handily separate out those procs and give them special FP attention. |
14:59:05 | FromGitter | <mratsim> a โitโ only sequtils would be much more useful if we could chain inline iterators |
14:59:22 | * | Araq sighs |
15:00:05 | Araq | chaining inline iterators doesn't even have an RFC iirc |
15:00:07 | disruptek | it's tricky because if they go into another lib, we'll have to deal with the clash once they go into stdlib. |
15:00:49 | disruptek | does .pure apply to procs? |
15:01:31 | disruptek | not advocating, just curious. |
15:01:51 | Araq | it doesn't |
15:02:06 | FromDiscord | <mratsim> it doesn't have a RFC but it says in the manual that it's supported ๐ |
15:02:14 | disruptek | lol |
15:02:22 | FromGitter | <alehander92> Araq i agree that chaining iterators makes more sense than the it versions imho |
15:02:57 | disruptek | +1 to range utils. |
15:02:57 | * | Hideki_ quit (Remote host closed the connection) |
15:03:22 | * | ng0_ joined #nim |
15:03:40 | FromGitter | <alehander92> they're orthogonal actually, sorry, but yeah better combo, just +1 for mratsim |
15:03:45 | * | Hideki_ joined #nim |
15:03:51 | Araq | mratsim: for me these things got resolved with the new sugar.collect |
15:04:05 | Araq | which I'm starting to love |
15:04:07 | * | ng0 quit (Disconnected by services) |
15:04:10 | * | ng0_ is now known as ng0 |
15:04:30 | FromDiscord | <mratsim> it doesn't get resolve until people stop asking for examples or about "lx is deprecated, what should I use" ๐ |
15:04:34 | disruptek | araq would be proud; i'm making commits that do nothing but remove `return`. |
15:04:39 | FromDiscord | <mratsim> lc not lx |
15:05:09 | disruptek | there are apparently a bunch of comprehension repositories. |
15:05:13 | FromGitter | <alehander92> `collect` is great, but they're very different |
15:05:20 | FromGitter | <alehander92> like, you can use chaining inside collect |
15:05:46 | shashlick | Milerius: check out nimterop for download and unzip |
15:05:53 | FromGitter | <alehander92> i thought about deprecating `comprehension`, i still think it shouldn't bring anything over collect |
15:06:01 | FromDiscord | <kodkuce> @sealegs hmm you on Windows or what, duno why would your system drop connection |
15:06:13 | Araq | but look, chaining itself has its own problems, harder to debug, unclear how to indent these long expressions |
15:06:52 | Araq | unclear performance profiles (are the temporary seqs optimized out?) |
15:06:54 | disruptek | you don't indent case because it does not precede a : (for you) so... |
15:07:35 | FromGitter | <mratsim> people want to write map(it +1).map(it * 2).reduce(sum) |
15:07:56 | disruptek | yep. |
15:07:59 | FromGitter | <alehander92> well, they should be optimized out most of the time |
15:08:04 | FromGitter | <mratsim> both sequtils and stringutils force people to do intermediate alloc at the moment |
15:08:06 | FromGitter | <alehander92> but this can be easily documented |
15:08:15 | disruptek | all we have to do is make chains more performant and araq will support the concept. |
15:08:20 | * | Hideki_ quit (Ping timeout: 248 seconds) |
15:08:45 | FromDiscord | <sealegs> I'm on windows and I am closing connection, so I can make sure it reconnects properly, @kodkuce. |
15:08:50 | Araq | I don't like designs where you can use sugar as long as you don't care about speed, I've seen it in C# with LINQ |
15:09:13 | disruptek | agree; that's part of what i love about nim. i don't feel that being sloppy is slow. |
15:09:48 | Araq | and pretty much everything we've done in the last months is moving away from this way of designing things |
15:09:50 | FromGitter | <alehander92> but instead, now you can use normal `.` syntax if you dont care about memory |
15:09:56 | * | junland quit (Quit: %ZNC Disconnected%) |
15:10:07 | FromGitter | <alehander92> speed* |
15:10:46 | Araq | and I've studied Haskell's deforestation fwiw |
15:11:12 | * | junland joined #nim |
15:11:19 | Araq | the paper outlined no way how to apply it to an imperative, eager PL |
15:11:59 | FromGitter | <alehander92> but rust,c++,d(?) etc have some form of iterators |
15:12:09 | FromGitter | <alehander92> i cant imagine its something exotic these days |
15:12:10 | disruptek | how inconsiderate. |
15:12:39 | Araq | D has ranges that happen to be memory-safe when you use its GC |
15:12:54 | FromDiscord | <kodkuce> @sealegs so form what i get, when you manualcy close connection vie OS netrwork disable or whatewer it shoots an "Exception message: The network connection was aborted by the local system" , but issue is it terminates whole app? did you tryed wiriting jsut 1 echo afert it? |
15:13:03 | Araq | C++ has ranges and is in need for a borrow checker for them |
15:13:13 | Araq | Rust has ranges and the borrow checker |
15:13:34 | FromDiscord | <mratsim> Rust has iterators with a state machine design |
15:13:39 | FromDiscord | <mratsim> like Python, with "next" |
15:13:47 | disruptek | maybe ... is a suitable operator ๐ |
15:13:48 | * | seni joined #nim |
15:13:50 | FromDiscord | <mratsim> different tradeoffs |
15:14:36 | Araq | state machine + next is pretty nice but needs to be optimized into our inline iterators |
15:15:47 | FromDiscord | <mratsim> I don't think I could do my tree traversal with next iterators |
15:15:53 | FromDiscord | <mratsim> or not as easily |
15:15:56 | FromGitter | <alehander92> that seems most suitable to me as well |
15:15:56 | FromDiscord | <kodkuce> @sealegs did you try minimal example , that chat one, if its really creashing should open issue |
15:17:39 | Araq | > people want to write map(it + 1).map(it * 2).reduce(sum) |
15:17:46 | Araq | so maybe we should give them |
15:18:13 | FromDiscord | <sealegs> Echo after what? My issue is that the program crashes when I disconnect the websocket manually and even not manually, so what I want to do is make it reconnect to the server successfully. I am trying to make a discord bot library. |
15:18:15 | Araq | fp: map(it + 1).map(it * 2).reduce(sum) |
15:18:49 | Araq | so that we have a macro 'fp' that sees a larger picture and can optmize things properly |
15:18:58 | Araq | we need to work smarter, not harder. |
15:19:01 | * | isaac[m]1 joined #nim |
15:19:02 | * | nergal[m]1 joined #nim |
15:19:02 | * | lqdev[m] joined #nim |
15:19:03 | * | BitPuffin joined #nim |
15:19:03 | * | Demos[m] joined #nim |
15:19:03 | * | leorize[m] joined #nim |
15:19:03 | * | GitterIntegratio joined #nim |
15:19:03 | * | k0mpjut0r joined #nim |
15:19:03 | * | Connor[m] joined #nim |
15:19:07 | * | vycb[m] joined #nim |
15:19:08 | * | skrylar[m] joined #nim |
15:19:08 | * | nc-x[m] joined #nim |
15:19:08 | * | macsek1911[m] joined #nim |
15:19:08 | * | Mike[m]3 joined #nim |
15:19:08 | * | d-nice2[m] joined #nim |
15:19:08 | * | spymasterd[m] joined #nim |
15:19:08 | * | yglukhov[m] joined #nim |
15:19:08 | * | Miguelngel[m] joined #nim |
15:19:08 | * | LEdoian[m] joined #nim |
15:19:09 | * | salotz[m] joined #nim |
15:19:09 | * | aeverr[m] joined #nim |
15:19:09 | * | Balu[m] joined #nim |
15:19:09 | * | zacharycarter[m] joined #nim |
15:19:09 | * | planetis[m] joined #nim |
15:19:09 | * | zielmicha[m]1 joined #nim |
15:19:09 | * | meff[m] joined #nim |
15:19:09 | * | xomachine[m] joined #nim |
15:19:09 | * | TheManiac[m] joined #nim |
15:19:09 | * | Manny8888 joined #nim |
15:19:10 | * | pigmej joined #nim |
15:19:10 | * | lasso[m] joined #nim |
15:19:25 | Araq | Nim is about reducing the language's complexity by macros |
15:20:29 | Araq | yeah yeah, I know, I know, it's not the same thing and then you can't "compose" all your other iterators that are outside the 'fp' context |
15:20:30 | disruptek | well, at least it could sidestep a syntax issue. |
15:21:22 | disruptek | does it really buy something over `...`? |
15:22:26 | * | solitudesf quit (Read error: Connection reset by peer) |
15:22:43 | * | solitudesf joined #nim |
15:22:49 | * | drewr quit (Quit: ERC (IRC client for Emacs 26.3)) |
15:22:55 | * | MightyJoe joined #nim |
15:23:03 | Araq | disruptek, what do you mean, '...'? |
15:23:40 | disruptek | i'm picturing `...` as an operator that folds two iterators into one. |
15:23:58 | FromGitter | <mratsim> Or we can embrace the ecosystem and redirect people to โrecommended librariesโ like zero-functional |
15:25:31 | Araq | if that worked we wouldn't get these PRs |
15:25:38 | * | cyraxjoe quit (Ping timeout: 258 seconds) |
15:25:52 | disruptek | maybe the pr is just to the wrong project. |
15:26:17 | Araq | and I'm not blaming anybody, we have sequtils.nim already some stuff "clearly belongs into there" |
15:26:30 | FromGitter | <bung87> @mratsim do you have idea about this ? โ โ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dfa4525260751301ccd964e] |
15:26:47 | disruptek | the compiler doesn't need any of these routines, apparently. |
15:27:31 | Araq | disruptek, the compiler doesn't import sequtils, maybe in some section of the code where I wasn't critical enough |
15:27:51 | Araq | gg sequtils compiler |
15:27:51 | Araq | compiler\commands.nim:30: wordrecg, parseutils, nimblecmd, parseopt, sequtils, lineinfos, |
15:27:51 | Araq | compiler\extccomp.nim:17: lineinfos, std / sha1, streams, pathutils, sequtils, times, strtabs |
15:27:52 | Araq | compiler\nimblecmd.nim:12: import parseutils, strutils, strtabs, os, options, msgs, sequtils, |
15:27:54 | Araq | 3 matches |
15:27:56 | Araq | ^ ha |
15:28:16 | FromGitter | <mratsim> @bung87 The compiler sometimes get confused when you have `Foo[T] = RooRaw` but I donโt know about this issue, is that in Chronos? |
15:28:17 | FromGitter | <bung87> goโs package have a rank system |
15:28:59 | disruptek | interesting idea, but i think nim would rather limit itself to rank0. |
15:29:55 | FromGitter | <bung87> https://github.com/bung87/cero/blob/master/src/cero/internet/reactor.nim here just few lines, could you take a look at it. |
15:31:25 | FromGitter | <bung87> I think itโs a good idea to have package rank system , I hate nodejs small package |
15:31:48 | Araq | can we please focus on the issue at hand? |
15:32:10 | disruptek | i like the idea of putting this stuff in zero-functional. |
15:32:13 | Araq | sequtils exists and somebody found missing parts |
15:32:14 | FromDiscord | <kodkuce> @sealegs does same crash heppend on minimal example? |
15:32:25 | disruptek | then it exists and it can always be brought in later. |
15:32:27 | FromDiscord | <kodkuce> @sealegs that chat one example |
15:32:53 | Araq | now we can pretend that "go patch some other lib instead" is a nice way to manage our community |
15:33:07 | * | Vladar quit (Quit: Leaving) |
15:33:08 | disruptek | how does it not solve the problem? |
15:33:31 | FromDiscord | <sealegs> chat one example? |
15:33:33 | Araq | or we find policies that work better |
15:33:54 | disruptek | there's already a policy of debuting new material in 3rd-party. |
15:33:58 | FromGitter | <bung87> or like python have a community repo |
15:34:11 | FromGitter | <bung87> no ,sorry like django |
15:34:52 | FromDiscord | <kodkuce> @sealegs https://github.com/treeform/ws scroll down litte there is example |
15:34:53 | * | narimiran quit (Ping timeout: 245 seconds) |
15:35:04 | * | marmotini_ quit (Remote host closed the connection) |
15:35:14 | disruptek | there's no reason that core can't make sure zero-functional works well, just as it'd have to do to make sure these work well in stdlib. |
15:35:48 | disruptek | or maybe you want to maintain zero-functional, too? |
15:36:01 | Araq | pkg "zero_functional", "nim c -r test.nim" |
15:36:09 | Araq | ^ from important_packages.nim |
15:36:20 | Araq | we do ensure it continues to work well to the best of our knowledge |
15:36:22 | disruptek | yes, so what's the problem. ๐ |
15:36:32 | FromDiscord | <sealegs> I haven't used treeform's ws |
15:36:56 | disruptek | why isn't that the right place for this? |
15:37:13 | Araq | the problem is that sequtils already exists and could have a countIt template |
15:37:30 | disruptek | so add that one. |
15:38:56 | disruptek | you're allowed to use 3rd-party libs, too, Araq. ๐คฃ |
15:39:04 | Araq | well somebody did and he also added more than just that. and since he put in the effort already it's only fair to give him some influence over sequtils' evolution |
15:39:10 | FromGitter | <Willyboar> Araq search someone to give a xmas present. |
15:39:51 | disruptek | this isn't about foldl's feelings, though i think it's pretty exceptional to give this much care to such a pr. a credit to foldl's work. |
15:40:55 | Araq | well it's a general pattern and I have no good solutions. I can tell him to only add X, Y, Z but it feels pretty arbitrary |
15:41:26 | * | marmotini_ joined #nim |
15:41:42 | disruptek | it's not arbitrary; you have to be the gatekeeper with an overarching vision that goes beyond feelings and personal needs and wants. |
15:41:53 | Araq | and why do I get to decide this, I don't use sequtils myself anyway |
15:41:57 | FromDiscord | <mratsim> Open a RFC: future of sequtils |
15:43:10 | disruptek | you can always add in the future, but it's damned hard to remove it later. |
15:43:32 | * | marmotini_ quit (Remote host closed the connection) |
15:43:46 | Araq | yeah I know but sequtils.countIt isn't another async framework, things are not equal |
15:44:10 | * | marmotini_ joined #nim |
15:44:39 | disruptek | okay, so the policy is that it's okay to richen stdlib. |
15:44:41 | dom96 | what's this about? |
15:44:54 | disruptek | !pull sequtils |
15:44:55 | disbot | https://github.com/nim-lang/Nim/pull/12887 -- 3add more utilities to `sequtils` 7& 29 more... |
15:45:17 | Araq | dude that bot is awesome. if only it would listen to me |
15:45:22 | Araq | !pull sequtils |
15:45:23 | disbot | https://github.com/nim-lang/Nim/pull/12887 -- 3add more utilities to `sequtils` 7& 29 more... |
15:45:27 | FromDiscord | <Milerius> xD araq |
15:45:57 | FromDiscord | <Milerius> is it possible to speedup the downloading time of the httpclient ? |
15:45:58 | disruptek | disbot is a fickle one. |
15:46:00 | * | yglukhov[m] quit (Remote host closed the connection) |
15:46:00 | * | isaac[m]1 quit (Read error: Connection reset by peer) |
15:46:01 | * | Demos[m] quit (Write error: Connection reset by peer) |
15:46:01 | * | Miguelngel[m] quit (Read error: Connection reset by peer) |
15:46:01 | * | TheManiac[m] quit (Read error: Connection reset by peer) |
15:46:03 | * | Mike[m]3 quit (Read error: Connection reset by peer) |
15:46:03 | * | zielmicha[m]1 quit (Read error: Connection reset by peer) |
15:46:06 | * | zacharycarter[m] quit (Remote host closed the connection) |
15:46:06 | * | Balu[m] quit (Remote host closed the connection) |
15:46:06 | * | lasso[m] quit (Remote host closed the connection) |
15:46:06 | * | planetis[m] quit (Remote host closed the connection) |
15:46:17 | * | salotz[m] quit (Read error: Connection reset by peer) |
15:46:17 | * | aeverr[m] quit (Remote host closed the connection) |
15:46:18 | * | macsek1911[m] quit (Remote host closed the connection) |
15:46:18 | * | nergal[m]1 quit (Remote host closed the connection) |
15:46:19 | * | d-nice2[m] quit (Read error: Connection reset by peer) |
15:46:20 | * | xomachine[m] quit (Read error: Connection reset by peer) |
15:46:20 | * | meff[m] quit (Read error: Connection reset by peer) |
15:46:21 | * | vycb[m] quit (Read error: Connection reset by peer) |
15:46:21 | FromDiscord | <Milerius> It's seem's really slow right now |
15:46:23 | * | lqdev[m] quit (Remote host closed the connection) |
15:46:24 | * | spymasterd[m] quit (Read error: Connection reset by peer) |
15:46:24 | * | nc-x[m] quit (Remote host closed the connection) |
15:46:25 | * | k0mpjut0r quit (Write error: Connection reset by peer) |
15:46:25 | * | BitPuffin quit (Remote host closed the connection) |
15:46:26 | * | leorize[m] quit (Read error: Connection reset by peer) |
15:46:26 | * | pigmej quit (Remote host closed the connection) |
15:46:26 | * | skrylar[m] quit (Remote host closed the connection) |
15:46:26 | * | nsf quit (Quit: WeeChat 2.6) |
15:46:27 | * | GitterIntegratio quit (Write error: Connection reset by peer) |
15:46:27 | * | Connor[m] quit (Remote host closed the connection) |
15:46:27 | * | LEdoian[m] quit (Write error: Connection reset by peer) |
15:46:27 | * | Manny8888 quit (Remote host closed the connection) |
15:46:45 | FromDiscord | <Milerius> i download a simple 5mo files it's take 30 seconds to download (i have 1Gbps/s) |
15:47:35 | FromDiscord | <kodkuce> @sealegs why dident usee treeform ws? |
15:47:53 | dom96 | kodkuce: what's wrong with niv's? |
15:48:20 | dom96 | Araq, cool, when did we get the {.since.} annotation? |
15:49:16 | FromDiscord | <sealegs> I liked niv's websocket.nim, but I'll try and see if treeform's ws work |
15:49:39 | dom96 | sealegs: what problems are you having with niv's? |
15:51:05 | shashlick | Milerius: did you check out nimgrab |
15:51:16 | disruptek | !repo nimgrab |
15:51:17 | disbot | no results ๐ข |
15:51:23 | disruptek | !package nimgrab |
15:51:24 | disbot | no packages match ๐ข |
15:51:27 | dom96 | Milerius: what's your code look like? |
15:51:35 | shashlick | dom96: made a choosenim PR, also we need to get 0.5.0 built |
15:51:43 | shashlick | disruptek: it is shipped with nim |
15:51:51 | disruptek | what is it? |
15:51:57 | dom96 | shashlick, how do we do that? |
15:52:02 | Araq | dom96, implementation here https://github.com/nim-lang/Nim/blob/devel/lib/system/inclrtl.nim#L52 |
15:52:07 | FromDiscord | <Milerius> ```nim |
15:52:07 | FromDiscord | <Milerius> import os |
15:52:08 | FromDiscord | <Milerius> import asyncdispatch, httpclient |
15:52:08 | FromDiscord | <Milerius> import zip/zipfiles |
15:52:08 | FromDiscord | <Milerius> |
15:52:08 | FromDiscord | <Milerius> if os.existsDir(os.CurDir & "/assets/tools/mm2"): |
15:52:08 | FromDiscord | <Milerius> echo "Assets Already Downloaded" |
15:52:10 | FromDiscord | <Milerius> quit(0) |
15:52:11 | FromDiscord | <Milerius> |
15:52:13 | FromDiscord | <Milerius> var client = newAsyncHttpClient() |
15:52:14 | FromDiscord | <Milerius> var target_dir = os.CurDir & "/tmp" |
15:52:16 | FromDiscord | <Milerius> var target_filename = "mm2" |
15:52:17 | FromDiscord | <Milerius> var target_file_extensions = ".zip" |
15:52:19 | FromDiscord | <Milerius> var filename = "" |
15:52:20 | FromDiscord | <Milerius> |
15:52:22 | FromDiscord | <Milerius> if not os.existsDir(target_dir): |
15:52:23 | FromDiscord | <Milerius> echo "Create target dir: " & target_dir |
15:52:25 | FromDiscord | <Milerius> os.createDir(target_dir) |
15:52:26 | FromDiscord | <Milerius> |
15:52:28 | FromDiscord | <Milerius> proc onProgressChanged(total, progress, speed: BiggestInt) {.async.} = |
15:52:30 | FromDiscord | <Milerius> echo("Downloaded ", progress, " of ", total) |
15:52:32 | FromDiscord | <Milerius> echo("Current rate: ", speed div 1000, "kb/s") |
15:52:33 | FromDiscord | <Milerius> |
15:52:35 | FromDiscord | <Milerius> client.onProgressChanged = onProgressChanged |
15:52:36 | FromDiscord | <Milerius> |
15:52:37 | FromDiscord | <Milerius> proc asyncProc() {.async.} = |
15:52:39 | FromDiscord | <Milerius> echo "Downloading mm2" |
15:52:40 | FromDiscord | <Milerius> when defined(macosx): |
15:52:42 | Araq | Milerius: use a pastebin service |
15:52:42 | FromDiscord | <Milerius> filename = target_filename & "_darwin" & target_file_extensions |
15:52:44 | FromDiscord | <Milerius> await client.downloadFile("http://195.201.0.6/mm2/mm2-latest-Darwin.zip", |
15:52:47 | FromDiscord | <Milerius> target_dir & "/" & filename) <message clipped> |
15:52:47 | FromGitter | <Willyboar> Oh God! |
15:52:48 | * | Araq sighs |
15:53:07 | shashlick | dom96: you updated the github token but the build only gets posted with a tag |
15:53:21 | dom96 | Maybe disruptek could help us out by writing a Discord bridge in Nim that handles long pastes sanely |
15:53:32 | FromDiscord | <Milerius> https://pastebin.com/ChtaPzxB |
15:53:46 | disruptek | is the bridge on github somewhere? |
15:54:13 | Araq | you know what, I'm gonna add a section "evolving the stdlib" to our contributors guidelines |
15:54:22 | disruptek | good. |
15:54:37 | Araq | and one "policy" will be "small stuff will arbitrarily rejected or accepted" |
15:54:41 | FromDiscord | <sealegs> Dom96, basically, whenever the websocket disconnects, it crashes. I tried to use the `try` block, but it still crashes. I'm trying make it reconnect when it disconnects. |
15:55:13 | FromDiscord | <sealegs> Dom96, basically, whenever the websocket disconnects, it crashes. I tried using the `try` block, but it still crashes. I'm trying make it reconnect when it disconnects. |
15:55:21 | dom96 | sealegs: on which call does it crash? |
15:55:27 | Araq | disruptek, this means 'staticGetCurrentDir' is even more likely to be accepted :P |
15:55:38 | disruptek | weeee! ๐ |
15:55:39 | dom96 | disruptek, the current bridge uses some Go framework |
15:56:04 | disruptek | hm, okay. |
15:56:14 | disruptek | do you know if it has a name? |
15:56:18 | dom96 | Araq, can't wait for the inevitable static/it variant explosion :P |
15:56:35 | dom96 | disruptek, matterbridge |
15:56:45 | * | aeverr[m] joined #nim |
15:57:01 | dom96 | Milerius: can't see anything that would slow this down. You sure the server you're requesting this from isn't just slow? :P |
15:57:21 | FromDiscord | <Milerius> @dom96 with curl it's take 2 seconds |
15:57:27 | FromDiscord | <Milerius> with the httpclient ~30 |
15:57:29 | * | Hideki_ joined #nim |
15:57:45 | FromGitter | <Willyboar> disruptek you can find a lot of bridges, I saw and some python libs |
15:58:13 | FromDiscord | <sealegs> it crashes on where the line disconnects the ws manually or if not manually not sure |
15:58:13 | dom96 | Milerius: can you try downloading http://speedtest-lon1.digitalocean.com/100mb.test? |
15:58:36 | FromDiscord | <Milerius> ``` |
15:58:36 | FromDiscord | <Milerius> โ atomic_dex_desktop git:(master) time curl http://195.201.0.6/mm2/mm2-latest-Darwin.zip -o toto.zip |
15:58:36 | FromDiscord | <Milerius> % Total % Received % Xferd Average Speed Time Time Time Current |
15:58:37 | FromDiscord | <Milerius> Dload Upload Total Spent Left Speed |
15:58:37 | FromDiscord | <Milerius> 100 16.2M 100 16.2M 0 0 19.1M 0 --:--:-- --:--:-- --:--:-- 19.1M |
15:58:39 | FromDiscord | <Milerius> curl http://195.201.0.6/mm2/mm2-latest-Darwin.zip -o toto.zip 0,02s user 0,12s system 16% cpu 0,859 total |
15:58:41 | FromDiscord | <Milerius> ``` |
15:59:03 | FromDiscord | <Milerius> downloaded in 2 seconds |
15:59:14 | dom96 | sealegs: what's the stack trace? |
15:59:26 | * | drewr joined #nim |
15:59:43 | FromDiscord | <Milerius> ๐ฎ It's faster now |
15:59:44 | FromDiscord | <kodkuce> dom96: dont remmeber exactly but i know i head some issues some stuff dident work, then i switched to treeform's and all worked np, plus i think @treeform has SSL too |
15:59:51 | FromDiscord | <Milerius> ``` |
15:59:51 | FromDiscord | <Milerius> โ atomic_dex_desktop git:(master) โ time ./tools/dependencies |
15:59:51 | FromDiscord | <Milerius> Create target dir: ./tmp |
15:59:51 | FromDiscord | <Milerius> Downloading mm2 |
15:59:52 | FromDiscord | <Milerius> Downloaded 4000 of 17048388 |
15:59:52 | FromDiscord | <Milerius> Current rate: 4kb/s |
15:59:53 | FromDiscord | <Milerius> Downloading Finished |
15:59:53 | FromDiscord | <Milerius> Opening: ./tmp/mm2_darwin.zip |
15:59:55 | FromDiscord | <Milerius> ./tools/dependencies 0,38s user 0,31s system 63% cpu 1,097 total |
15:59:57 | FromDiscord | <Milerius> ``` |
15:59:57 | federico3 | urgh |
15:59:58 | FromDiscord | <Milerius> Much faster now |
15:59:58 | disruptek | milerius: italian tune-up. |
16:00:19 | FromGitter | <Willyboar> disruptek https://github.com/milandamen/Discord-IRC-Python |
16:01:01 | FromDiscord | <Milerius> Perfect ! |
16:01:04 | FromDiscord | <Milerius> I'm happy now |
16:01:20 | dom96 | kodkuce: I've been using niv's for a while now for my game and it's been working fine. Tried treeform's but it had some deficiencies (not supporting PINGs properly IIRC). |
16:01:42 | dom96 | Milerius: so it was just a fluke? lol |
16:01:48 | shashlick | dude use a paste service man |
16:02:28 | shashlick | @dom96 - https://github.com/dom96/choosenim/pull/150 |
16:02:30 | disbot | โฅ Cleanup CI setup |
16:03:18 | FromDiscord | <sealegs> dom96 |
16:03:19 | FromDiscord | <sealegs> https://play.nim-lang.org/#ix=24N1 |
16:04:32 | FromDiscord | <Milerius> dom96 yeah there is no problem finally ! |
16:08:22 | * | icebattle joined #nim |
16:10:00 | sealmove | how to see number of passed/failed/skipped tests in unittest? |
16:10:30 | dom96 | sealegs: it looks like it happens on the recv call, you should be able to catch this though |
16:13:52 | shashlick | dom96: so what should we do for the choosenim release? should i build separately and send to you or do you want to delete the 0.5.0 tag and create it again? |
16:15:03 | dom96 | I can re-tag I suppose |
16:15:21 | dom96 | is the CI guaranteed to succeed now? |
16:16:40 | shashlick | yes it should be |
16:16:54 | * | planetis[m] joined #nim |
16:16:55 | planetis[m] | for loop macros dont work together with collect, unfortunately |
16:17:06 | Araq | planetis[m], how come? |
16:17:35 | planetis[m] | bc the inner macro is not resolved yet? dunno |
16:17:49 | planetis[m] | but doesn't compile |
16:17:49 | * | marmotini_ quit (Read error: Connection reset by peer) |
16:17:53 | Araq | example? |
16:18:03 | dom96 | shashlick, done |
16:18:13 | * | Hideki_ quit (Ping timeout: 245 seconds) |
16:18:42 | planetis[m] | https://github.com/b3liever/looper |
16:18:45 | planetis[m] | just replace pairs in the examples with enumerate |
16:18:57 | shashlick | dom96: cool i'll keep an eye |
16:19:04 | dom96 | shashlick, thanks! |
16:21:06 | * | endragor quit (Remote host closed the connection) |
16:22:23 | * | endragor joined #nim |
16:22:30 | * | luis_ joined #nim |
16:23:20 | * | luis_ quit (Remote host closed the connection) |
16:24:09 | * | clyybber quit (Quit: WeeChat 2.7) |
16:26:00 | * | luis_ joined #nim |
16:26:12 | * | luis_ quit (Read error: Connection reset by peer) |
16:27:08 | Araq | planetis[m], for me 'enumerate' doesn't work |
16:27:18 | Araq | no matter if used inside 'collect' or not |
16:28:19 | Araq | tforloop_macro1.nim works though, how strange |
16:29:06 | * | marmotini_ joined #nim |
16:29:39 | Araq | oh, I forgot {.experimental: "forLoopMacros".} |
16:30:03 | FromDiscord | <Milerius> We cannot call copyFile from nimble nims script is normal ? |
16:30:52 | FromDiscord | <Milerius> I have to do `exec("cp data/osx/Info.plist bin/atomic_dex_desktop.app/Contents/")` instead |
16:31:11 | Araq | ha and here I am thinking we already support too much things at compile-time |
16:31:14 | FromDiscord | <Milerius> of `os.copyFile("from", "to")` |
16:31:32 | Araq | nimscript has copyFile |
16:31:51 | Araq | well it has cpFile |
16:31:55 | Araq | which is what you should use |
16:32:00 | FromDiscord | <Milerius> ah ? |
16:32:03 | FromDiscord | <Milerius> Because i got an error |
16:32:12 | FromDiscord | <Milerius> ` ... /Users/romanszterg/CLionProjects/atomicDEX-QT/atomic_dex_desktop/atomic_dex_desktop_92718.nims(21, 8) Error: this proc is not available on the NimScript target; usage of 'copyFile' is a user-defined error` |
16:32:25 | FromDiscord | <Milerius> so i have to use cpFile instead alright ? |
16:32:31 | Araq | right |
16:32:38 | FromDiscord | <Milerius> There is a link where i can read all the function that is supported ? |
16:32:42 | sealmove | unittest really doesn't provide stats? at least how many tests failed/passed... |
16:33:15 | Araq | Milerius: everything in os.nim that is not marked as .noNimScript is supported |
16:33:26 | FromDiscord | <Milerius> ok thank's |
16:33:28 | federico3 | sealmove: https://github.com/nim-lang/Nim/issues/5114 |
16:33:29 | disbot | โฅ unittest improvements |
16:33:37 | federico3 | we really need a new unittest |
16:33:56 | Araq | there is no documentation for it and disruptek is cleaning up the support |
16:34:07 | sealmove | we really do |
16:34:50 | Araq | all we need is more polish for testament |
16:35:33 | disruptek | wut |
16:35:48 | disruptek | i don't even know Polish. |
16:36:18 | * | isaac[m]1 joined #nim |
16:36:19 | * | nergal[m]1 joined #nim |
16:36:20 | * | lqdev[m] joined #nim |
16:36:20 | * | BitPuffin joined #nim |
16:36:20 | * | salotz[m] joined #nim |
16:36:20 | * | Demos[m] joined #nim |
16:36:20 | * | leorize[m] joined #nim |
16:36:20 | * | GitterIntegratio joined #nim |
16:36:21 | * | k0mpjut0r joined #nim |
16:36:21 | * | Connor[m] joined #nim |
16:36:24 | * | skrylar[m] joined #nim |
16:36:24 | * | nc-x[m] joined #nim |
16:36:24 | * | macsek1911[m] joined #nim |
16:36:25 | * | vycb[m] joined #nim |
16:36:25 | * | LEdoian[m] joined #nim |
16:36:25 | * | yglukhov[m] joined #nim |
16:36:25 | * | Miguelngel[m] joined #nim |
16:36:25 | * | Mike[m]3 joined #nim |
16:36:26 | * | d-nice2[m] joined #nim |
16:36:26 | * | spymasterd[m] joined #nim |
16:36:26 | * | Manny8888 joined #nim |
16:36:26 | * | xomachine[m] joined #nim |
16:36:26 | * | Balu[m] joined #nim |
16:36:26 | * | pigmej joined #nim |
16:36:27 | * | zielmicha[m]1 joined #nim |
16:36:27 | * | zacharycarter[m] joined #nim |
16:36:28 | * | lasso[m] joined #nim |
16:36:28 | * | meff[m] joined #nim |
16:36:28 | * | TheManiac[m] joined #nim |
16:36:47 | FromDiscord | <Milerius> @araq i don't find cpFile inside the os.nim file, it's normal ? |
16:37:01 | FromDiscord | <Milerius> i can use it but i want to find the file with the supported function |
16:37:18 | sealmove | is it possible to make testament into a stdlib and just do `import testament`? |
16:37:50 | * | endragor quit (Remote host closed the connection) |
16:37:50 | sealmove | I mean theoretically |
16:37:57 | sealmove | I know it doesn't work like that atm |
16:38:42 | sealmove | Milerius: the procs have slightly different names than in nimscript, but they are essentially the same |
16:39:01 | sealmove | https://nim-lang.org/docs/os.html#copyFile%2Cstring%2Cstring |
16:40:14 | Araq | https://nim-lang.org/docs/nimscript.html#cpFile%2Cstring%2Cstring |
16:40:46 | Araq | it's inside nimscript.nim which is part of system.nim, no import required |
16:40:54 | Araq | (in retrospect ... what a bad idea...) |
16:44:39 | * | endragor joined #nim |
16:44:59 | shashlick | disruptek: disbot needs to be able to pull documentation |
16:45:19 | shashlick | !doc cpFile |
16:47:12 | FromDiscord | <Milerius> thanks ๐ |
16:47:14 | FromDiscord | <Milerius> i love ! |
16:47:44 | Araq | planetis[m], I have a fix for that |
16:47:45 | federico3 | Araq: if it can replace unittest and provide the same features, yes |
16:48:51 | Araq | why "same features"? what's so desireable about output in [sections] |
16:49:45 | * | endragor quit (Ping timeout: 268 seconds) |
16:55:44 | federico3 | huh? |
16:57:51 | Araq | as I said elsewhere, testament is what we use to ensure Nim's quality, it's actually used and gets improvements. 'unittest' is an unloved child, we accept PRs but so far nobody really fixed its bugs. |
16:58:42 | federico3 | by all means it's better to have one tool only and have it well mantained |
16:58:47 | Araq | testament also has CI integration, can run tests in parallel and offers process isolation. |
16:58:52 | federico3 | sure |
16:59:31 | federico3 | it does not offer the features listed in 5114 tho and it's not backward compatible / with unittest |
16:59:39 | sealmove | Araq: testament is great, but we need to make it into an stdlib so that projects other than the Nim compiler can use it easily? |
17:00:21 | Araq | sealmove, you cannot import it but then that's not how it's designed to work. how do you get process isolation via an import? it's impossible |
17:00:33 | FromDiscord | <Milerius> Is it possible to retrieve the Executable Path using `os` (not the current dir, but the executable path) |
17:00:36 | FromDiscord | <Milerius> Is it possible to retrieve the Executable Path using `os` (not the current dir, but the executable path) ? |
17:00:46 | Araq | os.getAppDir() |
17:00:49 | sealmove | ok, we at least need good documentation for how to use in a project |
17:00:57 | federico3 | that's not enough |
17:01:01 | FromDiscord | <Milerius> i see there is : getExecPath1 |
17:01:30 | federico3 | we need an importable component that can be used to define test syntax, and a test runner that is executed externally |
17:01:58 | Araq | we have that, the test syntax is inside |
17:01:59 | leorize | Araq: it can just call itself with special parameters as a way to isolate :P |
17:02:05 | leorize | that's how autotools does it iirc |
17:02:05 | Araq | discard """ ... """ setions |
17:02:13 | Araq | leorize, smart :P |
17:02:16 | federico3 | that's pretty horrible |
17:04:01 | FromDiscord | <Milerius> We cannot chain parent dir call ? |
17:04:08 | Araq | federico3, *shrug*, it works pretty well IME. maybe we could add a parser so that it understands unittest sections |
17:04:12 | FromDiscord | <Milerius> Such as `os.getAppDir.parentDir.parentDir` ? |
17:04:22 | federico3 | here's a good example of reasons for having test-specific syntax https://docs.pytest.org/en/latest/fixture.html |
17:04:54 | FromDiscord | <Milerius> Ah i understnad |
17:05:03 | FromDiscord | <Milerius> Ah i understand, i need to add parenthesis for the ufcs :p |
17:05:21 | federico3 | among other things, pytest creates a graph of setup functions based on the needs of each test and runs only what is required |
17:05:30 | leorize | @Milerius: that doesn't sound too right :P |
17:07:24 | federico3 | it also Parametrizing fixtures for an example on how useful it can be |
17:08:10 | Araq | Milerius: no, you only need () for nullary functions |
17:08:35 | Araq | as it's ambiguous otherwise since procs are also first class entities ( map(someProc) ) |
17:08:58 | Araq | UCFS has nothing to do with it really |
17:08:58 | FromDiscord | <Milerius> Ok i got |
17:09:02 | FromDiscord | <Milerius> Ok i got it |
17:09:07 | FromDiscord | <Milerius> Thank's for the precision |
17:11:40 | Araq | federico3, pytest does plenty of things I consider questionable, it's the "language inside a language" problem. so instead of calling f(3) I say @pytest.parametrize(x, 3) def f(x) |
17:12:16 | Araq | DSLs are better if they offer something the host language doesn't. |
17:12:36 | Araq | but I already know how to call a function in Python, thanks, let me use Python inside Python. |
17:13:06 | federico3 | no, that's required to make the test decarative: the pytest runner understand that a test has to be run twice and it's than able to run setup/teardown accordingly |
17:13:56 | federico3 | and I agree that it's a bit of a hack because python does not support DSLs natively |
17:14:27 | federico3 | but Nim *should* shine with test DSLs in comparison |
17:16:40 | Araq | maybe if you design the DSL well. but don't make me write 'expectException FooBar' when I already know how to catch exceptions |
17:17:15 | Araq | don't make me write 'section "desc" ' when I already know how to write 'echo'. |
17:17:19 | federico3 | having a declarative syntax so that testament can understand what to do would make unittest replaceable (e.g. how to order tests/setup/teardowns) |
17:18:51 | shashlick | dom96: the lin and osx binaries were posted for choosenim, but windows failed due to a network issue - can you restart that build? |
17:18:54 | federico3 | actually you are not required to use expectException, it just saves you the boilerplate of try-except-raise |
17:19:02 | shashlick | dom96: https://travis-ci.org/dom96/choosenim/jobs/626776798 |
17:20:39 | * | endragor joined #nim |
17:20:57 | madprops | courageous nim gets rid of 0-based indexing |
17:21:13 | federico3 | bonus points if we can put some tests close to the real procs |
17:26:20 | planetis[m] | awesome thanks Araq |
17:26:41 | Araq | you need to patch enumerate though |
17:26:49 | Araq | var i = -1 |
17:26:55 | Araq | for x in a: |
17:26:56 | FromGitter | <bung87> ```code paste, see link``` โ โ where is the `Callback` type ?, I can only find it from std source and not exported. [https://gitter.im/nim-lang/Nim?at=5dfa61608897197969bb783b] |
17:26:57 | Araq | inc i |
17:27:01 | Araq | (i, x) |
17:27:07 | Araq | so that collect can handle it |
17:27:27 | Araq | for obvious reasons |
17:27:39 | * | luis_ joined #nim |
17:28:18 | FromGitter | <bung87> I remeber I tried using async libs before, then give up. |
17:30:49 | * | krux02 quit (Remote host closed the connection) |
17:31:29 | stefantalpalaru | What is the "benign" pragma used for? |
17:32:24 | disruptek | don't worry; it's harmless. |
17:32:35 | Araq | {.pragma: benign, gcsafe, locks: 0.} |
17:32:44 | stefantalpalaru | OK |
17:33:13 | Araq | bung87: not sure, Callback doesn't have to be exported though because proc types in Nim are structural types |
17:33:13 | disruptek | disbot can pull docs once i write ndoc. |
17:33:16 | disruptek | !repo ndoc |
17:33:18 | disbot | https://github.com/nodeca/ndoc -- 9ndoc: 11js port of pdoc, with extentions 15 93โญ 8๐ด 7& 29 more... |
17:33:27 | disruptek | nope. still not that one. |
17:33:31 | disruptek | !repo disruptek/ndoc |
17:33:32 | disbot | https://github.com/disruptek/ndoc -- 9ndoc: 11like pydoc but for nim 15 0โญ 0๐ด |
17:33:57 | disruptek | if i write a unittest it will be kinda like ava |
17:36:04 | disruptek | what drives me nuts about unittest is that i cannot see any of my normal output while it runs. |
17:36:21 | * | mrgaturus joined #nim |
17:36:22 | disruptek | forget npeg trace, for example. |
17:37:01 | * | nsf joined #nim |
17:37:17 | disruptek | testament is too crude, imo. |
17:38:40 | mrgaturus | what is the equivalent of xor on sets? |
17:42:03 | FromGitter | <bung87> @Araq ok , get it , like typescript interface . |
17:42:46 | disruptek | mrgaturus: there's a difference that affects both sets. |
17:43:00 | disruptek | see the sets module. |
17:43:17 | disruptek | semmetricDifference() |
17:49:15 | mrgaturus | thanks, but i mean for set[T] |
17:52:53 | * | Vladar joined #nim |
17:53:41 | FromGitter | <bung87> ```code paste, see link``` โ โ do I need prevent gc collect `self `? [https://gitter.im/nim-lang/Nim?at=5dfa67a584c21677092514f3] |
17:57:03 | FromGitter | <bung87> ```code paste, see link``` โ โ it throw [https://gitter.im/nim-lang/Nim?at=5dfa686f0cb24d1d44e0c047] |
18:00:05 | * | luis_ quit (Quit: luis_) |
18:00:40 | sealmove | weird, I made a macro that produces this code: |
18:00:42 | sealmove | let test_if_b1 = 123'i64 |
18:00:44 | sealmove | result.test_if_b1 = test_if_b1y |
18:00:54 | sealmove | and it fails with Error: type mismatch: got <NimNode> but expected 'int64' |
18:00:57 | FromGitter | <Milerius> Is it possible to compile a single file with a different compiler using nim command line ? |
18:01:01 | * | luis_ joined #nim |
18:01:14 | leorize | bung87: yes |
18:01:27 | sealmove | result.test_if_b1 = test_if_b1 (not test_if_b1y) |
18:01:32 | * | luis_ quit (Client Quit) |
18:01:35 | leorize | Milerius: no |
18:02:06 | FromGitter | <Milerius> Thisi s not possible to specify nim.cfg for a single directory ? :/ |
18:03:49 | Araq | unclear what you want, compile some files via VCC and others via mingw? the object files are not compatible |
18:06:01 | sealmove | how to tell Nim compiler not to check for types? |
18:06:53 | lqdev[m] | @sealmove: why? |
18:07:22 | sealmove | let test_if_b1 = 123'i64 โ disbot |
18:07:23 | sealmove | โ20:00:13 sealmove | result.test_if_b1 = test_if_b1 |
18:07:26 | sealmove | sorry |
18:07:46 | sealmove | let test_if_b1 = 123'i64 |
18:07:48 | sealmove | result.test_if_b1 = test_if_b1 |
18:07:59 | sealmove | this fails with `Error: type mismatch: got <NimNode> but expected 'int64'` |
18:08:12 | FromGitter | <bung87> before it throw asgnRef , I just do `self.reactor = reactor` from connectionโs proc |
18:08:27 | sealmove | so I need compiler to trust me that `test_if_b1` is an int64 |
18:08:44 | FromGitter | <bung87> GC_ref(self) still not work. |
18:11:12 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dfa6bc0b1701e50ca481b22] |
18:14:05 | FromGitter | <bung87> oh,my bad ,forget it |
18:15:43 | sealmove | or maybe I need bindsym? |
18:15:46 | sealmove | :S |
18:16:36 | leorize | sealmove: uhmmmm if it said that it's not an int64, then you gotta see why :P |
18:16:41 | leorize | how are you generating that code? |
18:17:31 | lqdev[m] | sealmove: show me how you generate your code. |
18:17:36 | lqdev[m] | aka the macro's source code |
18:17:50 | lqdev[m] | right now I can only make assumptions about what you're doing. |
18:19:43 | * | Vladar quit (Quit: Leaving) |
18:23:35 | lqdev[m] | shashlick: any ideas on how I could solve this? https://github.com/liquid600pgm/euwren/runs/355000147#step:6:100 it's basically that issue with the "non-existent" branch that actually exists not checking out properly |
18:24:00 | mrgaturus | is there a way for toggle elements (like xor does on bitflags) on set[T]? |
18:27:19 | sealmove | lqdev: the codegen is complex, I am not able to reproduce in a simple example, so it could be anything... :( |
18:28:01 | FromDiscord | <mratsim> what CI is it? Circle? |
18:28:59 | leorize | github actions i think |
18:29:10 | FromDiscord | <mratsim> Both Travis and Azure give no detail in the Github action tab :/ |
18:30:07 | leorize | azure gives you some :P |
18:30:44 | leorize | https://github.com/nim-lang/Nim/runs/349699680 |
18:31:07 | leorize | but otherwise it doesn't give you detailed build log |
18:31:18 | FromDiscord | <mratsim> huh |
18:31:19 | leorize | you can't fight github on their own turf :P |
18:31:29 | FromDiscord | <mratsim> I always get the same reporting as the one in the failed windows job |
18:31:34 | FromDiscord | <mratsim> "view more details on Azure" |
18:31:46 | FromDiscord | <mratsim> Github is Microsoft, Azure is Microsoft |
18:31:57 | leorize | they are different teams |
18:32:01 | leorize | microsoft is big |
18:35:07 | * | mrgaturus quit (Quit: WeeChat 2.7) |
18:35:42 | shashlick | @lqdev - is that a git tag or branch? |
18:37:51 | leorize | @mratsim: if you want detailed azure errors report on github you have to integrate with azure pipelines |
18:38:09 | leorize | I added that to testament and it's a mess because of how azure pipelines works |
18:38:42 | lqdev[m] | shashlick: it's a branch |
18:39:21 | * | narimiran joined #nim |
18:39:44 | shashlick | can you try it manually and see? |
18:40:20 | stefantalpalaru | Where so modules imported by passing `--import:foo` to the compiler end up being imported? |
18:40:49 | stefantalpalaru | *do |
18:40:50 | leorize | stefantalpalaru: the module you passed to the compiler for complination |
18:41:04 | leorize | it used to add it to everything, but that changed iirc |
18:41:18 | stefantalpalaru | Yes, but it doesn't look like it's imported only in the main module. |
18:41:22 | lqdev[m] | shashlick: I encountered this numerous times locally, when building on other machines. this only happens the first time you run the build, it works after that. |
18:41:42 | lqdev[m] | other people encounter that error, too, I always tell them to try again. |
18:42:05 | shashlick | that's weird |
18:44:21 | shashlick | it works second time cause the git repo is already downloaded |
18:44:29 | shashlick | but it is on master, not on fix-710 |
18:45:26 | lqdev[m] | strange indeed |
18:45:42 | stefantalpalaru | How do I echo something at compile time? |
18:47:03 | shashlick | looks like we aren't pulling everything needed |
18:49:26 | leorize | stefantalpalaru: `static: echo "something"` |
18:49:39 | shashlick | even if we do, there's no way to know if somtehing is a tag or a branch |
18:49:40 | FromDiscord | <mratsim> @leorize so how do you integrate with Github? |
18:49:44 | shashlick | and for remote branches, you need to --track |
18:49:59 | shashlick | can you open a defect please? |
18:50:08 | leorize | @mratsim: azure's Tests system is integrated with github |
18:50:20 | leorize | the errors message we got on github is thanks to that |
18:50:30 | leorize | look in testament/azure.nim for more details |
18:50:31 | stefantalpalaru | leorize: thanks |
18:50:38 | FromDiscord | <mratsim> ah so I need to enable Azure tests and not just Azure Pipelines |
18:50:55 | leorize | no |
18:50:57 | leorize | it's a feature in pipelines |
18:51:21 | leorize | https://dev.azure.com/nim-lang/Nim/_build/results?buildId=1208&view=ms.vss-test-web.build-test-results-tab |
18:51:25 | leorize | a really cool one :P |
18:54:24 | FromDiscord | <mratsim> would be nice to have that @stefantalpalaru, well as always, you need to Swim into Microsoft documentation to find anything |
18:56:20 | stefantalpalaru | Looking. |
18:56:42 | FromDiscord | <mratsim> Looking as well but I don't even understand where to find this (like widgets, dashboard ...) |
18:59:05 | FromDiscord | <Milerius> Hey |
18:59:10 | FromDiscord | <Milerius> How we solve ambiguous call ? |
18:59:16 | FromDiscord | <Milerius> ``` |
18:59:16 | FromDiscord | <Milerius> Error: ambiguous call; both system.fileExists(filename: string) [declared in /home/milerius/.choosenim/toolchains/nim-1.0.4/lib/system/nimscript.nim(132, 6)] and os.fileExists(filename: string) [declared in /home/milerius/.choosenim/toolchains/nim-1.0.4/lib/pure/os.nim(1002, 6)] match for: (string) |
18:59:16 | FromDiscord | <Milerius> ``` |
18:59:19 | FromDiscord | <Milerius> In nims script |
18:59:45 | FromDiscord | <mratsim> Here they mention a "Tests" tab that seems well hidden: https://www.azuredevopslabs.com/labs/vstsextend/github-azurepipelines/ |
19:00:11 | leorize | @Milerius: you see the different prefixes? pick one :) |
19:00:12 | FromDiscord | <mratsim> import os except fileExists |
19:00:15 | leorize | they are the same |
19:00:34 | FromDiscord | <mratsim> or just use os.fileExists(foo) |
19:00:39 | FromDiscord | <Milerius> Ok i got it |
19:00:43 | FromDiscord | <Milerius> THanks |
19:00:47 | FromDiscord | <Milerius> i'm so noob : |
19:00:49 | FromDiscord | <Milerius> i'm so noob :p |
19:00:54 | FromDiscord | <Milerius> It's the beginning thats why |
19:02:04 | FromDiscord | <mratsim> I would say that you shouldn't have this ambiguous call and it's a bug in Nimscript |
19:02:24 | FromDiscord | <mratsim> because system reexports os.fileExists |
19:04:30 | FromDiscord | <mratsim> ah I see @leorize @stefantalpalaru you need to create specific test tasks in Azure: https://docs.microsoft.com/en-us/learn/modules/run-quality-tests-build-pipeline/4-add-unit-tests seems a bit of work |
19:05:22 | leorize | @mratsim: uh, no |
19:05:41 | leorize | they have a test parser that can parse popular format |
19:05:47 | leorize | none of which testament can produce |
19:05:56 | FromDiscord | <mratsim> ah |
19:05:59 | stefantalpalaru | Is this how it's done for Nim? https://github.com/nim-lang/Nim/blob/cb0a20b9b4521be066f5878f77c224540f73f779/azure-pipelines.yml#L145 |
19:06:01 | leorize | so instead I just interface with their REST api to push the result manually |
19:06:33 | leorize | https://github.com/nim-lang/Nim/blob/devel/testament/azure.nim |
19:06:36 | leorize | ^ that's all the magic |
19:07:42 | stefantalpalaru | Oh, OK. I don't think we need it that bad, @mratsim. |
19:07:51 | FromDiscord | <mratsim> yeah I agree |
19:08:18 | FromDiscord | <mratsim> I just wanted better reporting of the log details in Github instead of clicking twice (once to get to github action, once to get in Azure) |
19:08:41 | FromDiscord | <mratsim> If we write software without bugs we don't need to click :p |
19:24:09 | FromDiscord | <Milerius> `Creates the directory dir including all necessary subdirectories. If the directory already exists, no error is raised.` (mkDir) |
19:24:09 | FromDiscord | <Milerius> |
19:24:09 | FromDiscord | <Milerius> ``` |
19:24:10 | FromDiscord | <Milerius> ... Evaluating as NimScript file failed with: |
19:24:10 | FromDiscord | <Milerius> ... os.nim(2133) existsOrCreateDir |
19:24:10 | FromDiscord | <Milerius> ... Error: unhandled exception: Failed to create |
19:24:11 | FromDiscord | <Milerius> ``` |
19:24:12 | FromDiscord | <Milerius> |
19:24:13 | FromDiscord | <Milerius> Am i wrong ? |
19:24:24 | disruptek | yes, you should have use a paste service. |
19:33:53 | FromGitter | <Willyboar> disruptek I spit my coffee from my nose |
19:34:51 | disruptek | oh dear. |
19:35:49 | FromGitter | <Willyboar> by the way i cant wait to see ndoc |
19:35:50 | FromGitter | <Willyboar> :) |
19:37:29 | disruptek | so many projects... |
19:37:42 | FromGitter | <Willyboar> I know |
19:37:44 | disruptek | is ndoc more important than fixing unittest? |
19:38:25 | FromGitter | <Willyboar> are you gonna fix unittest for xmas? |
19:38:35 | disruptek | nope. |
19:38:56 | FromGitter | <Willyboar> after? |
19:39:34 | disruptek | i dunno, i'm thinking about getting a job. |
19:40:20 | FromGitter | <Willyboar> It's pitty there are not nim jobs for you |
19:41:54 | disruptek | nim has rekindled my enjoyment of programming and supporting developers, but i don't think that's exclusive to the language. |
19:42:37 | * | clyybber joined #nim |
19:42:45 | FromGitter | <Willyboar> well i hope to continue make the community better and after getting a job |
19:44:17 | disruptek | it's a good goal, but i don't know many people that can pull it off. |
19:44:39 | disruptek | i'm kinda one-track that way. my head is in my code all the time. |
19:45:56 | disruptek | you find it easy to switch between dramatically different projects? |
19:46:20 | FromGitter | <Willyboar> of course not |
19:46:32 | FromDiscord | <Lantos> frick @pmunch :pmunch did you get an arduino working? |
19:46:32 | FromDiscord | <Lantos> Im hitting |
19:46:32 | FromDiscord | <Lantos> |
19:46:32 | FromDiscord | <Lantos> https://pastebin.com/kNAzEgMZ |
19:46:53 | Araq | Lantos: use Nim devel or maybe 1.0.4 |
19:48:27 | * | zacharycarter[m] quit (Quit: User has been idle for 30+ days.) |
19:50:49 | FromDiscord | <Lantos> sure I'll give that a shot |
19:54:22 | salotz[m] | disruptek: ask Araq how he was able to make nim |
19:55:18 | disruptek | araq is on another level. |
19:57:24 | disruptek | i might just do something part-time, though. my time is more valuable to me than money. |
19:57:33 | FromDiscord | <Lantos> his german |
19:57:52 | disruptek | yes, i don't know why i said time. i meant, my german. |
19:57:54 | salotz[m] | my biggest issue with jobs is the time structure they force you into. 8 hrs by 5 days is really bad for multiple big projects imo |
19:58:56 | disruptek | i ran my team on a 3+1; 3 days of code, 1 day of design, and 3 day weekends. |
19:59:30 | disruptek | but, like i said, i don't really take days off. |
19:59:56 | FromGitter | <Willyboar> I think the best is to find what fits to the team to be more productive |
19:59:57 | salotz[m] | week by week is the flaw |
20:00:15 | salotz[m] | chunking by multiple weeks is better |
20:00:24 | disruptek | sure, but 28hr days are too hard to get past management. |
20:00:34 | disruptek | even though they make way more sense... |
20:00:56 | FromDiscord | <spook> 3+1. a scrum model? |
20:00:59 | salotz[m] | think about one thing intensely for a few weeks, then break, circle back around |
20:01:00 | * | nsf quit (Quit: WeeChat 2.6) |
20:01:17 | FromDiscord | <Milerius> is it possible to have default value for object in nim ? |
20:01:30 | disruptek | milerius: any color you want as long as it's black. |
20:01:44 | FromDiscord | <Milerius> wut ? |
20:01:57 | disruptek | 3+1 is like, my minions were available to meet with customers/management one day per week. |
20:02:01 | FromDiscord | <spook> 3 day weekends would help, stop mental blocks and force people to be more efficient with their time. like the microsoft a trail in japan |
20:02:21 | disruptek | milerius: any value you want as long as it's zero. |
20:02:31 | FromDiscord | <Milerius> Yeah but what is the syntax ? |
20:02:44 | disruptek | simply do not initialize. |
20:02:49 | FromDiscord | <Milerius> I have the following object: |
20:02:49 | FromDiscord | <Milerius> |
20:02:49 | FromDiscord | <Milerius> ```nim |
20:02:49 | FromDiscord | <Milerius> type |
20:02:50 | FromDiscord | <Milerius> MM2Config = object |
20:02:50 | FromDiscord | <Milerius> gui: string |
20:02:50 | FromDiscord | <Milerius> netid: int64 |
20:02:52 | FromDiscord | <Milerius> userhome: string |
20:02:53 | FromDiscord | <Milerius> passphrase: string |
20:02:54 | FromDiscord | <Milerius> ``` |
20:02:59 | disruptek | dude. how many times? |
20:03:06 | disruptek | !repo disruptek/xs |
20:03:07 | disbot | https://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 1โญ 0๐ด |
20:03:13 | disruptek | use the ix tool in there. |
20:03:14 | disruptek | please. |
20:03:34 | disruptek | 3 day weeks work well. |
20:03:37 | FromDiscord | <Milerius> ๐ฎ |
20:03:41 | disruptek | i mean, 3 day weekends. |
20:04:17 | disruptek | i'm not saying i wouldn't let people come into the office the rest of the time; it just wasn't mandatory. we didn't schedule groupthink more than one day/week. |
20:04:44 | disruptek | under normal circumstances, i mean. |
20:04:56 | FromGitter | <Milerius> https://gist.github.com/Milerius/a6f92a7e2c218161ce69d7519771898c |
20:04:59 | FromGitter | <Milerius> Gist is ok ? |
20:05:05 | disruptek | yes. |
20:05:13 | disruptek | but, i'm warning you. germans read irc. |
20:05:26 | FromDiscord | <Milerius> Yeah ok, no problem |
20:05:37 | FromDiscord | <Milerius> So there is a way to initialize on declaration object ? |
20:05:38 | madprops | is there no `for x in 0..10 (but reverse)` ? I've been having to make seqs and reverse them first |
20:05:52 | disruptek | madprops: countDown() |
20:06:08 | disruptek | milerius: those values are all initialized to 0 or "". |
20:06:11 | disruptek | enjoy. |
20:06:27 | madprops | disruptek, oh nice |
20:06:40 | disruptek | var x: MM2Config = MM2Config(netid: 33, gui: "hello there") |
20:06:41 | FromDiscord | <Milerius> Yeah but i want to initialize them to a specified value |
20:06:56 | FromDiscord | <Milerius> And if i have conditional initialization ? |
20:07:04 | disruptek | use a conditional. |
20:07:19 | disruptek | you can also `var x = block: ...` |
20:07:55 | FromDiscord | <Milerius> i edited my gist: https://gist.github.com/Milerius/a6f92a7e2c218161ce69d7519771898c |
20:08:00 | FromDiscord | <Milerius> I have a conditional based on the OS |
20:08:02 | FromDiscord | <Milerius> for example |
20:08:29 | FromDiscord | <Milerius> I'm supposing better to use: https://nim-lang.org/docs/os.html#getHomeDir |
20:08:35 | FromDiscord | <Milerius> Instead of conditonal stuff |
20:08:42 | disruptek | probably a wise choice. |
20:09:20 | FromDiscord | <Lantos> well that was not fun, updating ~/.profile to point to the new nim bin folder and having a typo so I have to drop into root to fix |
20:09:30 | FromDiscord | <Fern & Simula (They/Them)> what's the most idiomatic way to handle an improper use of a macro, just raise an exception? |
20:09:35 | FromDiscord | <Lantos> anyone know of a betterway of updating $PATH |
20:09:44 | disruptek | fern: `error`. |
20:09:54 | disruptek | fern: ie macros.error |
20:10:03 | disruptek | lantos: putEnv |
20:10:11 | FromDiscord | <Fern & Simula (They/Them)> oh duh. thanks! |
20:10:36 | disruptek | sure thing. |
20:11:22 | * | marmotini_ quit (Remote host closed the connection) |
20:12:00 | * | marmotini_ joined #nim |
20:12:06 | FromDiscord | <Lantos> awesome can compile to --cpu:avr |
20:12:06 | FromDiscord | <Lantos> |
20:12:06 | FromDiscord | <Lantos> ~/Documents/code/nim/nim_arduino$ nim -v |
20:12:06 | FromDiscord | <Lantos> Nim Compiler Version 1.1.1 [Linux: amd64] |
20:12:06 | FromDiscord | <Lantos> |
20:12:06 | FromDiscord | <Lantos> built nim from source. Does this mean that araq can see me in my webcam now? |
20:12:34 | disruptek | no, he was always able to see you in your webcam. |
20:12:39 | FromDiscord | <Lantos> lol |
20:13:24 | disruptek | it's really not funny. |
20:13:37 | disruptek | sometimes i catch him looking at me from the bottom of my coffee mug. |
20:13:40 | disruptek | creepy. |
20:14:06 | clyybber | sinister |
20:15:13 | * | Hideki_ joined #nim |
20:15:14 | FromDiscord | <Lantos> good thing I drink tea |
20:16:35 | * | marmotini_ quit (Ping timeout: 258 seconds) |
20:18:44 | FromDiscord | <Fern & Simula (They/Them)> araq likes to spy from tea even more than coffee |
20:19:56 | federico3 | even from the bottom of the tea jar |
20:20:02 | * | Hideki_ quit (Ping timeout: 268 seconds) |
20:20:30 | * | endragor quit (Remote host closed the connection) |
20:24:24 | * | endragor joined #nim |
20:25:43 | FromDiscord | <Milerius> There is a defer keyword equivalent for nim ? |
20:26:01 | clyybber | nim *has* the defer keyword |
20:26:01 | disruptek | you mean for async purposes? |
20:26:15 | FromDiscord | <Milerius> no for closing a process at the end of my scope |
20:26:23 | disruptek | yes, `defer:` |
20:26:44 | disruptek | nim really ought to provide a manual. |
20:26:50 | FromGitter | <Willyboar> disruptek I will try a different approach for my web thing |
20:26:57 | disruptek | of course, then we'd have nothing to talk about with araq. |
20:27:11 | FromDiscord | <Milerius> Thanks |
20:27:55 | clyybber | if only there was a manual... |
20:28:03 | clyybber | (where you could ctrl-f :p) |
20:28:22 | disruptek | but we wouldn't get to meet people on irc and be spammed by them. |
20:29:01 | * | abm quit (Quit: Leaving) |
20:30:33 | FromDiscord | <Lantos> lol |
20:31:06 | FromDiscord | <Lantos> ctrl+f+disruptek "how to find nimcache" |
20:31:55 | * | marmotini_ joined #nim |
20:31:57 | disruptek | ndoc, aka `disruptex`, is going to require a special "disruptek" key binding. |
20:32:09 | disruptek | ๐ง |
20:32:29 | * | Mike[m]3 quit (Quit: User has been idle for 30+ days.) |
20:32:45 | * | narimiran quit (Ping timeout: 250 seconds) |
20:32:59 | * | endragor quit (Ping timeout: 268 seconds) |
20:33:52 | FromDiscord | <Lantos> ctrl+f+d+i+s+r+u+p+t+e+k "how to find nimcache" |
20:34:15 | * | disruptek sighs. |
20:34:23 | disruptek | the best way to find nimcache is to specify it. |
20:34:39 | FromDiscord | <Lantos> --nimcache"/cache |
20:35:21 | FromGitter | <alehander92> Araq thats basically zero-functional |
20:35:28 | FromGitter | <alehander92> the fp: idea |
20:35:29 | FromDiscord | <Milerius> I also hear that there is a syntax to say: if my object is not nil please call this function |
20:35:36 | FromDiscord | <Milerius> This is true ? :p |
20:35:43 | FromGitter | <alehander92> but .. i dont get how would it |
20:35:51 | FromGitter | <alehander92> work with existing iterators |
20:35:55 | FromGitter | <alehander92> as it cant introspect |
20:35:58 | FromGitter | <alehander92> them |
20:35:59 | FromDiscord | <Milerius> (again i'm sorry, i know only C and C++ and we don't have such a syntax in those languages) |
20:36:03 | FromGitter | <alehander92> maybe if thats possible |
20:36:10 | FromGitter | <alehander92> it can generate its own iterators |
20:36:52 | * | marmotini_ quit (Remote host closed the connection) |
20:37:05 | disruptek | milerius: nil is valid for ref object types. there's no ?. chaining though. |
20:37:50 | disruptek | it's sometimes useful to call `isNil()` on a ref type instead of testing for == nil. |
20:38:08 | disruptek | otherwise, nil should be an anticipated value for ref types. |
20:38:20 | disruptek | until alehander's patch goes in. |
20:38:29 | disruptek | !rfc not nil |
20:38:30 | disbot | https://github.com/nim-lang/RFCs/issues/76 -- 3syntax request: `from std/[foo1,foo2] import nil` ; `from "." / [foo1,foo2] import bar1, bar2, bar3` 7& 27 more... |
20:38:40 | disruptek | er, not that one. |
20:38:46 | FromGitter | <Willyboar> @alehander92 how http goes? |
20:38:52 | disruptek | !rfc author:alehander42 |
20:38:54 | disbot | query failed ๐ข |
20:39:24 | FromGitter | <Willyboar> !http author:alehander92 |
20:39:46 | clyybber | !get to:work |
20:39:59 | disruptek | !rfc nilable author:alehander92 |
20:40:00 | disbot | https://github.com/nim-lang/RFCs/pull/169 -- 3Nilable and non-nilable types |
20:40:05 | FromGitter | <alehander92> thanks |
20:40:08 | FromGitter | <alehander92> well it waits |
20:40:34 | FromGitter | <alehander92> for people to work on it |
20:40:44 | FromGitter | <alehander92> `http` |
20:40:48 | FromGitter | <alehander92> or to design their own framework |
20:40:55 | FromGitter | <alehander92> i dont really have time sorry but |
20:41:15 | FromDiscord | <Generic> maybe someone remembers my computedGoto newruntime issue from yesterday? |
20:41:18 | FromGitter | <Willyboar> i have the time but not the knowledge |
20:41:22 | FromGitter | <Willyboar> :P |
20:41:26 | FromGitter | <alehander92> i can help you |
20:41:43 | FromGitter | <alehander92> i have some other ideas for big toolkits |
20:41:43 | FromDiscord | <Generic> I have thought a little bit more about it and it's more complicated than I thought |
20:41:47 | FromGitter | <alehander92> but i have to sit and write down |
20:41:58 | FromGitter | <alehander92> @Willyboar are you a web developer |
20:42:13 | FromGitter | <Willyboar> no professionally |
20:42:22 | FromGitter | <Willyboar> i am hobyist |
20:42:37 | FromGitter | <alehander92> do you like how certain frameworks work |
20:42:42 | FromDiscord | <Lantos> I did it, ๐ blink program written in nim uploaded to arduino |
20:42:53 | FromGitter | <Willyboar> well i like things from a lot |
20:43:06 | FromGitter | <alehander92> so you can write down how you expect |
20:43:10 | FromGitter | <alehander92> a nim version to look |
20:43:17 | FromGitter | <alehander92> of a simple app |
20:43:18 | FromGitter | <alehander92> and thats mostly it |
20:43:18 | FromGitter | <Willyboar> this is what i am doing now |
20:43:22 | FromGitter | <alehander92> great! |
20:43:31 | FromGitter | <Willyboar> Reverse development |
20:43:34 | FromGitter | <alehander92> yeah |
20:43:38 | FromGitter | <alehander92> i think its a good idea sometimes |
20:43:55 | FromGitter | <alehander92> its like tdd |
20:44:02 | FromGitter | <Willyboar> RDD |
20:44:04 | FromGitter | <Willyboar> :P |
20:44:12 | FromGitter | <alehander92> result driven development :P |
20:44:34 | FromGitter | <Willyboar> or reverse driven development |
20:45:03 | FromGitter | <alehander92> well, i dont even think its reverse |
20:45:18 | FromGitter | <alehander92> you write down your design and an example result of it |
20:45:28 | FromGitter | <alehander92> this should be done more often maybe anyway |
20:46:46 | FromGitter | <Willyboar> yes but this is the easy part. I will probably write a CRUD app and all the needed flags in 2 days |
20:50:24 | FromGitter | <alehander92> yeah but its not so easy |
20:50:32 | FromGitter | <alehander92> because then you need to iterate a bit |
20:50:43 | FromGitter | <alehander92> and see what is actually useful or sensible to implement |
20:51:10 | * | meff[m] quit (Quit: User has been idle for 30+ days.) |
20:54:54 | FromGitter | <zacharycarter> does this look better? |
20:55:05 | FromGitter | <Willyboar> maybe i will create a repo with the result |
20:55:08 | FromGitter | <zacharycarter> triplanar mapping: |
20:55:46 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/W3VC/image.png) |
20:56:10 | FromGitter | <zacharycarter> vs without: |
20:56:14 | disruptek | you fixed the bug. what was it? |
20:56:18 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/dWTG/image.png) |
20:57:00 | FromGitter | <zacharycarter> hrm - now I can't remember :P I think it was just using the wrong data type in a varying |
20:57:21 | FromGitter | <zacharycarter> right now I'm trying to make the textures look less like they're tiled |
20:57:41 | disruptek | i can't tell if they are just larger or superimposed or what. |
20:57:50 | disruptek | they look a little blurrier, but maybe it's me. |
20:57:51 | FromGitter | <zacharycarter> I at first was attempting to implement: https://drive.google.com/file/d/1QecekuuyWgw68HU9tg6ENfrCTCVIjm6l/view |
20:58:15 | FromGitter | <zacharycarter> but I ran into some things that the example code was doing that I don't know how to reproduce in bgfx |
20:58:28 | FromGitter | <zacharycarter> so I instead went with: https://gamedevelopment.tutsplus.com/articles/use-tri-planar-texture-mapping-for-better-terrain--gamedev-13821 |
20:58:35 | FromGitter | <zacharycarter> which is what the first screenshot is supposed to implement |
20:58:52 | disruptek | neat. |
20:59:03 | lqdev[m] | is there really no reliable way of getting the type of an nnkIdentDefs default value in a macro? |
20:59:33 | disruptek | lqdev: i thought you solved that problem. |
20:59:58 | clyybber | lqdev[m]: Untyped? |
21:00:06 | lqdev[m] | clyybber: no, typed |
21:00:14 | lqdev[m] | disruptek: I did, for primitives |
21:00:29 | disruptek | don't you just have an ident() otherwise? |
21:00:46 | lqdev[m] | I have a `Sym` |
21:01:03 | lqdev[m] | because the default value is a variable |
21:01:34 | lqdev[m] | wrapping the type in nnkTypeOfExpr doesn't really seem to help |
21:02:43 | lqdev[m] | oh wait, it's not the issue, ha. |
21:03:00 | lqdev[m] | the issue is `sameType` not giving me reliable results |
21:06:42 | lqdev[m] | http://ix.io/24Om `same?` shows if the types are the same. |
21:07:34 | lqdev[m] | in this case https://play.nim-lang.org/#ix=24On however, `true` is returned |
21:08:12 | lqdev[m] | and yeah, the same goes for `type(x)` and `typeof(x)`. |
21:18:21 | * | voltist joined #nim |
21:25:24 | * | lritter quit (Ping timeout: 248 seconds) |
21:29:33 | * | voltist quit (Read error: Connection reset by peer) |
21:30:05 | * | voltist joined #nim |
21:30:18 | FromDiscord | <mratsim> @Clyybber, I think I hunted that damn deadlock with the backoff. While there was a possibility of deadlocking the backoff system, it was not that that was plaguing me. |
21:30:18 | FromDiscord | <mratsim> First of all the responsible was not a deadlock of the sleeping thread but a livelock of the master thread, detailed writeup here: https://github.com/mratsim/weave/issues/43#issuecomment-567219465 |
21:30:18 | disbot | โฅ Livelock with backoff on Nqueens 11 |
21:35:07 | * | deepend quit (*.net *.split) |
21:36:15 | * | Trustable joined #nim |
21:37:00 | FromDiscord | <Clyybber> @mratsim Damn, nice. I'll look at your write up! |
21:37:26 | * | deepend joined #nim |
21:37:38 | FromDiscord | <mratsim> The fact that you need a very good night sleep for that sort of investigation is why I want to rewrite as a state machine |
21:38:15 | FromDiscord | <mratsim> it's too hard currently to have a good view of the control flow even for me |
21:38:27 | FromDiscord | <mratsim> I have to check with Andreas (the other one) but it's probably also in his C code |
21:40:00 | FromDiscord | <Clyybber> How would that state machine work roughly? |
21:40:26 | FromDiscord | <Clyybber> Every worker having a state machine? |
21:41:27 | FromDiscord | <Clyybber> @mratsim ping |
21:41:42 | FromDiscord | <Clyybber> always forget to tag : p |
21:44:53 | * | NimBot joined #nim |
21:45:28 | clyybber | let his name rename |
21:46:15 | FromDiscord | <mratsim> Every worker is a state machine or an actor |
21:46:26 | FromDiscord | <mratsim> they are already a state machine |
21:46:32 | FromDiscord | <mratsim> just that it's implicit |
21:47:29 | FromDiscord | <Clyybber> I see |
21:47:40 | FromDiscord | <mratsim> This is a state machine for example: https://github.com/mratsim/weave/blob/a06469293a8c61e85d53389e073dcfce8689ed7a/weave/scheduler.nim#L170-L226 |
21:48:08 | FromDiscord | <mratsim> Check your task, if you have some give them to your children, then to thieves, then run the task |
21:48:17 | * | Trustable quit (Remote host closed the connection) |
21:48:38 | FromDiscord | <mratsim> if you are out of task, become of thief, if you don't get any, sleep (if there is some backoff) or execute the task |
21:48:40 | FromDiscord | <mratsim> and repeat |
21:49:22 | FromDiscord | <mratsim> the main issue I have is that there are nested state machine that are not apparent from that loop, like the fact that in "nextTask" you also have a state machine that pops all the steal requests |
21:49:45 | FromDiscord | <mratsim> so I want all the control flow and so the "decisionTree" to happen at top level. |
21:50:47 | FromDiscord | <mratsim> because right now it's too complex to even see right away if when I touch something it's relatively safe or if i'm slipping into waters that need to be charted thoroughly |
21:51:22 | FromDiscord | <mratsim> that also means that it's very hard for outsiders to get into the code so maintenance will be bad |
21:52:01 | FromDiscord | <mratsim> obviously macros also have their cost but I think the benefits outweight the cost here |
21:52:04 | FromDiscord | <Milerius> Summary of my first real day in nim: |
21:52:04 | FromDiscord | <Milerius> |
21:52:04 | FromDiscord | <Milerius> I love, I learned a lot, I personalize my nimble with very specific tasks. |
21:52:05 | FromDiscord | <Milerius> |
21:52:05 | FromDiscord | <Milerius> I then launched a background process with osproc. |
21:52:05 | FromDiscord | <Milerius> |
21:52:07 | FromDiscord | <Milerius> I learned how to catch an exception, the defer. |
21:52:07 | FromDiscord | <Milerius> |
21:52:08 | FromDiscord | <Milerius> A good day. |
21:52:10 | FromDiscord | <Milerius> |
21:52:12 | FromDiscord | <Milerius> So far some little problem of syntax etc, everythingis new. |
21:52:13 | FromDiscord | <Milerius> Summary of my first real day in nim: |
21:52:14 | FromDiscord | <Milerius> |
21:52:16 | FromDiscord | <Milerius> I love, I learned a lot, I personalize my nimble with very specific tasks. |
21:52:18 | FromDiscord | <Milerius> |
21:52:19 | FromDiscord | <Milerius> I then launched a background process with osproc. |
21:52:21 | FromDiscord | <Milerius> |
21:52:22 | FromDiscord | <Milerius> I learned how to catch an exception, the defer. |
21:52:24 | FromDiscord | <Milerius> |
21:52:25 | FromDiscord | <Milerius> A good day. |
21:52:26 | FromDiscord | <Milerius> |
21:52:28 | FromDiscord | <Milerius> So far some little problem of syntax etc, everything is new for me. |
21:52:30 | FromDiscord | <mratsim> nice, welcome aboard ๐ |
21:52:52 | FromDiscord | <Clyybber> irc quietly suffering the edits and newlines |
21:52:56 | FromGitter | <zacharycarter> oh - disruptek - I remember what was causing that issue |
21:53:12 | FromDiscord | <Clyybber> @mratsim I agree, explicit state machine seems like the way to go. |
21:53:18 | FromDiscord | <Clyybber> also easier to visualize |
21:53:24 | * | krux02 joined #nim |
21:53:26 | FromGitter | <zacharycarter> it was the size of the depth buffer - I was using a 16 bit depth buffer, which wasn't large enough given my near / far clipping planes |
21:54:05 | FromDiscord | <Clyybber> @mratsim Could even write a debug layer on top that renders the workers states and the tasks being sent around in realtime |
21:54:13 | FromDiscord | <Clyybber> well debugger "realtime" |
21:55:42 | FromDiscord | <Milerius> @mratsim Oh i just saw your library |
21:55:48 | FromDiscord | <Milerius> My god it's exactly what i nee! |
21:55:52 | FromDiscord | <Milerius> My god it's exactly what i need! |
21:55:59 | * | gour quit (Remote host closed the connection) |
21:56:15 | FromDiscord | <Milerius> I want to execute tasks every x Seconds |
21:56:41 | FromDiscord | <Milerius> Can we scheduled task every X seconds with this library ? |
21:57:01 | FromDiscord | <mratsim> No, there is no timer |
21:57:50 | FromDiscord | <mratsim> but what kind of tasks are you scheduling? Because it's for multithreading and compute tasks, if it's something with a timer I expect you want asyncdispatch (network connection, databases, writing to disk) |
21:58:26 | FromDiscord | <mratsim> https://nim-lang.org/docs/asyncdispatch.html |
21:59:33 | FromDiscord | <Milerius> I'm writting a crypto wallet / decentralised exchange for my company |
21:59:52 | FromDiscord | <Milerius> I need to retrieve informations in an async way |
21:59:57 | FromDiscord | <Milerius> and send it to the GUI to draw |
22:00:13 | FromDiscord | <mratsim> yes so you need either asyncdispatch or chronos |
22:00:14 | FromDiscord | <Milerius> For exemple retrieve all the orders, stuff like that |
22:00:40 | FromDiscord | <Milerius> How can i send data in a thread safe way in nim ? |
22:00:54 | FromDiscord | <mratsim> Weave is for tasks that uses up all your CPU (i.e. numerical computing for example) |
22:00:55 | FromDiscord | <Milerius> I'm moving from c++ @mratsim That's why |
22:01:01 | FromDiscord | <Milerius> my application is currently written in c++ |
22:01:17 | FromDiscord | <mratsim> either you use channels |
22:01:26 | FromDiscord | <mratsim> or you send a raw pointer |
22:01:35 | FromDiscord | <Milerius> There is a tutorial for cannels ? |
22:01:37 | FromDiscord | <Milerius> it's seem's cool |
22:01:37 | FromDiscord | <mratsim> obviously the raw pointer is not threadsafe |
22:01:46 | FromDiscord | <Milerius> channels* |
22:02:26 | FromDiscord | <mratsim> or sockets |
22:02:29 | FromDiscord | <mratsim> see: https://livebook.manning.com/book/nim-in-action/chapter-3/346 |
22:03:39 | FromDiscord | <Milerius> What is this book |
22:03:40 | FromDiscord | <Milerius> seems cool |
22:04:06 | FromDiscord | <mratsim> The only book on Nim at the moment |
22:04:11 | FromDiscord | <mratsim> and an example use of channels: https://github.com/liquid600pgm/pibench2/blob/master/src/pibench2.nim#L36 |
22:05:21 | FromDiscord | <mratsim> it computes Pi in parallel and each threads sends a progress via channel |
22:05:23 | dom96 | Gotta love these spammers making their posts look genuine by re-posting old threads |
22:05:37 | FromDiscord | <mratsim> the one with what language do you prefer, please discuss? |
22:05:54 | FromDiscord | <mratsim> I was really on the fence but I looked in reddit and found nothing |
22:07:51 | FromDiscord | <mratsim> Regarding the crypto wallet / Dex, make sure to check the work we do at Status https://github.com/status-im?language=nim or the fork @kayabaNerve is doing on Meros https://github.com/MerosCrypto |
22:08:02 | * | voltist quit (Read error: Connection reset by peer) |
22:08:28 | FromDiscord | <mratsim> it might help you on cryptography primitives and/or big int in particular |
22:09:12 | FromDiscord | <mratsim> soon there will be more crypto and blockchain devs in Nim than game devs ๐ |
22:12:34 | FromDiscord | <Generic> I never understood that one |
22:13:00 | FromDiscord | <Generic> I've read multiple times that Nim is used by a lot of game devs |
22:13:45 | FromDiscord | <Generic> but I always felt like scientific computing would be the big one |
22:14:26 | FromDiscord | <Generic> there are some good bindings to some engines and frameworks for Nim |
22:14:56 | FromDiscord | <Generic> and some libraries, but nothing which really sticks out |
22:15:07 | FromDiscord | <Clyybber> umm |
22:15:18 | FromDiscord | <Clyybber> mratsims work sticks out |
22:15:25 | FromDiscord | <Clyybber> also |
22:19:25 | FromDiscord | <Milerius> @mratsim I'm interested for the big int stuff. |
22:20:44 | FromDiscord | <mratsim> here you go: https://github.com/status-im/nim-stint |
22:20:59 | FromDiscord | <mratsim> it's only power of 2 but it's stack-based so no allocations at all |
22:21:06 | FromDiscord | <Milerius> i was planning to import boost multiprecision xD |
22:21:31 | * | clyybber quit (Ping timeout: 268 seconds) |
22:21:57 | FromDiscord | <mratsim> C++ templates are a bit tricky because often they have "non-trivial destructors" and Clang complains when they are put in a sequence |
22:22:22 | FromDiscord | <Milerius> i'm writting the desktop app of https://atomicdex.io |
22:22:32 | FromDiscord | <Milerius> so far i have an app that work in c++ |
22:22:40 | FromDiscord | <mratsim> if you need to wrap C++ header-only libraries, here is an example of ttmath (a C++ bigint lib: https://github.com/status-im/nim-ttmath/blob/master/src/ttmath.nim) |
22:22:41 | FromDiscord | <Milerius> but threading model and lot of other stuff are painfull. |
22:23:11 | FromDiscord | <Milerius> oh i know this library |
22:23:15 | FromDiscord | <Milerius> it's supported in boost too |
22:23:31 | FromDiscord | <mratsim> otherwise you can use fragments: https://github.com/fragcolor-xyz/fragments or nimterop: https://github.com/nimterop/nimterop |
22:23:47 | * | clyybber joined #nim |
22:23:54 | FromDiscord | <Milerius> i was planning to import boost header |
22:23:59 | FromDiscord | <Milerius> and use boost multiprecision |
22:24:40 | FromDiscord | <Milerius> https://github.com/KomodoPlatform/atomicDEX-QT/blob/master/src/atomic.dex.mm2.hpp |
22:24:40 | FromDiscord | <Milerius> |
22:24:40 | FromDiscord | <Milerius> If you are interested to look at the current app |
22:25:10 | FromDiscord | <mratsim> that's fine, use what works, just be aware of non-trivial destructors/flexible array member with clanghttps://github.com/status-im/nim-ttmath/issues/10 |
22:25:12 | disbot | โฅ Clang cannot compile ttmath Uint in a seq ; snippet at 12https://play.nim-lang.org/#ix=24OX |
22:26:37 | FromDiscord | <Milerius> https://github.com/KomodoPlatform/atomicDEX-QT/blob/master/atomic_dex_desktop/src/atomic_dex_desktop/mm2/mm2.nim |
22:26:37 | FromDiscord | <Milerius> |
22:26:37 | FromDiscord | <Milerius> I started my nim port a bit |
22:26:42 | FromDiscord | <mratsim> For the threading model, I suggest you have a look at threadpools: https://github.com/yglukhov/threadpools |
22:26:56 | FromDiscord | <mratsim> the goal is to replace the standard library threadpools with this |
22:27:19 | FromDiscord | <mratsim> my own library will have a similar interface |
22:27:21 | FromDiscord | <Milerius> can i show you my current thread approach ? |
22:27:26 | FromDiscord | <mratsim> yes of course |
22:27:41 | FromDiscord | <mratsim> (also we are colleague at Status so we work full time on Nim) |
22:28:02 | FromDiscord | <Milerius> https://github.com/KomodoPlatform/atomicDEX-QT/blob/master/src/atomic.dex.mm2.cpp#L94 |
22:28:09 | FromDiscord | <Milerius> It's nice ! |
22:28:14 | FromDiscord | <Milerius> There is my approach |
22:28:25 | FromDiscord | <Milerius> i have 2 timer, when i reach the amount, i add a task in my thread pool |
22:28:36 | FromDiscord | <Milerius> my tasks simply insert into concurent hash map |
22:28:43 | FromDiscord | <Milerius> and the gui read the contents of the concurrent hash map |
22:28:51 | FromDiscord | <Milerius> It's a simple approach, but it's work really well |
22:29:05 | FromDiscord | <Milerius> I'm not looking for masturbating academic stuff, but simple stuff that do the job |
22:29:17 | FromDiscord | <Milerius> Araq tell me to didn't use SharedTable in nim |
22:29:22 | FromDiscord | <Milerius> because it's a mess ATM |
22:29:27 | FromDiscord | <mratsim> yeah so just try with yglukhov's threadpool |
22:29:39 | FromDiscord | <Milerius> there is a doc ? |
22:29:52 | FromDiscord | <mratsim> for hashtable nothings beat folly's in Nim ecosystem, or maybe some secret stuff from cooldome |
22:30:15 | FromDiscord | <Milerius> The things that is cool with folly hashmap |
22:30:15 | FromDiscord | <mratsim> same API as: https://nim-lang.org/docs/threadpool.html |
22:30:22 | FromDiscord | <Milerius> is that i can read/write from different thread |
22:30:27 | FromDiscord | <Milerius> they have huge optimisation barrier stuff |
22:30:32 | FromDiscord | <Milerius> hazard ptr etc |
22:30:51 | FromDiscord | <Milerius> The things is |
22:31:02 | FromDiscord | <Milerius> Even if i use this threadpool @mratsim Where i will output my data |
22:31:11 | FromDiscord | <Milerius> Since we cannot use shared table stuff |
22:31:30 | FromDiscord | <mratsim> you can wrap folly's hashtable |
22:31:47 | FromDiscord | <Milerius> yeah but i cannot use nim type as value ? |
22:31:49 | FromDiscord | <Milerius> no ? |
22:31:55 | FromDiscord | <mratsim> Yes you can |
22:31:59 | FromDiscord | <Milerius> what the hell ? |
22:32:04 | FromDiscord | <Milerius> are you joking ? |
22:32:27 | FromDiscord | <mratsim> type HashTable[T]{.importcpp:folly_Hashtable<'0>.} |
22:32:31 | FromDiscord | <mratsim> let me show you |
22:32:42 | FromDiscord | <mratsim> https://github.com/numforge/agent-smith/blob/master/third_party/std_cpp.nim#L23 |
22:32:53 | FromDiscord | <Milerius> by the way, what is your approach to wrap this kind of library that have lot of dependencies ? |
22:32:54 | FromDiscord | <mratsim> this is how I use Nim values in std::vector |
22:32:58 | FromDiscord | <Milerius> I plan to use VCPKG to download dependencies |
22:33:06 | FromDiscord | <Milerius> anduse getEnv(VCPKG_ROOT) to link folly |
22:33:07 | FromDiscord | <Milerius> properly |
22:33:19 | FromDiscord | <mratsim> git submodules |
22:33:46 | FromDiscord | <Milerius> well i much prefer VCPKG in this case so |
22:33:49 | FromDiscord | <Milerius> work's really well |
22:33:54 | FromDiscord | <Milerius> and take care about lot of boring stuff |
22:34:09 | FromDiscord | <Milerius> ok it's seem's really nice but |
22:34:25 | FromDiscord | <Milerius> but nothing, it's really nice. |
22:34:54 | FromDiscord | <Milerius> so for example you create your object in nim after |
22:35:01 | FromDiscord | <Milerius> and do vector<my_object> ? |
22:35:33 | FromDiscord | <mratsim> yes |
22:35:52 | FromDiscord | <mratsim> here I've only used for stuff imported also from C++: https://github.com/numforge/agent-smith/blob/a2d9251e289f92f6b5fb68e19a98d16b00f2694c/third_party/ale_wrap.nim#L89-L94 |
22:35:56 | FromDiscord | <Milerius> Man You can mix benefits of using great c++ library with syntax of nim |
22:36:17 | FromDiscord | <Milerius> loving stuff |
22:36:25 | FromDiscord | <Milerius> How much year experience you have in nim ? |
22:36:35 | FromDiscord | <Milerius> I have 5 years in C++, 3 in Golang only, i'm young ^^' |
22:37:06 | FromDiscord | <mratsim> but via fragcolor-xyz fragments they did wrap various C++ stuff with success: https://github.com/fragcolor-xyz/nimtorch/blob/5f9071ff8df33fac511fff667a84bd5b9aed46be/torch/torch_cpp.nim |
22:37:30 | FromDiscord | <mratsim> I have about 3 yers of Nim experience |
22:37:45 | FromDiscord | <Milerius> what was your programming langage before |
22:37:56 | FromDiscord | <mratsim> None :P, I wasn't a dev before |
22:38:01 | FromDiscord | <Milerius> ๐ฎ |
22:38:04 | FromDiscord | <mratsim> I did tech support sysadmin |
22:38:11 | FromDiscord | <mratsim> and then project management |
22:38:35 | FromDiscord | <mratsim> I guess i could say, VBA and bash :p |
22:39:19 | FromDiscord | <Milerius> ah :p |
22:39:33 | FromDiscord | <mratsim> I did some Python as well as it was needed for data science, but otherwise I did try Rust and haskell in the past but only for like 2-3 months |
22:39:45 | FromDiscord | <Milerius> and you fall in love with nim |
22:39:46 | FromDiscord | <Milerius> :p |
22:40:27 | FromDiscord | <mratsim> yes, because I wanted to learn deep learning from scratch, and I found Python restrictive, especially in terms of speed |
22:40:44 | FromDiscord | <mratsim> and I tried Rust before and it was painful |
22:40:52 | FromDiscord | <Milerius> But you are in the crypto industry too ? |
22:40:56 | FromDiscord | <mratsim> so I tried Nim and stayed with it |
22:40:59 | FromDiscord | <mratsim> yes |
22:41:06 | FromDiscord | <mratsim> working on Ethereum 2 |
22:41:15 | FromDiscord | <Milerius> ah rly cool, i'm lead dev for Komodo blockchain |
22:41:21 | FromDiscord | <Milerius> I'm rly happy |
22:41:48 | FromDiscord | <mratsim> we're about 10 Nim devs at Status working on Ethereum 1 and 2 |
22:42:08 | FromDiscord | <mratsim> and there is kayabaNerve working on his own crypto as well in Nim (Meros i linked before) |
22:42:12 | FromDiscord | <Milerius> In fact they didn't ask me to do nim, i do all the project in c++, but i think nim can be usefull too. |
22:43:17 | FromDiscord | <mratsim> And regarding finance there are atleast 2 funds that I know of that are using Nim |
22:43:58 | FromDiscord | <Milerius> interesting |
22:44:05 | FromDiscord | <mratsim> (I worked as supportsysadmin in big finance before, even AS400 and COBOL ~_~) |
22:44:17 | FromDiscord | <Milerius> Just in case you will be interested i made the port for Viewport High DPI in nim |
22:44:33 | FromDiscord | <Milerius> Just in case you will be interested i made the port for Viewport High DPI GUI in nim |
22:45:55 | FromDiscord | <Milerius> what do you use for light storage in nim @mratsim |
22:45:57 | FromDiscord | <Milerius> For local DB |
22:46:05 | FromDiscord | <mratsim> we use RocksDB |
22:46:13 | FromDiscord | <mratsim> looking into lmdb as well |
22:46:33 | FromDiscord | <Milerius> This is not light ahah :p |
22:46:34 | * | solitudesf quit (Ping timeout: 252 seconds) |
22:46:49 | FromDiscord | <Fern & Simula (They/Them)> when I try to compile some code with this in it (https://pastebin.com/z79N4TDp), I get `Error: undeclared identifier: 'k'` |
22:46:59 | FromDiscord | <Fern & Simula (They/Them)> any idea why? |
22:47:14 | disruptek | i have a guess... |
22:47:25 | FromDiscord | <Fern & Simula (They/Them)> oh nevermind. bad indentation |
22:48:39 | FromDiscord | <mratsim> does `newIdent("token")` interpolation work now? I always assigned everything before using quote do because it was broken in the past |
22:49:50 | FromDiscord | <Fern & Simula (They/Them)> nah |
22:50:04 | FromDiscord | <Fern & Simula (They/Them)> also it was bad code. it's a quote block, just replace it with the word token |
22:50:19 | FromDiscord | <Fern & Simula (They/Them)> first time writing an actual non-toy macro. kinda figuring things out as i go |
22:54:24 | FromDiscord | <mratsim> welcome to the wonderful land of macros, close the door behind you, you have reached the point of no return ๐ |
22:56:14 | FromDiscord | <Fern & Simula (They/Them)> just printed the generated ast tree |
22:56:20 | FromDiscord | <Fern & Simula (They/Them)> i have no idea what broke but its bad |
23:00:57 | FromDiscord | <Fern & Simula (They/Them)> is there a way to pretty-print the lispRepr? |
23:01:07 | FromDiscord | <Fern & Simula (They/Them)> sure is, nvm |
23:05:02 | clyybber | mratsim: WDYT about a pragma for case objects that allows their discriminator to be reassigned? |
23:05:11 | clyybber | Either a pragma on the type |
23:05:17 | clyybber | or on the assignment stmt |
23:05:33 | FromDiscord | <mratsim> that sounds good |
23:05:43 | clyybber | which one? |
23:05:50 | FromDiscord | <mratsim> on the type |
23:05:55 | clyybber | k |
23:06:02 | clyybber | ill put it in my todo list then |
23:06:07 | clyybber | (which keeps growing :p) |
23:06:10 | FromDiscord | <mratsim> it's really a pain point at Status |
23:06:45 | FromDiscord | <mratsim> see: https://github.com/status-im/nim-confutils/issues/9#issuecomment-559862829 |
23:06:47 | disbot | โฅ "assignment to discriminant changes object branch" ; snippet at 12https://play.nim-lang.org/#ix=24P7 |
23:07:01 | FromDiscord | <mratsim> tag @zah when you release it |
23:07:13 | * | leorize quit (Quit: WeeChat 2.6) |
23:07:26 | FromDiscord | <mratsim> for me as well in both Weave and for lazily deserializing crypto signatures from a database |
23:07:26 | disruptek | i managed to generate an infinite look in rawAlloc. |
23:07:31 | disruptek | loop, too. |
23:07:41 | FromDiscord | <mratsim> Are you the eye of Sauron? |
23:07:55 | disruptek | i have so many names... |
23:08:18 | FromDiscord | <mratsim> so does that exhaust your memory? |
23:08:24 | clyybber | eye of sauron, infinite loop, loop, cycle, cycle checker, --gc:orc |
23:08:30 | clyybber | I like where this is going |
23:08:36 | disruptek | call depth limit reached first. |
23:08:52 | clyybber | they are taking nim to Isengard |
23:09:14 | FromDiscord | <mratsim> In the Depths of Helm |
23:09:26 | FromDiscord | <mratsim> where you will reach the limits of your calls |
23:09:34 | FromGitter | <Willyboar> The fellowship of nim |
23:09:36 | disruptek | this really isn't my fault but i'm not sure i can repro it simply. |
23:09:52 | FromDiscord | <mratsim> well just screenshot it at least |
23:10:25 | FromDiscord | <mratsim> I remember seeing bugs in there that I couldn't reproduce and some magician managed to fix it |
23:10:38 | clyybber | i love magicians |
23:10:49 | disruptek | oh, it's npeg. |
23:10:55 | FromDiscord | <Fern & Simula (They/Them)> ive got this code (https://pastebin.com/Y9fgZ4j3) but i'm getting this error (https://pastebin.com/Y3R3i5Uw). no idea what i did wrong lol |
23:10:57 | clyybber | summon le magician Zevv |
23:11:08 | disruptek | lol |
23:11:25 | disruptek | $ cat ~/toucan 18:11 |
23:11:28 | disruptek | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:31 | disruptek | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:34 | disruptek | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:37 | disruptek | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:40 | disruptek | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:43 | disruptek | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:46 | disruptek | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:49 | disruptek | โโโโโleโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:52 | disruptek | โโโโtoucanโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:55 | disruptek | โโโโโโhasโโโโโโโโโโโโโโโโโโโโโโโโโโ |
23:11:58 | disruptek | โโโโโarrivedโโโโโโโโโโโโโโโโโโโโโโ |
23:12:04 | disruptek | toucan is always at the ready. |
23:12:25 | clyybber | lol |
23:12:31 | clyybber | its been 6 years fellow tucn |
23:12:33 | FromDiscord | <mratsim> Are you playing Path of Exile? |
23:12:42 | disruptek | not at the moment. |
23:12:45 | FromDiscord | <mratsim> this was the magic fix: https://github.com/nim-lang/Nim/pull/8496/files#diff-bbd2d0b5f1c7d2299ad11cfed6d9a7e0 |
23:12:46 | disbot | โฅ fixes #7894 |
23:13:24 | clyybber | just because he was born |
23:14:29 | FromDiscord | <mratsim> he moved var size = size 2 lines down and magic, no more rawAlloc crash |
23:15:27 | FromDiscord | <mratsim> okay, now I need to go back to fix this annoying livelock |
23:15:52 | FromDiscord | <Fern & Simula (They/Them)> can someone help me figure out what this error means? https://pastebin.com/Y3R3i5Uw |
23:16:20 | FromDiscord | <Fern & Simula (They/Them)> i'm so lost lol |
23:16:32 | disruptek | would be more helpful to see the code. |
23:17:02 | FromDiscord | <Fern & Simula (They/Them)> want the full code or just what's triggering the error? |
23:17:48 | disruptek | the more the merrier; it's christmas. |
23:18:00 | FromDiscord | <Fern & Simula (They/Them)> alrighty, https://pastebin.com/yVAhfYTK |
23:18:33 | FromDiscord | <Fern & Simula (They/Them)> whoops, hang on |
23:18:56 | FromDiscord | <Fern & Simula (They/Them)> this has the correct line numbers https://pastebin.com/jEsk7pNT |
23:19:22 | FromDiscord | <Fern & Simula (They/Them)> error occurs on line 53 |
23:19:26 | disruptek | i wish the playground didn't make me scroll so much. |
23:22:09 | clyybber | case object init got smarter |
23:22:10 | disruptek | i think you're missing a string cast somewhere. you're comparing to x when you need to compare to "x". |
23:22:14 | clyybber | the error messages dumber |
23:22:31 | clyybber | well, not dumber since they are not emitted as often now |
23:22:32 | disruptek | probably line 39ish |
23:23:36 | disruptek | damn 4-digit versions. who are these people? |
23:23:43 | FromDiscord | <Fern & Simula (They/Them)> nope, `k` is the string value |
23:23:59 | FromDiscord | <Fern & Simula (They/Them)> it's in a table where the keys are strings, and the values are NimNodes |
23:24:33 | disruptek | but is it a literal string? |
23:24:36 | clyybber | disruptek: tell me, is this acceptable: https://paste.gg/p/anonymous/22414066a6384c7bb4b979fdba117dc2 ? |
23:24:36 | FromDiscord | <Fern & Simula (They/Them)> yes |
23:25:09 | FromDiscord | <Fern & Simula (They/Them)> `k` is the string value taken directly from the ident nodes passed to the macro |
23:25:11 | disruptek | acceptable how? |
23:25:27 | clyybber | acceptable in the sense that it degraded the error messages |
23:25:30 | disruptek | k is a string literal? not a string value. |
23:25:42 | clyybber | well, theres no way around degrading them |
23:25:43 | FromDiscord | <Fern & Simula (They/Them)> oh. k is a string value |
23:25:45 | clyybber | afaict |
23:25:50 | disruptek | has to be a literal. |
23:25:53 | clyybber | I guess I'll have to write some docs |
23:25:58 | FromDiscord | <Fern & Simula (They/Them)> what, why? |
23:26:29 | disruptek | because that's what you're trying to compare. x isn't in scope there. |
23:27:00 | FromDiscord | <Fern & Simula (They/Them)> but enclosing it in backticks should turn it into a literal, shouldnt it? |
23:27:12 | FromDiscord | <Fern & Simula (They/Them)> k isnt x, k is "x" |
23:27:12 | disruptek | clyybber: i32 is a field? |
23:27:32 | disruptek | k needs to be newStrLit(k) |
23:27:42 | disruptek | if i'm reading this right... |
23:27:48 | FromDiscord | <Fern & Simula (They/Them)> i dont think you are |
23:28:00 | FromDiscord | <Fern & Simula (They/Them)> in the error message it says if token.val == "x":, so x is a string literal |
23:28:49 | clyybber | disruptek: Eh of course that 2nd one will be fixed. Which i32? |
23:28:57 | disruptek | near the end. |
23:28:58 | clyybber | Ah yeah |
23:29:03 | clyybber | In that test case yeah |
23:29:38 | disruptek | where is the error message? |
23:30:00 | disruptek | oh, i see. |
23:30:05 | clyybber | the ones after Expected: are the old ones |
23:30:14 | clyybber | the ones after Gotten: the new ones |
23:30:22 | disruptek | yes, i grokked that. |
23:30:27 | clyybber | k :p |
23:31:08 | disruptek | oh, so you're trying to echo [x], right? |
23:31:27 | FromDiscord | <Fern & Simula (They/Them)> yeah |
23:31:42 | FromDiscord | <Fern & Simula (They/Them)> just as a small test. that should change in the future |
23:32:11 | disruptek | i think that body is malformed somehow, because nim is expecting an identifier and it's getting an if statement. |
23:32:28 | disruptek | print it with `repr` or `treeRepr` |
23:33:55 | FromDiscord | <Fern & Simula (They/Them)> `(StmtList (Command))` |
23:34:53 | FromDiscord | <Fern & Simula (They/Them)> yeah i think thats the issue |
23:35:02 | FromDiscord | <Fern & Simula (They/Them)> i think i misread a previous thing and made a bad node |
23:35:58 | FromDiscord | <Fern & Simula (They/Them)> yup thats it. replaced it with mainBody = newStmtList |
23:36:12 | disruptek | yay |
23:43:57 | FromDiscord | <Fern & Simula (They/Them)> thank you so much, im so happy :) |
23:44:41 | disruptek | with great power comes great responsibility. |
23:45:11 | * | FromDiscord <Fern & Simula (They/Them)> writes all the terrible macros |
23:46:49 | * | clyybber tests |
23:46:57 | FromDiscord | <Clyybber> nice |
23:47:39 | disruptek | hmm, nimph is letting me downgrade outside of the project's reqs but not outside of the dependency reqs. |
23:48:07 | disruptek | but, like, it knows it's broken. |
23:48:15 | disruptek | npeg>=0.21.3 from nimph unmet by npeg-#0.20.0 |
23:53:10 | disruptek | doesn't anyone test this stuff? |