00:00:10 | FromDiscord | <Elegantbeef> I will say i'm fairly certain araq wishes enumerate was the way it was done in the start |
00:00:11 | FromDiscord | <Elegantbeef> Though i might be misremembering |
00:00:59 | PMunch | But the change from split returning a seq to being an iterator did change semantics.. |
00:01:12 | PMunch | I don't know if that was a recent thing though :P |
00:01:15 | FromDiscord | <Elegantbeef> What? |
00:01:25 | FromDiscord | <Elegantbeef> Iterators have always been prefered |
00:01:34 | FromDiscord | <Elegantbeef> There is just an iterator and a func variation |
00:01:43 | FromDiscord | <Elegantbeef> Which has always been allowed for reasons i demonstrated |
00:01:55 | FromDiscord | <Elegantbeef> The iterator version is less allocatey version of the procedure |
00:04:22 | FromDiscord | <Elegantbeef> I suppose if you really didnt want the import you could also do `for i, x in (let coll = input.split(); coll)` 😛 |
00:04:38 | FromDiscord | <Elegantbeef> inb4 it tries to call the iterator due to a compiler bug |
00:08:54 | FromDiscord | <Elegantbeef> A fun thing you might not know pmunch is that `typeof()` by default is in iterator mode |
00:09:13 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html#typeof%2Cuntyped it takes an optional `mode` |
00:10:18 | PMunch | Huh, interesting |
00:11:04 | PMunch | What I meant was that if you have a pair func, then adding an iterator would break your semantics |
00:11:17 | PMunch | And currently there's no way to get it back.. |
00:11:18 | FromDiscord | <Elegantbeef> No it doesnt |
00:11:39 | FromDiscord | <Elegantbeef> The correct pair is called in the correct scope |
00:11:53 | FromDiscord | <Elegantbeef> inside a for loop you call the iterator cause that's literally the point |
00:12:11 | FromDiscord | <Elegantbeef> Outside of one you call the procedure cause it's correct |
00:12:19 | PMunch | Well yes, but lets say strutils didn't have the iterator version, and I write code like `for i, x in myString.split:` |
00:12:22 | PMunch | This works fine |
00:12:36 | FromDiscord | <Elegantbeef> Of course |
00:12:40 | PMunch | Then someone comes along and adds the iterator, now my code doesn't work any longer |
00:12:57 | FromDiscord | <Elegantbeef> Correct adding a symbol is a possible breaking change |
00:13:18 | PMunch | But I still have my `pairs` iterator, which I would expect to be called |
00:13:19 | FromDiscord | <Elegantbeef> This extends beyond just iterators |
00:13:48 | FromDiscord | <Elegantbeef> If you add a procedure to the stdlib inside a module it can break user code cause they may have a procedure with the exact signature in another module |
00:13:54 | FromDiscord | <Elegantbeef> This is not different to that in anyway |
00:15:09 | FromDiscord | <Elegantbeef> You can disambiguate yet another way btw 😄 |
00:16:56 | FromDiscord | <Elegantbeef> `for i, x in (proc(s: string, spes: char, maxSplit:int = -1): seq[string])(split)(a, 'l'):` is yet another disambiguation |
00:17:44 | FromDiscord | <Elegantbeef> It's very much no different to adding a symbol in a module, in that it can break user code due to ambiguity. Atleast as far as i see it |
00:18:06 | PMunch | Hmm, quick threading question. What would be the easiest way to tell a thread that it should stop? |
00:18:10 | FromDiscord | <Elegantbeef> If i add a `proc doThing(i: int)` to the stdlib, it can cause ambiguity if someone else has written `doThing(i: int)` in their own code and import it |
00:19:02 | FromDiscord | <Elegantbeef> A a channel or a lock probably |
00:19:26 | PMunch | True, but at that point you get a nice error message saying that doThing is ambiguous |
00:19:39 | PMunch | This would just cause a wrong number of arguments error, which is super confusing |
00:20:02 | FromDiscord | <Elegantbeef> Ah shit this doesnt even mention the iterator type |
00:20:06 | FromDiscord | <Elegantbeef> So yes this is awful |
00:20:07 | FromDiscord | <Andreas> In reply to @Elegantbeef "Andreas no clue how": {.gensym.} it is - big thx |
00:20:27 | FromDiscord | <Elegantbeef> It should be "wrong number of variables for iterator 'iterator type here'" |
00:23:26 | PMunch | Hmm, is there a way I could get the cursor in the terminal to not blink? |
00:23:53 | FromDiscord | <Elegantbeef> `hideCursor`? |
00:24:07 | FromDiscord | <Elegantbeef> Think there is a way to disable blinking with a control code otherwise |
00:25:33 | PMunch | Perfect |
00:27:49 | FromDiscord | <Elegantbeef> `Error: wrong number of for variables for iterator of type 'iterator (s: string, sep: char, maxsplit: int): string{.inline, noSideEffect, gcsafe.}'` |
00:27:55 | FromDiscord | <Elegantbeef> Is that what you want you sick prick! 😛 |
00:28:57 | PMunch | Not really, what I want is for it to just work :P |
00:29:31 | PMunch | Hmm, now to the hardest part of any project. What should I call this thing? |
00:29:57 | FromDiscord | <Elegantbeef> Well just working is wrong |
00:30:12 | PMunch | No it's not |
00:30:41 | PMunch | As I said, I think it's better to not have the compiler error out when it could've just inserted an enumerate there |
00:30:49 | FromDiscord | <Elegantbeef> Hey the manual says it https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-implicit-itemsslashpairs-invocations |
00:31:13 | PMunch | I mean that was the whole idea of having `pairs` implicitly called wasn't it? To avoid having to use something like `enumerate` explicitly |
00:31:57 | FromDiscord | <Elegantbeef> given items and pairs do not work inside generics, i do not know what to say |
00:32:11 | PMunch | What? |
00:32:27 | FromDiscord | <Elegantbeef> If you do not use explicit `items`/`pairs` it does not mixin the symbol properly |
00:32:33 | FromDiscord | <Elegantbeef> Even if you explicitly `mixin pairs, items` it does not |
00:33:14 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/issues/19454 |
00:33:16 | PMunch | Well that just sounds like a bug.. |
00:33:24 | FromDiscord | <Elegantbeef> It is a bug of course |
00:33:40 | FromDiscord | <Elegantbeef> If you want enumerate to be defaulted i guess write an RFC |
00:33:59 | FromDiscord | <Elegantbeef> Since it's a change to the language that can have semantic changes 😛 |
00:37:46 | FromDiscord | <Yepoleb> i thought implementing tar would be easy, it's just the files interleaved with headers, but i was wrong. fucking cursed format with 6 (six) different versions, lots of octal strings and a ton of dumb limitations. |
00:38:02 | FromDiscord | <Elegantbeef> What's wrong with zippy? |
00:39:08 | FromDiscord | <Yepoleb> i did not know zippy does tar |
00:39:14 | FromDiscord | <Yepoleb> because it's called zippy |
00:39:26 | FromDiscord | <Elegantbeef> Well it supports tarballs so be merry |
00:39:57 | PMunch | tarry |
00:40:18 | PMunch | Hmm, maybe I should call my little plotter thing Harry |
00:40:21 | PMunch | Harry Plotter |
00:40:41 | FromDiscord | <Dudugz> I'm using zippy for zlib but it also works with zip and tar files |
00:40:42 | FromDiscord | <Elegantbeef> It's a plotter why not Booth? |
00:40:52 | PMunch | Booth? |
00:40:57 | FromDiscord | <Elegantbeef> Or any other person that plotted something |
00:41:09 | FromDiscord | <Elegantbeef> You know the wilkes variety of booth |
00:41:14 | FromDiscord | <Elegantbeef> The one that opened lincoln's mind |
00:41:24 | PMunch | Ooh, that kind of plot :P |
00:41:48 | FromDiscord | <Yepoleb> zippy's stream implementation\: `var data = stream.readAll() # TODO: actually treat as a stream` |
00:41:52 | FromDiscord | <Dudugz> I implemented my own ipc solution in nim 🙌 interprocess communication here i go |
00:41:53 | FromDiscord | <Elegantbeef> Could also call it bruno after the astronomer |
00:43:28 | PMunch | I just went with "plotter" |
00:43:28 | PMunch | https://github.com/PMunch/plotter |
00:43:30 | FromDiscord | <Elegantbeef> Releasing a book about the heliocentric model even though the church says no is a sort of plot |
00:43:31 | PMunch | It's getting late :P |
00:43:37 | FromDiscord | <Elegantbeef> Wow lame |
00:43:42 | PMunch | Haha |
00:44:21 | FromDiscord | <Elegantbeef> I'm debating saving my gittagger program, seems somewhat useful, but idk 😄 |
00:44:42 | PMunch | That the one which goes through nimble files and creates tags? |
00:44:47 | PMunch | Sounds useful indeed |
00:44:48 | FromDiscord | <Elegantbeef> Yes |
00:45:08 | FromDiscord | <Elegantbeef> Well that's all i need to hear to make my 10000th repo of a small one off thing |
00:45:13 | FromDiscord | <Yepoleb> [Elegantbeef](https://matrix.to/#/%40elegantbeef%3Amatrix.org)\: check out the loadColours implementation in xresources.nim |
00:45:43 | PMunch | What's wrong with that? |
00:45:48 | FromDiscord | <Yepoleb> you're gonna love this |
00:46:05 | FromDiscord | <Elegantbeef> I assume it's the use of the word colours |
00:46:07 | PMunch | And I like small repos for simple stuff |
00:46:10 | PMunch | Haha :P |
00:46:32 | FromDiscord | <Yepoleb> you did not use a macro to create the case statement |
00:46:32 | FromDiscord | <Elegantbeef> The Canadian in me sees that and just cheers "We're winning against the barbarians" |
00:46:49 | FromDiscord | <Elegantbeef> Lol |
00:47:47 | FromDiscord | <Elegantbeef> So grafiti is a fantastic name for a git tagger right? 😄 |
00:48:20 | FromDiscord | <Elegantbeef> gitfiti is too on the nose |
00:49:05 | FromDiscord | <treeform> Its ends with a y/ei sound I approve |
00:49:25 | FromDiscord | <Yepoleb> I don't get it 😢 |
00:50:06 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4qAs |
00:50:37 | FromDiscord | <Yepoleb> Good morning ringabout |
00:51:07 | FromDiscord | <ringabout> Hello, Yepoleb |
00:54:38 | FromDiscord | <Elegantbeef> Grafiti is also called tagging |
00:55:01 | FromDiscord | <Elegantbeef> Yea ringabout that bit me in the ass with constructor 😄 |
00:55:30 | FromDiscord | <Elegantbeef> Well `compileTime` did |
00:55:40 | FromDiscord | <Elegantbeef> I didnt try both gobal and compiletime i think |
00:55:47 | FromDiscord | <Elegantbeef> Might be related now i do not recall |
00:56:51 | FromDiscord | <ringabout> Yeah, https://github.com/nim-lang/Nim/pull/21351/files#diff-0503eb32aacc948b77b32dadc386f33fa1c89ecb89d4490cc71f7e0f9db3deca causes the regression, I'm fixing it. |
00:57:53 | FromDiscord | <Andreas> Is there some `{magic..}` that allows to make a closure over a `proc someProc() {.cdecl.}` ? |
00:58:08 | FromDiscord | <Andreas> (edit) "`{magic..}`" => "`{.magic.}`" |
00:59:19 | FromDiscord | <Yepoleb> Thank you 😌 |
01:01:52 | PMunch | Welp, I should head off to bed. |
01:02:16 | PMunch | Have gotten about 0% done on the project I intended to work on today. But at least I now have a small plotter thingy :P |
01:03:12 | PMunch | Well, that's not entirely true. I did get a small revelation for my project. Just haven't tried implementing it yet |
01:05:18 | * | rez quit (Ping timeout: 255 seconds) |
01:15:33 | FromDiscord | <Elegantbeef> Just call the proc inside a proc↵(@Andreas) |
01:15:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qAx |
01:15:58 | FromDiscord | <Elegantbeef> Nim only creates closures from nimcall |
01:16:08 | FromDiscord | <Elegantbeef> I do have a PR that would enable it for all procs but I got no help and cannot reason the issue |
01:19:06 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4qAz |
01:20:54 | FromDiscord | <Elegantbeef> No you cannot have a closure that is a cdecl |
01:21:03 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1084284891031666789/image.png |
01:21:07 | FromDiscord | <Elegantbeef> Damn graffitiception |
01:22:02 | FromDiscord | <Andreas> In reply to @Elegantbeef "image.png": zep / got it - macro does the trick |
01:22:07 | FromDiscord | <Elegantbeef> Uhh |
01:22:08 | PMunch | Haha, nice |
01:22:17 | FromDiscord | <Elegantbeef> A closure cannot be converted to a cdecl procedure safely |
01:22:31 | FromDiscord | <Elegantbeef> A closure has a pointer to the environment so unless you use `rawProc` and `rawEnv` you cannot pass it to a cdecl |
01:23:41 | FromDiscord | <Andreas> In reply to @Elegantbeef "A closure has a": i nnede to close over a var - the macro writes the var into `someProc(){.cdecl.}` - it works |
01:23:48 | FromDiscord | <Elegantbeef> I guess i should make the automated message better for graffiti and use the commit message, could also gather all the commit messages between two commits, but given that's just the wrong way to semver a project meh |
01:23:57 | FromDiscord | <Andreas> (edit) "nnede" => "neede" |
01:24:01 | FromDiscord | <Elegantbeef> What you're doing sounds wrong |
01:24:04 | FromDiscord | <Elegantbeef> So i'll just warn you |
01:24:15 | FromDiscord | <Elegantbeef> It might work but it's not proper |
01:25:23 | * | PMunch quit (Quit: leaving) |
01:27:11 | FromDiscord | <exelotl> yeah that doesn't sound like it should work 😅 |
01:28:19 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4qAB |
01:28:46 | FromDiscord | <Elegantbeef> Where's the closure? |
01:29:32 | FromDiscord | <Andreas> In reply to @Elegantbeef "Where's the closure?": i need `cls`=classname inside the finalizer. A closure did not work, so i made a macro.. |
01:29:42 | FromDiscord | <Elegantbeef> Well yea this is wrong then |
01:29:57 | FromDiscord | <Elegantbeef> if `cls` is not a constant this is going to do bad things when you exit scope |
01:29:58 | FromDiscord | <Andreas> In reply to @Elegantbeef "Well yea this is": godd, why;s that ? |
01:30:17 | FromDiscord | <Andreas> (edit) "godd, why;s" => "good, why's" | "good, why'sthat ? ... " added "whats wrong" |
01:30:41 | FromDiscord | <Elegantbeef> Doing an illegal capture, will only result in a dangling pointer or a memory leak |
01:31:05 | FromDiscord | <Elegantbeef> So either `cls` will not be what you expect in future stack frames, or it will never free due to being permanently captured |
01:31:21 | FromDiscord | <Andreas> In reply to @Elegantbeef "Doing an illegal capture,": wait a sec "illegal capture"- its not in the docs ? |
01:31:35 | FromDiscord | <Elegantbeef> Well cause the compiler doesnt allow it typically |
01:31:46 | FromDiscord | <Elegantbeef> Using a macro you've bypassed it's check somehow |
01:32:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qAD |
01:32:34 | FromDiscord | <Andreas> ok, thanks ic the problem.. `classId:int` is small ? |
01:32:37 | FromDiscord | <Elegantbeef> Which means it either is pointing to the original or is brought to the heap and never freed |
01:33:00 | FromDiscord | <Elegantbeef> Do you know what a closure is? |
01:33:39 | FromDiscord | <Andreas> In reply to @Elegantbeef "Do you know what": yes, it's what i tried first and the compiler said "NO" |
01:34:04 | FromDiscord | <Elegantbeef> Not do you know how to write them, do you know what they actually are |
01:34:54 | FromDiscord | <Andreas> in that case, i can create a fn-scope which carries the `cls`-param that the C-API has forgotten.. |
01:35:50 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4qAG |
01:35:56 | FromDiscord | <Elegantbeef> Yes with a global variable it'd work |
01:36:00 | FromDiscord | <Elegantbeef> Since that's not a capture |
01:36:35 | FromDiscord | <Andreas> In reply to @Elegantbeef "Since that's not a": would you prefer that ? c'mon it just a `int` 🙂 |
01:36:52 | FromDiscord | <Elegantbeef> It's not whether i'd prefer it |
01:36:56 | FromDiscord | <Elegantbeef> It's whether you want to fight bugs |
01:39:25 | FromDiscord | <Andreas> In reply to @Elegantbeef "It's whether you want": ic, well this macro won't be called often, just once for per modul. I'll do some more testing later. Maybe i find another way to solve it.. |
01:39:39 | FromDiscord | <Elegantbeef> Well if you have any odd behaviour look at the macro |
01:39:53 | FromDiscord | <Elegantbeef> Cause closures are not just different named procedures, they actually operate differently |
01:40:28 | FromDiscord | <Elegantbeef> They raise variables they use up to the heap to keep them alive so future calling will not error |
01:41:11 | FromDiscord | <Andreas> In reply to @Elegantbeef "Well if you have": The VM i'm working with is quite picky about leaks. It's a amazing experience when all those nim-safeties are gone.. quickjs screams when smth. i not freed properly |
01:42:04 | FromDiscord | <Andreas> (edit) "i" => "was" |
01:43:29 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4qAH |
01:43:35 | FromDiscord | <Elegantbeef> This demonstrates the behaviour you may run into |
01:44:01 | FromDiscord | <Andreas> hmm, i could try the JS-way and ask for `constructor.name` - that would do, too |
01:53:45 | FromDiscord | <Andreas> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4qAH": that is sweet example - i changed the `ptr` in BadClosure to a `int` which works but then the captured `int`would never be freed ? so valgrind should notice that, maybe ? |
01:54:31 | FromDiscord | <Elegantbeef> If you change that to `let i = i` Nim raises the `i` to the heap and frees it automatically when it needs to |
01:55:22 | FromDiscord | <Andreas> In reply to @Elegantbeef "If you change that": yep, that sounds good to me .. |
01:55:34 | FromDiscord | <Elegantbeef> But that only works if it's a `{.closure.}` |
01:55:40 | FromDiscord | <Elegantbeef> If it's a `{.cdecl.}` it does not work that way |
01:55:55 | FromDiscord | <Elegantbeef> if you change it to a cdecl it errors |
01:57:30 | FromDiscord | <Andreas> ik, i'll try the `constructor.name` thing, since i provide the class and the finalizer, i can be sure that `constructor.name` will always be avail.. which is not safe for other JS-types.. |
01:59:54 | FromDiscord | <Andreas> But the `cls`-value in the macro, that is 'burned-into' the code, statically - there is no problem about freeing things ? |
02:00:36 | FromDiscord | <Andreas> (edit) "But the `cls`-value in the macro, that is 'burned-into' the code, statically - there is no problem about freeing things ? ... " added "Besides that the code-size grows a bit with every invokation..." |
02:01:23 | FromDiscord | <Elegantbeef> No clue what cls is |
02:01:25 | FromDiscord | <Elegantbeef> Is it a constant? |
02:01:29 | FromDiscord | <Elegantbeef> Is it a runtime value? |
02:07:37 | FromDiscord | <Andreas> In reply to @Elegantbeef "Is it a runtime": it's the name of a `class:string` that is written in nim and gets passed to the JS-VM. The VM allocates for the nim-type and triggers the finalizer-cb when it wants to destroy a instance of the nim-type. I wrapped nim's InstSet for testing. So it happens in a critical spot... |
02:08:01 | FromDiscord | <Elegantbeef> If it's a runtime value it's also a possible issue |
02:10:39 | FromDiscord | <Andreas> In reply to @Elegantbeef "If it's a runtime": i'll take care and i'll mind your words when i see garbled data from such opaque-types.. greets and thx |
03:11:22 | * | derpydoo joined #nim |
03:24:19 | * | Xenon joined #nim |
03:24:51 | * | Xenon quit (Client Quit) |
04:01:57 | * | adigitoleo quit (*.net *.split) |
04:02:08 | * | adigitoleo joined #nim |
04:02:41 | * | joast quit (*.net *.split) |
04:02:42 | * | derpydoo quit (*.net *.split) |
04:02:42 | * | _________ quit (*.net *.split) |
04:02:42 | * | arkurious quit (*.net *.split) |
04:02:42 | * | ehmry quit (*.net *.split) |
04:02:42 | * | nyeaa492842301 quit (*.net *.split) |
04:02:42 | * | Jjp137 quit (*.net *.split) |
04:02:43 | * | FromDiscord quit (*.net *.split) |
04:02:43 | * | Goodbye_Vincent quit (*.net *.split) |
04:02:43 | * | lumidify quit (*.net *.split) |
04:02:44 | * | cm quit (*.net *.split) |
04:02:44 | * | cornfeedhobo quit (*.net *.split) |
04:02:44 | * | madprops quit (*.net *.split) |
04:02:44 | * | Ekho quit (*.net *.split) |
04:02:45 | * | krydos quit (*.net *.split) |
04:02:45 | * | Mi quit (*.net *.split) |
04:02:45 | * | dza quit (*.net *.split) |
04:02:46 | * | acidsys quit (*.net *.split) |
04:02:46 | * | om3ga quit (*.net *.split) |
04:02:46 | * | fallback quit (*.net *.split) |
04:02:47 | * | noeontheend quit (*.net *.split) |
04:02:47 | * | henrytill quit (*.net *.split) |
04:02:47 | * | mronetwo quit (*.net *.split) |
04:02:47 | * | leastrio quit (*.net *.split) |
04:02:47 | * | syl quit (*.net *.split) |
04:02:47 | * | GreaseMonkey quit (*.net *.split) |
04:02:48 | * | deadmarshal_ quit (*.net *.split) |
04:02:48 | * | Evolver quit (*.net *.split) |
04:02:48 | * | blackbeard420 quit (*.net *.split) |
04:03:15 | * | derpydoo joined #nim |
04:03:15 | * | joast joined #nim |
04:03:15 | * | fallback joined #nim |
04:03:15 | * | _________ joined #nim |
04:03:15 | * | henrytill joined #nim |
04:03:15 | * | noeontheend joined #nim |
04:03:15 | * | leastrio joined #nim |
04:03:15 | * | mronetwo joined #nim |
04:03:15 | * | arkurious joined #nim |
04:03:15 | * | Mi joined #nim |
04:03:15 | * | ehmry joined #nim |
04:03:15 | * | nyeaa492842301 joined #nim |
04:03:15 | * | Jjp137 joined #nim |
04:03:15 | * | FromDiscord joined #nim |
04:03:15 | * | Goodbye_Vincent joined #nim |
04:03:15 | * | lumidify joined #nim |
04:03:15 | * | cm joined #nim |
04:03:15 | * | krydos joined #nim |
04:03:15 | * | madprops joined #nim |
04:03:15 | * | Ekho joined #nim |
04:03:15 | * | cornfeedhobo joined #nim |
04:03:15 | * | syl joined #nim |
04:03:15 | * | dza joined #nim |
04:03:15 | * | acidsys joined #nim |
04:03:15 | * | GreaseMonkey joined #nim |
04:03:15 | * | deadmarshal_ joined #nim |
04:03:15 | * | Evolver joined #nim |
04:03:15 | * | om3ga joined #nim |
04:03:15 | * | blackbeard420 joined #nim |
04:03:39 | * | jmcantrell quit (*.net *.split) |
04:03:47 | FromDiscord | <Iliketwertles> what does isNil do? i dont know that Nil means |
04:03:56 | FromDiscord | <Takemichi Hanagaki> What is the main difference between ARC and Borrow checker? |
04:04:14 | FromDiscord | <Takemichi Hanagaki> (edit) |
04:06:04 | FromDiscord | <Elegantbeef> It's like asking the difference between a fridge and a blender |
04:06:12 | FromDiscord | <Elegantbeef> They're both related to cooking, but they're two vastly different things |
04:06:42 | * | Phil[m]123 quit (Ping timeout: 252 seconds) |
04:06:44 | * | frenchboy[m] quit (Ping timeout: 246 seconds) |
04:09:06 | FromDiscord | <Elegantbeef> A borrow checker ensures you do not have unsafe memory, arc places destructor calls inside the code |
04:09:08 | * | azimut quit (*.net *.split) |
04:09:13 | * | azimut joined #nim |
04:09:15 | * | euantorano_ quit (*.net *.split) |
04:09:15 | * | LyndsySimon quit (*.net *.split) |
04:09:17 | * | def- quit (*.net *.split) |
04:09:17 | * | Zevv_ quit (*.net *.split) |
04:09:17 | * | lain quit (*.net *.split) |
04:09:18 | * | nisstyre quit (*.net *.split) |
04:09:18 | * | arkanoid quit (*.net *.split) |
04:09:18 | * | gshumway quit (*.net *.split) |
04:09:32 | * | euantorano_ joined #nim |
04:09:32 | * | LyndsySimon joined #nim |
04:09:35 | * | def- joined #nim |
04:09:35 | * | Zevv_ joined #nim |
04:09:35 | * | lain joined #nim |
04:09:35 | * | nisstyre joined #nim |
04:09:35 | * | arkanoid joined #nim |
04:09:35 | * | gshumway joined #nim |
04:09:41 | * | arkanoid quit (Max SendQ exceeded) |
04:10:12 | FromDiscord | <Iliketwertles> does anyone know if theres a sixel(image in terminal) thing for nim |
04:10:21 | FromDiscord | <Iliketwertles> didnt find anything on a light google search |
04:10:28 | * | arkanoid joined #nim |
04:10:41 | * | xet7 quit (*.net *.split) |
04:10:41 | * | oddish quit (*.net *.split) |
04:10:49 | * | arkanoid quit (*.net *.split) |
04:10:49 | * | termer quit (*.net *.split) |
04:10:49 | * | m5zs7k quit (*.net *.split) |
04:10:49 | * | dv^_^ quit (*.net *.split) |
04:10:50 | * | notchris quit (*.net *.split) |
04:10:53 | * | Batzy quit (*.net *.split) |
04:10:53 | * | cnx quit (*.net *.split) |
04:10:53 | * | oz quit (*.net *.split) |
04:10:54 | * | xet7 joined #nim |
04:10:54 | * | oddish joined #nim |
04:10:54 | * | xaltsc quit (*.net *.split) |
04:10:55 | * | koltrast quit (*.net *.split) |
04:10:55 | * | alice quit (*.net *.split) |
04:10:55 | * | crem quit (*.net *.split) |
04:10:55 | * | tk quit (*.net *.split) |
04:10:55 | * | robertmeta quit (*.net *.split) |
04:10:55 | * | ormiret quit (*.net *.split) |
04:10:56 | * | estiquelapice quit (*.net *.split) |
04:10:57 | * | Onionhammer quit (*.net *.split) |
04:10:57 | * | hernan quit (*.net *.split) |
04:10:57 | * | adium quit (*.net *.split) |
04:10:57 | * | hexeme_ quit (*.net *.split) |
04:10:58 | * | oprypin quit (*.net *.split) |
04:10:59 | * | Mister_Magister quit (*.net *.split) |
04:10:59 | * | redj quit (*.net *.split) |
04:11:01 | * | arkanoid joined #nim |
04:11:01 | * | termer joined #nim |
04:11:01 | * | m5zs7k joined #nim |
04:11:01 | * | dv^_^ joined #nim |
04:11:01 | * | notchris joined #nim |
04:11:03 | * | Batzy joined #nim |
04:11:03 | * | cnx joined #nim |
04:11:03 | * | oz joined #nim |
04:11:06 | * | cyraxjoe quit (*.net *.split) |
04:11:07 | * | Amun-Ra quit (*.net *.split) |
04:11:07 | * | mal``` quit (*.net *.split) |
04:11:07 | * | attah quit (*.net *.split) |
04:11:07 | * | ixmpp quit (*.net *.split) |
04:11:07 | * | via__ quit (*.net *.split) |
04:11:08 | * | ttkap quit (*.net *.split) |
04:11:08 | * | oisota quit (*.net *.split) |
04:11:09 | * | xaltsc joined #nim |
04:11:09 | * | koltrast joined #nim |
04:11:09 | * | alice joined #nim |
04:11:09 | * | crem joined #nim |
04:11:09 | * | tk joined #nim |
04:11:09 | * | robertmeta joined #nim |
04:11:09 | * | ormiret joined #nim |
04:11:11 | * | arkanoid quit (Max SendQ exceeded) |
04:11:11 | * | m5zs7k quit (Max SendQ exceeded) |
04:11:12 | * | oprypin joined #nim |
04:11:12 | * | Mister_Magister joined #nim |
04:11:12 | * | redj joined #nim |
04:11:14 | * | estiquelapice joined #nim |
04:11:14 | * | hernan joined #nim |
04:11:14 | * | Onionhammer joined #nim |
04:11:14 | * | adium joined #nim |
04:11:14 | * | hexeme_ joined #nim |
04:11:17 | * | Batzy quit (Max SendQ exceeded) |
04:11:19 | * | alice quit (Max SendQ exceeded) |
04:11:19 | * | tk quit (Max SendQ exceeded) |
04:11:21 | * | pbsds quit (*.net *.split) |
04:11:22 | * | onetwo3 quit (*.net *.split) |
04:11:22 | * | anddam quit (*.net *.split) |
04:11:22 | * | NimEventer quit (*.net *.split) |
04:11:22 | * | tanami quit (*.net *.split) |
04:11:22 | * | genpaku quit (*.net *.split) |
04:11:23 | * | mahlon quit (*.net *.split) |
04:11:23 | * | systemdsucks quit (*.net *.split) |
04:11:23 | * | estiquelapice quit (*.net *.split) |
04:11:23 | * | Onionhammer quit (*.net *.split) |
04:11:23 | * | hernan quit (*.net *.split) |
04:11:23 | * | adium quit (*.net *.split) |
04:11:23 | * | hexeme_ quit (*.net *.split) |
04:11:24 | * | oprypin quit (*.net *.split) |
04:11:24 | * | Mister_Magister quit (*.net *.split) |
04:11:24 | * | redj quit (*.net *.split) |
04:11:24 | * | xaltsc quit (*.net *.split) |
04:11:24 | * | koltrast quit (*.net *.split) |
04:11:24 | * | crem quit (*.net *.split) |
04:11:24 | * | robertmeta quit (*.net *.split) |
04:11:24 | * | ormiret quit (*.net *.split) |
04:11:25 | * | cnx quit (*.net *.split) |
04:11:25 | * | oz quit (*.net *.split) |
04:11:25 | * | termer quit (*.net *.split) |
04:11:25 | * | dv^_^ quit (*.net *.split) |
04:11:26 | * | notchris quit (*.net *.split) |
04:11:26 | * | xet7 quit (*.net *.split) |
04:11:26 | * | oddish quit (*.net *.split) |
04:11:26 | * | euantorano_ quit (*.net *.split) |
04:11:26 | * | LyndsySimon quit (*.net *.split) |
04:11:27 | * | def- quit (*.net *.split) |
04:11:27 | * | Zevv_ quit (*.net *.split) |
04:11:27 | * | lain quit (*.net *.split) |
04:11:27 | * | nisstyre quit (*.net *.split) |
04:11:27 | * | gshumway quit (*.net *.split) |
04:11:27 | * | azimut quit (*.net *.split) |
04:11:29 | * | joast quit (*.net *.split) |
04:11:29 | * | derpydoo quit (*.net *.split) |
04:11:29 | * | _________ quit (*.net *.split) |
04:11:29 | * | arkurious quit (*.net *.split) |
04:11:30 | * | ehmry quit (*.net *.split) |
04:11:30 | * | nyeaa492842301 quit (*.net *.split) |
04:11:30 | * | Jjp137 quit (*.net *.split) |
04:11:30 | * | FromDiscord quit (*.net *.split) |
04:11:30 | * | Goodbye_Vincent quit (*.net *.split) |
04:11:31 | * | lumidify quit (*.net *.split) |
04:11:31 | * | cm quit (*.net *.split) |
04:11:31 | * | cornfeedhobo quit (*.net *.split) |
04:11:31 | * | madprops quit (*.net *.split) |
04:11:31 | * | Ekho quit (*.net *.split) |
04:11:32 | * | krydos quit (*.net *.split) |
04:11:32 | * | Mi quit (*.net *.split) |
04:11:33 | * | dza quit (*.net *.split) |
04:11:33 | * | acidsys quit (*.net *.split) |
04:11:33 | * | om3ga quit (*.net *.split) |
04:11:34 | * | fallback quit (*.net *.split) |
04:11:34 | * | noeontheend quit (*.net *.split) |
04:11:34 | * | henrytill quit (*.net *.split) |
04:11:34 | * | mronetwo quit (*.net *.split) |
04:11:34 | * | leastrio quit (*.net *.split) |
04:11:34 | * | syl quit (*.net *.split) |
04:11:35 | * | GreaseMonkey quit (*.net *.split) |
04:11:35 | * | deadmarshal_ quit (*.net *.split) |
04:11:35 | * | Evolver quit (*.net *.split) |
04:11:35 | * | blackbeard420 quit (*.net *.split) |
04:11:36 | * | adigitoleo quit (*.net *.split) |
04:11:36 | * | ChanServ quit (*.net *.split) |
04:12:03 | * | m5zs7k_ joined #nim |
04:12:03 | * | tk joined #nim |
04:12:03 | * | hexeme_ joined #nim |
04:12:03 | * | adium joined #nim |
04:12:03 | * | Onionhammer joined #nim |
04:12:03 | * | hernan joined #nim |
04:12:03 | * | estiquelapice joined #nim |
04:12:03 | * | redj joined #nim |
04:12:03 | * | Mister_Magister joined #nim |
04:12:03 | * | oprypin joined #nim |
04:12:03 | * | ormiret joined #nim |
04:12:03 | * | robertmeta joined #nim |
04:12:03 | * | crem joined #nim |
04:12:03 | * | koltrast joined #nim |
04:12:03 | * | xaltsc joined #nim |
04:12:03 | * | oz joined #nim |
04:12:03 | * | cnx joined #nim |
04:12:03 | * | notchris joined #nim |
04:12:03 | * | dv^_^ joined #nim |
04:12:03 | * | termer joined #nim |
04:12:03 | * | oddish joined #nim |
04:12:03 | * | xet7 joined #nim |
04:12:03 | * | gshumway joined #nim |
04:12:03 | * | nisstyre joined #nim |
04:12:03 | * | lain joined #nim |
04:12:03 | * | Zevv_ joined #nim |
04:12:03 | * | def- joined #nim |
04:12:03 | * | LyndsySimon joined #nim |
04:12:03 | * | euantorano_ joined #nim |
04:12:03 | * | azimut joined #nim |
04:12:03 | * | blackbeard420 joined #nim |
04:12:03 | * | om3ga joined #nim |
04:12:03 | * | Evolver joined #nim |
04:12:03 | * | deadmarshal_ joined #nim |
04:12:03 | * | GreaseMonkey joined #nim |
04:12:03 | * | acidsys joined #nim |
04:12:03 | * | dza joined #nim |
04:12:03 | * | syl joined #nim |
04:12:03 | * | cornfeedhobo joined #nim |
04:12:03 | * | Ekho joined #nim |
04:12:03 | * | madprops joined #nim |
04:12:03 | * | krydos joined #nim |
04:12:03 | * | cm joined #nim |
04:12:03 | * | lumidify joined #nim |
04:12:03 | * | Goodbye_Vincent joined #nim |
04:12:03 | * | FromDiscord joined #nim |
04:12:03 | * | Jjp137 joined #nim |
04:12:03 | * | nyeaa492842301 joined #nim |
04:12:03 | * | ehmry joined #nim |
04:12:03 | * | Mi joined #nim |
04:12:03 | * | arkurious joined #nim |
04:12:03 | * | mronetwo joined #nim |
04:12:03 | * | leastrio joined #nim |
04:12:03 | * | noeontheend joined #nim |
04:12:03 | * | henrytill joined #nim |
04:12:03 | * | _________ joined #nim |
04:12:03 | * | fallback joined #nim |
04:12:03 | * | joast joined #nim |
04:12:03 | * | derpydoo joined #nim |
04:12:03 | * | adigitoleo joined #nim |
04:12:03 | * | pbsds joined #nim |
04:12:03 | * | onetwo3 joined #nim |
04:12:03 | * | anddam joined #nim |
04:12:03 | * | NimEventer joined #nim |
04:12:03 | * | tanami joined #nim |
04:12:03 | * | genpaku joined #nim |
04:12:03 | * | mahlon joined #nim |
04:12:03 | * | systemdsucks joined #nim |
04:12:24 | * | alicetries joined #nim |
04:12:24 | * | alicetries is now known as alice |
04:12:24 | * | azimut quit (Ping timeout: 255 seconds) |
04:12:26 | * | arkanoid joined #nim |
04:12:26 | * | Lord_Nightmare quit (Excess Flood) |
04:12:50 | * | Lord_Nightmare2 joined #nim |
04:12:59 | * | Batzy joined #nim |
04:13:58 | FromDiscord | <Iliketwertles> or is there something else that does something similar? |
04:15:19 | * | azimut joined #nim |
04:15:45 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
04:16:55 | * | Phil[m]123 joined #nim |
04:17:29 | * | cyraxjoe joined #nim |
04:17:29 | * | Amun-Ra joined #nim |
04:17:29 | * | mal``` joined #nim |
04:17:29 | * | ixmpp joined #nim |
04:17:29 | * | attah joined #nim |
04:17:29 | * | via__ joined #nim |
04:17:29 | * | ttkap joined #nim |
04:17:29 | * | oisota joined #nim |
04:20:14 | * | m5zs7k_ is now known as m5zs7k |
04:20:49 | * | pbsds quit (*.net *.split) |
04:20:49 | * | onetwo3 quit (*.net *.split) |
04:20:49 | * | anddam quit (*.net *.split) |
04:20:50 | * | NimEventer quit (*.net *.split) |
04:20:50 | * | tanami quit (*.net *.split) |
04:20:50 | * | genpaku quit (*.net *.split) |
04:20:50 | * | mahlon quit (*.net *.split) |
04:20:50 | * | systemdsucks quit (*.net *.split) |
04:22:51 | * | pbsds joined #nim |
04:22:51 | * | onetwo3 joined #nim |
04:22:51 | * | anddam joined #nim |
04:22:51 | * | NimEventer joined #nim |
04:22:51 | * | tanami joined #nim |
04:22:51 | * | genpaku joined #nim |
04:22:51 | * | mahlon joined #nim |
04:22:51 | * | systemdsucks joined #nim |
04:24:59 | FromDiscord | <Elegantbeef> If you use kitty there is tpix |
04:29:24 | FromDiscord | <Iliketwertles> im not sadly, might just have to use ascii lol |
04:29:37 | FromDiscord | <Iliketwertles> kitty is good tho but i like foot better |
04:34:06 | * | cyraxjoe quit (*.net *.split) |
04:34:06 | * | Amun-Ra quit (*.net *.split) |
04:34:06 | * | mal``` quit (*.net *.split) |
04:34:07 | * | attah quit (*.net *.split) |
04:34:07 | * | ixmpp quit (*.net *.split) |
04:34:07 | * | via__ quit (*.net *.split) |
04:34:07 | * | ttkap quit (*.net *.split) |
04:34:07 | * | oisota quit (*.net *.split) |
04:36:01 | * | cyraxjoe joined #nim |
04:36:01 | * | Amun-Ra joined #nim |
04:36:01 | * | mal``` joined #nim |
04:36:01 | * | ixmpp joined #nim |
04:36:01 | * | attah joined #nim |
04:36:01 | * | via__ joined #nim |
04:36:01 | * | ttkap joined #nim |
04:36:01 | * | oisota joined #nim |
05:07:34 | * | arkurious quit (Quit: Leaving) |
05:14:35 | * | azimut quit (Ping timeout: 255 seconds) |
05:43:12 | * | jmcantrell joined #nim |
05:46:13 | * | rmt joined #nim |
05:51:49 | * | derpydoo quit (Ping timeout: 276 seconds) |
06:12:49 | * | frenchboy[m] joined #nim |
06:39:40 | * | derpydoo joined #nim |
07:50:42 | * | Notxor joined #nim |
08:30:51 | FromDiscord | <planetis> sent a code paste, see https://paste.rs/eP6 |
08:32:24 | FromDiscord | <planetis> it's the only thing that can reliably work, besides mangling the names |
08:32:54 | FromDiscord | <planetis> wait a sec... |
08:33:42 | FromDiscord | <planetis> no I need to mangle the names |
08:33:44 | FromDiscord | <planetis> fuck |
08:34:47 | FromDiscord | <planetis> windows sucks |
08:40:08 | FromDiscord | <planetis> that would mean maintaining a fork of raylib with mangled names ffs |
08:43:06 | * | azimut joined #nim |
08:47:26 | * | azimut quit (Ping timeout: 255 seconds) |
09:16:07 | * | azimut joined #nim |
09:39:49 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @planetis "no I need to": what does name mangling means? |
09:41:41 | FromDiscord | <Elegantbeef> Mutate the name so it does not clash with others |
09:44:53 | FromDiscord | <planetis> I think emitting a typedef might work as well↵typedef struct Rectangle RaylibRectangle; |
09:54:12 | NimEventer | New question by Quonux: Nim: run external program from Nim, see https://stackoverflow.com/questions/75712315/nim-run-external-program-from-nim |
09:55:47 | FromDiscord | <Elegantbeef> Phil must've lost access to his SO account 😛 |
10:08:08 | FromDiscord | <Phil> I resent that statement, there's way more people than just me that write SO questions 😛 |
10:16:32 | * | derpydoo quit (Read error: Connection reset by peer) |
10:29:16 | FromDiscord | <planetis> In reply to @planetis "I think emitting a": nope it still conflicts regardless... |
10:34:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @planetis "nope it still conflicts": So you'll have to mangle |
10:53:51 | FromDiscord | <planetis> except if I do something really hacky, undef these macros in the "typesection" and include raylib right after |
10:55:09 | FromDiscord | <planetis> but it needs an emit for every nim file importing naylib that's inconvenient |
11:38:26 | FromDiscord | <Phil> Actually, are there other approaches than "Have one gigantic piece of global state all your GUI can access" ? |
11:38:34 | FromDiscord | <Phil> (edit) "?" => " for frontends?" |
11:39:00 | FromDiscord | <Phil> Mostly asking because that appears to have been the approach everywhere, be it webdev or native. |
12:04:53 | FromDiscord | <planetis> In reply to @Isofruit "Actually, are there other": you mean in general, I am sure there are, or on a specific nim library? |
12:05:14 | FromDiscord | <Phil> In general, just pondering general setups in terms of architecture that are possible |
12:05:38 | FromDiscord | <Phil> I know owlkettle e.g. goes for the "one global state" approach for sure, or rather with how it is set up it encourages that approach |
12:05:56 | FromDiscord | <planetis> recently there was an offtopic discussion about Model-View-Update https://thomasbandt.com/model-view-update |
12:26:10 | FromDiscord | <Hourglass [She/Her]> How do I force nimble to install a dependency even if nothing has changed? |
12:33:13 | FromDiscord | <Gumbercules> Model view anything is garbage |
12:33:36 | FromDiscord | <Gumbercules> Just separate code from data. Done |
12:33:46 | FromDiscord | <Gumbercules> Anything else is over engineering |
12:35:50 | * | PMunch joined #nim |
12:47:17 | * | azimut quit (Ping timeout: 255 seconds) |
12:48:14 | FromDiscord | <Takemichi Hanagaki> In reply to @Elegantbeef "A borrow checker ensures": Got it! |
12:49:12 | * | azimut joined #nim |
13:12:32 | * | madprops quit (Ping timeout: 248 seconds) |
13:13:02 | * | tinystoat joined #nim |
13:13:50 | * | tinytoast quit (Read error: Connection reset by peer) |
13:16:14 | * | madprops joined #nim |
13:16:14 | * | madprops quit (Changing host) |
13:16:14 | * | madprops joined #nim |
14:25:23 | * | azimut quit (Ping timeout: 255 seconds) |
14:32:32 | FromDiscord | <Ayy Lmao> How do I manually call nim's initialization code? I need to go through a custom entry point. |
14:34:29 | Amun-Ra | from C? NimMain() |
14:38:29 | FromDiscord | <Ayy Lmao> Ok so I would need to figure out how to call `NimMain()` from my function then. I'm building a dll that has a struct with a bunch of functions as an entry point. |
14:41:24 | Amun-Ra | something like this https://dpaste.org/xnynB |
14:41:57 | FromDiscord | <punch_cake> is there a better package manager for nim? |
14:42:20 | Amun-Ra | better than nimble? I'm not aware of any |
14:45:33 | FromDiscord | <hotdog> punch_cake two alternatives that I’ve heard of - https://forum.nim-lang.org/t/9748 https://github.com/disruptek/nimph . Haven’t used either, don’t know if they’re any better |
14:46:01 | FromDiscord | <punch_cake> alright, thanks! |
14:48:38 | PMunch | @punch_cake, what do you miss in Nimble? |
15:07:51 | FromDiscord | <punch_cake> that its dog shit↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
15:08:24 | FromDiscord | <punch_cake> it sometimes fails to install stuff for no reason but when i run it again it magically works |
15:14:12 | * | azimut joined #nim |
15:16:05 | * | arkurious joined #nim |
15:53:00 | * | derpydoo joined #nim |
15:56:22 | FromDiscord | <RMT> @Ayy Lmao , how is it going with your CLAP plugin? |
15:58:46 | FromDiscord | <RMT> In reply to @punch_cake "it sometimes fails to": That sounds like an annoying bug (that I haven't hit yet on Linux) .. it might possibly not even be in nimble. Have you filed an issue? |
16:00:59 | FromDiscord | <hotdog> In reply to @punch_cake "it sometimes fails to": I haven’t noticed that. A specific package or just anything? |
16:14:25 | FromDiscord | <Ayy Lmao> In reply to @Garf404 "<@277645179115143178> , how is": Well I figured out how to compile an example in C and get my DAW to detect it. Now I am trying to compile from Nim but it is complicated. Having a struct as an entry point seems to be a pretty rare case and the `exportc` pragma isn't working for me, so I am trying to do a bunch of emit pragma shenanigans. |
16:40:36 | FromDiscord | <RMT> sent a long message, see http://ix.io/4qE8 |
16:47:24 | FromDiscord | <Ayy Lmao> In reply to @Garf404 "Ok. I look": I'm kind of just dipping my toes at the moment so I can't promise anything will come of it. I'll post it somewhere and let you know if I get anything up and running. |
16:48:50 | FromDiscord | <Livid> sent a code paste, see https://play.nim-lang.org/#ix=4qEc |
16:53:51 | FromDiscord | <Rika> @firasuke most likely all DE/plugins use the standard nim formatter `nimpretty` |
16:53:52 | FromDiscord | <firasuke> The vscode nim plugin isn't formatting constants with the same style, some have a space between the name and and some don't. What development environment or text editor do you recommend with an official nim formatter/tooling? https://media.discordapp.net/attachments/371759389889003532/1084519640543273030/image.png |
16:54:06 | FromDiscord | <firasuke> In reply to @Rika "<@248208053952970752> most likely all": I see |
16:54:16 | FromDiscord | <firasuke> is this a default behavior in nim? |
16:54:32 | FromDiscord | <Rika> probably just not an implemented format rule in nimprett |
16:54:33 | FromDiscord | <Rika> (edit) "nimprett" => "nimpretty" |
16:55:18 | FromDiscord | <firasuke> hmmmm should I open a pr? or can I define a custom rule myself? |
16:56:31 | FromDiscord | <Rika> pr, prolly |
16:58:16 | FromDiscord | <firasuke> I see thanks |
16:58:21 | FromDiscord | <firasuke> (edit) "see" => "see," |
16:58:52 | FromDiscord | <Rika> i dont know where the code lives, prolly the same as the nim compiler |
17:11:38 | FromDiscord | <ieltan> sent a code paste, see https://paste.rs/TN9 |
17:12:04 | FromDiscord | <ieltan> the compilers says `selector must be of an ordinal type, float or string` |
17:15:19 | FromDiscord | <Rika> no, iterate over guildflags and have the case be over the iteration value |
17:15:50 | FromDiscord | <ieltan> Yeah i thought about this too but it would have been nice if there was a cleaner syntax |
17:15:51 | FromDiscord | <Rika> ofc you dont need the `noFlag` any more in that case |
17:16:02 | FromDiscord | <Rika> i do not see how the case would be cleaner syntax |
17:16:10 | FromDiscord | <Rika> it would be more obscure syntax i would say |
17:17:38 | FromDiscord | <ieltan> In reply to @Rika "ofc you dont need": `noFlag` is just to demonstrate `guildFlags` may not have all the flags but that was redundant ig |
17:17:45 | FromDiscord | <ieltan> thanks! |
17:18:02 | FromDiscord | <Rika> cases can have an `else:` |
17:43:21 | * | rmt quit (Ping timeout: 265 seconds) |
17:48:42 | FromDiscord | <Odi> Hello my gorgeous friends on the nimternet 🖖↵Can anyone point me in the direction on how i can convert an sequence of hex values into and image like for example this python ↵Say i have a whole sequence with all the hex values, is there a simple way to write this out as a jpeg or png file=)↵Thanks in advance, and pleas mind you i dont try to be lazy🥹Thanks in advance=) https://media.discordapp.net/attachments/371759389889003532/108 |
17:54:36 | FromDiscord | <Hourglass [She/Her]> How would I force nimble to install a project? Does it do that no matter what? Or |
18:00:14 | * | derpydoo quit (Ping timeout: 250 seconds) |
18:09:38 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qEF |
18:22:42 | Amun-Ra | what do you mean "force"? |
18:57:56 | FromDiscord | <firasuke> for writing tests in nim, what's the standard way? unit tests or testament? |
19:06:10 | PMunch | Either |
19:06:37 | PMunch | Well I guess unittests might be more used since it's the default for nimble |
19:06:47 | FromDiscord | <Phil> TBh I myself use unittests because it's easier.↵HOWEVER, if you want to do it right which you seem to want to do given that you're even willing to write tests, you're likely better off with testament.↵The main reason you'd want to play with it afaik is testing with multiple compilation-flags |
19:07:12 | FromDiscord | <Phil> (edit) "compilation-flags" => "compilation-flag-combinations" |
19:09:17 | FromDiscord | <Phil> Assuming you run github workflows to run your tests in the end, I also recommend setting up your workflow so you can run your test-suite for multiple different nim versions (assuming it is a library) |
19:16:22 | FromDiscord | <firasuke> oh ok |
19:16:26 | FromDiscord | <Hourglass [She/Her]> Tempted to work on Nimpiler again |
19:17:11 | FromDiscord | <Nilts> what is that? |
19:17:26 | * | azimut quit (Ping timeout: 255 seconds) |
19:17:46 | FromDiscord | <Hourglass [She/Her]> Was my (failed/neglected) attempt to compile Nim to JVM bytecode |
19:18:07 | FromDiscord | <Hourglass [She/Her]> (Well, to an assembler language but that is irrelevant lol) |
19:20:33 | PMunch | @firasuke, there's even balls |
19:20:38 | FromDiscord | <Nilts> I mean, the compiler is not meant to be extended on. So it would be difficult |
19:20:56 | FromDiscord | <firasuke> In reply to @PMunch "<@248208053952970752>, there's even balls": Dare I ask what is that xD? |
19:21:05 | FromDiscord | <Hourglass [She/Her]> In reply to @not logged in "I mean, the compiler": definitely but I had some (admittedly crap) code generation working |
19:21:23 | FromDiscord | <Phil> In reply to @firasuke "oh ok": Regarding github workflows I'm happy to help, assuming you want it.↵Way back when I had no clue about them and it was a major pain to put them together |
19:21:34 | FromDiscord | <firasuke> oh ok thanks a bunch |
19:21:42 | PMunch | https://github.com/disruptek/balls |
19:22:01 | FromDiscord | <firasuke> I'm porting my Rust application to Nim, so far so good, and I reached the point where I need to port the tests as well |
19:22:27 | PMunch | Oh cool, what kind of application? |
19:22:33 | PMunch | And what prompted the port? |
19:22:43 | FromDiscord | <firasuke> It's a package manager for a Linux distribution I am making |
19:22:51 | FromDiscord | <firasuke> In reply to @PMunch "And what prompted the": complexity is a cost |
19:23:41 | FromDiscord | <firasuke> so I have my own cross compilation toolchain that builds against musl libc, I use this toolchain to cross compile software for the linux distribution I am developing |
19:24:18 | FromDiscord | <firasuke> the rust package manager was like 3.2 MB in size, and couldn't be built by my toolchain (my toolchain uses gcc), and rust needs LLVM |
19:24:20 | FromDiscord | <Nilts> sent a long message, see http://ix.io/4qFa |
19:24:41 | PMunch | Hmm interesting |
19:24:47 | PMunch | So you're making your own distro? |
19:24:56 | FromDiscord | <firasuke> I rewrote some parts of it in Nim, size dropped down to under 100 kb, and I was able to tell nim to use the custom compiler from my toolchain and it worked |
19:25:01 | FromDiscord | <firasuke> In reply to @PMunch "So you're making your": yup |
19:25:11 | FromDiscord | <jmgomez> In reply to @ringabout "Yeah, create a routine": Sorry for the screenshot for those in IRC. What I missed, on the right my folder structure. It's a DynLib that has as entry point vm.nim. I just replaced the `` and did create the folder. Should I do something else? It doensnt output errors, it just dont work https://media.discordapp.net/attachments/371759389889003532/1084557718871883867/Screenshot_2023-03-12_at_19.22.29.png |
19:25:16 | FromDiscord | <firasuke> In reply to @PMunch "So you're making your": https://www.glaucuslinux.org/ |
19:25:27 | FromDiscord | <Rika> In reply to @not logged in "Opinion of someone online": I would say the criticism is true. The alternative is up to you though |
19:26:08 | PMunch | @Nilts, different pros and cons TBH |
19:26:23 | PMunch | Rust definitely has got a bigger user base, which could mean better support |
19:26:34 | PMunch | That said I've seldom come across a more helpful channel than this one here |
19:26:58 | * | estiquelapice quit (*.net *.split) |
19:26:58 | * | Onionhammer quit (*.net *.split) |
19:26:58 | * | hernan quit (*.net *.split) |
19:26:58 | * | adium quit (*.net *.split) |
19:26:58 | * | hexeme_ quit (*.net *.split) |
19:27:06 | FromDiscord | <firasuke> sent a long message, see http://ix.io/4qFb |
19:27:08 | * | Onionhammer joined #nim |
19:27:11 | PMunch | Hmm, what's toybox? |
19:27:26 | * | hernan joined #nim |
19:27:28 | FromDiscord | <firasuke> In reply to @PMunch "Hmm, what's toybox?": a clean rewrite of busybox used on Android |
19:27:40 | FromDiscord | <firasuke> it has the ability to build Linux from Scratch |
19:27:45 | PMunch | Huh |
19:27:51 | * | estiquelapice_ joined #nim |
19:27:58 | FromDiscord | <firasuke> so it's one of the better lightweight coreutils alternatives out there |
19:28:09 | PMunch | Oooh, now I remember |
19:28:19 | PMunch | BusyBox was the thing I had on my router |
19:28:28 | PMunch | Oh wow, you're going really lightweight then |
19:28:36 | * | adium joined #nim |
19:28:37 | FromDiscord | <firasuke> In reply to @PMunch "Oh wow, you're going": yup |
19:28:40 | * | hexeme joined #nim |
19:28:45 | PMunch | Any particular reason? |
19:29:00 | FromDiscord | <firasuke> it was more of an exercise in minimalism |
19:29:17 | PMunch | Fair enough |
19:29:18 | FromDiscord | <firasuke> apparently there was a community that is interested so I decided to continue the effort |
19:29:30 | FromDiscord | <Rika> In reply to @firasuke "so Nim just felt": Async isn’t exactly about speed but latency I’d say |
19:30:17 | FromDiscord | <firasuke> In reply to @Rika "Async isn’t exactly about": I agree, but it is surprising that the nim version turned out to be faster (15-20%) faster and had much less cpu usage (rust had like 150-200% more cpu usage) |
19:30:57 | FromDiscord | <firasuke> I was like, if it's easier to write in, and can be using my gcc toolchain without introducing LLVM, and is much smaller and a tad bit faster, then why not switch to Nim lol |
19:31:08 | FromDiscord | <firasuke> (edit) "I was like, if it's easier to write in, and can be ... using" added "built" |
19:31:54 | FromDiscord | <firasuke> I'm listing all 128 packages information and sorting them based on their dependencies in 0.03 seconds (using topological sorting) (this is not a cached run) https://media.discordapp.net/attachments/371759389889003532/1084559407150551080/image.png |
19:34:49 | FromDiscord | <firasuke> loop 1000 times and parse 128 packages, a.sh runs the Nim version of the package manager, and b.sh runs the Rust version (I tried my best to make them equal in terms of code and formatting, the output is identical for both as well) https://media.discordapp.net/attachments/371759389889003532/1084560146476306462/image.png https://media.discordapp.net/attachments/371759389889003532/1084560146686017686/image.png |
19:35:32 | FromDiscord | <firasuke> The nim port ran like 2 seconds faster, and was insanely smaller. |
19:35:32 | FromDiscord | <Phil> In reply to @not logged in "Opinion of someone online": I mean, I wouldn't say so, but I have to immediately qualify that I obviously like nim better so eh |
19:36:00 | FromDiscord | <firasuke> I'm probably doing something stupid in Rust, but given the time it took me to write the nim port, I am not complaining lol |
19:38:10 | FromDiscord | <Nilts> In reply to @Isofruit "I mean, I wouldn't": they apparently just changed their opinion, waiting on a why |
19:39:08 | FromDiscord | <Nilts> This is in a language suggestion thing:↵> Because I do not want to discourage him from learning anyhow.↵> I find it a fun language and since he comes from python, might be a simpler way to get ti statically typed programming than, for example rust. |
19:39:09 | FromDiscord | <firasuke> I think you have to try both, the amount of complexity that I was introducing in the Rust version of my package manger, whether intentional or not, was just a nightmare to look at or maintain |
19:39:14 | FromDiscord | <Phil> The reason I like nim better is pretty much what firasuke is describing, it is trivial to get productive in it |
19:39:42 | FromDiscord | <jmgomez> In reply to @Isofruit "I mean, I wouldn't": if it counts I started at Rust for NUE. The way I see it, you can do stuff with Nim that you just cant with Rust I cant think an example of the other way around |
19:39:51 | FromDiscord | <firasuke> In reply to @Isofruit "The reason I like": exactly, you won't find a better compiled systems programming language that is as productive and as expressive |
19:40:56 | FromDiscord | <firasuke> tbh I wasn't expecting to reap benefits in terms of size and performance when writing the Nim port, I just wanted something easier to write in to get things done quickly |
19:41:01 | FromDiscord | <firasuke> got them as an added benefit lol |
19:49:12 | FromDiscord | <weitzj> sent a long message, see http://ix.io/4qFe |
19:49:39 | FromDiscord | <weitzj> (edit) "http://ix.io/4qFe" => "http://ix.io/4qFf" |
19:50:25 | FromDiscord | <Phil> I summon the PMunch |
19:50:56 | FromDiscord | <Phil> I assume simply because he's involved in the topic that he knows his competition and has an overview over that field of nim |
19:55:52 | FromDiscord | <jmgomez> In reply to @jmgomez "Sorry for the screenshot": I see the example of the compiler using Nim.nimble but no matter where I add the routine/routine.nimble dir/file it doesnt pick it |
20:23:05 | PMunch | Huh? |
20:23:14 | PMunch | Err, I mean.. |
20:23:28 | PMunch | I've been summoned! What is your question, mortal? |
20:23:52 | FromDiscord | <Phil> Read weitzej's question oh Pmunch |
20:24:05 | FromDiscord | <auxym> nimterop is sort of dead, but futhark is actively developed by PMunch. My experience with c2nim was that it was mostly unusable on macro-heavy C-code: it required so much finagling to understand macros that manually writing bindings was easier / less work |
20:24:24 | FromDiscord | <Elegantbeef> I disagree auxym |
20:24:29 | FromDiscord | <Elegantbeef> `gcc -E` then run `c2nim` |
20:24:42 | FromDiscord | <auxym> indeed, I did not try that approach |
20:24:44 | PMunch | Why though? |
20:25:24 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasmer/blob/master/src/wasmer/wasmc.nim It's still not pretty |
20:25:24 | FromDiscord | <Elegantbeef> Why what? |
20:25:26 | PMunch | I mean the reason I wrote Futhark was because I couldn't get c2nim or nimterop to work |
20:25:38 | FromDiscord | <spoon> what does gcc -E do? i tried c2nim but it cut off a quarter of a way through this header |
20:25:45 | FromDiscord | <Elegantbeef> I still despise the lack of readable generated binding |
20:25:57 | FromDiscord | <auxym> I think it runs the preprocessor only and outputs processed C files? |
20:26:00 | FromDiscord | <Elegantbeef> `gcc -E` runs the preprocessor |
20:26:05 | FromDiscord | <Elegantbeef> So it expands all macros and emits the underlying code |
20:26:06 | PMunch | I had spent a week with either trying to get it to wrap a rather complex piece of code to no avail |
20:26:33 | PMunch | The I spent a week writing Futhark and it spit out a perfect wrapper pretty much on the first try |
20:26:40 | FromDiscord | <Elegantbeef> I've had good results with `gcc -E` and `c2nim` it's not as seemless as futhark, but i get a concrete Nim API i can use |
20:27:00 | FromDiscord | <weitzj> In reply to @PMunch "I had spent a": Thank you. As you mentioned in your readme I think |
20:27:13 | PMunch | Yeah I think I mentioned that |
20:27:27 | PMunch | What I didn't mention is that I've used it for multiple projects since |
20:27:53 | PMunch | The thought of wrapping C libraries in Nim always filled me with dread, with Futhark I don't even think about it |
20:28:15 | PMunch | I just tell Futhark what to import, same as I would in C, and then it just goes and does its thing |
20:28:59 | Amun-Ra | I love writing wrappers for nim |
20:29:08 | FromDiscord | <weitzj> Thank you everybody. This helped me to clarify the state of affairs. |
20:29:34 | FromDiscord | <djazz> I have used nimterop and c2nim, but with futhark I didnt have to modify the C headers |
20:30:11 | PMunch | Exactly, and that is sooo important when you're working against someone elses code |
20:30:22 | FromDiscord | <Elegantbeef> The massive downside of futhark is all the features that pmunch has leaks into the generated Nim files so they're pretty much not human readable |
20:30:30 | FromDiscord | <Elegantbeef> But that's also a benefit cause then you just use it like the CAPi |
20:30:41 | PMunch | @Elegantbeef, haven't you seen the new switches? |
20:30:47 | FromDiscord | <Elegantbeef> I'll die on this hill pmunch 😛 |
20:31:00 | FromDiscord | <Elegantbeef> No one told me |
20:31:05 | Amun-Ra | I always hide native types and only expose nim ones |
20:31:29 | FromDiscord | <spoon> tried c2nim, get `Error: unhandled exception: idents.nim(83, 13) (id == 0) or (id == result.id) [AssertionDefect]` |
20:31:34 | FromDiscord | <Elegantbeef> Is there a `-d:futharkForThatAnnoyingBeefFellow`? |
20:31:34 | FromDiscord | <djazz> You could use futhark to generate the raw wrapper, and then make a pretty nim api on top |
20:32:02 | PMunch | Before writing Futhark I ended up wrapping the aforementioned library by hand, but in a couple of versions they where totally incorrect (but still managed to work by pure coincidence). Comparing it to Futhark was a bit crazy because of how much stuff was now incorrect. |
20:32:22 | PMunch | @djazz, yeah this is the intended way to use it |
20:32:41 | PMunch | @Elegantbeef, something like that: https://github.com/PMunch/futhark#compatibility-features-and-readability |
20:32:45 | FromDiscord | <djazz> Or you can always do the rust approach. Rewrite all C in Nim |
20:32:45 | FromDiscord | <spoon> i saw the example of futhark being used to run from a header file directly, is there a method for producing a nim file i can refactor if needed? |
20:32:59 | PMunch | Basically -d:nodeclguards will create a much more readable output |
20:33:25 | FromDiscord | <Elegantbeef> shame on you |
20:33:30 | FromDiscord | <Elegantbeef> You should prefix the flag with `futhark` |
20:33:38 | FromDiscord | <Elegantbeef> especially `exportAll` |
20:34:00 | PMunch | @spoon, yes you can get the Nim file out so you can do it. But it's better to use the hooking system, that way your changes are actually written out in code so you don't have to remember the changes |
20:34:11 | PMunch | That being said there shouldn't really be anything you'd want to change |
20:34:20 | PMunch | @Elegantbeef, hmm, fair point |
20:34:36 | FromDiscord | <Elegantbeef> The way you use futhark is like how you use the C import in zig |
20:34:45 | FromDiscord | <Elegantbeef> You get a C-api in your language, you then add a wrapping on top |
20:35:27 | PMunch | Exactly! Futhark was heavily inspired by the Zig approach |
20:35:37 | FromDiscord | <Elegantbeef> Speaking of is there a way to retype pointers inside specific procedures, I know there is for types |
20:36:11 | PMunch | Well, you could definitely do it, but not as ergonomically |
20:36:14 | PMunch | I plan to add it though |
20:36:18 | FromDiscord | <Elegantbeef> Also `comppilerArgs` is this a typo? |
20:36:25 | PMunch | Yes |
20:38:01 | FromDiscord | <Elegantbeef> I guess `retype procName"field", ptr UncheckedArray[int]` is like the best you can do |
20:38:21 | FromDiscord | <Elegantbeef> or `retype procName, proc(...): ...` |
20:38:34 | PMunch | Well that doesn't currently work, but yes the syntax would be something like that |
20:43:21 | PMunch | I guess you could create a proc through a cast or something |
20:47:00 | FromDiscord | <weitzj> sent a long message, see http://ix.io/4qFo |
20:47:47 | PMunch | Correct, although clang still need to be able to understand the headers |
20:47:55 | FromDiscord | <Elegantbeef> This is where the fun part of futhark is |
20:48:27 | FromDiscord | <Elegantbeef> It's limited by the fact it's basically a modified clang compiler, so if clang cannot understand the code it cannot be used |
20:48:28 | PMunch | I wasn't able to use it for AVR stuff because it uses some features of avr-gcc which clang doesn't know about. But I know @djazz has been able to wrap some Pi Pico stuff (I think that was it) |
20:48:41 | PMunch | Basically YMMV |
20:48:57 | FromDiscord | <Elegantbeef> This also means things that do specialisations for msvc, gcc, tcc will not be parsable independantly |
20:49:01 | FromDiscord | <Elegantbeef> It'll always take the clang path |
20:49:04 | FromDiscord | <weitzj> Yeah. But if this is only C then this is all handled by clang? Or is there a C dialect per processor architecture ? |
20:49:26 | PMunch | Well, it depends @Elegantbeef if the header is "clean" then it will work |
20:49:29 | FromDiscord | <Elegantbeef> There are compiler specialisations so somethings might not be the same across compilers |
20:49:33 | FromDiscord | <Elegantbeef> Usually it's inside a `ifdef` |
20:49:37 | FromDiscord | <weitzj> In reply to @PMunch "I wasn't able to": Ah. Got it. |
20:49:45 | PMunch | I.e. if header is the same but the ifdef only exists in the .c files |
20:50:12 | FromDiscord | <djazz> example, I wrapped lwip using futhark https://github.com/daniel-j/nim-picosdk/blob/master/src/picostdlib/lib/lwip.nim https://github.com/lwip-tcpip/lwip |
20:50:25 | PMunch | @weitzj, yeah compilers can have different "dialects".. |
20:50:32 | FromDiscord | <djazz> i first made my own wrappers using c2nim |
20:50:58 | FromDiscord | <djazz> you can see my c2nim wrappers here https://github.com/daniel-j/nim-picosdk/tree/master/src/picostdlib/lib/lwip |
20:51:12 | FromDiscord | <djazz> some might have been nimterop (toast) |
20:53:25 | FromDiscord | <weitzj> Thank you everybody. That was very helpful |
20:53:40 | FromDiscord | <djazz> what OS are you on? |
20:55:40 | FromDiscord | <djazz> PMunch: so any idea how to get rid of the red squiggly lines when using futhark, and not using the generated nim directly? nim lang server dont understand the macro magic? |
20:56:03 | FromDiscord | <weitzj> In reply to @djazz "what OS are you": Linux |
20:57:22 | PMunch | @djazz, I'm actually not sure why it isn't able to read it |
20:57:40 | PMunch | But keeping a local cache and when defined statements seems to help |
20:57:42 | FromDiscord | <djazz> thats my biggest downsade with it |
21:04:44 | FromDiscord | <djazz> PMunch: about short enums on windows... idk, seems like a debated feature so... |
21:04:55 | FromDiscord | <djazz> and i couldnt get them to work there |
21:05:12 | FromDiscord | <djazz> not sure if its a clang or opir issue |
21:05:15 | PMunch | Yeah that's the conclusion I came to as well |
21:05:30 | PMunch | Basically it's a strange feature, and Windows doesn't like it I think |
21:05:39 | PMunch | The when defined for Windows is fine |
21:06:11 | FromDiscord | <djazz> should i bring back when defined(windows) for them? |
21:06:41 | FromDiscord | <djazz> when not defined xd |
21:06:44 | PMunch | Did you take them out? |
21:06:48 | FromDiscord | <djazz> yea |
21:06:56 | FromDiscord | <djazz> removed the compiler arg |
21:07:59 | PMunch | Yeah, put it back in |
21:09:29 | FromDiscord | <djazz> going to test it on macos as well then |
21:12:38 | FromDiscord | <djazz> sent a code paste, see https://paste.rs/7fC |
21:13:53 | FromDiscord | <djazz> works on macos |
21:14:00 | FromDiscord | <djazz> short enums that is |
21:14:07 | PMunch | I think you can do `compilerArg when not defined(): else: ""` |
21:14:21 | FromDiscord | <djazz> does it ignore empty string? |
21:14:55 | PMunch | Well an empty compiler arg wouldn't do much now would it |
21:15:11 | FromDiscord | <djazz> ok that worked |
21:16:14 | FromDiscord | <djazz> ok, so what do you think of my hostQuoteCommand, hostAbsolutePath etc procs? |
21:16:31 | FromDiscord | <djazz> they arent directly related to futhark, but needed when crosscompiling |
21:16:59 | PMunch | Sorry, haven't had a chance to look at those |
21:17:36 | FromDiscord | <djazz> copied from nim os module and modified to use buildOS, windowsHost const |
21:19:06 | FromDiscord | <firasuke> what's the recommended method to execute a command on the host system and store its output as a string and its exit code? `os` vs `osproc`? |
21:19:32 | FromDiscord | <djazz> gorgeEx if at compiletime |
21:19:38 | FromDiscord | <Elegantbeef> `execCmdEx` |
21:20:02 | FromDiscord | <firasuke> In reply to @djazz "gorgeEx if at compiletime": ok cool so staticEx or gorgeEx for compile time stuff |
21:20:16 | FromDiscord | <firasuke> In reply to @Elegantbeef "`execCmdEx`": ok |
21:20:20 | FromDiscord | <djazz> gorgeEx gives you the status code |
21:20:33 | FromDiscord | <djazz> staticExec/gorge only gives output |
21:21:25 | FromDiscord | <djazz> dont forget quoteShell, quoteShellCommand if passing command arguments as string |
21:21:26 | PMunch | Anyways, I'm off to shovel some snow |
21:21:34 | FromDiscord | <firasuke> I was wondering what's the diff between execShellCmd and execCmd, is it only the shell part? or does execCmd give more control over the output/input/exit code |
21:21:48 | FromDiscord | <firasuke> In reply to @djazz "dont forget quoteShell, quoteShellCommand": thanks for that |
21:22:31 | FromDiscord | <djazz> osproc module has functions to pass arguments as array/seq |
21:24:10 | FromDiscord | <firasuke> can you pass constants as parameters to functions expecting a string? |
21:24:38 | FromDiscord | <Elegantbeef> Of course |
21:25:12 | FromDiscord | <djazz> look at this example also, using startProcess https://nim-lang.org/docs/osproc.html#readLines%2CProcess |
21:25:59 | FromDiscord | <firasuke> cool, thanks |
21:26:34 | FromDiscord | <djazz> hmm, there should be a execProcessEx proc imo, that can give you return code also |
21:26:36 | FromDiscord | <firasuke> how about working with constant strings as paths and joining them |
21:26:48 | FromDiscord | <firasuke> In reply to @djazz "hmm, there should be": yea saw that as well, very useful |
21:27:01 | FromDiscord | <djazz> import os↵"this" / "is" / "joined" |
21:27:31 | FromDiscord | <djazz> In reply to @firasuke "yea saw that as": I mean, it should exist. It doesnt exist today |
21:27:37 | FromDiscord | <firasuke> In reply to @djazz "import os "this" /": come on, it can't be this easy lol |
21:27:53 | FromDiscord | <djazz> https://nim-lang.org/docs/os.html#%2F%2Cstring%2Cstring |
21:27:54 | FromDiscord | <djazz> XD |
21:28:07 | FromDiscord | <djazz> `/` is an alias for joinPath |
21:29:06 | FromDiscord | <firasuke> I mean don't I have to like at least spend 8 hours to understand the difference between strings and os paths and such, just use `/` are you kidding me lol |
21:29:42 | FromDiscord | <Elegantbeef> Nim 2.0 does have typed paths but yes it's all just a string in Nim |
21:30:39 | FromDiscord | <firasuke> imo this is great |
21:31:10 | FromDiscord | <Phil> In reply to @Elegantbeef "Nim 2.0 does have": What property do "typed paths" have over strings? |
21:31:43 | FromDiscord | <Elegantbeef> It's statically typed, so you work on things knowing they're absolute, relative, files, directories, symlinks |
21:33:20 | FromDiscord | <Phil> Ahh so I can distinguish different kinds of paths thanks to static typing and not run into issues there |
21:33:27 | FromDiscord | <Phil> Check |
21:33:46 | FromDiscord | <Elegantbeef> https://nim-lang.github.io/Nim/paths.html correct |
21:34:38 | FromDiscord | <djazz> nice |
21:35:32 | FromDiscord | <Elegantbeef> It didnt go as deep as i though it just has `Path` 😄 |
21:35:45 | FromDiscord | <djazz> `distinct string` xd |
21:36:05 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4qFw |
21:36:38 | FromDiscord | <Elegantbeef> You should be able to echo typedefs |
21:36:45 | FromDiscord | <Elegantbeef> Perhaps you cannot which would be weird |
21:37:13 | FromDiscord | <jmgomez> I thought it was a orc issue with 1.6.x but it seems it keep happening in devel.. |
21:37:55 | FromDiscord | <jmgomez> although just tried refc/markAndSweep and got the same result |
21:38:34 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qFy |
21:38:44 | FromDiscord | <Elegantbeef> That's not the VM phill |
21:38:53 | FromDiscord | <Phil> Oh right, nim secret |
21:39:17 | FromDiscord | <Elegantbeef> But it still will work |
21:40:29 | FromDiscord | <jmgomez> I think is related to this: https://github.com/nim-lang/Nim/issues/19974 |
21:40:35 | FromDiscord | <Phil> I can't even do a type declaration in nim secret o.O |
21:40:44 | FromDiscord | <firasuke> I know I am asking a lot, so please bare with me |
21:40:51 | FromDiscord | <firasuke> what's the default method for handling errors in nim? |
21:41:10 | FromDiscord | <Phil> exception handling currently, though some folks use Result-types |
21:41:14 | FromDiscord | <Elegantbeef> Exceptions |
21:41:15 | FromDiscord | <firasuke> with proper error messages based on result types |
21:41:20 | FromDiscord | <firasuke> oh ok, exceptions |
21:41:38 | FromDiscord | <Elegantbeef> Yea jm just tested using `nim e` it works fine |
21:41:43 | FromDiscord | <Elegantbeef> So you're smoking something |
21:42:01 | FromDiscord | <Phil> I think I'm just failing at using nim secret |
21:42:50 | FromDiscord | <firasuke> In reply to @Isofruit "exception handling currently, though": can you link to both please? |
21:43:26 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/TSE |
21:44:38 | FromDiscord | <jmgomez> oh yeah that works sure |
21:44:59 | FromDiscord | <jmgomez> what doesnt work is inside a vm building an interpreter, not sure about the diffs.. |
21:45:09 | NimEventer | New Nimble package! webui - Nim wrapper for WebUI, see https://github.com/neroist/webui#readme |
21:45:43 | FromDiscord | <Elegantbeef> Perhaps you are not passing the right defines |
21:45:53 | FromDiscord | <firasuke> In reply to @Elegantbeef "Exceptions": so this: https://status-im.github.io/nim-style-guide/errors.html? |
21:47:04 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#exception-handling |
21:47:05 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4qFE |
21:47:05 | FromDiscord | <Phil> In reply to @firasuke "so this: https://status-im.github.io/nim-style-guid": Status has a Result lib, can't find it atm but shouldn't be tooooo hard to find:↵https://status-im.github.io/nim-style-guide/libraries.results.html |
21:47:14 | FromDiscord | <Phil> And beef just linked exception handling docs |
21:47:30 | FromDiscord | <firasuke> oh ok thanks a lot |
21:47:44 | FromDiscord | <jmgomez> In reply to @jmgomez "I see the example": got this to work cc @ringabout |
21:48:22 | FromDiscord | <Elegantbeef> Jm does `defines = @{"nimscript": "true", "nimconfig": "true"}` help any? |
21:48:37 | FromDiscord | <Phil> In reply to @firasuke "oh ok thanks a": There's multiple libs, pick one that you trust and see if it works for you:↵https://nimble.directory/search?query=result↵resultutils, questionable and result seem to be what you're looking for |
21:48:42 | FromDiscord | <Phil> (edit) "In reply to @firasuke "oh ok thanks a": There's multiple libs, pick one that you trust and see if it works for you:↵https://nimble.directory/search?query=result↵resultutils, questionable and result seem to be what you're looking for ... " added "(if you want to use result-types)" |
21:48:56 | FromDiscord | <Phil> If you want to enforce exception handling, then also check out the `raises` pragma |
21:49:05 | FromDiscord | <firasuke> oh cool |
21:49:53 | FromDiscord | <jmgomez> In reply to @Elegantbeef "Jm does `defines =": nope |
21:50:11 | FromDiscord | <Phil> In reply to @firasuke "oh cool": https://nim-lang.org/docs/manual.html#effect-system-exception-tracking↵Here in case you want to start explicitly tracking which proc can raise which exception etc. |
21:50:25 | FromDiscord | <jmgomez> do you recall if it worked for you at some point in nimscripter? |
21:50:32 | FromDiscord | <firasuke> that is insanely useful, thanks @Phil |
21:50:39 | FromDiscord | <Elegantbeef> I mean it should work fine |
21:50:52 | FromDiscord | <Elegantbeef> Not like nimscripter works on devel anymore anyway |
21:51:17 | FromDiscord | <Elegantbeef> It's pretty much a dead package now until i get around to figuring the whole using nimble files to implement procedures |
21:51:33 | FromDiscord | <jmgomez> I was waiting to resume the work on it to have the chance to upgrade to devel hoping that it worked there. But it isnt the case |
21:52:17 | FromDiscord | <jmgomez> Oh yeah, that's why I pinged ringabout now, as he (or she?) mentioned the `` is not available anymore |
21:52:41 | FromDiscord | <Phil> In reply to @jmgomez "Oh yeah, that's why": Welcome to the reason I just use they: It's foolproof 😛 |
21:52:44 | FromDiscord | <jmgomez> not sure if just adding nimscripter instead for you will do the trick, it did for me |
21:52:46 | FromDiscord | <Phil> (edit) "they:" => ""they":" |
21:53:24 | FromDiscord | <jmgomez> In reply to @Isofruit "Welcome to the reason": English is hard enough for me already, Im fine saying sorry if I got it wrong I guess |
21:54:47 | FromDiscord | <jmgomez> So I need to go, will fill an issue for that if it should work and in the meantime I will see if I can get a hacky workaround for the interop |
21:54:55 | NimEventer | New thread by Naterlarsen: Cursor Location for user input., see https://forum.nim-lang.org/t/9986 |
21:55:16 | FromDiscord | <Yepoleb> In reply to @jmgomez "Oh yeah, that's why": it's he btw |
22:10:12 | NimEventer | New Nimble package! dhash - Nim implementation of dHash algorithm, see https://github.com/filvyb/dhash |
22:13:42 | FromDiscord | <Elegantbeef> You're telling me males would use anime pictures for profile pictures?! |
22:15:58 | PMunch | Right, back from snow shoveling |
22:16:02 | FromDiscord | <Phil> Males would even use intelligent looking fruits for profile pictures |
22:16:48 | FromDiscord | <Elegantbeef> You cannot put glasses on a tomato to make it look smart |
22:17:20 | PMunch | Huh, just had a look at an older project of mine. Apparently it's wrapping Gtk with futhark |
22:17:26 | PMunch | That's neat |
22:18:09 | PMunch | Didn't even remember that was a thing I've done, that's how easy wrapping stuff with Futhark is :P |
22:25:04 | FromDiscord | <Elegantbeef> Oh also i made graffiti a tinge smarter, it now uses the commit that the version was ticked on |
22:25:04 | FromDiscord | <Phil> In reply to @Elegantbeef "You cannot put glasses": That's why you put them on a refined looking apple |
22:25:46 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1084603162582855810/image.png |
22:25:50 | FromDiscord | <Elegantbeef> It's like it was done manually! 😛 |
22:37:40 | * | azimut joined #nim |
22:38:11 | * | Notxor quit (Remote host closed the connection) |
22:56:47 | NimEventer | New thread by alexeypetrushin: Strange SIGSEGV / nil, see https://forum.nim-lang.org/t/9987 |
22:58:07 | FromDiscord | <Yepoleb> it's always a big surprise when the cute anime girl is a man |
22:59:32 | FromDiscord | <tsoj> sent a code paste, see https://play.nim-lang.org/#ix=4qG3 |
23:02:12 | FromDiscord | <Elegantbeef> Static parameters is pretty much it |
23:03:50 | * | PMunch quit (Quit: leaving) |
23:07:34 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "You cannot put glasses": Beef came for blood lmao |
23:09:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qGa |
23:10:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qGb |
23:15:01 | FromDiscord | <tsoj> Usually I would do your more straightforward 2nd version, but in this case, the `MyEnum` enum will grow and I don't want to update the `doThing` function everytime there gets a new enum element introduced (I also don#t want everything in the `doThing` function, so I'd need extra functions anyway). But your first version looks nice, I'm gonna try this, thanks! |
23:16:23 | * | azimut quit (Ping timeout: 255 seconds) |
23:19:48 | FromDiscord | <Elegantbeef> It's a shame we cannot do `proc doThing(s: static 10)` or `s: 10` |
23:21:35 | FromDiscord | <tsoj> Have you also run into a situation where you needed this? I assumed this was kind of a niche case |
23:21:56 | FromDiscord | <Elegantbeef> I havent really needed it I just futz around with the type system |
23:22:36 | FromDiscord | <Elegantbeef> In your case you could use types aswell |
23:23:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qGf |
23:23:30 | FromDiscord | <Elegantbeef> But those do not compose for obvious reasons |
23:25:15 | NimEventer | New thread by alexeypetrushin: How to decouple code?, see https://forum.nim-lang.org/t/9988 |
23:26:00 | * | azimut joined #nim |
23:29:49 | FromDiscord | <tsoj> sent a code paste, see https://play.nim-lang.org/#ix=4qGh |
23:30:03 | FromDiscord | <Elegantbeef> I concur |
23:56:06 | FromDiscord | <luteva> is there any transpiler from javascript to nim? |
23:56:36 | FromDiscord | <Elegantbeef> IIRC there are some very basic attempts, but it's always going to be awful |
23:56:48 | FromDiscord | <Elegantbeef> JS is not statically typed so raising it to static typed is pretty much impossible |
23:57:54 | FromDiscord | <luteva> ok typescript to nim 😄 |
23:57:56 | FromDiscord | <luteva> ? |
23:59:02 | FromDiscord | <Elegantbeef> One of those exists |
23:59:02 | FromDiscord | <Elegantbeef> A lot of people write interfaces for their types and that means there is no real instance |
23:59:03 | FromDiscord | <Elegantbeef> But it's a similar problem due to everything being equivalent to a Nim concept in TS |