<< 14-08-2019 >>

01:09:55*m171273 joined #nim
01:14:19*m171273 quit (Ping timeout: 250 seconds)
01:29:46FromGitter<awr1> https://forum.nim-lang.org/t/2569 looking at this
01:30:14FromGitter<awr1> i halfway feel like there should be a pointer arithmetic module because it occasionally becomes a little necessary
01:30:20FromGitter<awr1> although the other half of me is like "no"
01:33:01FromGitter<awr1> (in the style of say, `std/lenientops`)
01:40:02*theelous3 quit (Ping timeout: 245 seconds)
01:42:35*snifftek quit (Remote host closed the connection)
01:59:03*m171273 joined #nim
02:00:13*m171273 quit (Client Quit)
02:03:24*abm quit (Quit: Leaving)
02:21:10*snooptek joined #nim
02:43:08*snooptek quit (Remote host closed the connection)
02:44:13*snooptek joined #nim
02:50:03*nif quit (Quit: ...)
02:50:12*nif joined #nim
02:54:48*lritter quit (Ping timeout: 268 seconds)
02:55:06*lritter joined #nim
03:00:28*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
03:00:53*laaron joined #nim
03:06:37*laaron quit (Remote host closed the connection)
03:06:58*laaron joined #nim
03:44:40*laaron- joined #nim
03:44:42*rockcavera quit (Remote host closed the connection)
03:44:44*laaron quit (Remote host closed the connection)
03:59:26*endragor joined #nim
04:06:47*laaron- quit (Remote host closed the connection)
04:09:13*laaron joined #nim
04:18:39*rockcavera joined #nim
04:19:53*nsf joined #nim
04:38:46*fjellfras joined #nim
04:51:15*arecaceae quit (Remote host closed the connection)
04:51:39*arecaceae joined #nim
05:00:30*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
05:01:07*laaron joined #nim
05:28:21*solitudesf- joined #nim
05:38:22Araqdeech: I don't know how to verify stuff but more effort has been spent on the "destructor spec" than on most other aspects of the language
05:39:01Araqand we also have a document for symbol lookups in the works
05:49:58*LargeEpsilon joined #nim
06:22:35*PMunch joined #nim
06:23:43*narimiran joined #nim
06:31:08*oalvarez quit (Ping timeout: 244 seconds)
06:39:38PMunchHmm, is there a module in the standard library or a package that can do HTML escaping?
06:45:16*shomodj joined #nim
06:52:51*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:53:48*shomodj joined #nim
06:54:14*shomodj quit (Client Quit)
06:58:28*eterps joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:28*krux02 joined #nim
07:00:33*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
07:00:52*laaron joined #nim
07:04:22*gmpreussner joined #nim
07:18:29*ng0 joined #nim
07:21:41*eterps quit (Quit: WeeChat 2.5)
07:21:50*eterps joined #nim
07:27:26*eterps is now known as terps
07:37:39*Vladar joined #nim
07:41:01*shomodj joined #nim
07:42:55Zevvand, did you find it? :)
07:47:36*actuallybatman quit (Ping timeout: 244 seconds)
08:04:06FromGitter<arnetheduck> @deech we've considered it, potentially starting with a subset of the language
08:06:27FromGitter<awr1> w/r/t earlier talk on hypothetical nim cross-platform future UI library: i'm curious to know what scope araq or others had in mind
08:08:18FromGitter<arnetheduck> @awr1 "good luck"
08:08:19FromGitter<awr1> qt-ish native controls? or "electron-like, but native?"
08:08:45FromGitter<awr1> there was that ocaml electron-like library i saw a while back
08:08:46FromGitter<awr1> https://github.com/revery-ui/revery
08:10:36*floppydh joined #nim
08:15:16*hoijui joined #nim
08:15:37Araqawr1: basically what libui offers, but better event handling (I found its event handling to be so incomplete that became unusable)
08:15:53Araqan event based canvas with text rendering capabilities
08:16:20Araqmaybe some native widgets but if I can draw stuff, I can write every widget I need
08:16:32Araqand it will portable and look the same everywhere
08:17:46Araq"native look and feel" is for toys, I don't give a crap if my video editor uses "Windows' native buttons"
08:18:44Araqon the other hand using the native "printer dialog" or "file open dialogs" is very much appreciated
08:19:25Araqso ... we need to find some pragmatic compromise
08:19:45*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:19:46shashlickIsn't that a huge endeavor?
08:20:23PMunchZevv, nope
08:21:18PMunchshashlick, yes
08:22:05shashlickPerhaps because most gui libs in c/c++ world also end up providing an stdlib of sorts
08:22:41shashlickConsidering Nim already has one, maybe it isn't as much work
08:22:57Araqit's much work
08:23:13AraqI hoped somebody would steal code from libui and c2nim it
08:23:31PMunchAnd to address Araqs "I don't give a crap if my video editor uses [...]" comment. It's not only about look and feel (although for Linux users who are used to setting a system-wide Gtk/Qt theme it's super annoying when some application decides to draw it own stuff). The more important issue is accesibility. Want to make a tool that people with physical or mental disabilities can use you better use the native controls. That way you get all the OSes
08:23:32PMunchaccessibility tools for free
08:25:25Araqgood point
08:29:18PMunchAnd besides, you will also get any updates to things like 4k UI scaling, better integration into system appearances, etc.
08:29:49Araqbut then you are in the very messy "how can I write custom widgets" land
08:30:34PMunchAh yes
08:30:39Araqand most applications that I use are based on a "custom widget", the text editor, this chat, the browser, a video editor, ...
08:32:02Araqbut I guess business apps are fine with premade TableWidget and buttons
08:32:24PMunchTrue, to get 100% cross-platform/-framework custom widgets you would have to implement your own drawing toolkit and map that to whatever the underlying framework supports
08:36:20Araqthat's why the browser-based stuff always wins
08:37:37*fredrik92 is now known as couven92
08:38:21Araqin C++ there is a proposal for adding web_view to the stdlib
08:38:28PMunchI did some thinking about this for the ergonomics of the library I want to write. Basically I ended up categorising applications into two categories, data/algorithm-based and interaction-based. A data/algorithm-based application is something that's more or less just an interface for an underlying algorithm or data manipulation tool. Think of something like a video converter, a password manager, a system diagnostics application like the task manager, etc.
08:38:28PMunchThey are generally more indifferent to their interface, focusing more on the actual "meat" of the application which is the data collection/manipulation. Then you have the interaction-based tools, like a calculator, a text editor, or a web browser. They are typically much more picky about their interface, because their entire reason d'etre is to allow the user to interact with something in a more ergonomic way. Of course most applications fall somewhere on a
08:38:28PMunchspectrum between these extremes, but I found the categories to help a bit when I was considering how to think of widget creation.
08:38:47PMunchYeah the browser-based stuff has some pros
08:39:00Araqand then C++ finally would have a "UI lib" in std::
08:40:17Araqsuper silly IMO, but it does show the browser's importance.
08:40:40PMunchMainly that people know how to create interfaces in them (because most people in tech have done something with webpages), and the fact that we've spent the better part of three decades slowly getting to a point where they more or less render the same thing on all platforms.
08:48:40FromGitter<mratsim> @awr1, ptr_arithmetic module sounds ok
08:49:24Araqa stdlib addition? boooh!
08:49:27Araq:P
08:49:56*shomodj joined #nim
08:51:47FromGitter<arnetheduck> like https://github.com/status-im/nim-stew/blob/master/stew/ranges/ptr_arith.nim ?
08:55:46livcdAraq: i am very skeptical about a cross platform UI lib (unless it is not just a fork of libui)
08:58:21FromGitter<mratsim> The posts by GordonBGood are so long ~_~ https://forum.nim-lang.org/t/5083
09:00:27*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
09:00:58*laaron joined #nim
09:01:59Araqlivcd: why?
09:04:21livcdHave you seen a good looking libui app ?
09:05:23*mheinz joined #nim
09:08:04AraqI don't know if I've seen a libui app in the wild. it's pretty new
09:14:15*mheinz quit (Remote host closed the connection)
09:16:39livcdWell yeah
09:18:21livcdbtw it's fascinating how many chinese users are interested in something like wNim (this is Go's wNim) https://github.com/lxn/walk/issues
09:22:19*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:22:45*shomodj joined #nim
09:23:15Araqhttps://forum.dlang.org/post/[email protected] cyclic import problems in D.
09:23:32Araqthey have this feature for a decade now or something.
09:24:19FromGitter<alehander42> @mratsim they are shorter than your RFC-s :P
09:24:58Araqlol
09:27:20*leorize quit (Remote host closed the connection)
09:27:51*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:28:10*leorize joined #nim
09:29:49FromGitter<mratsim> Obivously you didn’t read his post on the prime sieves
09:29:55*laaron quit (Remote host closed the connection)
09:30:12*laaron joined #nim
09:32:52FromGitter<mratsim> Also it’s condensed of a couple of hours of videos and hundreds of page of theses and papers: https://github.com/numforge/laser/blob/master/research/runtime_threads_tasks_allocation_NUMA.md
09:38:42*theelous3 joined #nim
09:49:29PMunchHmm, any of you currently playing with wxWidgets in Nim?
09:49:47PMunchWas poking around at some ix.io pastes and stumbled across this: ix.io/1RD0 :P
09:54:03*stefanos82 joined #nim
09:54:27shashlickJust about done with vacation, plan on spending some quality time on nimterop next few weeks
09:54:57shashlickAny burning issues, please add or vote on the issue tracker
09:55:39shashlickOnce I feel I've actually achieved something, I will try working on the dll stuff in feud again
09:59:51*shomodj joined #nim
10:01:25*abm joined #nim
10:02:51*laaron quit (Remote host closed the connection)
10:05:02*laaron joined #nim
10:06:02*krux02 quit (Remote host closed the connection)
10:06:37*krux02 joined #nim
10:10:26*fjellfras quit (Quit: Leaving)
10:11:50*fjellfras joined #nim
10:20:30FromGitter<alehander42> @mratsim of course, but this just proves the point: sometimes one needs more space to represent his ideas/comments
10:30:25*laaron quit (Remote host closed the connection)
10:36:50*laaron joined #nim
10:38:54*fjellfras quit (Quit: Leaving)
10:54:58*gmpreussner quit (Ping timeout: 272 seconds)
10:57:22*laaron quit (Remote host closed the connection)
10:58:26*laaron joined #nim
11:00:20*gmpreussner joined #nim
11:00:39*laaron quit (Client Quit)
11:08:53*laaron joined #nim
11:09:36*laaron quit (Remote host closed the connection)
11:10:12*laaron joined #nim
11:16:08*clyybber joined #nim
11:29:15PMunchThe Nim playground now properly converts ANSI colour codes: https://play.nim-lang.org/#ix=1RDk (yay!)
11:29:52PMunchBut more importantly this solves the issue where parts of Nim output was seen as HTML and rendered incorrectly
11:30:27PMunchNow the output should be rendered just like it is in the terminal, but with full colour/bold/italics support
11:30:44clyybberawesome!
11:41:18FromGitter<mratsim> Nim Evangelist Task Force: Assemble —> https://www.reddit.com/r/ProgrammingLanguages/comments/cq4b1x/compiled_language_that_can_interpret_itself/ewuizax/
11:41:23FromGitter<mratsim> Game devs especially
11:43:44FromGitter<zetashift> @mratsim would be careful with HCR advertising, it's there but largely untested, no?
11:44:07FromGitter<mratsim> @zacharycarter decided to be our guinea pig :p
11:44:48FromGitter<zetashift> for the greater good!
11:45:45FromGitter<zetashift> also unrelated but julia can be compiled iirc
11:47:03FromGitter<mratsim> you cannot build dlls/static binary with Julia
11:47:14FromGitter<mratsim> it’s something they are still working on
11:48:41FromGitter<deech> Araq, PMunch: I have a fairly high coverage binding to FLTK (https://fltk.org) in Haskell (https://github.com/deech/fltkhs), I know the default looks ugly but it's quite customizable (https://github.com/deech/fltkhs-themes-demo) and very easy to install across platforms and produce self-contained static binaries. It's a lot of work to make a nice wrapper but I have a lot of the tedious C-binding bits ready to go
11:48:41FromGitter... (https://github.com/deech/fltkhs/tree/master/c-src). I've wanted to port it to Nim for quite a bit now. There is a Nim port out there (https://github.com/Skrylar/nfltk) but it's not as far along.
11:49:43FromGitter<zetashift> https://github.com/JuliaLang/PackageCompiler.jl I recall it being early development yea, but you can try it out :P
11:51:02*lritter quit (Ping timeout: 258 seconds)
12:03:49*dddddd joined #nim
12:07:16*terps quit (Ping timeout: 264 seconds)
12:07:59*Kaivo joined #nim
12:08:16*terps joined #nim
12:12:29FromGitter<zacharycarter> I will be a guinea pig for HCR all day long
12:12:37FromGitter<zacharycarter> but we need someone to fix it first :P
12:37:30FromGitter<bevo009> Is there a timer option when compiling? ⏎ I can't see an option in nim --fullhelp
12:39:21*shomodj_ joined #nim
12:42:33*shomodj quit (Ping timeout: 245 seconds)
12:48:29*nsf quit (Quit: WeeChat 2.4)
12:50:20*laaron quit (Remote host closed the connection)
12:53:11*laaron joined #nim
13:10:25PMunchbevo009, what kind of timer where you thinking of?
13:11:47FromGitter<bevo009> Just times the program running time, like Code Runner does automatically
13:12:06PMunchWell on Linux you can just call it with `time`
13:13:05FromGitter<bevo009> I'm looking for one I can integrate with F6 Nim command
13:15:09PMunchIn an editor?
13:15:17*Vladar quit (Remote host closed the connection)
13:15:24PMunchWell that depends on your editor..
13:15:40FromGitter<bevo009> vs code
13:15:49FromGitter<bevo009> I found this for timing a specific code block while I was looking: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d54098453490e334dee3613]
13:15:52PMunchAgain, if you're on Linux you could create an alias for Nim to run `time nim` instead
13:15:58PMunchThat way you would always get timing information
13:16:33FromGitter<bevo009> Oh ok you just place time before your main nim command
13:16:59PMunchYes, time is a program that runs the command after it and returns the time it took to run it
13:17:07PMunchCan be appended to pretty much anything
13:17:35FromGitter<bevo009> cheers, thats great
13:17:53PMunchWhat would be cool though was if Nim could have a timed mode where it would output timings for the different parts of the compilation
13:18:17PMunchLike how long did parsing take, what about macro expansion, C compilation, etc.
13:19:46FromGitter<bevo009> yes it would
13:20:24FromGitter<bevo009> After trying inserting time into code runners custom command, it's automatic timing is prstty correct
13:23:07livcdwhen i compile with cpp and run on windows server 2012 i get this https://privatebin.net/?e3733c229028e67a#3iGd9Sz4N5fsoc1bw5rtoETVyVKWbUgnZXzFjDrfme5u
13:30:04livcdooops i know
13:35:55*salewski joined #nim
13:38:11salewskiI would need some support for our new Chinese community, heterogeneous container see https://forum.nim-lang.org/t/5095
13:41:43*salewski quit (Quit: WeeChat 2.5)
13:42:10*endragor quit (Remote host closed the connection)
13:45:47FromGitter<mratsim> @bevo009, use the criterion package or “import profile"
13:46:21FromGitter<mratsim> https://github.com/LemonBoy/criterion.nim
13:46:49clyybberAraq: For some reason nkInt8Lit, nkIntLit or nkNilLit sometimes doesn't have a type.
13:47:12clyybberSo for isExpression its not enough to check not isEmptyType
13:47:26FromGitter<mratsim> and this is my profiling code: https://github.com/mratsim/weave/blob/master/e04_channel_based_work_stealing/profile.nim#L52-L55 with the timers: https://github.com/mratsim/weave/blob/master/e04_channel_based_work_stealing/timer.nim @bevo009
13:49:23FromGitter<bevo009> @mratsim cheers! I'll check it out
13:50:37*Kaivo quit (Quit: WeeChat 2.5)
13:51:10*floppydh quit (Quit: WeeChat 2.5)
13:55:13*Kaivo joined #nim
14:08:52Araqclyybber: meh ok
14:10:30clyybberDo you know why that happens?
14:10:48clyybberI mean for nkNilLit it makes sense, but for the other ones?
14:11:00clyybberAre they not fully resolved yet?
14:13:51AraqI remember it happens for some complex macro cases
14:14:23Araqand I remember teaching the backend about it was less work then changing the frontend
14:14:28*PMunch quit (Remote host closed the connection)
14:14:32clyybberOk.
14:14:51Araqbut now it's the 2nd time somebody stumbles over it
14:14:59Araqso we could have a deeper look
14:15:05clyybberAraq: Yeah
14:15:38clyybberAraq: Is it intended that nkIfExpr sometimes includes nkElifBranch instead of nkElifExpr ?
14:16:17Araqthere is no difference really
14:16:29Araqit was a design mistake to distinguish them
14:17:13clyybberShould be pretty easy to unify them, right?
14:22:12Araqno, it's very hard
14:23:03Araqthe macros.nim enum is mapped 1:1 to the ast.TNodeKind enum
14:23:18Araqso every change that is not just "added an enum field at the end" causes endless bootstrapping problems
14:27:18Araqwe should use a string based comparison
14:28:12clyybberCouldn't one just do const nnkElifExpr = nnkElifBranch in macros.nim
14:29:28Araqit's the nature of bootstrapping
14:29:41Araqyou would need to update macros.nim and the Nim compiler binary at the same time
14:29:45Araqand that's impossible
14:30:03Araqso first you need to eliminate the binary dependency
14:30:41*mattmurr joined #nim
14:31:18clyybberBut the compiler doesn't rely on macros.nim does it?
14:32:09Araqit uses macros in msgs.nim and uses json.nim that uses macros
14:32:19Araqand maybe also elsewhere
14:32:23clyybberArgh
14:32:42clyybberSo how could it ever be fixed?
14:33:08clyybberManually changing the C source of the compiler?
14:33:38*actuallybatman joined #nim
14:36:52Araqyou need to patch of opcNNewNimNode: in vm.nim
14:37:01Araqand then wait for a stable release
14:37:12Araqand then you can fix it
14:37:36Araqinterestingly we avoided this mistake for TMagic :P
14:39:26clyybberDo you intend to fix this before 1.0?
14:39:49Araqnow that you reminded me ...
14:40:23Araqit's one of these time bombs we need to disarm before v1, yes
14:43:16*terps quit (Ping timeout: 264 seconds)
14:44:01clyybberYeah I agree
14:44:45clyybberAraq: Is there a reason that {.discardable.} is not just implemented as a transformation to discard someDiscardableProc ?
14:45:45Araqthe transformation would need to be done in the sem'check and then the macros could see it
14:46:30clyybberWould that be a problem? I mean if we change the spec?
14:48:32Araqwe don't have a spec for 'typed' ASTs
14:48:41Araq:-(
14:48:45*terps joined #nim
14:49:57clyybberWell, even better ;D
14:51:11clyybberMaybe discardable can even be implemented as a macro
14:52:44Araqhardly
14:55:51*theelous3_ joined #nim
14:58:52clyybberWould you be ok with me including the discardable rewrite in my injectdestructors refactor?
14:59:40AraqI remember we tried that one before and it broke stuff
14:59:56Araqplease don't touch it, we have more important things to do
14:59:56clyybberAh, ok. Then I'm just gonna work around it for the moment
14:59:59clyybberYeah
15:00:16AraqPARTIALLY MATERIALIZED OBJECTS!
15:00:21Araq;-)
15:00:33Araqwe need them. it's the most important thing
15:01:15clyybberHaha, I'm on it
15:06:02FromGitter<mratsim> most important thing for v1?
15:06:51Araqof course, what else
15:08:16Araqfixing typedesc and concept bugs so that you can destroy your icache more easily and wish for more dynamic binding?
15:13:19FromGitter<deech> What are partially materialized objects?
15:13:42clyybberAraq: How can I check wether a call is a call to a discardable proc? `if n.kind in nkCallKinds and sfDiscardable in n[0].sym.flags` doesnt seem to work
15:15:47Araqwhy do you need to check for that?
15:16:05Araqdeech: something we recently invented
15:17:43FromGitter<deech> Nice.
15:18:01*terps quit (Ping timeout: 250 seconds)
15:19:24clyybberAraq: I want to have my assert(not isExpression(n)) at the start of pStmt
15:19:43clyybberwhere pStmt is a simplified version of p
15:20:01Araqyeah, I gave up on that idea in backend code
15:20:21Araqnever got the assertion right, but the logic usually was fine
15:27:55*endragor joined #nim
15:37:09disruptekmaybe you should RFC partially materialized objects and see if any feedback provokes changes to the design before implementation is complete.
15:37:25*terps joined #nim
15:38:06Zevvis this partially materialized objects some kind of running gag, or is that somehing real?
15:38:34disruptekit's a fair question, if a funny one. 😁
15:39:08disruptekif i understand it, it's the concept of only partially composing objects in a function scope because they need never escape as fully-realized objects.
15:39:24disrupteknewruntime shenanigans.
15:41:10Zevvsounds plausible
15:43:01Zevvbut since an object is already almost nothing; if you have an object on the stack that stays there just as long as the function lives, nothing is even "materialized" anyway, right? its members are nothing more then adresses on the stack frame
15:43:50disrupteki think we're talking newruntime accounting overhead here.
15:44:11Araqfor blobs yes, but consider MyObject(x: value) where typeof(value) has an expensive copy
15:45:04*terps quit (Ping timeout: 264 seconds)
15:45:21Zevvright, that makes sense
15:45:34Araqwith PMO you can remove different construction/destruction pairs than what our control flow analysis can do
15:45:35disruptekobjects: almost nothing.
15:46:28disruptekit's more like simply omitting spec inside a vague scope.
15:46:33Zevvoh it already got its own TLA, great :)
15:46:53disruptekor, it's vague in a specific scope.
15:47:29Araqyou don't have to make it scope based
15:47:53disruptekoh, it's graph-based?
15:48:22disruptekis this a valid typeclass? int|string|enum
15:48:38Araqsure.
15:49:36disrupteki can't figure out why i cannot integrate two generics -- one for int|string and one for enum. maybe i can create a test.
15:52:11Zevvcan you genericize on a non-specific enum type then?
15:52:28disruptekall my tests say yes.
15:52:42Zevvwow
15:53:07*terps joined #nim
16:05:54krux02eval: 17+4
16:06:06krux02I wonder what the syntax for NimBot was
16:06:13krux02NimBot: what is your syntax
16:06:21disruptekit's !eval
16:06:28disruptek!eval echo 17+4
16:06:30NimBot21<br/>
16:06:32krux02!eval 17+4
16:06:34NimBotCompile failed: <span style="color: #66d9ef;">Hint: </span>used config file '/nim/config/nim.cfg'<span style="color: #50fa7b;"> [Conf]</span><br/><span style="color: #66d9ef;">Hint: </span>system<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>widestrs<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>io<span style="color: #50fa7b;"> [Processing]</span><br/><span style...
16:06:52disrupteknimbot is pretty verbose today.
16:06:54krux02nice, I get html in my irc
16:07:10disrupteknext stop javascript.
16:07:21krux02yes stop javascript
16:07:35FromGitter<bobeff> Hi, could someone replace this script `https://nim-lang.org/choosenim/init.sh` with the latest version from here https://github.com/dom96/choosenim/blob/master/scripts/choosenim-unix-init.sh, because it supports `*msys*`. I'm trying to add support for Windows in Travis CI for Nimble. Of course I can change the URL but I suspect that it is intentionally not from `choosenim`'s master branch.
16:07:37disruptek🤣
16:08:23krux02!eval test.nims
16:08:29NimBotCompile failed: <span style="color: #66d9ef;">Hint: </span>used config file '/nim/config/nim.cfg'<span style="color: #50fa7b;"> [Conf]</span><br/><span style="color: #66d9ef;">Hint: </span>system<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>widestrs<span style="color: #50fa7b;"> [Processing]</span><br/><span style="color: #66d9ef;">Hint: </span>io<span style="color: #50fa7b;"> [Processing]</span><br/><span style...
16:08:56disruptekmust be related to pmunch's color output support.
16:10:11krux02it is nice that because of all the colors it cats cut off before it even gets to the error message
16:10:26FromGitter<Varriount> Araq: What is a partially materialized object?
16:11:01disruptekprecursure to dehydrated objects.
16:15:36clyybberAraq: implictlyDiscardable from semstmts works fine
16:21:09FromDiscord_<kodkuce> hmm am back 😃 , anyway i am trying to write code to kick zombie ws connections if they inactive
16:21:16FromDiscord_<kodkuce> but i get this error that i dont get
16:21:17FromDiscord_<kodkuce> https://pasteboard.co/IsG2oqT.png
16:24:43narimirankodkuce look at your proc definition, and then at your call
16:28:06FromDiscord_<kodkuce> lol i frogot to pass paremetar xD
16:28:39narimiranand then you forgot to read the error message and look at your code :P
16:30:24FromDiscord_<kodkuce> nah i did just got <> confused me
16:30:48*hoijui quit (Quit: Leaving)
16:31:41FromDiscord_<kodkuce> but hmm now i get more
16:32:10FromDiscord_<kodkuce> https://pasteboard.co/IsG75BT.png
16:32:30FromDiscord_<kodkuce> wtf it says it expets float ???
16:34:03solitudesf-you dont see that dash after the proc name?
16:34:19*solitudesf- quit (Quit: Leaving)
16:34:30disruptekmic drop
16:34:36*solitudesf joined #nim
16:35:14FromDiscord_<kodkuce> lol i really dident
16:35:23narimiransolitudesf: did you change your username just to make that comment?
16:35:23FromDiscord_<kodkuce> time for slaping myslef
16:36:29solitudesfnah, freenode just playing with me
16:38:10narimirankodkuce btw, what version of nim are you using?
16:38:43narimiranbecause currently that output should be indented and a bit easier to read
16:41:11FromDiscord_<kodkuce> Nim Compiler Version 0.20.99 [Linux: amd64]
16:42:48narimiranhmm, then i guess vscode strips the initial spaces
16:44:36*uvegbot joined #nim
16:45:33*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:48:04clyybberAraq: In destructors/tobjfield_analysis:35 why does nim generate a default case in the C code?
16:48:40*zyklon quit (Ping timeout: 264 seconds)
16:49:12clyybberBecause it is not clear to me or my code what it should sink in the default case.
16:49:44clyybberSo my code currently generates invalid: eqsink(&y, )
16:51:16*endragor quit (Remote host closed the connection)
16:55:36*py0tr joined #nim
17:00:22*py0tr quit (Remote host closed the connection)
17:10:08*shomodj joined #nim
17:10:53*jmiven_ joined #nim
17:14:52*krux02 quit (Remote host closed the connection)
17:19:29*jmiven quit (Quit: reboot)
17:19:55*jmiven_ quit (Quit: WeeChat 2.4)
17:20:13FromDiscord_<kodkuce> hmm for simple vlaue types example bool can i pass them as ref ?
17:20:16*jmiven joined #nim
17:20:27FromDiscord_<kodkuce> ref var b = false , or do i have to make a new type?
17:24:29FromDiscord_<kodkuce> hmm, duno how to get a referece to variable under my wsconnection
17:26:12leorizeyou can't get a reference to a variable....
17:26:21leorizeand yes you can pass simple types as ref
17:26:31leorizealthough I can't think of any good use for them
17:30:34*leorize quit (Remote host closed the connection)
17:31:22*leorize joined #nim
17:35:12leorizeAraq: is new runtime safe to use yet (ie. no mem corruption)?
17:36:08leorizenarimiran: can you check this one? should be fixed I think? https://github.com/nim-lang/Nim/issues/11629
17:39:19FromDiscord_<kodkuce> https://pasteboard.co/IsGyoS1.png
17:40:50FromDiscord_<kodkuce> lol i frogot F on by RE
17:41:01FromDiscord_<kodkuce> so wated to pass this by REF 😃
17:45:21*rockcavera quit (Remote host closed the connection)
17:51:50*shomodj_ joined #nim
17:54:14FromDiscord_<kodkuce> duno how to terminate ws connection if player dont auth or just zombie out in 2-3sec after connection
17:55:12*Jesin quit (Quit: Leaving)
17:55:38*ng0 quit (Remote host closed the connection)
17:55:45*shomodj quit (Ping timeout: 268 seconds)
17:56:43*ng0 joined #nim
17:57:47*Jesin joined #nim
18:07:07*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:08:27*laaron quit (Remote host closed the connection)
18:10:09clyybberleorize: Yeah, new runtime is safe to use. But some things dont work yet i.e. tables
18:11:01clyybbertables.nim
18:11:53*laaron joined #nim
18:12:04*terps quit (Ping timeout: 264 seconds)
18:14:31clyybberleorize: There is one remaining issue with double free that I'm currently fixing, but you probably won't encounter it.
18:16:27*terps joined #nim
18:20:22Araqtables are covered by a tiny test
18:20:32Araqbut sure, they need more love
18:43:41rayman22201Do closure iterators / async work with newruntime yet?
18:52:01*couven92 quit (Read error: Connection reset by peer)
18:56:49dom96hello all
18:58:56disrupteksup boss
18:59:03disruptekhow is the game comin'?
19:00:49dom96slowly inching along
19:05:20dom96https://github.com/nim-lang/opengl/issues/66
19:05:24dom9619 upvotes, wtf?
19:05:36*terps quit (Ping timeout: 252 seconds)
19:06:21disrupteki believe they call that a `raid`. 😉
19:12:25*terps joined #nim
19:15:04*LargeEpsilon quit (Ping timeout: 246 seconds)
19:22:48*laaron quit (Write error: Connection reset by peer)
19:22:48*leorize quit (Remote host closed the connection)
19:24:08*laaron joined #nim
19:24:52*jjido joined #nim
19:34:19*abm quit (Ping timeout: 246 seconds)
19:43:42*leorize joined #nim
19:48:32*abm joined #nim
20:03:09*ehmry quit (Remote host closed the connection)
20:05:06ZevvIs there a way to use portable terminal colors at compile time?
20:05:28Araqrayman22201: no. closure iterators have been ported though
20:05:44*terps quit (Ping timeout: 252 seconds)
20:06:02disruptekZevv: you mean more portable than the colored compiler output we currently enjoy?
20:07:13ZevvWell, the compiler is outputting at copiler runtime, so it has access to stdout
20:07:27Calinoudo you mean the `terminal` module?
20:07:30Zevvright
20:08:06Zevvstdout is null at compile time, so it goes *poof* in my face
20:08:34ZevvI now do ansii escapes by hand, but that is not very nice for non-unix-people
20:09:39Calinouoh, you want a module that can be used in compile-time strings
20:09:50CalinouI don't think that exists, at least not if you want to support Windows versions older than 10
20:09:51rayman22201@Araq, cool. Thanks for the update. I wasn't sure based on what Clyybber was saying :-)
20:16:06ZevvCalinou: that's what I though, thanks
20:26:15FromDiscord_<kodkuce> what game?
20:43:07ZevvIn these iterators called somethingIt, is 'it' ment as "it", aka "this" or is it short for "iterator"?
20:47:40disruptekit's the target of the iteration, a single element|member.
20:47:51disrupteks/target/result/
20:48:28disruptekit's more `this` than `iterator`, i guess.
20:48:36*sacredfrog quit (Quit: ZNC 1.7.4 - https://znc.in)
20:51:03disruptekhey, riddle me this: https://play.nim-lang.org/#ix=1RGE -- testing generics and converters; seems fine.
20:52:23disruptekthis one with json doesn't work: https://play.nim-lang.org/#ix=1RGH
20:52:47*NimBot joined #nim
20:57:24FromDiscord_<Kiloneie> Guys, can you give me a quick minute to explain why the commented out code wont pass the if statement(no errors, just it's code wont run): https://play.nim-lang.org/#ix=1RGL
21:02:56rayman22201@disruptek, you can't dispatch on return type
21:04:12disruptekkiloneie: i just fixed it and then the playground broke.
21:04:39disruptekyou should iterate over r_letters.low .. r_letters.high instead and modify everything else to match.
21:05:09disruptekrayman22201: why does it work in the first example?
21:05:48disruptekor, where am i dispatching on return type?
21:06:31rayman22201you have those converters. They all take `JsonNode` but return different types.
21:06:40rayman22201Nim cannot differentiate between them
21:07:03disrupteknone of that code block is executed.
21:07:33disrupteki just put that in there for comparison; it's like a series of comments.
21:07:43rayman22201maybe I misunderstood then
21:07:52rayman22201then why not just put it in a comment?
21:08:26rayman22201lol. sorry. minor pet peeve. I hate when people use always false if statements as comments. let me look again
21:08:35disrupteki dunno; i was breaking stuff out and recombining it. i had it working with enum generics separated out and i was trying to figure out why i could not typeclass completely.
21:12:34*shomodj joined #nim
21:13:45FromDiscord_<Kiloneie> Okay i get, what i did was bonkers xD, should echo a bit more often than i already do(which is a LOT)
21:15:29*vivus joined #nim
21:18:57disrupteki just don't understand how parseEnum could think it's its type is string inside a generic[enum] implementation.
21:19:55*solitudesf quit (Ping timeout: 258 seconds)
21:21:04*lritter joined #nim
21:22:04rayman22201It's not parseEnum. The get proc is treating foo["string"] as an enum
21:22:06rayman22201not a string
21:22:17rayman22201I'm just not sure why yet
21:24:01disruptekit's interesting that ints, enums, and bools work fine.
21:24:59*sagax quit (Remote host closed the connection)
21:32:32FromGitter<alehander42> Kiloneie
21:32:43FromGitter<alehander42> its because r_letters is not result
21:33:20FromGitter<alehander42> but you use result.low and .high
21:33:28FromGitter<alehander42> so maybe you want to result[stuff]
21:33:38FromGitter<alehander42> or to use r_letters.low and .high
21:33:50FromGitter<alehander42> many of those can be confusing, so your second version is more clear if works
21:35:25FromDiscord_<Kiloneie> It is more clear but i can't then use that loop to access both r_letters and r_values correctly, that was the problem of not wanting to use that one, i'd have to make a dictionary just for that.
21:35:25FromDiscord_<Kiloneie> Distruptek's solution worked though, iterating over r_letters.low.. high
21:36:01*narimiran quit (Read error: Connection reset by peer)
21:36:15FromGitter<alehander42> sorry didnt realize its fixed :P
21:36:50FromDiscord_<Kiloneie> No problem, thanks anyways 😃
21:37:04rayman22201ohhhh. @disruptek, I think I get it. Even the branches that aren't executed must type check. Because the type checking happens even though the branch isn't executed.
21:37:24rayman22201maybe a compiler / generics bug. I'm not sure.
21:37:53disruptekso when i make a statement that causes a generic to get built, it fails compilation because that changes the inputs to that type checking.
21:38:11FromDiscord_<Kiloneie> It is kind of hard getting used to a Static typed language after most of my coding experience outside of my computer science high school from ages ago, was in Game Maker(dynamic typing, which can be great, but in the long run i'd rather shoot myself than use dynamic again <.<)
21:38:42disruptekwell, don't shoot yourself. o.O
21:39:05disrupteknim: better than a speeding bullet to the temple.
21:39:07ZevvThat would make a rad slogan "don't shoot yourself, use nim!"
21:39:16Zevvhmm that was a bit on-the-edge, imho
21:39:27Zevvsorry about that
21:40:14FromDiscord_<Kiloneie> xD, well it's better to face problems right on that to deal with them hours or days later when they finally occur.
21:40:45rayman22201@disruptek. I'm not an expert in the generics code gen part of the compiler, but yes, I think it essentially instantiates a version the proc for each case of the allowed types, and type-checks the instantiation. It has no way to know that branch won't be reached in the string case.
21:40:57disruptekrayman22201: i can almost grok this, but why does int work while float does not?
21:41:04rayman22201also lmao at "don't shoot yourself, use nim!". Should be a sticker :-P
21:41:31rayman22201both int and float can be passed into `parseEnum[T]`
21:41:51FromDiscord_<Kiloneie> Man this Roman numerals exercise is killing me, third day on it, my brain can't comprehend how to digit to roman O,O
21:42:27rayman22201or specifically, when instantiating `parseEnum[T]`, `low[float]()`, `low[int]()` is valid, but `low[string]()` is not.
21:43:00disruptekyes, but when is T: float|int for `parseEnum`?
21:43:09rayman22201ironically, float and int probably shouldn't be allowed either, but you get lucky, because those happen to type check.
21:43:19rayman22201It's not!
21:43:56*Kaivo quit (Quit: WeeChat 2.5)
21:44:37disruptekit's interesting that json has a `getEnum` in it.
21:44:43rayman22201`converter toAnything[T: enum|string|float|int|bool](node: JsonNode): T ` is getting turned into `converter toAnything[T: enum](node: JsonNode): T`, `converter toAnything[T: string](node: JsonNode): T`, `converter toAnything[T: float](node: JsonNode): T`, `converter toAnything[T: int](node: JsonNode): T`, ``converter toAnything[T: bool](node: JsonNode): T`
21:45:13rayman22201I.E. the typechecker is putting in the types for each possible type.
21:45:37rayman22201and feeding that down to each called proc recursively to see if it type checks for all possible cases.
21:46:03disruptekso let's say it does. that code won't even compile for T: float, but it compiles for T: int.
21:47:41rayman22201you get lucky for int. It happens to typecheck all the way down
21:48:16disrupteki guess i don't know what "all the way down" means.
21:48:56rayman22201Typecheckers are recursive. It's going to replace and check the concrete type for the entire AST
21:49:26rayman22201even the branches that won't be accessed at runtime (Because the typechecker can't know anything about runtime)
21:49:28disrupteki doubt it. it doesn't compile it you don't cast getInt to T: int
21:49:45rayman22201That is exactly why you have to cast it
21:49:57disruptekwas there any doubt what getInt might return?
21:50:11rayman22201If the typechecker knew about runtime, then you would not have to have the casts inside your branch.
21:50:22disruptekyou cannot get it to work if you cast parseEnum, so...
21:50:54rayman22201what do you mean? I don't understand?
21:51:20disruptekyou say i need to cast all the return values to T when i assign them to result, right?
21:51:52disruptekbut, it works fine if you don't cast the result from parseEnum.
21:52:26rayman22201you probably do, but it fails earlier in the typecheck, so you don't get that error yet
21:52:40rayman22201it doesn't work because parseEnum fails :-P
21:52:55disruptekno, i mean if you comment out the string and float assignments, the remaining assignments/assertions all work fine.
21:53:27disruptekcompilation breaks because we add float to the generic typeclass.
21:53:48rayman22201yes. I know. that is expected
21:53:50disruptek(ie. by creating a runtime invocation with that type). but it's fine before that point.
21:54:03rayman22201Sorry. This is hard to describe over chat :-/
21:56:31rayman22201Your problem is a typechecker + generics problem.
21:56:56disruptekit really seems splitbrained to me.
21:57:33FromDiscord_<Kiloneie> .removeSuffix cannot remove letters if they are not connected one by one at the end right ?
21:57:49rayman22201The way generics work is that for each type you actually use, a version of the function gets code-generated for that type. This is called monomorphization.
21:58:09rayman22201it gets converted from "generic version" -> "specific version for that type".
21:58:38disruptekyes, but it remains unclear as to why adding an invocation of the generic with a float type causes compilation to fail.
21:58:54disruptek"turtles all the way down" doesn't really elucidate here.
21:59:02disruptekor s/turtles/types/
21:59:14rayman22201So when the compiler sees, `foo.get[int](....)` it makes an int version of `get`
21:59:32rayman22201or whatever other type `string` for example.
21:59:55rayman22201Nim does this in a slightly naive way. It does not take into account your if statement over the type.
22:00:34rayman22201so, it's going to do `parseEnum[string](...)` even if that function could never possibly get called (Because of your if statement)
22:00:46Araqif T is int: <-- use 'when T is int'
22:01:01Araqbut all of this code is a bad idea
22:01:05disruptekcan you tell me why this one works? https://play.nim-lang.org/#ix=1RGE
22:01:18disrupteki mean, i don't even want to use converters. that's the point.
22:02:04disruptekperfect, thanks Araq! :-D
22:02:16disruptekand no converter. 😁
22:02:48rayman22201duh, of course, when. That makes perfect sense. The compiler will see that at the right time.
22:02:54clyybberZevv: I like that slogan haha
22:03:02Araqwhy this one works? well because it's completely different
22:03:07rayman22201`if` works at runtime, `when` at compile ttime
22:03:31FromGitter<deech> disruptek, `Observations = FeralHogs | enum` compiled for you?
22:04:03disruptekdeepend: and you, if you hit the `run` button. 😉
22:04:26disruptekthat's what started this whole series of machinations...
22:04:57FromGitter<deech> For my own knowledge what does that syntax even mean?
22:05:18disruptekit's a typeclass mixing FeralHogs and any enum.
22:05:41rayman22201@disruptek, It just happens to work because `enum | FerlHogs` => `enum | range[]`. and `parseEnum` typechecks with both those types.
22:06:04FromGitter<deech> Dear god.
22:06:22rayman22201really @distruptek, you just got lucky
22:06:33rayman22201it does not work in the general case
22:06:58disruptekwhat is this general case of which you speak?
22:07:26rayman22201as in just about any other type
22:07:32rayman22201you happen to pick types that play nice
22:07:42clyybberAraq: Why does the compiler generate an else case for case of statements that cover all cases?
22:08:27Zevvquantum tunneling
22:08:31rayman22201lol
22:08:34disruptekcan you gimme an example where an errant type screws me up?
22:09:18rayman22201you have your own example already. The float type in your foo converter
22:10:04disruptekhow do you figure? it works fine if you use `when` to control the checker.
22:10:41rayman22201well yeah, `when` is the solution. But The example you sent doesn't use when
22:10:54rayman22201the FeralHogs example
22:11:11disruptekoh, so we can break it by sending it a float.
22:11:19rayman22201or a string
22:11:21rayman22201yeah
22:11:29disrupteki mean, people will always write broken code, myself included.
22:11:50disruptekthe only versions that ran were versions that worked, so i'm not too worried here.
22:11:57disruptekthey may as well have had typos.
22:12:20disruptekor insufficient memory to invoke the compiler. the result is the same. no binary to worry about.
22:12:50rayman22201Well yeah, but the whole point of typeclasses is to help avoid those kinds of errors.
22:12:57rayman22201But you have to use them properly
22:13:11disruptekuh, sure.
22:13:20rayman22201which means using `when` instead of `if` in these cases.
22:14:10disruptekso you're saying if i want to write code that's correct, i should correct my code?
22:15:07rayman22201lolol. I'm not trying to be an ass. You asked why your feralHogs example worked. We told you why. You got lucky.
22:15:18rayman22201Even a broken clock is right twice a day.
22:15:32rayman22201You wrote bad code that happened to work. That doesn't make it good code.
22:16:42disruptekand my point is that as long as the compiler doesn't GIGO, i'm happy.
22:19:25*rockcavera joined #nim
22:23:29rayman22201sure. Does that mean we helped you solve your problem? I was just trying explain what was going on, and why you got lucky with your code example.
22:27:50disruptekprobably the longest 1.5hr of my life, but, uh, sure.
22:28:08rayman22201Welcome to programming
22:28:12disruptekwouldn't you know it, all the tests still pass. 🙄
22:28:51rayman22201all the tests still pass when you do what?
22:31:33*abm quit (Quit: Leaving)
22:32:57rayman22201Also, just because a test suite passes doesn't mean there are no bugs. It just means you haven't written a test that catches a bug. So I don't know what your point is?
22:35:27disruptekand my point is that as long as the compiler doesn't GIGO, i'm happy.
22:39:15rayman22201It's a lot easier to not have GIGO when you actually understand how a feature works, but what ever. to each their own.
22:45:02*laaron quit (Remote host closed the connection)
22:47:00*laaron joined #nim
22:58:15clyybberAraq: You still here?
23:21:49*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:41:11*stefanos82 quit (Quit: Quitting for now...)
23:45:37*laaron quit (Remote host closed the connection)
23:50:06*laaron joined #nim