<<11-01-2019>>

00:10:06FromDiscord_<moerm> *** forum server problem? *** The forum is *very* slow currently
00:13:45*zyklon joined #nim
00:16:37*xet7 quit (Quit: Leaving)
00:20:09FromDiscord_<exelotl> when wrapping a C function pointer type, should I use {.noconv.} or something else?
00:26:04*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:26:05*zyklon quit (Read error: Connection reset by peer)
00:26:45*shpx joined #nim
00:31:30*shpx quit (Client Quit)
00:32:53*shpx joined #nim
00:37:01FromGitter<dom96> moerm: seems fast for me. Maybe your internet?
00:39:59*leorize joined #nim
00:42:28*zyklon joined #nim
00:42:36*wildlander quit (Quit: Konversation terminated!)
00:44:09FromDiscord_<moerm> @dom96 Yes. It's OK again (whatever the reason was. maybe my ISP)
00:44:40*theelous3 joined #nim
01:01:03*ng0 quit (Ping timeout: 256 seconds)
01:04:24*ng0 joined #nim
01:24:11*lritter quit (Remote host closed the connection)
01:33:04*leorize quit (Remote host closed the connection)
01:33:30*leorize joined #nim
01:35:35FromDiscord_<domain3000> Sex dating Discord > http://discord.amazingsexdating.com
02:03:29*Tyresc quit (Quit: WeeChat 2.4-dev)
02:23:48*gangstacat quit (Ping timeout: 245 seconds)
02:26:08*ng0_ joined #nim
02:28:53*ng0 quit (Ping timeout: 256 seconds)
02:57:41*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
03:00:35*banc quit (Quit: Bye)
03:01:53FromDiscord_<moerm> see you
03:04:12*abm quit (Read error: Connection reset by peer)
03:17:01*banc joined #nim
03:24:41*cspar_ joined #nim
03:25:48*cspar quit (Ping timeout: 250 seconds)
03:40:18*dddddd quit (Remote host closed the connection)
03:52:57*oculux quit (Quit: blah)
04:01:23*nsf joined #nim
04:02:58*oculux joined #nim
04:03:05*oculux quit (Client Quit)
04:03:38*oculux joined #nim
04:21:08*kapil____ joined #nim
04:30:31FromGitter<gogolxdong> How to convert slice to seq?
04:36:08FromGitter<kaushalmodi> you mean an array to seq?
04:36:24FromGitter<kaushalmodi> I believe `newSeq` + `for` loop is the way to go: https://github.com/nim-lang/Nim/blob/ab425d793af1a5c0b221bfbeab382b4781479c63/lib/system.nim#L3391-L3395
04:38:24FromGitter<kaushalmodi> you shouldn't need `newSeq`, but I think it would be more efficient than doing `.add` starting from an empty `@[]`
04:39:25FromGitter<gogolxdong> sorry, slice to JsonNode
04:39:40FromGitter<gogolxdong> not array , slice like data[1..^1]
04:41:24FromGitter<gogolxdong> in karax
04:41:51FromGitter<kaushalmodi> `dat[1 .. ^1]` would technically be a seq
04:42:01*Marumoto quit (Ping timeout: 244 seconds)
04:42:14FromGitter<kaushalmodi> `Slice` / `HSlice` is simply a 2-element object
04:42:45FromGitter<kaushalmodi> that said, not sure how I would convert that slice to JsonNode
04:42:55FromGitter<kaushalmodi> s/slice/seq
04:43:26leorizeit's technically an array so it can be treated as an array in JsonNode?
04:44:25FromGitter<kaushalmodi> https://nim-lang.github.io/Nim/system.html#%5B%5D%2CopenArray%5BT%5D%2CHSlice%5BU%2CV%5D shows that the HSlice notation input returns a seq
04:58:48*Marumoto joined #nim
05:02:00*theelous3 quit (Ping timeout: 250 seconds)
05:05:26*leorize quit (Remote host closed the connection)
05:28:24FromGitter<gogolxdong> something like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c38297883c7e377654ed204]
05:29:37*Marumoto quit (Ping timeout: 268 seconds)
05:34:35*darithorn quit (Quit: Leaving)
06:07:18*vlad1777d joined #nim
06:11:03*narimiran joined #nim
06:25:45*NimBot joined #nim
06:38:23*leorize joined #nim
06:50:22*s3govesus quit (Ping timeout: 272 seconds)
06:53:00*krux02 joined #nim
07:04:43*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:09:32*kapil____ quit (Quit: Connection closed for inactivity)
07:09:46*Marumoto joined #nim
07:11:36Araqhttps://www.twitch.tv/araq4k
07:11:47AraqDAILY SCRUM LIVE STREAM!
07:11:51Araq;-)
07:23:42*absolutejam_phon joined #nim
07:24:04*absolutejam_phon quit (Read error: Connection reset by peer)
07:26:01*LargeEpsilon joined #nim
07:28:26*LargeEpsilon quit (Client Quit)
07:41:47*gangstacat joined #nim
07:42:50*BigEpsilon joined #nim
07:53:34Araqin case you missed it
07:54:23Araqjoin us on Monday
07:59:14*vlad1777d quit (Ping timeout: 250 seconds)
08:00:35FromGitter<Varriount> Araq: Any idea if Twitch has a way to send love streams into your head while you sleep? 😉
08:02:10*miran joined #nim
08:02:47*narimiran quit (Ping timeout: 240 seconds)
08:03:39*miran is now known as narimiran
08:09:04*absolutejam joined #nim
08:09:07absolutejammorning
08:09:29narimiranmorning
08:11:22absolutejamyou ever dream of code?
08:11:26absolutejamthink I need more sleep.
08:28:25absolutejamdoes defer always do something last or is it only in the event of an exception?
08:28:29absolutejameg defer myFile.close
08:30:27leorizealways do something
08:30:49leorizeand you shouldn't use defer that way
08:31:06leorizeit's quite different than expected
08:32:26leorizeeg. let myFile = open(); defer: close myFile is equal to try: let myFile = open() finally: close myFile
08:33:05leorizewhich means it will be called anyway if open() failed, possibly freeing whatever is it that myFile is refering to at the callsite
08:34:25absolutejamwhat's the correct approach for this then?
08:34:34*zyklon quit (Read error: Connection reset by peer)
08:34:59leorizeuse an explicit try-finally block
08:36:19Araqleorize, I think that's a myth I'm responsible for
08:36:35Araqand defer for file closing works fine
08:36:49AraqI never use 'defer', that's why I'm not sure
08:38:39absolutejamSorry, how is your example different leorize?
08:38:42absolutejamNot had my morning coffee yet
08:39:21absolutejamlet foo = open(...); defer foo.close
08:39:31absolutejamis what I have now, but I wasn't sure if it was correct
08:41:11leorizeAraq said it's fine to use it like that so :P
08:51:28*zyklon joined #nim
09:03:51Araqdon't ask me, try it for yourself, inspect the C code with -d:release (release makes it easier to comprehend)
09:06:32*banc quit (Ping timeout: 272 seconds)
09:07:45*xet7 joined #nim
09:07:46*livcd quit (Remote host closed the connection)
09:07:53*livcd joined #nim
09:07:55*banc joined #nim
09:16:44FromGitter<deansher> And perhaps if you are up for making a contribution, find the place in documentation where the behavior should have been made clear and submit a PR to make it clear? "Use the force, read the intermediate code source" being an awesome available option but a bit extreme. :-)
09:20:15*xet7 quit (Quit: Leaving)
09:22:37krux02nim gdb debugging stream: https://www.twitch.tv/araq4k
09:23:35absolutejamwell, it's not that it's unclear tbh
09:23:46absolutejamit's just not a feature I'm familiar with
09:25:36Zevv"RAII"
09:26:53absolutejamwhere do 'pragmas' come from?
09:26:58absolutejamis it a feature from another language?
09:30:40*xet7 joined #nim
09:31:45*shpx joined #nim
09:33:16*Marumoto quit (Ping timeout: 250 seconds)
09:36:20*Marumoto joined #nim
09:40:24*sheerluck joined #nim
09:42:48*nc-x joined #nim
09:43:00nc-xaraq krux02
09:43:09nc-xthat code is due to https://github.com/nim-lang/Nim/pull/10026
09:43:19nc-xcan probably be removed if you do your patch
09:44:00FromGitter<alehander42> maybe you need to comment on the stream, not sure if they'll see it here
09:44:46nc-x can you post it there?
09:44:51nc-xi am not on twitch
09:49:46Araqhttps://github.com/nim-lang/Nim/issues/10240
09:53:47*nc-x quit (Ping timeout: 256 seconds)
09:54:04*xet7 quit (Ping timeout: 264 seconds)
09:54:07*Marumoto quit (Ping timeout: 240 seconds)
09:54:41*floppydh joined #nim
10:19:59*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:25:21*OrganicAnywhere joined #nim
10:28:29*shpx joined #nim
10:28:58*chemist69 joined #nim
10:32:43*Vladar joined #nim
10:45:22*dom96_w joined #nim
10:58:18*cspar_ quit (Ping timeout: 268 seconds)
10:58:23*cspar joined #nim
10:58:50dom96_wAraq: No recording of livestream? :(
10:59:32*CcxWrk quit (Ping timeout: 268 seconds)
11:00:23*ng0_ is now known as ng0
11:01:13*nc-x joined #nim
11:01:47nc-xdom96_w: araq said it will be uploaded on youtube
11:01:59Araqyeah I have the recording
11:02:14Araqbut we're thinking about redoing it :P
11:02:25nc-xlol
11:02:52Araqbut hey, we fixed 2 bugs
11:03:11*absolutejam_phon joined #nim
11:03:37*absolutejam_phon quit (Read error: Connection reset by peer)
11:05:41dom96_wRedoing it? You've already fixed the bugs, there is no re-do's :P
11:05:47dom96_wJust upload it, the more videos the better
11:07:44FromGitter<mratsim> killer app incoming: https://github.com/bluenote10/nim-electron-karax
11:08:26dom96_w:o
11:08:51FromGitter<kayabaNerve> But does it count as an app
11:09:37dom96_w.to(cstring) wat https://github.com/bluenote10/nim-electron-karax/blob/master/src/main.nim#L40
11:10:08FromGitter<kayabaNerve> Shhhhhhhh
11:10:15FromGitter<kayabaNerve> Code's not bad if you never have anyone review it
11:10:34FromGitter<kayabaNerve> Just shift your paradigm /s
11:10:46*PMunch joined #nim
11:11:20FromGitter<alehander42> what is the problem with `to(cstring)` ?
11:11:41dom96_wI've never seen it and it makes me wonder why it exists
11:11:46dom96_wyou can just write .cstring
11:11:50*CcxWrk joined #nim
11:11:53FromGitter<alehander42> no .. this is a JsObject
11:12:03dom96_woh
11:12:30FromGitter<alehander42> i can agree that maybe `cast` is better because it makes people use stuff like this less and type their objects more
11:12:41FromGitter<alehander42> but it's an acceptable helper for prototyping
11:13:15dom96_wIMO it shouldn't be called `to`
11:13:20dom96_wmaybe something like `getAs`
11:13:31dom96_wto make it clearer that there is some container and that it can fail
11:13:52FromGitter<alehander42> `as` is better indeed, `to` implies that there is a conversion going on
11:14:28FromGitter<alehander42> `getAs` because `as` is a keyword?
11:14:44dom96_wbecause that's too short
11:14:56dom96_wand to imply that there is some runtime thing happening
11:15:09FromGitter<alehander42> but there is no runtime thing happening
11:15:27FromGitter<alehander42> it's an escape hatch for the type system
11:15:53Araqthe escape hatch is spelt 'cast'
11:15:53dom96_wSo if I write .to(MyRandomObj) it won't raise an exception?
11:16:13FromGitter<alehander42> yes, it's equivalent to `cast`
11:16:31Araqmratsim: very interesting indeed. if only we had an electron alternative, but oh well
11:17:16*CcxWrk quit (Ping timeout: 244 seconds)
11:17:33absolutejamkeep getting caught out by not declaring my Type properties as public
11:17:38absolutejam/ exported
11:17:41*OrganicAnywhere quit ()
11:17:51absolutejamis it a type 'field'?
11:18:04Araqyep
11:18:17FromGitter<alehander42> honestly i expect such an alternative would depend on wasm one day (in order to be still working well in browsers, but having a slimmer runtime)
11:18:24dom96_walehander42: huh, so what will happen?
11:18:36FromGitter<alehander42> @dom96 it's literally a cast
11:18:36Araqyeah to be honest, I think we picked the wrong default years ago and 'public' should be the default
11:18:40*dddddd_ joined #nim
11:18:41dom96_wDo I get JS errors because the field's don't exist (if I `to` on an object)?
11:18:49Araqbut nobody agrees with me, so ... it's ok
11:18:50narimiranagreed for public
11:18:57Araqdamn.
11:19:02narimiranit has bitten me so many times
11:19:12AraqrunnableExample catches it though
11:19:13narimiranand the reversed way seems more logical to me
11:19:15*dddddd_ is now known as dddddd
11:19:20Araqbecause it runs it from a client module
11:19:21narimiranbut i guess that train has left....
11:19:33FromGitter<alehander42> @dom96_w a.to(B) <=> castB (a)
11:19:38FromGitter<mratsim> explicit (public) better than implicit?
11:20:48narimiranor is 'ship has sailed' the english version
11:20:49FromGitter<alehander42> so in this sense, `to` does nothing on runtime, it expands to `a`
11:20:58Araqwell in the stdlib most symbols are public, in the compiler most are private
11:21:04narimiran'train has left' is the direct translation from croatian :D
11:21:17Araqso it depends on the domain I guess
11:21:33FromGitter<alehander42> narimiarn, i am surprised, you have such a coastline!
11:21:46Araqnarimiran, I think English has this saying, at least I immediately understood it
11:21:56dom96_walehander42: again, what happens when I cast (`to`) to something silly?
11:22:01Araq"this ship has sailed"
11:22:05Araq"this train has left"
11:22:33absolutejamI just need to get it into my muscle memory
11:22:48FromGitter<alehander42> @dom96_w the operation that takes the result of `to` might raise, but `to` itself can't
11:22:52narimiran@alehander42 i live by the sea, i guess i've gotten used to it
11:23:10FromGitter<alehander42> @dom96_w if you don't do anything with the result of an incorrect cast, nothing will happend
11:24:14FromGitter<alehander42> `to` is a noop
11:24:49Araqoh, it's Friday
11:25:04Araqcould stream more.
11:25:20Araqwanna see me add markdown features to our RST pipeline?
11:25:21narimiranAraq: back to business: it is nice that we have clickable types in the documentation, but what would be nice (i would have used it so many times in the last few days) to have proc name clickable to give you the direct link to it
11:25:41FromGitter<mratsim> ^
11:26:13narimirannow if you click on its name in the contents on the left, that happens (you get the direct link), but not when you in the documentation part
11:26:25narimiran(i hope i have explained what i mean)
11:26:34Araqnarimiran, well you know how the docgen works, I showed you ;-)
11:26:37*theelous3 joined #nim
11:27:27narimiranok, putting it on my todo list :)
11:27:48Araqon my list: - []() links (never remember the order)
11:27:53Araq- headers with #, ##
11:27:58narimiranso: markdown
11:27:59Araqanything else?
11:28:16narimiran`code` not doubletick
11:28:26Araqthat's part of RST already
11:28:35Araqbut I can change its rendering style
11:29:09narimiran`foo` gives you some kind of italic (similar to asterisks), ``foo`` gives you code
11:29:16FromGitter<alehander42> @dom96 at the very least we have to add better explanation of how the dynamic JsObject and normal types interact to jsffi docs, i'll try to do that this month
11:30:13dom96_wAraq: Don't create a frankenstein
11:30:20narimiran^
11:32:00dom96_wWrite an asciidoc parser from scratch instead ;)
11:32:07narimiranhahah
11:32:20Araqwe already have markdown extensions, ```nim comes to mind
11:32:29Araqand RST is quite close to markdown
11:32:46Araqand I don't want to migrate to markdown completely because it's shit
11:33:08Araqadding 2 more features won't kill us, we already have the frankenstein, might as well put some lipstick onto it
11:33:17narimiranok, then implement just []() and # headers
11:33:29narimiranand we won't tell you that we now have markdown :D
11:34:45Araqand I might fix this RST specific problem where stuff is simply left out instead of a proper error message
11:36:35Araqdoes anybody have an example handy?
11:36:41*CcxWrk joined #nim
11:37:25narimirani *think* that putting `..code-blok::` (without space between .. and code-block) silently ignores that block
11:37:43narimiranor something like that has tripped me in the past
11:39:46federico3https://forum.nim-lang.org/t/4524#28312 nice tip on nesting templates in macros. Should this go in the manual?
11:40:44FromGitter<GULPF> Another rst issue: for single paragraphs, no <p> element is created. This messed up the spacing, especially when there is a runnable examples code block below the paragraph.
11:41:37FromGitter<GULPF> example: https://nim-lang.github.io/Nim/times.html#toParts%2CDuration
11:42:11FromGitter<GULPF> Compare the spacing before "Examples: " for that proc and the one below
11:42:33narimiranhey @GULPF i don't know why gist notifications don't work (i also didn't get a notification for your reply), so if you manage to update that list of most used packages, please ping me here
11:42:50absolutejamis there a more extensie style guide than the one on the website?
11:43:02FromGitter<GULPF> @narimiran ok, will do
11:43:26narimiranabsolutejam: just follow this https://nim-lang.org/docs/nep1.html and you'll be fine
11:44:03narimiranabsolutejam: also, there is a tool called `nimpretty` you could use
11:44:45dom96_wGULPF: IMO that's just something the "Examples" should do, it should add some padding
11:45:26narimirandom96_w: but it is different if there is one line of text above it or multiple lines
11:45:29absolutejamYeah, I've seen that but some languages have a community style guide with more examples
11:45:41absolutejamthis isn't me having a go, I'm just curious if it currently exists
11:52:38FromGitter<kayabaNerve> Araq: Electron alternative? What about WebView? ⏎ ⏎ It's not a browser that runs HTML/JS and so on. It's a... library? for native code to create a pseudo browser to display HTML/CSS and run JS.
11:52:56FromGitter<kayabaNerve> I'm using it for a GUI in my Nim app.
11:53:00Araqthese libs tend to be terrible to build
11:53:22Araqhow do you do it?
11:53:55*nc-x quit (Quit: Page closed)
11:54:21dom96_wMy dream is an Electron written in Nim. Just a framework that makes creating GUIs in libcef easy
11:54:27PMunchAh the age old discussion of UI toolkits. Guess I should continue work on my own UI toolkit..
11:54:56absolutejamhttps://xkcd.com/927/
11:55:07FromGitter<alehander42> i cant really see how all of those fix the bloat of having a browser engine
11:55:19PMunchI don't even need to click that to knw which one it is :P
11:55:19FromGitter<alehander42> and stuff on top of it
11:55:49PMunchMy idea though is to use the native toolkits, but not in a 1:1 way like WxWidgets or NiGui
11:56:05FromGitter<alehander42> @PMunch and how would you target a browser
11:56:17PMunchBy having a browser target
11:56:30Araqproblem is that the browser, its DOM and event model are everywhere
11:56:39Araqand quite portable.
11:56:54FromGitter<alehander42> would it be easy to map the same ui to html/css ?
11:57:54absolutejamnarimiran: where's that?
11:58:10PMunchWell the idea is to tell the graphical toolkit what you need in terms of inputs and outputs and then let the target decide how to display them.
11:58:14narimiranabsolutejam: where's what?
11:58:22PMunchWith some more manual control than that though :P
11:58:29absolutejamnimpretty
11:58:48absolutejamis it a 3rd party util? didn't see it on Nimble
11:58:57FromGitter<alehander42> PMunch, and would it be easy to ensure you produce the exact same behavior for all targets
11:58:58narimiranabsolutejam: i think it should come preinstalled with nim
11:59:05FromGitter<alehander42> behavior+looks
11:59:20absolutejamhttps://github.com/nim-lang/Nim/issues/7420 - Don't think it's there any more?
11:59:26*livcd quit (Changing host)
11:59:26*livcd joined #nim
11:59:35PMunchalehander42, the entire point is that looks shouldn't be the same. Function should be the same, looks should depend on the system.
11:59:52FromGitter<alehander42> ehhh, it's debatable if this is a good thing
11:59:54narimiranabsolutejam: no, there definitely is, 0.19.2 had lots of fixes for it
12:00:12narimiranabsolutejam: https://github.com/nim-lang/Nim/tree/devel/nimpretty
12:00:15FromGitter<alehander42> people start to get used to having the same recognizable ui everywhere
12:00:59PMunchalehander42, oh definitely. But the idea is to decouple function from UI, but through a modular system allow the user to manually create UIs for each target if they want, or rely on a "UI target engine" to create one for them based on platform guidelines.
12:01:06narimiranabsolutejam: if you installed nim via choosenim, i don't know if it comes bundled or not
12:01:11absolutejamoh, I did
12:01:14absolutejammb
12:01:27AraqIMHO this is a typical programmer's perspective ("Must use native UI"), ordinary users appreciate when the program looks the same on every OS instead
12:01:37livcdwhy not sciter ?
12:01:58PMunchalehander42, well most desktop apps would probably end up looking the same since the UI toolkits are similar. But a mobile app shouldn't look anything like a desktop app, and a TUI shouldn't look like a GUI
12:03:07PMunchAraq, disabled people really prefer native UIs though since they have much better accessibility options than some custom made system
12:03:18PMunchAnd they tend to be very optimised
12:03:27livcdwhich reminds me that the sciter bindings for nim are probably outdated at this point
12:03:35dom96_wWeb Browsers have pretty good accessibility nowadays
12:03:39Araqdisabled people have no choice and to use the internet though
12:03:44dom96_wI wouldn't be surprised if it's better than native in fact
12:04:07livcddom96_w: you really liked how glasswire looked right ?
12:04:27dom96_wyep
12:04:39PMunchdom96_w, well they can't offer the same level of contextuality though seing how every UI element nowadays is just a super styled div.
12:04:48livcdwas stalking you and accidentally discovered glasswire as well
12:04:57livcdbeautiful desktop apps are a scarcity
12:16:34absolutejamdoes it make sense to put nimpretty in Nimble?
12:17:16FromGitter<zacharycarter> not much has changed - http://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/
12:17:36narimiranabsolutejam: it comes with nim, it's just that choosenim isn't updated yet to include it, AFAIK
12:18:08FromGitter<zacharycarter> I guess it depends what your GUI needs are - if you're building a desktop app and you are willing to spend a lot of time optimizing or you don't care about performance - electron is a fine candidate
12:18:34absolutejamI was trying to build it manually but it's bawking ../compiler/pathutils.nim(13, 22) Error: cannot open file: pathnorm at me
12:18:36FromGitter<zacharycarter> webviews might work in certain scenarios - but they are not for every situation
12:18:57FromGitter<zacharycarter> for instance - the games industry has moved away from and scrapped most engine tooling that was built around CEF / web views
12:19:11FromGitter<zacharycarter> for multiple reasons
12:19:34FromGitter<zacharycarter> the most obvious - C++ devs aren't going to be necessarily great at working with the web
12:20:17FromGitter<zacharycarter> I don't really think we need a "Nim electron"
12:20:20FromGitter<zacharycarter> electron is enough - isn't it?
12:20:43FromGitter<zacharycarter> what we need is - https://github.com/trustable-code/NiGui - to be finished
12:20:52narimiranabsolutejam: since you have choosenim, do `choosenim update devel` and then `choosenim devel`, and then try to build it
12:25:00FromGitter<kayabaNerve> Araq WebView is a header. A singular C (I think C, not C++) header you include and walk away. There's no linking. It uses various OS APIs to handle the actual browser. It's a cross-platform abstraction.
12:25:20FromGitter<kayabaNerve> I do have to admit it's minimal. I liked it because it didn't have Electron bloat, but I do think it may cut back too far...
12:28:50FromGitter<zacharycarter> https://deplinenoise.files.wordpress.com/2017/03/webtoolspostmortem.pdf
12:29:10FromGitter<zacharycarter> webview is limited - and it's a bit clumsy to work with, as you need to communicate with the host process via sockets
12:30:03*absolutejam_phon joined #nim
12:30:35*absolutejam_phon quit (Read error: Connection reset by peer)
12:31:22FromGitter<zacharycarter> off to work
12:33:59FromGitter<alehander42> @PMunch of course, TUI is different, but I am not sure if the web UI should be different: at the very least you either need ~ 2x the manpower/manhours to do 2 ui-s or your engine must be really good in abstracting away the differences which seems hard
12:34:02*sheerluck quit (Quit: Leaving)
12:34:34FromGitter<kayabaNerve> @zacharycarter You don't need to use sockets
12:34:38FromGitter<alehander42> socket communication can be abstracted/hidden pretty neatly by nim macros
12:34:45PMunchWell WebUIs can be two quite different things
12:34:45FromGitter<kayabaNerve> Or if you do, it's abstracted to the point I don't even notice.
12:34:54FromGitter<kayabaNerve> I've bound Nim functions and called them over JS.
12:34:58FromGitter<kayabaNerve> That's how I communicate.
12:35:09PMunchA web site and a web app can look completely different
12:35:15FromGitter<zacharycarter> well web sockets
12:35:24FromGitter<kayabaNerve> You can just bind functions
12:35:42FromGitter<kayabaNerve> I'm not denying the possibility it's internally using web sockets to call bound functions
12:35:52FromGitter<kayabaNerve> I'm saying I've never touched web sockets while I've used WebView
12:35:54FromGitter<alehander42> @kayabaNerve i think i've done something similar with methods invoking sending stuff with json thru socket
12:36:05FromGitter<zacharycarter> if you're doing something with the JS backend sure
12:36:13FromGitter<zacharycarter> but I'm not quite sure how you're going to do that with the C backend
12:36:15FromGitter<kayabaNerve> I'm using JS to call Nim.
12:36:19FromGitter<alehander42> you can communicate with the c backend in the same way
12:36:20FromGitter<zacharycarter> oh I see
12:36:21FromGitter<kayabaNerve> Which is via the C.
12:36:33FromGitter<kayabaNerve> And the Nim wrapper doesn't have socket macros
12:36:39FromGitter<kayabaNerve> And I haven't wrote ANY socket code
12:36:40FromGitter<zacharycarter> I don't know - I've only ever seen people use web sockets with web view
12:36:54FromGitter<kayabaNerve> That said, it's a bitch about threads. It requires being on the primary thread for Linux/Mac to work. You then lose all access over that thread, which makes safe shutdowns and event loops impossible
12:36:55FromGitter<zacharycarter> but your method sounds feasible
12:36:59FromGitter<zacharycarter> yeah
12:37:10FromGitter<kayabaNerve> I legit have a setInterval immediately execute so I can track Channels
12:37:30FromGitter<kayabaNerve> I say, OK, I can't have this thread, call my code every 0.06 seconds so I can have thread comms
12:37:35FromGitter<alehander42> @PMunch yeah, but I am talking about the typical usecase, e.g. if you build slack/spotify/<myissueapp> etc , you would love if you can get desktop and web app versions with almost the same code(with some edge cases maybe)
12:37:37FromGitter<kayabaNerve> It's such a dirty hack
12:37:41FromGitter<zacharycarter> :P
12:37:51FromGitter<zacharycarter> the best kind
12:38:29FromGitter<alehander42> I am just trying to say that this is not trivial and there is a reason why electron/similar stuff is succesful: your idea sounds cool and i hope it can take off
12:39:04PMunchalehander42, yeah that is part of the idea. Basically keep more or less the exact same code for the functionality, and then have the option of generating, generating with guiding, or completely custom making a UI.
12:39:06FromGitter<alehander42> (maybe flutter will also get there? they target the canvas in web ui, but i have no idea if they have desktop versions)
12:39:28Araqer ...
12:39:43AraqVS Code on Windows doesn't accept my '}'
12:39:51absolutejamnarimiran: 👍
12:39:53Araqany ideas what might cause this?
12:39:53absolutejamthanks
12:40:01AraqI can type '{' just fine though
12:40:25FromGitter<alehander42> i think it's hard to separate a lot of the ui logic: e.g. if you have to create a complicated tree component, but write a separate html ui, wouldn't you need special case javascript/css handling code etc
12:40:37FromGitter<zacharycarter> Araq: have you recently installed any extensions or changed any key bindings?
12:40:58FromGitter<zacharycarter> I've seen extensions override key bindings before in VSCode - but it'd be very weird if one was overriding `}`
12:41:16FromGitter<zacharycarter> you might also check the VSCode console / error log and see if anything is going on there
12:42:41Araqgood points
12:43:33Araqmy console is full of [Extension host]
12:43:48Araq=outline about my .nim files
12:44:45*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:44:53Araqand in the console I can type }
12:45:19*Vladar quit (Remote host closed the connection)
12:45:29narimiranthis should be printed as an evidence why indentation-based languages are better :D
12:45:59*Vladar joined #nim
12:46:23Araqit's one of these days...
12:46:30AraqI dunno why I use VS code
12:47:00FromGitter<zacharycarter> I think it's the extensions - they're so convenient until they start breaking things
12:47:31FromGitter<zacharycarter> In the output tab - there is a drop down menu where you can inspect output from various output streams in VSCode
12:47:39FromGitter<zacharycarter> there are quite a few of them - sometimes I find weird issues with VSCode lurking there
12:47:55*shpx joined #nim
12:48:18FromGitter<zacharycarter> but in general I agree - VSCode suffers from a lot of the same problems that Atom did - even if it did solve a lot of the performance problems
12:48:43FromGitter<zacharycarter> I'd be very curious to hear people's experiences using a modal editor + LSP or Sublime Text + LSP
12:48:53FromGitter<zacharycarter> anywho - now I'm really off to work ;P
12:49:26*Jehan_ joined #nim
12:52:38PMunchzacharycarter, I use Vim + LSP, great experience :)
12:52:59FromGitter<alehander42> i am also using sublime, but haven't started with lsp yet
12:53:08FromGitter<alehander42> but instlaling it
12:53:39absolutejamI use VSCode with Vim mode
12:54:02absolutejamI need to get my Vim-fu down and move over more
12:54:25absolutejamLSP?
12:54:34narimiranabsolutejam: same here. and it is okayish. not perfect, but for me it's ok to get some of vim functionality combined with vscode goodies
12:55:00absolutejamyeah, it's pretty good, but there are times it frustrates me
12:55:39absolutejamlike ctrl K + o to open a project folder doesn't work because Vim mode intercepts it, and transversely, things like :edit aren't implemented
12:55:56absolutejamSo I have to jump between VS Code and Vim keybinds
12:56:38narimiranabsolutejam: you can do `"vim.useCtrlKeys": false`to have your ctrl enabled
12:57:32absolutejamI haven't looked at the vim config tbh haha
12:57:35absolutejamshould really
12:58:09absolutejamI really like VS Code's ability to keybind based on things like if you're in the terminal, or if you have a nim file open
12:58:13absolutejamthat's slick as
12:58:34narimiran...this is getting quite offtopic ;)
12:59:51absolutejamyeah, sorry haha
13:00:40*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:01:23absolutejamanyone used nimyaml?
13:05:43PMunchabsolutejam, you asked about LSP. It's a way to get Nim support in different editors
13:06:15absolutejamoh, language server protocol?
13:06:20PMunchlangserver.org and Nim implementation: github.com/PMunch/nimlsp
13:06:24PMunchYes
13:08:42*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:12:31*shpx joined #nim
13:24:00*nsf quit (Quit: WeeChat 2.3)
13:24:35FromGitter<timotheecour> @araq https://github.com/nim-lang/Nim/pull/10274 fixes a serious bug
13:27:46*cspar_ joined #nim
13:28:40Araqis that the famous control+C OSX bug?
13:30:21*cspar quit (Ping timeout: 246 seconds)
13:30:44leorizetimotheecour: I don't think you should use commandLineParams()[0]
13:31:55leorizeand yea, c_system can return < 0, but looks like was ignored long ago so I didn't add an exceptions there
13:31:55FromGitter<timotheecour> what’s the famous control+C osx bug? I actually have a bug I haven’t yet reported related to that, but not sure that’s the 1 u’re referring to
13:32:37FromGitter<timotheecour> it think the 1 i had w control C was different: when kill parent process, child processes keep running, I have a local repro for that; will report it
13:33:32FromGitter<timotheecour> @leorize r u the same person as @alavis? sorry i’m getting confused w ppl having different handles
13:33:34*ng0 quit (Remote host closed the connection)
13:33:41leorizeyep
13:33:46*rect0x511 joined #nim
13:34:08*rect0x511 quit (Client Quit)
13:34:37*ng0 joined #nim
13:35:45Araqyeah that's what I mean, child process not killed
13:36:13FromGitter<timotheecour> ya, that’s a separate bug, and it’s also quite serious, and the fix shdn’t be too hard
13:39:15*rect0x51_l joined #nim
13:39:24*cspar_ quit (Ping timeout: 250 seconds)
13:39:46rect0x51_lis there a binarySearchTree or equivelant data structure in stdlib?
13:43:04Araqrect0x51_l, compiler/btrees is a stdlib candidate
13:43:19Araqonce we figured out how delete() in it :P
13:44:08rect0x51_loh, waiting for destructors?
13:44:24Araqno
13:44:39Araqwe don't have a BTree delete operation
13:44:49rect0x51_lI see
13:45:58Araqbut BTrees are much better than binary trees on today's machines
13:46:20rect0x51_lhmm didn't know
13:46:29rect0x51_linteresting
13:47:59FromGitter<timotheecour> araq i think we should make https://nim-lang.github.io/Nim/lib.html show docgen for `compiler/**` ; otherwise you’ll get questions like that
13:48:34leorizethe compiler is not a part of the stdlib
13:48:40FromGitter<timotheecour> we can put a big fat warning: `use it at your own risk, it may disppear and is not as tested as stdlib` but still useful to show
13:48:42leorizeit should not be there imo
13:48:52leorizeit could be elsewhere
13:48:54FromGitter<timotheecour> well it should be somewher
13:49:33Araqwe also should consider to use BTrees over hash tables
13:49:59Araqperformance is worse but there are no security problems with hashing attacks
13:50:00FromGitter<timotheecour> given that compiler is part of Nim repo (and will probably be for a while/forever), it would make sense to just show the docs there
13:50:17absolutejamCan somebody please tell me what I'm doing wrong here?
13:50:19absolutejamhttps://hastebin.com/ibuyopikib.nim
13:50:44leorizeuse `=`, not `:` for line 11
13:50:57rect0x51_lAre BTrees so performant in ram? Araq can you point to some relevant resource that explains why?
13:51:01FromGitter<timotheecour> (that’d also help ppl use it and discover/fix bugs etc; out of sight out of mind; also it’d help making ppl add more documentation to `compiler/**` which is not very well documented so far
13:51:40Araqrect0x51_l, because of hardware CPU caches
13:51:40absolutejamokay, done that
13:51:52absolutejamalso tried SomeType().init because I didn't know if it had to be instantiated first
13:52:09absolutejamoh wait
13:52:31absolutejamoh, so it was both
13:52:56leorizethat's not really what you want to do I assume
13:52:59absolutejamso colons for instantiating via SomeType() and = for function calls (I thought colons worked for function calls too)
13:53:15absolutejamand I have to SomeType().init(...)
13:53:18absolutejamright?
13:53:22leorizethe convention is initSomeType() :P
13:53:29absolutejamI know but that makes me feel icky
13:53:30narimiranabsolutejam: beside these small fixes, i'm not sure you're generally on the right path
13:53:35absolutejamI should be idiomatic, I know
13:54:00narimiranleorize: but SomeType is ref object, so `newSomeType` (cc absolutejam )
13:54:34leorizeoh yeah, I always use stack objects :P
13:55:09absolutejamwould that just be `type SomeType = object` then?
13:55:23rect0x51_lso... data are more easily cached if the tree has lower height?
13:55:32leorizeabsolutejam: depends on what you want
13:55:57leorizeif you need reference semantic, use ref object
13:56:00leorizeelse use object
13:56:19narimiranabsolutejam: here you go http://ix.io/1y2M/
13:56:31*dom96_w joined #nim
13:57:20dom96_wtimotheecour: the child process not killed bug has already been reported
13:57:36leorizenarimiran: we don't have result type overloading, so you shouldn't name your functions like that :P
13:57:51narimiranabsolutejam: and here is with a simple object http://ix.io/1y2P
13:58:11absolutejamI don't need a ref object ~I don't think~ but when I did it without ref, I couldn't use ``` proc `name=` ```
13:58:24narimiranleorize: i'm just typing quickly here to show an example of what works. but i agree — my second example is just a bit better :)
13:58:37leorizeabsolutejam: you can still use it without ref object
13:58:59absolutejamat what point is the object created in the last exampel narimiran ?
13:59:10*stefanos82 joined #nim
13:59:12leorizewhen the function begins
13:59:23narimiranwell, when the function is called :P
13:59:55absolutejamI'm lost. Is 'result' automatically an instance of SomeType?
13:59:58absolutejamin that example
14:00:01leorizeyep
14:00:11absolutejamoh fuck, I didn't know that
14:00:22leorizeresult is the special variable that's returned when the function ends
14:00:37absolutejamI knew about result, but I didn't know it did _that_
14:00:46leorizethis doesn't work for ref object, mind you :P
14:00:49narimiranabsolutejam: you can create an object without a function: `let test2 = SomeType(name: "xyz", something: 7)`
14:01:01leorizebecause ref object default is nil
14:01:12absolutejamYeah, but I wanted to a bit of validation, etc.
14:01:19FromGitter<timotheecour> @dom96 i guess that’d be https://github.com/nim-lang/Nim/issues/9616 ; ok
14:01:46absolutejamso initSomeType or what I was aiming for was SomeType.init(something="...")
14:02:12leorizemake your init proc take typedesc[SomeType] as the first param
14:02:42rect0x51_lok I see, in BTrees there are chunks of data in contiguous adresses, while in BST there are more spread out in memory, thus harder to cache.
14:03:11absolutejamah, I see
14:03:21absolutejambecause I was requiring an instance of SomeType
14:03:29rect0x51_lwow... and I'm being teached that BTrees are only for secondary memory...
14:03:39absolutejamokay, sorry, I realise this is pretty basic stuff
14:03:55absolutejamI need to revisit the whole ref thing again because as much as I think I understand it, I go away, write some code and get it wrong haha
14:04:20Araqrect0x51_l, in some way hardware advanced to be more disk-like
14:04:49Araqand RAM is not "random access"
14:05:27narimiranabsolutejam: nhf, but i think you should try to go slower, and first cover the basics. don't jump straight in the deep water. it will make your journey easier and more enjoyable in the long run
14:05:38absolutejamyeah, it's my own fault
14:05:52absolutejamI'm trying to prototype something and skipping over some of the finer details
14:06:58rect0x51_lAraq: you gave me enough puzzling for ~a week, thanks
14:07:05absolutejamokay, so if I switch my type to object or object of RootObj
14:07:31absolutejammy `name=` proc now spits out "Error: 'self.name' cannot be assigned to" on compile
14:07:52narimiranstart slowly and read the available learning resources, please.
14:09:43*Snircle joined #nim
14:09:52absolutejamyeah, sorry. I am actually reading the resources, but I'm jumping between a few at a time
14:10:42AraqJehan_, https://github.com/nim-lang/Nim/issues/10271 is why I've grown to dislike GCs ;-)
14:11:04Araqalways some weird heuristics and guesswork involved
14:11:40Araqand programmers do not understand why stuff is not freed "immediately" when it goes out of scope
14:11:52Jehan_Araq: Yeah, GCs offload programmer work on the language implementer. But that's the same reason why I consider GCs to be absolutely essential (outside of domains where they don't work).
14:12:24Jehan_Speaking of which, do you see any problem with enabling GC_set_all_interior_pointers(0) for the Boehm GC?
14:12:35Araqno
14:12:48Jehan_Hmm, I may write a PR for that, then.
14:13:12Jehan_Reason: it's currently the highest throughput GC for Nim (by a large margin) if you don't care about pause times.
14:13:30Araq there is no good automatic way to do MM
14:13:51Jehan_But with all interior pointers on, it basically adds two words to the size of each allocation that is an exact multiple of two words.
14:14:03Jehan_Depends on how you define good, I think?
14:14:14Araqsure :-)
14:14:41Jehan_I'd say that there is no good way to do manual memory management myself. :) Or, in essence, that it's all about tradeoffs.
14:15:40AraqBoehm still needs to care about interior pointers on the stack
14:15:49Araqbut I don't think you can disable that part
14:16:11Jehan_Yes, but that's a separate mechanism.
14:16:41Jehan_The setting is about pointers originating in heap objects or global variables.
14:18:03Araqwell let me put it this way: Allocations are always something worth optimizing and when you do you have fewer but bigger allocations and then "freeing as soon as you can" becomes more important and hopefully also less expensive
14:19:17Jehan_Are they, though? That would depend on the problem domain, I'd argue.
14:19:51absolutejamI'm rereading PMunch's blog post for the third time
14:22:33Jehan_Here's some performance data: https://gist.github.com/rbehrends/be15230b31a098c647e4cdbeb67af0f0
14:22:37PMunchIs that good or bad?
14:22:39*nsf joined #nim
14:22:57PMunchabsolutejam ^
14:23:15*vlad1777d joined #nim
14:23:33absolutejamIt's not the article that's at fault, don't worry :P
14:23:35AraqJehan_, benchmarks. ;-)
14:25:10Araqhere is what mark&sweep does for an app that keeps increasing its liveset (like a compiler): The time spent in its mark phase increases while at the same time it cannot free much
14:25:33Araqmark&copy: same problem
14:25:37Jehan_Yup. That's why the benchmark keeps a large liveset allocated throughout.
14:26:34Jehan_You can still keep tracing/sweeping work at O(allocation work).
14:26:43Araqreference counting: independent of the size of liveset
14:27:38Jehan_Yes, I know. I fully agree that a GC should be configurable.
14:27:38Araqand what C++/Rust do can be seen as one bit reference counting with essentially the same properties
14:28:06Jehan_Yeah, that's a point I've made myself before. No disagreement. :)
14:32:08Araqyes and then when you make programmers care about owning/non-owning pointers and back references the system suffers from cascading recursive freeing
14:32:39Araqwell at least that can be made incremental too
14:33:07FromDiscord_<Gilgamish> Hello, sorry for the stupid question but I've been googling for a while with no luck. I have two modules play and playerInput in the same folder (src)
14:33:07FromDiscord_<Gilgamish>
14:33:07FromDiscord_<Gilgamish> play uses playerInput, playerInput declares a type and some methods for said type. I can not for the life of me import playerInput into play.
14:34:36FromDiscord_<Gilgamish>
14:34:36FromDiscord_<Gilgamish> https://cdn.discordapp.com/attachments/371759389889003532/533292648904130581/unknown.png
14:34:53leorizeyou didn't export the type
14:35:15leorizeand you shouldn't use from import
14:35:33FromDiscord_<Gilgamish> Thanks!
14:35:48leorizeimport like that will only get you the type and not the methods
14:35:58Jehan_Yeah, I think Herb Sutter even had that result in a stack overflow once. :)
14:37:02Araqdifferent topic: I'd like to make our allocator "shared"
14:37:31Araqand here is what I've come up with: Every chunk has a threadId, the creating thread sets its ID
14:38:06Araqwhen currentThread.id == chunk.threadId it's the same owner and can dealloc() in it
14:38:19Araqotherwise it puts the deallocation request in a thread specific queue
14:38:34Araqthat the the owning thread occasionally needs to process
14:38:48Araqthe big question is: "what does occasionally mean"?
14:38:59Araqand: What if the owner died?
14:47:20*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:48:05ZevvIf the owner is terminating in a controlled way it should allocate all its resources. If it dies unexpectedly, I guess all bets are off. Or it should leave a will and pass all its resources to another thread, which probably get messy
14:48:59Araqothers can have pointers to the chunks that belong to the dying owner
14:49:19Jehan_Well, a POSIX thread at least can't really "die". Or rather, you can always intercept cancellation requests.
14:49:46Jehan_So, you could keep it around indefinitely for when you need to assign a new logical thread to it.
14:49:48*shpx joined #nim
14:50:13Araqhmm
14:50:58*shpx quit (Client Quit)
14:51:18Zevvthe 'occasional' part is also tricky. If a thread is not doing any allocations and is not waiting for any systems call, should it be interrupted? You can not possible add checking conditions into every loop?
14:51:31Zevv/possibly/
14:51:41AraqI can but I don't want to ;-)
14:53:32Jehan_Actually, this can be overridden by C calls, so not something that one should rely on. But still, you could always get a cleanup handler run before the thread terminates.
14:58:32Jehan_The easiest solution would be to handle it sort of like GC heuristics for when to collect, but then you'd run the risk of wasting memory. But that would be no different from what the GC currently does.
14:59:28Araqeverything except the easy global (spin)locking solution risks wasting memory
15:00:51ZevvHow bad can it be worst case? Is a thread is busy and not doing allocations, it will not look at its todo-queue, but it will also not be growing its own footprint.
15:01:24ZevvAs soon as it needs to do allocations itself, it will see the queue and do the cleanups
15:02:44ZevvThe current allocations from a thread can temporary be wasted, but can not grow larger.
15:03:24Jehan_Well, we can always say that this is okay and that if memory is so tight, then people need to explicitly invoke the cleanup process.
15:03:48Jehan_Or make it configurable.
15:04:15Araqwe can also check the queue before IO calls, these are already slow
15:06:22Jehan_Well, I think the typical problem case would be a computation-heavy part of the program.
15:06:23Zevvany system call
15:06:38AraqZevv, yeah that seems to be the worst case. On the other hand, checking the queue in every alloc() call doesn't feel right either
15:07:02Jehan_That allocates a bunch of memory, does a ton of CPU-heavy work, frees the memory (or thinks it does), and then goes back.
15:07:13ZevvDo it when its own memory grows by factor N, like 120%
15:07:26Jehan_Yup. Basically, the GC approach.
15:07:51Jehan_Though you can make the overhead much tighter, possibly even an absolute number.
15:08:36Jehan_The GC growth factor is predicated on the need to keep the collection/allocation work ratio bounded.
15:08:54Jehan_I'm not sure that this holds here, too.
15:09:09ZevvThese allocation requests queues should probably be smarter then a queue - they should only hold every unique request once for each thread
15:09:18Jehan_Hmm, actually, it may.
15:10:29Jehan_You may actually need to deallocate at a faster rate than you allocate, assuming there is a sufficient number of requests in the queue.
15:13:09*Jesin quit (Quit: Leaving)
15:13:50AraqZevv, there are no allocation requests, only deallocation requests
15:14:04Zevvsorry, that's what I ment
15:14:37Araqand they are "unique", you can free a pointer only once
15:15:16ZevvBut could three threads request the same pointer to be freed? Or the same thread request this more then once?
15:15:35AraqNo. and you can misuse the memory in the freed block to hold a singly linked list
15:15:53Araqlockfree singly linked list seems possible
15:15:59*zyklon quit (Read error: Connection reset by peer)
15:16:19ZevvIs there a minimum size for allocations? Your list should fit, even in small blocks
15:16:36Araqyeah, minimum size 16 bytes or something. then every alloc() needs to do an atomic read, cheap enough to always do it
15:19:44*Jesin joined #nim
15:21:39Araqcould work. A simple producer/consumer system then means the producer ends up doing all alloction work
15:21:47*floppydh quit (Quit: WeeChat 2.3)
15:24:17*vlad1777d quit (Ping timeout: 258 seconds)
15:29:37*pwntus joined #nim
15:29:37*pwntus quit (Changing host)
15:29:37*pwntus joined #nim
15:34:17*zyklon joined #nim
15:35:23*itschin joined #nim
15:47:26*Jehan_ quit (Quit: Leaving)
16:10:16*chemist69 quit (Ping timeout: 260 seconds)
16:12:22*absolutejam quit (Ping timeout: 250 seconds)
16:12:47*itschin quit (Ping timeout: 240 seconds)
16:15:20*itschin joined #nim
16:16:28*banc quit (Quit: Bye)
16:29:35*itschin quit (Quit: Leaving)
16:37:59*banc joined #nim
16:54:44*Geezus42 quit (Ping timeout: 268 seconds)
16:55:47*Geezus42 joined #nim
16:57:45*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
16:58:02*nsf quit (Quit: WeeChat 2.3)
16:59:14*mbomba joined #nim
17:00:06*mbomba left #nim (#nim)
17:06:35*narimiran quit (Remote host closed the connection)
17:08:27*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:08:51*narimiran joined #nim
17:09:20*narimiran quit (Remote host closed the connection)
17:09:52*narimiran joined #nim
17:10:22*dom96_w joined #nim
17:19:12narimiranhi guys, i'm using manjaro i3 and since recently when i do "open folder" in some program, i3 opens 'catfish'. how can i change this back to 'thunar', like it was before?
17:19:13*zyklon quit (Read error: Connection reset by peer)
17:19:21narimiraneerrrm, wrong channel
17:22:20*Trustable joined #nim
17:24:47rect0x51_lAraq: How is ram not ram? Can't solve your enigma >_<
17:24:53Zevvprobably related to xdg-open, or an "alternatives" setting if you're using a debian
17:25:30PMunchYeah definitely xdg-open related
17:28:45FromGitter<Varriount> @Araq What about using the algorithm that GC paper described?
17:32:13narimiranZevv, PMunch: i've found it. in MIME types, "inode/directory" was set to catfish
17:33:30AraqVarriount: that's RC + cycle detection
17:34:04Araqit is nice, but for our discussion the same as RC
17:36:20*zyklon joined #nim
17:37:45PMunchYou're lucky it was that easy.. I find that xdg-open is always a PITA to fix
17:37:48*PMunch quit (Remote host closed the connection)
17:38:22Araqrect0x51_l, because it's much faster when you don't use its 'random access' feature and access it sequentially
17:39:19rect0x51_lohh i see, for caching reasons again
17:41:57Araqcaching but also prefetching
17:47:59Araqhttps://www.bleepingcomputer.com/news/security/linux-systemd-affected-by-memory-corruption-vulnerabilities-no-patches-yet/
17:48:05*miran joined #nim
17:49:13*narimiran quit (Ping timeout: 245 seconds)
17:50:34rect0x51_lsystemd has been critisized a lot.
17:51:00*miran is now known as narimiran
17:51:34*isaac[m] joined #nim
17:53:34Araqso funny how the self proclaimed experts in C fail to produce correct code. Every. Single. Time.
17:53:38rect0x51_lit is unnecessary complexity
17:55:54*Marumoto joined #nim
17:55:55*xet7 joined #nim
17:59:44isaac[m]Greetings - Nim n00b here. I was curious if anyone has experience they could share for using Nim in embedded or IoT projects. Looking at SoC type stuff for networking and cryptography.
18:00:09*rect0x51_l quit (Ping timeout: 252 seconds)
18:01:26isaac[m]<isaac[m] "Greetings - Nim n00b here. I was"> I’m the world’s worst c developer looking for superpowers. nim looks like an incredible tool.
18:06:46Araqisaac[m], check out "Nimbus"
18:06:51*Snircle joined #nim
18:09:39*skellock joined #nim
18:11:00isaac[m]<freenode_Ara "isaac, check out "Nimbus""> will do. didn't realize the status guys were targeting embedded apps
18:12:30isaac[m]I'm a big fan of Pony lang and was working on a port of cjdns to that, but now am eyeballing Nim instead.
18:13:07*banc quit (Ping timeout: 240 seconds)
18:16:40Zevvisaac[m]: I'm doing some relatively small devices, but still Linux based, 8M flash + 32m ram. "Embedded" is a broad concept these days.
18:17:11Araqfun is over, back to the harder destructor bugs
18:19:47ZevvFunny thing these constructors. I hardly use them ever, and dont't miss them at all. Still for others it is such a critical component that they consider Nim unfinished without. I wonder how there can be such different views. Is it only because I skipped Java and C++?
18:19:48*zyklon quit (Read error: Connection reset by peer)
18:19:58*banc joined #nim
18:21:44Zevvdestructors, that is, of course
18:23:18AraqJava lacks them too
18:23:26*dom96_w quit (Quit: Textual IRC Client: www.textualapp.com)
18:24:03ZevvAh, that's what I get from skipping those :) Ignorance is bliss
18:28:28*absolutejam joined #nim
18:34:22shashlickjust pushed #include support in nimterop and several fixes
18:36:15*rect0x51_l joined #nim
18:36:46*zyklon joined #nim
18:37:07*darithorn joined #nim
18:37:20*rect0x51_l quit (Client Quit)
18:43:57*so quit (Ping timeout: 246 seconds)
18:44:49FromGitter<Clyybber> @Araq Is https://github.com/nim-lang/Nim/issues/6347 really fixed? Reordering the type statements changes the behaviour to not call the destructor.
18:48:59Araqit doesn't matter, it's a known big problem waiting for a solution
18:51:30*so joined #nim
18:57:43FromGitter<Clyybber> So it's a duplicate?
18:58:00isaac[m]Zevv: 👍 yeah, true that! you didn't miss much by skipping Java. I left it in 2005 or so. I hardly recognize it, now. Nim's way to implement generics is so much simpler and cleaner. You get the abstraction without all the boilerplate. I think this is more of an accomplishment than many might realize on the surface.
19:05:50*Marumoto quit (Remote host closed the connection)
19:10:54*theelous3 quit (Ping timeout: 246 seconds)
19:16:38ZevvC++ just never clicked for me. I've been doing C for ages, and about 12 years ago I picked up Lua. Lua+C have been my primary work horses for over a decade, but I'm *so* sick of duck typing.
19:18:55ZevvI tried C++ again, Go, Rust, all the usual suspects. And them I happened to walk into Nim. I feel it shares lots of the philosophy of Lua - provide mechanisms but don't force any design patterns. Has been a pretty much frictionless journey.
19:29:13AraqZevv: blog about it!
19:31:58*vlad1777d joined #nim
19:40:09skellockabsolutely @Zevv -- plz share your story; i'd love hear this stuff
19:42:22skellockwe should start a blog series of these in a visual format -- put it up on the official site
19:42:30*Vladar quit (Remote host closed the connection)
19:42:39skellocki think i just re-invented "case studies"
19:43:19*Vladar joined #nim
19:43:20*theelous3 joined #nim
19:43:52isaac[m]+1. sounds like a good blog post. Im a rubyist for the most part (not rails - backend microservices, data processing, api's etc) and i get it on the duck typing.
19:45:05skellocki'm heading into a new gig in feb -- and i'm bringing nim with me =)
19:48:22*Tyresc joined #nim
19:53:28*xet7 quit (Quit: Leaving)
19:54:05narimiranskellock: what's the gig about?
19:54:36skellocksmall SaaS company
19:55:21*xet7 joined #nim
19:55:23skellockno reason i can't use nim for that... talks to redis, talks to pg, can make http requests... done
20:03:43isaac[m]we used Go in my last company. results were a bit mixed. we had devs from scala/java, ruby, python, and 2 really intense PHP gurus.
20:03:44isaac[m]pluses: less bickering during code reviews, sweet compile times, and easy to abuse channels without fear. almost as fast as C, which is still overkill for many things.
20:03:44isaac[m]minuses: longer than expected ramp-up times despite claims of "easy" syntax, poor error handling consistency, devs looking for framework bloat that doesn't exist, and a general lack of enthusiasm for its spartan nature. C style for loops everywhere feels downright medieval compared to modern iterators and range sugars. also - the repetitive nil checking gets tiresome.
20:05:30*theelous3 quit (Ping timeout: 250 seconds)
20:05:30isaac[m]skellock: just started using jester. SaaS work should be a slam dunk. Is the protobuf lib used much in nim?
20:12:17skellocki haven't tried jester yet (nor the protobuf lib other than kickin' tires)
20:13:08skellocki'm suprised you said ramp-up with go... interesting to hear that from someone with experience
20:15:26absolutejamis it possible/idiomatic to return an item or nil
20:15:46isaac[m]yes ... it's oversold IMO. the scala guys especially were not that enthusiastic about it. my 1 C++ engineer was really torqued that there weren't generics, either.
20:16:12isaac[m]absolutejam: yes. rob pike has talked about this at length.
20:16:16absolutejameg. MyType.getSomething("foo") - return MyType.something.foo or nil
20:17:08absolutejamSorry, who is Rob Pike?
20:17:30dom96absolutejam: use Option[MyType]
20:17:40absolutejamI'ma googlin' but I don't know if it's a 'The Rob Pike'
20:17:46absolutejamthanks
20:18:04isaac[m]i recall sending this around ... https://speakerdeck.com/campoy/understanding-nil
20:18:11absolutejamffs, I write Option[Rob]
20:18:17absolutejam:facepalm:
20:18:19isaac[m]haha
20:18:22absolutejam*wrote
20:19:11skellockhaha
20:19:13isaac[m]Nim's fluent mix of styles and python syntax is so slick.
20:19:48*shpx joined #nim
20:20:21isaac[m]Rob Pike is a co-author of Go lang. He worked at Bell Labs and contributed a lot to Unix.
20:20:26absolutejamand if I'm checking against this result, should I be doing if not a.something.isNull ?
20:20:40absolutejamAh, right
20:21:06isaac[m]^ yeah that. if nil crap everywhere.
20:21:13absolutejamI went for the ol' Python crutch of is not a.something but that only works with bools
20:21:38dom96if you're using Option then you use `isSome` or `isNone`
20:21:38*zyklon quit (Read error: Connection reset by peer)
20:21:47isaac[m]similar exits for ruby :D
20:22:04dom96if you have a ref type then it's nillable so you can just return `nil`
20:22:08dom96and check for it with `isNil`
20:22:29isaac[m]assuming is_nil works, too?
20:22:55dom96yep
20:23:08isaac[m]dom96: beautiful book btw. i'm just getting through the first few chapters. you earned a convert.
20:23:17dom96Thanks :D
20:23:49skellockwe need more books
20:25:14skellock(said the guy who never wrote a book)
20:25:15isaac[m]i wonder ... is do / end really so troublesome to pythonistas? :P
20:26:05dom96Nothing stops you from writing #do / #end ;)
20:26:37isaac[m]lol - fair enough
20:27:39ZevvQ: How can I make my macro report the proper line number when I detect an error? Now it just points to the start of the code block
20:28:47dom96the `macros.error` proc takes an optional NimNode, set it to the NimNode you are processing
20:28:58ZevvTakk!
20:29:16*Amun_Ra quit (Ping timeout: 272 seconds)
20:31:23*Amun_Ra joined #nim
20:31:37isaac[m]has anyone worked on Actor macros in Nim?
20:32:15isaac[m]it looks like the main concurrency primitive is async await. are there others?
20:33:07Zevvthreadpools, parallel
20:33:31Zevvand posix.fork() for the true connaisseur, of course :)
20:34:23isaac[m]w00t
20:35:12Zevvisaac[m]: https://nim-lang.org/docs/manual.html#parallel-amp-spawn
20:35:23isaac[m]being a ruby hacker, well versed in abusing fork.
20:35:54skellockweb scale (tm)
20:36:27FromGitter<kaushalmodi> skellock: looking forward to more of your awesome blog posts :)
20:36:30ZevvIt is already 2019, and I fork() a lot. I have decided long ago that I am just not smart enough for threads.
20:37:02FromGitter<kaushalmodi> narimiran: You should add skellock's pants blog too
20:37:09skellockkaushalmodi: thx!
20:37:16narimiranlink?
20:37:16ZevvI'd rather take a stapler to the forhead then to spend another day of my life debugging mutexes
20:37:23FromGitter<kaushalmodi> https://totallywearingpants.com/
20:37:30*zyklon joined #nim
20:37:49narimirantoo few articles, no?
20:38:17skellockya, only have the 2 there for now... turns out writing is hard
20:38:48FromGitter<kaushalmodi> narimiran: that's why asking skellock to write more :)
20:38:53isaac[m]<freenode_Zev "It is already 2019, and I fork()"> no shame. fork is often the correct tool to use when many are making code way too complicated with other primitives.
20:39:50isaac[m]Zevv: thx for the link. yeah this looks good.
20:40:16Zevvskellock: that's a pretty sweet list of the good things. Guess I will be using this as the "yeah, look at this" while indoctrinating people about Nim.
20:40:58FromGitter<kaushalmodi> narimiran: we need Nim Planet
20:41:06FromGitter<kaushalmodi> are you aware of Planet thingy
20:41:26narimiranwhat would that be?
20:41:32FromGitter<kaushalmodi> it's like a blog aggregator showing a stream of posts from multiple nim blog RSS feeds
20:41:43narimirani know that i stumbled a long time ago on some python planet or something like that
20:41:57FromGitter<kaushalmodi> here's emacs planet: http://planet.emacsen.org/
20:42:04narimiranok, let's first have "a stream of posts from multiple nim blogs" ;)
20:42:40skellockhaha
20:42:48FromGitter<kaushalmodi> yeah, this can wait :P
20:43:04FromGitter<kaushalmodi> planet emacsen source for future ref: https://github.com/hober/planet.emacsen.org/
20:43:18dom96https://planet.nim-lang.org/
20:43:22dom96Already exists ;)
20:43:28FromGitter<kaushalmodi> huh?
20:43:57skellockwtf man, not cool to withhold info like this
20:43:59FromGitter<kaushalmodi> skellock: add your feed to that planet then!
20:44:19FromGitter<kaushalmodi> I have like 7 Nim posts: https://scripter.co/tags/nim/
20:44:45FromGitter<kaushalmodi> adding that nim tag feed to nim-lang planet
20:44:48FromGitter<kaushalmodi> .. looking into how
20:45:08dom96federico3: ^
20:45:39FromGitter<kaushalmodi> the nim planet needs the official Nim logo etc at the top
20:45:44skellockkaushalmodi: issue #3 on my blog repo -- fix rss feed
20:45:48FromGitter<kaushalmodi> and also instructions on how to contribute to it
20:46:04FromGitter<kaushalmodi> skellock: switch to Hugo :P
20:46:26skellocki did! and i broke that too!
20:46:29FromGitter<kaushalmodi> skellock: ok, that issue link went to Nim repo
20:46:36federico3uh?
20:46:46FromGitter<kaushalmodi> heh, I can be your Nim world Hugo help
20:46:55FromGitter<kaushalmodi> feel free to shoot questions
20:47:13FromGitter<kaushalmodi> federico3: how do I add my blog feed to Nim planet?
20:47:25federico3of course
20:47:31federico3one sec..
20:47:44FromGitter<kaushalmodi> if you scroll up, I had like 2 instant comments
20:48:03FromGitter<kaushalmodi> the planet site needs official Nim logo at the top, and instructions on how to contribute to it
20:48:36FromGitter<kaushalmodi> may be to the top banner .. because paging down seems to go into an infinite stream
20:48:45*wildlander joined #nim
20:48:45isaac[m](random n00b making n00b comments) - so nim has a real threadpool, awesome. i kinda dig how you just directly expose epoll. golang's sql interface has all this magic in it that manages the threadpool and it can take you by surprise. things like having to exec a stmt to open the conn after opening the conn ... look broken.
20:48:46*aguspiza joined #nim
20:49:32FromGitter<kaushalmodi> federico3: Also, the site never seems to top loading
20:49:37FromGitter<kaushalmodi> it's stuck on something
20:49:58FromGitter<kaushalmodi> in Firefox, the "loading page" animation in the tab seems to be going on for last 5 mins or so
20:51:32federico3https://github.com/FedericoCeratto/nim-planet
20:51:34federico3here
20:55:05FromGitter<kaushalmodi> federico3: something's odd with github .. I forked that repo, but that link is 404
20:55:12FromGitter<kaushalmodi> my fork's link
20:55:22FromGitter<skellock> they're having issues atm
20:55:32federico3sounds like a GH issue
20:55:46FromGitter<kaushalmodi> yeah, will wait
20:56:17skellockeveryone is uploading their private source code to github now
20:59:55FromGitter<kaushalmodi> federico3: https://github.com/FedericoCeratto/nim-planet/pull/1
20:59:56isaac[m]^ yeah no doubt, huh
21:00:01*absolutejam quit (Quit: WeeChat 1.9.1)
21:00:01federico3thanks!
21:00:08*Vladar quit (Remote host closed the connection)
21:00:18federico3heh, the pull leads to a 404 for me
21:00:20FromGitter<kaushalmodi> can you look into that "forever page loading" issue?
21:00:29FromGitter<kaushalmodi> press F5 5 times :P
21:00:35FromGitter<kaushalmodi> you'll get it in one of those
21:00:42federico3possibly more
21:00:47FromGitter<kaushalmodi> hehe
21:00:53rayman22201https://www.githubstatus.com/
21:00:59rayman22201github is broken atm :-/
21:01:48ZevvI noticed, my PR just limbo'ed
21:04:52*BigEpsilon quit (Quit: WeeChat 2.3)
21:09:09federico3still blocked at 'fatal: Could not read from remote repository.'
21:09:54FromGitter<kaushalmodi> federico3: what's blocked?
21:10:07FromGitter<kaushalmodi> I see that PR already merged
21:10:07federico3git pull
21:10:20federico3yep but I cannot fetch it :D
21:10:37FromGitter<kaushalmodi> ah, I see
21:10:52FromGitter<kaushalmodi> I thought some CI must be picking up from that repo's git hooks
21:15:44*cspar_ joined #nim
21:16:25*oculux quit (Quit: blah)
21:17:11*oculux joined #nim
21:18:03federico3ok, the planet is unstuck. GH still is. Perhaps it would be nice to integrate with mastodon to announce blog posts but the planet codebase is unmaintained.
21:18:56*oculux quit (Client Quit)
21:20:07*oculux joined #nim
21:29:56Araqdom96: https://github.com/nim-lang/Nim/pull/10254
21:31:22dom96replied
21:33:54*skellock quit (Ping timeout: 250 seconds)
21:40:14*zachk joined #nim
21:40:44dom96FOSDEM 2019 soon: https://forum.nim-lang.org/t/4461#28491
21:42:26*narimiran quit (Ping timeout: 244 seconds)
21:45:05*zachk quit (Changing host)
21:45:05*zachk joined #nim
21:54:45*absolutejam_phon joined #nim
21:56:44*absolutejam_phon left #nim (#nim)
21:56:55*absolutejam_phon joined #nim
21:57:03*absolutejam_phon quit (Remote host closed the connection)
21:57:17*absolutejam_phon joined #nim
21:57:31FromGitter<alehander42> Oh I use telegram
21:58:18*absolutejam_phon quit (Read error: Connection reset by peer)
21:58:20FromGitter<alehander42> I always knew bot very well known Russian social networks will become huge
21:58:43dom96the Nim telegram channel feels like a different world lol
21:58:56dom96Loving the memes
22:00:24*absolutejam_phon joined #nim
22:00:45*absolutejam_phon quit (Read error: Connection reset by peer)
22:05:16*krux02 quit (Remote host closed the connection)
22:06:48*Trustable quit (Remote host closed the connection)
22:11:30*aguspiza quit (Ping timeout: 246 seconds)
22:11:44*powerbit joined #nim
22:12:25*absolutejam_phon joined #nim
22:12:56absolutejam_phonThink my laptop charger has died 😭
22:13:14absolutejam_phonNim compiles on Android right?!
22:17:25*Snircle quit (Read error: Connection reset by peer)
22:17:59*Snircle joined #nim
22:29:43rayman22201using Termux on android, I have actually gotten Nim to run on android actually. It killed my battery and it's a terribl experience to code on your phone, but it totally works lol
22:39:00xacerayman22201: did they add nim as a package?
22:41:01rayman22201No. But pulling from git works flawlessly
22:41:04rayman22201https://stisa.space/articles/compile-nim-on-android/
22:41:14*rect0x51 joined #nim
22:41:17*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:41:19rayman22201You just need to install the glob package
22:41:22rayman22201apt install libandroid-glob apt install libandroid-glob-dev
22:44:32rayman22201That article is old, but I tried it very recently (about a month ago with #head) and it still works fine.
22:44:57rayman22201I was at a family holiday dinner and was bored lol.
22:46:10xacethanks for the link ill check it out
23:10:06*rect0x51 quit (Quit: WeeChat 2.3)
23:15:56*oculux quit (Quit: blah)
23:16:30*oculux joined #nim
23:24:29*zyklon quit (Read error: Connection reset by peer)
23:35:54*skellock joined #nim
23:41:33*zyklon joined #nim
23:55:01*zyklon quit (Read error: Connection reset by peer)