<< 21-03-2023 >>

00:08:18FromDiscord<etra> In reply to @anddam "btw why is there": because C isn't a programming language anymore <https://faultlore.com/blah/c-isnt-a-language/>
00:10:04FromDiscord<etra> In reply to @anddam "is that because C": (basically this, the ABIs circle around too close to C)
00:10:33FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4rnW
00:10:44FromDiscord<Elegantbeef> Well C is the language of FFI layout sadly
00:10:44FromDiscord<Elegantbeef> It's not something stronger typed like pascal
00:10:44FromDiscord<Elegantbeef> `MetaEnum` is not an integer
00:11:21FromDiscord<Elegantbeef> I do love the premise that arrays exist but no one until now has though of `[]` for them
00:11:33FromDiscord<Elegantbeef> Nim is nearing 2.0 😄
00:12:09FromDiscord<etra> are they getting closer to release?
00:12:12FromDiscord<Nilts> In reply to @Elegantbeef "`MetaEnum` is not an": wait so do index it like a table? Then what is the purpose of tables
00:12:28FromDiscord<Elegantbeef> Tables exist for any type to any other type
00:12:50FromDiscord<Elegantbeef> Arrays work with ordinal keys to be basically 0 cost enum indexed arrays
00:12:55FromDiscord<Elegantbeef> Tables also can not have a value, arrays are fixed size
00:13:00FromDiscord<Nilts> ah
00:13:09FromDiscord<Nilts> well, ok. This makes life easier
00:13:38FromDiscord<Elegantbeef> I mean it's soon is all i can say etra, i do not know anything more than you do
00:13:41FromDiscord<Nilts> Speaking of which, how does metaSubtitle, metaAuthor, metaVersion get set
00:14:14FromDiscord<Elegantbeef> How am i supposed to know, i do not even know what those are
00:15:03FromDiscord<Diogenes of Toronto> hey i am trying to add nim as a language to helix and I am wondering if anyone else has done so already.
00:15:44FromDiscord<Elegantbeef> https://github.com/helix-editor/helix/issues/3117
00:16:12FromDiscord<Nilts> In reply to @Elegantbeef "How am i supposed": https://nim-lang.org/docs/rstgen.html#MetaEnum
00:16:24FromDiscord<Elegantbeef> They're enums
00:16:49FromDiscord<Elegantbeef> They're ordinal values starting from `0` or the first `= val`
00:18:14FromDiscord<Diogenes of Toronto> In reply to @Elegantbeef "https://github.com/helix-editor/helix/issues/3117": thank you
00:18:30FromDiscord<Diogenes of Toronto> read it over seems like its been unsuccessful
00:18:31FromDiscord<Diogenes of Toronto> sigh
00:22:32*beholders_eye quit (Ping timeout: 246 seconds)
00:26:27FromDiscord<Nilts> In reply to @Elegantbeef "They're enums": ik. I am wondering what do you have to configure/what do you put in the rst to make these
01:18:07*nanxiao joined #nim
01:20:40*xet7 quit (Quit: Leaving)
01:46:27*nanxiao quit (Quit: Client closed)
02:01:26*nanxiao joined #nim
02:19:21*sagax quit (Remote host closed the connection)
03:20:39*nanxiao quit (Quit: Client closed)
03:28:24*nanxiao joined #nim
03:28:33FromDiscord<Elegantbeef> @elcritch\: so looking at fidgetty, would you be opposed to a PR that adds the abillity of generics to the fidgetty macro?
03:42:22FromDiscord<onemorepeter> I will teach you how to earn $1k with $200 in just 2hours from Blockchain … if you’re interested message me on Telegram on how to start earning…↵↵https://t.me/onemoresmithhttps://t.me/+7ANtL_KZI6VlMTJk
03:51:02*ltriant quit (Quit: leaving)
03:54:09FromDiscord<Gumbercules> wow, what a nice guy
04:03:12*rockcavera quit (Remote host closed the connection)
04:08:37FromDiscord<kubo39> <@&371760044473319454>
04:20:55FromDiscord<Gumbercules> In reply to @Elegantbeef "<@703717429230174229>\: so looking at": out of curiosity - does anyone still use fidget?
04:21:03FromDiscord<Gumbercules> I figured it was dead
04:24:25FromDiscord<Elegantbeef> Elcritch is using it as the basis for his widget api
04:28:15*nanxiao quit (Quit: Client closed)
04:31:16FromDiscord<Gumbercules> Yeah I know they were working on one, but since it seemed like fidget development stopped, that most likely did as well
04:31:23FromDiscord<Gumbercules> I guess I'm wrong in that assumption
04:31:43FromDiscord<Elegantbeef> Well fidgetty is based off a fork of fidget iirc
04:31:54FromDiscord<Gumbercules> ah gotcha
04:32:13FromDiscord<Elegantbeef> Fidget was at a place that it had alot of what is needed from a gui toolkit covered
04:32:42FromDiscord<Gumbercules> Yeah, just some annoying tight coupling
04:32:53FromDiscord<Gumbercules> it wasn't really a GUI toolkit / library it was an entire application framework
04:33:15FromDiscord<Gumbercules> since you couldn't decouple it from the drawing API it used
04:33:27FromDiscord<Gumbercules> or the windowing library - you had to bring glfw and opengl along
04:33:56FromDiscord<Elegantbeef> Well yea it's not aimed for making game UI it's made for making UI programs
04:34:14FromDiscord<Gumbercules> yeah I get that, but most people do that with the native window APIs
04:34:30FromDiscord<Gumbercules> and not OpenGL / GLFW
04:34:38FromDiscord<Elegantbeef> Except when they dont
04:34:44FromDiscord<Gumbercules> well, yes
04:34:48FromDiscord<Gumbercules> but again - annoying tight coupling
04:35:01FromDiscord<Gumbercules> there's a way to design it to be agnostic
04:37:33FromDiscord<Elegantbeef> I do not disagree but meh
04:37:47FromDiscord<Elegantbeef> A native Nim gui is a good thing generally
04:46:14FromDiscord<Gumbercules> Meh...
04:48:33FromDiscord<Gumbercules> https://github.com/simonkrauter/NiGui
04:48:38FromDiscord<Gumbercules> was always what I was hoping would take off
04:51:29FromDiscord<Elegantbeef> Yea i'm not one to really care about native unless it's nice to write
04:52:18FromDiscord<Gumbercules> I mean, that's easily fixable with a DSL on top of whatever library
04:55:17*azimut joined #nim
04:58:37*nanxiao joined #nim
05:19:22*ltriant joined #nim
05:25:02*xet7 joined #nim
05:42:12*cnx quit (Remote host closed the connection)
05:43:01*cnx joined #nim
06:12:59FromDiscord<ajusa> Has anyone here used fusion/matching or hmatching to match the first element in an array that has a specific value? I have an array of objects and I want the first element with a certain field being set to a value
06:14:22*junaid_ joined #nim
06:15:21*junaid_ quit (Remote host closed the connection)
06:24:55*nanxiao quit (Quit: Client closed)
06:30:33FromDiscord<basilajith> In reply to @disruptek "no wonder our web-server": Is there any good benchmarks for the http module?
06:31:38FromDiscord<basilajith> (edit) "Is" => "Are"
06:34:05FromDiscord<Rika> What the heck why’d you reply to a message 3 years old lmao
06:34:32FromDiscord<Rika> Personally, benchmarks aren’t useful unless you make them for your use case
06:37:58FromDiscord<Elegantbeef> Even worse when people take them as gospel
06:38:16FromDiscord<Elegantbeef> "X benchmark written shows that Y language is 100% slower than Z"
06:38:55Amun-Ra99% of benchamrks are worthless
06:39:09FromDiscord<Elegantbeef> And the other 1% are pointless
06:39:13Amun-Ratrue
06:39:42FromDiscord<Elegantbeef> Like on the subreddit someone was in disbelief that Nim could be as fast as C/C++
06:39:43Amun-RaI'd like to see benchmarks that measures which langauges sleeps one second the fastest
06:39:49Amun-Rameasure*
06:40:27FromDiscord<Elegantbeef> Lol
06:40:57FromDiscord<Elegantbeef> "I can sleep 1ms in .1ms in C"
06:41:14FromDiscord<Elegantbeef> Well actually if you throw open some threads that's technically possible, but shush
06:41:23Amun-Ra:>
06:41:42FromDiscord<Rika> I can cook minute rice in 58 seconds
06:41:51FromDiscord<huantian> I can destroy your mental health in an instant with C
06:41:51FromDiscord<Elegantbeef> That's no fair though
06:42:19*leastrio left #nim (#nim)
06:42:22*advesperacit joined #nim
06:44:17FromDiscord<Elegantbeef> Yea just declare a procedure that takes a `T` and do not document whether it's an array or an element
06:44:20FromDiscord<ringabout> If `Object(12, 1, 9)` is implemented as the shorthand for `Object(a: 12, b: 1, c: 9)`. Which should take the predecence, the object construction rewrite or the normal call?
06:44:40FromDiscord<Elegantbeef> Neither should
06:44:51FromDiscord<Elegantbeef> Named parameters should disable positional intialisation
06:44:54FromDiscord<Elegantbeef> and vice versa
06:45:30FromDiscord<Elegantbeef> `Object(a: 12, 1, 9)` is an as is `Object(12, 1, c: 300)`
06:45:34FromDiscord<Elegantbeef> Atleast that's my view
06:45:45FromDiscord<huantian> is an as is?
06:45:52FromDiscord<Elegantbeef> `and`
06:46:02FromDiscord<Elegantbeef> an error and is
06:46:21FromDiscord<Elegantbeef> I give up
06:46:24FromDiscord<Elegantbeef> Someone take my keyboard
06:46:29FromDiscord<huantian> Yeah that makes sense lol
06:47:05FromDiscord<Elegantbeef> One could argue positional followed by name makes sense, but ugh
06:47:26FromDiscord<huantian> In reply to @ringabout "If `Object(12, 1, 9)`": Would we have a recommended style in NEP-1?
06:47:45FromDiscord<huantian> Or would both be acceptable
06:48:11FromDiscord<ringabout> Both I suppose.
06:48:23FromDiscord<ringabout> Like https://en.cppreference.com/w/cpp/language/aggregate_initialization
06:48:25FromDiscord<Elegantbeef> At the very least i can see positional followed by named somewhat sensible, but no clue if it warrants the mess that it enables
06:50:40FromDiscord<huantian> You would have to check for extra edge cases like if you specify value both with position and name
06:54:41FromDiscord<Elegantbeef> dont have to 😛
06:55:51FromDiscord<huantian> Yeah true
06:55:55FromDiscord<huantian> Just say it’s undefined behavior
06:56:10FromDiscord<Elegantbeef> How would it be UB
06:56:15FromDiscord<huantian> And then you randomly choose which value is used at runtime on purpose
06:56:18FromDiscord<Elegantbeef> The last version would overwrite the first
06:56:22FromDiscord<Elegantbeef> Ah there you go
07:00:17FromDiscord<Elegantbeef> If ringabout keeps going after these language features, soon i'll have 0 macros
07:03:20FromDiscord<Gumbercules> I still really want to be able to instantiate an object and address it in the same line
07:03:47FromDiscord<Gumbercules> some of the new C initialization stuff is pretty rad
07:04:25FromDiscord<Elegantbeef> Luckily for the address and instantiate you can make a template
07:04:31FromDiscord<Elegantbeef> But yea not idea
07:05:05FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/zWB
07:05:18FromDiscord<Elegantbeef> Whoops `unsafeAddr(val)` at the end 😄
07:06:57FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4roT
07:08:29FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4roU
07:08:36FromDiscord<Elegantbeef> No
07:08:42FromDiscord<Elegantbeef> Byaddr is if you want a mutable reference to a `var T`
07:08:58*nanxiao joined #nim
07:09:01FromDiscord<Elegantbeef> gumber wants to to intialise memory and take the address of it
07:09:15FromDiscord<Gumbercules> right - currently you need to write a template or do something like
07:09:36FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4roV
07:09:57FromDiscord<Gumbercules> instead of just being able to call - `myInvocation(addr(Foo())`
07:10:05FromDiscord<Gumbercules> (edit) "`myInvocation(addr(Foo())`" => "`myInvocation(addr(Foo()))`"
07:10:30FromDiscord<Gumbercules> also being able to use the subscript operator in initialization is pretty awesome
07:10:51FromDiscord<Gumbercules> so you can initialize member array members
07:11:02FromDiscord<Elegantbeef> I do think very much think that in nim having `addr` work in that case is a bad idea, but like araq suggested `addrToTemp` or something similar is fine
07:11:33FromDiscord<Gumbercules> or just `tempAddr` probably as you wrote earlier
07:11:47FromDiscord<Gumbercules> hell `taddr` would be fine
07:11:58FromDiscord<Gumbercules> or `tmpAddr`
07:12:00FromDiscord<Elegantbeef> Yea anything but overloading `addr` to places it shouldnt be
07:12:05FromDiscord<Gumbercules> right
07:13:48FromDiscord<Elegantbeef> Anyway the array subscript is fine, it just gets a bit convoluted in Nim I think, since users can implement operators
07:16:05FromDiscord<Gumbercules> yeah, I'm not sure how one would go about implementing it cleanly
07:17:45FromDiscord<Gumbercules> sent a long message, see http://ix.io/4roW
07:17:49FromDiscord<Gumbercules> (edit) "sent" => "unrelated, but I finished bindings to Jolt Physics" | "long message, see http://ix.io/4roW" => "few moments ago - shared in #gamedev but I figured I'd share here too: https://gist.github.com/zacharycarter/8f9e70d4dc3b940d32e02137b0a640b2↵↵I'm integrating them into my project now. I also updated the gist with the Nuklear bindings:↵https://gist.github.com/zacharycarter/d37584c21481472717c053f3fb0c01cf"
07:18:06FromDiscord<Gumbercules> (edit) "bindings:↵https://gist.github.com/zacharycarter/d37584c21481472717c053f3fb0c01cf" => "bindings (which are already being used in my project):↵https://gist.github.com/zacharycarter/d37584c21481472717c053f3fb0c01cf"
07:18:19FromDiscord<Elegantbeef> That's way less than i expected for bindings
07:20:08FromDiscord<Gumbercules> 🤷
07:20:15FromDiscord<Elegantbeef> literally unusable links '.lib'
07:20:15*kenran joined #nim
07:20:22FromDiscord<Elegantbeef> Yea i was just surprised it's like 1k loc
07:20:33FromDiscord<Gumbercules> I mean - I'm not going to teach people how to compile
07:20:34FromDiscord<Gumbercules> or link
07:20:36FromDiscord<Gumbercules> that's on them
07:20:48FromDiscord<Gumbercules> but I'll share the time consuming part
07:20:54FromDiscord<Elegantbeef> I'm more joking that it's window centric
07:21:03FromDiscord<Gumbercules> oh yeah - well that's the first platform I'm targetting
07:21:10FromDiscord<Gumbercules> until I have something on one OS there's no point in supporting others really
07:21:28FromDiscord<Gumbercules> I guess I can add the compile commands for windows in another document in that gist
07:21:39FromDiscord<⚶ Zeno> In reply to @Elegantbeef "I'm more joking that": it just works 😔
07:21:52FromDiscord<Elegantbeef> Does it really though
07:21:59FromDiscord<Gumbercules> it does if you know what you're doing!
07:22:15FromDiscord<Elegantbeef> Gumber here is going to have to tell people "Hey my game is totally not a virus"
07:23:52FromDiscord<Gumbercules> nah - you will be able to link dynamically or statically with my project
07:24:02FromDiscord<Gumbercules> static linking is primarily for dev purposes because hot reloading
07:24:24FromDiscord<Gumbercules> excuse me - dynamic linking is primarily for dev purposes
07:24:40FromDiscord<Gumbercules> if you want to bundle everything up into your executable, you have that option as well
07:31:52FromDiscord<Gumbercules> and I'm pretty sure my game is going to be open source anyway - at least the code
07:32:14FromDiscord<Gumbercules> the engine certainly will, I haven't decided re: the game yet
07:34:36*PMunch joined #nim
07:40:28*rmt joined #nim
08:06:17*Notxor joined #nim
08:30:58*derpydoo joined #nim
08:33:59*nanxiao quit (Quit: Client closed)
08:36:21FromDiscord<jmgomez> @ElegantBeef, did you by any chance measure the diff on perf between json vs pnodes? Now that I have a working prototype I may revisit it
08:39:01FromDiscord<Elegantbeef> Nope
08:43:54FromDiscord<jmgomez> Ok, ticking the same set of funcs went from ~10ms in regular Nim to ~30ms. Not sure if due to the interop or just the VM being slow. I dont think it's that slow, so probably the former. One could thing though, is that I feed it 10K+ funcs to see how it scales, and even though the init times increases, the re eval time kept being <100ms
08:48:29*nanxiao joined #nim
08:53:18*beholders_eye joined #nim
09:13:14anddamElegantbeef | Tables also can not have a value, <-- care to elaborate?
09:17:20anddamthat seemed to suggest arrays have value
09:17:35FromDiscord<Elegantbeef> What?
09:19:12anddam?Elegantbeef | Arrays work with ordinal keys to be basically 0 cost enum indexed arrays
09:19:14anddamElegantbeef | Tables also can not have a value, arrays are fixed size
09:19:20anddamfrom the scrollback
09:19:32FromDiscord<Elegantbeef> Oh i mean that tables are not contiguous and fixed size
09:20:13FromDiscord<Elegantbeef> So you can have a lacking value
09:20:13FromDiscord<Elegantbeef> hence `key in table`
09:21:53FromDiscord<firasuke> what's the difference between `"some string".strip()` and `stripLineEnd("some string")`?
09:22:26anddamI see
09:23:00anddamback to my cimgui issue, I gather the generator script automatically looking for the dear-imgui source is not finding <something> <somewhere>
09:23:02anddam https://termbin.com/2r9d
09:25:39FromDiscord<Phil> In reply to @firasuke "what's the difference between": stripLineEnd is "in place", so it modifies your current string.↵It also only removes whitespaces from the end of the string.↵"strip" creates a new string (and will thus be slightly slower) and will remove whitespaces from both ends of the string
09:25:56FromDiscord<Phil> (edit) "In reply to @firasuke "what's the difference between": stripLineEnd is "in place", so it modifies your current string.↵It also only removes whitespaces from the end of the string.↵"strip" creates a new string (and will thus be slightly slower) and will remove whitespaces from both ends of the ... stringwill" added "string.↵In exchange, your original" | "string.↵In exchange, your originalstring ... " added "will rema
09:26:24FromDiscord<firasuke> Oh ok, but with `stripLineEnd` I need to use a var so it updates the string, but what if I am using `let` or a CONST?
09:27:22FromDiscord<Phil> Actually, allow me to correct myself
09:27:31FromDiscord<Phil> StripLineEnd doesn't do jack with whitespaces, it removes "\n"
09:27:51FromDiscord<firasuke> In reply to @Isofruit "StripLineEnd doesn't do jack": oh ok, sticking to `strip` then
09:28:00FromDiscord<Phil> And trying to use a proc that needs a `var` with `let/const` will result in compiler errors
09:28:19FromDiscord<firasuke> In reply to @Isofruit "And trying to use": exactly
09:28:33FromDiscord<Phil> Because you're telling the compiler with let/const: "Yeah, this value shall not change!" and the next second "Yeah, use this changeable value with this proc"
09:28:57FromDiscord<Phil> Which is a contradiction the compiler does not allow
09:28:58anddamoh nimgl/cimgui itself is a fork, I'll pull its upstream and see what happens
09:30:59FromDiscord<firasuke> In reply to @Isofruit "Which is a contradiction": I see, thanks for the explanation
09:54:20*fallback quit (Quit: IRCNow and Forever!)
09:56:45*nanxiao quit (Quit: Client closed)
09:56:56anddamand bingo
10:01:32NimEventerNew thread by Araq: Nim goto intermediate representation, see https://forum.nim-lang.org/t/10027
10:04:58*fallback joined #nim
10:15:07PMunchHmm, implemented the templating thing I spoke about the other day: http://ix.io/4rpF/
10:15:20PMunchIt's pretty much done in the dumbest way possible (copying strings and such)
10:16:25PMunchAnd it isn't great.. Like blocks can't have a shared end statement (e.g. `end`), and the simple matchers need an explicit end sequence, can't do e.g. Whitespace
10:16:50PMunchBut I'm not sure where to take it in the balance of flexibility and ease of use
10:17:29PMunchI could build it around streams and then have the user return from their parsers once they've hit their end condition, but then I'm pushing parsing work over on the user
10:17:40PMunchI guess with convenience procs it wouldn't be that bad..
10:23:11PMunch@Elegantbeef, your version is slower than the modified one I made in the benchmark :P
10:25:38PMunchWell, it's faster if you switch to int32's for the positions
10:25:42PMunchProbably better cache locality
10:40:43*nanxiao joined #nim
10:45:44*nanxiao quit (Quit: Client closed)
11:13:48FromDiscord<Phil> What exactly is a IR in the context of the nim compiler?
11:14:02FromDiscord<Phil> I saw Araq's topic and I don't even know what the acronym means ^^'
11:17:27PMunchIntermediate Representation
11:18:33PMunchSo with that RFC Nim would first be parsed into AST, then modified by macros, then converted into an IR which is easier to reason about in terms of control flow, then C code
11:19:54PMunchIn a way you can say that Nim already uses C as its IR
11:22:01FromDiscord<Andreas> has smth. changed with the `fieldPairs()`-iterator in devel ?
11:22:29FromDiscord<Andreas> (edit) "?" => "?↵gives me a TypeError oon code that works with 1.6.2"
11:22:43FromDiscord<Andreas> (edit) "oon" => "on"
11:23:40FromDiscord<Andreas> (edit) "has smth. changed with the `fieldPairs()`-iterator in devel ?↵gives me a TypeError on code that works with ... 1.6.2" added "1.6.2. Sry it's the other way around - works on devel, but not on"
11:26:08FromDiscord<ringabout> 1.6.2 or 1.6.12 ?
11:27:43FromDiscord<Andreas> In reply to @ringabout "1.6.2 or 1.6.12 ?": sry latest = 1.6.12
11:29:50PMunchHmm strange, I modified the @Elegantbeef optimisation of this benchmark to use a 70_000_000 unit large sequence to a similarly sized array and got a ~33% increase in performance
12:03:11*beholders_eye quit (Ping timeout: 264 seconds)
12:34:36*jmdaemon quit (Ping timeout: 265 seconds)
12:34:48FromDiscord<Nerve> I'm having an issue where a statically compiled binary that is running extremely fast on my development laptop is running very slow on a server, is there any reason that might be? Could it have to do with SSE instructions? I checked my binary disassembly and there is no AVX512.
12:42:16FromDiscord<Nerve> Nevermind, it appears that it's gnuplot
12:47:38FromDiscord<Nerve> If anyone has some insight as to why gnuplot might be extremely slow on some machines I'm open to it, I realize nobody might have any info on that.
13:47:10*fallback quit (Quit: IRCNow and Forever!)
14:06:27*PMunch quit (Quit: Leaving)
14:15:35*Notxor quit (Remote host closed the connection)
14:24:53*oprypin joined #nim
14:48:04FromDiscord<firasuke> how do you get progress, total and speed from `onProgressChange()` to use them as variables?
14:48:17FromDiscord<firasuke> (edit) "`onProgressChange()`" => "`onProgressChanged()`"
15:16:59*beholders_eye joined #nim
15:25:18FromDiscord<etra> I wonder, has anyone built something using Reshade addons api (<https://crosire.github.io/reshade-docs/index.html>) in Nim?
15:40:38*Notxor joined #nim
15:42:41*fallback joined #nim
15:52:59*xet7 quit (Ping timeout: 264 seconds)
15:55:51NimEventerNew thread by FabienPRI: How to get exe name from pid under Windows, see https://forum.nim-lang.org/t/10029
15:58:19*arkurious joined #nim
16:03:05FromDiscord<Phil> In reply to @etra "I wonder, has anyone": I don't think so, can't find any packages mentioning it at a first glance at least
16:05:23FromDiscord<Phil> In reply to @PMunch "Intermediate Representation": Why does araqs proposal has a seemingly random "goto" in its headline there? It's just about an IR, so why Nim goto or?
16:05:30FromDiscord<Phil> (edit) "or?" => "IR?"
16:11:46FromDiscord<Rika> It’s part of the name
16:11:48FromDiscord<Rika> “I called it the "Nim goto intermediate representation (NGIR)".”
16:12:05FromDiscord<Rika> “Compared to the AST NGIR contains these major changes:↵↵A proc body is a single list of instructions and control flow is mapped to labels and goto”↵…
16:13:29FromDiscord<Phil> Yeah but why is it part of the name? Why add seemingly non informative additional nouns like a java dev would?
16:14:44FromDiscord<Phil> Is goto stuff not also assumed to be covered by any IR?
16:20:22FromDiscord<Rika> The thing is that it’s the main star of the IR
16:22:22FromDiscord<Gumbercules> pretty sure gotos are fairly common in 3AC IR
16:22:39FromDiscord<Gumbercules> it's how control flow is commonly represented
16:23:03FromDiscord<Rika> Yeah, but the impression I get from reading it is that it’s meant to be the star, not that it is uncommon of course
16:23:04FromDiscord<deech> Please consider that the acronym NGIR is pretty vulnerable to problematic pronunciation and abuse. NIR does not have this problem.
16:24:01FromDiscord<eyes> interruption
16:24:13FromDiscord<eyes> sent a code paste, see https://play.nim-lang.org/#ix=4rry
16:24:24FromDiscord<eyes> this aint work lol, im struggling to find an implementation
16:24:28FromDiscord<eyes> seems like it should be so common
16:24:29FromDiscord<Gumbercules> `when defined`
16:24:34FromDiscord<Gumbercules> maybe?
16:24:36FromDiscord<Gumbercules> I don't know....
16:24:51FromDiscord<Phil> Goto intermediate representation in Nim; girn↵Best I can come up with other than nir
16:25:02FromDiscord<Gumbercules> nope...
16:25:07FromDiscord<Rika> I’m just explaining the possible thought process of the name, I’m not saying that that’s how I perceive IRs are
16:25:50FromDiscord<Gumbercules> oh @eyes you need to do
16:26:09FromDiscord<Phil> If we could somehow turn that name into Ginn, that'd be something
16:26:35FromDiscord<Gumbercules> https://play.nim-lang.org/#ix=4rrz
16:27:03FromDiscord<Phil> Generally use defined with when, not if
16:27:06FromDiscord<eyes> ahhh so when doesnt hide stuff in the scope of a block
16:27:13FromDiscord<eyes> its just like a ifdef
16:27:18FromDiscord<Gumbercules> no
16:27:28FromDiscord<Gumbercules> `when` is evaluated at compile time
16:27:41FromDiscord<Phil> When cuts code blocks out if it is false
16:27:53FromDiscord<Phil> May just not work well in that syntax
16:27:54FromDiscord<Gumbercules> `if` is not unless it's in a static block
16:28:04FromDiscord<eyes> ah okay
16:28:10FromDiscord<eyes> interesting
16:51:17FromDiscord<firasuke> why so many `"""`? https://nim-lang.org/docs/strformat.html#formatting-strings
16:52:27FromDiscord<Phil> ? That's for Multiline strings
16:53:23FromDiscord<firasuke> I want to format a string to be left aligned and span 15 characters, how would I do that using `fmt` or `&`?
16:53:53FromDiscord<firasuke> `echo fmt"""{"someString":>15}"""`
16:54:02FromDiscord<firasuke> is there a better way with less double quotes lol
16:54:50FromDiscord<firasuke> ok got it
16:58:24FromDiscord<eyes> could someone recommend a workflow for writing and testing a nim library? I tried using the builtin ``nimble test`` task, but when I do that it doesn't show the output of tests. I am early in development so I want to see what the program is actually doing, not just whether or not it builds and runs in certain cases
16:58:55FromDiscord<eyes> my only thought is to add a ``bin`` file in my .nimble for no reason other than having something to run, and then having a bunch of ``when isMainModule`` things in my code
16:59:17FromDiscord<eyes> would prefer not to add a bin entry if my project isnt meant to produce a binary though
17:01:52*Notxor quit (Quit: Leaving)
17:02:27*fallback quit (Quit: IRCNow and Forever!)
17:03:29FromDiscord<firasuke> In reply to @eyes "could someone recommend a": I am also facing a similar problem
17:03:47FromDiscord<firasuke> I am using testament and it is just not robust...
17:03:57FromDiscord<firasuke> I have to manually remove test artifacts
17:04:01FromDiscord<eyes> testament seemed like way too much for my purposes
17:07:22*rockcavera joined #nim
17:11:01FromDiscord<eyes> sent a code paste, see https://play.nim-lang.org/#ix=4rrK
17:11:03FromDiscord<eyes> manually for each test
17:12:28FromDiscord<Phil> In reply to @eyes "could someone recommend a": Honestly I just write one test module per Nim module I want to unit test or for integration tests one test module per functionality.↵I use std/unittest for that.↵You can check out the tinypool test suite or snorlogue test suite
17:12:58FromDiscord<Phil> Snorlogue does solely integration tests tbh, unit tests imo require proper mocking and I couldn't get that to work properly
17:13:40FromDiscord<Phil> And typically there's setup and teardown sections for every test suite
17:13:57FromDiscord<eyes> yeah thats just too much
17:14:23FromDiscord<eyes> having a testing script, or in this case a bunch of execs in my nimble file, is just simpler
17:14:25FromDiscord<Phil> Writing setup and teardown sections?
17:14:35FromDiscord<eyes> no its not that its too much work i just dont need it
17:15:23FromDiscord<eyes> im writing a library which just parses text (dates and recurrences, like "every week on Wednesday" into dateTimes
17:15:28FromDiscord<eyes> (edit) "Wednesday"" => "Wednesday")"
17:15:41FromDiscord<eyes> its super simple and has no dependencies nor setup
17:15:51FromDiscord<eyes> its like the platonic program, info->program->info lol
17:15:57*derpydoo quit (Ping timeout: 255 seconds)
17:16:05FromDiscord<Phil> I'd argue that using at least Std unittest for integration testing of your public API is worth it for guarantees in the long run, but I'm a stickler to standardisation anyway for better cooperation with others
17:16:34FromDiscord<eyes> maybe hm
17:16:50FromDiscord<eyes> earlier you mentioned "proper mocking"
17:16:55FromDiscord<Phil> But then again you can see from my test description that I can be fairly verbose to describe what I mean
17:16:57FromDiscord<eyes> what is that? why couldnt you get it to work?
17:17:12FromDiscord<etra> maybe it would be a good PR to do something like `--nocapture` to nimble
17:17:19FromDiscord<Phil> In reply to @eyes "what is that? why": You can get mocking to work with normal procs, but not generics
17:18:00FromDiscord<Phil> The reason for that is, that is that generics aren't real, they're a template to copy paste for the compiler that fills in the types
17:18:10FromDiscord<Phil> And I don't know enough about macros to deal with that
17:18:52FromDiscord<Phil> Mockingbird was my first attempt that died an ugly death
17:21:48FromDiscord<eyes> okay
17:22:12FromDiscord<eyes> ill take another look at std/unittest
17:23:50FromDiscord<eyes> hm
17:24:07FromDiscord<eyes> actually i have such a small need for testing that i think i could easily switch to this in the future if i need it so whatevs
17:24:17FromDiscord<eyes> maybe later if people actually use my library
17:26:12ZevvNGIR, really
17:28:19*fallback joined #nim
17:41:32FromDiscord<jmgomez> Is there a dumpTree version of pnodes/
17:41:35FromDiscord<jmgomez> (edit) "pnodes/" => "pnodes?"
17:42:02FromDiscord<LAURA> The objective & aim of chatting with me should be sex and relationship
17:48:25*kenran quit (Remote host closed the connection)
17:56:09FromDiscord<Rika> ok
17:56:24FromDiscord<Phil> I can't go on matrix while on phone, <@&371760044473319454> one ban please
18:02:30FromDiscord<Yepoleb> can't ban, permissions are fucked
18:04:03FromDiscord<Yepoleb> removed the message on discord
18:11:17Amun-Raah, laura one
18:12:57FromDiscord<pmunch> Sorry about that, should be fixed now↵(@Yepoleb)
18:16:42FromDiscord<pmunch> And I banned the spammer
18:16:53FromDiscord<Elegantbeef> Look at you lot missing out on secks
18:16:57FromDiscord<Phil> Thanks!
18:21:07*jmdaemon joined #nim
18:21:38FromDiscord<jmgomez> In reply to @jmgomez "Is there a treeRepr*": debug ouputs json which is something. Although it says it's deprecated
18:26:29FromDiscord<Gumbercules> I feel like the situation is a bit unfair to Araq
18:27:28FromDiscord<Phil> ?
18:29:15FromDiscord<Gumbercules> Like yah, it's a gaffe but he's not a native English speaker and while it can be pronounced so that it is phonetically similar to that slur it can also be pronounced in a totally innocuous manner
18:29:39FromDiscord<Elegantbeef> Phil it's in response to the new IR being named NGIR
18:29:51FromDiscord<Phil> Ohhhh that
18:29:55FromDiscord<Rika> i personally didnt realise until it was pointed out either
18:30:00FromDiscord<Gumbercules> But people are making it sound like he did it intentionally and I'm fairly certain nothing is further from the truth
18:30:02Amun-Rahmm
18:30:05FromDiscord<Gumbercules> In reply to @Rika "i personally didnt realise": Same
18:30:09FromDiscord<Rika> i definitely do not think it is intentional
18:30:15FromDiscord<Rika> but ofc i thikn it should be changed
18:30:18FromDiscord<Phil> I'm like 95 percent sure that was an accident, I only saw it after it was pointed out
18:30:21Amun-RaI'd pronounce it en-geer, and I'm not native too
18:30:24FromDiscord<jmgomez> I still dont even get it. What's the issue with it?
18:30:30FromDiscord<Gumbercules> I'm more confident than that
18:30:37FromDiscord<Gumbercules> I've known Andreas a long time
18:30:42FromDiscord<Rika> In reply to @Gumbercules "Same": most likely it's influenced by the fact my native language can have "ng" at the start of words xd
18:30:53FromDiscord<Phil> Because the acronym can be pronounced like the n bomb
18:31:10FromDiscord<Phil> If you stretch it a lot, that's all it is
18:31:14Amun-Rabut one has to try that very hard
18:31:39FromDiscord<Rika> first thought was pronouncing it as is, ngir as in "ng of sing + how ear sounds"
18:31:51FromDiscord<Gumbercules> He might have some rough demeanor at times, but he's not a racist
18:31:53FromDiscord<jmgomez> In reply to @Isofruit "Because the acronym can": Sorry I still dont get it
18:32:09FromDiscord<Gumbercules> The N word that people use as a slur for black people
18:32:13FromDiscord<Rika> In reply to @jmgomez "Sorry I still dont": its almost a stretch
18:32:15FromDiscord<jmgomez> ahh
18:32:17FromDiscord<jmgomez> ok
18:32:19FromDiscord<Gumbercules> Nim Goto Immediate Representation
18:32:26FromDiscord<Gumbercules> NGIR
18:32:31FromDiscord<Elegantbeef> I do not think it's a stretch
18:32:42Amun-Rawell, I thought NG stands for New Generation :>
18:32:47FromDiscord<Rika> i said almost
18:33:01FromDiscord<Gumbercules> I think it demonstrates where peoples minds are at
18:33:12FromDiscord<Gumbercules> Not like anyone is racist
18:33:23FromDiscord<Gumbercules> Just people are very sensitive to this stuff atm
18:33:36FromDiscord<Rika> but thats not necessarily bad
18:33:41FromDiscord<Phil> Engir is imo the way to read it
18:33:42FromDiscord<jtv> I mean, he has made quite explicit anti-trans statements, so it's not TOO hard to believe for those of us who don't know him.
18:33:52FromDiscord<Gumbercules> It's not necessarily good either
18:34:10FromDiscord<Phil> But yeah, might as well just go with nir
18:34:12FromDiscord<Gumbercules> But I think the safe thing to do is amend it before anyone gets the wrong impression
18:34:17FromDiscord<jtv> 100%
18:34:19FromDiscord<Gumbercules> It already was posted to HN
18:35:12FromDiscord<jtv> The whole name drips in religious conservatism
18:35:14FromDiscord<Gumbercules> We don't need another dlang like incident
18:35:31FromDiscord<Rika> In reply to @Gumbercules "We don't need another": do i want to know
18:35:34FromDiscord<Gumbercules> In reply to @jtv "The whole name drips": Nim?
18:35:50FromDiscord<Gumbercules> In reply to @Rika "do i want to": You probably already do...
18:36:03FromDiscord<Gumbercules> I know the Nimrod and babel stuff
18:36:03Amun-Rathat reminds me of that zig thing
18:36:21FromDiscord<Gumbercules> I was around for some of that haha
18:36:23FromDiscord<firasuke> can you control which shell to use when running `execCmd`/`execCmdEx`?
18:36:31FromDiscord<Gumbercules> But not too many people know about it either
18:36:50FromDiscord<jtv> Yup, it doesn't take long looking at the language for anyone who has basic awareness of such things to get that the choices were made by someone steeped in the Christian religious tradition
18:37:04FromDiscord<Rika> man i have the memory retention of an unpowered stick of ram
18:37:10Amun-Ra;P
18:37:12FromDiscord<jtv> Oh, I'm pretty new to the language and I feel like I was smacked in the face w/ it honestly.
18:37:38FromDiscord<Rika> In reply to @Gumbercules "You probably already do...": i really dont recall what you mean by the dlang incident
18:38:13FromDiscord<Gumbercules> Sure but that's not necessarily anything to admonish or take offense to - not claiming you are either
18:38:33*rmt quit (Ping timeout: 265 seconds)
18:39:08FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4rsl
18:40:05FromDiscord<Gumbercules> It's not like anyone has to adopt anyone's beliefs or embrace any dogma
18:40:06FromDiscord<Phil> In reply to @Rika "i really dont recall": I'll write in offtopic to keep the chat here on track
18:40:52FromDiscord<jtv> No, but it makes plenty of people uncomfortable. Lots of people refuse to eat at Chick-Fil-A, and plenty of people eat there but a lot less than they would because it gives them guilt
18:40:54FromDiscord<Gumbercules> But yeah, the themes are quite obvious if one is paying attention and knows anything about religion.
18:41:24FromDiscord<Gumbercules> Well it's hard to not make someone uncomfortable these days.
18:42:14FromDiscord<jtv> I don't think that's true if you have a basic respect for people with beliefs different than yours.
18:42:23FromDiscord<Gumbercules> People are often looking for reasons to find someone to hitch their blame wagon to for one reason or another
18:42:51FromDiscord<jmgomez> In reply to @jmgomez "<@145405730571288577> Dunno how many": BTW what is `import assume/typeit` ? Is it a nimble package?
18:43:17FromDiscord<firasuke> what's the difference between execProcess, execCmd, execCmdEx and startProcess? (I want to run a command through a custom shell `dash` in a certain working directory while storing output to a file)
18:43:27FromDiscord<Phil> Could we keep this channel for code debate? :-p we have offtopic
18:43:40FromDiscord<Gumbercules> Eh, I mean I'm not religious but I've had uncomfortable interactions with folks here because they don't share my beliefs or views on certain subjects.
18:43:59FromDiscord<Phil> Oh god that requires me to look at docs, give me a bit unless somebody else answers
18:44:30FromDiscord<Gumbercules> It's hard / near impossible to get along with everyone - both on and off the internet
18:44:58FromDiscord<jtv> Sure, but if you're not going to try to consider the likely feelings of other people, then it's YOUR issue not theirs.
18:45:13FromDiscord<Gumbercules> Agreed
18:45:37FromDiscord<jtv> It's as if I said, "While my name is John, I don't like it, call me Jack", and you refuse to call me Jack. It just makes you an asshole. And that's enough, I'll let Phil have his channel back 🙂
18:47:06FromDiscord<Phil> Finally on a PC, docs here I come
18:48:51FromDiscord<firasuke> In reply to @firasuke "what's the difference between": I had success with `execProcess` should I continue using it, or consider something else for this use case?
18:50:09FromDiscord<Phil> sent a long message, see http://ix.io/4rsp
18:50:55FromDiscord<firasuke> In reply to @Isofruit "execProcess: Returns whatever the": thanks for the explanation, guess I'm going with execCmdEx then
18:51:04FromDiscord<Gumbercules> In reply to @Isofruit "execProcess: Returns whatever the": I think start process would be for a service/daemon
18:51:16FromDiscord<Phil> Yeah, looks to me like that as well
18:51:20FromDiscord<Gumbercules> And it'd be a separate process not just a separate thread
18:51:57FromDiscord<Phil> In reply to @firasuke "thanks for the explanation,": "output" can also be an error stacktrace, keep that in mind.↵So ideally first check whether it succeeded with the success code, if it didn't raise an exception with the output as part of the exception
18:52:16FromDiscord<Phil> (edit) "stacktrace," => "stacktrace printed by command you triggered,"
18:52:32FromDiscord<firasuke> ok, and for storing the output in a file?
18:52:42FromDiscord<0ffh> In reply to @Gumbercules "We don't need another": Did I miss something?
18:53:28FromDiscord<0ffh> What incident?
18:53:31FromDiscord<Phil> In reply to @firasuke "ok, and for storing": I don't quite follow, wouldn't you just pipe it then?
18:53:37FromDiscord<Phil> In reply to @0ffh "Did I miss something?": See offtopic
18:54:31FromDiscord<firasuke> In reply to @Isofruit "I don't quite follow,": pipe it from within the command passed to execCmd, as in `execCmd("someCommandInShell > tosomething")`?
18:54:54FromDiscord<Phil> Yeah.↵I mean the alternative is you take the output and write the file yourself, but I'd imagine this is way less complicated
19:02:09NimEventerNew thread by Angluca: Looks like c-nim ?, see https://forum.nim-lang.org/t/10030
19:03:04FromDiscord<firasuke> In reply to @Isofruit "Yeah. I mean the": funny thing is I was already doing this and thought there was a better way xD
19:05:49*Phytolizer joined #nim
19:08:13FromDiscord<Phil> In reply to @firasuke "funny thing is I": You're already diving into bash-land, might as well 😛↵Though that does bind your code to linux/macos land
19:08:48FromDiscord<firasuke> In reply to @Isofruit "You're already diving into": well that's where I come from kekw, and that's were the executable is intended to run, so no harm done I guess 🙂
19:14:00FromDiscord<firasuke> is there such a thing as string substitution in Nim? echo("this is something {}", someVariable)?
19:14:07FromDiscord<firasuke> (edit) "echo("this" => "`echo("this" | "someVariable)?" => "someVariable)`?"
19:14:33FromDiscord<firasuke> nvm should just use concatenation using `&`
19:16:30*Phytolizer quit (Remote host closed the connection)
19:16:50*Phytolizer joined #nim
19:23:34FromDiscord<Elegantbeef> Are you just using my vm conversions module?↵(@jmgomez)
19:25:06FromDiscord<jmgomez> In reply to @Elegantbeef "Are you just using": yup, what is import assume/typeit ? Is it a nimble package?
19:25:20FromDiscord<jmgomez> (edit) "import assume/typeit" => "`import assume/typeit`"
19:25:21FromDiscord<Elegantbeef> Yes
19:25:35FromDiscord<Elegantbeef> https://github.com/disruptek/assume/blob/master/assume/typeit.nim
19:26:58FromDiscord<jmgomez> Nice, Im still implementing `from` without json. Will check it out later, it's only needed for `to`↵Hope to see some gains
19:27:34FromDiscord<Elegantbeef> I really do need to clean the parse logic inside nimscripter eventually
19:30:03FromDiscord<jmgomez> `vmconversion` doesnt look bad, taking into account that's dealing with some complicated stuff. Also the fact that I could just picked the file and it worked, speaks of it!
19:31:15FromDiscord<Elegantbeef> Yea that was one goal, detatch the serialisation
19:31:25FromDiscord<Elegantbeef> Did you get any speed boost?
19:32:01FromDiscord<jmgomez> Im far away still from testing it, will let you know
19:41:14*xet7 joined #nim
19:42:11*Phytolizer quit (Remote host closed the connection)
20:17:40*Notxor joined #nim
20:22:42*jmdaemon quit (Ping timeout: 268 seconds)
20:22:46FromDiscord<System64 ~ Flandre Scarlet> Do you know how I can convert a char to a string please?
20:23:05FromDiscord<huantian> `$somechar`
20:23:32FromDiscord<System64 ~ Flandre Scarlet> Alright, thanks
20:25:58*kenran joined #nim
20:39:16FromDiscord<I have 50GB of nothing on my PC> TIL araq is a christian fundamentalist
20:54:05anddamhowdy, in my journey to update nimgl/imgui I finally have an actual nim issue
20:54:22FromDiscord<Elegantbeef> Ruh roh
20:54:24anddamand I am not liking it very much
20:55:58anddamhttps://github.com/anddam/imgui/blob/master/tools/generator.nim#L61 relies on a global table to check enum info, the table is populated at https://github.com/anddam/imgui/blob/master/tools/generator.nim#L147
20:57:42FromDiscord<Elegantbeef> What's the issue?
20:57:45anddamthe function at L127 reads data from a JSON and fill in the table, at L140 you can see it taking the "name" attribute of a dict
20:57:58anddamI am rubberxplaining
20:59:25anddamthe issue is that the a few names have a trailing "_COUNT" part, that logic takes them and stores in the global table
20:59:33anddame.g. "name" = "ImGuiLocKey_COUNT"
21:00:15anddamso the table gets a key "ImGuiLocKey" with the "ImGuiLocKey_COUNT" value
21:00:32anddamor rather the "value" sibling to "name"
21:01:23anddamthe issue is that now on updating cimgui the generator chokes on "ImGuiKey_NamedKey_COUNT" and rightfully so since it's storing the "ImGuiKey_COUNT" due to that manual split
21:02:12anddamno, that is a wrong description of the issue
21:02:52anddamthe name part taken into account is dataName = dataName.split("_")[1] and that is compared to "COUNT" but that's not going to happen on "ImGuiKey_NamedKey_COUNT" since the element index 1 is "NamedKey"
21:03:00anddamis there [-1] slicing as in python?
21:03:07anddamlet's check
21:03:17FromDiscord<Elegantbeef> `[^1]`
21:03:58anddamyea, it already died with a horrid IndexDefect
21:04:08*jmdaemon joined #nim
21:04:24anddamba-da-bingo!
21:04:35anddamElegantbeef: thanks, took just two days of your effort
21:04:40anddam;-)
21:04:54FromDiscord<Elegantbeef> I'm getting overworked over here
21:04:56FromDiscord<Elegantbeef> I need a riase
21:04:58FromDiscord<Elegantbeef> raise\
21:05:02anddamlet me sip the serotonin
21:05:48anddampro question: how do I debug this thing? I just threw echo &"" as needed to figure this out
21:06:04anddambut there has to be some gdb-like evil machinery somewhere
21:06:20FromDiscord<Elegantbeef> You can use gdb somewhat, i just use echo for 99% of things
21:06:57FromDiscord<Elegantbeef> The cursed part is that i contribute to the compiler using echo debugging 😄
21:07:46anddamnot a problem, many years of pythoning have taught me the wisdom of printing to console
21:08:11anddamI also learnt how to run tasks with nimble, quite the learning experience
21:10:05FromDiscord<Gumbercules> Debuggers are life changing
21:10:46FromDiscord<Elegantbeef> I generally just need a value printed out at a given line
21:10:54FromDiscord<Elegantbeef> So like i could do it with a debugger or just write echo
21:11:01FromDiscord<huantian> it is nice to use a debugger to do that tho so you don't need to recompile
21:11:02FromDiscord<Gumbercules> I mean, if your program is simple sure
21:11:09FromDiscord<Elegantbeef> Especially since lldb and gdb are comically bad with any Nim types, it's a waste
21:11:26FromDiscord<Elegantbeef> I mean i did just say i debug the compiler using ech
21:11:49FromDiscord<Gumbercules> Also with time travel debugging you can go back and change program input and or state at whatever frame
21:12:12FromDiscord<Gumbercules> When I said simple I probably wasn't specific enough
21:12:35FromDiscord<Elegantbeef> I know you mean simple logic
21:12:41FromDiscord<Elegantbeef> I agree though
21:12:46FromDiscord<Gumbercules> Well like, no threads
21:12:56FromDiscord<Gumbercules> Minimal C interop
21:13:20anddamis there a builting debugger?
21:13:29FromDiscord<Elegantbeef> No
21:13:41FromDiscord<Elegantbeef> you can use any C debugger if you supply `--debugger:native`
21:13:49anddamhttps://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#debugging-nim-code ah using echo, writeStackTrace and gdb/lldb
21:13:52FromDiscord<Elegantbeef> But as I said it's a sad sight since many Nim types are not sensible
21:14:07FromDiscord<Gumbercules> Chasing down certain bugs can be a PITA when you have multiple threads of execution or stack over/underflow segfaults etc
21:14:23FromDiscord<Gumbercules> In reply to @anddam "is there a builting": What OS are you on?
21:14:58FromDiscord<Gumbercules> In reply to @Gumbercules "Chasing down certain bugs": Especially if you're calling into C/C++
21:15:12FromDiscord<Gumbercules> Then you need to printf debug there
21:15:28FromDiscord<Diogenes of Toronto> Hey i am looking to do some natural language processing for checking whether a commit's title is in the imperative mood. Does anyone have any ideas on how to do this in a somewhat quick way?
21:16:03anddamhrmm I got another error
21:16:18anddamthe generated imgui.nim now lacks a few enum labels
21:16:47anddamso in a type ImDrawFlags* {.pure, size: int32.sizeof.} = enum
21:16:59anddamthe repo had RoundCornersMask = 496
21:17:08anddamI now have = 496
21:19:18FromDiscord<Gumbercules> https://iconix.github.io/portfolio%20building/2017/09/25/nlp-for-tasks
21:19:40FromDiscord<Gumbercules> @Diogenes of Toronto I have no clue if this link will be helpful
21:19:52FromDiscord<Gumbercules> Seems pretty detailed though
21:25:22anddamElegantbeef: found, the [^1] is the culprit
21:32:04anddamnow for the Noob Corner, how do I split a literal string? I tried echo "foo_bar_baz".split("_") but got a Error: attempting to call undeclared routine: 'split'
21:32:28FromDiscord<Elegantbeef> `import std/strutils`
21:39:03anddamnim's type system scares me a bit
21:39:20FromDiscord<huantian> how so 😆
21:40:15anddamI have the result of split() I see it's seq[string] I want to remove empty strings from it, I guess there's a filtering function and I find one in sequtils
21:40:28anddamhuantian: not used to it, I guess
21:41:06anddamfilter wants openArray, how do I check seq "complies" with openArray?
21:41:26FromDiscord<huantian> i'd probably use `filter`/`filterIt` from sequtils
21:41:26FromDiscord<Elegantbeef> `seq` and `array` implicitly convert on dispatch to `openArray`
21:41:28*advesperacit quit ()
21:41:29FromDiscord<huantian> yeah that
21:42:02FromDiscord<ajusa> In reply to @anddam "https://nim-lang.org/blog/2017/10/02/documenting-pr": It is a little depressing how little has changed in the tooling for debugging in 6 years
21:42:05FromDiscord<Elegantbeef> Though i'd still question what are you trying to extract and do you actually want `split` or is that just python rotting your brain
21:45:28anddammight be, the point is that split("_")[^1] I used in place of split("_")[1] earlier, with a key with trailing _ I get an empty string in the sequence
21:45:41anddam"foo_bar_" -> ["foo", "bar", ""]
21:45:54anddamI want to filter the sequence, then get [^1]
21:46:27anddamfilter(value.split("_"), proc (x: string): bool x != "")[^1] is my wild guess
21:47:03anddammissed an equal sign there, it seems
21:47:26anddamyep
21:48:25FromDiscord<huantian> `value.split(_').filter(proc (x: string): bool x != "")[^1]`
21:48:28FromDiscord<huantian> (edit) "`value.split(_').filter(proc" => "`value.split('_').filter(proc"
21:48:35FromDiscord<huantian> (edit) "`value.split('_').filter(proc (x: string): bool ... x" added "="
21:49:00anddamoh fat arrow notation, noice
21:49:26FromDiscord<huantian> or if you like filter it `value.split('_').filterIt(it != "")[^1]`
21:49:34anddamnoice-er
21:50:08anddambtw there isn't a CLI repl for nim, right? I found repl.it but it's not the same thing
21:50:34FromDiscord<huantian> you can try `inim` or `nim secret`
21:50:48anddamfor playing with this I made foo.nim and nim c -r that, but that was the perfect fiddling case for a REPL
21:50:54anddamthx
21:50:55FromDiscord<huantian> also beef aren't you supposed to complain about seqs and memory and parsing and stuff :)
21:52:14FromDiscord<Elegantbeef> I am huan, but where's the fun in always screaming about the python ways
21:52:59anddamchange of topic, after a split("_") how is ever https://github.com/anddam/imgui/blob/master/tools/generator.nim#L144 going to hit true?
21:55:58anddamoh jeez, inbefore the wrapper had enums Nav = 4\n Clipboard = 5 , after updating cimgui and running the generate script Clipboard = 4\n Nav = 5
21:59:21anddamanother glitch Error: identifier expected, but got '0'
22:00:41anddamthe generator assumed the key values in config were like "ImGuiSomething_Alphasomething" and had a numeric value, then proceeded to use ImGuiSomething* = enum with Alphasomething = value
22:00:57anddamnow there's ImGuiSomething_0 and it's trying to use 0 = 536 in the enum listing
22:08:26*kenran quit (Remote host closed the connection)
22:15:25FromDiscord<konradmb> What is wrong with this code\: https://play.nim-lang.org/#ix=4rtm ?↵Forget functionality, it's not implemented correctly.↵I get gcc error\:↵> has no member named 'has'
22:16:39FromDiscord<Elegantbeef> C compiler bug nice
22:17:59FromDiscord<Elegantbeef> I mean a codegen issue
22:18:32FromDiscord<konradmb> So is it my fault or should I report it on GitHub?
22:19:19FromDiscord<Elegantbeef> Nim should never have a cgen bug
22:19:29FromDiscord<Elegantbeef> So yes you should attempt to make a min repro and report it
22:20:51FromDiscord<Elegantbeef> I'd wager the 0 cost `Option` api is causing the issue
22:21:03FromDiscord<Elegantbeef> Since there is no `has` for `Option[ref]`
22:21:19FromDiscord<jmgomez> Beef, just could retest things, no much gain but at least looks better
22:21:35FromDiscord<Elegantbeef> You are testing in `release` right?
22:22:01FromDiscord<konradmb> Choosenim stable and devel gives the same error
22:22:11FromDiscord<Elegantbeef> Yea it's a cgen bug
22:22:35FromDiscord<Elegantbeef> For some reason it's calling `.has` for a `Option[ref]` even though it shouldnt
22:22:44FromDiscord<jmgomez> In reply to @Elegantbeef "You are testing in": nope, not sure if that will mess things up with the pch
22:23:09FromDiscord<jmgomez> but will try tomorrow, probably it will enable some incompatible flags anyways
22:23:31FromDiscord<Elegantbeef> I mean release for the compiled code
22:23:41FromDiscord<Elegantbeef> Benchmarking debug code is silly
22:25:02FromDiscord<jmgomez> I know what you meant. Well the sets of conditions are the same
22:25:35FromDiscord<jmgomez> Thing is if I enable opts I have to enabled them accross the plugin and all UE modules
22:26:01FromDiscord<jmgomez> and I cant really change the compiler flags for the cpp on the PCH
22:26:19FromDiscord<jmgomez> it requires a custom ue build, which defeat the purpose of the plugin
22:27:46FromDiscord<Elegantbeef> Ah
23:01:28FromDiscord<Bizarro> sent a long message, see http://ix.io/4rtu
23:03:12FromDiscord<Bizarro> sent a long message, see http://ix.io/4rtw
23:03:47*jmdaemon quit (Ping timeout: 264 seconds)
23:04:04FromDiscord<Bizarro> Could it be that the underlying system function that is used by getHomeDir() may not be Unicode-ready, or something like that?
23:04:11FromDiscord<Elegantbeef> well Nim wouldnt replace the character, so sounds like windows
23:04:52FromDiscord<MOV RAX> I'm using the nimsaem.nimvscode extension and I've noticed that I get absolutely no code completion for libraries that require the js backend to be enabled. I've looked around and it seems like `nimsuggest --backend:js` is supposed to work, but I don't see an option in the extension to change the backend. Any help would be appreciated.
23:05:03FromDiscord<Elegantbeef> !eval echo "C\:\\Users\\Señor"
23:05:07NimBotCompile failed: /usercode/in.nim(1, 9) Error: invalid character constant
23:05:16FromDiscord<Bizarro> I've tried to change the codepage with chcp in cmd, and also with the following in PowerShell, but to no avail...↵$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
23:05:23FromDiscord<Elegantbeef> !eval echo echo "C\:\\Users\\Señor"
23:05:26NimBotCompile failed: /usercode/in.nim(1, 14) Error: invalid character constant
23:05:39FromDiscord<Elegantbeef> I swear to jeebus
23:05:42FromDiscord<Elegantbeef> Anyway it works fine
23:05:56FromDiscord<Elegantbeef> Make a config with `--backend:js`
23:06:03FromDiscord<Elegantbeef> `config.nims` to be exact
23:06:39FromDiscord<MOV RAX> In reply to @Elegantbeef "`config.nims` to be exact": Do I put it alongside the nimble file?
23:06:41FromDiscord<Elegantbeef> I mean it's just a call to `getEnv("USERPROFILE")`
23:07:04FromDiscord<Elegantbeef> Should just be root of your project or next to the file you're calling
23:07:54FromDiscord<Elegantbeef> What does `echo getHomeDir().len` report?
23:09:27FromDiscord<konradmb> Preferably yes, but you can put it anywhere here\: https://nim-lang.org/docs/nims.html↵(@MOV RAX)
23:10:29FromDiscord<Bizarro> Yeah, I took a look at the Nim source... so I suppose the problem is in the underlying C or system function, because the env variable was OK.
23:11:10FromDiscord<konradmb> It is nimscript couterpart of nim.cfg files https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files↵It comes in handy when you need to have --threads\:on, so you don't need to enable it everytime
23:13:07FromDiscord<Bizarro> I am talking in the past tense because today, after several days of problems with several programs because of that (scoop didn't work, oh-my-posh didn't work...), I've finally "renamed" my user folder.
23:13:39FromDiscord<MOV RAX> nice, it works now
23:14:05FromDiscord<Bizarro> Well, it can't be officially renamed, but I had to (using another admin account, editing the registry... ugh!).
23:14:09FromDiscord<Nilts> How do you compile to wasm again?
23:15:03FromDiscord<Bizarro> But the problem is there. It's already late where I live, but tomorrow I will try to create a new Local User with the name "Niño" and I will try to reproduce it.
23:16:19FromDiscord<Bizarro> What I can confirm now is that I tried to run choosenim both in cmd and in PowerShell 7, and redirected the error to a txt file.
23:19:13FromDiscord<Bizarro> Opening the files with an Hex editor, I remember that the one from cmd had the Hex value "F1" (which is 'ñ' in codepage 1252)
23:20:01FromDiscord<Bizarro> so the length was 1 byte, but on the cmd screen appeared as '�' (the app was Windows Terminal, the official terminal which comes with Windows 11)
23:20:33FromDiscord<Bizarro> it showed as '�' instead of 'ñ', although I tried with codepage 1252 and 850 explicitly
23:21:39*jmdaemon joined #nim
23:22:04FromDiscord<Bizarro> In the output obtained from PowerShell, the '�' on screen was written as 3 bytes in the txt file. Unfortunately, I cannot remember the values... but I think that the first two ones were shown as '00' in the Hex editor.
23:23:28FromDiscord<amadan> In reply to @not logged in "How do you compile": Using emscripten and following this tutorial https://github.com/treeform/nim_emscripten_tutorial is what I usually do
23:24:22FromDiscord<Nilts> In reply to @amadan "Using emscripten and following": ok, i will try. Btw, what is emscripten?
23:24:38FromDiscord<amadan> Its a compiler for c to wasm
23:24:52FromDiscord<amadan> (edit) "c" => "c/c++"
23:25:45FromDiscord<Nilts> In reply to @amadan "Its a compiler for": ok, but the tut wants me to install python, is there a reason for that?
23:26:55FromDiscord<amadan> The sdk installer is written in python↵https://github.com/emscripten-core/emsdk
23:27:40FromDiscord<Nilts> In reply to @amadan "The sdk installer is": if this is only for installation, can i just install it in my preferred package manager instead of installing python?
23:28:06FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4rtC
23:28:06FromDiscord<amadan> In reply to @not logged in "if this is only": yeah should be fine
23:28:22FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4rtD
23:28:59FromDiscord<Nilts> probably here: `proc(a, b: T): bool = a < b`. I don't think it works like that
23:30:08FromDiscord<huantian> sent a code paste, see https://paste.rs/COK
23:31:14FromDiscord<huantian> oh i see
23:31:22FromDiscord<huantian> it fails when you try to pass in a value for less
23:32:20FromDiscord<huantian> https://play.nim-lang.org/#ix=4rtJ
23:32:55FromDiscord<huantian> You have to specify the type of the default param apparently
23:33:56FromDiscord<AmjadHD> In reply to @huantian "You have to specify": I'm aware of that, I wanted to know why. anyway thx.
23:35:47FromDiscord<huantian> Might be a bug
23:36:06FromDiscord<huantian> Could be worth opening a bug report on GitHub
23:37:09FromDiscord<Bizarro> I also would like to say thanks to everybody for your help. I will try to create another user with an 'ñ' in the folder name and reproduce the error, and update here.
23:37:10FromDiscord<Elegantbeef> It's a known bug with generic parameters iirc
23:37:56FromDiscord<Elegantbeef> I believe the issue is that the right hand of the `=` is attempted to be sem'd before instantiation
23:38:04FromDiscord<Elegantbeef> Which means `T` does not exist
23:43:30FromDiscord<Bizarro> Oh! I've had an idea! Since the implementation of getHomeDir() on Windows is simply a call to getEnv("USERPROFILE"), I've created a new dummy environment variable with the value "C:\Users\Niño".
23:43:38FromDiscord<Bizarro> Now I can reproduce the error:
23:45:23FromDiscord<Bizarro> https://media.discordapp.net/attachments/371759389889003532/1087884692239425616/image.png
23:45:47FromDiscord<Bizarro> this is PowerShell 7, the returned Length is 13
23:45:50FromDiscord<Bizarro> and in cmd:
23:46:43FromDiscord<Bizarro> https://media.discordapp.net/attachments/371759389889003532/1087885026571591710/image.png
23:47:13FromDiscord<Bizarro> also 13! but you can see the '�' character on both screens
23:47:59FromDiscord<Bizarro> that character breaks choosenim (and probably many things more, because the getHomeDir() function is commongly used)
23:48:01FromDiscord<Elegantbeef> What is `ord(getEnv(...)[^2])`?
23:48:46FromDiscord<Bizarro> 241
23:49:30FromDiscord<Bizarro> 241 in cmd, I mean
23:49:35FromDiscord<Bizarro> let me check PS
23:49:47FromDiscord<Elegantbeef> That doesnt matter
23:49:48FromDiscord<Elegantbeef> This is nim reporting it
23:49:50FromDiscord<Bizarro> 241 also
23:50:02FromDiscord<konradmb> @Bizarro\: Isn't this related? https://github.com/nim-lang/Nim/issues/20083
23:50:04FromDiscord<Bizarro> yes, you're right
23:50:06FromDiscord<Elegantbeef> This means that for some reason the character is getting replaced with what's supposed to be the +- sign
23:51:12FromDiscord<Bizarro> In reply to @konradmb "<@448155547942912021>\: Isn't this related?": That seems related, indeed!
23:51:26FromDiscord<konradmb> @Bizarro\: Do you get the same behaviour as in screenshots with devel? Should be fixed there.
23:52:18FromDiscord<konradmb> Looks like Ruby had the same issue... 11 years earlier 😅
23:52:21FromDiscord<konradmb> https://bugs.ruby-lang.org/issues/5570
23:52:24FromDiscord<Bizarro> In reply to @konradmb "<@448155547942912021>\: Do you get": Oh, I haven't tested devel
23:52:56FromDiscord<Bizarro> please, let me check
23:53:36FromDiscord<michaelb.eth> `�` is the replacement character↵# https://codepoints.net/U+FFFD
23:53:44FromDiscord<michaelb.eth> (edit) "character↵# https://codepoints.net/U+FFFD" => "characterhttps://codepoints.net/U+FFFD"
23:53:50FromDiscord<michaelb.eth> (edit) "characterhttps://codepoints.net/U+FFFD" => "characterhttps://codepoints.net/U+FFFD"
23:53:53FromDiscord<Bizarro> Hey! With devel, nim --eval:"echo ord(getEnv(""DUMMY"")[^2])" returns 177, not 241 !!!
23:54:22FromDiscord<Bizarro> and nim --eval:"echo getEnv(""DUMMY"")" returns "C:\Users\Niño"
23:54:27FromDiscord<Bizarro> It's fixed!!!
23:54:33FromDiscord<Bizarro> Thank you very much!
23:55:17FromDiscord<Bizarro> We will just have to wait until the devel changes are incorporated into the stable version
23:55:23*Notxor quit (Remote host closed the connection)
23:55:32FromDiscord<Bizarro> It's great to know that it is fixed in development.
23:55:34FromDiscord<Elegantbeef> Well that will not happen 2.0 release will happen eventually
23:56:05FromDiscord<konradmb> I often run devel and it's stable enough for daily use
23:56:12FromDiscord<Elegantbeef> I pretty much only use devel
23:56:23FromDiscord<Elegantbeef> Unless someone complains my code doesnt work on X version 😄
23:57:42FromDiscord<Bizarro> Anyway, Windows console has always been a mess with Unicode support
23:57:53FromDiscord<Elegantbeef> Windows has always
23:57:56FromDiscord<Elegantbeef> Fixed that for you
23:57:57FromDiscord<michaelb.eth> @Bizarro what terminal are you using, or is it `cmd.exe`?
23:58:09FromDiscord<Elegantbeef> They used powershell's terminal and cmd
23:58:12FromDiscord<Bizarro> there are system functions which still use char, which can be anything
23:58:40FromDiscord<Bizarro> and, apparently, Microsoft encourages to use functions which use wide types such as wchar_t
23:58:53FromDiscord<Elegantbeef> Yea MS loves their utf16
23:59:27FromDiscord<michaelb.eth> probably better to use Windows Terminal if there's input/output that doesn't fit nicely to old expectations re: ASCII or (very, very broken) wchar_t
23:59:56FromDiscord<michaelb.eth> also, there's an OS-level setting for Windows re: the code page, just a sec