00:12:03 | FromDiscord | <Varriount> Yardanico: One median blur filter, and that looks like it would make a great desktop |
00:12:11 | Yardanico | lol |
00:18:24 | * | martinium joined #nim |
00:18:53 | martinium | Hello, everyone I am glad to see all the progress Nim has made since I last used in version 0.13 |
00:19:06 | Yardanico | martinium: wow that was quite a while ago :P |
00:19:17 | martinium | Documentation is spectacular! So great job guys |
00:19:28 | martinium | I am converting a python script I use at work into Nim |
00:19:32 | * | bunbunbunbunny joined #nim |
00:19:33 | martinium | I need the performance |
00:19:53 | martinium | python script is still running for over 5 hours and I think Nim should be able to do it faster |
00:20:00 | Yardanico | what does it do? |
00:21:03 | martinium | we use a vuln management tool at my job so I am using API to get all site names within the tool and create a custom dict that stores its name then using the ID of the site I have to do another http request to another endpoint to get the list of assets and their IDs and paginate through however many pages |
00:21:27 | Yardanico | that mostly sounds like an IO-bound task though |
00:21:39 | martinium | then after than I am searching for each asset IDs vulns and iterating through them all and exporting to CSV with name of site etc that I put together from first call |
00:21:58 | martinium | then filtering to just TLS/SSL vulns with an if conditional |
00:22:06 | martinium | so far running time for python script is 6 hours |
00:22:12 | martinium | still going |
00:22:26 | martinium | we have a lot of assets |
00:22:53 | martinium | anyways, my question is how do you do HTTP basic authentication with httpClient in Nim? |
00:23:04 | martinium | I am spoiled by Python's Requests lib |
00:23:25 | Yardanico | well basic auth is just an "Authorization" header with stuff |
00:23:27 | Yardanico | https://stackoverflow.com/questions/47791826/how-do-i-authenticate-using-nims-httpclient-module-to-retrieve-html :P |
00:24:43 | martinium | yeah you have to base64 encode it |
00:24:57 | martinium | username and password and then base64 encode it |
00:25:12 | martinium | "Authorization: Basic" is the header |
00:25:25 | martinium | was just wondering if there was a time saving function in Nim to handle that |
00:28:55 | martinium | seems newProxy seems to implement what I am looking for but I don't need a connection proxy |
00:29:23 | Yardanico | well it uses a "Proxy-Authorization" header |
00:29:51 | martinium | yeah |
00:30:05 | martinium | need it to be only Authorization: Basic header instead |
00:30:18 | martinium | guess I'll have to create a custom function to take care of that |
00:35:07 | * | couven92 quit (Quit: Client Disconnecting) |
00:46:27 | martinium | anyone know how to import variables from a separate source file |
00:46:43 | martinium | I am doing from file import * and it isn't reading my variables |
00:48:57 | FromDiscord | <Varriount> martinum: Are you exporting your variables, and isn't it just `import file`? |
00:50:28 | leorize | I can see python habits peeking through :P |
00:53:18 | martinium | how do I export the variables so they are visible in other source file? |
00:53:43 | Yardanico | martinium: use asterisk * |
00:53:48 | Yardanico | like "proc test*()..." |
00:54:02 | Yardanico | or "type MyType* = myfield*: int" |
00:54:25 | martinium | yep that solved it |
00:54:27 | martinium | Thanks! |
00:55:03 | skrylar[m] | i had some nim support code for flatbuffers somewhere |
00:55:26 | FromDiscord | <Varriount> martinum: https://gist.github.com/Varriount/bacbcb5af7e75f686249eec3a94195f5 |
00:56:06 | skrylar[m] | @Recruit_main707 https://github.com/Skrylar/skflatbuffers |
00:57:25 | FromDiscord | <Varriount> What are flat buffers? Aren't buffers usually flat by default (being backed by arrays and all...)? |
00:58:01 | Yardanico | xd |
00:58:03 | skrylar[m] | nah its one of those serialization formats thats largely blitting structs |
00:59:03 | skrylar[m] | there is an offset field that says each field is N bytes from the table and then you can do some machinery where you read those offsets and adjust some pointers, it was meant for some phone games to get out of having to do serialization code |
00:59:10 | martinium | plan is to convert this: https://gist.github.com/martinium/c93119a6e4fb0bb4914fc5dfbc7c91af into Nim |
01:00:12 | Yardanico | I still think that it's mostly IO-bound |
01:01:07 | Yardanico | and even in python you can make it much faster with async |
01:01:08 | skrylar[m] | @Varriount the weaker platform (the phone) can blit the structs and put in some offset blobs, the stronger one (server) can adjust some pointers so deserialization is mostly an extra pointer deref... capnproto has a similar idea but does it differently. they're both a little worse with bandwidth though since they don't compress as well |
01:02:02 | skrylar[m] | (capnproto the fields always have the same order so theres no offset table, but the structs are packed in a deterministic way which is not the same as the C compiler) |
01:03:33 | martinium | Yardanicowouldn't IO be much faster in a compiled language regardless? |
01:03:47 | Yardanico | IO means that most of the time is spent waiting for IO |
01:03:54 | Yardanico | for network requests or writing data |
01:04:12 | martinium | it does the network request then processing the data then writes each row |
01:04:16 | Yardanico | well I suppose nim version will be faster anyway but you can make python version much faster nonetheless |
01:04:21 | martinium | seems to take a while and I have a super fast SSD |
01:04:22 | * | Faulander quit (Read error: Connection reset by peer) |
01:04:48 | martinium | running for 6.5 hours elapsed so far |
01:05:13 | martinium | if my nim converted version ends up much faster I am going to jump |
01:05:17 | martinium | then I'll make it async |
01:05:18 | * | Faulander joined #nim |
01:05:42 | martinium | text data over internet is usually super fast |
01:06:05 | skrylar[m] | i don't suppose you've put in profile tracing code yet :eyes: |
01:06:43 | Yardanico | martinium: not when you do like millions of requests sequentially :P |
01:06:55 | Prestige | not sure if this is a bug, but I'm getting an error with imports here: https://play.nim-lang.org/#ix=2j1r |
01:07:24 | Yardanico | what error |
01:07:26 | Prestige | Line 51 says windowmanager isn't defined, but works if i import nimdow/windowmanager as windowmanager |
01:07:31 | Yardanico | oh lol wtf is / |
01:07:33 | Yardanico | oh nvm |
01:08:16 | Prestige | I also can't import windowmanager inside that import array (lines 3-7) |
01:10:19 | Prestige | Does that seem off? Here's the file hierarchy: https://0x0.st/ijst.png |
01:13:25 | Yardanico | i'm not sure but it probably happens because you have "a/b" inside of [] import |
01:14:06 | Prestige | weird because that syntax is working on its own |
01:15:11 | Yardanico | well idk if you really can use it like that in brackets :P |
01:15:15 | Yardanico | i've never seen that |
01:17:06 | martinium | success, authentication and API calls working good |
01:17:27 | martinium | are the methods for the asyncHttpClient roughly the same as non async? |
01:18:15 | Yardanico | yes, but you need to call them in an async context |
01:18:42 | Yardanico | and to actually take advance of async you will need to do start all futures in a loop or something, and then wait for completion of them all |
01:18:53 | martinium | to work with a received json response can I access the data directly using iterator["key"] syntax or do I first need to parse it into a jsonnode for nim? |
01:19:11 | Prestige | Hm well Yardanico if I change it to this, I still have to use `as windowmanager` https://play.nim-lang.org/#ix=2j1u |
01:21:23 | Yardanico | martinium: you get strings from httpclient mostly (if you do stuff like getContent), but if you use something like "get" then for async you'll also need to await the body of the response |
01:21:26 | Yardanico | and then parseJson it |
01:21:56 | Yardanico | Prestige: well maybe compiler is confused so it reports "not used" |
01:22:04 | Yardanico | but does it work with the first way? |
01:22:10 | martinium | I did this and printed to std out using req.body() in echo function to see if response was good |
01:22:11 | martinium | var req = client.request(url, httpMethod=HttpGet, multipart=data) |
01:22:44 | Prestige | with a/b inside the array? Yes that works Yardanico |
01:30:10 | FromDiscord | <Elegant Beef> Prestige do you know how to get requests of full screen/floating? |
01:30:23 | martinium | how can I deal with this error Error: unhandled exception: input(1, 5) Error: string literal as key expected [JsonParsingError] |
01:30:37 | Prestige | Nah haven't looked into it yet Elegant Beef |
01:30:42 | Prestige | about to finish up user config stuff |
01:30:55 | FromDiscord | <Elegant Beef> Ah im just about to go to user config stuff 😄 |
01:31:02 | disruptek | martinium: fix your js encoder to follow the standard. |
01:31:06 | FromDiscord | <Elegant Beef> Current progresshttps://streamable.com/gzztzv |
01:31:21 | disruptek | beef: is this wayland or...? |
01:31:32 | FromDiscord | <Elegant Beef> xlib |
01:31:39 | Prestige | Nice Elegant Beef |
01:31:54 | disruptek | there's that troubled pupper. |
01:32:04 | Prestige | I haven't actually started on anything with window management yet, just config for key bindings |
01:32:07 | martinium | I have no clue how I would fix that |
01:32:09 | martinium | lol |
01:32:09 | FromDiscord | <Elegant Beef> I mean he knows i've talked to you, he's just worried about me |
01:32:11 | martinium | :) |
01:32:39 | disruptek | pipe it through jq i guess. |
01:32:43 | martinium | doing this |
01:32:44 | martinium | let jsonNode = parseJson("{req.body()}") |
01:32:48 | FromDiscord | <Elegant Beef> Yea like i said i want to use nim script for configurating my wm so I think im going to give the window managing a break and implement the nimscript stuff i need |
01:32:58 | disruptek | or use npeg. |
01:33:05 | Yardanico | martinium: nim has string interpolation, but not in all literals :) |
01:33:16 | Yardanico | let node = parseJson(req.body) |
01:33:29 | FromDiscord | <Elegant Beef> Then after the config i get to figure out how to make nimscriptable imgui widgets 😄 |
01:33:33 | martinium | I was just following example |
01:33:40 | martinium | they had quotes around it etc |
01:34:21 | Yardanico | martinium: where? |
01:34:54 | Yardanico | if they had quotes, then they also had "&" or "fmt" before the string which comes from "strformat" module and it's really useless in this example |
01:34:56 | martinium | from here https://nim-lang.org/docs/json.html |
01:35:05 | martinium | I should have paid closer attention since it was literally literals in there |
01:35:08 | martinium | haha |
01:36:51 | martinium | so that fix worked but it ignored my multipart query |
01:37:00 | martinium | it only iterated through 10 |
01:37:12 | martinium | api response default is 10 max is 500 |
01:37:28 | martinium | I added the filter for it to be 500 so weird that the loop only did 10 |
01:37:39 | disruptek | maybe it got tired. |
01:38:06 | disruptek | i usually need a sip of something between 6 and 8. |
01:38:26 | * | endragor joined #nim |
01:38:57 | martinium | probably |
01:41:49 | * | Tlongir joined #nim |
01:44:25 | * | dadada quit (Ping timeout: 250 seconds) |
01:47:40 | martinium | wow my python processing finally finished |
01:47:45 | martinium | took it 7 hours |
01:47:50 | martinium | .... |
01:48:17 | Prestige | Elegant Beef: I just finished user config, aside from dynamically loading the file's location |
01:48:20 | martinium | Nim save meeeee |
01:48:23 | Prestige | https://github.com/avahe-kellenberger/nimdow <- using toml |
01:50:39 | martinium | anyone create a library like this for Nim yet? http://zetcode.com/python/prettytable/ |
01:51:02 | martinium | if not I may take it upon myself when I come to grips with the language enough |
01:51:34 | Yardanico | there's https://github.com/xmonader/nim-terminaltables |
01:52:48 | martinium | ah perfect |
01:52:50 | martinium | same thing |
01:54:48 | * | bunbunbunbunny quit (Ping timeout: 256 seconds) |
01:55:50 | * | endragor quit (Remote host closed the connection) |
01:56:26 | martinium | does nim allow you to create empty hashmaps and empty lists? |
01:56:36 | Yardanico | martinium: of course |
01:56:48 | disruptek | since when? |
01:56:59 | Yardanico | var myemptyseq = newSeq[string]() for an empty sequence of strings |
01:57:10 | martinium | I am trying to declare an empty list as var id_lst = @[] |
01:57:14 | Yardanico | you need a type |
01:57:21 | Yardanico | nim can't infer type in that example |
01:57:39 | Yardanico | so you either do var id_lst: seq[mytype] = @[] or var id_lst = newSeq[mytype]() |
01:58:01 | martinium | ah I see |
01:58:09 | martinium | same thing for a hashmap or slightly different? |
01:58:21 | Yardanico | it's called "table" in nim, "tables" module |
01:58:40 | Yardanico | if you need value semantics, var tabl = initTable[keytype, valtype]() |
01:58:49 | Yardanico | if ref semantics - var tabl = newTable[keytype, valtype]() |
01:59:42 | martinium | Thanks, this will save me some googling |
02:00:15 | Yardanico | no need for googling |
02:00:15 | Yardanico | https://nim-lang.org/docs/tables.html |
02:00:28 | disruptek | WHEN DID WE GET DOCS? |
02:00:45 | martinium | I will say the docs have improved substantially since I was here last |
02:00:49 | martinium | 0.13 was a while back |
02:00:54 | martinium | back then they were good also |
02:01:03 | martinium | but now there are even more examples I think |
02:01:47 | * | chemist69 quit (Ping timeout: 246 seconds) |
02:02:46 | * | chemist69 joined #nim |
02:05:02 | martinium | can a table have multiple value types if so how? |
02:05:08 | Yardanico | no |
02:05:18 | Yardanico | what's your use case? |
02:05:28 | disruptek | use a variant object. |
02:05:45 | * | dadada joined #nim |
02:06:08 | * | dadada is now known as Guest15539 |
02:08:20 | martinium | only thinking of json since it has diff value types |
02:08:36 | disruptek | that a negatory, ace. |
02:08:37 | FromDiscord | <Elegant Beef> lol prestige, dynamic file location is silly, just for `~/.config/wmname/wmname.configextension` |
02:08:38 | martinium | but nim has specific json types for jsonNode already |
02:08:56 | Yardanico | martinium: you can use json module, yes |
02:09:01 | disruptek | no, they are all type JsonNode. |
02:09:08 | Yardanico | also, why do you really need that? |
02:09:19 | * | bunbunbunbunny joined #nim |
02:10:11 | Prestige | Atm I just load config.default.toml from the project Beef |
02:10:20 | FromDiscord | <Elegant Beef> ah |
02:10:38 | FromDiscord | <Elegant Beef> Im also going to use toml, since embedded nimscript seems very limited for what i wanted |
02:10:43 | FromDiscord | <Elegant Beef> and i cant be arsed to expand it |
02:10:53 | FromDiscord | <Elegant Beef> So widgets will end in a burning ring of fire |
02:10:56 | Prestige | I'm going to have a global default config, and a user config that will be in ~/.config/nimdow/ |
02:10:58 | FromDiscord | <Elegant Beef> or i just use a different bar |
02:10:59 | Yardanico | it's much less limited than TOML though :P |
02:11:20 | FromDiscord | <Elegant Beef> Yea but i wanted to pass types from nimscript to nim but it's currently not possible |
02:11:29 | Yardanico | wdym "types"? |
02:11:40 | FromDiscord | <Elegant Beef> Constructed objects |
02:12:28 | Prestige | Reading PMunch's code that uses NimNodes is hurting my brain |
02:13:18 | Yardanico | you mean macros |
02:13:33 | disruptek | get him to read it for you; he has a voice like liquid sex and thighs that just won't quit. |
02:13:33 | Prestige | Yeah, using NimNodes and quote do |
02:13:41 | Prestige | lmao disruptek |
02:14:01 | disruptek | what? |
02:14:14 | Prestige | It was a very funny sentence |
02:14:25 | Prestige | I think he and I are going to talk about the code this weekend but yeah |
02:14:44 | disruptek | i never knew what they meant by "a dancer's hips" until i met pmunch. |
02:15:20 | Yardanico | disruptek: your voice is very nice too :P |
02:15:26 | disruptek | awww |
02:16:02 | martinium | what is the proper way to add url query params? |
02:16:15 | martinium | I mistakenly used Add() |
02:16:39 | martinium | on a newMultiPartData() object |
02:16:47 | Yardanico | concat |
02:16:57 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:17:02 | Yardanico | string concatenation :P if you mean for get requests |
02:17:14 | martinium | yeah |
02:17:19 | martinium | so manually? |
02:17:28 | disruptek | there's an encodeQuery iirc. |
02:17:36 | martinium | let me look that up |
02:17:38 | Yardanico | ah yes |
02:17:43 | Yardanico | there is, in "uri" module |
02:18:06 | martinium | https://nim-lang.org/docs/uri.html#encodeQuery%2CopenArray%5B%5D |
02:18:09 | martinium | yep |
02:18:15 | martinium | have to import uri module |
02:18:19 | disruptek | FUCK |
02:18:44 | disruptek | it's just one thing after another with this fucking language. |
02:18:48 | Yardanico | disruptek: i see you're not in a good mood today xd |
02:18:51 | * | muffindrake joined #nim |
02:19:04 | disruptek | my balls are throbbin', that's for damn sure. |
02:19:19 | disruptek | you know what i hate about uri? |
02:19:55 | Yardanico | wat |
02:19:59 | * | endragor joined #nim |
02:20:09 | disruptek | it defines Url and doesn't use it for shit. |
02:20:17 | disruptek | fucking useless. |
02:20:27 | Yardanico | lol actually yes |
02:20:28 | Yardanico | xdd |
02:21:01 | Yardanico | it's there for at least 6 years |
02:21:05 | disruptek | i need an ice pack; those brazilians did a number on the ol' plums. |
02:21:18 | Yardanico | https://github.com/nim-lang/Nim/commit/cf87759e2911cb44aaf1e107f20417df74d2a606 |
02:21:23 | Yardanico | it was actually used! |
02:21:24 | Yardanico | in the past |
02:21:38 | disruptek | great, that really helps. |
02:23:12 | FromDiscord | <Elegant Beef> prestige are you using the toml nimble package? |
02:23:27 | disruptek | i done tol' you not to use that shit. |
02:23:33 | FromDiscord | <Elegant Beef> You didnt tell me |
02:23:40 | Yardanico | disruptek: I think toml is fine :P |
02:23:41 | Prestige | parsetoml |
02:23:41 | FromDiscord | <Elegant Beef> Also you cant use said shit cause it doesnt install |
02:23:51 | Yardanico | "parsetoml" |
02:23:53 | FromDiscord | <Elegant Beef> No issues installing it? |
02:24:06 | Prestige | nah, I just nimble install parsetoml |
02:24:15 | FromDiscord | <Elegant Beef> Well it seems to not like me then |
02:24:18 | disruptek | it cannot parse what it writes, and what it writes is not pretty. |
02:24:24 | disruptek | so you may as well use json. |
02:24:29 | Prestige | I couldn't build with nimble after adding parsetoml to my repo tho, idk why |
02:24:35 | Yardanico | how did you add it |
02:24:35 | Prestige | so I just used nim c |
02:24:38 | Yardanico | and what's the error |
02:24:44 | Prestige | let me check |
02:24:44 | disruptek | nimble is for chumps. |
02:24:55 | FromDiscord | <Elegant Beef> https://hatebin.com/srmuqruiib |
02:24:58 | FromGitter | <kaushalmodi> disruptek: ⏎ ⏎ > it cannot parse what it writes, and what it writes is not pretty. ⏎ ⏎ hmm? [https://gitter.im/nim-lang/Nim?at=5e9faafa312a2d132c27b720] |
02:24:58 | FromDiscord | <Elegant Beef> My issue |
02:25:15 | FromGitter | <kaushalmodi> I have use parsetoml in lot of my projects.. reads/writes toml just fine |
02:25:17 | Prestige | src/nimdowpkg/config/config.nim(3, 3) Error: cannot open file: parsetoml |
02:25:35 | disruptek | i tried using toml for nimph's lockfiles. i dunno; maybe i'm an idiot. |
02:25:35 | Prestige | seems like a nimble issue to me |
02:25:51 | Yardanico | try to reinstall it I guess |
02:26:08 | Yardanico | here it's proper "modern" nimble syntax https://github.com/NimParsers/parsetoml/blob/master/parsetoml.nimble |
02:26:12 | Prestige | Yardanico: it works if I compile it manually with nim, just not if I try compiling with `nimble build` |
02:26:20 | Prestige | https://github.com/avahe-kellenberger/nimdow if you wanted to see |
02:26:21 | Yardanico | how is it specified in your .nimble file |
02:26:38 | Yardanico | you should add requires "parsetoml" |
02:26:38 | Prestige | exec "nim c src/nimdow.nim" |
02:26:47 | Prestige | oh neat |
02:26:53 | Prestige | thanks, I forgot about that |
02:27:02 | martinium | this URI stuff is annoying |
02:27:04 | martinium | ugh |
02:27:06 | Yardanico | also why gplv2 ? :P just a friendly question |
02:27:26 | Yardanico | ah there's no license at all so it's all rights reserved, sorry :P |
02:27:29 | disruptek | kaushalmodi: got a sample project to share? |
02:27:43 | Prestige | I should attach the license just haven't bothered |
02:27:59 | Yardanico | well by default if some repo on github has code and no license it means that it's "all rights reserved" |
02:28:00 | FromDiscord | <Elegant Beef> MIT or broke 😄 |
02:28:04 | Yardanico | so you can look at the source but not use it |
02:28:08 | Yardanico | without the permission of the owner |
02:28:12 | FromDiscord | <Elegant Beef> Yea i fucking hate it |
02:28:17 | FromDiscord | <Elegant Beef> Nim embedded is also like that |
02:28:24 | FromDiscord | <Elegant Beef> nimscript* |
02:28:24 | Prestige | I'll go add it then |
02:28:33 | Yardanico | https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository "However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work. " |
02:28:47 | Prestige | Yeah, I just was lazy |
02:28:52 | Prestige | I usually add the license |
02:29:16 | leorize | I'm going for MPL nowadays |
02:29:20 | leorize | MIT is too lax |
02:30:21 | FromDiscord | <Yardanico> Yeah MPL is kinda nice too |
02:30:45 | martinium | found what I needed |
02:30:46 | martinium | https://nim-lang.org/docs/uri.html#%3F%2CUri%2CopenArray%5B%5D |
02:30:53 | martinium | that's a useful proc |
02:31:20 | FromDiscord | <Elegant Beef> Prestige what nim version are you running? |
02:31:33 | Prestige | 1.2.0 |
02:31:46 | FromDiscord | <Elegant Beef> Ok so then i have no clue why i cant install this |
02:31:57 | Prestige | u can't nimble install parsetoml? |
02:32:07 | Prestige | I did install nim with choosenim btw, if that makes a difference |
02:32:15 | FromDiscord | <Elegant Beef> I did too |
02:32:39 | FromDiscord | <Elegant Beef> so just for fun i did sudo and it installed |
02:32:45 | Prestige | O.o |
02:33:12 | Prestige | weird permissions maybe, did u get an error when installing normally? |
02:33:27 | FromDiscord | <Elegant Beef> i got an error but nothing complaining about permissions |
02:33:32 | disruptek | don't use sudo, chuckles. |
02:33:41 | FromDiscord | <Elegant Beef> Oh i know disruptek |
02:33:54 | Prestige | What error? |
02:33:57 | FromDiscord | <Elegant Beef> It's more of a "does this change anything" and less of a solution |
02:34:03 | FromDiscord | <Elegant Beef> I already posted it up ther |
02:34:06 | FromDiscord | <Elegant Beef> there* |
02:34:21 | Prestige | Yardanico: about gpl2, I just agree with the ideology |
02:35:04 | FromDiscord | <Elegant Beef> Doesnt gpl2 remove a fair bit of freedom from the software? |
02:35:13 | FromDiscord | <Elegant Beef> Requiring changes to be open sourced |
02:35:18 | Prestige | as opposed to something like bsd, yeah |
02:36:14 | FromDiscord | <Varriount> GPL for applications, bsd/mit for libraries |
02:36:35 | Prestige | eh |
02:36:40 | Prestige | matter of opinion |
02:37:42 | FromDiscord | <Varriount> I have yet to see many (any?) companies do the things the GPL protects against with regards to libraries. |
02:37:42 | FromDiscord | <Elegant Beef> Idk feels sorta silly imo to publish anything openly whilst preventing reuse of anything in it |
02:38:01 | Prestige | wdym? |
02:38:39 | FromDiscord | <Elegant Beef> I mean if you want to take code, use it and modify it and put it on proprietary software you arent allowed |
02:38:46 | FromDiscord | <Elegant Beef> Atleast the way i understand it |
02:38:56 | Prestige | well just the last part, yes |
02:38:58 | leorize | well sometimes that's exactly what people want |
02:39:08 | disruptek | hookers and blow? |
02:40:00 | FromDiscord | <Elegant Beef> Liberty, and prosperity? |
02:40:32 | FromGitter | <kaushalmodi> disruptek: ⏎ ⏎ > got a sample project to share? ⏎ ⏎ No, all are company-internal [https://gitter.im/nim-lang/Nim?at=5e9fae9f35a35031bf79e5ac] |
02:40:51 | FromDiscord | <Elegant Beef> That's a terrible quote system 😄 |
02:40:52 | disruptek | you make me sad. |
02:41:07 | FromDiscord | <Elegant Beef> Good |
02:41:31 | disruptek | well, my toml effort is in nimph's git history. |
02:41:32 | rockcavera | my devel version is not compiling. ;`( |
02:42:09 | FromDiscord | <Varriount> When I've encountered a GPL that looked useful while working on an internal tool, I've nearly always had to walk away from it. |
02:42:10 | Prestige | basically it boils down to me not support proprietary software |
02:42:13 | rockcavera | https://pastebin.com/Wr1bQFD3 |
02:42:24 | Prestige | supporting* |
02:42:41 | leorize | Varriount: you are allowed to use gpl for things you don't release, like internal tools |
02:43:14 | FromDiscord | <Varriount> Leorize: Yes, but the phrase there is "don't release" |
02:43:27 | disruptek | rockcavera: is this new? |
02:43:33 | rockcavera | yes |
02:43:37 | rockcavera | now |
02:43:42 | leorize | Varriount: it technically just mean that whoever got the tool can ask you for a copy of the source, but since it's internal you don't really have to care about it? |
02:43:44 | disruptek | you usually use gcc on windows? |
02:43:51 | FromGitter | <kaushalmodi> disruptek: here's an old public project using parsetoml: https://github.com/kaushalmodi/nbuild/blob/master/src/nbuild.nim |
02:43:52 | rockcavera | yes, gcc |
02:44:12 | FromDiscord | <Varriount> leorize: And what do I do when my company wants to distribute said tool? |
02:44:26 | FromDiscord | <Varriount> (to customers) |
02:44:31 | leorize | tell them to release the source? :P |
02:44:38 | FromGitter | <bung87> why the htmlparser $html result a document element |
02:45:21 | FromDiscord | <Varriount> leorize: Yes, I'm sure that would just make the manager's day. |
02:45:45 | leorize | lol |
02:45:55 | disruptek | rockcavera: reproduced on linux. |
02:46:08 | * | endragor quit (Remote host closed the connection) |
02:46:31 | rockcavera | disruptek, so less bad. |
02:46:37 | disruptek | yeah. |
02:47:00 | disruptek | this commit hash works: 1b6c4ed2ba29f855b47ff295515b54c9ae4edafa |
02:47:30 | * | endragor joined #nim |
02:48:14 | * | dddddd quit (Ping timeout: 256 seconds) |
02:50:31 | FromGitter | <kaushalmodi> disrupek: for the issue you faced with parsetoml, can you open an issue on its repo? |
02:52:01 | FromGitter | <sealmove> federico3 you here? |
02:52:05 | * | endragor quit (Ping timeout: 265 seconds) |
02:52:55 | disruptek | someone can merge #14063 to fix devel. |
02:52:56 | disbot | https://github.com/nim-lang/Nim/pull/14063 -- 3fix typo preventing build |
02:53:09 | disruptek | uh, i can open an issue maybe, sure. |
02:53:42 | disruptek | not a big deal because json works for me and as long as the output is sloppy, toml is useless -- it's supposed to make editing easier, not harder, after all. |
02:55:26 | martinium | need help with this error |
02:55:28 | martinium | type mismatch: got <seq[int], JsonNode>but expected one of:proc add[T](x: var seq[T]; y: T)first type mismatch at position: 2required type for y: Tbut expression 'item["id"]' is of type: JsonNodeproc add[T](x: var seq[T]; y: openArray[T])first type mismatch at position: 2required type for y: openArray[T]but expression 'item["id"]' is of type: |
02:55:28 | martinium | JsonNode14 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see themexpression: add(asset_ids, item["id"])Peek Problem (⌥F8)No quick fixes available |
02:55:47 | martinium | seems like it wants a generic type |
02:56:08 | disruptek | item["id"].getInt most likely. |
02:56:12 | martinium | I am trying to pass a value from one of the json keys in each iteration |
02:56:16 | martinium | ok let me try that |
02:56:30 | disruptek | confidence intensifies |
02:56:40 | martinium | works |
02:56:48 | martinium | so you have to be more explicit |
02:56:52 | martinium | in this language |
02:57:10 | disruptek | no; JsonNode is a type. getInt unpacks the int value from it. |
02:57:18 | disruptek | getInt() i should say. |
02:57:25 | disruptek | for one alternative, see |
02:57:27 | disruptek | !repo jsonconvert |
02:57:29 | disbot | https://github.com/disruptek/jsonconvert -- 9jsonconvert: 11lazy json node conversion 15 2⭐ 0🍴 |
02:58:26 | disruptek | the language is typed, sure; this is a wonderful feature. |
02:58:39 | martinium | yes, will help avoid a lot of errors |
02:58:52 | rockcavera | disruptek, with your pull you compiled normally. |
02:59:05 | disruptek | yes. |
02:59:11 | martinium | does the $ stringify values |
02:59:11 | martinium | ? |
02:59:14 | disruptek | yes. |
02:59:20 | martinium | beautiful |
02:59:26 | martinium | so concise |
02:59:26 | disruptek | when it is defined for the type, that is. |
02:59:36 | disruptek | it is a proc such as any other. |
03:00:03 | martinium | its the functions mannnnn |
03:00:18 | disruptek | dude. |
03:01:30 | disruptek | varriount: you up |
03:01:57 | shashlick | disruptek did you think more about our conversation the other day |
03:02:11 | disruptek | yeah. |
03:02:28 | shashlick | And feedback? |
03:02:31 | disruptek | i'm not interested in a 3-way at this time. |
03:02:56 | disruptek | flattered that you asked, of course. |
03:04:02 | FromDiscord | <Varriount> Disruptek: yeah |
03:04:16 | disruptek | varriount: you get to be the hero that unbreaks the build. |
03:04:24 | FromDiscord | <Varriount> ? |
03:04:28 | disruptek | shashlick: we need to fix nimterop. |
03:04:45 | shashlick | What's up |
03:04:47 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:04:55 | shashlick | I'm neck deep in it so anything goes |
03:05:18 | disruptek | also, i still like your idea. i just don't want to promote fracture of the pm behavior. let's make it work for everyone. |
03:05:44 | disruptek | i could not make includes and private imports work, so yeah, there will need to be something there. |
03:06:05 | shashlick | I don't know if that's what I'm proposing, just that the interfaces should be clean and in one direction |
03:06:05 | disruptek | but it's madness to say "my tool can only be installed with pm X" |
03:06:12 | * | bunbunbunbunny quit (Ping timeout: 256 seconds) |
03:06:21 | disruptek | well, no argument here. |
03:06:52 | disruptek | wrt nimterop, i'm convinced its untenable in its current run-toast-at-ct form. |
03:07:13 | shashlick | Also, there's no compulsion to use a particular tool but if openssl can only be compiled reliably with autoconf, just invoke it and call it a day |
03:07:16 | disruptek | all things considered, that's my considered opinion. |
03:07:37 | shashlick | Toast is getting more and more capable by itself |
03:07:57 | FromDiscord | <Varriount> How does this involve me? |
03:08:03 | disruptek | you have merge rights. |
03:08:16 | FromDiscord | <Varriount> I do... |
03:08:20 | disruptek | "someone can merge #14063 to fix devel." |
03:08:21 | disbot | https://github.com/nim-lang/Nim/pull/14063 -- 3fix typo preventing build |
03:09:21 | FromDiscord | <Varriount> I'll merge it, but what led to the typo in the first place? |
03:09:27 | disruptek | shashlick: if you wanna spend money, i hope you'll spend it in having ct code select from platform-specific wrappers generated aot. |
03:09:35 | disruptek | varriount: sleepy araq |
03:10:19 | disruptek | misbehavior ci, too, i guess. |
03:10:35 | FromDiscord | <Elegant Beef> How do we parse enums from strings in nimland? |
03:10:48 | leorize | strutils.parseEnum |
03:10:55 | FromDiscord | <Elegant Beef> Ok thanks |
03:11:03 | disruptek | strutils.parseEnum[SomeEnumType](somestr) is the syntax you'll need. |
03:11:03 | skrylar[m] | eh, i use mpl-2 these days. i'm partial to [a]gpl in some ways but always tended to prefer the lgpl+link exception |
03:11:22 | shashlick | Aot? |
03:11:26 | disruptek | ahead-of-time |
03:11:50 | shashlick | But it only generates once after which it is cached |
03:12:40 | disruptek | that's cool, man, but not as cool as reliable builds. |
03:13:10 | * | bunbunbunbunny joined #nim |
03:13:19 | disruptek | we're stuck between a rock and a hard place. |
03:13:36 | skrylar[m] | did you mean reliable or reproducible |
03:13:42 | disruptek | reliable. |
03:14:36 | shashlick | disruptek: have you read the latest nimterop readme? |
03:14:44 | shashlick | i've tried to explain the compile time pov |
03:14:57 | skrylar[m] | wasn't aware that installing packages was a hard problem these days |
03:15:06 | disruptek | i will look, but i truly believe that i understand that pov. |
03:15:16 | shashlick | there's 3 things - platform, compiler (version) and packages (nim and C libs) |
03:15:17 | disruptek | i even shared that pov at a point. |
03:15:57 | martinium | whats the error here: sites_map.add(item["id"].getInt().intToStr(): item["name"].getStr()) |
03:16:00 | shashlick | every render depends on all those things so there's not really a single wrapper that can be cached |
03:16:17 | shashlick | for simple libs, it is definitely possible |
03:16:36 | shashlick | but without looking at the library headers in detail, there's no way to know |
03:16:40 | disruptek | , not : |
03:16:54 | martinium | got it |
03:17:03 | martinium | actually just fixed before you commented woohoo |
03:17:15 | martinium | thanks |
03:17:18 | disruptek | not need for () on calls with at least one arg. |
03:17:24 | shashlick | i was working on PMunch's wrapper request for openssl |
03:17:28 | disruptek | rtfm re: UFCS |
03:17:31 | disruptek | you'll love it. |
03:17:47 | disruptek | shashlick: this is exactly my point. |
03:18:08 | shashlick | wrapped 6 header files - results in 13k lines of wrapped headers |
03:18:11 | disruptek | one person has the expertise to wrap the package and the mission to maintain it across multiple platforms. |
03:18:31 | leorize | martinium: sites_map.[item["id"].getInt.intToStr] = item["name"].getStr |
03:18:31 | shashlick | it'll work on my machine sure |
03:18:37 | shashlick | but it won't on yours |
03:19:00 | disruptek | well, it doesn't work for me right now. or solitude, as the case was today when he tried to build nimph. |
03:19:02 | martinium | leorize fixed it the issue was the : |
03:19:03 | shashlick | since you may not have some random package installed or your distro might exclude certain things from the conf |
03:19:21 | shashlick | give me issues to work on |
03:20:56 | disruptek | there's no point, because the design relies upon nimble and prohibits local deps. |
03:21:16 | disruptek | when you run nimscript in ~/.cache/nim/nimterop you don't pick up any of my compiler env. |
03:21:17 | shashlick | is it because toast isn't built? |
03:21:31 | disruptek | or w/e the hell you're running in there... |
03:21:57 | shashlick | okay, give me the commands i should run to reproduce it and i'll fix it |
03:22:06 | disruptek | and my next step is to remove nimble from nimph. which breaks nimterop. |
03:22:41 | disruptek | put --clearNimblePath in your nim.cfg and then have fun building nimph. |
03:22:43 | shashlick | it is doable - i don't have anything in the nimble file to enable build or execution |
03:23:25 | FromDiscord | <Varriount> Merged |
03:23:25 | shashlick | step 1 - git clone nimph? |
03:23:33 | shashlick | step 2 - bootstrap |
03:23:36 | disruptek | it's 154... it needs to go into $NIMBLE_DIR/lib |
03:23:46 | disruptek | not ~/.cache/ ... |
03:24:20 | disruptek | chmod 0 ~/.nimble first. |
03:25:05 | disruptek | if you aren't picking up my env when you build my software, you're doing it wrong. simple as that. and not specific to disruptek, of course. |
03:25:28 | disruptek | but honestly, this goes deeper than nimph or nimble or even nimterop. |
03:25:50 | disruptek | it doesn't make sense to have those least-qualified engineer the solution. |
03:26:42 | shashlick | so again, what are the steps |
03:26:52 | shashlick | i git clone nimph, bootstrap directly |
03:27:00 | disruptek | did you chmod 0 ~/.nimble? |
03:27:04 | shashlick | do i make a deps dir? |
03:27:07 | FromDiscord | <KingDarBoja> Hi fellas |
03:27:26 | disruptek | what's the deps dir? |
03:27:58 | shashlick | where should nimterop get installed? |
03:29:06 | disruptek | got me. |
03:29:28 | disruptek | the bootstrap still works. 🎉 |
03:31:02 | shashlick | 154 is on my backlog - i haven't figured out how to fix it though |
03:31:41 | disruptek | here's a repro: |
03:31:42 | shashlick | for nimbass, i'm now resorting to -l instead of dynlib - https://github.com/genotrance/nimbass/blob/nimterop/nimbass/bass.nim#L59 |
03:31:53 | disruptek | 1) clone nimph as per usual. |
03:31:59 | disruptek | 2) bootstrap nimph as per usual. |
03:32:01 | shashlick | cause hard linking to ~/.cache isn't portable |
03:32:13 | disruptek | 3) create a nim.cfg with these two lines: |
03:32:19 | disruptek | 3a) --clearNimblePath |
03:32:31 | disruptek | 3b) --nimblePath="$config/deps/pkgs/" |
03:32:42 | disruptek | 4) rm -rf ~/.cache/nim/nimterop |
03:32:52 | disruptek | 5) nim c src/nimph.nim |
03:32:57 | disruptek | that's it. |
03:33:14 | disruptek | /home/adavidoff/.cache/nim/nimterop/cPlugins/nimterop_418565994.nim(1, 24) Error: cannot open file: nimterop/plugin [AssertionError] [AssertionError] |
03:33:32 | disruptek | home/adavidoff/nims/1.0/lib/system/fatal.nim(39, 5) Error: unhandled exception: /home/adavidoff/git/n/nimph/deps/pkgs/nimterop-0.4.4/nimterop/cimport.nim(166, 12) `ret == 0` |
03:33:33 | Prestige | any good resources on macros? Aside from the docs |
03:33:52 | disruptek | you can try macroutils. |
03:33:55 | disruptek | !repo macroutils |
03:33:56 | disbot | https://github.com/PMunch/macroutils -- 9macroutils: 11A package that makes creating macros easier 15 8⭐ 1🍴 |
03:33:59 | disruptek | it's new. |
03:34:06 | disruptek | !repo breeze |
03:34:07 | disbot | https://github.com/alehander92/breeze -- 9breeze: 11a macro dsl for nim 15 37⭐ 2🍴 |
03:34:19 | disruptek | some folks use breeze, also. |
03:34:23 | Prestige | Cool, thanks. Trying to learm more about them |
03:34:36 | skrylar[m] | neat |
03:35:14 | skrylar[m] | was doing macros in janet and its kind of nice being able to just switch/case off list symbols so things that make nim macros easier are neat |
03:35:22 | disruptek | shashlick: i forgot; chmod 0 ~/.nimble in there, too, of course. |
03:37:55 | disruptek | for 154 we'd probably need to -rpath the $NIMBLE_DIR/lib because otherwise we cannot probably isolate the libs; hence $XDG stuff won't work, right? |
03:38:12 | disruptek | s/probably/properly/ |
03:41:43 | shashlick | what exactly is the goal? |
03:41:50 | Prestige | this seems useful: https://www.youtube.com/watch?v=8SoJR3sCaR4 |
03:42:10 | shashlick | i'll try out your steps |
03:42:11 | disruptek | to not have nimph stop working because i broke gittyup while developing new features for golden. |
03:43:54 | FromDiscord | <Elegant Beef> Well prestige i now have loading keybinds from a json 😄 |
03:44:04 | Prestige | Nice |
03:44:10 | Prestige | That was fast |
03:44:50 | FromDiscord | <Elegant Beef> I mean i already had the base system in just needed to feed it data |
03:45:02 | FromDiscord | <Varriount> Victor Kirilov... I wonder if he's on this channel |
03:45:26 | leorize | onqtam? |
03:46:09 | FromDiscord | <Elegant Beef> The old setup i did this manually `newKeyConfig(113,Mod4Mask or ShiftMask,nil)`, so it was quick to plug in a jsonnode in place of the data |
03:46:51 | Prestige | This is actually a great video |
03:46:54 | leorize[m] | Varriount: he does appear when someone mentions, but not a lurker afaict |
03:49:01 | disruptek | so he's like batman? |
03:49:34 | * | rockcavera quit (Remote host closed the connection) |
03:50:37 | FromDiscord | <Elegant Beef> Well i mean batman has a symbol, so we need a viktor symbol |
03:51:23 | disruptek | is there a symbol that denotes random code that no one uses strewn across the entire compiler? |
03:51:29 | FromDiscord | <Elegant Beef> Also by the title i assume it's a video promoting the use of C++ transpiling? |
03:53:42 | skrylar[m] | disruptek: gensym? |
03:55:20 | disruptek | ☢ |
04:00:05 | martinium | so for multiple web requests async should make it faster? |
04:04:59 | * | nsf joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:44 | * | supakeen joined #nim |
04:08:21 | leorize[m] | @kaushalmodi: you here? |
04:08:22 | Prestige | martinium: making async requests is faster |
04:08:36 | FromGitter | <kaushalmodi> leorize: yes |
04:08:43 | Prestige | They'll happen more or less at the same time, need to wait for one to return before you send another request |
04:08:54 | martinium | jsut got a too many open files error doing it synchronously |
04:09:05 | leorize[m] | kaushalmodi: try this `echo | ./script/that/nim/generates` |
04:09:25 | * | bunbunbunbunny quit (Quit: leaving) |
04:09:26 | martinium | `Error: unhandled exception: Too many open filesAdditional info: "nodename nor servname provided, or not known" [OSError]` |
04:10:43 | leorize | kaushalmodi: if the same error surfaces, then it might just be that gcc can't deal with not having it's stdin being a tty for whatever reason |
04:11:03 | FromGitter | <kaushalmodi> leorize: nothing.. no output |
04:11:21 | FromGitter | <kaushalmodi> but the `stdinfile` got generated fine (with the `set -e` added to the script) |
04:11:47 | leorize | at this point I guess it's up to gcc devs to point out the problem :P |
04:12:16 | leorize | maybe you'll find a patch that you can just backport to your gcc 6.1 |
04:12:41 | FromGitter | <kaushalmodi> I wanted to show folks at work that they can quickly try out nim this way, but now I'll just wait for a fix |
04:13:21 | leorize | does it apply to any nim file or just stdin? |
04:13:27 | leorize | also you can just point to `inim` :P |
04:13:39 | leorize | though I don't think that one is still being developed |
04:13:51 | FromGitter | <kaushalmodi> leorize: another observation .. |
04:13:56 | FromGitter | <kaushalmodi> `echo echo NimVersion | nim c - ` works fine |
04:14:05 | FromGitter | <kaushalmodi> but `echo echo NimVersion | nim c -r -` gives that collect2 err |
04:15:06 | FromGitter | <kaushalmodi> > does it apply to any nim file or just stdin? ⏎ ⏎ I mean `nim c -r foo.nim` works just fine |
04:15:20 | FromGitter | <kaushalmodi> It's just that I wanted this cool feature to Just Work |
04:20:02 | leorize | I have no idea now, the `-r` literally change nothing but to tell nim to run the executable after it's generated (at least that's what I'm seeing in the compiler source) |
04:20:32 | martinium | how do I make a proc async |
04:20:38 | martinium | used to be adding {.async.} |
04:20:44 | martinium | that still the way? |
04:20:44 | leorize | import asyncdispatch |
04:20:48 | leorize | yea |
04:20:55 | leorize | just remember to import asyncdispatch first |
04:22:08 | martinium | linter still giving me crap about {.async.} |
04:22:25 | * | endragor joined #nim |
04:22:37 | leorize | what's the function prototype? |
04:23:10 | FromGitter | <kaushalmodi> > I have no idea now, the -r literally change nothing ⏎ ⏎ I feel like crying.. you are correct.. I had set gcc back to 9.1.0 :facepalm: |
04:23:26 | FromGitter | <kaushalmodi> so `echo echo NimVersion | nim c -` still gives the same error |
04:23:43 | leorize | try the `echo | script` thing again? |
04:24:00 | * | Lord_Nightmare quit (Ping timeout: 256 seconds) |
04:25:17 | martinium | looks like now since it's an async http client it returns a future |
04:25:30 | FromGitter | <kaushalmodi> nope, no error with that (rm'd the .cache and double checked the gcc version to be 6.1.0 this time) |
04:26:28 | leorize | out of ideas then :P |
04:27:26 | FromGitter | <kaushalmodi> thanks though for sticking with me through this debug |
04:27:41 | FromGitter | <kaushalmodi> I really hope that the fix is awesome |
04:28:25 | * | Lord_Nightmare joined #nim |
04:35:12 | martinium | I haven't ever really done Async code |
04:35:23 | martinium | guess I'll have to learn... :D |
04:35:38 | FromDiscord | <pragma> anyone interested in writing emulator server in Nim is made in Java but I think it would be fun to pass it to Nim |
04:36:13 | FromDiscord | <pragma> Emulator Server works with a 2D game under Flash player |
04:36:35 | FromDiscord | <pragma> who are encouraged |
04:59:08 | * | ljoonal quit (Quit: ljoonal.xyz) |
04:59:57 | * | ljoonal joined #nim |
05:06:09 | Prestige | Hm can someone explain this statement about parameters used in a template? |
05:06:13 | Prestige | https://youtu.be/8SoJR3sCaR4?t=880 |
05:06:40 | Prestige | since `filename` is a string, I didn't think it could get "evaluated" twice by referencing it twice |
05:10:09 | leorize | template parameters are AST nodes |
05:10:25 | leorize | for example templateCall(thisExpensiveOperation()) |
05:10:52 | leorize | and it will paste "thisExpensiveOperation()" to all the place that the param was referenced |
05:11:13 | Prestige | Very interesting, thanks for the explanation. I'm not familiar with AST yet |
05:16:52 | * | martinium quit (Remote host closed the connection) |
05:27:41 | * | lritter joined #nim |
05:30:07 | Prestige | damn macros are cool |
05:32:18 | FromDiscord | <Elegant Beef> The entire meta programming is fancy cool features 😄 |
05:32:40 | Prestige | I'm just starting to learn about it, pretty sick. |
05:32:55 | Prestige | going to take a bit to get used to |
05:33:29 | FromDiscord | <Elegant Beef> Yea it basically means "Hey i want this", and the answer is almost certainly "Well go get it", atleast from my understanding |
05:34:15 | Prestige | Been watching here about it https://youtu.be/8SoJR3sCaR4?t=1151 pretty informative |
05:38:20 | * | endragor quit (Quit: Leaving...) |
05:46:04 | * | narimiran joined #nim |
06:04:41 | * | PMunch joined #nim |
06:08:13 | * | opal quit (Remote host closed the connection) |
06:09:26 | * | opal joined #nim |
06:28:52 | * | solitudesf joined #nim |
06:31:33 | * | ryan_ joined #nim |
06:32:20 | * | ryan_ is now known as number_one |
06:34:10 | * | Tlongir quit (Ping timeout: 256 seconds) |
06:54:54 | * | xcm quit (Read error: Connection reset by peer) |
06:54:59 | * | chemist69 quit (Ping timeout: 272 seconds) |
06:55:23 | * | chemist69 joined #nim |
06:57:04 | * | xcm joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:05:00 | * | gmpreussner joined #nim |
07:08:34 | * | hax-scramper quit (Ping timeout: 240 seconds) |
07:08:37 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
07:09:12 | * | ehmry joined #nim |
07:10:01 | * | hax-scramper joined #nim |
07:13:33 | * | hax-scramper quit (Read error: Connection reset by peer) |
07:13:46 | * | hax-scramper joined #nim |
07:13:47 | * | kungtotte quit (Read error: Connection reset by peer) |
07:15:45 | FromDiscord | <Rika> where is nimsuggest documented? |
07:15:46 | * | kungtotte joined #nim |
07:16:03 | FromDiscord | <Rika> oh found it |
07:18:13 | * | hax-scramper quit (Ping timeout: 264 seconds) |
07:19:43 | * | hax-scramper joined #nim |
07:23:11 | * | hax-scramper quit (Read error: Connection reset by peer) |
07:23:25 | * | hax-scramper joined #nim |
07:29:33 | FromGitter | <alehander92> PMunch is macroutils going to fusion |
07:29:42 | PMunch | fusion? |
07:29:58 | PMunch | Oh that's the Nim distribution thing? |
07:30:00 | PMunch | Cool :) |
07:33:00 | PMunch | Oh, you were asking if macroutils where going to fusion :P |
07:33:09 | PMunch | I dunno |
07:33:14 | FromGitter | <alehander92> well it was Araq's idea |
07:33:16 | FromGitter | <alehander92> to make fusion |
07:33:21 | FromGitter | <alehander92> but no idea if its happening |
07:34:24 | * | Vladar joined #nim |
07:41:02 | * | letto quit (Quit: Konversation terminated!) |
07:43:19 | * | letto joined #nim |
07:44:26 | Amun_Ra | what's the most efficient way of (python code): buf = buf[pos:] (buf is a seq)? I went for C approach by now and I just copy data in for loop then set length at the end |
07:45:13 | Faulander | good morning |
07:45:17 | Araq | depends |
07:45:40 | * | liblq-dev joined #nim |
07:45:41 | Faulander | if i run "nim jsondoc -o:doc.json filename.nim" i get: Error: unhandled exception: index out of bounds, the container is empty [IndexError] |
07:45:57 | Araq | hmm cooldome already fixed what I was about to work on... |
07:47:07 | Araq | Faulander, which Nim version? |
07:47:41 | Araq | ah no, the bug still exists :-) |
07:48:14 | * | hax-scramper quit (Ping timeout: 240 seconds) |
07:48:28 | Faulander | Andreas, 1.2.0 |
07:48:43 | Araq | Faulander, tell PMunch |
07:49:22 | Faulander | OT: Andreas, bist Du eigentlich Österreicher? In der Weststeiermark wo ich herkomme, gibt's viele Rumpfs :) |
07:49:24 | * | hax-scramper joined #nim |
07:49:27 | PMunch | Amun_Ra, buf = buf[pos..^1] |
07:49:39 | Araq | Nö, bin Deutscher |
07:49:58 | PMunch | Maybe those Rumpfs are german? |
07:49:59 | Amun_Ra | PMunch: argh, I completely forgot I can use it there, thank you |
07:50:03 | FromGitter | <alehander92> ich habe diese Worten versteen! |
07:50:07 | PMunch | Amun_Ra, no problem :) |
07:50:12 | Faulander | @PMunch: <Faulander> if i run "nim jsondoc -o:doc.json filename.nim" i get: Error: unhandled exception: index out of bounds, the container is empty [IndexError] |
07:50:26 | PMunch | Hmm |
07:50:31 | PMunch | On any file? |
07:50:47 | Faulander | at least on the one i tried, let me try another one ... |
07:51:15 | PMunch | Just tried it on a random file and it worked fine |
07:52:39 | Faulander | on another i get: Error: new section expected |
07:52:39 | Faulander | lineinfos.nim(249) raiseRecoverableError |
07:52:39 | Faulander | Error: unhandled exception: new section expected [ERecoverableError] |
07:53:19 | FromGitter | <jorjun_twitter> Loving this language (experienced in python but not types & compilation), any recommended reading on how to work with 3rd party stuff, either c++ framework or javascript ..? Do I need to know more about chips and linking? My comp sci was many many moons ago.. ultimately I want to target raspberry pi |
07:54:06 | FromGitter | <jorjun_twitter> I’ve waited 30 years for a non-nerdy language like this that exposes the power of CPU |
07:54:38 | Faulander | jorjun: do you know the nim for python developers series? this was great for me (same background as you) |
07:54:44 | FromGitter | <sheerluck> I love this language too |
07:55:44 | FromGitter | <jorjun_twitter> Yes @faulander , but I am getting the syntax pretty well from completing exercism challenges. I am curious to see if I can use nim to leverage libraries. Easily |
07:56:10 | FromGitter | <jorjun_twitter> Clueless about clang and linking and build stuffs. |
07:56:32 | FromGitter | <alehander92> guys |
07:56:36 | FromGitter | <alehander92> how can i change assembler |
07:56:46 | FromGitter | <alehander92> for gcc (like the binary path for as) |
07:56:51 | Araq | do yourself a favor and remain as clueless as possible :-) this stuff is all awful |
07:56:56 | Faulander | well, i am there too ... no clue about that either. but reading nim.cfg helps in understand which options the nim compiler has. |
07:57:03 | FromGitter | <jorjun_twitter> :D |
07:58:11 | PMunch | @jorjun_twitter here's a little primer on types: https://peterme.net/nim-types-originally-a-reddit-reply.html |
07:58:33 | PMunch | Like how Nim handles types on the stack/heap and such |
07:58:45 | PMunch | Might be helpful to get into the more low-level stuff in C |
07:59:04 | FromGitter | <jorjun_twitter> Spent an hour last night trying to build nimgame2 lib and then run the demo’s. Then I tried “nimble develop” and it all worked |
07:59:37 | FromGitter | <jorjun_twitter> Last time I tried low level was 6502 in 1985. So I will dive in. <Merci |
08:00:06 | Faulander | i am trying to create mardown docs for my library since yesterday evening ... stuff which took me 5 mins in python, takes hours now. but that's part of the learning process. the guys here are SUPER helpful. |
08:00:12 | FromDiscord | <Varriount> Any idea what `nimble develop` did that fixed it? |
08:01:48 | narimiran | Faulander: and if it is just to have readme.md on github — github can render .rst too :D |
08:01:49 | PMunch | Faulander, wait, what are you trying to do? |
08:03:06 | FromGitter | <jorjun_twitter> @Varriount Honestly, no. I think it built things and linked them, probably in my home nim folder. I was able to run each demo afterwards. My first attempt at running demos after ‘nimble install’ failed with plenty of errors in the framework. Prolly didn’t have latest. |
08:03:43 | Araq | 'nimble install' usually skips the boring parts like examples or tests |
08:03:50 | Araq | or documentation |
08:04:27 | Araq | it saved less than 1MB on your disk but did cost you hours of your time, a tradeoff you should appreciate |
08:05:07 | Araq | after all, you can now have one more cat picture on your disk isn't that nice ;-) |
08:06:02 | * | oculux quit (K-Lined) |
08:08:20 | FromGitter | <jorjun_twitter> modern nerds are way better than the old skool. Complexity shouldn’t relished for its own sake. I’ve met people like that…. the barriers that go up around unneccessary complexity remind me of the pumped up security types. Or the sys admin’s. Real programmers…got work to do. |
08:08:53 | * | alexander92 joined #nim |
08:09:15 | livcd | Araq is snarky today :-) |
08:09:36 | FromGitter | <jorjun_twitter> I couldn’t accept C++, Java or any of those languages rife with artefacts. Not because I am sissy. But coz I spent ten years on mainframes. |
08:09:59 | FromGitter | <jorjun_twitter> and these languages are all following Kernighan & Ritchie like baaaaah |
08:12:24 | FromGitter | <jorjun_twitter> Anyway bon chance. Will try document my learning steps this time, as it might be valuable. I have ten years in python, and I nim is going to be my next competence. |
08:12:36 | Zevv | Araq is right |
08:12:51 | Zevv | I hate it so much that nimble leaves out all that stuff. Why not just include the docs? |
08:14:38 | FromDiscord | <Varriount> Personally, I would rather just use nimscript |
08:14:51 | FromGitter | <jorjun_twitter> https://www.youtube.com/watch?v=H4s55GgAg0I |
08:15:50 | FromDiscord | <Gary M> I'm doing a little bit of very basic profiling in VS code using the extension host profile to compare performance between the original Nim extension and my fork. |
08:16:30 | FromDiscord | <Gary M> The results at the moment are showin original Nim peaking at 620ms latency during use, and mine peaking at 95ms |
08:17:05 | FromDiscord | <Gary M> If I can prove the results under a more precise benchmark then it looks like a substantial improvement |
08:18:40 | Prestige | I didnt know nimble didnt include docs, that's weird.. |
08:18:41 | FromGitter | <jorjun_twitter> @ Varriount I do a fair bit of I/O and web, and don’t plan on moving away from python. Asyncio seems totally fine for io/bound. I now spend all my time wrestling with types instead of just going straight to an algorithm. But hoping that this can become second nature eventually… bloody hope so. |
08:19:51 | FromGitter | <alehander92> types help imho |
08:19:53 | FromGitter | <jorjun_twitter> Certainly was a thrill to get my 20K prime out, almost instantaneously. But there’s a trade all the time… I know |
08:20:12 | Araq | jorjun_twitter: I think there is no universal law but most people eventually like static typing |
08:20:16 | FromGitter | <alehander92> people add type annotations even to dynamic languages now |
08:21:00 | FromGitter | <jorjun_twitter> Noticed that trend… but really I didn’t have to think so much about them, for ten whole years. The performance brigade have been winning the argument. But there is a backlash against OO |
08:21:45 | FromDiscord | <Rika> @Gary M what's up with the speed improvement? the regex? |
08:21:49 | Araq | types are more about "please write out what's already in your head" than they are about performance |
08:21:49 | FromDiscord | <Gary M> there's been a backlash against inheritance heavy OO I think, but composition based OO is kinda still popular |
08:21:53 | FromGitter | <jorjun_twitter> I like working in high level, nim even better than Python at being ‘literate; I will give it that. But if you change your mind on an implementation, lot of munging about to do with types.. |
08:22:21 | FromGitter | <jorjun_twitter> hoping it won’t always feel like very hard work |
08:22:36 | FromDiscord | <Rika> there's typescript for a reason 😛 |
08:22:39 | FromDiscord | <Gary M> @Rika I don't quite know yet, but it's either that or the minifying of the extension down from >300 files to just 14 and one long JS for the actual plugin |
08:22:57 | FromGitter | <jorjun_twitter> @rika for sure. Have totally moved to typescript |
08:23:36 | FromDiscord | <Gary M> my bet is on the minification though |
08:24:10 | FromDiscord | <Gary M> it's pretty easy to migrate an extension to webpack if the code doesn't conflict with minifying |
08:24:16 | livcd | I use Nim as a betterGo. I dont use Nim's full potential (because I am dumb) but it's surprisingly working really well for what you would use Go for. |
08:24:33 | FromGitter | <alehander92> yes @jorjun_twitter i'd say types should be often not about performance at all (lets say they happen to also help with that) |
08:25:16 | FromDiscord | <Gary M> dynamic types are great if you love silent unintended behavior /s |
08:26:04 | Araq | livcd, now that's what I consider a compliment :-) |
08:26:52 | PMunch | Big benefit of types, all that "munging about" when changing your implementation actually means you look at your code and make sure it works with the new implementation. And the stricter you are with your types the more you can be certain that the compiler will catch bugs. |
08:27:44 | PMunch | Faulander, built the compiler in debug mode (from the v1.2.0 tag) and ran the example you provided. Here is the stacktrace: http://ix.io/2j3c |
08:27:59 | FromGitter | <jorjun_twitter> @alehander92 Yes, protoyping is also very valuable. I might end up doing that in python and solidifying in nim. Unless I just get fluent, and my 1.int just comes naturally. But it feels like the compiler is underneath, in a way that I am not used to. I would say on exercism so far, 90% on wrestling with weird errors due to type mismatch. 10% on the algorithm. But I will persist. |
08:28:11 | PMunch | If you want to have a look at it, I'm a bit busy right now |
08:28:13 | FromGitter | <alehander92> i think nim is very fast for prototyping |
08:28:47 | FromGitter | <alehander92> i'd even say writing down signatures is an ok form of prototyping as well |
08:28:50 | livcd | Yeah much faster than Go |
08:29:13 | FromGitter | <alehander92> but i agree it probably takes time to get used to it |
08:29:24 | FromGitter | <alehander92> the bigger difference with python might be metaprogramming |
08:31:10 | livcd | The only thing is when you get SIGSEGV: Illegal storage access. (Attempt to read from nil?). You run it through gdb and you still have no clue what's going on |
08:31:33 | FromDiscord | <Gary M> Oh that's fun |
08:32:08 | FromGitter | <jorjun_twitter> @alehander92 do you use metaprogramming regularly to reduce the weight of code? Gotta say am intrigued by that as well. I didn’t use it much in python, but Django (popular web framework) folks benefitted hugely from declarative database model stuff implemented via metaprogramming. Huge lot of ugly wiring behind that productivity deliverable. Great for giving tools to others.. |
08:32:36 | PMunch | I use it quite heavily |
08:33:17 | PMunch | And not only for creating libraries, a small template or macro in a project can be a great way to cut down on code |
08:33:34 | PMunch | https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html |
08:33:35 | FromDiscord | <Gary M> I really want to learn how to do that kind of stuff, especially macros |
08:33:45 | PMunch | Like I explain in this article |
08:35:01 | livcd | Macros only for libs! |
08:35:13 | PMunch | Macros for president! |
08:35:36 | FromGitter | <alehander92> @jorjun_twitter yes, i think many django/rails concepts |
08:35:52 | FromGitter | <alehander92> can be adapted to nim with macros |
08:36:16 | FromGitter | <alehander92> sometimes it might be a bit harder, but sometimes you can do stuff that's hard to do in python/ruby |
08:36:23 | FromGitter | <alehander92> because you have access to ast/types |
08:36:44 | FromGitter | <alehander92> e.g. you can typecheck that your ORM types match your db schema on compile time |
08:36:53 | FromGitter | <alehander92> just as an example, not saying its a good plan |
08:37:33 | FromGitter | <alehander92> overally you use different code patterns to achieve the same thing, but many things are possible |
08:38:31 | FromGitter | <jorjun_twitter> I started coded purely to write games. Got sidetracked by corporate s***. But am gradually rediscovering the enthusiasm side. I want nim for moving things about, especially in 3d I think. Would like to make an A/R something. Not sure what. Python is already pretty good with its openCV bindings. |
08:39:34 | FromGitter | <jorjun_twitter> Maybe valve will cough up their new source engine and we can all dive on that.. |
08:40:07 | FromGitter | <jorjun_twitter> Games have always stretched the bounds of computing, I’ve observed.. |
08:41:12 | FromGitter | <jorjun_twitter> @pmunch This meta programming article is fantastic. merci |
08:41:37 | FromDiscord | <Gary M> I don't think source 2 is going to be open source 2'd |
08:41:46 | PMunch | jorjun_twitter, de rien :) |
08:42:04 | FromDiscord | <Gary M> Or really released for the public in the same way unity or unreal are |
08:43:28 | FromGitter | <jorjun_twitter> @FromIRC There’ll be something but, yes, they aren’t going to bust a gut documenting. Probably more like a partner thing. But having recently completed Alyx, gotta say I am quite impressed. There’s a dead rat in one of the bins at the start. Hideously real physics engine.. :D |
08:43:52 | FromDiscord | <Rika> Macro only libraries in nim where |
08:44:28 | * | ftsf joined #nim |
08:44:44 | PMunch | Rika, huh? |
08:45:03 | FromDiscord | <Rika> Libraries that implement its api using only macros lol |
08:45:20 | FromDiscord | <Gary M> Source 2 has been around for years, not just for Alyx. It's the engine running DotA 2 |
08:45:56 | FromDiscord | <Gary M> Since 2015 |
08:46:28 | PMunch | Rika, some of mine come real close :P |
08:46:52 | FromDiscord | <Gary M> Macro only nim executable when |
08:47:21 | PMunch | That'd be interesting, an application for Nim that counts cloc, but is able to determine compile-time lines vs. runtime lines |
08:47:36 | PMunch | Or macro+template+static lines against everything ele |
08:48:00 | FromDiscord | <Rika> Sounds hard to do |
08:48:07 | FromDiscord | <Gary M> Nim executable with macros generating code entirely from config data when |
08:49:18 | FromGitter | <alehander92> hm, PMunch you want coverage |
08:49:20 | FromGitter | <alehander92> not cloc? |
08:49:42 | FromGitter | <alehander92> otherwise compile time lines generate runtime lines, so its a bit misleading :P |
08:49:55 | PMunch | Yeah that's a good point |
08:50:00 | PMunch | I guess both would be best |
08:50:29 | FromGitter | <alehander92> a debugger for compile time :P |
08:50:57 | PMunch | Something like: source lines: 100, macro lines: 76, generated lines: 1242, output lines: 1266 |
08:51:23 | PMunch | Or maybe compiled lines instead of output lines |
08:52:25 | FromGitter | <alehander92> it sounds not hard if you build it in the compiler :P |
08:56:05 | PMunch | I mean it could be a tool that imported from the compiler |
08:56:19 | PMunch | But yeah, it'd definitely need stuff from the compiler to calculate that |
08:59:50 | FromDiscord | <Varriount> Does a line count mean anything for generated code though? It's all an AST at that point |
09:06:03 | PMunch | Just for fun |
09:06:22 | PMunch | I mean a line count doesn't really mean much to begin with |
09:08:23 | FromGitter | <alehander92> for generated C code it does |
09:08:32 | FromGitter | <alehander92> but this is very relative of course |
09:08:53 | PMunch | What is opt[int]? |
09:18:54 | FromDiscord | <Rika> ??? how do i use nimsuggest in stdin mode? |
09:19:11 | FromDiscord | <Rika> im confused on what format the query location should be givent |
09:19:59 | FromDiscord | <Gary M> just for fun <https://i.imgur.com/5EyDre1.png> vs <https://i.imgur.com/JHqTfeg.png> |
09:20:32 | FromDiscord | <Rika> ah it only works if the CWD is the project folder |
09:21:12 | FromDiscord | <Gary M> also I noticed something weird that I can't explain with my fork of the extension which is that in the original extension nimsuggest runs and continues to run over multiple tabs in VS Code, however after minifying everything nimsuggest only runs when it needs to and closes right after... I don't know at all why that is |
09:21:39 | FromDiscord | <Gary M> but it seems to work "better" |
09:21:56 | FromDiscord | <Rika> why does nimsuggest require a project folder to work? |
09:22:21 | FromDiscord | <Rika> i've always wondered this actually |
09:22:29 | FromDiscord | <Gary M> I don't know enough about nimsuggest since I haven't implemented it myself. I can only observe what was already done |
09:23:40 | FromDiscord | <Gary M> it's still properly executing a check on the project and not just a dirty file so that's good |
09:26:28 | FromDiscord | <Gary M> with the original nim plugin, my processes look like this: https://i.imgur.com/nmXfI4K.png |
09:26:45 | FromDiscord | <Gary M> and those nimsuggest processes aren't closing down at all |
09:27:40 | FromDiscord | <Gary M> but with the modified plugin, it looks like this while idle: https://i.imgur.com/MFk2CXd.png |
09:28:11 | FromDiscord | <Gary M> so I think it should in theory scale up way better with more open files in a project |
09:34:26 | * | couven92 joined #nim |
09:34:44 | Araq | Rika: because nimsuggest cannot guess the project structure, it's true for every IDE I've ever used |
09:40:47 | PMunch | Anyone able to help me with some C wrapping? crypt.nim (the library): http://ix.io/2j3B, test.nim (trying to use it, with C code I try to implement): http://ix.io/2j3D, the error: http://ix.io/2gc0 |
09:41:39 | FromDiscord | <Rika> Araq: but arent imports either nimble imports, standard lib imports, or imports relative to the current file? |
09:50:18 | Araq | Rika: ignoring the 'include' file issue, you would then create a project per module you open in your editor, not good enough |
09:52:58 | FromDiscord | <Rika> what do you mean "create a project"? why must everything have a project |
09:53:18 | FromDiscord | <Rika> i have single .nim files i use, small scripts that i compile and run once in a few months |
09:54:02 | FromGitter | <bung87> nimsuggest need a project entry file |
09:54:22 | FromGitter | <bung87> the vscode set the every nim file you open as a entry file |
09:55:18 | FromGitter | <bung87> so every entry file as a project. that's the logic |
09:55:45 | Araq | that logic is broken and must be replaced |
09:56:10 | FromGitter | <bung87> in fact , the vscode extension that behavior can be change. |
09:57:56 | FromDiscord | <Rika> what logic? the "every file is its entry file"? |
09:58:37 | FromGitter | <bung87> I'v tried modify the vscode extension ,but now I can't recall. |
09:59:35 | FromGitter | <bung87> yeah, so that you have multiple nimsuggest proccess at the background. |
09:59:56 | Araq | Rika, yes, that logic |
10:02:45 | FromDiscord | <Rika> araq: what logic would you recommend to replace this one? how do you determine what file is the entry file? |
10:04:29 | * | Intensity quit (Ping timeout: 250 seconds) |
10:05:03 | FromGitter | <bung87> `packaname` `src/packagename.nim` that's the default structure when using `nimble init` |
10:05:30 | FromDiscord | <mratsim> if only we could fix nimble eating the "src" directory it's really annoyinh |
10:07:41 | Araq | Rika: just use nimsuggest's directory feature |
10:07:49 | Araq | and let it figure it out itself |
10:07:58 | FromDiscord | <Rika> so i pass it a dir rather than a file? |
10:08:06 | Araq | yeah, on *startup* |
10:08:14 | FromDiscord | <Rika> the one on the command no? |
10:08:20 | FromDiscord | <Rika> yeah okay hmm |
10:08:55 | FromGitter | <bung87> you can modify the vscode extension , that's not hard task |
10:09:16 | FromDiscord | <Gary M> I'm currently working on that myself, I just don't know exactly how I should modify it. |
10:09:36 | FromDiscord | <Gary M> I don't think it should depend on a nimble init scaffold |
10:09:52 | narimiran | leorize: maybe you can help vscode guys above? |
10:09:59 | FromDiscord | <Rika> Gary, i sent you some PMs |
10:11:17 | FromDiscord | <Gary M> bung87: I forked the vscode extension and it's currently available as Nim Alt, if you want to take a look. |
10:12:19 | FromGitter | <bung87> I have a modified version https://github.com/bung87/vscode-nim-extension |
10:13:20 | FromDiscord | <Rika> what did you modify |
10:13:58 | FromGitter | <bung87> and another extension that using nim lsp server , that just slow at first index period, anything else works fine. |
10:14:53 | FromGitter | <bung87> remain single nimsuggest per project, add a status bar can change nim version,when you have multiple nim version |
10:15:12 | * | ZoomZoomZoom joined #nim |
10:15:19 | FromDiscord | <Gary M> nimsuggest works as intended with only a single per project? |
10:15:24 | FromDiscord | <Gary M> in your fork |
10:15:34 | FromGitter | <bung87> now I cant confirm they both work, it's months ago |
10:17:30 | FromGitter | <bung87> yeah, someday I noticed my 8gb memory left less.I made this change |
10:24:07 | Araq | damn, hunting a ghost... |
10:24:15 | FromGitter | <bung87> oh , it's https://github.com/bung87/vscode-nim not that url |
10:24:25 | Araq | you write some assert, you debug the compiler |
10:24:35 | Araq | only to find out the assert was wrong :-( |
10:27:13 | FromGitter | <bung87> https://github.com/bung87/vscode-nim/blob/master/src/nimSuggestExec.ts#L227 start here find the project root file |
10:28:40 | Araq | you don't have to find the project root fine, Nimsuggest does that for you |
10:28:52 | Araq | you pass a directory to nimsuggest, it figures it out |
10:31:20 | * | Ekho quit (Quit: An alternate universe was just created where I didn't leave. But here, I left you. I'm sorry.) |
10:31:52 | FromDiscord | <Gary M> ```let desc = await getNimSuggestProcess(vscode.workspace.rootPath,filename);``` |
10:31:53 | FromDiscord | <Gary M> Araq: so this is not how you would do it right? What directory should you pass to nimsuggest? |
10:32:21 | Araq | the directory of the .nim file that is open |
10:32:47 | FromDiscord | <Rika> Even if it's a few folders within the project root? |
10:33:37 | Araq | yes |
10:33:53 | Araq | nimsuggest auto-detects the main project file |
10:34:02 | * | Vladar quit (Quit: Leaving) |
10:34:15 | Araq | since every editor gets it wrong nimsuggest standardizes it |
10:34:31 | FromGitter | <bung87> ok , so that can be very easy now. |
10:38:00 | * | ryan_ joined #nim |
10:39:57 | * | zacharycarter quit (Ping timeout: 265 seconds) |
10:40:50 | * | ftsf quit (Ping timeout: 256 seconds) |
10:40:50 | * | number_one quit (Ping timeout: 256 seconds) |
10:51:56 | FromDiscord | <InventorMatt> how do you do a for loop in the middle of a macro tree? |
10:52:49 | Araq | ^ awesome question. there is no good way currently, you need to split up the tree construction to regain mutability |
10:53:31 | Araq | but I'll keep it in mind for upcoing newTree/quoteAst/etc proposals |
10:56:37 | FromDiscord | <InventorMatt> okay, thanks. I'll do a bit more research into macros and then probably come back for help on getting it right. |
10:57:26 | * | Ekho joined #nim |
11:10:54 | * | CcxWrk quit (Quit: ZNC 1.7.4 - https://znc.in) |
11:11:12 | * | CcxWrk joined #nim |
11:22:23 | * | nickster quit (Quit: Ping timeout (120 seconds)) |
11:23:41 | * | dddddd joined #nim |
11:25:33 | * | nickster joined #nim |
11:29:06 | PMunch | Okay, made an actually fully working C sample of what I need to be able to do shashlick: http://ix.io/2j4d |
11:39:11 | FromGitter | <alehander92> Araq |
11:39:29 | FromGitter | <alehander92> how important is it that the await error should be as clear as possible |
11:40:04 | FromGitter | <alehander92> i wonder if i should just leave the default type mismatch one |
11:40:16 | FromGitter | <alehander92> as this would be very natural |
11:40:43 | FromGitter | <alehander92> (tho if i dont leave a global overload fallback, people might overload it erroneously) |
11:42:58 | * | tane joined #nim |
11:43:25 | Araq | global overload fallback sounds ok |
11:44:18 | PMunch | Uhm... Error: unhandled exception: value out of range: 22 notin -2147483648 .. 2147483647 [RangeError] |
11:44:23 | PMunch | I beg to differ.. |
11:45:42 | * | yassen[m] joined #nim |
11:48:09 | PMunch | What on earth is going on here? https://play.nim-lang.org/#ix=2j4h |
11:50:10 | * | abm joined #nim |
11:55:19 | liblq-dev | PMunch: well it works if you split it into a few different variables |
11:55:26 | liblq-dev | https://play.nim-lang.org/#ix=2j4k |
11:55:41 | liblq-dev | but it's obviously a bug that your example doesn't work |
11:57:37 | * | nickster quit (Quit: The Lounge - https://thelounge.chat) |
11:58:55 | PMunch | Yeah, just splitting the len and cint works: https://play.nim-lang.org/#ix=2j4m |
11:59:26 | PMunch | But it's the strangest thing I've seen in a while. I mean even the error message is just plain wrong |
11:59:36 | * | nickster joined #nim |
12:01:26 | * | oculux joined #nim |
12:04:56 | shashlick | @PMunch - I have the openssl wrapper ready, will send in 30 minutes |
12:05:05 | shashlick | Will you still be on? |
12:05:06 | PMunch | Oh.. |
12:05:07 | yassen[m] | Hi there, trying to join the forum at https://forum.nim-lang.org/ since this morning, to no avail. Somehow missed the confirmation email -- when clicked couple hours later, it said it has expired, then attempts to get other links and click on them didn't work -- I got "Invalid ident hash". Also logging stopped working. Attempt to create another account with the same email address also failed. Can anyone help me? (My user name: |
12:05:07 | yassen[m] | yassen, email address [email protected].) |
12:05:08 | PMunch | Yeah |
12:05:19 | shashlick | Ok will ping |
12:05:24 | PMunch | Sweet :) |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:07 | narimiran | yassen[m]: ping dom96 |
12:06:43 | yassen[m] | thanks, will do! |
12:06:44 | * | supakeen joined #nim |
12:09:33 | * | sunwukong joined #nim |
12:16:22 | * | arecaceae quit (Remote host closed the connection) |
12:17:05 | * | arecaceae joined #nim |
12:20:37 | * | couven92 quit (Ping timeout: 264 seconds) |
12:20:50 | FromDiscord | <InventorMatt> how does one create a wrapper for a python library. I was thinking of using nimpy and importing the library from there but it seems as though it'll treat it like a generic objects as generic python object and it won't bring in the dunder methods from the object. |
12:24:07 | * | couven92 joined #nim |
12:30:16 | FromDiscord | <Rika> What |
12:31:43 | FromDiscord | <clyybber> PMunch: Looks awfully similar to this: https://github.com/nim-lang/Nim/issues/13698 |
12:31:45 | disbot | ➥ Exception when converting csize to clong ; snippet at 12https://play.nim-lang.org/#ix=2eKB |
12:32:34 | FromDiscord | <clyybber> for which the fix looks suspicious |
12:33:22 | PMunch | Hmm, compiling with 1.0.6 indeed fixes the issue |
12:33:30 | FromDiscord | <clyybber> Araq: Whats the cause for this bug/bugs and why does the fix have to special case csize ? |
12:33:30 | PMunch | Very likely the same |
12:34:27 | PMunch | Yikes, that fix does indeed look sketchy |
12:35:09 | FromDiscord | <mratsim> I think Araq tried to change csize to actually match csize_t and in the end it caused to much bug so csize_t was introduced |
12:35:21 | FromDiscord | <mratsim> new code should use csize_t, and csize has been deprecated |
12:37:31 | FromGitter | <alehander92> so `dirty` is like |
12:37:44 | FromGitter | <alehander92> adding mixin to used idents? |
12:37:53 | FromDiscord | <clyybber> @mratsim I tried to make csize a uint and it worked |
12:38:10 | FromGitter | <alehander92> my new approach for async templates defines await as an inline template |
12:38:21 | FromDiscord | <mratsim> dirty uses idents instead of nnkSym I think |
12:38:22 | FromDiscord | <clyybber> @mratsim But my PR was reverted and csize_t was introduced instead |
12:38:30 | FromGitter | <alehander92> but i didnt realize now this requires one to use `mixin await` or `{.dirty.}` for template using await |
12:38:34 | FromDiscord | <clyybber> Because its a breaking change |
12:38:40 | FromGitter | <alehander92> this *can* be hinted in the error message .. |
12:44:56 | Araq | hmm isn't ACM free for all articles nowadays? |
12:46:49 | FromDiscord | <clyybber> I thought so as well |
12:47:41 | * | fredrik92 joined #nim |
12:49:54 | * | couven92 quit (Ping timeout: 240 seconds) |
12:50:03 | * | fredrik92 is now known as couven92 |
12:51:07 | * | fredrik92 joined #nim |
12:52:58 | * | Vladar joined #nim |
12:54:00 | FromDiscord | <mratsim> I think macro/proc/method overload resolution has an edge case when methods have the same name as a macro/proc: https://github.com/bluenote10/NimData/issues/56 |
12:54:01 | disbot | ➥ Compile error with nim 1.2.0 |
12:54:31 | * | freddy92 joined #nim |
12:54:42 | * | couven92 quit (Disconnected by services) |
12:54:50 | * | freddy92 is now known as couven92 |
12:55:14 | * | nsf quit (Quit: WeeChat 2.8) |
12:55:56 | * | fredrik92 quit (Ping timeout: 246 seconds) |
12:56:04 | shashlick | @PMunch - i'm back on |
12:56:24 | * | rockcavera joined #nim |
12:56:38 | PMunch | Oh you were gone :P I though you were working on something |
12:58:14 | shashlick | so openssl does not have a clean import order of headers or a top level header that imports in the right order |
12:58:37 | shashlick | so i had to maek some changes to toast to enable imports of multiple headers without duplication of symbols |
12:59:06 | shashlick | i'm importing these five headers - **pem.h ssl.h rsa.h evp.h bio.h err.h** |
12:59:18 | shashlick | based on this example - http://hayageek.com/rsa-encryption-decryption-openssl-c/ |
12:59:32 | shashlick | make that 6 |
13:00:10 | PMunch | I found out I could get away with rsa.h, pem.h, and err.h |
13:00:25 | PMunch | http://ix.io/2j4H |
13:00:47 | shashlick | cool |
13:00:51 | PMunch | And usage: http://ix.io/2j4J |
13:01:28 | PMunch | Ah, probably because I don't need to generate a key |
13:04:46 | shashlick | just those 3 files results in a 10k wrapper |
13:06:17 | PMunch | Bytes or lines? |
13:06:34 | PMunch | Not that it really matter with deadCodeElim |
13:06:36 | shashlick | lines |
13:09:09 | shashlick | http://ix.io/2j4M/nim is what the wrapper looks like |
13:09:15 | shashlick | the toast command line is at the top |
13:10:04 | shashlick | i'm using a plugin which looks like this - http://ix.io/2j4O/nim |
13:13:03 | PMunch | I'd need that wrapped up in Nimble if I were to use it.. |
13:13:27 | shashlick | sure but want to make sure it works for you first |
13:13:42 | shashlick | recommend generating the wrapper rather than using what i pasted tho |
13:13:49 | shashlick | cause it is system specific |
13:13:59 | PMunch | System specific? |
13:14:01 | * | zacharycarter joined #nim |
13:14:15 | shashlick | so if you can pull the multifile branch of nimterop |
13:15:36 | shashlick | see the why nimterop section of the readme, specifically the preprocessing portion |
13:20:36 | * | martinium joined #nim |
13:21:13 | FromGitter | <brentp> with nim#head, I get further compiling with --cc:zig and it works for hello world, but I get SIGILL on other pure nim code, such as: https://github.com/brentp/nim-lapper (src/lapper). and it doesn't seem to know about -d:openmp. |
13:22:39 | martinium | Good morning all |
13:22:51 | martinium | Afternoon for you guys across the pond |
13:22:54 | martinium | :D |
13:23:18 | FromGitter | <alehander92> hi, america ! |
13:24:21 | FromDiscord | <Recruit_main707> how is something like this done? |
13:24:22 | FromDiscord | <Recruit_main707> https://play.nim-lang.org/#ix=2j4W |
13:24:38 | Araq | brentp: we really don't support zig. supporting all these different C compilers and OSes and CPU archs is already painful enough |
13:25:09 | PMunch | Recruit_main707, like this? https://play.nim-lang.org/#ix=2j4X |
13:25:40 | FromGitter | <brentp> heh. ok @Araq . was just thinking it might be an easier way to get static binaries for my projects. |
13:25:46 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2j4Y |
13:25:49 | FromDiscord | <Rika> oops, late |
13:25:54 | FromDiscord | <Recruit_main707> thanks both |
13:26:14 | FromDiscord | <Rika> @Recruit_main707 look at mine too though 😛 |
13:26:16 | PMunch | By the way, you only need to set the first one to 1 and the rest will increment automatically |
13:26:41 | FromDiscord | <Recruit_main707> i have looked it obv |
13:26:53 | FromDiscord | <Rika> oh ok |
13:27:07 | FromDiscord | <Recruit_main707> PMunch, that would have been something valuable to know :P |
13:27:19 | PMunch | And now you do :) |
13:27:30 | FromDiscord | <Rika> also commas arent needed for newline'd enum entries |
13:29:43 | * | filcuc joined #nim |
13:29:56 | * | fredrik92 joined #nim |
13:30:54 | filcuc | i'm trying to build/link SDL2 by directly bundling it by compiling its .c files. Is there a way to disable the automatic inclusion of the system module? |
13:31:05 | * | freddy92 joined #nim |
13:31:13 | filcuc | C:\Users\filcuc\nimcache\main_d\stdlib_system.nim.c.o:stdlib_system.nim.c:(.text+0x0): multiple definition of `NtCurrentTeb' C:\Users\filcuc\nimcache\main_d\SDL.c.o:SDL.c:(.text+0x0): first defined here |
13:31:24 | * | fredrik92 quit (Disconnected by services) |
13:32:53 | filcuc | btw i'm not so sure in what i'm doing :D |
13:33:27 | filcuc | the idea is to have a somewhat pure nimble package |
13:34:46 | shashlick | PMunch: so if you can test if the wrapper meets your needs, i'll be enhancing cImport to allow multiple files like the command line does |
13:34:53 | shashlick | and then we can update the official package |
13:37:01 | PMunch | Okay, so how do I test this |
13:37:08 | PMunch | Copy the wrapper and the plug-in? |
13:37:24 | PMunch | Oh no wait, not the wrapper |
13:39:06 | shashlick | install the multifile branch of nimterop |
13:39:15 | shashlick | and then run the command line in the wrapper i sent |
13:40:49 | shashlick | **`/home/nimterop/nimterop/toast -np --pluginSourcePath /home/wrappers/nimssl/nimssl/p.nim -f:ast2 -k -O OPENSSL_die -r -s pem.h rsa.h err.h`** |
13:40:57 | shashlick | along with the plugin i sent |
13:41:21 | shashlick | you can use -o or > to redirect to file |
13:44:50 | PMunch | Hmm, I just get no such file or directory |
13:44:55 | PMunch | But I'm not sure why.. |
13:45:33 | PMunch | http://ix.io/2j52 |
13:45:45 | shashlick | Araq: I import segfaults and I have --stackTrace:on and --lineTrace:on but I still get SIGSEGV: Illegal storage access crashes without any traceback |
13:46:05 | Araq | don't import segfaults, ever |
13:46:23 | shashlick | i added it to see if i get more, but it crashes even without it the same way |
13:46:37 | shashlick | this is only on 1.2.0 and devel, same stuff works fine on 1.0.6 and 0.20.2 |
13:47:02 | shashlick | was happening only on OSX but last CI it is failing on Linux |
13:47:11 | shashlick | and i'm unable to reproduce locally |
13:49:39 | shashlick | PMunch: please update to nimterop branch multifile |
13:49:44 | PMunch | I have |
13:49:52 | shashlick | cause toast is pointing to 0.4.4 |
13:50:02 | shashlick | which is very old |
13:50:07 | PMunch | Huh |
13:50:52 | PMunch | I cloned the repo, checked out multifile, and ran nimble install |
13:51:28 | shashlick | perhaps remove nimterop@#v0.4.4 |
13:51:47 | shashlick | and link toast to the new binary or use full path |
13:52:01 | shashlick | does /tmp/opensslwrap have the ssl header files? |
13:52:17 | shashlick | i was running in /usr/include/openssl |
13:52:25 | PMunch | The nimble file in that branch says 0.4.4.. |
13:53:19 | PMunch | Same error when running from /usr/include/openssl |
13:54:15 | shashlick | what's the output of toast -h |
13:55:56 | PMunch | Huh, seems like there was something funky with that symlink |
13:56:16 | PMunch | http://ix.io/2j56 |
13:56:21 | PMunch | Different error now though |
13:56:29 | shashlick | ya that's up to date now |
13:57:30 | shashlick | what's cligen upto now |
13:58:03 | PMunch | [email protected] |
13:58:59 | shashlick | try `-np --pluginSourcePath=/tmp/plugin.nim -f:ast2 -k -O:OPENSSL_die -r -s pem.h rsa.h err.h` |
13:59:08 | shashlick | not sure what to say |
14:01:42 | PMunch | Same error |
14:03:23 | FromDiscord | <Recruit_main707> how can i only import sqrt from `math` |
14:04:00 | PMunch | `from math import sqrt` |
14:04:26 | FromDiscord | <Recruit_main707> oh, thx |
14:04:48 | shashlick | hmm |
14:05:13 | shashlick | PMunch - seems like zsh itself is complaining |
14:05:48 | PMunch | Same error with bash |
14:05:49 | shashlick | seems to be treating the whole command line as the executable |
14:06:00 | PMunch | Oh |
14:06:06 | PMunch | That was a bad symlink |
14:06:15 | PMunch | The new error is: Unknown short option: "Â" |
14:06:31 | shashlick | oh right |
14:07:05 | * | fanta1 joined #nim |
14:07:22 | shashlick | can you add the flags incrementally and see which one is causing the problem? |
14:08:48 | PMunch | Well, that fixed the issue.. |
14:08:59 | shashlick | maybe cause of copy/paste? |
14:09:03 | PMunch | Must've been some weird symbol hidden in there when I copied it |
14:09:04 | PMunch | Yeah |
14:12:11 | PMunch | Well it thinks that it takes a ptr File, which should just be a File in Nim. |
14:12:34 | PMunch | And I get some conflicting type errors: http://ix.io/2j5c |
14:13:31 | FromDiscord | <Recruit_main707> > ptr File, which should just be a File in Nim. |
14:13:32 | FromDiscord | <Recruit_main707> i think not iirc its the same as in c/c++ |
14:14:31 | PMunch | I just defined it as `pointer` and passed it the output of `open` which worked |
14:14:58 | PMunch | According to the io module `File = ptr CFile` |
14:15:14 | * | ZoomZoomZoom quit (Ping timeout: 240 seconds) |
14:15:18 | * | nsf joined #nim |
14:15:27 | PMunch | So it should either be ptr CFile or File, but not ptr File |
14:15:29 | FromDiscord | <Recruit_main707> but i think CFile is also a pointer to a file |
14:15:41 | * | ZoomZoomZoom joined #nim |
14:18:01 | shashlick | okay we can fix that - FILE => CFile |
14:18:20 | shashlick | rather FILE* => File |
14:18:47 | FromGitter | <bung87> https://play.nim-lang.org/#ix=2j5e why parse simple html fails? |
14:20:37 | * | ZoomZoomZoom quit (Ping timeout: 264 seconds) |
14:21:10 | * | fredrik92 joined #nim |
14:21:50 | * | couven92 quit (Disconnected by services) |
14:21:53 | * | fredrik92 is now known as couven92 |
14:23:26 | * | tirej joined #nim |
14:23:30 | * | tirej left #nim (#nim) |
14:25:16 | * | waleee-cl joined #nim |
14:25:35 | shashlick | PMunch: pushed a fix on that branch |
14:28:07 | PMunch | That fixed the file issue, but I still get the conflicting types errors: http://ix.io/2j5i |
14:28:35 | PMunch | Oh wait.. |
14:29:51 | PMunch | Okay, that was caused by me leaving in my emit statement from earlier :P |
14:30:04 | PMunch | Woo, it works :) |
14:30:18 | PMunch | (with --passL:-lcrypto) |
14:31:01 | shashlick | excellent |
14:32:10 | shashlick | i tried copy pasting the command in a hex editor but don't see any 0xc2 which mapped to that unknown char |
14:32:50 | PMunch | Weird.. |
14:33:05 | PMunch | I might've hit some random keys :P |
14:33:11 | shashlick | by the way, there's a lot of comments at the top of the wrapper which you can toss out for now |
14:33:24 | shashlick | i am trying to figure out how to best report that kind of stuff |
14:33:30 | * | Senketsu joined #nim |
14:33:48 | PMunch | I didn't even look at the generated code :P |
14:34:43 | * | inv2004 joined #nim |
14:34:49 | inv2004 | Hello |
14:35:47 | inv2004 | K* = ptr object {.packed.} # it works, but writes that it is depricated to write pragma here, ok, I changed it to K* {.packed.} = ptr object - and it does not work - alignment is broken |
14:36:00 | * | liblq-dev quit (Ping timeout: 256 seconds) |
14:39:14 | * | Senketsu quit (Quit: WeeChat 2.7) |
14:41:40 | shashlick | how do you pass a `static string` passed to a macro onto another macro as a `static string`? |
14:43:02 | FromDiscord | <treeform> PMunch, I just read your Q&A it's really well written, good job. |
14:43:12 | PMunch | Oh, thanks :) |
14:43:32 | Yardanico | ah yeah, I read it in the morning today too, its very nice :) |
14:43:41 | * | couven92 is now known as fredrik92 |
14:43:50 | * | freddy92 is now known as couven92 |
14:43:56 | shashlick | link? |
14:43:59 | FromDiscord | <treeform> https://peterme.net/nim-qa-originally-a-hn-reply.html |
14:44:01 | PMunch | Credit to the guy on HackerNews for the good questions |
14:44:01 | Yardanico | https://peterme.net/nim-qa-originally-a-hn-reply.html |
14:44:35 | shashlick | any ideas on the static string question? |
14:45:38 | narimiran | anybody here have some experience with ruby/gems/jekyll/bundler and that stuff? i'm trying to build nim's website and i'm failing left and right |
14:46:03 | PMunch | I've gotta go walk the dog. Might be back later |
14:46:08 | * | PMunch quit (Quit: leaving) |
14:46:08 | FromGitter | <kaushalmodi> narimiran: Switch to Hugo |
14:46:09 | shashlick | PMunch: `chop their arm ofF then` |
14:46:40 | narimiran | @kaushalmodi heh, https://github.com/nim-lang/website/ uses jekyll |
14:46:43 | * | opal quit (Ping timeout: 240 seconds) |
14:46:47 | FromGitter | <kaushalmodi> narimiran: jekyll/octopress left me stumped for many years with all the ruby mess, until one day I discovered Hugo on HN |
14:46:59 | FromGitter | <kaushalmodi> narimiran: I know.. *switch* to Hugo |
14:47:04 | * | leorize quit (Ping timeout: 240 seconds) |
14:47:49 | Yardanico | @kaushalmodi make a PR :) |
14:48:06 | FromDiscord | <Rika> LOL |
14:48:13 | FromGitter | <kaushalmodi> If the nim team is fine with the switch, I can spend time on that |
14:48:17 | FromGitter | <kaushalmodi> I am not joking |
14:48:30 | Yardanico | well you need to ask dom and 4raq I guess, I don't do webdev stuff at all |
14:48:32 | disruptek | go for it. |
14:48:53 | Yardanico | and miran too |
14:52:22 | shashlick | disruptek: continuing our conversation from last night |
14:52:40 | shashlick | how come you aren't statically linking libgit2? |
14:52:57 | disruptek | PRs accepted. |
14:53:10 | shashlick | just need to set -d:git2Static in gittyup and you are done |
14:53:29 | disruptek | does it work? |
14:53:36 | shashlick | its tested on the CI |
14:54:13 | disruptek | not afaik. |
14:54:47 | narimiran | @kaushalmodi if hugo would make our life easier (and currently the bar for that is quite low :P), why not :) |
14:54:56 | shashlick | https://github.com/genotrance/nimgit2/blob/master/nimgit2.nimble#L35 |
14:55:04 | * | krux02 joined #nim |
14:55:21 | Araq | no. |
14:55:34 | narimiran | i'm guessing i'm currently in some dependency hell, and i can't get out of it no matter what i try.... |
14:55:36 | Araq | website rewrites are only acceptable if they use Nim |
14:55:52 | Araq | the website used to use Nim and it worked fine |
15:00:04 | disruptek | shashlick: it doesn't work because libssh needs static linking. |
15:00:04 | * | opal joined #nim |
15:00:37 | disruptek | ssl, crypto, libz, ssh2, etc. |
15:00:53 | Yardanico | libressl works for static linking too |
15:03:03 | shashlick | works fine on travis and locally |
15:03:25 | shashlick | https://github.com/genotrance/nimgit2/blob/master/nimgit2.nim#L51 |
15:04:09 | Araq | btw Hugo has 64 dependencies and had a bug in 'ToLower', see https://github.com/gohugoio/hugo/commit/27af5a339a4d3c5712b5ed946a636a8c21916039 I'd rather use my own 300 line helper Nim program instead, thanks |
15:08:48 | FromGitter | <kaushalmodi> Araq: You can wget a hugo static binary |
15:08:56 | FromDiscord | <Recruit_main707> oh gosh, out of all of the names for a go tool they had to choose mine |
15:09:13 | FromDiscord | <Rika> ok hugo |
15:09:35 | Araq | kaushalmodi: the art of programming lies in what *not* to do. |
15:09:41 | FromGitter | <kaushalmodi> Araq: just wget this tar, extract and binary and run it: https://github.com/gohugoio/hugo/releases/download/v0.69.1/hugo_0.69.1_Linux-ARM64.tar.gz |
15:09:57 | FromGitter | <kaushalmodi> s/and/the |
15:10:20 | Araq | I'm not on Linux and I have a life |
15:10:27 | FromGitter | <kaushalmodi> they have windows binaries too |
15:10:37 | Araq | dude, I don't want it |
15:10:41 | FromGitter | <kaushalmodi> https://github.com/gohugoio/hugo/releases/download/v0.69.1/hugo_0.69.1_Windows-64bit.zip |
15:10:59 | FromGitter | <kaushalmodi> ok, I am just saying that you don't have to worry about Hugo dependencies, no matter what platform you are on |
15:11:02 | Araq | believe it or not, I'm capable of installing software on my machine |
15:11:21 | * | natrys joined #nim |
15:11:36 | Araq | I want the old Nim website builder back and you'll never convince me of anything else |
15:11:49 | FromGitter | <kaushalmodi> > btw Hugo has 64 dependencies ⏎ ⏎ I am just countering that.. if you don't want to use Hugo, I understand, but "hugo has dependencies" is the wrong reason |
15:11:57 | disruptek | it would make a good demo of karax. |
15:12:04 | * | fredrik92 quit (Ping timeout: 265 seconds) |
15:12:16 | Yardanico | disruptek: no |
15:12:20 | Yardanico | no need for karax |
15:12:28 | FromGitter | <bung87> @Araq https://github.com/nim-lang/Nim/pull/14070 need feedback |
15:12:29 | Yardanico | just a simple nim static website builder |
15:12:29 | disbot | ➥ fix #14064 xmltree should allow create text node with raw text(non-es… |
15:13:06 | Araq | "hugo has 64 deps" for a static website builder for me is an indicator of "software written by amateurs", I am well aware that you can bundle deps |
15:13:13 | * | chemist69 quit (Ping timeout: 265 seconds) |
15:13:48 | FromGitter | <kaushalmodi> following the hugo development actively, I can understand the reason for those 64 deps |
15:13:53 | disruptek | ~stream |
15:13:53 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
15:14:07 | disruptek | compiler hacking and ragging on karax. |
15:14:09 | * | chemist69 joined #nim |
15:14:13 | FromGitter | <kaushalmodi> it's a static site builder with lot of features but I won't go into that over here |
15:15:25 | * | leorize joined #nim |
15:16:39 | * | liblq-dev joined #nim |
15:16:57 | FromDiscord | <Rika> can we drop this hugo thing |
15:17:07 | narimiran | i finally, after half a day of trying (!), managed to somehow make jekyll to build the website |
15:17:09 | FromDiscord | <Rika> im not sure of what you guys are arguing about anymore |
15:17:37 | companion_cube | (funny, the one I use in rust, cobalt, also has a bunch of deps so it can provide a local dev server and stuff) |
15:17:48 | narimiran | (and i'm not sure if this blessed state would last or if it is just temporary) |
15:17:52 | Araq | Rika: we're already done |
15:18:06 | FromDiscord | <Rika> okay |
15:19:21 | Araq | but once again, I want my old website builder back that used 'nim rst2html' and Nim's source code filters because I like Nim. and guess what, I had any feature that I needed available in this setup. |
15:19:51 | Yardanico | old nim website looked more "solid" or something like that :P |
15:20:24 | Araq | Yardanico: you look at the CSS, it was bad, then it got better. nothing to do with the builder software |
15:20:33 | Yardanico | ah right |
15:20:36 | companion_cube | the current website looks good |
15:20:50 | Yardanico | yeah we're not talking about changing the website look |
15:21:25 | Prestige | I feel like some specific pages take a while to load |
15:21:50 | Yardanico | Prestige: nim website is literally statically served :P |
15:21:51 | companion_cube | disruptek: what other chan are you on? :p is there a offtopic to this? |
15:21:52 | Prestige | but idk how the content is being served |
15:21:55 | Prestige | hm |
15:22:12 | Yardanico | and it's behing cloudflare as well |
15:22:13 | disruptek | twitch chat. |
15:22:27 | companion_cube | ahhhhhh ofc. |
15:23:35 | * | ZoomZoomZoom joined #nim |
15:23:45 | Prestige | Woah that's weird, maybe firefox is just having issues with the searchable index page Yardanico |
15:23:55 | Yardanico | Prestige: oh you're about that page |
15:23:56 | Prestige | Takes like 4 seconds to load on ff but chromium took like .5 seconds |
15:23:59 | Yardanico | https://nim-lang.org/docs/theindex.html ? |
15:24:05 | Yardanico | well it's a very big page |
15:24:25 | Prestige | Right, still seems odd that ff is taking much longer than the other |
15:29:58 | * | sunwukong quit (Quit: Leaving) |
15:31:27 | * | NimBot joined #nim |
15:34:10 | FromGitter | <kaushalmodi> I am using latest firefox on Windows, loads fine.. takes about a second |
15:34:21 | FromGitter | <kaushalmodi> *theindex.html loads fine |
15:37:21 | companion_cube | disruptek: gRPC and the likes are RPC over http |
15:37:40 | Araq | narimiran: so what's the changelog situation? |
15:37:51 | Araq | where should people add their changelog entries? |
15:38:42 | companion_cube | disruptek: http supports persistent connections, too |
15:39:08 | * | lritter quit (Ping timeout: 265 seconds) |
15:39:14 | Araq | cc bung87 |
15:39:28 | companion_cube | :DD no offense |
15:40:08 | companion_cube | yeah that was funny 😂 |
15:41:55 | narimiran | Araq: i'm still not convinced that `changelog.md` should become just a "table of contents" for changelogs |
15:42:21 | narimiran | if anybody else wants to give their opinion/view: https://github.com/nim-lang/Nim/pull/14025 |
15:42:22 | disbot | ➥ avoid messing up changelog history on each subsequent release |
15:42:22 | Araq | no, it should be changelog_$version.md |
15:42:27 | companion_cube | monday night I think |
15:42:31 | Araq | and there should be no changelog.md |
15:42:38 | companion_cube | on discord? |
15:43:55 | Prestige | Could just be a ff bug for this version I guess lol |
15:45:13 | FromGitter | <bung87> @Arag I added it to changelog_1_2_0.md |
15:45:32 | companion_cube | why would you want to troll crystal, disruptek? |
15:45:38 | Yardanico | companion_cube: why not |
15:45:43 | Yardanico | it's for research |
15:46:09 | narimiran | @bung87 that change of changelog_1_2_0.md is wrong!! |
15:46:20 | narimiran | 1.2.0 is already released!! |
15:46:21 | companion_cube | 😂 oh well |
15:46:30 | companion_cube | please be nice, crystal is interesting (unlike V) |
15:46:37 | FromDiscord | <Rika> OOF |
15:46:48 | FromGitter | <bung87> ah, that's a problem. |
15:46:48 | companion_cube | and thus starts another copy-pasta |
15:46:58 | narimiran | @bung87 put it in `changelog.md` |
15:47:01 | FromGitter | <bung87> I dont think I can change the nim version.. |
15:47:12 | narimiran | this one: https://github.com/nim-lang/Nim/blob/devel/changelog.md |
15:47:33 | FromGitter | <bung87> ok |
15:47:44 | narimiran | and it is `since:(1, 3)` |
15:48:13 | narimiran | and in text, it is `**Since**: Version 1.4.` (not a typo, 1.4) |
15:50:10 | companion_cube | they're doing good |
15:50:27 | companion_cube | who knows, maybe we were trolled the same way |
15:50:37 | FromGitter | <bung87> ok, next time I can easyly handle this .. |
15:53:23 | companion_cube | well rust might be a valid choice for that crazy project disbot |
15:53:25 | companion_cube | disruptek |
16:01:29 | zacharycarter | q |
16:01:30 | zacharycarter | q! |
16:01:33 | * | zacharycarter quit (Quit: leaving) |
16:01:43 | companion_cube | q? |
16:02:35 | Yardanico | q! |
16:02:43 | FromDiscord | <Recruit_main707> q |
16:03:08 | * | zacharycarter joined #nim |
16:05:27 | FromDiscord | <Rika> :q! |
16:05:27 | Prestige | Lol |
16:06:22 | narimiran | brainfuq language when? |
16:06:32 | Yardanico | Chef language is better |
16:06:38 | Yardanico | write programs using recipies |
16:07:01 | companion_cube | there's beef lang, too :p |
16:07:08 | FromDiscord | <Recruit_main707> \:smart: |
16:07:17 | narimiran | it was a (bad) joke about repetitive usage of Q :'( |
16:07:28 | Yardanico | it was a good joke |
16:07:40 | narimiran | q! |
16:12:41 | * | PMunch joined #nim |
16:15:12 | * | sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in) |
16:15:42 | * | sacredfrog joined #nim |
16:21:42 | * | liblq-dev quit (Ping timeout: 258 seconds) |
16:23:27 | * | liblq-dev joined #nim |
16:32:07 | * | fanta1 quit (Quit: fanta1) |
16:36:22 | * | abm quit (Quit: Leaving) |
16:37:26 | FromDiscord | <clyybber> Araq: Does your recent PR mean that the cycle collector is now working? |
16:46:43 | FromGitter | <bung87> https://github.com/nim-lang/Nim/issues/14073 any idea to this ? |
16:46:45 | disbot | ➥ htmlparser doest parse self close tag ; snippet at 12https://play.nim-lang.org/#ix=2j67 |
16:49:19 | FromGitter | <kdheepak> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ea0758f35a35031bf7cd6cb] |
16:49:30 | FromGitter | <kdheepak> Why does something like this not work? |
16:50:04 | FromGitter | <kdheepak> > Error: cannot create a flowVar of type: Person ⏎ ⏎ I get the following error |
16:50:26 | FromGitter | <kdheepak> I've tried with Person = tuple as well. |
16:51:18 | FromGitter | <bung87> you evalute worker() |
16:51:38 | FromGitter | <bung87> that return a Person, so you wrote spawn Person |
16:51:39 | shashlick | if porting to --gc:arc, can the code still compile with regular GC for older Nim versions? |
16:51:53 | Yardanico | shashlick: most of the time you don't need to port anything |
16:51:56 | FromDiscord | <Rika> so essentially, dont call worker |
16:51:57 | FromDiscord | <Rika> ? |
16:52:08 | FromGitter | <kdheepak> I want to start a thread that returns a Person. |
16:52:27 | shashlick | ya but my code doesn't work anymore since i'm loading a dll and there's some issue being introduced |
16:52:41 | leorize | shashlick: --gc:arc is vastly simpler than the normal gc |
16:52:48 | leorize | if it can run on arc it runs everywhere |
16:53:48 | FromGitter | <bung87> so you just pass `worker` |
16:54:17 | FromGitter | <kdheepak> ```test.nim(14, 19) Error: 'spawn' takes a call expression ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5ea076b9727e88014a0d028f] |
16:54:23 | shashlick | so in nimterop, i compile a plugin with --app:lib --gc:arc and run a proc from it on memory from main exe |
16:54:32 | shashlick | that data isn't coming through so tests are failing |
16:54:39 | shashlick | basically cPlugin() isn't working |
16:54:53 | FromGitter | <kdheepak> If I return `int` it works if I use `spawn worker()` |
16:55:54 | FromGitter | <bung87> hmm I checked my mistake |
16:58:18 | leorize | shashlick: use -d:useMalloc for both of them |
16:59:49 | * | PMunch quit (Quit: leaving) |
17:00:11 | FromGitter | <bung87> document not explain what FlowVar is |
17:02:59 | shashlick | leorize: how does that help? |
17:04:19 | shashlick | same issue |
17:04:44 | leorize | then it might be a bug |
17:08:01 | leorize | do you have a small reproducible sample? |
17:09:22 | shashlick | Trying to figure out what's going wrong |
17:10:01 | FromDiscord | <Yardanico> @gaurav |
17:10:21 | FromDiscord | <Yardanico> so what did you choose for your adobe premiere competitor in the end? |
17:11:04 | zacharycarter | You picked vlang didn't you? |
17:16:05 | FromDiscord | <gaurav> @Yardanico I am still researching. I have not been hired for the position yet. Researching before I join. Learning alot about cross platform desktop apps. I found the advices helpful though. May go with Qt and CPP |
17:18:00 | FromDiscord | <gaurav> The only reason to think about other options was to get less size of binary and low mem footprint. VLang, Rust and Nim are options too. |
17:18:48 | leorize | you can get small binary size with C++ if you know what you're doing |
17:19:27 | FromDiscord | <gaurav> Performance matters and that could be the selling point over Premiere.. We hv few editors as mentors though and they complained abt transition in windows and flow of different softwares. UI should not be overwhelming. |
17:19:58 | leorize | make sure you hire a proper designer and not a bunch of developers trying to draw out a clunky ui |
17:20:43 | FromDiscord | <gaurav> I am not into programming and I can't impose what I like (I like web based programming languges and FP). I need to look with the point of view of architects and developers. |
17:20:59 | FromDiscord | <gaurav> I understand that. UI is important. |
17:22:15 | FromDiscord | <gaurav> I am looking at the option of going with KDenlive's code too.. saw some of its performance videos over other editors and it is good.. I liked the suggestion of one mate that day to use Kdenlite's code at the backend and make a new GUI |
17:22:35 | companion_cube | kdenlive is GPL though, you can't just commercialize a fork of the code |
17:23:06 | FromDiscord | <gaurav> I am planning to use Qt Design Studio for it for now. Licensed version. Hopefully, we will get up with something better.. |
17:24:14 | FromDiscord | <gaurav> we will look into the code and tweak it and use it for our favour... I think we need few testing tools too.. with C++ I heard that few things are very slow to implement in that.. |
17:24:30 | disruptek | don't talk to him about commercial forks; he isn't into programming. |
17:25:15 | FromDiscord | <gaurav> yes.. I am not into programming.. |
17:26:48 | FromDiscord | <gaurav> we will look into the code and tweak it and use it for our favour... I think we need few testing tools too.. with C++ I heard that few things after being made perform very slow to implement in that.. |
17:27:57 | FromDiscord | <gaurav> Someone was sugggesting to use JS over Electron as it has lesser footprint.. |
17:28:40 | FromDiscord | <gaurav> I need to look into that option too.. will try some alternatives of Electron if this option is better.. |
17:28:54 | companion_cube | that was a joke |
17:29:06 | companion_cube | electron s the heaviest thing in the galaxy |
17:29:27 | * | supakeen must resist mom jokes |
17:30:07 | leorize | this is way people need consultants and not just running head first into making some big projects |
17:31:19 | shashlick | this entire conversation belongs in #nim-offtopic |
17:31:25 | shashlick | nothing is nim specific |
17:33:06 | FromGitter | <kdheepak> I posted my question on the forum (https://forum.nim-lang.org/t/6245) because I'm pretty sure get lost in this thread. |
17:35:11 | leorize | looks like you're moderated :P |
17:35:34 | leorize | for your flowvar problem, I'd recommend using |
17:35:44 | leorize | !repo yglukhov/threadpools |
17:35:45 | disbot | https://github.com/yglukhov/threadpools -- 9threadpools: 11 15 15⭐ 7🍴 |
17:36:05 | leorize | it's an improved version of threadpool and works better than the stdlib |
17:36:18 | leorize | !repo weave |
17:36:20 | disbot | https://github.com/mratsim/weave -- 9weave: 11A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead 15 141⭐ 8🍴 |
17:36:50 | leorize | ^ this one is interesting too, but it's not compatible with GC-ed memory so not really that useful yet |
17:36:58 | leorize | hopefully arc will change this |
17:38:02 | narimiran | leorize: @kdheepak's post should be visible now |
17:43:05 | FromDiscord | <gaurav> brb |
17:47:07 | shashlick | can you set the gc on http://play.ni |
17:47:11 | Yardanico | no |
17:47:22 | * | Trustable joined #nim |
17:53:19 | * | Trustable quit (Remote host closed the connection) |
17:54:27 | * | Trustable joined #nim |
18:00:10 | shashlick | @leorize - i have a minimal example |
18:02:31 | shashlick | Araq: have a --gc:arc test that doesn't work - appreciate some help |
18:03:09 | Araq | well? |
18:03:14 | shashlick | main.nim = http://ix.io/2j6u/nim and plugin.nim = http://ix.io/2j6v/nim |
18:03:58 | leorize | shashlick: your plugin one need cdecl too... |
18:04:08 | leorize | or use nimcall for the main one |
18:04:12 | leorize | though it shouldn't matter on linux |
18:04:52 | shashlick | well it doesn't even work with the regular GC, so hold on, let me check |
18:05:03 | * | martinium quit (Remote host closed the connection) |
18:05:32 | Araq | shashlick: does your malloc implementation work across .so boundaries? |
18:06:02 | shashlick | let's just say i've been living on the edge and it's finally come to bite me |
18:06:28 | leorize | Araq: I'd expect it to, since that's literally libc job |
18:06:40 | shashlick | nimterop sporadically crashes with the regular GC so i'm testing with --gc:arc |
18:07:02 | shashlick | but now hash is empty in the plugin |
18:07:02 | Araq | shashlick: well ask valgrind |
18:07:26 | FromDiscord | <clyybber> Araq: Does your recent PR mean that the cycle collector is now working? |
18:07:45 | Araq | no. |
18:08:29 | Araq | I suspect the paper's algorithm might have a bug since my 'thinout' uses the same technology and doesn't crash |
18:08:47 | Araq | so I'm looking for a simpler cycle detector algorithm to try out |
18:08:47 | leorize | shashlick: also can you add an echo to the plugin to verify that the initialization proc was run? |
18:08:58 | shashlick | how do I do that |
18:09:22 | leorize | just a simple `echo "hello"` at the top-level of plugin.nim |
18:09:49 | shashlick | yep init runs with regular GC |
18:09:57 | Araq | wouldn't be the first time I found a bug in a paper with a "correctness proof" |
18:10:24 | shashlick | init runs with --gc:arc as well |
18:10:46 | shashlick | so in theory, hash should be populated with a value |
18:11:36 | Araq | shashlick: try also with --sinkInference:off |
18:12:01 | FromDiscord | <mratsim> @leorize, is yglukhov threadpool compatible with sequences and strings? or I guess it works with Nim channels |
18:12:18 | leorize | it is compatible |
18:12:34 | leorize | it can do ref objects the last time I checked |
18:16:59 | FromDiscord | <RaycatWhoDat> oh jeez |
18:17:07 | FromDiscord | <RaycatWhoDat> IRC bridge throwbacks |
18:18:36 | FromDiscord | <RaycatWhoDat> Also, hello. Trying to canvass the room for a few opinions. Does anyone here uses Nim to generate their C++ code but is proficient in C++ as well? |
18:19:26 | Araq | define "proficient", I know a bit about C++ |
18:19:33 | leorize[m] | I'm not that proficient in C++ but I do know a thing or two |
18:20:27 | narimiran | i'm proficient, but i know nothing |
18:20:40 | FromDiscord | <RaycatWhoDat> On the scale of 1 to Bjorne... like a 6. You know enough about it to put "C++ programmer" on your resume. |
18:21:09 | Araq | leorize[m]: is https://github.com/nim-lang/Nim/pull/13934 still relevant? |
18:21:09 | disbot | ➥ Set NONBLOCK flag atomically |
18:21:32 | leorize | yea, it's still relevant |
18:21:42 | Araq | RaycatWhoDat: please ask your question already |
18:21:52 | Araq | leorize[m]: merge? |
18:22:26 | leorize | sure |
18:23:11 | FromDiscord | <RaycatWhoDat> Does Nim address most of the things you'd write C++ code for? |
18:23:24 | FromGitter | <awr1> anyone that claims to know C++ is lying |
18:23:55 | FromGitter | <awr1> /s |
18:24:13 | shashlick | Araq: --sinkInference:off doesn't help |
18:24:22 | leorize | you can see why none of us said we know c++ :p |
18:24:56 | FromDiscord | <RaycatWhoDat> Right. |
18:26:11 | leorize | I write C++ because I work on a project that is written in C++, and Nim certainly can't address that :) |
18:26:45 | FromDiscord | <RaycatWhoDat> That makes sense. Would you pick Nim if it was a greenfield project? |
18:27:09 | FromDiscord | <RaycatWhoDat> I'm guessing "yes". |
18:27:16 | FromGitter | <bung87> @gaurav electron is the easy way to go, qt also good as well. |
18:29:11 | FromGitter | <bung87> any other approach "cross platform" just wrote two words... |
18:29:17 | leorize | ofc I'd pick nim :p |
18:31:03 | FromDiscord | <Rika> Only issue with nim IMO is its small 3rd party library count, but that fixes over time |
18:31:27 | FromDiscord | <Rika> Has anyone used nimlua? |
18:31:42 | FromGitter | <bung87> I'm planed write a new webview lib ,but I have no income now |
18:32:47 | FromDiscord | <Recruit_main707> I was thinking, you know what would be nuts? |
18:32:47 | FromDiscord | <Recruit_main707> Getting Computerphile to feature Araq to talk about nim. |
18:33:54 | FromDiscord | <Recruit_main707> with the quarantine they probably dont have that much content |
18:34:24 | leorize | you can ask them and maybe they'd reach out |
18:34:28 | leorize | if they haven't already :P |
18:35:23 | Araq | RaycatWhoDat: "greenfield project" is too broad, what project |
18:35:40 | FromDiscord | <Recruit_main707> Araq: would you accept that? |
18:36:23 | Araq | Recruit_main707: sure |
18:36:45 | FromDiscord | <Recruit_main707> then gotta start spamming their social media ;P |
18:38:05 | FromDiscord | <Rika> Not a good idea I don't think |
18:38:16 | FromDiscord | <Rika> Just inquire once and wait |
18:38:32 | FromDiscord | <Recruit_main707> they tend to read comments i know |
18:39:12 | FromDiscord | <RaycatWhoDat> @Araq "Greenfield project" in my head means you started from zero, you're in the process of choosing a language. |
18:39:34 | FromDiscord | <Rika> Never heard of that idiom |
18:39:49 | FromDiscord | <RaycatWhoDat> I'd be interested to know when Nim isn't the best option. |
18:39:53 | Araq | I know what a Greenfield project is, but you didn't say the topic |
18:40:22 | Araq | is it a new web browser, a game engine, control software for your toaster? |
18:40:31 | FromDiscord | <Rika> Right now nim ain't too good for mobile app development AFAIK |
18:40:49 | leorize | spoiler: control software for toaster is actually where you shouldn't use nim, yet |
18:41:07 | FromDiscord | <Rika> Why not? I though nim was embedded ready |
18:41:55 | FromDiscord | <clyybber> @Rika Why wouldn't it be good for mobile app development? |
18:42:27 | FromDiscord | <RaycatWhoDat> Araq: Sorry for the miscommunication. I was looking at it from an overall perspective, use case aside. "When isn't Nim the best option?" is the closest I can get in meaning. |
18:42:41 | FromDiscord | <Rika> I don't know of any tutorials for mobile development in nim |
18:42:55 | leorize | Rika: the ecosystem around embedded things in nim is still young, and almost no support for any of the popular embedded boards |
18:42:58 | FromDiscord | <clyybber> Well, its as possible as it is to do with C++ or C |
18:43:02 | leorize | also --os:standalone breaks every release :P |
18:43:11 | FromDiscord | <Rika> But are there the docs for it |
18:43:17 | FromDiscord | <clyybber> @Rika We can even compile to dalvik |
18:43:30 | FromDiscord | <Rika> Is it well supported |
18:43:42 | leorize | we now have --os:any but you don't seem to have control over everything like --os:standalone |
18:44:10 | FromDiscord | <clyybber> @Rika No it was more of an experiment AFAICT. But there is https://github.com/yglukhov/jnim which the original author of the dalvik backend is now working on too |
18:44:10 | FromDiscord | <Rika> Interesting, I've heard of any but not standalone |
18:44:25 | FromDiscord | <Rika> I see. That looks useful |
18:44:30 | FromDiscord | <Rika> For my project I mean |
18:44:52 | FromDiscord | <clyybber> also dom96 is making a mobile app/game |
18:44:55 | leorize | --os:standalone predates --os:any, but it's kinda funky and no one ever nailed the semantics down |
18:44:57 | FromDiscord | <clyybber> using jnim afaik |
18:48:25 | Araq | RaycatWhoDat: ok well, Nim definitely has all the downsides of a small ecosystem so if your project relies on libraries that are not available and not easy to wrap/redo than Nim isn't a good choice |
18:48:58 | * | MightyJoe is now known as cyraxjoe |
18:50:39 | FromDiscord | <RaycatWhoDat> @Araq Okay, cool. I'm used to smaller ecosystems and I'm not afraid to put in some elbow grease to make things play nice. |
18:58:28 | FromDiscord | <RaycatWhoDat> Thanks for the info! |
19:01:43 | FromGitter | <alehander92> hey guyss |
19:01:46 | FromGitter | <alehander92> i used ! |
19:01:50 | FromGitter | <alehander92> os:any yesterday |
19:01:54 | FromGitter | <alehander92> for study-kernel |
19:01:59 | FromGitter | <alehander92> and it seems to work! awesome work |
19:02:11 | FromGitter | <alehander92> disruptek or zevv or rainman or leorize not sure who did it |
19:02:18 | FromGitter | <alehander92> also i used `--gc:arc ` |
19:02:22 | disruptek | zevv. |
19:02:26 | FromGitter | <alehander92> so my plan is to use `async` now and rewrite |
19:02:34 | disruptek | congrats, dude. |
19:02:36 | FromGitter | <alehander92> it to very simple cooperative multithreading |
19:02:53 | FromGitter | <alehander92> well it's like absolutely toy stuff dont listen to my rambling :P |
19:03:00 | FromGitter | <alehander92> the problem is simple |
19:03:10 | FromGitter | <alehander92> `asyncdispatch` currently depends on `os` and a lot of stuff |
19:03:24 | FromGitter | <alehander92> so probably it would be better for me to just write a custom `async` macro |
19:03:30 | leorize | use chronos and write your own backend for it :P |
19:03:50 | FromGitter | <alehander92> well, thats the good thing: i was like "how to write a custom executor like they do in rust" |
19:04:00 | FromGitter | <alehander92> and in nim you can just sidestep the whole thing |
19:04:16 | leorize | true :P |
19:04:17 | FromGitter | <alehander92> and write your own third macro ignoring the whole stdlib/chronos thing |
19:04:54 | leorize | I'm a bit wary about --os:any due to sysFatal not overridable |
19:04:59 | FromGitter | <alehander92> i need to think of preemption one day but for now not important |
19:05:07 | leorize | meaning you can't have a nice panic for your kernel |
19:07:19 | FromGitter | <alehander92> but i wonder if i need to just generate `switchTasks(res: T)` calls instead of `yield` as syntax sugar |
19:08:38 | * | nsf quit (Quit: WeeChat 2.8) |
19:10:18 | FromGitter | <alehander92> background (shell(1), shell(2)); => var input = await read(); var output = await process(input); await write(output); |
19:10:26 | FromGitter | <alehander92> hm, i really need to think about that first |
19:10:48 | FromGitter | <alehander92> anyway, my first battle was to just manage to build a cross compiler |
19:11:23 | Zevv | zup |
19:11:32 | Zevv | oh it was me, yes |
19:12:10 | FromGitter | <alehander92> Zevv is it a good idea to write a kernel which exposes everything in async style |
19:13:21 | Zevv | ha how should I know :) |
19:13:23 | FromGitter | <alehander92> my plan is every "process" / "syscall" to be just a proc name(args): ret (optional {.kernel kind of async.}) and |
19:13:35 | Zevv | If it was a good idea, wouldn't there be kernels around which expose everything in async style? :) |
19:13:36 | FromGitter | <alehander92> to just see where this goes |
19:13:47 | FromGitter | <alehander92> well, i think |
19:13:52 | FromGitter | <alehander92> it's probably a good idea but the problem is |
19:13:53 | shashlick | markAndSweep fixed the crash for now |
19:14:02 | FromGitter | <alehander92> if almost everything is awaitable anyway |
19:14:15 | FromGitter | <alehander92> its better to use this as a default in the language of the kernel |
19:14:28 | FromGitter | <alehander92> so maybe people use different kinds of expressing it |
19:15:03 | FromGitter | <alehander92> but this is still doable in nim |
19:15:23 | FromGitter | <alehander92> you can write `write!(a)` instead of `await write(a)` i think |
19:15:33 | FromGitter | <alehander92> if you write such an api |
19:15:38 | Zevv | I've been neglecting recent developments here, but I assume arc and async now play together well? |
19:15:49 | disruptek | nah. |
19:15:52 | FromGitter | <alehander92> not sure, but i'd write my own custom async if i do that |
19:15:58 | Zevv | nah?! |
19:16:09 | Zevv | that was *the* single problem to be solved! |
19:16:36 | * | moerm joined #nim |
19:16:36 | FromGitter | <alehander92> so you just write write!(a) or write~(a) for await/background |
19:16:42 | FromGitter | <alehander92> but maybe too much operator |
19:16:44 | moerm | Hello everyone |
19:16:46 | Zevv | what about just exposing write() only |
19:17:10 | FromGitter | <alehander92> zevv but then how would the scheduler know to run it non-blockingly |
19:17:17 | FromGitter | <alehander92> if the language generates a direct call |
19:17:22 | Zevv | sure, but you make your own write(), I mean |
19:17:30 | Zevv | that is implicitly async |
19:17:49 | Zevv | not sure if that's the smart thing to do of course, but hey, what do I know |
19:18:01 | * | Tlongir joined #nim |
19:18:05 | Zevv | it makes sense to see where your scheduling points are. That's what "await" is helping with |
19:18:32 | FromGitter | <alehander92> yeah, i mean if you somehow automatically insert `await/yield` |
19:18:42 | FromGitter | <alehander92> before "futures" |
19:18:43 | FromGitter | <alehander92> this can work |
19:18:45 | * | ryan_ quit (Ping timeout: 256 seconds) |
19:18:56 | * | sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in) |
19:19:06 | Zevv | sure. I did that in Lua ages ago with coroutines. |
19:19:26 | FromGitter | <alehander92> hm |
19:19:36 | FromGitter | <alehander92> but i want to sometimes |
19:19:37 | Araq | Zevv: well it's hard and nobody screams "hey, I'm solving it" |
19:19:39 | FromGitter | <alehander92> run them in the background |
19:19:53 | FromGitter | <alehander92> i can always write explicitly that |
19:20:15 | Araq | Zevv: work on --gc:orc is continuing and then you can run everything without the porting effort |
19:20:20 | * | sacredfrog joined #nim |
19:20:48 | Zevv | Araq: I'm not complaining :) I know it's hard - I tried understanding any of that and just gave up after two days |
19:21:13 | FromGitter | <alehander92> Zevv yeah an example solution is safeasync from https://github.com/status-im/nim-chronos/issues/2#issue-327470294 |
19:21:15 | disbot | ➥ [RFC] Async I/O with structural control flow (a.k.a. Enforced Awaits) ; snippet at 12https://play.nim-lang.org/#ix=2j7c |
19:21:17 | Araq | yeah well, same here, I gave up and I'm adding a cycle collector |
19:21:23 | FromGitter | <bung87> recommand a good html parser? I know python's |
19:21:25 | FromGitter | <alehander92> but i probably just like explicitness here |
19:21:34 | Zevv | Araq: fair enough |
19:21:51 | FromGitter | <alehander92> it can be simpler to just know "ah here in the code i await and here i dont" |
19:22:25 | Zevv | right |
19:23:01 | FromGitter | <alehander92> so its technically possible, but i can't decide why would i do that as language point |
19:23:08 | * | Tlongir quit (Ping timeout: 256 seconds) |
19:23:33 | FromGitter | <bung87> like ruby style |
19:24:20 | FromGitter | <bung87> so developer will not relys on their bad memory |
19:25:52 | FromGitter | <alehander92> also piping is interesting, if everything is awaitable `a().b()` should be something like async iterator in async iterator |
19:26:08 | Zevv | lazy iterators |
19:26:18 | Zevv | chainable lazy iterators, even |
19:26:35 | Zevv | I'm all for it |
19:26:41 | FromGitter | <alehander92> for await e in a: for await c in b(e): |
19:27:05 | FromGitter | <alehander92> yeah |
19:27:13 | FromGitter | <alehander92> but for my shell to understand it |
19:27:22 | FromGitter | <alehander92> it should interpret this on nim runtime |
19:27:29 | FromGitter | <alehander92> which is not that hard |
19:29:16 | * | PMunch joined #nim |
19:30:38 | moerm | Have a good time everyone (and especially Araq our beloved BDFL) |
19:30:56 | FromGitter | <alehander92> ok, so 1) cross compile 2) structure correctly repo 3) elementary custom async switchTasks |
19:31:02 | FromGitter | <alehander92> moerm hey hello |
19:31:20 | * | moerm quit (Quit: Leaving) |
19:39:36 | leorize | shashlick: I've tried your test and the hash set is weirdly empty |
19:40:20 | shashlick | i fixed my crash with markAndSweep for now but ya, eventually would like to use arc |
19:40:31 | shashlick | but I don't understand how the regular GC also fails with that test |
19:41:48 | leorize | it might be a bug in hashset itself? |
19:41:51 | leorize | ping narimiran |
19:42:17 | narimiran | pong |
19:42:19 | leorize | shashlick: fun fact, if you use `hash.incl` inside `onTest`, it will work |
19:43:10 | shashlick | actually it works on regular gc and with boehm |
19:43:13 | shashlick | only not with arc |
19:43:34 | shashlick | let me open a bug for tracking |
19:43:44 | Araq | yes please |
19:44:11 | Araq | shashlick: oh also try with --exceptions:setjmp |
19:45:12 | * | Tlongir joined #nim |
19:46:32 | leorize | newruntime repr() on ptr is kinda useless... |
19:46:39 | leorize | it doesn't show me the address |
19:47:06 | Araq | leorize: fix it please |
19:47:27 | Araq | when I wrote the code I thought "yeah, nobody ever cared about these addresses..." |
19:50:11 | shashlick | https://github.com/nim-lang/Nim/issues/14074 |
19:50:14 | disbot | ➥ --gc:arc does not retain global HashSet in --app:lib ; snippet at 12https://play.nim-lang.org/#ix=2j7k |
19:50:14 | leorize | shashlick: found the issue |
19:50:35 | leorize | it's an old one and probably reported long ago |
19:50:46 | Araq | what is it? |
19:50:54 | leorize | but the global variable destructors assume that the program last for the duration of NimMain() |
19:51:03 | leorize | which is not true for libraries |
19:51:56 | leorize | so as you might expect, everything got wiped out after initialization finished :) |
19:53:20 | leorize | shashlick: walkaround: move everything to an init proc |
19:53:48 | FromDiscord | <clyybber> Araq: Are you referring to the proof in this paper https://sci-hub.tw/https://doi.org/10.1016/j.ipl.2008.09.009 ? |
19:53:54 | FromDiscord | <clyybber> It looks correct to me |
19:55:22 | shashlick | i'll stick to markAndSweep for now since I have to support older Nim |
19:56:33 | shashlick | phew, seeing green after weeks! https://travis-ci.org/github/nimterop/nimterop/builds |
19:59:44 | leorize | oh also disregard that advice about {.nimcall.}, it appears to me that {.exportc.} defaults to cdecl |
20:00:06 | shashlick | cool |
20:00:33 | shashlick | okay so question i asked again - how do you pass a static string param to a macro to another macro that expects a static string |
20:00:52 | leorize | you don't :) |
20:05:37 | * | ZoomZoomZoom quit (Ping timeout: 264 seconds) |
20:06:06 | leorize | Araq: does --gc:arc support sharing memory between shared objects without using nimrtl? |
20:10:32 | FromGitter | <mratsim> 1) use a compile-time proc @shashlick ⏎ 2) use getAST ⏎ 3) quote do call the macro and pass the string |
20:12:19 | Araq | leorize: with -d:useMalloc, yes |
20:12:53 | shashlick | @mratsim: i am using #3 in nimdeps, will try the same in this case |
20:15:13 | shashlick | https://github.com/nim-lang/Nim/issues/7375 is still biting me |
20:15:15 | disbot | ➥ Macro: bool is converted to int inside `quote do` ; snippet at 12https://play.nim-lang.org/#ix=2j7q |
20:16:28 | FromGitter | <mratsim> just call newLit(x) before doing quote do |
20:16:39 | FromGitter | <mratsim> or in the quote do block boo(`x`) |
20:16:45 | FromGitter | <mratsim> foo* |
20:17:15 | FromGitter | <mratsim> I'm more annoyed at the fact that you can't interpolate an expression, only variables in quote do |
20:17:28 | shashlick | it works! |
20:17:29 | shashlick | peace |
20:17:46 | shashlick | so now you can cImport multiple files and toast will process them altogether and skip duplicates |
20:17:59 | shashlick | duplicate symbols |
20:33:10 | FromGitter | <awr1> and made this public |
20:33:11 | FromGitter | <awr1> https://github.com/awr1/cpuwhat |
20:34:42 | leorize | are we gonna see a runtime dispatcher library based on this? :) |
20:35:53 | leorize | @mratsim might like this |
20:36:41 | leorize | oh wait you depend on nimterop.. |
20:36:41 | FromDiscord | <Recruit_main707> a nim library that doesnt have nim in the name :0 |
20:37:30 | * | filcuc quit (Ping timeout: 250 seconds) |
20:37:54 | FromGitter | <awr1> does mratsim not like nimterop |
20:38:12 | leorize | I don't like nimterop dependency, not sure 'bout him |
20:38:27 | leorize | though what you do look simple enough |
20:38:38 | FromDiscord | <Recruit_main707> thats what i was gonna say |
20:38:42 | FromGitter | <awr1> i thought it would have been useful for all those new weird intrinsics |
20:38:50 | FromGitter | <awr1> that intel likes to keep adding |
20:38:52 | FromDiscord | <Recruit_main707> he only imports a few types |
20:39:42 | FromDiscord | <Recruit_main707> no arm support though :( |
20:39:51 | FromGitter | <awr1> if only optional dependencies were a thing in nimble |
20:39:53 | leorize | I've got my fair share of nimterop erroring out on installation, so it's not my favourite |
20:40:22 | FromGitter | <awr1> i'll get an RPI when i move out and then i'll add proper ARM support |
20:41:01 | leorize | you can use qemu arm emulation as a stop gap measure :P |
20:41:04 | FromDiscord | <Recruit_main707> i havent been able to succesfully wrap a project, but its hell of a big one, and shashlick has dedicated me a lot of time trying to help. |
20:41:27 | * | filcuc joined #nim |
20:43:24 | * | oculuxe joined #nim |
20:44:54 | * | narimiran quit (Ping timeout: 240 seconds) |
20:45:13 | * | oculux quit (Ping timeout: 264 seconds) |
20:47:32 | * | ryan_ joined #nim |
20:48:53 | * | Tlongir quit (Ping timeout: 258 seconds) |
20:55:21 | * | inv2004 quit (Ping timeout: 250 seconds) |
20:55:36 | shashlick | I'd appreciate issue reports if you do encounter stuff |
20:56:05 | FromDiscord | <Recruit_main707> dont worry, ive just parked it for a while |
20:56:38 | shashlick | ya i mean in general to everyone |
20:57:34 | shashlick | its getting old hearing about errors and bugs with no actual issues to tackle |
20:58:19 | shashlick | @awr1 - if the wrappers aren't changing across platforms, you can cache the output in your repo |
20:58:44 | leorize | I saw that issue with nimterop/plugin on nimph installation, has it been fixed? |
20:59:09 | shashlick | no not yet - there's multiple issues with that |
20:59:41 | leorize | until that's fixed I can't trust having nimterop as a dependency, sorry :/ |
20:59:42 | FromGitter | <awr1> what do you mean? |
20:59:48 | shashlick | first need to get Nim flags with std/compilersettings |
21:00:14 | shashlick | but i'm not sure if http://nim.cf also gets picked up by that |
21:00:48 | leorize | I got hit once and the only way out was to keep trying until it starts to work |
21:01:18 | shashlick | you don't use nimble either? |
21:01:29 | FromGitter | <awr1> what issue exists with niph and nimterop |
21:01:31 | shashlick | or overriding nimble dir? |
21:01:32 | FromGitter | <awr1> *nimph |
21:02:13 | leorize | shashlick: yea, was overriding nimble dir |
21:02:58 | shashlick | on the nimterop tracker, 154 - though disruptek could use nimgit2 with static link instead, and 153 |
21:03:38 | shashlick | issue is that nimterop builds a plugin by calling nim but doesn't yet know that nimcache, path or other nim compiler settings are tweaked |
21:04:07 | shashlick | so if you change your nimble dir, the top level nim command will pick it up but not nimterop |
21:05:06 | FromGitter | <awr1> should the nim compiler expose a const or something for the nimble directory then |
21:05:29 | shashlick | it is available now with std/compilesettings |
21:05:36 | shashlick | but nimterop needs to use it |
21:05:44 | leorize | shashlick: isn't having binaries in the project cache dir the right thing to do? |
21:06:16 | * | oculuxe quit (Ping timeout: 256 seconds) |
21:06:18 | leorize | I'd be worried if I have to clear my XDG_DATA_HOME/nimterop if something went wrong |
21:06:34 | FromGitter | <awr1> oh i see. i thought there was something like that already but it's `compileOption` - only getting a bool back, not querying a string |
21:06:52 | shashlick | the thing breaking disruptek there is that if you have two projects using nimgit2 and one of them deleted the cache, the other one's binary stops working |
21:07:03 | * | qwertfisch quit (Quit: ZNC - http://znc.in) |
21:07:04 | shashlick | i suggested static linking but that might not always be desirable |
21:07:15 | * | oculux joined #nim |
21:07:18 | shashlick | the way i made nimbass is to use standard linking instead of dynlib |
21:07:31 | shashlick | https://github.com/genotrance/nimbass/blob/nimterop/nimbass/bass.nim#L59 |
21:07:35 | leorize | static linking please, this install to $XDG_DATA_HOME is tacky as hell |
21:07:48 | shashlick | so that the end user can move the binary and take the so/dll with it |
21:07:52 | shashlick | and use standard lib loading |
21:08:25 | * | PMunch quit (Quit: leaving) |
21:09:15 | shashlick | https://github.com/nim-lang/RFCs/issues/58 is similar in motivation |
21:09:16 | disbot | ➥ RFC: change `dynlib` handling on linux to use standard dynamic linking instead of runtime loading via `dlopen` |
21:09:27 | shashlick | i might have to change nimarchive and nimgit2 to do the same |
21:09:49 | shashlick | by default, library will link with -l and then its up to the user to move the binary dlls to wherever and set LD_LIBRARY_PATH |
21:10:02 | leorize | note that standard linking assumes that libraries are in standard locations |
21:10:04 | shashlick | it's not pretty though - see the nimbass test file |
21:10:19 | shashlick | https://github.com/genotrance/nimbass/blob/nimterop/nimbass.nimble#L16 |
21:10:43 | shashlick | ya and if you did want to use std locations then why download and build to nimcache |
21:10:52 | shashlick | you can just -d:git2Std and nimterop will find the standard stuff |
21:11:05 | shashlick | so i don't yet know how to solve that one |
21:11:19 | Araq | clyybber: I cannot open your link but my implementation is faithful to the algorithm in the paper modulo its very many typos |
21:11:40 | leorize | shashlick: go all in on static linking |
21:11:47 | leorize | it works, and you don't have to deal with the .so mess |
21:12:00 | Araq | and feel free to debug it against hamming.nim to find the problem |
21:12:04 | leorize | dynamic linking then hide the library is a recipe for disaster |
21:13:07 | leorize | linux distributions has yet to solve this problem after who knows how long |
21:15:07 | shashlick | Ya but for like nimbass which only have a dll |
21:15:14 | leorize | if you want to support dynamic linking, force the user to specify where the resulting library will be |
21:15:16 | shashlick | What do you think of the approach |
21:15:41 | leorize | static vs shared is not a minor difference that you can just mask over |
21:15:52 | leorize | if you produce only an exe, then the user will only copy the exe |
21:16:11 | shashlick | Hmm |
21:16:17 | leorize | you got to produce both the exe and the dll at the same place, then the user will copy both |
21:16:48 | shashlick | See the nimbass readme, is that okay? |
21:17:44 | leorize | I don't think so, this is unreliable |
21:17:47 | FromDiscord | <clyybber> Araq: Ok, I will do so tomorrow. |
21:18:16 | FromDiscord | <clyybber> Araq: scihub.tw is dns blocked on vodafone/kabeldeutschland and probably some others too. Had to change my dns to access it |
21:19:15 | shashlick | So if shared lib, user has to specify where the lib should be copied? |
21:19:26 | FromDiscord | <clyybber> awr1: What does it need nimterop for? |
21:19:32 | leorize | IMO anything that rely on things outside of the scoped environment of your build is prone to breakage |
21:19:44 | shashlick | That works on windows but for posix it won't run unless user uses ld library etc |
21:20:02 | leorize | well it still wouldn't run even if you put it in ~/.nimble |
21:20:19 | * | inv2004 joined #nim |
21:21:02 | leorize | *nix have a trick for this, but it's not really welcomed |
21:21:13 | shashlick | Does posix have no solution for this? |
21:21:17 | shashlick | Rpath? |
21:21:37 | leorize | if you link with `-rpath $ORIGIN` (note the `$`), then the binary will look for libraries in it's directory |
21:21:47 | leorize | the `$` must not be escaped :) |
21:21:54 | leorize | sorry, must be escaped |
21:22:15 | leorize | it's a PITA with any shell-based build system |
21:22:30 | leorize | I heard `-rpath $$ORIGIN` is a common walkaround |
21:22:40 | * | Vladar quit (Quit: Leaving) |
21:25:00 | * | inv2004 quit (Client Quit) |
21:32:26 | leorize[m] | I think when you design a system like nimterop, you should strive for the most deterministic behavior |
21:34:08 | leorize[m] | for dynamic libraries, you can follow the example of most C/C++ build systems, build them in the cache with the same flags as the project, then copy them to somewhere that's easy to be seen |
21:34:25 | * | hax-scramper quit (Ping timeout: 264 seconds) |
21:34:36 | * | hax-scramper joined #nim |
21:35:25 | leorize[m] | you can default to `--passL:-Wl,-rpath,$$ORIGIN` to make the binary look for libraries next to it |
21:36:05 | leorize[m] | and for bigger libraries, say LLVM, this would be needed to keep the collection of helper libraries in one place |
21:36:40 | leorize[m] | `$$ORIGIN/lib` is also an usable pattern IMO |
21:39:36 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
21:39:38 | * | natrys quit (Ping timeout: 256 seconds) |
21:39:49 | * | solitudesf quit (Ping timeout: 264 seconds) |
21:40:40 | FromGitter | <awr1> i've used the rpath thing before, it works |
21:40:53 | FromGitter | <awr1> it makes the lib loader work more like windows |
21:43:38 | * | ryan_ quit (Remote host closed the connection) |
21:43:58 | * | ryan_ joined #nim |
21:44:23 | zedeus | has anyone succeeded in statically linking openssl with mingw? i've gotten pretty close but `SslLibraryInit()` returns 0 |
21:44:36 | FromGitter | <bung87> I will create pr has bugfix cross maybe 3 libs, what's the correct steps? |
21:45:15 | * | junland quit (Quit: %ZNC Disconnected%) |
21:45:31 | FromGitter | <bung87> that might have breaking change |
21:45:46 | * | FromDiscord_ joined #nim |
21:46:00 | * | junland joined #nim |
21:47:12 | * | filcuc quit (Quit: Konversation terminated!) |
21:48:18 | FromGitter | <bung87> @Araq still there? |
21:48:41 | zedeus | nvm I forgot to do --dynlibOverride:ssl, got it working now |
21:49:51 | * | FromDiscord quit (Ping timeout: 265 seconds) |
21:49:53 | Araq | bung87: what do you mean? |
21:51:42 | leorize | Araq: how does `=destroy` binding work? do I have to export it or can I keep it private? |
21:51:43 | disruptek | Araq: shouldn't the warshall's algo stuff use a distinct type so it doesn't overflow? |
21:51:50 | FromGitter | <bung87> may disscuss first? or just create the PR? |
21:52:11 | Araq | discuss it first |
21:52:21 | Araq | leorize: keep it private |
21:52:29 | * | natrys joined #nim |
21:52:54 | Araq | disruptek: what's warshall's algo again? |
21:52:56 | leorize | does `=destroy` to finalizer transformation work for generic `=destroy`? |
21:53:30 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/9y7t/Screenshot-2020-04-23-at-5.53.02-AM.png) |
21:53:45 | FromGitter | <bung87> I will commented these lines |
21:53:55 | disruptek | Araq: dirty a graph's deps. |
21:54:16 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/7xyn/Screenshot-2020-04-23-at-5.54.05-AM.png) |
21:54:22 | disruptek | it's nothing to reall worry about. |
21:54:33 | FromGitter | <bung87> make it not self closing |
21:54:38 | Araq | leorize: I hope so |
21:55:53 | Araq | bung87: that's a breaking change |
21:56:54 | FromGitter | <bung87> I locally test the html file parse as well as expected. |
22:02:39 | Araq | huh? you want to change how the html parser handles certain constructs |
22:02:47 | Araq | so obviously it's a breaking change |
22:03:21 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/MAIB/Screenshot-2020-04-23-at-6.01.39-AM.png) |
22:03:21 | FromGitter | <bung87> also these lines, semantic checks not readlly need, and wrongly reporting errors |
22:03:51 | FromGitter | <bung87> yeah , when do this it can correct parse html, but loss semantic checks feature |
22:04:52 | Araq | move htmlparser to fusion please and give it a better test suite |
22:05:39 | * | tane quit (Quit: Leaving) |
22:07:08 | FromDiscord_ | <mratsim> Github just push their notification changes to everyone :/ |
22:07:10 | FromGitter | <bung87> ok how to "move htmlparser to fusion" |
22:07:27 | * | rufusROFLpunch joined #nim |
22:08:16 | * | rufusROFLpunch left #nim (#nim) |
22:08:17 | * | letto_ joined #nim |
22:09:27 | FromGitter | <kdheepak> Is there a way to run a task on `nimble install` on the user's machine? |
22:09:44 | * | CcxWrk quit (Ping timeout: 256 seconds) |
22:10:25 | * | letto quit (Ping timeout: 264 seconds) |
22:10:29 | FromGitter | <kdheepak> I'm wrapping a C library and need to download the appropriate libraries that need to be present during dynamic linking at runtime. |
22:10:44 | shashlick | The are before and after install hooks |
22:10:44 | * | natrys quit (Quit: natrys) |
22:11:04 | FromGitter | <kdheepak> got it! I think the before hooks are what I want. |
22:11:50 | FromGitter | <bung87> I might move the modified libs to a new repo , then see where to put |
22:11:54 | shashlick | Note that it's not without its issues |
22:12:56 | shashlick | See the issue tracker if you run into issues |
22:13:15 | * | opal quit (Remote host closed the connection) |
22:14:29 | * | opal joined #nim |
22:17:39 | leorize | Araq: so no, generic destructor -> finalizer doesn't work |
22:19:18 | FromGitter | <awr1> @leorize what were you going to say in regards to the nimterop caching earlier |
22:20:27 | FromGitter | <awr1> i'm sorry i meant @shashlick |
22:20:31 | nerdrat[m] | <shashlick "nerdrat: i think this is the sec"> Well 0.4.0 Also works as expected same machine. I'll keep testing. |
22:21:01 | shashlick | Frankly this dll thing isn't really a nimterop issue cause it really is the library writers job to decide what to do with the dll they build |
22:21:47 | shashlick | Reason I'm affected is cause I make wrappers too so they kind of need to set an example of best practices so getting it right is important |
22:22:35 | shashlick | @awr1 sorry I missed the context |
22:23:04 | shashlick | @nerdrat[m] same with your message, don't see the full context |
22:23:47 | FromGitter | <Bennyelg> Error: attempting to call undeclared routine: 'dup' |
22:23:56 | FromGitter | <Bennyelg> when using example of version 1.2 |
22:24:02 | leorize | Araq: destroy is bound on the first object construction? I have a destroy at the end of the file and now I gotta bring it up |
22:24:10 | leorize | Bennyelg: import sugar |
22:24:37 | leorize | it's noted on the changelog :P |
22:24:45 | FromGitter | <Bennyelg> need to edit the docs |
22:24:47 | FromGitter | <Bennyelg> thanks |
22:24:51 | FromGitter | <awr1> you said something about caching the output of the headers - in regards to my intrinsics library - inside my repo |
22:28:03 | nerdrat[m] | shashlick: About the choosenim "corrupted nim installation" issue. |
22:29:55 | Araq | leorize: well you need to instantiate the generic |
22:30:26 | shashlick | @awr1 ah okay |
22:30:42 | leorize | Araq: it gives me an error about wrong definition |
22:31:01 | shashlick | if the wrapper output won't change across distro or OS, you could use cDebug() to print it out and save it to a file which could be checked into source controlt |
22:31:12 | leorize | Araq: the definition was: proc `=destroy`[T: AsyncPipeObj | PipeObj](p: var T) |
22:31:14 | shashlick | that way you don't need to depend on nimterop as the end user or run it at compile time |
22:31:37 | leorize | the compiler said it expects: proc `=destroy`[T: object](var T) :P |
22:31:43 | shashlick | problem though is that these are compiler specific extensions and having a generic wrapper that works on multiple versions of compilers across OS is probably not realistic |
22:32:31 | FromGitter | <awr1> Hmm maybe. The intrinsics are weird though. The outward interface is supposed to work on multiple compilers (GCC and Clang and MSVC) |
22:32:36 | shashlick | @nerdrat[m] so nimarchive was introduced in 0.5.0 so the fact that it works but 0.6.0 does not is weird |
22:33:06 | FromGitter | <awr1> even if their implementation internally depends on compiler specific internals |
22:33:08 | shashlick | it could be a build issue but both versions of choosenim were built by the CI automatically |
22:33:40 | shashlick | @awr1 - I've documented my opinion on the nimterop readme in the later sections on compile time |
22:34:03 | shashlick | I don't think of it as different than cmake or some other tool that's required at build time |
22:34:12 | shashlick | but if you don't need to depend on it, why not |
22:34:27 | shashlick | it might be more work for you to ensure that the wrappers work predictably though |
22:34:38 | shashlick | might have to add more code to check for conditions, etc. |
22:36:58 | nerdrat[m] | Well I think may be something else not nimarchive if you say nothing related to extraction has been changed since 0.5.0. |
22:37:15 | FromGitter | <awr1> Maybe, I dunno. I always liked that nimterop 'just works' and has everything generated when you import it, that you don't need to have to toast things manually prior or add it as a build step |
22:37:19 | shashlick | Can you try the debug version |
22:37:25 | shashlick | It's posted on the release page |
22:37:37 | shashlick | Or compile a build locally |
22:39:20 | * | ZoomZoomZoom joined #nim |
22:39:37 | * | ZoomZoomZoom quit (Read error: Connection reset by peer) |
22:40:56 | shashlick | @awr1 I agree and I have a good success rate of getting it to work cross os - with Travis and appveyor jobs, across Nim versions |
22:41:35 | shashlick | But there are limitations |
22:41:42 | shashlick | Time and info |
22:42:04 | FromGitter | <awr1> I'm reminded of a special loader library for Vulkan for C/C++ that autogens a header from the Vulkan spec XML, and it did so with a python script and it came with a pregenerated version of the header. But the Vulkan spec changes (due to added extensions) often, so I always figured this was a bit janky |
22:42:28 | FromGitter | <awr1> the Nimterop equivalent, if sources changed, would be to just force a rebuild |
22:49:01 | shashlick | That's how it works |
22:49:02 | shashlick | Stuff is cached |
23:01:50 | * | inv2004 joined #nim |
23:01:58 | inv2004 | Good night, |
23:02:53 | inv2004 | I have one struct K = object k:ptr KP. And a lot of functions which use ptr KP. K is just wrapper for ref-counter. |
23:03:42 | inv2004 | Is it possible to make access to the K.k field easier? Becuase looks like I have to put it everywhere and it is a boilerplate |
23:09:07 | * | couven92 quit (Ping timeout: 265 seconds) |
23:12:30 | inv2004 | ... probably converter |
23:15:04 | FromDiscord_ | <exelotl> if I do "import foo" is there a proper way to have it find "foo.nim" in "$projectDir/foo/src" |
23:17:10 | FromDiscord_ | <exelotl> oh wait that path is incorrect anyways |
23:24:20 | FromDiscord_ | <exelotl> basically my project looks like this |
23:24:20 | FromDiscord_ | <exelotl> https://cdn.discordapp.com/attachments/371759389889003532/702661094262702121/unknown.png |
23:27:11 | FromDiscord_ | <exelotl> so like, I can solve it with --path:"foo/src" |
23:28:02 | * | inv2004 quit (Quit: Leaving) |
23:28:12 | FromDiscord_ | <exelotl> but then I need to do that for every new library that I add as a submodule |
23:33:51 | FromDiscord_ | <exelotl> curiously, `nim dump` doesn't seem to show any nimble paths? |
23:36:34 | shashlick | That's why there's package managers |
23:36:50 | FromDiscord_ | <Elegant Beef> to add foo to main i believe you'd need to do `../../foo/src/foo`, but yes package maangers save lives |
23:41:09 | FromDiscord_ | <exelotl> fair, was hoping to save my teammate some work so he doesn't have to remember to update all the dependencies whenever he pulls the project |
23:41:21 | FromDiscord_ | <exelotl> and also so that I can't forget to push a change in a dependency |
23:41:50 | FromDiscord_ | <exelotl> and also so that it's easy for him to change the code of a dependency that we wrote |
23:42:24 | FromDiscord_ | <Elegant Beef> Nimble supports github hosted dependancies |
23:42:29 | FromDiscord_ | <Elegant Beef> git* |
23:45:07 | FromDiscord_ | <exelotl> Truuue |
23:51:14 | * | krux02_ joined #nim |
23:55:31 | * | krux02 quit (Ping timeout: 265 seconds) |
23:55:56 | * | ftsf joined #nim |