<< 22-04-2020 >>

00:12:03FromDiscord<Varriount> Yardanico: One median blur filter, and that looks like it would make a great desktop
00:12:11Yardanicolol
00:18:24*martinium joined #nim
00:18:53martiniumHello, everyone I am glad to see all the progress Nim has made since I last used in version 0.13
00:19:06Yardanicomartinium: wow that was quite a while ago :P
00:19:17martiniumDocumentation is spectacular! So great job guys
00:19:28martiniumI am converting a python script I use at work into Nim
00:19:32*bunbunbunbunny joined #nim
00:19:33martiniumI need the performance
00:19:53martiniumpython script is still running for over 5 hours and I think Nim should be able to do it faster
00:20:00Yardanicowhat does it do?
00:21:03martiniumwe 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:27Yardanicothat mostly sounds like an IO-bound task though
00:21:39martiniumthen 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:58martiniumthen filtering to just TLS/SSL vulns with an if conditional
00:22:06martiniumso far running time for python script is 6 hours
00:22:12martiniumstill going
00:22:26martiniumwe have a lot of assets
00:22:53martiniumanyways, my question is how do you do HTTP basic authentication with httpClient in Nim?
00:23:04martiniumI am spoiled by Python's Requests lib
00:23:25Yardanicowell basic auth is just an "Authorization" header with stuff
00:23:27Yardanicohttps://stackoverflow.com/questions/47791826/how-do-i-authenticate-using-nims-httpclient-module-to-retrieve-html :P
00:24:43martiniumyeah you have to base64 encode it
00:24:57martiniumusername and password and then base64 encode it
00:25:12martinium"Authorization: Basic" is the header
00:25:25martiniumwas just wondering if there was a time saving function in Nim to handle that
00:28:55martiniumseems newProxy seems to implement what I am looking for but I don't need a connection proxy
00:29:23Yardanicowell it uses a "Proxy-Authorization" header
00:29:51martiniumyeah
00:30:05martiniumneed it to be only Authorization: Basic header instead
00:30:18martiniumguess I'll have to create a custom function to take care of that
00:35:07*couven92 quit (Quit: Client Disconnecting)
00:46:27martiniumanyone know how to import variables from a separate source file
00:46:43martiniumI am doing from file import * and it isn't reading my variables
00:48:57FromDiscord<Varriount> martinum: Are you exporting your variables, and isn't it just `import file`?
00:50:28leorizeI can see python habits peeking through :P
00:53:18martiniumhow do I export the variables so they are visible in other source file?
00:53:43Yardanicomartinium: use asterisk *
00:53:48Yardanicolike "proc test*()..."
00:54:02Yardanicoor "type MyType* = myfield*: int"
00:54:25martiniumyep that solved it
00:54:27martiniumThanks!
00:55:03skrylar[m]i had some nim support code for flatbuffers somewhere
00:55:26FromDiscord<Varriount> martinum: https://gist.github.com/Varriount/bacbcb5af7e75f686249eec3a94195f5
00:56:06skrylar[m]@Recruit_main707 https://github.com/Skrylar/skflatbuffers
00:57:25FromDiscord<Varriount> What are flat buffers? Aren't buffers usually flat by default (being backed by arrays and all...)?
00:58:01Yardanicoxd
00:58:03skrylar[m]nah its one of those serialization formats thats largely blitting structs
00:59:03skrylar[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:10martiniumplan is to convert this: https://gist.github.com/martinium/c93119a6e4fb0bb4914fc5dfbc7c91af into Nim
01:00:12YardanicoI still think that it's mostly IO-bound
01:01:07Yardanicoand even in python you can make it much faster with async
01:01:08skrylar[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:02skrylar[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:33martiniumYardanicowouldn't IO be much faster in a compiled language regardless?
01:03:47YardanicoIO means that most of the time is spent waiting for IO
01:03:54Yardanicofor network requests or writing data
01:04:12martiniumit does the network request then processing the data then writes each row
01:04:16Yardanicowell I suppose nim version will be faster anyway but you can make python version much faster nonetheless
01:04:21martiniumseems to take a while and I have a super fast SSD
01:04:22*Faulander quit (Read error: Connection reset by peer)
01:04:48martiniumrunning for 6.5 hours elapsed so far
01:05:13martiniumif my nim converted version ends up much faster I am going to jump
01:05:17martiniumthen I'll make it async
01:05:18*Faulander joined #nim
01:05:42martiniumtext data over internet is usually super fast
01:06:05skrylar[m]i don't suppose you've put in profile tracing code yet :eyes:
01:06:43Yardanicomartinium: not when you do like millions of requests sequentially :P
01:06:55Prestigenot sure if this is a bug, but I'm getting an error with imports here: https://play.nim-lang.org/#ix=2j1r
01:07:24Yardanicowhat error
01:07:26PrestigeLine 51 says windowmanager isn't defined, but works if i import nimdow/windowmanager as windowmanager
01:07:31Yardanicooh lol wtf is /
01:07:33Yardanicooh nvm
01:08:16PrestigeI also can't import windowmanager inside that import array (lines 3-7)
01:10:19PrestigeDoes that seem off? Here's the file hierarchy: https://0x0.st/ijst.png
01:13:25Yardanicoi'm not sure but it probably happens because you have "a/b" inside of [] import
01:14:06Prestigeweird because that syntax is working on its own
01:15:11Yardanicowell idk if you really can use it like that in brackets :P
01:15:15Yardanicoi've never seen that
01:17:06martiniumsuccess, authentication and API calls working good
01:17:27martiniumare the methods for the asyncHttpClient roughly the same as non async?
01:18:15Yardanicoyes, but you need to call them in an async context
01:18:42Yardanicoand 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:53martiniumto 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:11PrestigeHm well Yardanico if I change it to this, I still have to use `as windowmanager` https://play.nim-lang.org/#ix=2j1u
01:21:23Yardanicomartinium: 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:26Yardanicoand then parseJson it
01:21:56YardanicoPrestige: well maybe compiler is confused so it reports "not used"
01:22:04Yardanicobut does it work with the first way?
01:22:10martiniumI did this and printed to std out using req.body() in echo function to see if response was good
01:22:11martiniumvar req = client.request(url, httpMethod=HttpGet, multipart=data)
01:22:44Prestigewith a/b inside the array? Yes that works Yardanico
01:30:10FromDiscord<Elegant Beef> Prestige do you know how to get requests of full screen/floating?
01:30:23martiniumhow can I deal with this error Error: unhandled exception: input(1, 5) Error: string literal as key expected [JsonParsingError]
01:30:37PrestigeNah haven't looked into it yet Elegant Beef
01:30:42Prestigeabout to finish up user config stuff
01:30:55FromDiscord<Elegant Beef> Ah im just about to go to user config stuff 😄
01:31:02disruptekmartinium: fix your js encoder to follow the standard.
01:31:06FromDiscord<Elegant Beef> Current progresshttps://streamable.com/gzztzv
01:31:21disruptekbeef: is this wayland or...?
01:31:32FromDiscord<Elegant Beef> xlib
01:31:39PrestigeNice Elegant Beef
01:31:54disruptekthere's that troubled pupper.
01:32:04PrestigeI haven't actually started on anything with window management yet, just config for key bindings
01:32:07martiniumI have no clue how I would fix that
01:32:09martiniumlol
01:32:09FromDiscord<Elegant Beef> I mean he knows i've talked to you, he's just worried about me
01:32:11martinium:)
01:32:39disruptekpipe it through jq i guess.
01:32:43martiniumdoing this
01:32:44martiniumlet jsonNode = parseJson("{req.body()}")
01:32:48FromDiscord<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:58disruptekor use npeg.
01:33:05Yardanicomartinium: nim has string interpolation, but not in all literals :)
01:33:16Yardanicolet node = parseJson(req.body)
01:33:29FromDiscord<Elegant Beef> Then after the config i get to figure out how to make nimscriptable imgui widgets 😄
01:33:33martiniumI was just following example
01:33:40martiniumthey had quotes around it etc
01:34:21Yardanicomartinium: where?
01:34:54Yardanicoif 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:56martiniumfrom here https://nim-lang.org/docs/json.html
01:35:05martiniumI should have paid closer attention since it was literally literals in there
01:35:08martiniumhaha
01:36:51martiniumso that fix worked but it ignored my multipart query
01:37:00martiniumit only iterated through 10
01:37:12martiniumapi response default is 10 max is 500
01:37:28martiniumI added the filter for it to be 500 so weird that the loop only did 10
01:37:39disruptekmaybe it got tired.
01:38:06disrupteki usually need a sip of something between 6 and 8.
01:38:26*endragor joined #nim
01:38:57martiniumprobably
01:41:49*Tlongir joined #nim
01:44:25*dadada quit (Ping timeout: 250 seconds)
01:47:40martiniumwow my python processing finally finished
01:47:45martiniumtook it 7 hours
01:47:50martinium....
01:48:17PrestigeElegant Beef: I just finished user config, aside from dynamically loading the file's location
01:48:20martiniumNim save meeeee
01:48:23Prestigehttps://github.com/avahe-kellenberger/nimdow <- using toml
01:50:39martiniumanyone create a library like this for Nim yet? http://zetcode.com/python/prettytable/
01:51:02martiniumif not I may take it upon myself when I come to grips with the language enough
01:51:34Yardanicothere's https://github.com/xmonader/nim-terminaltables
01:52:48martiniumah perfect
01:52:50martiniumsame thing
01:54:48*bunbunbunbunny quit (Ping timeout: 256 seconds)
01:55:50*endragor quit (Remote host closed the connection)
01:56:26martiniumdoes nim allow you to create empty hashmaps and empty lists?
01:56:36Yardanicomartinium: of course
01:56:48disrupteksince when?
01:56:59Yardanicovar myemptyseq = newSeq[string]() for an empty sequence of strings
01:57:10martiniumI am trying to declare an empty list as var id_lst = @[]
01:57:14Yardanicoyou need a type
01:57:21Yardaniconim can't infer type in that example
01:57:39Yardanicoso you either do var id_lst: seq[mytype] = @[] or var id_lst = newSeq[mytype]()
01:58:01martiniumah I see
01:58:09martiniumsame thing for a hashmap or slightly different?
01:58:21Yardanicoit's called "table" in nim, "tables" module
01:58:40Yardanicoif you need value semantics, var tabl = initTable[keytype, valtype]()
01:58:49Yardanicoif ref semantics - var tabl = newTable[keytype, valtype]()
01:59:42martiniumThanks, this will save me some googling
02:00:15Yardanicono need for googling
02:00:15Yardanicohttps://nim-lang.org/docs/tables.html
02:00:28disruptekWHEN DID WE GET DOCS?
02:00:45martiniumI will say the docs have improved substantially since I was here last
02:00:49martinium0.13 was a while back
02:00:54martiniumback then they were good also
02:01:03martiniumbut 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:02martiniumcan a table have multiple value types if so how?
02:05:08Yardanicono
02:05:18Yardanicowhat's your use case?
02:05:28disruptekuse a variant object.
02:05:45*dadada joined #nim
02:06:08*dadada is now known as Guest15539
02:08:20martiniumonly thinking of json since it has diff value types
02:08:36disruptekthat a negatory, ace.
02:08:37FromDiscord<Elegant Beef> lol prestige, dynamic file location is silly, just for `~/.config/wmname/wmname.configextension`
02:08:38martiniumbut nim has specific json types for jsonNode already
02:08:56Yardanicomartinium: you can use json module, yes
02:09:01disruptekno, they are all type JsonNode.
02:09:08Yardanicoalso, why do you really need that?
02:09:19*bunbunbunbunny joined #nim
02:10:11PrestigeAtm I just load config.default.toml from the project Beef
02:10:20FromDiscord<Elegant Beef> ah
02:10:38FromDiscord<Elegant Beef> Im also going to use toml, since embedded nimscript seems very limited for what i wanted
02:10:43FromDiscord<Elegant Beef> and i cant be arsed to expand it
02:10:53FromDiscord<Elegant Beef> So widgets will end in a burning ring of fire
02:10:56PrestigeI'm going to have a global default config, and a user config that will be in ~/.config/nimdow/
02:10:58FromDiscord<Elegant Beef> or i just use a different bar
02:10:59Yardanicoit's much less limited than TOML though :P
02:11:20FromDiscord<Elegant Beef> Yea but i wanted to pass types from nimscript to nim but it's currently not possible
02:11:29Yardanicowdym "types"?
02:11:40FromDiscord<Elegant Beef> Constructed objects
02:12:28PrestigeReading PMunch's code that uses NimNodes is hurting my brain
02:13:18Yardanicoyou mean macros
02:13:33disruptekget him to read it for you; he has a voice like liquid sex and thighs that just won't quit.
02:13:33PrestigeYeah, using NimNodes and quote do
02:13:41Prestigelmao disruptek
02:14:01disruptekwhat?
02:14:14PrestigeIt was a very funny sentence
02:14:25PrestigeI think he and I are going to talk about the code this weekend but yeah
02:14:44disrupteki never knew what they meant by "a dancer's hips" until i met pmunch.
02:15:20Yardanicodisruptek: your voice is very nice too :P
02:15:26disruptekawww
02:16:02martiniumwhat is the proper way to add url query params?
02:16:15martiniumI mistakenly used Add()
02:16:39martiniumon a newMultiPartData() object
02:16:47Yardanicoconcat
02:16:57*muffindrake quit (Ping timeout: 272 seconds)
02:17:02Yardanicostring concatenation :P if you mean for get requests
02:17:14martiniumyeah
02:17:19martiniumso manually?
02:17:28disruptekthere's an encodeQuery iirc.
02:17:36martiniumlet me look that up
02:17:38Yardanicoah yes
02:17:43Yardanicothere is, in "uri" module
02:18:06martiniumhttps://nim-lang.org/docs/uri.html#encodeQuery%2CopenArray%5B%5D
02:18:09martiniumyep
02:18:15martiniumhave to import uri module
02:18:19disruptekFUCK
02:18:44disruptekit's just one thing after another with this fucking language.
02:18:48Yardanicodisruptek: i see you're not in a good mood today xd
02:18:51*muffindrake joined #nim
02:19:04disruptekmy balls are throbbin', that's for damn sure.
02:19:19disruptekyou know what i hate about uri?
02:19:55Yardanicowat
02:19:59*endragor joined #nim
02:20:09disruptekit defines Url and doesn't use it for shit.
02:20:17disruptekfucking useless.
02:20:27Yardanicolol actually yes
02:20:28Yardanicoxdd
02:21:01Yardanicoit's there for at least 6 years
02:21:05disrupteki need an ice pack; those brazilians did a number on the ol' plums.
02:21:18Yardanicohttps://github.com/nim-lang/Nim/commit/cf87759e2911cb44aaf1e107f20417df74d2a606
02:21:23Yardanicoit was actually used!
02:21:24Yardanicoin the past
02:21:38disruptekgreat, that really helps.
02:23:12FromDiscord<Elegant Beef> prestige are you using the toml nimble package?
02:23:27disrupteki done tol' you not to use that shit.
02:23:33FromDiscord<Elegant Beef> You didnt tell me
02:23:40Yardanicodisruptek: I think toml is fine :P
02:23:41Prestigeparsetoml
02:23:41FromDiscord<Elegant Beef> Also you cant use said shit cause it doesnt install
02:23:51Yardanico"parsetoml"
02:23:53FromDiscord<Elegant Beef> No issues installing it?
02:24:06Prestigenah, I just nimble install parsetoml
02:24:15FromDiscord<Elegant Beef> Well it seems to not like me then
02:24:18disruptekit cannot parse what it writes, and what it writes is not pretty.
02:24:24disruptekso you may as well use json.
02:24:29PrestigeI couldn't build with nimble after adding parsetoml to my repo tho, idk why
02:24:35Yardanicohow did you add it
02:24:35Prestigeso I just used nim c
02:24:38Yardanicoand what's the error
02:24:44Prestigelet me check
02:24:44disrupteknimble is for chumps.
02:24:55FromDiscord<Elegant Beef> https://hatebin.com/srmuqruiib
02:24:58FromGitter<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:58FromDiscord<Elegant Beef> My issue
02:25:15FromGitter<kaushalmodi> I have use parsetoml in lot of my projects.. reads/writes toml just fine
02:25:17Prestigesrc/nimdowpkg/config/config.nim(3, 3) Error: cannot open file: parsetoml
02:25:35disrupteki tried using toml for nimph's lockfiles. i dunno; maybe i'm an idiot.
02:25:35Prestigeseems like a nimble issue to me
02:25:51Yardanicotry to reinstall it I guess
02:26:08Yardanicohere it's proper "modern" nimble syntax https://github.com/NimParsers/parsetoml/blob/master/parsetoml.nimble
02:26:12PrestigeYardanico: it works if I compile it manually with nim, just not if I try compiling with `nimble build`
02:26:20Prestigehttps://github.com/avahe-kellenberger/nimdow if you wanted to see
02:26:21Yardanicohow is it specified in your .nimble file
02:26:38Yardanicoyou should add requires "parsetoml"
02:26:38Prestigeexec "nim c src/nimdow.nim"
02:26:47Prestigeoh neat
02:26:53Prestigethanks, I forgot about that
02:27:02martiniumthis URI stuff is annoying
02:27:04martiniumugh
02:27:06Yardanicoalso why gplv2 ? :P just a friendly question
02:27:26Yardanicoah there's no license at all so it's all rights reserved, sorry :P
02:27:29disruptekkaushalmodi: got a sample project to share?
02:27:43PrestigeI should attach the license just haven't bothered
02:27:59Yardanicowell by default if some repo on github has code and no license it means that it's "all rights reserved"
02:28:00FromDiscord<Elegant Beef> MIT or broke 😄
02:28:04Yardanicoso you can look at the source but not use it
02:28:08Yardanicowithout the permission of the owner
02:28:12FromDiscord<Elegant Beef> Yea i fucking hate it
02:28:17FromDiscord<Elegant Beef> Nim embedded is also like that
02:28:24FromDiscord<Elegant Beef> nimscript*
02:28:24PrestigeI'll go add it then
02:28:33Yardanicohttps://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:47PrestigeYeah, I just was lazy
02:28:52PrestigeI usually add the license
02:29:16leorizeI'm going for MPL nowadays
02:29:20leorizeMIT is too lax
02:30:21FromDiscord<Yardanico> Yeah MPL is kinda nice too
02:30:45martiniumfound what I needed
02:30:46martiniumhttps://nim-lang.org/docs/uri.html#%3F%2CUri%2CopenArray%5B%5D
02:30:53martiniumthat's a useful proc
02:31:20FromDiscord<Elegant Beef> Prestige what nim version are you running?
02:31:33Prestige1.2.0
02:31:46FromDiscord<Elegant Beef> Ok so then i have no clue why i cant install this
02:31:57Prestigeu can't nimble install parsetoml?
02:32:07PrestigeI did install nim with choosenim btw, if that makes a difference
02:32:15FromDiscord<Elegant Beef> I did too
02:32:39FromDiscord<Elegant Beef> so just for fun i did sudo and it installed
02:32:45PrestigeO.o
02:33:12Prestigeweird permissions maybe, did u get an error when installing normally?
02:33:27FromDiscord<Elegant Beef> i got an error but nothing complaining about permissions
02:33:32disruptekdon't use sudo, chuckles.
02:33:41FromDiscord<Elegant Beef> Oh i know disruptek
02:33:54PrestigeWhat error?
02:33:57FromDiscord<Elegant Beef> It's more of a "does this change anything" and less of a solution
02:34:03FromDiscord<Elegant Beef> I already posted it up ther
02:34:06FromDiscord<Elegant Beef> there*
02:34:21PrestigeYardanico: about gpl2, I just agree with the ideology
02:35:04FromDiscord<Elegant Beef> Doesnt gpl2 remove a fair bit of freedom from the software?
02:35:13FromDiscord<Elegant Beef> Requiring changes to be open sourced
02:35:18Prestigeas opposed to something like bsd, yeah
02:36:14FromDiscord<Varriount> GPL for applications, bsd/mit for libraries
02:36:35Prestigeeh
02:36:40Prestigematter of opinion
02:37:42FromDiscord<Varriount> I have yet to see many (any?) companies do the things the GPL protects against with regards to libraries.
02:37:42FromDiscord<Elegant Beef> Idk feels sorta silly imo to publish anything openly whilst preventing reuse of anything in it
02:38:01Prestigewdym?
02:38:39FromDiscord<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:46FromDiscord<Elegant Beef> Atleast the way i understand it
02:38:56Prestigewell just the last part, yes
02:38:58leorizewell sometimes that's exactly what people want
02:39:08disruptekhookers and blow?
02:40:00FromDiscord<Elegant Beef> Liberty, and prosperity?
02:40:32FromGitter<kaushalmodi> disruptek: ⏎ ⏎ > got a sample project to share? ⏎ ⏎ No, all are company-internal [https://gitter.im/nim-lang/Nim?at=5e9fae9f35a35031bf79e5ac]
02:40:51FromDiscord<Elegant Beef> That's a terrible quote system 😄
02:40:52disruptekyou make me sad.
02:41:07FromDiscord<Elegant Beef> Good
02:41:31disruptekwell, my toml effort is in nimph's git history.
02:41:32rockcaveramy devel version is not compiling. ;`(
02:42:09FromDiscord<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:10Prestigebasically it boils down to me not support proprietary software
02:42:13rockcaverahttps://pastebin.com/Wr1bQFD3
02:42:24Prestigesupporting*
02:42:41leorizeVarriount: you are allowed to use gpl for things you don't release, like internal tools
02:43:14FromDiscord<Varriount> Leorize: Yes, but the phrase there is "don't release"
02:43:27disruptekrockcavera: is this new?
02:43:33rockcaverayes
02:43:37rockcaveranow
02:43:42leorizeVarriount: 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:44disruptekyou usually use gcc on windows?
02:43:51FromGitter<kaushalmodi> disruptek: here's an old public project using parsetoml: https://github.com/kaushalmodi/nbuild/blob/master/src/nbuild.nim
02:43:52rockcaverayes, gcc
02:44:12FromDiscord<Varriount> leorize: And what do I do when my company wants to distribute said tool?
02:44:26FromDiscord<Varriount> (to customers)
02:44:31leorizetell them to release the source? :P
02:44:38FromGitter<bung87> why the htmlparser $html result a document element
02:45:21FromDiscord<Varriount> leorize: Yes, I'm sure that would just make the manager's day.
02:45:45leorizelol
02:45:55disruptekrockcavera: reproduced on linux.
02:46:08*endragor quit (Remote host closed the connection)
02:46:31rockcaveradisruptek, so less bad.
02:46:37disruptekyeah.
02:47:00disruptekthis commit hash works: 1b6c4ed2ba29f855b47ff295515b54c9ae4edafa
02:47:30*endragor joined #nim
02:48:14*dddddd quit (Ping timeout: 256 seconds)
02:50:31FromGitter<kaushalmodi> disrupek: for the issue you faced with parsetoml, can you open an issue on its repo?
02:52:01FromGitter<sealmove> federico3 you here?
02:52:05*endragor quit (Ping timeout: 265 seconds)
02:52:55disrupteksomeone can merge #14063 to fix devel.
02:52:56disbothttps://github.com/nim-lang/Nim/pull/14063 -- 3fix typo preventing build
02:53:09disruptekuh, i can open an issue maybe, sure.
02:53:42disrupteknot 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:26martiniumneed help with this error
02:55:28martiniumtype 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:28martiniumJsonNode14 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:47martiniumseems like it wants a generic type
02:56:08disruptekitem["id"].getInt most likely.
02:56:12martiniumI am trying to pass a value from one of the json keys in each iteration
02:56:16martiniumok let me try that
02:56:30disruptekconfidence intensifies
02:56:40martiniumworks
02:56:48martiniumso you have to be more explicit
02:56:52martiniumin this language
02:57:10disruptekno; JsonNode is a type. getInt unpacks the int value from it.
02:57:18disruptekgetInt() i should say.
02:57:25disruptekfor one alternative, see
02:57:27disruptek!repo jsonconvert
02:57:29disbothttps://github.com/disruptek/jsonconvert -- 9jsonconvert: 11lazy json node conversion 15 2⭐ 0🍴
02:58:26disruptekthe language is typed, sure; this is a wonderful feature.
02:58:39martiniumyes, will help avoid a lot of errors
02:58:52rockcaveradisruptek, with your pull you compiled normally.
02:59:05disruptekyes.
02:59:11martiniumdoes the $ stringify values
02:59:11martinium?
02:59:14disruptekyes.
02:59:20martiniumbeautiful
02:59:26martiniumso concise
02:59:26disruptekwhen it is defined for the type, that is.
02:59:36disruptekit is a proc such as any other.
03:00:03martiniumits the functions mannnnn
03:00:18disruptekdude.
03:01:30disruptekvarriount: you up
03:01:57shashlickdisruptek did you think more about our conversation the other day
03:02:11disruptekyeah.
03:02:28shashlickAnd feedback?
03:02:31disrupteki'm not interested in a 3-way at this time.
03:02:56disruptekflattered that you asked, of course.
03:04:02FromDiscord<Varriount> Disruptek: yeah
03:04:16disruptekvarriount: you get to be the hero that unbreaks the build.
03:04:24FromDiscord<Varriount> ?
03:04:28disruptekshashlick: we need to fix nimterop.
03:04:45shashlickWhat's up
03:04:47*waleee-cl quit (Quit: Connection closed for inactivity)
03:04:55shashlickI'm neck deep in it so anything goes
03:05:18disruptekalso, 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:44disrupteki could not make includes and private imports work, so yeah, there will need to be something there.
03:06:05shashlickI don't know if that's what I'm proposing, just that the interfaces should be clean and in one direction
03:06:05disruptekbut 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:21disruptekwell, no argument here.
03:06:52disruptekwrt nimterop, i'm convinced its untenable in its current run-toast-at-ct form.
03:07:13shashlickAlso, 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:16disruptekall things considered, that's my considered opinion.
03:07:37shashlickToast is getting more and more capable by itself
03:07:57FromDiscord<Varriount> How does this involve me?
03:08:03disruptekyou have merge rights.
03:08:16FromDiscord<Varriount> I do...
03:08:20disruptek"someone can merge #14063 to fix devel."
03:08:21disbothttps://github.com/nim-lang/Nim/pull/14063 -- 3fix typo preventing build
03:09:21FromDiscord<Varriount> I'll merge it, but what led to the typo in the first place?
03:09:27disruptekshashlick: if you wanna spend money, i hope you'll spend it in having ct code select from platform-specific wrappers generated aot.
03:09:35disruptekvarriount: sleepy araq
03:10:19disruptekmisbehavior ci, too, i guess.
03:10:35FromDiscord<Elegant Beef> How do we parse enums from strings in nimland?
03:10:48leorizestrutils.parseEnum
03:10:55FromDiscord<Elegant Beef> Ok thanks
03:11:03disruptekstrutils.parseEnum[SomeEnumType](somestr) is the syntax you'll need.
03:11:03skrylar[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:22shashlickAot?
03:11:26disruptekahead-of-time
03:11:50shashlickBut it only generates once after which it is cached
03:12:40disruptekthat's cool, man, but not as cool as reliable builds.
03:13:10*bunbunbunbunny joined #nim
03:13:19disruptekwe're stuck between a rock and a hard place.
03:13:36skrylar[m]did you mean reliable or reproducible
03:13:42disruptekreliable.
03:14:36shashlickdisruptek: have you read the latest nimterop readme?
03:14:44shashlicki've tried to explain the compile time pov
03:14:57skrylar[m]wasn't aware that installing packages was a hard problem these days
03:15:06disrupteki will look, but i truly believe that i understand that pov.
03:15:16shashlickthere's 3 things - platform, compiler (version) and packages (nim and C libs)
03:15:17disrupteki even shared that pov at a point.
03:15:57martiniumwhats the error here: sites_map.add(item["id"].getInt().intToStr(): item["name"].getStr())
03:16:00shashlickevery render depends on all those things so there's not really a single wrapper that can be cached
03:16:17shashlickfor simple libs, it is definitely possible
03:16:36shashlickbut without looking at the library headers in detail, there's no way to know
03:16:40disruptek, not :
03:16:54martiniumgot it
03:17:03martiniumactually just fixed before you commented woohoo
03:17:15martiniumthanks
03:17:18disrupteknot need for () on calls with at least one arg.
03:17:24shashlicki was working on PMunch's wrapper request for openssl
03:17:28disruptekrtfm re: UFCS
03:17:31disruptekyou'll love it.
03:17:47disruptekshashlick: this is exactly my point.
03:18:08shashlickwrapped 6 header files - results in 13k lines of wrapped headers
03:18:11disruptekone person has the expertise to wrap the package and the mission to maintain it across multiple platforms.
03:18:31leorizemartinium: sites_map.[item["id"].getInt.intToStr] = item["name"].getStr
03:18:31shashlickit'll work on my machine sure
03:18:37shashlickbut it won't on yours
03:19:00disruptekwell, it doesn't work for me right now. or solitude, as the case was today when he tried to build nimph.
03:19:02martiniumleorize fixed it the issue was the :
03:19:03shashlicksince you may not have some random package installed or your distro might exclude certain things from the conf
03:19:21shashlickgive me issues to work on
03:20:56disruptekthere's no point, because the design relies upon nimble and prohibits local deps.
03:21:16disruptekwhen you run nimscript in ~/.cache/nim/nimterop you don't pick up any of my compiler env.
03:21:17shashlickis it because toast isn't built?
03:21:31disruptekor w/e the hell you're running in there...
03:21:57shashlickokay, give me the commands i should run to reproduce it and i'll fix it
03:22:06disruptekand my next step is to remove nimble from nimph. which breaks nimterop.
03:22:41disruptekput --clearNimblePath in your nim.cfg and then have fun building nimph.
03:22:43shashlickit is doable - i don't have anything in the nimble file to enable build or execution
03:23:25FromDiscord<Varriount> Merged
03:23:25shashlickstep 1 - git clone nimph?
03:23:33shashlickstep 2 - bootstrap
03:23:36disruptekit's 154... it needs to go into $NIMBLE_DIR/lib
03:23:46disrupteknot ~/.cache/ ...
03:24:20disruptekchmod 0 ~/.nimble first.
03:25:05disruptekif 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:28disruptekbut honestly, this goes deeper than nimph or nimble or even nimterop.
03:25:50disruptekit doesn't make sense to have those least-qualified engineer the solution.
03:26:42shashlickso again, what are the steps
03:26:52shashlicki git clone nimph, bootstrap directly
03:27:00disruptekdid you chmod 0 ~/.nimble?
03:27:04shashlickdo i make a deps dir?
03:27:07FromDiscord<KingDarBoja> Hi fellas
03:27:26disruptekwhat's the deps dir?
03:27:58shashlickwhere should nimterop get installed?
03:29:06disruptekgot me.
03:29:28disruptekthe bootstrap still works. 🎉
03:31:02shashlick154 is on my backlog - i haven't figured out how to fix it though
03:31:41disruptekhere's a repro:
03:31:42shashlickfor nimbass, i'm now resorting to -l instead of dynlib - https://github.com/genotrance/nimbass/blob/nimterop/nimbass/bass.nim#L59
03:31:53disruptek1) clone nimph as per usual.
03:31:59disruptek2) bootstrap nimph as per usual.
03:32:01shashlickcause hard linking to ~/.cache isn't portable
03:32:13disruptek3) create a nim.cfg with these two lines:
03:32:19disruptek3a) --clearNimblePath
03:32:31disruptek3b) --nimblePath="$config/deps/pkgs/"
03:32:42disruptek4) rm -rf ~/.cache/nim/nimterop
03:32:52disruptek5) nim c src/nimph.nim
03:32:57disruptekthat's it.
03:33:14disruptek/home/adavidoff/.cache/nim/nimterop/cPlugins/nimterop_418565994.nim(1, 24) Error: cannot open file: nimterop/plugin [AssertionError] [AssertionError]
03:33:32disruptekhome/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:33Prestigeany good resources on macros? Aside from the docs
03:33:52disruptekyou can try macroutils.
03:33:55disruptek!repo macroutils
03:33:56disbothttps://github.com/PMunch/macroutils -- 9macroutils: 11A package that makes creating macros easier 15 8⭐ 1🍴
03:33:59disruptekit's new.
03:34:06disruptek!repo breeze
03:34:07disbothttps://github.com/alehander92/breeze -- 9breeze: 11a macro dsl for nim 15 37⭐ 2🍴
03:34:19disrupteksome folks use breeze, also.
03:34:23PrestigeCool, thanks. Trying to learm more about them
03:34:36skrylar[m]neat
03:35:14skrylar[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:22disruptekshashlick: i forgot; chmod 0 ~/.nimble in there, too, of course.
03:37:55disruptekfor 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:12disrupteks/probably/properly/
03:41:43shashlickwhat exactly is the goal?
03:41:50Prestigethis seems useful: https://www.youtube.com/watch?v=8SoJR3sCaR4
03:42:10shashlicki'll try out your steps
03:42:11disruptekto not have nimph stop working because i broke gittyup while developing new features for golden.
03:43:54FromDiscord<Elegant Beef> Well prestige i now have loading keybinds from a json 😄
03:44:04PrestigeNice
03:44:10PrestigeThat was fast
03:44:50FromDiscord<Elegant Beef> I mean i already had the base system in just needed to feed it data
03:45:02FromDiscord<Varriount> Victor Kirilov... I wonder if he's on this channel
03:45:26leorizeonqtam?
03:46:09FromDiscord<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:51PrestigeThis is actually a great video
03:46:54leorize[m]Varriount: he does appear when someone mentions, but not a lurker afaict
03:49:01disruptekso he's like batman?
03:49:34*rockcavera quit (Remote host closed the connection)
03:50:37FromDiscord<Elegant Beef> Well i mean batman has a symbol, so we need a viktor symbol
03:51:23disruptekis there a symbol that denotes random code that no one uses strewn across the entire compiler?
03:51:29FromDiscord<Elegant Beef> Also by the title i assume it's a video promoting the use of C++ transpiling?
03:53:42skrylar[m]disruptek: gensym?
03:55:20disruptek
04:00:05martiniumso 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:21leorize[m]@kaushalmodi: you here?
04:08:22Prestigemartinium: making async requests is faster
04:08:36FromGitter<kaushalmodi> leorize: yes
04:08:43PrestigeThey'll happen more or less at the same time, need to wait for one to return before you send another request
04:08:54martiniumjsut got a too many open files error doing it synchronously
04:09:05leorize[m]kaushalmodi: try this `echo | ./script/that/nim/generates`
04:09:25*bunbunbunbunny quit (Quit: leaving)
04:09:26martinium`Error: unhandled exception: Too many open filesAdditional info: "nodename nor servname provided, or not known" [OSError]`
04:10:43leorizekaushalmodi: 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:03FromGitter<kaushalmodi> leorize: nothing.. no output
04:11:21FromGitter<kaushalmodi> but the `stdinfile` got generated fine (with the `set -e` added to the script)
04:11:47leorizeat this point I guess it's up to gcc devs to point out the problem :P
04:12:16leorizemaybe you'll find a patch that you can just backport to your gcc 6.1
04:12:41FromGitter<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:21leorizedoes it apply to any nim file or just stdin?
04:13:27leorizealso you can just point to `inim` :P
04:13:39leorizethough I don't think that one is still being developed
04:13:51FromGitter<kaushalmodi> leorize: another observation ..
04:13:56FromGitter<kaushalmodi> `echo echo NimVersion | nim c - ` works fine
04:14:05FromGitter<kaushalmodi> but `echo echo NimVersion | nim c -r -` gives that collect2 err
04:15:06FromGitter<kaushalmodi> > does it apply to any nim file or just stdin? ⏎ ⏎ I mean `nim c -r foo.nim` works just fine
04:15:20FromGitter<kaushalmodi> It's just that I wanted this cool feature to Just Work
04:20:02leorizeI 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:32martiniumhow do I make a proc async
04:20:38martiniumused to be adding {.async.}
04:20:44martiniumthat still the way?
04:20:44leorizeimport asyncdispatch
04:20:48leorizeyea
04:20:55leorizejust remember to import asyncdispatch first
04:22:08martiniumlinter still giving me crap about {.async.}
04:22:25*endragor joined #nim
04:22:37leorizewhat's the function prototype?
04:23:10FromGitter<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:26FromGitter<kaushalmodi> so `echo echo NimVersion | nim c -` still gives the same error
04:23:43leorizetry the `echo | script` thing again?
04:24:00*Lord_Nightmare quit (Ping timeout: 256 seconds)
04:25:17martiniumlooks like now since it's an async http client it returns a future
04:25:30FromGitter<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:28leorizeout of ideas then :P
04:27:26FromGitter<kaushalmodi> thanks though for sticking with me through this debug
04:27:41FromGitter<kaushalmodi> I really hope that the fix is awesome
04:28:25*Lord_Nightmare joined #nim
04:35:12martiniumI haven't ever really done Async code
04:35:23martiniumguess I'll have to learn... :D
04:35:38FromDiscord<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:13FromDiscord<pragma> Emulator Server works with a 2D game under Flash player
04:36:35FromDiscord<pragma> who are encouraged
04:59:08*ljoonal quit (Quit: ljoonal.xyz)
04:59:57*ljoonal joined #nim
05:06:09PrestigeHm can someone explain this statement about parameters used in a template?
05:06:13Prestigehttps://youtu.be/8SoJR3sCaR4?t=880
05:06:40Prestigesince `filename` is a string, I didn't think it could get "evaluated" twice by referencing it twice
05:10:09leorizetemplate parameters are AST nodes
05:10:25leorizefor example templateCall(thisExpensiveOperation())
05:10:52leorizeand it will paste "thisExpensiveOperation()" to all the place that the param was referenced
05:11:13PrestigeVery 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:07Prestigedamn macros are cool
05:32:18FromDiscord<Elegant Beef> The entire meta programming is fancy cool features 😄
05:32:40PrestigeI'm just starting to learn about it, pretty sick.
05:32:55Prestigegoing to take a bit to get used to
05:33:29FromDiscord<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:15PrestigeBeen 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:45FromDiscord<Rika> where is nimsuggest documented?
07:15:46*kungtotte joined #nim
07:16:03FromDiscord<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:33FromGitter<alehander92> PMunch is macroutils going to fusion
07:29:42PMunchfusion?
07:29:58PMunchOh that's the Nim distribution thing?
07:30:00PMunchCool :)
07:33:00PMunchOh, you were asking if macroutils where going to fusion :P
07:33:09PMunchI dunno
07:33:14FromGitter<alehander92> well it was Araq's idea
07:33:16FromGitter<alehander92> to make fusion
07:33:21FromGitter<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:26Amun_Rawhat'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:13Faulandergood morning
07:45:17Araqdepends
07:45:40*liblq-dev joined #nim
07:45:41Faulanderif 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:57Araqhmm cooldome already fixed what I was about to work on...
07:47:07AraqFaulander, which Nim version?
07:47:41Araqah no, the bug still exists :-)
07:48:14*hax-scramper quit (Ping timeout: 240 seconds)
07:48:28FaulanderAndreas, 1.2.0
07:48:43AraqFaulander, tell PMunch
07:49:22FaulanderOT: Andreas, bist Du eigentlich Österreicher? In der Weststeiermark wo ich herkomme, gibt's viele Rumpfs :)
07:49:24*hax-scramper joined #nim
07:49:27PMunchAmun_Ra, buf = buf[pos..^1]
07:49:39AraqNö, bin Deutscher
07:49:58PMunchMaybe those Rumpfs are german?
07:49:59Amun_RaPMunch: argh, I completely forgot I can use it there, thank you
07:50:03FromGitter<alehander92> ich habe diese Worten versteen!
07:50:07PMunchAmun_Ra, no problem :)
07:50:12Faulander@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:26PMunchHmm
07:50:31PMunchOn any file?
07:50:47Faulanderat least on the one i tried, let me try another one ...
07:51:15PMunchJust tried it on a random file and it worked fine
07:52:39Faulanderon another i get: Error: new section expected
07:52:39Faulanderlineinfos.nim(249) raiseRecoverableError
07:52:39FaulanderError: unhandled exception: new section expected [ERecoverableError]
07:53:19FromGitter<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:06FromGitter<jorjun_twitter> I’ve waited 30 years for a non-nerdy language like this that exposes the power of CPU
07:54:38Faulanderjorjun: do you know the nim for python developers series? this was great for me (same background as you)
07:54:44FromGitter<sheerluck> I love this language too
07:55:44FromGitter<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:10FromGitter<jorjun_twitter> Clueless about clang and linking and build stuffs.
07:56:32FromGitter<alehander92> guys
07:56:36FromGitter<alehander92> how can i change assembler
07:56:46FromGitter<alehander92> for gcc (like the binary path for as)
07:56:51Araqdo yourself a favor and remain as clueless as possible :-) this stuff is all awful
07:56:56Faulanderwell, i am there too ... no clue about that either. but reading nim.cfg helps in understand which options the nim compiler has.
07:57:03FromGitter<jorjun_twitter> :D
07:58:11PMunch@jorjun_twitter here's a little primer on types: https://peterme.net/nim-types-originally-a-reddit-reply.html
07:58:33PMunchLike how Nim handles types on the stack/heap and such
07:58:45PMunchMight be helpful to get into the more low-level stuff in C
07:59:04FromGitter<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:37FromGitter<jorjun_twitter> Last time I tried low level was 6502 in 1985. So I will dive in. <Merci
08:00:06Faulanderi 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:12FromDiscord<Varriount> Any idea what `nimble develop` did that fixed it?
08:01:48narimiranFaulander: and if it is just to have readme.md on github — github can render .rst too :D
08:01:49PMunchFaulander, wait, what are you trying to do?
08:03:06FromGitter<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:43Araq'nimble install' usually skips the boring parts like examples or tests
08:03:50Araqor documentation
08:04:27Araqit saved less than 1MB on your disk but did cost you hours of your time, a tradeoff you should appreciate
08:05:07Araqafter 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:20FromGitter<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:15livcdAraq is snarky today :-)
08:09:36FromGitter<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:59FromGitter<jorjun_twitter> and these languages are all following Kernighan & Ritchie like baaaaah
08:12:24FromGitter<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:36ZevvAraq is right
08:12:51ZevvI hate it so much that nimble leaves out all that stuff. Why not just include the docs?
08:14:38FromDiscord<Varriount> Personally, I would rather just use nimscript
08:14:51FromGitter<jorjun_twitter> https://www.youtube.com/watch?v=H4s55GgAg0I
08:15:50FromDiscord<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:30FromDiscord<Gary M> The results at the moment are showin original Nim peaking at 620ms latency during use, and mine peaking at 95ms
08:17:05FromDiscord<Gary M> If I can prove the results under a more precise benchmark then it looks like a substantial improvement
08:18:40PrestigeI didnt know nimble didnt include docs, that's weird..
08:18:41FromGitter<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:51FromGitter<alehander92> types help imho
08:19:53FromGitter<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:12Araqjorjun_twitter: I think there is no universal law but most people eventually like static typing
08:20:16FromGitter<alehander92> people add type annotations even to dynamic languages now
08:21:00FromGitter<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:45FromDiscord<Rika> @Gary M what's up with the speed improvement? the regex?
08:21:49Araqtypes are more about "please write out what's already in your head" than they are about performance
08:21:49FromDiscord<Gary M> there's been a backlash against inheritance heavy OO I think, but composition based OO is kinda still popular
08:21:53FromGitter<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:21FromGitter<jorjun_twitter> hoping it won’t always feel like very hard work
08:22:36FromDiscord<Rika> there's typescript for a reason 😛
08:22:39FromDiscord<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:57FromGitter<jorjun_twitter> @rika for sure. Have totally moved to typescript
08:23:36FromDiscord<Gary M> my bet is on the minification though
08:24:10FromDiscord<Gary M> it's pretty easy to migrate an extension to webpack if the code doesn't conflict with minifying
08:24:16livcdI 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:33FromGitter<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:16FromDiscord<Gary M> dynamic types are great if you love silent unintended behavior /s
08:26:04Araqlivcd, now that's what I consider a compliment :-)
08:26:52PMunchBig 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:44PMunchFaulander, 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:59FromGitter<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:11PMunchIf you want to have a look at it, I'm a bit busy right now
08:28:13FromGitter<alehander92> i think nim is very fast for prototyping
08:28:47FromGitter<alehander92> i'd even say writing down signatures is an ok form of prototyping as well
08:28:50livcdYeah much faster than Go
08:29:13FromGitter<alehander92> but i agree it probably takes time to get used to it
08:29:24FromGitter<alehander92> the bigger difference with python might be metaprogramming
08:31:10livcdThe 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:33FromDiscord<Gary M> Oh that's fun
08:32:08FromGitter<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:36PMunchI use it quite heavily
08:33:17PMunchAnd 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:34PMunchhttps://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html
08:33:35FromDiscord<Gary M> I really want to learn how to do that kind of stuff, especially macros
08:33:45PMunchLike I explain in this article
08:35:01livcdMacros only for libs!
08:35:13PMunchMacros for president!
08:35:36FromGitter<alehander92> @jorjun_twitter yes, i think many django/rails concepts
08:35:52FromGitter<alehander92> can be adapted to nim with macros
08:36:16FromGitter<alehander92> sometimes it might be a bit harder, but sometimes you can do stuff that's hard to do in python/ruby
08:36:23FromGitter<alehander92> because you have access to ast/types
08:36:44FromGitter<alehander92> e.g. you can typecheck that your ORM types match your db schema on compile time
08:36:53FromGitter<alehander92> just as an example, not saying its a good plan
08:37:33FromGitter<alehander92> overally you use different code patterns to achieve the same thing, but many things are possible
08:38:31FromGitter<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:34FromGitter<jorjun_twitter> Maybe valve will cough up their new source engine and we can all dive on that..
08:40:07FromGitter<jorjun_twitter> Games have always stretched the bounds of computing, I’ve observed..
08:41:12FromGitter<jorjun_twitter> @pmunch This meta programming article is fantastic. merci
08:41:37FromDiscord<Gary M> I don't think source 2 is going to be open source 2'd
08:41:46PMunchjorjun_twitter, de rien :)
08:42:04FromDiscord<Gary M> Or really released for the public in the same way unity or unreal are
08:43:28FromGitter<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:52FromDiscord<Rika> Macro only libraries in nim where
08:44:28*ftsf joined #nim
08:44:44PMunchRika, huh?
08:45:03FromDiscord<Rika> Libraries that implement its api using only macros lol
08:45:20FromDiscord<Gary M> Source 2 has been around for years, not just for Alyx. It's the engine running DotA 2
08:45:56FromDiscord<Gary M> Since 2015
08:46:28PMunchRika, some of mine come real close :P
08:46:52FromDiscord<Gary M> Macro only nim executable when
08:47:21PMunchThat'd be interesting, an application for Nim that counts cloc, but is able to determine compile-time lines vs. runtime lines
08:47:36PMunchOr macro+template+static lines against everything ele
08:48:00FromDiscord<Rika> Sounds hard to do
08:48:07FromDiscord<Gary M> Nim executable with macros generating code entirely from config data when
08:49:18FromGitter<alehander92> hm, PMunch you want coverage
08:49:20FromGitter<alehander92> not cloc?
08:49:42FromGitter<alehander92> otherwise compile time lines generate runtime lines, so its a bit misleading :P
08:49:55PMunchYeah that's a good point
08:50:00PMunchI guess both would be best
08:50:29FromGitter<alehander92> a debugger for compile time :P
08:50:57PMunchSomething like: source lines: 100, macro lines: 76, generated lines: 1242, output lines: 1266
08:51:23PMunchOr maybe compiled lines instead of output lines
08:52:25FromGitter<alehander92> it sounds not hard if you build it in the compiler :P
08:56:05PMunchI mean it could be a tool that imported from the compiler
08:56:19PMunchBut yeah, it'd definitely need stuff from the compiler to calculate that
08:59:50FromDiscord<Varriount> Does a line count mean anything for generated code though? It's all an AST at that point
09:06:03PMunchJust for fun
09:06:22PMunchI mean a line count doesn't really mean much to begin with
09:08:23FromGitter<alehander92> for generated C code it does
09:08:32FromGitter<alehander92> but this is very relative of course
09:08:53PMunchWhat is opt[int]?
09:18:54FromDiscord<Rika> ??? how do i use nimsuggest in stdin mode?
09:19:11FromDiscord<Rika> im confused on what format the query location should be givent
09:19:59FromDiscord<Gary M> just for fun <https://i.imgur.com/5EyDre1.png> vs <https://i.imgur.com/JHqTfeg.png>
09:20:32FromDiscord<Rika> ah it only works if the CWD is the project folder
09:21:12FromDiscord<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:39FromDiscord<Gary M> but it seems to work "better"
09:21:56FromDiscord<Rika> why does nimsuggest require a project folder to work?
09:22:21FromDiscord<Rika> i've always wondered this actually
09:22:29FromDiscord<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:40FromDiscord<Gary M> it's still properly executing a check on the project and not just a dirty file so that's good
09:26:28FromDiscord<Gary M> with the original nim plugin, my processes look like this: https://i.imgur.com/nmXfI4K.png
09:26:45FromDiscord<Gary M> and those nimsuggest processes aren't closing down at all
09:27:40FromDiscord<Gary M> but with the modified plugin, it looks like this while idle: https://i.imgur.com/MFk2CXd.png
09:28:11FromDiscord<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:44AraqRika: because nimsuggest cannot guess the project structure, it's true for every IDE I've ever used
09:40:47PMunchAnyone 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:39FromDiscord<Rika> Araq: but arent imports either nimble imports, standard lib imports, or imports relative to the current file?
09:50:18AraqRika: ignoring the 'include' file issue, you would then create a project per module you open in your editor, not good enough
09:52:58FromDiscord<Rika> what do you mean "create a project"? why must everything have a project
09:53:18FromDiscord<Rika> i have single .nim files i use, small scripts that i compile and run once in a few months
09:54:02FromGitter<bung87> nimsuggest need a project entry file
09:54:22FromGitter<bung87> the vscode set the every nim file you open as a entry file
09:55:18FromGitter<bung87> so every entry file as a project. that's the logic
09:55:45Araqthat logic is broken and must be replaced
09:56:10FromGitter<bung87> in fact , the vscode extension that behavior can be change.
09:57:56FromDiscord<Rika> what logic? the "every file is its entry file"?
09:58:37FromGitter<bung87> I'v tried modify the vscode extension ,but now I can't recall.
09:59:35FromGitter<bung87> yeah, so that you have multiple nimsuggest proccess at the background.
09:59:56AraqRika, yes, that logic
10:02:45FromDiscord<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:03FromGitter<bung87> `packaname` `src/packagename.nim` that's the default structure when using `nimble init`
10:05:30FromDiscord<mratsim> if only we could fix nimble eating the "src" directory it's really annoyinh
10:07:41AraqRika: just use nimsuggest's directory feature
10:07:49Araqand let it figure it out itself
10:07:58FromDiscord<Rika> so i pass it a dir rather than a file?
10:08:06Araqyeah, on *startup*
10:08:14FromDiscord<Rika> the one on the command no?
10:08:20FromDiscord<Rika> yeah okay hmm
10:08:55FromGitter<bung87> you can modify the vscode extension , that's not hard task
10:09:16FromDiscord<Gary M> I'm currently working on that myself, I just don't know exactly how I should modify it.
10:09:36FromDiscord<Gary M> I don't think it should depend on a nimble init scaffold
10:09:52narimiranleorize: maybe you can help vscode guys above?
10:09:59FromDiscord<Rika> Gary, i sent you some PMs
10:11:17FromDiscord<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:19FromGitter<bung87> I have a modified version https://github.com/bung87/vscode-nim-extension
10:13:20FromDiscord<Rika> what did you modify
10:13:58FromGitter<bung87> and another extension that using nim lsp server , that just slow at first index period, anything else works fine.
10:14:53FromGitter<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:19FromDiscord<Gary M> nimsuggest works as intended with only a single per project?
10:15:24FromDiscord<Gary M> in your fork
10:15:34FromGitter<bung87> now I cant confirm they both work, it's months ago
10:17:30FromGitter<bung87> yeah, someday I noticed my 8gb memory left less.I made this change
10:24:07Araqdamn, hunting a ghost...
10:24:15FromGitter<bung87> oh , it's https://github.com/bung87/vscode-nim not that url
10:24:25Araqyou write some assert, you debug the compiler
10:24:35Araqonly to find out the assert was wrong :-(
10:27:13FromGitter<bung87> https://github.com/bung87/vscode-nim/blob/master/src/nimSuggestExec.ts#L227 start here find the project root file
10:28:40Araqyou don't have to find the project root fine, Nimsuggest does that for you
10:28:52Araqyou 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:52FromDiscord<Gary M> ```let desc = await getNimSuggestProcess(vscode.workspace.rootPath,filename);```
10:31:53FromDiscord<Gary M> Araq: so this is not how you would do it right? What directory should you pass to nimsuggest?
10:32:21Araqthe directory of the .nim file that is open
10:32:47FromDiscord<Rika> Even if it's a few folders within the project root?
10:33:37Araqyes
10:33:53Araqnimsuggest auto-detects the main project file
10:34:02*Vladar quit (Quit: Leaving)
10:34:15Araqsince every editor gets it wrong nimsuggest standardizes it
10:34:31FromGitter<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:56FromDiscord<InventorMatt> how do you do a for loop in the middle of a macro tree?
10:52:49Araq^ awesome question. there is no good way currently, you need to split up the tree construction to regain mutability
10:53:31Araqbut I'll keep it in mind for upcoing newTree/quoteAst/etc proposals
10:56:37FromDiscord<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:06PMunchOkay, made an actually fully working C sample of what I need to be able to do shashlick: http://ix.io/2j4d
11:39:11FromGitter<alehander92> Araq
11:39:29FromGitter<alehander92> how important is it that the await error should be as clear as possible
11:40:04FromGitter<alehander92> i wonder if i should just leave the default type mismatch one
11:40:16FromGitter<alehander92> as this would be very natural
11:40:43FromGitter<alehander92> (tho if i dont leave a global overload fallback, people might overload it erroneously)
11:42:58*tane joined #nim
11:43:25Araqglobal overload fallback sounds ok
11:44:18PMunchUhm... Error: unhandled exception: value out of range: 22 notin -2147483648 .. 2147483647 [RangeError]
11:44:23PMunchI beg to differ..
11:45:42*yassen[m] joined #nim
11:48:09PMunchWhat on earth is going on here? https://play.nim-lang.org/#ix=2j4h
11:50:10*abm joined #nim
11:55:19liblq-devPMunch: well it works if you split it into a few different variables
11:55:26liblq-devhttps://play.nim-lang.org/#ix=2j4k
11:55:41liblq-devbut it's obviously a bug that your example doesn't work
11:57:37*nickster quit (Quit: The Lounge - https://thelounge.chat)
11:58:55PMunchYeah, just splitting the len and cint works: https://play.nim-lang.org/#ix=2j4m
11:59:26PMunchBut 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:56shashlick@PMunch - I have the openssl wrapper ready, will send in 30 minutes
12:05:05shashlickWill you still be on?
12:05:06PMunchOh..
12:05:07yassen[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:07yassen[m]yassen, email address [email protected].)
12:05:08PMunchYeah
12:05:19shashlickOk will ping
12:05:24PMunchSweet :)
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:07narimiranyassen[m]: ping dom96
12:06:43yassen[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:50FromDiscord<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:16FromDiscord<Rika> What
12:31:43FromDiscord<clyybber> PMunch: Looks awfully similar to this: https://github.com/nim-lang/Nim/issues/13698
12:31:45disbotException when converting csize to clong ; snippet at 12https://play.nim-lang.org/#ix=2eKB
12:32:34FromDiscord<clyybber> for which the fix looks suspicious
12:33:22PMunchHmm, compiling with 1.0.6 indeed fixes the issue
12:33:30FromDiscord<clyybber> Araq: Whats the cause for this bug/bugs and why does the fix have to special case csize ?
12:33:30PMunchVery likely the same
12:34:27PMunchYikes, that fix does indeed look sketchy
12:35:09FromDiscord<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:21FromDiscord<mratsim> new code should use csize_t, and csize has been deprecated
12:37:31FromGitter<alehander92> so `dirty` is like
12:37:44FromGitter<alehander92> adding mixin to used idents?
12:37:53FromDiscord<clyybber> @mratsim I tried to make csize a uint and it worked
12:38:10FromGitter<alehander92> my new approach for async templates defines await as an inline template
12:38:21FromDiscord<mratsim> dirty uses idents instead of nnkSym I think
12:38:22FromDiscord<clyybber> @mratsim But my PR was reverted and csize_t was introduced instead
12:38:30FromGitter<alehander92> but i didnt realize now this requires one to use `mixin await` or `{.dirty.}` for template using await
12:38:34FromDiscord<clyybber> Because its a breaking change
12:38:40FromGitter<alehander92> this *can* be hinted in the error message ..
12:44:56Araqhmm isn't ACM free for all articles nowadays?
12:46:49FromDiscord<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:00FromDiscord<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:01disbotCompile 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:04shashlick@PMunch - i'm back on
12:56:24*rockcavera joined #nim
12:56:38PMunchOh you were gone :P I though you were working on something
12:58:14shashlickso openssl does not have a clean import order of headers or a top level header that imports in the right order
12:58:37shashlickso i had to maek some changes to toast to enable imports of multiple headers without duplication of symbols
12:59:06shashlicki'm importing these five headers - **pem.h ssl.h rsa.h evp.h bio.h err.h**
12:59:18shashlickbased on this example - http://hayageek.com/rsa-encryption-decryption-openssl-c/
12:59:32shashlickmake that 6
13:00:10PMunchI found out I could get away with rsa.h, pem.h, and err.h
13:00:25PMunchhttp://ix.io/2j4H
13:00:47shashlickcool
13:00:51PMunchAnd usage: http://ix.io/2j4J
13:01:28PMunchAh, probably because I don't need to generate a key
13:04:46shashlickjust those 3 files results in a 10k wrapper
13:06:17PMunchBytes or lines?
13:06:34PMunchNot that it really matter with deadCodeElim
13:06:36shashlicklines
13:09:09shashlickhttp://ix.io/2j4M/nim is what the wrapper looks like
13:09:15shashlickthe toast command line is at the top
13:10:04shashlicki'm using a plugin which looks like this - http://ix.io/2j4O/nim
13:13:03PMunchI'd need that wrapped up in Nimble if I were to use it..
13:13:27shashlicksure but want to make sure it works for you first
13:13:42shashlickrecommend generating the wrapper rather than using what i pasted tho
13:13:49shashlickcause it is system specific
13:13:59PMunchSystem specific?
13:14:01*zacharycarter joined #nim
13:14:15shashlickso if you can pull the multifile branch of nimterop
13:15:36shashlicksee the why nimterop section of the readme, specifically the preprocessing portion
13:20:36*martinium joined #nim
13:21:13FromGitter<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:39martiniumGood morning all
13:22:51martiniumAfternoon for you guys across the pond
13:22:54martinium:D
13:23:18FromGitter<alehander92> hi, america !
13:24:21FromDiscord<Recruit_main707> how is something like this done?
13:24:22FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2j4W
13:24:38Araqbrentp: we really don't support zig. supporting all these different C compilers and OSes and CPU archs is already painful enough
13:25:09PMunchRecruit_main707, like this? https://play.nim-lang.org/#ix=2j4X
13:25:40FromGitter<brentp> heh. ok @Araq . was just thinking it might be an easier way to get static binaries for my projects.
13:25:46FromDiscord<Rika> https://play.nim-lang.org/#ix=2j4Y
13:25:49FromDiscord<Rika> oops, late
13:25:54FromDiscord<Recruit_main707> thanks both
13:26:14FromDiscord<Rika> @Recruit_main707 look at mine too though 😛
13:26:16PMunchBy the way, you only need to set the first one to 1 and the rest will increment automatically
13:26:41FromDiscord<Recruit_main707> i have looked it obv
13:26:53FromDiscord<Rika> oh ok
13:27:07FromDiscord<Recruit_main707> PMunch, that would have been something valuable to know :P
13:27:19PMunchAnd now you do :)
13:27:30FromDiscord<Rika> also commas arent needed for newline'd enum entries
13:29:43*filcuc joined #nim
13:29:56*fredrik92 joined #nim
13:30:54filcuci'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:13filcucC:\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:53filcucbtw i'm not so sure in what i'm doing :D
13:33:27filcucthe idea is to have a somewhat pure nimble package
13:34:46shashlickPMunch: 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:53shashlickand then we can update the official package
13:37:01PMunchOkay, so how do I test this
13:37:08PMunchCopy the wrapper and the plug-in?
13:37:24PMunchOh no wait, not the wrapper
13:39:06shashlickinstall the multifile branch of nimterop
13:39:15shashlickand then run the command line in the wrapper i sent
13:40:49shashlick**`/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:57shashlickalong with the plugin i sent
13:41:21shashlickyou can use -o or > to redirect to file
13:44:50PMunchHmm, I just get no such file or directory
13:44:55PMunchBut I'm not sure why..
13:45:33PMunchhttp://ix.io/2j52
13:45:45shashlickAraq: 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:05Araqdon't import segfaults, ever
13:46:23shashlicki added it to see if i get more, but it crashes even without it the same way
13:46:37shashlickthis is only on 1.2.0 and devel, same stuff works fine on 1.0.6 and 0.20.2
13:47:02shashlickwas happening only on OSX but last CI it is failing on Linux
13:47:11shashlickand i'm unable to reproduce locally
13:49:39shashlickPMunch: please update to nimterop branch multifile
13:49:44PMunchI have
13:49:52shashlickcause toast is pointing to 0.4.4
13:50:02shashlickwhich is very old
13:50:07PMunchHuh
13:50:52PMunchI cloned the repo, checked out multifile, and ran nimble install
13:51:28shashlickperhaps remove nimterop@#v0.4.4
13:51:47shashlickand link toast to the new binary or use full path
13:52:01shashlickdoes /tmp/opensslwrap have the ssl header files?
13:52:17shashlicki was running in /usr/include/openssl
13:52:25PMunchThe nimble file in that branch says 0.4.4..
13:53:19PMunchSame error when running from /usr/include/openssl
13:54:15shashlickwhat's the output of toast -h
13:55:56PMunchHuh, seems like there was something funky with that symlink
13:56:16PMunchhttp://ix.io/2j56
13:56:21PMunchDifferent error now though
13:56:29shashlickya that's up to date now
13:57:30shashlickwhat's cligen upto now
13:58:03PMunch[email protected]
13:58:59shashlicktry `-np --pluginSourcePath=/tmp/plugin.nim -f:ast2 -k -O:OPENSSL_die -r -s pem.h rsa.h err.h`
13:59:08shashlicknot sure what to say
14:01:42PMunchSame error
14:03:23FromDiscord<Recruit_main707> how can i only import sqrt from `math`
14:04:00PMunch`from math import sqrt`
14:04:26FromDiscord<Recruit_main707> oh, thx
14:04:48shashlickhmm
14:05:13shashlickPMunch - seems like zsh itself is complaining
14:05:48PMunchSame error with bash
14:05:49shashlickseems to be treating the whole command line as the executable
14:06:00PMunchOh
14:06:06PMunchThat was a bad symlink
14:06:15PMunchThe new error is: Unknown short option: "Â"
14:06:31shashlickoh right
14:07:05*fanta1 joined #nim
14:07:22shashlickcan you add the flags incrementally and see which one is causing the problem?
14:08:48PMunchWell, that fixed the issue..
14:08:59shashlickmaybe cause of copy/paste?
14:09:03PMunchMust've been some weird symbol hidden in there when I copied it
14:09:04PMunchYeah
14:12:11PMunchWell it thinks that it takes a ptr File, which should just be a File in Nim.
14:12:34PMunchAnd I get some conflicting type errors: http://ix.io/2j5c
14:13:31FromDiscord<Recruit_main707> > ptr File, which should just be a File in Nim.
14:13:32FromDiscord<Recruit_main707> i think not iirc its the same as in c/c++
14:14:31PMunchI just defined it as `pointer` and passed it the output of `open` which worked
14:14:58PMunchAccording to the io module `File = ptr CFile`
14:15:14*ZoomZoomZoom quit (Ping timeout: 240 seconds)
14:15:18*nsf joined #nim
14:15:27PMunchSo it should either be ptr CFile or File, but not ptr File
14:15:29FromDiscord<Recruit_main707> but i think CFile is also a pointer to a file
14:15:41*ZoomZoomZoom joined #nim
14:18:01shashlickokay we can fix that - FILE => CFile
14:18:20shashlickrather FILE* => File
14:18:47FromGitter<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:35shashlickPMunch: pushed a fix on that branch
14:28:07PMunchThat fixed the file issue, but I still get the conflicting types errors: http://ix.io/2j5i
14:28:35PMunchOh wait..
14:29:51PMunchOkay, that was caused by me leaving in my emit statement from earlier :P
14:30:04PMunchWoo, it works :)
14:30:18PMunch(with --passL:-lcrypto)
14:31:01shashlickexcellent
14:32:10shashlicki tried copy pasting the command in a hex editor but don't see any 0xc2 which mapped to that unknown char
14:32:50PMunchWeird..
14:33:05PMunchI might've hit some random keys :P
14:33:11shashlickby the way, there's a lot of comments at the top of the wrapper which you can toss out for now
14:33:24shashlicki am trying to figure out how to best report that kind of stuff
14:33:30*Senketsu joined #nim
14:33:48PMunchI didn't even look at the generated code :P
14:34:43*inv2004 joined #nim
14:34:49inv2004Hello
14:35:47inv2004 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:40shashlickhow do you pass a `static string` passed to a macro onto another macro as a `static string`?
14:43:02FromDiscord<treeform> PMunch, I just read your Q&A it's really well written, good job.
14:43:12PMunchOh, thanks :)
14:43:32Yardanicoah 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:56shashlicklink?
14:43:59FromDiscord<treeform> https://peterme.net/nim-qa-originally-a-hn-reply.html
14:44:01PMunchCredit to the guy on HackerNews for the good questions
14:44:01Yardanicohttps://peterme.net/nim-qa-originally-a-hn-reply.html
14:44:35shashlickany ideas on the static string question?
14:45:38narimirananybody 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:03PMunchI've gotta go walk the dog. Might be back later
14:46:08*PMunch quit (Quit: leaving)
14:46:08FromGitter<kaushalmodi> narimiran: Switch to Hugo
14:46:09shashlickPMunch: `chop their arm ofF then`
14:46:40narimiran@kaushalmodi heh, https://github.com/nim-lang/website/ uses jekyll
14:46:43*opal quit (Ping timeout: 240 seconds)
14:46:47FromGitter<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:59FromGitter<kaushalmodi> narimiran: I know.. *switch* to Hugo
14:47:04*leorize quit (Ping timeout: 240 seconds)
14:47:49Yardanico@kaushalmodi make a PR :)
14:48:06FromDiscord<Rika> LOL
14:48:13FromGitter<kaushalmodi> If the nim team is fine with the switch, I can spend time on that
14:48:17FromGitter<kaushalmodi> I am not joking
14:48:30Yardanicowell you need to ask dom and 4raq I guess, I don't do webdev stuff at all
14:48:32disruptekgo for it.
14:48:53Yardanicoand miran too
14:52:22shashlickdisruptek: continuing our conversation from last night
14:52:40shashlickhow come you aren't statically linking libgit2?
14:52:57disruptekPRs accepted.
14:53:10shashlickjust need to set -d:git2Static in gittyup and you are done
14:53:29disruptekdoes it work?
14:53:36shashlickits tested on the CI
14:54:13disrupteknot afaik.
14:54:47narimiran@kaushalmodi if hugo would make our life easier (and currently the bar for that is quite low :P), why not :)
14:54:56shashlickhttps://github.com/genotrance/nimgit2/blob/master/nimgit2.nimble#L35
14:55:04*krux02 joined #nim
14:55:21Araqno.
14:55:34narimirani'm guessing i'm currently in some dependency hell, and i can't get out of it no matter what i try....
14:55:36Araqwebsite rewrites are only acceptable if they use Nim
14:55:52Araqthe website used to use Nim and it worked fine
15:00:04disruptekshashlick: it doesn't work because libssh needs static linking.
15:00:04*opal joined #nim
15:00:37disruptekssl, crypto, libz, ssh2, etc.
15:00:53Yardanicolibressl works for static linking too
15:03:03shashlickworks fine on travis and locally
15:03:25shashlickhttps://github.com/genotrance/nimgit2/blob/master/nimgit2.nim#L51
15:04:09Araqbtw 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:48FromGitter<kaushalmodi> Araq: You can wget a hugo static binary
15:08:56FromDiscord<Recruit_main707> oh gosh, out of all of the names for a go tool they had to choose mine
15:09:13FromDiscord<Rika> ok hugo
15:09:35Araqkaushalmodi: the art of programming lies in what *not* to do.
15:09:41FromGitter<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:57FromGitter<kaushalmodi> s/and/the
15:10:20AraqI'm not on Linux and I have a life
15:10:27FromGitter<kaushalmodi> they have windows binaries too
15:10:37Araqdude, I don't want it
15:10:41FromGitter<kaushalmodi> https://github.com/gohugoio/hugo/releases/download/v0.69.1/hugo_0.69.1_Windows-64bit.zip
15:10:59FromGitter<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:02Araqbelieve it or not, I'm capable of installing software on my machine
15:11:21*natrys joined #nim
15:11:36AraqI want the old Nim website builder back and you'll never convince me of anything else
15:11:49FromGitter<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:57disruptekit would make a good demo of karax.
15:12:04*fredrik92 quit (Ping timeout: 265 seconds)
15:12:16Yardanicodisruptek: no
15:12:20Yardanicono need for karax
15:12:28FromGitter<bung87> @Araq https://github.com/nim-lang/Nim/pull/14070 need feedback
15:12:29Yardanicojust a simple nim static website builder
15:12:29disbotfix #14064 xmltree should allow create text node with raw text(non-es…
15:13:06Araq"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:48FromGitter<kaushalmodi> following the hugo development actively, I can understand the reason for those 64 deps
15:13:53disruptek~stream
15:13:53disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
15:14:07disruptekcompiler hacking and ragging on karax.
15:14:09*chemist69 joined #nim
15:14:13FromGitter<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:57FromDiscord<Rika> can we drop this hugo thing
15:17:07narimirani finally, after half a day of trying (!), managed to somehow make jekyll to build the website
15:17:09FromDiscord<Rika> im not sure of what you guys are arguing about anymore
15:17:37companion_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:48narimiran(and i'm not sure if this blessed state would last or if it is just temporary)
15:17:52AraqRika: we're already done
15:18:06FromDiscord<Rika> okay
15:19:21Araqbut 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:51Yardanicoold nim website looked more "solid" or something like that :P
15:20:24AraqYardanico: you look at the CSS, it was bad, then it got better. nothing to do with the builder software
15:20:33Yardanicoah right
15:20:36companion_cubethe current website looks good
15:20:50Yardanicoyeah we're not talking about changing the website look
15:21:25PrestigeI feel like some specific pages take a while to load
15:21:50YardanicoPrestige: nim website is literally statically served :P
15:21:51companion_cubedisruptek: what other chan are you on? :p is there a offtopic to this?
15:21:52Prestigebut idk how the content is being served
15:21:55Prestigehm
15:22:12Yardanicoand it's behing cloudflare as well
15:22:13disruptektwitch chat.
15:22:27companion_cubeahhhhhh ofc.
15:23:35*ZoomZoomZoom joined #nim
15:23:45PrestigeWoah that's weird, maybe firefox is just having issues with the searchable index page Yardanico
15:23:55YardanicoPrestige: oh you're about that page
15:23:56PrestigeTakes like 4 seconds to load on ff but chromium took like .5 seconds
15:23:59Yardanicohttps://nim-lang.org/docs/theindex.html ?
15:24:05Yardanicowell it's a very big page
15:24:25PrestigeRight, 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:10FromGitter<kaushalmodi> I am using latest firefox on Windows, loads fine.. takes about a second
15:34:21FromGitter<kaushalmodi> *theindex.html loads fine
15:37:21companion_cubedisruptek: gRPC and the likes are RPC over http
15:37:40Araqnarimiran: so what's the changelog situation?
15:37:51Araqwhere should people add their changelog entries?
15:38:42companion_cubedisruptek: http supports persistent connections, too
15:39:08*lritter quit (Ping timeout: 265 seconds)
15:39:14Araqcc bung87
15:39:28companion_cube:DD no offense
15:40:08companion_cubeyeah that was funny 😂
15:41:55narimiranAraq: i'm still not convinced that `changelog.md` should become just a "table of contents" for changelogs
15:42:21narimiranif anybody else wants to give their opinion/view: https://github.com/nim-lang/Nim/pull/14025
15:42:22disbotavoid messing up changelog history on each subsequent release
15:42:22Araqno, it should be changelog_$version.md
15:42:27companion_cubemonday night I think
15:42:31Araqand there should be no changelog.md
15:42:38companion_cubeon discord?
15:43:55PrestigeCould just be a ff bug for this version I guess lol
15:45:13FromGitter<bung87> @Arag I added it to changelog_1_2_0.md
15:45:32companion_cubewhy would you want to troll crystal, disruptek?
15:45:38Yardanicocompanion_cube: why not
15:45:43Yardanicoit's for research
15:46:09narimiran@bung87 that change of changelog_1_2_0.md is wrong!!
15:46:20narimiran1.2.0 is already released!!
15:46:21companion_cube😂 oh well
15:46:30companion_cubeplease be nice, crystal is interesting (unlike V)
15:46:37FromDiscord<Rika> OOF
15:46:48FromGitter<bung87> ah, that's a problem.
15:46:48companion_cubeand thus starts another copy-pasta
15:46:58narimiran@bung87 put it in `changelog.md`
15:47:01FromGitter<bung87> I dont think I can change the nim version..
15:47:12narimiranthis one: https://github.com/nim-lang/Nim/blob/devel/changelog.md
15:47:33FromGitter<bung87> ok
15:47:44narimiranand it is `since:(1, 3)`
15:48:13narimiranand in text, it is `**Since**: Version 1.4.` (not a typo, 1.4)
15:50:10companion_cubethey're doing good
15:50:27companion_cubewho knows, maybe we were trolled the same way
15:50:37FromGitter<bung87> ok, next time I can easyly handle this ..
15:53:23companion_cubewell rust might be a valid choice for that crazy project disbot
15:53:25companion_cubedisruptek
16:01:29zacharycarterq
16:01:30zacharycarterq!
16:01:33*zacharycarter quit (Quit: leaving)
16:01:43companion_cubeq?
16:02:35Yardanicoq!
16:02:43FromDiscord<Recruit_main707> q
16:03:08*zacharycarter joined #nim
16:05:27FromDiscord<Rika> :q!
16:05:27PrestigeLol
16:06:22narimiranbrainfuq language when?
16:06:32YardanicoChef language is better
16:06:38Yardanicowrite programs using recipies
16:07:01companion_cubethere's beef lang, too :p
16:07:08FromDiscord<Recruit_main707> \:smart:
16:07:17narimiranit was a (bad) joke about repetitive usage of Q :'(
16:07:28Yardanicoit was a good joke
16:07:40narimiranq!
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:26FromDiscord<clyybber> Araq: Does your recent PR mean that the cycle collector is now working?
16:46:43FromGitter<bung87> https://github.com/nim-lang/Nim/issues/14073 any idea to this ?
16:46:45disbothtmlparser doest parse self close tag ; snippet at 12https://play.nim-lang.org/#ix=2j67
16:49:19FromGitter<kdheepak> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ea0758f35a35031bf7cd6cb]
16:49:30FromGitter<kdheepak> Why does something like this not work?
16:50:04FromGitter<kdheepak> > Error: cannot create a flowVar of type: Person ⏎ ⏎ I get the following error
16:50:26FromGitter<kdheepak> I've tried with Person = tuple as well.
16:51:18FromGitter<bung87> you evalute worker()
16:51:38FromGitter<bung87> that return a Person, so you wrote spawn Person
16:51:39shashlickif porting to --gc:arc, can the code still compile with regular GC for older Nim versions?
16:51:53Yardanicoshashlick: most of the time you don't need to port anything
16:51:56FromDiscord<Rika> so essentially, dont call worker
16:51:57FromDiscord<Rika> ?
16:52:08FromGitter<kdheepak> I want to start a thread that returns a Person.
16:52:27shashlickya but my code doesn't work anymore since i'm loading a dll and there's some issue being introduced
16:52:41leorizeshashlick: --gc:arc is vastly simpler than the normal gc
16:52:48leorizeif it can run on arc it runs everywhere
16:53:48FromGitter<bung87> so you just pass `worker`
16:54:17FromGitter<kdheepak> ```test.nim(14, 19) Error: 'spawn' takes a call expression ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5ea076b9727e88014a0d028f]
16:54:23shashlickso in nimterop, i compile a plugin with --app:lib --gc:arc and run a proc from it on memory from main exe
16:54:32shashlickthat data isn't coming through so tests are failing
16:54:39shashlickbasically cPlugin() isn't working
16:54:53FromGitter<kdheepak> If I return `int` it works if I use `spawn worker()`
16:55:54FromGitter<bung87> hmm I checked my mistake
16:58:18leorizeshashlick: use -d:useMalloc for both of them
16:59:49*PMunch quit (Quit: leaving)
17:00:11FromGitter<bung87> document not explain what FlowVar is
17:02:59shashlickleorize: how does that help?
17:04:19shashlicksame issue
17:04:44leorizethen it might be a bug
17:08:01leorizedo you have a small reproducible sample?
17:09:22shashlickTrying to figure out what's going wrong
17:10:01FromDiscord<Yardanico> @gaurav
17:10:21FromDiscord<Yardanico> so what did you choose for your adobe premiere competitor in the end?
17:11:04zacharycarterYou picked vlang didn't you?
17:16:05FromDiscord<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:00FromDiscord<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:48leorizeyou can get small binary size with C++ if you know what you're doing
17:19:27FromDiscord<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:58leorizemake sure you hire a proper designer and not a bunch of developers trying to draw out a clunky ui
17:20:43FromDiscord<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:59FromDiscord<gaurav> I understand that. UI is important.
17:22:15FromDiscord<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:35companion_cubekdenlive is GPL though, you can't just commercialize a fork of the code
17:23:06FromDiscord<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:14FromDiscord<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:30disruptekdon't talk to him about commercial forks; he isn't into programming.
17:25:15FromDiscord<gaurav> yes.. I am not into programming..
17:26:48FromDiscord<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:57FromDiscord<gaurav> Someone was sugggesting to use JS over Electron as it has lesser footprint..
17:28:40FromDiscord<gaurav> I need to look into that option too.. will try some alternatives of Electron if this option is better..
17:28:54companion_cubethat was a joke
17:29:06companion_cubeelectron s the heaviest thing in the galaxy
17:29:27*supakeen must resist mom jokes
17:30:07leorizethis is way people need consultants and not just running head first into making some big projects
17:31:19shashlickthis entire conversation belongs in #nim-offtopic
17:31:25shashlicknothing is nim specific
17:33:06FromGitter<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:11leorizelooks like you're moderated :P
17:35:34leorizefor your flowvar problem, I'd recommend using
17:35:44leorize!repo yglukhov/threadpools
17:35:45disbothttps://github.com/yglukhov/threadpools -- 9threadpools: 11 15 15⭐ 7🍴
17:36:05leorizeit's an improved version of threadpool and works better than the stdlib
17:36:18leorize!repo weave
17:36:20disbothttps://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:50leorize^ this one is interesting too, but it's not compatible with GC-ed memory so not really that useful yet
17:36:58leorizehopefully arc will change this
17:38:02narimiranleorize: @kdheepak's post should be visible now
17:43:05FromDiscord<gaurav> brb
17:47:07shashlickcan you set the gc on http://play.ni
17:47:11Yardanicono
17:47:22*Trustable joined #nim
17:53:19*Trustable quit (Remote host closed the connection)
17:54:27*Trustable joined #nim
18:00:10shashlick@leorize - i have a minimal example
18:02:31shashlickAraq: have a --gc:arc test that doesn't work - appreciate some help
18:03:09Araqwell?
18:03:14shashlickmain.nim = http://ix.io/2j6u/nim and plugin.nim = http://ix.io/2j6v/nim
18:03:58leorizeshashlick: your plugin one need cdecl too...
18:04:08leorizeor use nimcall for the main one
18:04:12leorizethough it shouldn't matter on linux
18:04:52shashlickwell 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:32Araqshashlick: does your malloc implementation work across .so boundaries?
18:06:02shashlicklet's just say i've been living on the edge and it's finally come to bite me
18:06:28leorizeAraq: I'd expect it to, since that's literally libc job
18:06:40shashlicknimterop sporadically crashes with the regular GC so i'm testing with --gc:arc
18:07:02shashlickbut now hash is empty in the plugin
18:07:02Araqshashlick: well ask valgrind
18:07:26FromDiscord<clyybber> Araq: Does your recent PR mean that the cycle collector is now working?
18:07:45Araqno.
18:08:29AraqI suspect the paper's algorithm might have a bug since my 'thinout' uses the same technology and doesn't crash
18:08:47Araqso I'm looking for a simpler cycle detector algorithm to try out
18:08:47leorizeshashlick: also can you add an echo to the plugin to verify that the initialization proc was run?
18:08:58shashlickhow do I do that
18:09:22leorizejust a simple `echo "hello"` at the top-level of plugin.nim
18:09:49shashlickyep init runs with regular GC
18:09:57Araqwouldn't be the first time I found a bug in a paper with a "correctness proof"
18:10:24shashlickinit runs with --gc:arc as well
18:10:46shashlickso in theory, hash should be populated with a value
18:11:36Araqshashlick: try also with --sinkInference:off
18:12:01FromDiscord<mratsim> @leorize, is yglukhov threadpool compatible with sequences and strings? or I guess it works with Nim channels
18:12:18leorizeit is compatible
18:12:34leorizeit can do ref objects the last time I checked
18:16:59FromDiscord<RaycatWhoDat> oh jeez
18:17:07FromDiscord<RaycatWhoDat> IRC bridge throwbacks
18:18:36FromDiscord<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:26Araqdefine "proficient", I know a bit about C++
18:19:33leorize[m]I'm not that proficient in C++ but I do know a thing or two
18:20:27narimirani'm proficient, but i know nothing
18:20:40FromDiscord<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:09Araqleorize[m]: is https://github.com/nim-lang/Nim/pull/13934 still relevant?
18:21:09disbotSet NONBLOCK flag atomically
18:21:32leorizeyea, it's still relevant
18:21:42AraqRaycatWhoDat: please ask your question already
18:21:52Araqleorize[m]: merge?
18:22:26leorizesure
18:23:11FromDiscord<RaycatWhoDat> Does Nim address most of the things you'd write C++ code for?
18:23:24FromGitter<awr1> anyone that claims to know C++ is lying
18:23:55FromGitter<awr1> /s
18:24:13shashlickAraq: --sinkInference:off doesn't help
18:24:22leorizeyou can see why none of us said we know c++ :p
18:24:56FromDiscord<RaycatWhoDat> Right.
18:26:11leorizeI write C++ because I work on a project that is written in C++, and Nim certainly can't address that :)
18:26:45FromDiscord<RaycatWhoDat> That makes sense. Would you pick Nim if it was a greenfield project?
18:27:09FromDiscord<RaycatWhoDat> I'm guessing "yes".
18:27:16FromGitter<bung87> @gaurav electron is the easy way to go, qt also good as well.
18:29:11FromGitter<bung87> any other approach "cross platform" just wrote two words...
18:29:17leorizeofc I'd pick nim :p
18:31:03FromDiscord<Rika> Only issue with nim IMO is its small 3rd party library count, but that fixes over time
18:31:27FromDiscord<Rika> Has anyone used nimlua?
18:31:42FromGitter<bung87> I'm planed write a new webview lib ,but I have no income now
18:32:47FromDiscord<Recruit_main707> I was thinking, you know what would be nuts?
18:32:47FromDiscord<Recruit_main707> Getting Computerphile to feature Araq to talk about nim.
18:33:54FromDiscord<Recruit_main707> with the quarantine they probably dont have that much content
18:34:24leorizeyou can ask them and maybe they'd reach out
18:34:28leorizeif they haven't already :P
18:35:23AraqRaycatWhoDat: "greenfield project" is too broad, what project
18:35:40FromDiscord<Recruit_main707> Araq: would you accept that?
18:36:23AraqRecruit_main707: sure
18:36:45FromDiscord<Recruit_main707> then gotta start spamming their social media ;P
18:38:05FromDiscord<Rika> Not a good idea I don't think
18:38:16FromDiscord<Rika> Just inquire once and wait
18:38:32FromDiscord<Recruit_main707> they tend to read comments i know
18:39:12FromDiscord<RaycatWhoDat> @Araq "Greenfield project" in my head means you started from zero, you're in the process of choosing a language.
18:39:34FromDiscord<Rika> Never heard of that idiom
18:39:49FromDiscord<RaycatWhoDat> I'd be interested to know when Nim isn't the best option.
18:39:53AraqI know what a Greenfield project is, but you didn't say the topic
18:40:22Araqis it a new web browser, a game engine, control software for your toaster?
18:40:31FromDiscord<Rika> Right now nim ain't too good for mobile app development AFAIK
18:40:49leorizespoiler: control software for toaster is actually where you shouldn't use nim, yet
18:41:07FromDiscord<Rika> Why not? I though nim was embedded ready
18:41:55FromDiscord<clyybber> @Rika Why wouldn't it be good for mobile app development?
18:42:27FromDiscord<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:41FromDiscord<Rika> I don't know of any tutorials for mobile development in nim
18:42:55leorizeRika: the ecosystem around embedded things in nim is still young, and almost no support for any of the popular embedded boards
18:42:58FromDiscord<clyybber> Well, its as possible as it is to do with C++ or C
18:43:02leorizealso --os:standalone breaks every release :P
18:43:11FromDiscord<Rika> But are there the docs for it
18:43:17FromDiscord<clyybber> @Rika We can even compile to dalvik
18:43:30FromDiscord<Rika> Is it well supported
18:43:42leorizewe now have --os:any but you don't seem to have control over everything like --os:standalone
18:44:10FromDiscord<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:10FromDiscord<Rika> Interesting, I've heard of any but not standalone
18:44:25FromDiscord<Rika> I see. That looks useful
18:44:30FromDiscord<Rika> For my project I mean
18:44:52FromDiscord<clyybber> also dom96 is making a mobile app/game
18:44:55leorize--os:standalone predates --os:any, but it's kinda funky and no one ever nailed the semantics down
18:44:57FromDiscord<clyybber> using jnim afaik
18:48:25AraqRaycatWhoDat: 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:39FromDiscord<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:28FromDiscord<RaycatWhoDat> Thanks for the info!
19:01:43FromGitter<alehander92> hey guyss
19:01:46FromGitter<alehander92> i used !
19:01:50FromGitter<alehander92> os:any yesterday
19:01:54FromGitter<alehander92> for study-kernel
19:01:59FromGitter<alehander92> and it seems to work! awesome work
19:02:11FromGitter<alehander92> disruptek or zevv or rainman or leorize not sure who did it
19:02:18FromGitter<alehander92> also i used `--gc:arc `
19:02:22disruptekzevv.
19:02:26FromGitter<alehander92> so my plan is to use `async` now and rewrite
19:02:34disruptekcongrats, dude.
19:02:36FromGitter<alehander92> it to very simple cooperative multithreading
19:02:53FromGitter<alehander92> well it's like absolutely toy stuff dont listen to my rambling :P
19:03:00FromGitter<alehander92> the problem is simple
19:03:10FromGitter<alehander92> `asyncdispatch` currently depends on `os` and a lot of stuff
19:03:24FromGitter<alehander92> so probably it would be better for me to just write a custom `async` macro
19:03:30leorizeuse chronos and write your own backend for it :P
19:03:50FromGitter<alehander92> well, thats the good thing: i was like "how to write a custom executor like they do in rust"
19:04:00FromGitter<alehander92> and in nim you can just sidestep the whole thing
19:04:16leorizetrue :P
19:04:17FromGitter<alehander92> and write your own third macro ignoring the whole stdlib/chronos thing
19:04:54leorizeI'm a bit wary about --os:any due to sysFatal not overridable
19:04:59FromGitter<alehander92> i need to think of preemption one day but for now not important
19:05:07leorizemeaning you can't have a nice panic for your kernel
19:07:19FromGitter<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:18FromGitter<alehander92> background (shell(1), shell(2)); => var input = await read(); var output = await process(input); await write(output);
19:10:26FromGitter<alehander92> hm, i really need to think about that first
19:10:48FromGitter<alehander92> anyway, my first battle was to just manage to build a cross compiler
19:11:23Zevvzup
19:11:32Zevvoh it was me, yes
19:12:10FromGitter<alehander92> Zevv is it a good idea to write a kernel which exposes everything in async style
19:13:21Zevvha how should I know :)
19:13:23FromGitter<alehander92> my plan is every "process" / "syscall" to be just a proc name(args): ret (optional {.kernel kind of async.}) and
19:13:35ZevvIf it was a good idea, wouldn't there be kernels around which expose everything in async style? :)
19:13:36FromGitter<alehander92> to just see where this goes
19:13:47FromGitter<alehander92> well, i think
19:13:52FromGitter<alehander92> it's probably a good idea but the problem is
19:13:53shashlickmarkAndSweep fixed the crash for now
19:14:02FromGitter<alehander92> if almost everything is awaitable anyway
19:14:15FromGitter<alehander92> its better to use this as a default in the language of the kernel
19:14:28FromGitter<alehander92> so maybe people use different kinds of expressing it
19:15:03FromGitter<alehander92> but this is still doable in nim
19:15:23FromGitter<alehander92> you can write `write!(a)` instead of `await write(a)` i think
19:15:33FromGitter<alehander92> if you write such an api
19:15:38ZevvI've been neglecting recent developments here, but I assume arc and async now play together well?
19:15:49disrupteknah.
19:15:52FromGitter<alehander92> not sure, but i'd write my own custom async if i do that
19:15:58Zevvnah?!
19:16:09Zevvthat was *the* single problem to be solved!
19:16:36*moerm joined #nim
19:16:36FromGitter<alehander92> so you just write write!(a) or write~(a) for await/background
19:16:42FromGitter<alehander92> but maybe too much operator
19:16:44moermHello everyone
19:16:46Zevvwhat about just exposing write() only
19:17:10FromGitter<alehander92> zevv but then how would the scheduler know to run it non-blockingly
19:17:17FromGitter<alehander92> if the language generates a direct call
19:17:22Zevvsure, but you make your own write(), I mean
19:17:30Zevvthat is implicitly async
19:17:49Zevvnot 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:05Zevvit makes sense to see where your scheduling points are. That's what "await" is helping with
19:18:32FromGitter<alehander92> yeah, i mean if you somehow automatically insert `await/yield`
19:18:42FromGitter<alehander92> before "futures"
19:18:43FromGitter<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:06Zevvsure. I did that in Lua ages ago with coroutines.
19:19:26FromGitter<alehander92> hm
19:19:36FromGitter<alehander92> but i want to sometimes
19:19:37AraqZevv: well it's hard and nobody screams "hey, I'm solving it"
19:19:39FromGitter<alehander92> run them in the background
19:19:53FromGitter<alehander92> i can always write explicitly that
19:20:15AraqZevv: work on --gc:orc is continuing and then you can run everything without the porting effort
19:20:20*sacredfrog joined #nim
19:20:48ZevvAraq: I'm not complaining :) I know it's hard - I tried understanding any of that and just gave up after two days
19:21:13FromGitter<alehander92> Zevv yeah an example solution is safeasync from https://github.com/status-im/nim-chronos/issues/2#issue-327470294
19:21:15disbot[RFC] Async I/O with structural control flow (a.k.a. Enforced Awaits) ; snippet at 12https://play.nim-lang.org/#ix=2j7c
19:21:17Araqyeah well, same here, I gave up and I'm adding a cycle collector
19:21:23FromGitter<bung87> recommand a good html parser? I know python's
19:21:25FromGitter<alehander92> but i probably just like explicitness here
19:21:34ZevvAraq: fair enough
19:21:51FromGitter<alehander92> it can be simpler to just know "ah here in the code i await and here i dont"
19:22:25Zevvright
19:23:01FromGitter<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:33FromGitter<bung87> like ruby style
19:24:20FromGitter<bung87> so developer will not relys on their bad memory
19:25:52FromGitter<alehander92> also piping is interesting, if everything is awaitable `a().b()` should be something like async iterator in async iterator
19:26:08Zevvlazy iterators
19:26:18Zevvchainable lazy iterators, even
19:26:35ZevvI'm all for it
19:26:41FromGitter<alehander92> for await e in a: for await c in b(e):
19:27:05FromGitter<alehander92> yeah
19:27:13FromGitter<alehander92> but for my shell to understand it
19:27:22FromGitter<alehander92> it should interpret this on nim runtime
19:27:29FromGitter<alehander92> which is not that hard
19:29:16*PMunch joined #nim
19:30:38moermHave a good time everyone (and especially Araq our beloved BDFL)
19:30:56FromGitter<alehander92> ok, so 1) cross compile 2) structure correctly repo 3) elementary custom async switchTasks
19:31:02FromGitter<alehander92> moerm hey hello
19:31:20*moerm quit (Quit: Leaving)
19:39:36leorizeshashlick: I've tried your test and the hash set is weirdly empty
19:40:20shashlicki fixed my crash with markAndSweep for now but ya, eventually would like to use arc
19:40:31shashlickbut I don't understand how the regular GC also fails with that test
19:41:48leorizeit might be a bug in hashset itself?
19:41:51leorizeping narimiran
19:42:17narimiranpong
19:42:19leorizeshashlick: fun fact, if you use `hash.incl` inside `onTest`, it will work
19:43:10shashlickactually it works on regular gc and with boehm
19:43:13shashlickonly not with arc
19:43:34shashlicklet me open a bug for tracking
19:43:44Araqyes please
19:44:11Araqshashlick: oh also try with --exceptions:setjmp
19:45:12*Tlongir joined #nim
19:46:32leorizenewruntime repr() on ptr is kinda useless...
19:46:39leorizeit doesn't show me the address
19:47:06Araqleorize: fix it please
19:47:27Araqwhen I wrote the code I thought "yeah, nobody ever cared about these addresses..."
19:50:11shashlickhttps://github.com/nim-lang/Nim/issues/14074
19:50:14disbot--gc:arc does not retain global HashSet in --app:lib ; snippet at 12https://play.nim-lang.org/#ix=2j7k
19:50:14leorizeshashlick: found the issue
19:50:35leorizeit's an old one and probably reported long ago
19:50:46Araqwhat is it?
19:50:54leorizebut the global variable destructors assume that the program last for the duration of NimMain()
19:51:03leorizewhich is not true for libraries
19:51:56leorizeso as you might expect, everything got wiped out after initialization finished :)
19:53:20leorizeshashlick: walkaround: move everything to an init proc
19:53:48FromDiscord<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:54FromDiscord<clyybber> It looks correct to me
19:55:22shashlicki'll stick to markAndSweep for now since I have to support older Nim
19:56:33shashlickphew, seeing green after weeks! https://travis-ci.org/github/nimterop/nimterop/builds
19:59:44leorizeoh also disregard that advice about {.nimcall.}, it appears to me that {.exportc.} defaults to cdecl
20:00:06shashlickcool
20:00:33shashlickokay 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:52leorizeyou don't :)
20:05:37*ZoomZoomZoom quit (Ping timeout: 264 seconds)
20:06:06leorizeAraq: does --gc:arc support sharing memory between shared objects without using nimrtl?
20:10:32FromGitter<mratsim> 1) use a compile-time proc @shashlick ⏎ 2) use getAST ⏎ 3) quote do call the macro and pass the string
20:12:19Araqleorize: with -d:useMalloc, yes
20:12:53shashlick@mratsim: i am using #3 in nimdeps, will try the same in this case
20:15:13shashlickhttps://github.com/nim-lang/Nim/issues/7375 is still biting me
20:15:15disbotMacro: bool is converted to int inside `quote do` ; snippet at 12https://play.nim-lang.org/#ix=2j7q
20:16:28FromGitter<mratsim> just call newLit(x) before doing quote do
20:16:39FromGitter<mratsim> or in the quote do block boo(`x`)
20:16:45FromGitter<mratsim> foo*
20:17:15FromGitter<mratsim> I'm more annoyed at the fact that you can't interpolate an expression, only variables in quote do
20:17:28shashlickit works!
20:17:29shashlickpeace
20:17:46shashlickso now you can cImport multiple files and toast will process them altogether and skip duplicates
20:17:59shashlickduplicate symbols
20:33:10FromGitter<awr1> and made this public
20:33:11FromGitter<awr1> https://github.com/awr1/cpuwhat
20:34:42leorizeare we gonna see a runtime dispatcher library based on this? :)
20:35:53leorize@mratsim might like this
20:36:41leorizeoh wait you depend on nimterop..
20:36:41FromDiscord<Recruit_main707> a nim library that doesnt have nim in the name :0
20:37:30*filcuc quit (Ping timeout: 250 seconds)
20:37:54FromGitter<awr1> does mratsim not like nimterop
20:38:12leorizeI don't like nimterop dependency, not sure 'bout him
20:38:27leorizethough what you do look simple enough
20:38:38FromDiscord<Recruit_main707> thats what i was gonna say
20:38:42FromGitter<awr1> i thought it would have been useful for all those new weird intrinsics
20:38:50FromGitter<awr1> that intel likes to keep adding
20:38:52FromDiscord<Recruit_main707> he only imports a few types
20:39:42FromDiscord<Recruit_main707> no arm support though :(
20:39:51FromGitter<awr1> if only optional dependencies were a thing in nimble
20:39:53leorizeI've got my fair share of nimterop erroring out on installation, so it's not my favourite
20:40:22FromGitter<awr1> i'll get an RPI when i move out and then i'll add proper ARM support
20:41:01leorizeyou can use qemu arm emulation as a stop gap measure :P
20:41:04FromDiscord<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:36shashlickI'd appreciate issue reports if you do encounter stuff
20:56:05FromDiscord<Recruit_main707> dont worry, ive just parked it for a while
20:56:38shashlickya i mean in general to everyone
20:57:34shashlickits getting old hearing about errors and bugs with no actual issues to tackle
20:58:19shashlick@awr1 - if the wrappers aren't changing across platforms, you can cache the output in your repo
20:58:44leorizeI saw that issue with nimterop/plugin on nimph installation, has it been fixed?
20:59:09shashlickno not yet - there's multiple issues with that
20:59:41leorizeuntil that's fixed I can't trust having nimterop as a dependency, sorry :/
20:59:42FromGitter<awr1> what do you mean?
20:59:48shashlickfirst need to get Nim flags with std/compilersettings
21:00:14shashlickbut i'm not sure if http://nim.cf also gets picked up by that
21:00:48leorizeI got hit once and the only way out was to keep trying until it starts to work
21:01:18shashlickyou don't use nimble either?
21:01:29FromGitter<awr1> what issue exists with niph and nimterop
21:01:31shashlickor overriding nimble dir?
21:01:32FromGitter<awr1> *nimph
21:02:13leorizeshashlick: yea, was overriding nimble dir
21:02:58shashlickon the nimterop tracker, 154 - though disruptek could use nimgit2 with static link instead, and 153
21:03:38shashlickissue 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:07shashlickso if you change your nimble dir, the top level nim command will pick it up but not nimterop
21:05:06FromGitter<awr1> should the nim compiler expose a const or something for the nimble directory then
21:05:29shashlickit is available now with std/compilesettings
21:05:36shashlickbut nimterop needs to use it
21:05:44leorizeshashlick: 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:18leorizeI'd be worried if I have to clear my XDG_DATA_HOME/nimterop if something went wrong
21:06:34FromGitter<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:52shashlickthe 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:04shashlicki suggested static linking but that might not always be desirable
21:07:15*oculux joined #nim
21:07:18shashlickthe way i made nimbass is to use standard linking instead of dynlib
21:07:31shashlickhttps://github.com/genotrance/nimbass/blob/nimterop/nimbass/bass.nim#L59
21:07:35leorizestatic linking please, this install to $XDG_DATA_HOME is tacky as hell
21:07:48shashlickso that the end user can move the binary and take the so/dll with it
21:07:52shashlickand use standard lib loading
21:08:25*PMunch quit (Quit: leaving)
21:09:15shashlickhttps://github.com/nim-lang/RFCs/issues/58 is similar in motivation
21:09:16disbotRFC: change `dynlib` handling on linux to use standard dynamic linking instead of runtime loading via `dlopen`
21:09:27shashlicki might have to change nimarchive and nimgit2 to do the same
21:09:49shashlickby 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:02leorizenote that standard linking assumes that libraries are in standard locations
21:10:04shashlickit's not pretty though - see the nimbass test file
21:10:19shashlickhttps://github.com/genotrance/nimbass/blob/nimterop/nimbass.nimble#L16
21:10:43shashlickya and if you did want to use std locations then why download and build to nimcache
21:10:52shashlickyou can just -d:git2Std and nimterop will find the standard stuff
21:11:05shashlickso i don't yet know how to solve that one
21:11:19Araqclyybber: I cannot open your link but my implementation is faithful to the algorithm in the paper modulo its very many typos
21:11:40leorizeshashlick: go all in on static linking
21:11:47leorizeit works, and you don't have to deal with the .so mess
21:12:00Araqand feel free to debug it against hamming.nim to find the problem
21:12:04leorizedynamic linking then hide the library is a recipe for disaster
21:13:07leorizelinux distributions has yet to solve this problem after who knows how long
21:15:07shashlickYa but for like nimbass which only have a dll
21:15:14leorizeif you want to support dynamic linking, force the user to specify where the resulting library will be
21:15:16shashlickWhat do you think of the approach
21:15:41leorizestatic vs shared is not a minor difference that you can just mask over
21:15:52leorizeif you produce only an exe, then the user will only copy the exe
21:16:11shashlickHmm
21:16:17leorizeyou got to produce both the exe and the dll at the same place, then the user will copy both
21:16:48shashlickSee the nimbass readme, is that okay?
21:17:44leorizeI don't think so, this is unreliable
21:17:47FromDiscord<clyybber> Araq: Ok, I will do so tomorrow.
21:18:16FromDiscord<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:15shashlickSo if shared lib, user has to specify where the lib should be copied?
21:19:26FromDiscord<clyybber> awr1: What does it need nimterop for?
21:19:32leorizeIMO anything that rely on things outside of the scoped environment of your build is prone to breakage
21:19:44shashlickThat works on windows but for posix it won't run unless user uses ld library etc
21:20:02leorizewell it still wouldn't run even if you put it in ~/.nimble
21:20:19*inv2004 joined #nim
21:21:02leorize*nix have a trick for this, but it's not really welcomed
21:21:13shashlickDoes posix have no solution for this?
21:21:17shashlickRpath?
21:21:37leorizeif you link with `-rpath $ORIGIN` (note the `$`), then the binary will look for libraries in it's directory
21:21:47leorizethe `$` must not be escaped :)
21:21:54leorizesorry, must be escaped
21:22:15leorizeit's a PITA with any shell-based build system
21:22:30leorizeI heard `-rpath $$ORIGIN` is a common walkaround
21:22:40*Vladar quit (Quit: Leaving)
21:25:00*inv2004 quit (Client Quit)
21:32:26leorize[m]I think when you design a system like nimterop, you should strive for the most deterministic behavior
21:34:08leorize[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:25leorize[m]you can default to `--passL:-Wl,-rpath,$$ORIGIN` to make the binary look for libraries next to it
21:36:05leorize[m]and for bigger libraries, say LLVM, this would be needed to keep the collection of helper libraries in one place
21:36:40leorize[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:40FromGitter<awr1> i've used the rpath thing before, it works
21:40:53FromGitter<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:23zedeushas anyone succeeded in statically linking openssl with mingw? i've gotten pretty close but `SslLibraryInit()` returns 0
21:44:36FromGitter<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:31FromGitter<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:18FromGitter<bung87> @Araq still there?
21:48:41zedeusnvm I forgot to do --dynlibOverride:ssl, got it working now
21:49:51*FromDiscord quit (Ping timeout: 265 seconds)
21:49:53Araqbung87: what do you mean?
21:51:42leorizeAraq: how does `=destroy` binding work? do I have to export it or can I keep it private?
21:51:43disruptekAraq: shouldn't the warshall's algo stuff use a distinct type so it doesn't overflow?
21:51:50FromGitter<bung87> may disscuss first? or just create the PR?
21:52:11Araqdiscuss it first
21:52:21Araqleorize: keep it private
21:52:29*natrys joined #nim
21:52:54Araqdisruptek: what's warshall's algo again?
21:52:56leorizedoes `=destroy` to finalizer transformation work for generic `=destroy`?
21:53:30FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/9y7t/Screenshot-2020-04-23-at-5.53.02-AM.png)
21:53:45FromGitter<bung87> I will commented these lines
21:53:55disruptekAraq: dirty a graph's deps.
21:54:16FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/7xyn/Screenshot-2020-04-23-at-5.54.05-AM.png)
21:54:22disruptekit's nothing to reall worry about.
21:54:33FromGitter<bung87> make it not self closing
21:54:38Araqleorize: I hope so
21:55:53Araqbung87: that's a breaking change
21:56:54FromGitter<bung87> I locally test the html file parse as well as expected.
22:02:39Araqhuh? you want to change how the html parser handles certain constructs
22:02:47Araqso obviously it's a breaking change
22:03:21FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/MAIB/Screenshot-2020-04-23-at-6.01.39-AM.png)
22:03:21FromGitter<bung87> also these lines, semantic checks not readlly need, and wrongly reporting errors
22:03:51FromGitter<bung87> yeah , when do this it can correct parse html, but loss semantic checks feature
22:04:52Araqmove htmlparser to fusion please and give it a better test suite
22:05:39*tane quit (Quit: Leaving)
22:07:08FromDiscord_<mratsim> Github just push their notification changes to everyone :/
22:07:10FromGitter<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:27FromGitter<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:29FromGitter<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:44shashlickThe are before and after install hooks
22:10:44*natrys quit (Quit: natrys)
22:11:04FromGitter<kdheepak> got it! I think the before hooks are what I want.
22:11:50FromGitter<bung87> I might move the modified libs to a new repo , then see where to put
22:11:54shashlickNote that it's not without its issues
22:12:56shashlickSee 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:39leorizeAraq: so no, generic destructor -> finalizer doesn't work
22:19:18FromGitter<awr1> @leorize what were you going to say in regards to the nimterop caching earlier
22:20:27FromGitter<awr1> i'm sorry i meant @shashlick
22:20:31nerdrat[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:01shashlickFrankly 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:47shashlickReason 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:35shashlick@awr1 sorry I missed the context
22:23:04shashlick@nerdrat[m] same with your message, don't see the full context
22:23:47FromGitter<Bennyelg> Error: attempting to call undeclared routine: 'dup'
22:23:56FromGitter<Bennyelg> when using example of version 1.2
22:24:02leorizeAraq: 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:10leorizeBennyelg: import sugar
22:24:37leorizeit's noted on the changelog :P
22:24:45FromGitter<Bennyelg> need to edit the docs
22:24:47FromGitter<Bennyelg> thanks
22:24:51FromGitter<awr1> you said something about caching the output of the headers - in regards to my intrinsics library - inside my repo
22:28:03nerdrat[m]shashlick: About the choosenim "corrupted nim installation" issue.
22:29:55Araqleorize: well you need to instantiate the generic
22:30:26shashlick@awr1 ah okay
22:30:42leorizeAraq: it gives me an error about wrong definition
22:31:01shashlickif 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:12leorizeAraq: the definition was: proc `=destroy`[T: AsyncPipeObj | PipeObj](p: var T)
22:31:14shashlickthat way you don't need to depend on nimterop as the end user or run it at compile time
22:31:37leorizethe compiler said it expects: proc `=destroy`[T: object](var T) :P
22:31:43shashlickproblem 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:31FromGitter<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:36shashlick@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:06FromGitter<awr1> even if their implementation internally depends on compiler specific internals
22:33:08shashlickit could be a build issue but both versions of choosenim were built by the CI automatically
22:33:40shashlick@awr1 - I've documented my opinion on the nimterop readme in the later sections on compile time
22:34:03shashlickI don't think of it as different than cmake or some other tool that's required at build time
22:34:12shashlickbut if you don't need to depend on it, why not
22:34:27shashlickit might be more work for you to ensure that the wrappers work predictably though
22:34:38shashlickmight have to add more code to check for conditions, etc.
22:36:58nerdrat[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:15FromGitter<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:19shashlickCan you try the debug version
22:37:25shashlickIt's posted on the release page
22:37:37shashlickOr compile a build locally
22:39:20*ZoomZoomZoom joined #nim
22:39:37*ZoomZoomZoom quit (Read error: Connection reset by peer)
22:40:56shashlick@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:35shashlickBut there are limitations
22:41:42shashlickTime and info
22:42:04FromGitter<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:28FromGitter<awr1> the Nimterop equivalent, if sources changed, would be to just force a rebuild
22:49:01shashlickThat's how it works
22:49:02shashlickStuff is cached
23:01:50*inv2004 joined #nim
23:01:58inv2004Good night,
23:02:53inv2004I 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:42inv2004Is 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:30inv2004... probably converter
23:15:04FromDiscord_<exelotl> if I do "import foo" is there a proper way to have it find "foo.nim" in "$projectDir/foo/src"
23:17:10FromDiscord_<exelotl> oh wait that path is incorrect anyways
23:24:20FromDiscord_<exelotl> basically my project looks like this
23:24:20FromDiscord_<exelotl> https://cdn.discordapp.com/attachments/371759389889003532/702661094262702121/unknown.png
23:27:11FromDiscord_<exelotl> so like, I can solve it with --path:"foo/src"
23:28:02*inv2004 quit (Quit: Leaving)
23:28:12FromDiscord_<exelotl> but then I need to do that for every new library that I add as a submodule
23:33:51FromDiscord_<exelotl> curiously, `nim dump` doesn't seem to show any nimble paths?
23:36:34shashlickThat's why there's package managers
23:36:50FromDiscord_<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:09FromDiscord_<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:21FromDiscord_<exelotl> and also so that I can't forget to push a change in a dependency
23:41:50FromDiscord_<exelotl> and also so that it's easy for him to change the code of a dependency that we wrote
23:42:24FromDiscord_<Elegant Beef> Nimble supports github hosted dependancies
23:42:29FromDiscord_<Elegant Beef> git*
23:45:07FromDiscord_<exelotl> Truuue
23:51:14*krux02_ joined #nim
23:55:31*krux02 quit (Ping timeout: 265 seconds)
23:55:56*ftsf joined #nim