00:11:22 | * | xet7 quit (Read error: Connection reset by peer) |
00:11:36 | * | xet7 joined #nim |
00:18:27 | * | Gustavo6046_ joined #nim |
00:19:12 | * | vicfred quit (Quit: Leaving) |
00:19:21 | * | Gustavo6046 quit (Ping timeout: 256 seconds) |
00:20:50 | * | Gustavo6046_ is now known as Gustavo6046 |
01:00:49 | * | kasperk81 quit (Quit: Connection closed) |
01:01:59 | * | petrj quit (Quit: Connection closed) |
01:08:25 | * | lain joined #nim |
01:40:54 | * | arkurious quit (Quit: Leaving) |
01:44:00 | FromDiscord | <Rika> In reply to @dom96 "`obj.field = 42` is": And then if the object has both a field and a function but the field is unexported lol |
01:44:11 | FromDiscord | <Rika> Inside the module, it's the field, outside, it's the function |
02:18:34 | FromDiscord | <deech> Semantically what's the difference between `type MyInt = object i: int` and `type MyInt = distinct int`? |
02:19:43 | FromDiscord | <Elegantbeef> You cannot borrow procedures from the int in this case, nor can you easily convert a `MyInt` to `int` without a converter |
02:20:59 | FromDiscord | <deech> Can the latter have distinct lifecycle hooks, `=sink`, `=copy` etc? |
02:21:58 | FromDiscord | <Elegantbeef> !eval type A = distinct int; proc `=sink`(a\: var A, y\: A) = discard |
02:21:59 | NimBot | Compile failed: /usercode/in.nim(1, 44) Error: expected: ')', but got: 'keyword var' |
02:22:06 | FromDiscord | <Elegantbeef> Oh shit that's not going to work is it? \:D |
02:22:15 | FromDiscord | <Elegantbeef> To answer your question it can i believe |
02:23:46 | FromDiscord | <deech> Interesting! Then why would I ever want an object with one field as opposed to a `distinct` type? That seems like a better design choice in general? |
02:23:52 | FromDiscord | <Elegantbeef> Yea the docs say `T can also be a distinct type` |
02:24:05 | FromDiscord | <Elegantbeef> You wouldnt |
02:24:38 | FromDiscord | <deech> I suppose `distinct` can't be parameterized? eg. `type MySeq[T] = distinct seq[T]`? |
02:25:05 | FromDiscord | <Elegantbeef> Had someone making a generic collection yesterday |
02:25:34 | FromDiscord | <Elegantbeef> It works but dont expect to borrow `[]` `[]=` as they work on generics so are not concrete |
02:26:31 | FromDiscord | <deech> Yeah good point. It still seems that for concrete types `distinct` is always a better choice vs. a single field `object.`. |
02:27:36 | FromDiscord | <Elegantbeef> But in that case get close with the ufcs generic syntax to make your life easier |
02:27:47 | FromDiscord | <Elegantbeef> `proc add[T](a: var A[T], val: sink T) = a.seq[:T].add(val)` just slides of the tongue |
02:28:18 | FromDiscord | <deech> whoa, what does `a.seq[:T]` do? |
02:28:18 | FromDiscord | <Elegantbeef> Distincts converted to their base are l values which means things like that works |
02:28:34 | FromDiscord | <Elegantbeef> It converts it back to a seq and runs the add operation on that |
02:28:53 | FromDiscord | <Elegantbeef> It's the same as `seq[T](a).add` just with ufcs for type conversion |
02:29:10 | FromDiscord | <Elegantbeef> In ufcs generic calls you have to do `: T` to pass the generic along |
02:29:23 | FromDiscord | <deech> Ah! I didn't know that. |
02:29:28 | FromDiscord | <Elegantbeef> Otherwise it's taken as a indexing by type and doesnt work unless that's what you want |
02:31:11 | FromDiscord | <Elegantbeef> To highlight that note though, it's another benefit for the distinct, since you can call base operations on the type if they expect a mutable version without any converters or anything |
02:33:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3r2M |
03:09:10 | FromDiscord | <hamidb80> what is {.anchor.}? |
03:09:16 | FromDiscord | <hamidb80> i coudn't find doc about it |
03:09:35 | FromDiscord | <hamidb80> (edit) "{.anchor.}?" => "`{.anchor.}`?" |
03:10:26 | FromDiscord | <hamidb80> also what is `{.dirty.}`? |
03:11:51 | FromDiscord | <hamidb80> are they documented? |
03:15:55 | FromDiscord | <Elegantbeef> Dirty is for making a template unhygenic so it doesnt gensym symbols internally |
03:17:23 | FromDiscord | <Elegantbeef> Never seen `anchor` before |
03:22:02 | * | Epsilon quit (Ping timeout: 244 seconds) |
03:24:00 | FromDiscord | <hamidb80> tnks |
03:24:16 | * | Epsilon joined #nim |
03:26:29 | FromDiscord | <kaushalmodi> In reply to @hamidb80 "also what is `{.dirty.}`?": https://nim-lang.github.io/Nim/manual#templates-hygiene-in-templates |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:37 | * | supakeen joined #nim |
04:08:22 | FromDiscord | <checkersai> Can I get some input on an idea? |
04:08:58 | FromDiscord | <checkersai> I was wondering if it might be a fun exercise to port the quake engine to Nim |
04:11:56 | FromDiscord | <Elegantbeef> it'd probably be a fun exercise, but you're after all just re-implementing an already existing thing so if you find that worthwhile is the question you should ask |
04:12:47 | FromDiscord | <checkersai> fair enough |
04:12:57 | FromDiscord | <checkersai> What if I tried to make a quake-like engine in Nim? |
04:13:24 | FromDiscord | <Elegantbeef> You're presently talking to someone who is making a voxel rendering engine in Nim for fun, so.... \:P |
04:13:39 | FromDiscord | <checkersai> oh cool |
04:14:23 | FromDiscord | <Varriount> Is there some new flag required to get line numbers in stack traces? I have a program that is throwing an exception, and no matter what flags I do or do not use (`linetrace`, `stacktrace`, `linedir`, `debugger`, etc.) nothing seems to get line numbers working properly. |
04:15:30 | FromDiscord | <checkersai> In reply to @Elegantbeef "You're presently talking to": I mainly got interested because I was just playing the Hrot demo |
04:15:44 | FromDiscord | <checkersai> and the developer of that wrote a custom engine in Pascal |
04:16:28 | FromDiscord | <checkersai> I just spent like 20 minutes in the demo just looking at everything. Not even playing through it just observing the models and shading and stuff |
04:16:43 | FromDiscord | <checkersai> And I thought "I wonder if I can do something like this" |
04:16:44 | FromDiscord | <Elegantbeef> Yea i mean it's completely doable, really a question of "is it something you want to dedicate a buttload of time into" |
04:16:55 | FromDiscord | <Elegantbeef> If you dont know much about game engines it'd teach you a fair bit |
04:17:27 | FromDiscord | <checkersai> I know a tiny bit |
04:18:18 | FromDiscord | <checkersai> Like I've dabbled in rendering stuff |
04:18:27 | FromDiscord | <checkersai> but I've never written a whole game engine |
04:18:33 | FromDiscord | <checkersai> (edit) "Like I've dabbled in ... rendering" added "basic" |
04:19:02 | fn | <ForumUpdaterBot> New Nimble package! chain - Nim's function chaining and method cascading, see https://github.com/khchen/chain |
04:19:03 | fn | <R2D2> itHub: 7"Nim's function chaining and method cascading" |
04:19:48 | * | SebastianM joined #nim |
04:20:41 | FromDiscord | <Elegantbeef> Well if you're interested in doing it there is not much reason not to unless you have other stuff you want to do π |
04:21:17 | FromDiscord | <Elegantbeef> Just dont make a "quake engine" make a game of your own and have it play similarly to quake π |
04:26:45 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3r31 |
04:26:56 | FromDiscord | <hamidb80> > Error: invalid token: _ (\95) |
04:27:36 | FromDiscord | <hamidb80> even in ` back ticks |
04:27:40 | FromDiscord | <hamidb80> (edit) "in" => "inside" |
04:27:48 | FromDiscord | <Elegantbeef> Well `_` is an invalid start character |
04:28:51 | FromDiscord | <kaushalmodi> In reply to @hamidb80 "i cant define variable": https://nim-lang.github.io/Nim/manual#lexical-analysis-identifiers-amp-keywordsβ΅β΅> letter ::= 'A'..'Z' | 'a'..'z' | '\x80'..'\xff' |
04:29:23 | FromDiscord | <Elegantbeef> even without that in mind, `_name` would have to be a valid way to interact with that variable |
04:31:08 | FromDiscord | <Elegantbeef> I say would have to, but that's just cause `\`name\`` can be accessed`name\` |
04:31:15 | FromDiscord | <Elegantbeef> oh jeez there goes highlighting |
04:31:26 | FromDiscord | <kaushalmodi> In reply to @Elegantbeef "even without that in": Nim allows unicodes in identifiers, but looking at that spec, those have to be within those hex values? And the hex value of `_` is 0x5F. |
04:31:56 | FromDiscord | <kaushalmodi> checking if markdown-like double back-quoting works.. `` `abc` `` |
04:32:42 | FromDiscord | <Elegantbeef> Anywho why are we starting variables with `_` this isnt C# or python π |
04:32:47 | FromDiscord | <kaushalmodi> yep.. that's `BB BabcB BB` where B is a backquote |
04:33:47 | FromDiscord | <hamidb80> In reply to @Elegantbeef "Anywho why are we": i wanna make a client for arangoDB and Arango has fields `_key`, `_id` and `_rev` by defauly |
04:33:53 | FromDiscord | <hamidb80> (edit) "defauly" => "default" |
04:34:28 | FromDiscord | <hamidb80> i think i can use \key , \id , ... instead |
04:34:47 | FromDiscord | <Elegantbeef> Why make it harder on yourself? |
04:35:24 | FromDiscord | <hamidb80> π |
04:35:32 | FromDiscord | <hamidb80> youre right |
04:35:35 | FromDiscord | <hamidb80> (edit) "youre" => "you're" |
04:36:11 | FromDiscord | <Elegantbeef> Like why not just use `key`, `id`, `rev` then on conversion add the `_` or even use metaprogramming to control the conversion |
04:37:17 | FromDiscord | <hamidb80> that's a good idea |
04:40:23 | FromDiscord | <checkersai> @ElegantBeef is your voxel engine on github? |
04:40:41 | FromDiscord | <Elegantbeef> It is but it's absolutely useless atm |
04:40:51 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/857842755845488640/image.png |
04:40:57 | FromDiscord | <Elegantbeef> Unless that grid really makes you happy |
04:43:00 | FromDiscord | <Elegantbeef> That's a 4x4 raymarched grid, so.... yea |
04:45:03 | FromDiscord | <checkersai> ah |
05:03:10 | * | SebastianM quit (Quit: Bye) |
05:19:09 | FromDiscord | <checkersai> Can I specify what garbage collector to use in the `.nimble` file? |
05:19:27 | FromDiscord | <Elegantbeef> should be `switch("gc", "orc")` for instance |
05:24:18 | FromDiscord | <checkersai> thanks |
05:25:38 | * | rockcavera quit (Remote host closed the connection) |
05:25:39 | FromDiscord | <checkersai> Also, `GC_step` only works for gc:refc, right? |
05:30:10 | * | cyraxjoe joined #nim |
05:44:02 | FromDiscord | <Phytolizer> can someone review this code and let me know if i am doing Terrible Awful Things? it's probably a lot to ask but i really want to improve my Nimβ΅https://github.com/onContentStop/crenshaw.nim |
05:44:04 | fn | <R2D2> itHub: 7"<No Description>" |
05:44:34 | FromDiscord | <Phytolizer> the big mama is in `tiny.nim` |
05:45:10 | FromDiscord | <Phytolizer> it's a programming language compiler. |
05:46:45 | FromDiscord | <Elegantbeef> I see PascalCased procedures |
05:48:14 | FromDiscord | <Phytolizer> yes, this is based on a chunk of Pascal code |
05:48:31 | FromDiscord | <Phytolizer> is that bad style? |
05:48:48 | FromDiscord | <Elegantbeef> Nim conventions are camelCased for procedures |
05:49:16 | FromDiscord | <Elegantbeef> `GetNum` returning `char` is a bit odd |
05:49:50 | FromDiscord | <Phytolizer> it returns `int` in `tiny.nim`, the other files are prototypes of that compiler |
05:50:15 | FromDiscord | <Phytolizer> sorry for the confusion |
05:50:31 | FromDiscord | <Elegantbeef> Ah checkout strutils/parseutils you're reimpl alot of logic |
05:51:19 | FromDiscord | <Phytolizer> never heard of `parseutils`, will check it out |
05:51:26 | FromDiscord | <Phytolizer> i have a feeling this compiler could be a lot smaller |
05:52:16 | FromDiscord | <haxscramper> In reply to @Phytolizer "can someone review this": Also use `import std/[...]` for imports |
05:52:27 | FromDiscord | <Phytolizer> oh really? why? |
05:52:48 | FromDiscord | <Phytolizer> absolute vs relative path specification i guess? |
05:53:51 | FromDiscord | <haxscramper> No, just better to use `std/` prefix when importing std modules |
05:54:01 | FromDiscord | <haxscramper> Btw, are you following some tutorial? |
05:54:09 | FromDiscord | <Phytolizer> yes, i'll link it |
05:54:20 | FromDiscord | <Phytolizer> it's from 1985 but has been really helpful for me |
05:54:27 | FromDiscord | <Phytolizer> https://compilers.iecc.com/crenshaw |
05:55:11 | FromDiscord | <Phytolizer> something i haven't paid much mind to yet is that back then there were a LOT less convenience functions and you had to DIY |
05:55:18 | FromDiscord | <Phytolizer> that's why there's a lot of reinventing the wheel here |
05:56:34 | FromDiscord | <haxscramper> https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 if you are interested in the collection of links for language development in nim |
05:56:44 | FromDiscord | <haxscramper> I also added your project tot he list because it looks very interesting |
05:57:11 | FromDiscord | <Phytolizer> hey, thanks! :) |
05:57:17 | FromDiscord | <Phytolizer> that looks like a really good list |
05:57:27 | FromDiscord | <Elegantbeef> But yea strutils has stuff for almost all `isX` |
05:58:14 | FromDiscord | <Phytolizer> not just IsAlpha/Digit/AlNum? |
05:58:43 | FromDiscord | <Phytolizer> IsWhite specifically excludes newlines because there is control over where that is allowed in the language |
05:59:08 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#isAlphaNumeric%2Cchar |
05:59:52 | FromDiscord | <Elegantbeef> Most of that stuff is nearby |
06:04:11 | * | PMunch joined #nim |
06:05:55 | FromDiscord | <Elegantbeef> I dont know what the general view is but for atleast some of those emitted calls you could use templates as such to reduce the chance of a typo https://play.nim-lang.org/#ix=3r3p \:D |
06:06:48 | FromDiscord | <Phytolizer> templates are like C macros right? |
06:07:06 | FromDiscord | <Phytolizer> just a cut-and-paste thing? |
06:07:10 | FromDiscord | <Elegantbeef> They're code substitution, they're slightly similar |
06:07:22 | FromDiscord | <Elegantbeef> They can have typed parameters for type safety |
06:07:38 | FromDiscord | <Phytolizer> ok, templates are definitely not a bad idea as this code has some repetition |
06:08:26 | FromDiscord | <Elegantbeef> Also no clue if you want more safety but i'd do this a bit different π |
06:08:35 | FromDiscord | <Phytolizer> how so? |
06:08:47 | FromDiscord | <Phytolizer> btw if you refresh the page, i fixed the casing for all the procs |
06:09:02 | FromDiscord | <Phytolizer> i am interested in making this code safer/easier to debug |
06:09:32 | FromDiscord | <Elegantbeef> Have all the registers be enums then have for instance `proc push(r: Register)` |
06:09:33 | FromDiscord | <Elegantbeef> then your code would be almost identical to the asm |
06:10:01 | FromDiscord | <Phytolizer> i see |
06:10:41 | FromDiscord | <Phytolizer> most of the code deals in rax/rbx though, wouldn't it make more sense to make the opcode be the parameter? |
06:10:57 | FromDiscord | <Phytolizer> exception being div because div is annoying in x64 apparently |
06:11:02 | FromDiscord | <Elegantbeef> That'd be valid nim code π |
06:11:02 | FromDiscord | <Elegantbeef> Well `cdq()` |
06:11:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3r3r |
06:11:15 | FromDiscord | <Phytolizer> ah that's clever |
06:11:29 | FromDiscord | <checkersai> Just curious, is there a function or flag in nim that says which gc is being used currently? Like could I do something like `echo currentGC` |
06:12:25 | FromDiscord | <Elegantbeef> There is a way to fetch compiler options but i never remember how, sorry |
06:13:53 | FromDiscord | <Elegantbeef> No clue if you like my idea, but i think it's nicer than writing strings manually π |
06:14:16 | FromDiscord | <Phytolizer> i'm not 100% sold, it would feel like a gimmick to me |
06:14:44 | FromDiscord | <Elegantbeef> Yea i mean it's mostly just about if you're adding any more operations |
06:15:12 | fn | <hoijui> I have small tool which runs a series of checks. each check is defined in its own nim source file, and has the same structure (simplified, it contains a: `proc run()`) |
06:15:13 | fn | <hoijui> each such Nim source file is in the "checks" sub-dir |
06:15:21 | fn | <hoijui> in the main source file, I manually import each of these files, and later execute the `run` method from it. |
06:15:28 | fn | <hoijui> is it possible to somehow automate the importing of all the checks ("checks/*.nim"), and get a list of them, so I can execute their `run` procs in a loop? |
06:15:46 | FromDiscord | <Elegantbeef> You could use a macro to import all the files in that folder |
06:15:50 | fn | <hoijui> something like.. "compile-time plugins" |
06:15:50 | FromDiscord | <Phytolizer> fair enough. i haven't finished the tutorial but it doesn't seem like he's going to add more |
06:16:06 | fn | <hoijui> Elegantbeef, ok! |
06:16:12 | FromDiscord | <Elegantbeef> https://github.com/GaryM-exkage/GDGW-Maverick-Bot/blob/master/src/nimcordbot/utils.nim#L3 might be useful for you |
06:16:40 | FromDiscord | <Phytolizer> god i love nim macros |
06:16:41 | FromDiscord | <Elegantbeef> That handles the importing of the given relative folder path, you then would also emit a `moduleX.run()` |
06:16:56 | FromDiscord | <Elegantbeef> Join the club, they solve so many issues |
06:17:42 | * | lucerne joined #nim |
06:18:45 | FromDiscord | <Elegantbeef> Feel free to ask for help if you need it modifying that macro |
06:20:34 | fn | <hoijui> Elegantbeef.. coool! thank you! :-) |
06:21:07 | fn | <ForumUpdaterBot> New post on r/nim by totallyspis: Fetch compiler options in code, see https://reddit.com/r/nim/comments/o7hxsn/fetch_compiler_options_in_code/ |
06:21:13 | fn | <hoijui> I think I'll need help for the "emit a `moduleX.run()`" part |
06:21:55 | fn | <hoijui> hm.. I geus it should be a separate macro, as I'll run that in a different place, right? |
06:22:10 | fn | <hoijui> guess* |
06:29:44 | FromDiscord | <Phytolizer> thanks for looking over my code Elegantbeef, i really appreciate having fresh eyes on it |
06:34:28 | * | xbello joined #nim |
06:35:10 | FromDiscord | <Elegantbeef> Yea you can use either the macro cache or some other variable for storing module names |
06:35:47 | * | xbello quit (Client Quit) |
06:49:14 | PMunch | Hmm, what would be the easiest way to have an interactive curve thing. Something like this: https://www.theinsidetips.com/wp-content/uploads/2020/04/Curves_01.jpg |
06:57:44 | PMunch | Hmm, looks like I might need to write this myself in SDL or something.. |
07:12:17 | fn | <hoijui> Elegantbeef, got it working! wow.. it looked har at first but was surprisingly easy! thank you! |
07:12:31 | FromDiscord | <Elegantbeef> No problem! |
07:12:33 | fn | <hoijui> never used macros before |
07:12:47 | fn | <hoijui> :-) |
07:13:31 | fn | <hoijui> luckily I fond some macro tutorial that mentioned `dumpTree()`, which was essential for figuring things out |
07:21:24 | FromDiscord | <Elegantbeef> Yea it's very useful for solving macro woes |
07:21:51 | FromDiscord | <Elegantbeef> `treeRepr`, `dumpTree`, and `repr` are very very useful for debugging/reasoning around macros |
07:28:52 | PMunch | hoijui, that wouldn't happen to be my tutorial would it? |
07:29:02 | FromDiscord | <Elegantbeef> Hope it's mine |
07:29:10 | FromDiscord | <Elegantbeef> It's certainly not mine π |
07:29:22 | PMunch | Do you have a macros tutorial? |
07:29:52 | FromDiscord | <Elegantbeef> I have the one write up but nothing much |
07:33:12 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
07:37:20 | fn | <hoijui> it was this tutorial/example: https://nim-lang.org/blog/2018/06/07/create-a-simple-macro.html |
07:41:56 | fn | <hoijui> i did a web-search, opened 5 links , and looked at just one of them, so it was a quite random choice |
07:42:39 | fn | <hoijui> is there a macro that takes code as argument, and outputs the source code of a macro that generates that code? |
07:43:06 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html#quote%2Ctyped%2Cstring |
07:43:32 | FromDiscord | <Elegantbeef> Let's you write macros akin to templates |
07:43:36 | fn | <hoijui> all by itsself it woudl not be very useful of course, but it could form a base for a macro, where one just needs to replace some static strings with paramters, and adding a loop here and there |
07:43:44 | fn | <hoijui> ok ... |
07:46:58 | FromDiscord | <Elegantbeef> Atleast i think that's what you mean |
07:47:14 | FromDiscord | <Elegantbeef> There is also the `astgenrepr` |
07:48:03 | fn | <hoijui> Elegantbeef, I think it is not what I mean |
07:48:03 | PMunch | Yeah astGenRepr sounds more like what they asked for |
07:48:15 | fn | <hoijui> looking at `astgenrepr` now ... |
07:48:54 | * | max22- joined #nim |
07:50:18 | * | Schnouki quit (Quit: WeeChat 3.2) |
07:55:08 | fn | <hoijui> I think, `astgenrepr` is almost what I mean, but I would have to prepare the arguemnt somehow.. |
07:56:00 | fn | <hoijui> what I want is this (I think): `echo astgenrep(someProc(let i = 3))` |
07:56:25 | FromDiscord | <Elegantbeef> Dont quite follow |
08:00:31 | PMunch | Well astGenRepr is more intended to see what you need to write to create a macro, and then copy that into your program |
08:03:52 | fn | <hoijui> `dumpTree(check(registry, runState))` -> Call |
08:03:52 | fn | <hoijui> Ident "check" |
08:03:53 | fn | <hoijui> Ident "registry" |
08:03:53 | fn | <hoijui> Ident "runState" |
08:03:57 | fn | <hoijui> `astGenRep(check(registry, runState))` -> |
08:03:57 | fn | <hoijui> macro NAME*(): untyped = |
08:03:57 | fn | <hoijui> newStmtList( |
08:03:58 | fn | <hoijui> newNimNode(nnkCode).add( |
08:04:00 | fn | <hoijui> ident("check"), |
08:04:02 | fn | <hoijui> ident("registry"), |
08:04:04 | fn | <hoijui> ident("runState"), |
08:04:06 | fn | <hoijui> ), |
08:04:08 | fn | <hoijui> ) |
08:04:10 | fn | <hoijui> the first one works |
08:04:15 | fn | <hoijui> the second one is what I would want |
08:04:15 | PMunch | Please don't paste data into IRC |
08:04:20 | fn | <hoijui> (more or less) |
08:04:26 | PMunch | It spams the channel quite abit |
08:04:34 | fn | <hoijui> :/ sorry |
08:04:41 | fn | <hoijui> pastebin |
08:04:50 | FromDiscord | <Elegantbeef> Or nim playground π |
08:05:04 | FromDiscord | <Elegantbeef> I dont see the point templates already give you this |
08:06:34 | FromDiscord | <mantielero (mantielero)> Hi all. Quick question. |
08:06:59 | FromDiscord | <mantielero (mantielero)> I am wrapping a CPP method with\: `proc typeName(this:Mx): string {.importcpp: "#.type_name()".}` |
08:07:16 | FromDiscord | <Elegantbeef> Like this seems similar to what you want hoijui https://play.nim-lang.org/#ix=3r3X |
08:07:24 | FromDiscord | <mantielero (mantielero)> and I am gettig the error\: error\: cannot convert βstd\:\:stringβ {aka βstd\:\:\_\_cxx11\:\:basic\_string\<char\>β} to βvoid\β |
08:07:56 | FromDiscord | <Elegantbeef> well string is Nim's string, so the CPP method is almost certainly not going to return that |
08:08:04 | PMunch | Nim `string` is certainly not compatible with whatever C++ strings are |
08:08:18 | PMunch | You probably want it to return `cstring` instead |
08:08:18 | FromDiscord | <mantielero (mantielero)> I have tried `cstring`as well |
08:08:56 | PMunch | And what did that give you? |
08:09:49 | FromDiscord | <mantielero (mantielero)> sent a long message, see http://ix.io/3r3Y |
08:10:21 | FromDiscord | <mantielero (mantielero)> It works with the type\: `CppString {.importcpp: "std::string", header: "<string>", byref.} = object` |
08:10:55 | * | saem[m] joined #nim |
08:11:08 | FromDiscord | <mantielero (mantielero)> But I was expecting using `cstring`. I tried `string`because that was what c2nim gave me. |
08:12:36 | FromDiscord | <mantielero (mantielero)> The line that I am wrappin\: https://github.com/casadi/casadi/blob/12fa60f676716ae09aa2abe34c1c9b9cf426e68a/casadi/core/mx.hpp#L84 |
08:36:03 | fn | <hoijui> Elegantbeef, I am not sure I understand what this does, but I am almost certain it is not what I want. |
08:36:50 | fn | <hoijui> I want to have macro code (as string) that generates an AST that does the same like the code I supplied |
08:37:09 | fn | <hoijui> in itsself, that is not useful, as you could just.. write the code directly |
08:37:24 | fn | <hoijui> but you can then use this macro code as a base, and start modularizing it |
08:37:49 | fn | <hoijui> so it basically just automates part of the macro-writing process |
08:38:52 | FromDiscord | <haxscramper> You need to `importcpp` `std::string` as well |
08:39:04 | fn | <hoijui> instead of dumpTree, one would use this macro instead, so adding "nkk" in front of things, and putting `newNimNode` in between and so on, would not have to be done manually |
08:39:09 | FromDiscord | <haxscramper> There is a wrapper for some C++ stdlib parts actually, so you can use this |
08:39:34 | FromDiscord | <haxscramper> https://github.com/sinkingsugar/nimline or https://github.com/Clonkk/nim-cppstl |
08:39:36 | fn | <R2D2> itHub: 7"Wrapper-less C/C++ interop for Nim" |
08:39:49 | FromDiscord | <haxscramper> First also has a lot of helper stuff for wrapping C++ code |
08:40:10 | PMunch | Sounds a lot like `quote do` to me hoijui, or possibly something from macroutils |
08:40:52 | FromDiscord | <mantielero (mantielero)> I tried\: https://github.com/Clonkk/nim-cppstl/blob/49399f79c2a6bfed132f9fe71dea280e10dd4899/cppstl/std_string.nim#L126 |
08:41:16 | FromDiscord | <mantielero (mantielero)> Everything compiles fine, but I cannot see the result |
08:41:44 | fn | <hoijui> yeah.. I am sure it already exists. I think astgenrep is pretty close |
08:42:09 | fn | <hoijui> it just won;t take code as input, but wants NimNode |
08:42:44 | FromDiscord | <Elegantbeef> `parsestmt` and `parseExpr` also might be what you want |
08:42:55 | FromDiscord | <Elegantbeef> I'm a little loss so just throwing stuff and seeing what sticks \:D |
08:43:57 | FromDiscord | <haxscramper> > β΅> cannot see the resultβ΅> Nothing is returned on the nim side?β΅> |
08:44:09 | FromDiscord | <haxscramper> > cannot see the resultβ΅Nothing is returned on the nim side? |
08:44:24 | FromDiscord | <mantielero (mantielero)> I just get\: "" |
08:44:52 | FromDiscord | <mantielero (mantielero)> The cpp code is `static std::string type_name() {return "MX";}` |
08:45:08 | FromDiscord | <mantielero (mantielero)> I don't know why I don't get "MX". |
08:45:25 | FromDiscord | <mantielero (mantielero)> And why `cstring` is not working. |
08:46:12 | FromDiscord | <haxscramper> Because `cstring` is not an `std::string` |
08:46:43 | FromDiscord | <haxscramper> And you are wrapping static method, I think you need to use `importcpp: "class::staticMethod()` instead |
08:47:11 | FromDiscord | <mantielero (mantielero)> What is `cstring` in CPP context? |
08:47:26 | FromDiscord | <mantielero (mantielero)> Or is it only for the C backend? |
08:48:03 | fn | <hoijui> Elegantbeef, the parse* procs are .. I think also close, but they take string as input instead of code |
08:48:09 | FromDiscord | <haxscramper> `cstring` is a `char` |
08:48:09 | FromDiscord | <haxscramper> For both C++ and C |
08:48:39 | fn | <hoijui> is htere no proc that takes code as input and returns a NimNode for that code? |
08:48:49 | FromDiscord | <haxscramper> `std::string` is a C++ stdlib-only class so that is not universally used in the C++, so it makes no sense to work with it by default |
08:49:03 | FromDiscord | <mantielero (mantielero)> Understood |
08:49:11 | FromDiscord | <Rika> hoijui didnt someone already say to look at `quote` in the `macros` module |
08:49:18 | FromDiscord | <mantielero (mantielero)> I tried\: `proc typeName(this:Mx): CppString {.importcpp: "casadi::MX::type_name()".} # cdecl,` |
08:49:37 | FromDiscord | <mantielero (mantielero)> Compiles, but I get an empty string |
08:51:18 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3r49 |
08:51:21 | FromDiscord | <haxscramper> Works fine |
08:51:51 | FromDiscord | <haxscramper> I should've used `StdString` for the name instead of `CString` to avoid confusion though |
08:52:14 | fn | <hoijui> Rika, ahaa.. not I got it! :D yeap thanks! |
08:52:41 | fn | <hoijui> `static: echo astGenRepr(quote do: check(registry, runState))` |
08:52:46 | fn | <hoijui> this works! |
08:53:05 | FromDiscord | <Elegantbeef> So ignore me is what we're doing today hoijui π |
08:53:17 | FromDiscord | <haxscramper> idk why `cpp-stl` does `const_cast<char> on the `c\_str()\` results, but I suppose this is unrelated |
08:54:09 | fn | <hoijui> :D :D Elegantbeef, sorry! I was looking at quote as something that does what I want, but it just does the preparation step .. I could not see it fitting |
08:54:10 | FromDiscord | <haxscramper> > β΅> const\_cast makes it possible to form a reference or pointer to non-const type that is actually referring to a const object or a reference or pointer to non-volatile type that is actually referring to a volatile object. Modifying a const object through a non-const access path and referring to a volatile object through a non-volatile glvalue results in undefined behavior.β΅> |
08:54:11 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=3r4a |
08:54:22 | FromDiscord | <Elegantbeef> Lol it's fine |
08:54:32 | FromDiscord | <haxscramper> Most likely it is to avoid compilation errors on the nim side, since it might be the only option |
08:54:43 | FromDiscord | <haxscramper> As nim does not have type-level immutability |
08:55:03 | fn | <hoijui> :-) |
08:55:04 | FromDiscord | <Rika> lets all ignore beef lmaooooo |
08:55:07 | FromDiscord | <haxscramper> So it is either UB or `const_cast` |
08:55:21 | FromDiscord | <Elegantbeef> Wait you dont ignore me rika? |
08:55:43 | FromDiscord | <Rika> i said "lets all ignore" implying im inviting everyone else to do so |
08:56:07 | FromDiscord | <Elegantbeef> I tricked you into responding to me, you failed! |
08:56:45 | FromDiscord | <Rika> funny |
08:56:46 | FromDiscord | <Rika> i laughed |
09:09:29 | PMunch | @hoijui, you can also have a look at dumpAstGen which does the same as your code |
09:10:28 | fn | <Prestige> what's up hoijui :) nice to see you here |
09:10:51 | fn | <hoijui> Prestige, hey.. who are you? :D |
09:11:15 | fn | <Prestige> just another irc user in this chat haha. I also wrote the relay bot, working on nick colors now.. |
09:11:53 | fn | <Prestige> oh and also wrote R2D2, can !eval code with it. I wonder if that'll conflict with the bot on libera |
09:12:19 | fn | <hoijui> PMunch, indeed! :-) same thing! (just the generated symbol names differ, which makes no difference) |
09:12:54 | fn | <Prestige> PMunch: can you !eval some code on your end for me? |
09:13:07 | PMunch | !eval echo "Hello Prestige" |
09:13:08 | fn | <hoijui> ah.. I though we know each other from somewhere else, Prestige |
09:13:10 | NimBot | Hello Prestige |
09:13:10 | fn | <R2D2> Hello Prestige |
09:13:21 | fn | <Prestige> aha |
09:13:28 | fn | <Prestige> I should change that for this channel |
09:13:44 | FromDiscord | <Elegantbeef> Nah it's a feature |
09:13:45 | FromDiscord | <Elegantbeef> Double speak! |
09:14:37 | FromDiscord | <Elegantbeef> I think that's what orwell meant atleast |
09:14:42 | fn | <hoijui> ahh the relay bot.. nice! :-) what tech is the original chat made of? |
09:15:34 | FromDiscord | <Elegantbeef> I think most of the normal chat is biotic, might be a few NPCs about |
09:15:35 | fn | <Prestige> They're on discord and another irc network, I think also on matrix still? |
09:16:07 | * | max22- quit (Ping timeout: 246 seconds) |
09:16:50 | FromDiscord | <Elegantbeef> There are many bridges, but we dont cross them cause they're heavily guarded |
09:17:13 | FromDiscord | <Elegantbeef> \I just hope atleast one person gets the SG1 reference |
09:19:45 | PMunch | Did the bridge to Freenode die? |
09:19:54 | fn | <hoijui> :D |
09:20:05 | fn | <Prestige> *crickets* |
09:20:06 | fn | <hoijui> I am on freenode, and I think Prestige too |
09:20:10 | FromDiscord | <Elegantbeef> When they killed freenode it did, if that's what you mean |
09:20:27 | FromDiscord | <Elegantbeef> Libera is the new home for Nim-irc, these heathens are heathens |
09:20:40 | PMunch | Wait.. |
09:20:45 | fn | <hoijui> what happened to freenode? enemy takeover? |
09:20:49 | PMunch | When I type on Freenode it doesn't get relayed here |
09:20:57 | PMunch | Am I shadowbanned on Freenode? |
09:21:05 | fn | <Prestige> I didn't see you type on freenode |
09:21:27 | FromDiscord | <Elegantbeef> 1 too many liberachat messages |
09:21:27 | fn | <hoijui> mmm... strange. I see you here |
09:21:42 | FromDiscord | <Rika> have you forgotten that they wiped the db |
09:21:48 | FromDiscord | <Rika> so you have to reregister, i believe |
09:21:53 | fn | <hoijui> aha |
09:21:55 | fn | <Prestige> correct |
09:22:13 | fn | <hoijui> sliped my mind for a moment |
09:22:24 | PMunch | This is what it looks like to me: https://uploads.peterme.net/shadowbanned.png |
09:22:37 | PMunch | Wait what? |
09:22:46 | PMunch | They deleted all Freenode users? |
09:22:57 | FromDiscord | <Elegantbeef> Yep |
09:23:01 | FromDiscord | <Elegantbeef> Hence the sudden move to libera |
09:23:10 | FromDiscord | <Elegantbeef> Users + servers iirc |
09:23:53 | fn | <hoijui> why do you see PMunch as an IRC user instead of as a "remote" one? |
09:23:55 | fn | <hoijui> on IRC |
09:23:58 | PMunch | I thought the whole point was to get access to all the users.. |
09:24:06 | fn | <hoijui> and.. you DO see me there |
09:24:06 | FromDiscord | <zetashift> In reply to @PMunch "This is what it": very nice colorscheme tho |
09:24:08 | PMunch | Because I om on IRC |
09:24:09 | PMunch | :P |
09:24:23 | PMunch | Oh well, I have to run |
09:24:35 | FromDiscord | <Elegantbeef> And i have to sleep |
09:24:39 | fn | <hoijui> I am on IRC too, and PMunch to me is not on IRC |
09:24:44 | PMunch | @zetashift, it's based on the same colourtheme that's used for the Nim website code snippets |
09:24:44 | FromDiscord | <zetashift> good run and good night! |
09:25:01 | * | PMunch quit (Quit: leaving) |
09:25:05 | FromDiscord | <zetashift> Dracula? |
09:25:25 | FromDiscord | <zetashift> it doesn't resemble it at first glance |
09:26:13 | fn | <Prestige> Oh PMunch can you link me that repo |
09:26:20 | FromDiscord | <dom96> honestly, you should all move to Libera |
09:26:24 | fn | <Prestige> I didn't see your message till the screenshot |
09:26:24 | FromDiscord | <dom96> no reason not to |
09:26:59 | FromDiscord | <Elegantbeef> You're not my real mom dom, you cannot tell me how to live |
09:27:35 | fn | <Prestige> dom96 or everyone come back to freenode, or we could start our own irc network :P |
09:27:44 | FromDiscord | <Rika> dommom |
09:27:44 | fn | <Prestige> or we could all move to matrix, or... |
09:27:54 | FromDiscord | <dom96> bruh, you're not even on IRC |
09:27:58 | FromDiscord | <Rika> domomdom |
09:28:27 | FromDiscord | <dom96> Yep, I'm the dominant mom of this channel |
09:28:45 | FromDiscord | <dom96> only my britishness cannot help but want to write _mum_ |
09:29:36 | FromDiscord | <dom96> happy friday btw π |
09:30:00 | FromDiscord | <tomck> Is there any reason why the options `some` function doesn't take a `sink T` parameter? it seems to want to copy `T` all the time, & it magically works if I change `T` to `sink T` |
09:45:47 | FromDiscord | <dom96> @Araq Any ideas about above? |
09:53:22 | FromDiscord | <gerwy> i will probably be making some small app to display and play around with Cellular Automatas in nimβ΅How should i name it? |
09:57:21 | FromDiscord | <gerwy> nimca? |
09:57:25 | FromDiscord | <dom96> nooo |
09:57:32 | FromDiscord | <dom96> it should have no nim in the name |
09:57:37 | FromDiscord | <dom96> too many projects with a nim prefix |
09:58:06 | FromDiscord | <dom96> First name that comes to mind: AutomataOverlord |
09:58:42 | fn | <hoijui> Elegantbeef, regarding your maverick bot ... |
09:58:57 | fn | <hoijui> I just saw, that you do . basically what I woudl want, I think |
09:59:08 | fn | <hoijui> you have a dir with commands |
09:59:21 | fn | <hoijui> and you import all of them with a macro |
09:59:22 | FromDiscord | <zetashift> Tomatas! |
09:59:41 | FromDiscord | <gerwy> In reply to @dom96 "it should have no": why, you don't like when things are associated with nim? I think its pretty cool and cute that so many projects have this |
09:59:48 | FromDiscord | <Rika> its dull |
09:59:49 | fn | <hoijui> I then run an other macro to register them to my... commands registry |
10:00:05 | FromDiscord | <Rika> nim-xxx nimxxx xxxnim xnimx gets old really quickly |
10:00:19 | FromDiscord | <dom96> I don't like having dozens of projects that begin with nim and then my `cd nim` tab complete failing heh |
10:00:28 | FromDiscord | <Rika> they can always just see the language its written in in the languages bar thing of github |
10:00:32 | fn | <hoijui> you seem not to have to do that... why not? how do the commands become effective/usable? |
10:01:04 | FromDiscord | <gerwy> well for your context i think it will be just to play around with β΅Game of Lifeβ΅Ants and Rule Xβ΅and maybe, just maybee i will add option to make your own CA with custom rules and states |
10:01:29 | FromDiscord | <gerwy> In reply to @dom96 "I don't like having": but you don't download all projects made in nim right? right? |
10:01:55 | FromDiscord | <dom96> I download enough that it annoys me that too many begin with `nim` lol |
10:02:01 | FromDiscord | <gerwy> In reply to @zetashift "Tomatas!": thats nice, but i think it has too much to do with tomato and people could get confused haha |
10:02:15 | FromDiscord | <tomck> I have lots of `nim-xxx` clones too, it's annoying, suffix with nim instead |
10:02:20 | FromDiscord | <gerwy> ah i understand, well i can always change its name i guess |
10:03:30 | fn | <hoijui> ahh.. I think you create a table with commands somewhere, right, Elegantbeef |
10:03:45 | FromDiscord | <Rika> In reply to @tomck "I have lots of": i'm not for suffixes either |
10:04:14 | FromDiscord | <Rika> just dont put it, it's going to be obvious its a nim project because the language is listed as well on github anyway |
10:04:32 | FromDiscord | <Rika> even worse if you put it on the nimble package name |
10:04:51 | FromDiscord | <gerwy> lol i could call it Edumata |
10:04:54 | FromDiscord | <gerwy> or just mata |
10:04:57 | FromDiscord | <gerwy> ta |
10:05:15 | FromDiscord | <Rika> eh |
10:05:29 | FromDiscord | <gerwy> mata seems fine |
10:05:32 | FromDiscord | <tomck> dunno about you but i often remake projects in different languages when they're non-trivial, so i play about with it in common lisp (and name it XXX-cl) then move to some other lang (and name it XXX-nim) |
10:05:54 | FromDiscord | <gerwy> CA-nim |
10:05:57 | FromDiscord | <gerwy> na |
10:06:00 | FromDiscord | <gerwy> (edit) "na" => "nah" |
10:06:22 | FromDiscord | <gerwy> it sounds like some american anti-terrorist forces |
10:06:43 | FromDiscord | <tomck> If i want to edit nim's stdlib for a project, but I don't want to change the compiler, what're my options |
10:06:56 | FromDiscord | <tomck> ideally i'd rather not fork the compiler & have to build a fresh one just to build my project |
10:07:12 | FromDiscord | <Araq> @tomck we haven't updated the stdlib with `sink` annotations all that much yet. |
10:07:24 | FromDiscord | <Araq> we had sink parameter inference instead but it's flawed |
10:07:33 | FromDiscord | <Araq> and so mostly disabled |
10:07:49 | FromDiscord | <tomck> @Araq Ah ok yeah i figured, can i just add it then (?) unsure what the process for getting this merged would be, it's a semi-blocker on my current project |
10:07:57 | FromDiscord | <gerwy> also i want this project to be a little more maintainable so i would like to use nimble and allβ΅β΅is there any nice nimble tutorial? |
10:08:01 | FromDiscord | <Araq> PRs are accepted |
10:08:11 | FromDiscord | <Rika> In reply to @tomck "If i want to": copy the files into another folder and use it like a normal module? |
10:08:38 | FromDiscord | <tomck> yeah but then if i import `options`, that'll just import the stdlib (right?) |
10:08:49 | FromDiscord | <Rika> uh, no i mean |
10:09:00 | FromDiscord | <Rika> stdlib as a module, not as a collection of modules |
10:09:06 | FromDiscord | <Rika> so you do import std2/options |
10:09:28 | FromDiscord | <Rika> (and you can force it with import pkg/options anyway but thatll clobber with other peoples packages called options) |
10:09:34 | FromDiscord | <zetashift> https://github.com/disruptek/disruptek/blob/master/style.md#packaging reminds me of this |
10:09:35 | FromDiscord | <zetashift> `Don't use .nim or nim- or nim in your package name; we all know it's nim, that's why we're here -- use keywords if you want to influence search results.` |
10:09:36 | FromDiscord | <planetis> none i guess, try it and make a PR, also use .nodestroyβ΅(@tomck) |
10:09:36 | FromDiscord | <mantielero (mantielero)> > So it is either UB or `const_cast`β΅Finally it worked. Thanks. |
10:09:39 | FromDiscord | <tomck> yeah but then if i interface with other libs that use the normal stdlib options i'm fucked because i'll have to convert between std2 and std |
10:09:57 | FromDiscord | <Rika> theres no way around that |
10:10:12 | FromDiscord | <tomck> planetis: what does nodestroy do? i struggled to understand from the docs |
10:10:26 | FromDiscord | <tomck> @Rika what i really want is to just swap out the stdlib on the compiler, is there a flag for that |
10:10:33 | FromDiscord | <Rika> if you want to change a single proc just make a "procname2" and use that |
10:10:39 | FromDiscord | <Rika> uh |
10:10:42 | FromDiscord | <Rika> not that i know of? |
10:10:51 | FromDiscord | <Rika> maybe check the nimc docs |
10:11:00 | FromDiscord | <Rika> https://nim-lang.org/docs/nimc.html |
10:11:11 | FromDiscord | <tomck> there's a flag to change the 'system library path', `--lib`, not sure what that means |
10:11:18 | FromDiscord | <tomck> oh i could settle for a `some2` for now |
10:11:25 | FromDiscord | <Rika> sounds like thats what you want? |
10:11:31 | FromDiscord | <planetis> its forces the compiler not to write destructor calls |
10:11:47 | FromDiscord | <tomck> problem is all the fields of `Option` are private, is there any way to bypass that? |
10:12:02 | FromDiscord | <tomck> planetis: i don't think that's what i want, i just want to force a move |
10:12:08 | FromDiscord | <Rika> you can |
10:12:22 | FromDiscord | <planetis> only in its scope |
10:12:27 | FromDiscord | <Rika> copy option type, name it idk option2, cast, then do whatever, then cast back |
10:12:35 | FromDiscord | <zetashift> well it's just a guideline not a rule, I think that naming scheme works too if you're a polyglotβ΅(@tomck) |
10:12:35 | FromDiscord | <Rika> ofc hacky |
10:12:39 | FromDiscord | <Rika> has cast, so dangerous |
10:13:14 | FromDiscord | <tomck> planetis: oh cool, does a `nodestroy` var use `copy=` still? because i'm deleting that, that's the issue. Maybe `shallowCopy` works (??) |
10:13:38 | FromDiscord | <tomck> lmao ok i'll have a think about the whole cast thing |
10:14:09 | FromDiscord | <Rika> In reply to @tomck "dunno about you but": personally as im a massive weeb i name my projects over names of the (semi-)fictional girls i like so i have plenty of name options |
10:14:19 | FromDiscord | <dom96> just clone the compiler and fix it, if you're using Nim seriously you should have a devel check out anyway |
10:14:41 | FromDiscord | <tomck> yeah i just don't want to have to use devel for this project for the next N months |
10:14:56 | FromDiscord | <dom96> In reply to @Araq "we had sink parameter": will it get fixed or are we just destined to have sink annotations everywhere? |
10:16:05 | FromDiscord | <tomck> honestly i like sink annotations, sink inference feels a bit hands off to meβ΅If there was a way to bypass module name scopes, it'd be easy enough to have per-project reimplementations of functions that're missing `sink` in the stdlib |
10:18:05 | FromDiscord | <dom96> sink annotations are coming too close to Rust's lifetime annotations to me |
10:18:34 | FromDiscord | <dom96> but I suppose it is still just an optimisation rather than a strict requirement |
10:19:29 | FromDiscord | <tomck> ehh i dunno, nim does it the other way - assume everything is a borrow, annotate a move, & then just silently copy if something goes wrong |
10:19:45 | * | Torro joined #nim |
10:19:55 | FromDiscord | <tomck> it's still pretty frictionless, we're not quite at `Foo<'a, Bar<'a>>` just yet lol |
10:22:18 | FromDiscord | <tomck> hmmm so I've copied the stdlib into my project, and i'm pointing to itt with `--lib:custom-stdlib/`, but it's still finding `options` in the original place |
10:22:26 | FromDiscord | <tomck> does anyone know what the `--lib` flag on the compiler does? |
10:23:08 | FromDiscord | <haxscramper> `--lib:PATH set the system library path` |
10:23:13 | FromDiscord | <haxscramper> `nim --fullhelp` |
10:23:39 | FromDiscord | <haxscramper> For nim modules use `--path`, this is for dynamic libraries I think |
10:23:55 | arkanoid | I'm headed to learning how to acquire some of the benefits of functional programming into nim. I'm talking about side-effects-free core logic while pushing stateful stuff on the edge. I'm currently forcing myself using "let" and "func" instead of "var" and "proc" in core logic. What else can I ask nim to do for me? Any idea? |
10:24:38 | FromDiscord | <Rika> experimental strict funcs? |
10:24:42 | FromDiscord | <planetis> why would you delete copy, then enable it explicitly?, can you .error sink instead? |
10:24:43 | FromDiscord | <planetis> ok youre copying rusts design |
10:24:43 | FromDiscord | <planetis> why would you delete copy, then enable it explicitly? |
10:24:44 | FromDiscord | <planetis> do --expandarc\:some and find outβ΅(@tomck) |
10:24:51 | FromDiscord | <haxscramper> In reply to @arkanoid "I'm headed to learning": https://github.com/arnetheduck/nim-result https://github.com/zero-functional/zero-functional |
10:24:52 | fn | <R2D2> itHub: 7"Friendly, exception-free value-or-error returns, similar to Option[T]" |
10:25:56 | FromDiscord | <tomck> planetis: because disabling copy for certain things is very useful, you see it in c++ all the time |
10:26:10 | FromDiscord | <haxscramper> `.raises[].` annotations can be used to avoid exceptions as well |
10:27:09 | FromDiscord | <planetis> ok i get itβ΅(@tomck) |
10:27:12 | FromDiscord | <tomck> Oh ok i figured it out, `--lib` works to set the stdlib path, but you need to pass the flag earlier (??), i think it was getting consumed by my application rather than the compilerβ΅β΅So `nim c --lib:/foo -r src/code.nim` will point the stdlib to `/foo`, so that's all fixed |
10:28:58 | * | saem[m] quit (Quit: Bridge terminating on SIGTERM) |
10:29:20 | FromDiscord | <tomck> haxscramper: what does .raises[]. do? |
10:29:58 | FromDiscord | <Rika> ensures no exceptions are raised |
10:30:04 | * | max22- joined #nim |
10:30:58 | * | Clonkk[m] joined #nim |
10:31:24 | FromDiscord | <Rika> and are unhandled |
10:31:36 | * | Zoom[m] joined #nim |
10:31:36 | * | saem[m] joined #nim |
10:31:36 | * | nixfreak_nim[m] joined #nim |
10:31:36 | * | Helios joined #nim |
10:32:29 | FromDiscord | <tomck> oh i see, cool |
10:32:43 | FromDiscord | <tomck> whilst I'm here, is there any way to get Table to return an Option or equivalent? |
10:33:05 | FromDiscord | <tomck> i see it has `getOrDefault`, but the type I have in `Table` has no proper 'default' value |
10:33:26 | FromDiscord | <tomck> I don't really want to catch an exception because it's in a pretty tight loop, unless nim does weird optimisations with exceptions i'm unaware of |
10:33:30 | FromDiscord | <Rika> not that i know of currently |
10:33:42 | FromDiscord | <tomck> ripβ΅guess i have a custom stdlib now though lol |
10:33:43 | FromDiscord | <Rika> nim exceptions are relatively fast i think? |
10:34:32 | FromDiscord | <tomck> i'm sure they are, i just don't know how it'd mess with stuff in a tight loop |
10:34:55 | FromDiscord | <tomck> would a PR be accepted to add an Option alternative, or do we want to keep the modules as separate as possible |
10:36:41 | FromDiscord | <Rika> idk search it first then try it |
10:37:45 | FromDiscord | <planetis> they are goto based |
10:38:18 | * | Epsilon quit (Remote host closed the connection) |
10:38:33 | * | Epsilon joined #nim |
10:44:58 | FromDiscord | <planetis> also can you please make a benchmark with your alternative too? In my experience returning an option would be slower, but not sure vs exceptions |
10:46:32 | FromDiscord | <Araq> I recently benchmarked exceptions vs Option[T] and exceptions (via --exceptions:goto) where faster |
10:46:49 | FromDiscord | <Araq> for my benchmark anyway, of course. |
10:46:58 | FromDiscord | <planetis> also why make a fork of stdlib while a adding sink pr are merged on the same day? |
10:48:45 | FromDiscord | <tomck> interesting, i'll make a benchmark for it then, i have no idea how goto exceptions work |
10:48:58 | FromDiscord | <tomck> b/c i don't want to have to get a devel build of the compiler just to compile my project |
10:50:17 | FromDiscord | <planetis> it doesnt suprise me, so not going to question it |
10:52:01 | FromDiscord | <planetis> options just add even more states to my code for no benefit so tend to not use them |
10:53:11 | arkanoid | Rika, thanks. Didn't know about experimental strict funcs |
10:53:23 | FromDiscord | <Rika> yeah its relatively new |
11:00:01 | * | Torro quit (Quit: leaving) |
11:27:19 | FromDiscord | <planetis> In old nim you had to use "if hasKey\:" before "table[key]" (and afaik was the reason for the withValue template), now you can just use "try\: except ValueEror\:", thats actually a big improvement. Congratulations Araq! |
11:41:23 | FromDiscord | <mantielero (mantielero)> I am playing for the first time with `nimline`. How would you do this? |
11:41:30 | FromDiscord | <mantielero (mantielero)> sent a long message, see http://ix.io/3r4U |
11:41:49 | FromDiscord | <mantielero (mantielero)> \`\`\`c++ |
11:42:32 | FromDiscord | <mantielero (mantielero)> sent a code paste, see https://play.nim-lang.org/#ix=3r4V |
11:42:34 | FromDiscord | <mantielero (mantielero)> (better now) |
11:43:26 | FromDiscord | <vindaar> I'm gonna stick to `hasKey` and manually adding (or `hasKeyOrPut` directly) over try / except π
|
11:45:23 | * | fn quit (Remote host closed the connection) |
11:45:28 | FromDiscord | <haxscramper> https://github.com/sinkingsugar/nimline/blob/703d6aec1f466a3ccbc757243185ea7349f7345c/README.md#constructors-and-destructors I think you can use `cppnewref` |
11:45:32 | FromDiscord | <haxscramper> In this case at least |
11:45:40 | * | fn joined #nim |
11:47:15 | FromDiscord | <haxscramper> Although I suspect it is broken for namespaced classes |
11:49:47 | FromDiscord | <mantielero (mantielero)> sent a code paste, see https://play.nim-lang.org/#ix=3r50 |
11:51:07 | FromDiscord | <haxscramper> Failed how? And if `sym` is a static method you don't need to call on the instance |
11:51:36 | FromDiscord | <haxscramper> I provided an example of how to interface with static methods |
11:53:37 | * | max22- quit (Ping timeout: 246 seconds) |
11:54:08 | FromDiscord | <planetis> I dunno, I was short of asking \:P |
11:56:50 | FromDiscord | <mantielero (mantielero)> Sorry I don't get it (I am not a pro-developer) |
11:59:26 | FromDiscord | <haxscramper> First - you said it failed. How exactly? Compilation error, runtime error, unexpected output? |
12:00:40 | FromDiscord | <mantielero (mantielero)> sent a code paste, see https://play.nim-lang.org/#ix=3r57 |
12:00:49 | FromDiscord | <mantielero (mantielero)> Gotta have lunch now (I'll com back later) |
12:00:53 | FromDiscord | <haxscramper> Second - C++ has notion of static methods that don't require object instance when called, so if `Mx::sym` is a static method (which I assume it is, at least judging from the C++ code you showed earlier) you need to wrap it as `importcpp: "MX::sym"` for a procedure without additional `MX` parameter |
12:05:13 | FromDiscord | <haxscramper> Third - I've looked at the nimline's implementation and I would say that it might be better to wrap some things manually, unless you need to wrap the whole `MX` class (and even in this case I'm not sure if nimline is a good starting point. Seems like it does not provide any means to automatically mass-wrap methods) |
12:05:14 | FromDiscord | <haxscramper> I linked it mostly because it implements `StdString` wrapper that you needed https://github.com/sinkingsugar/nimline/tree/703d6aec1f466a3ccbc757243185ea7349f7345c#standard-library-helpers |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:43 | * | supakeen joined #nim |
12:12:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3r5b |
12:28:43 | * | arkurious joined #nim |
12:31:14 | FromDiscord | <mantielero (mantielero)> Thanks a lot for your clarifications |
12:34:40 | * | fn-test joined #nim |
12:38:43 | fn | <restige99> Is the color of my nick messed up over on libera? |
12:40:11 | fn | <restige99> Was testing using their webchat and it looked off, but it's fine in my irc client |
12:42:20 | FromDiscord | <tomck> sent a long message, see http://ix.io/3r5h |
12:42:42 | FromDiscord | <tomck> Unsure if i'm turning on 'goto exceptions' properly, that's the flag i saw in the article on nim-lang.org |
12:43:16 | * | fn-test quit (Remote host closed the connection) |
12:43:22 | FromDiscord | <tomck> (edit) "http://ix.io/3r5h" => "http://ix.io/3r5i" |
12:43:31 | FromDiscord | <dom96> huh, that's very surprising |
12:44:39 | FromDiscord | <tomck> note it's more like 10x slower than default values, it's only 4x slower when the table has 1mil items, so you get more noise from cache misses b/c it doesn't fit in memory |
12:46:01 | FromDiscord | <tomck> I think i'm not turning on the special exceptions properly, because i'm getting the same performance with/without the `--exceptions:goto` flag |
12:47:32 | FromDiscord | <Araq> you need the -d:release (or -d:danger) switch |
12:47:41 | FromDiscord | <Araq> (edit) "you ... need" added "also" |
12:48:01 | FromDiscord | <Araq> --opt:speed is not gonna cut it, the stack tracing skews all results otherwise |
12:48:08 | FromDiscord | <planetis> @tomck nice |
12:48:51 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=3r5j |
12:49:33 | FromDiscord | <Araq> dunno, benchmarking is hard, also try `--gc:orc` (which implies the goto exceptions) |
12:50:46 | FromDiscord | <tomck> weird, gc:orc and gc:arc are MUCH slower, probably because they inc/dec references |
12:51:35 | FromDiscord | <tomck> what about a proc that returned a pointer to the table value, that way if you care about perf you can do what you want with it & deal with iterator invalidation, but if you don't you just don't touch it |
12:53:14 | * | fn quit (Remote host closed the connection) |
12:53:30 | * | fn joined #nim |
12:59:27 | * | hoijui joined #nim |
13:01:42 | FromDiscord | <planetis> https://play.nim-lang.org/#ix=3r5m wit options |
13:04:05 | FromDiscord | <planetis> so you are benchmarking the extreme senario when is empty |
13:04:26 | FromDiscord | <planetis> ok i had more normal usage in mind |
13:04:36 | FromDiscord | <tomck> the 'extreme' scenario? |
13:04:42 | FromDiscord | <planetis> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/857969394746261564): so you are benchmarking the extreme scenario when is empty |
13:04:42 | FromDiscord | <tomck> it's 50% hits, or should be |
13:05:02 | FromDiscord | <tomck> not all misses - & i don't think all misses is even that extreme |
13:05:23 | FromDiscord | <planetis> oh ok |
13:05:37 | FromDiscord | <planetis> my bad i see setupTestTable now |
13:05:42 | FromDiscord | <planetis> missed it |
13:05:54 | FromDiscord | <tomck> np |
13:06:20 | FromDiscord | <tomck> right i've added an option return to my stdlib copy, i'll setup a PR for that tonight & we shall see, gtg now |
13:07:20 | FromDiscord | <planetis> bye |
13:10:27 | FromDiscord | <planetis> its a bit faster if you remove KeyError |
13:20:40 | * | max22- joined #nim |
13:22:48 | FromDiscord | <planetis> we are basically seeing allocating and deallocating KeyError |
13:35:48 | FromDiscord | <planetis> this is weird right? |
13:35:49 | FromDiscord | <planetis> Screenshot\_20210625\_162942.png https://media.discordapp.net/attachments/371759389889003532/857977382496895006/Screenshot_20210625_162942.png |
13:35:57 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3r5A |
13:36:47 | FromDiscord | <haxscramper> Would it make sense to spend time on placing cursor annotations everywhere or otherwise this might be caused by unnecessary copying that I should try to find? |
13:40:02 | FromDiscord | <offbeat-stuff (offbeat-stuff)> Hi, is there a pragma like {.define(ssl).} that i can use |
13:40:58 | FromDiscord | <haxscramper> no, you need to pass `-d:ssl` from the command line/config file |
13:48:04 | * | hoijui quit (Ping timeout: 244 seconds) |
13:52:11 | FromDiscord | <offbeat-stuff (offbeat-stuff)> actually it is exactly {.define(ssl).} |
13:52:24 | FromDiscord | <offbeat-stuff (offbeat-stuff)> just have to use it just before importing the module |
13:58:32 | FromDiscord | <haxscramper> Ah, it seems I confused recommendation not to do this vs "it does not work" |
13:59:04 | * | hoijui joined #nim |
14:03:17 | FromDiscord | <planetis> anyone knows why sumWithHasKey seems to be twice slower than raising, in that benchmark? only with perf |
14:09:36 | FromDiscord | <planetis> that benchmark is super weird, I changed setupTestTable to be always filled, removed the try block and getting same results |
14:10:06 | FromDiscord | <planetis> https://play.nim-lang.org/#ix=3r5N |
14:11:19 | FromDiscord | <Araq> still a good point, we need to remove these allocations π |
14:11:58 | FromDiscord | <Araq> I wonder why it didn't show up in my benchmark, probably because I test exception propagation, not exception allocation |
14:14:08 | * | SebastianM joined #nim |
14:16:29 | FromDiscord | <planetis> ...and also strstr\_sse was poping up with except KeyError but until i unconfuse myself I don't know how but was that |
14:21:02 | FromDiscord | <leorize> because of how RTTI in arc/orc work |
14:21:22 | FromDiscord | <planetis> my guess is sumWithDefault and sumWithOpt are optimized away so @tomck you weren't benchmarking anything useful |
14:21:30 | FromDiscord | <leorize> `of` is done via a string in the object with every parent in it |
14:21:52 | FromDiscord | <leorize> then Nim uses strstr to scan for the parent |
14:22:18 | FromDiscord | <leorize> it's pretty inefficient tbh |
14:24:21 | * | rockcavera joined #nim |
14:24:21 | * | rockcavera quit (Changing host) |
14:24:21 | * | rockcavera joined #nim |
14:27:00 | fn | <ForumUpdaterBot99> New thread by Tsojtsoj: Is there a built in way to get how high total CPU usage is?, see https://forum.nim-lang.org/t/8155 |
14:30:10 | * | SebastianM quit (Quit: Bye) |
14:33:27 | * | rockcavera quit (Read error: Connection reset by peer) |
14:33:50 | * | rockcavera joined #nim |
14:33:50 | * | rockcavera quit (Changing host) |
14:33:50 | * | rockcavera joined #nim |
14:36:13 | * | Derbycat joined #nim |
14:50:22 | * | notchris_ is now known as notchris |
15:07:38 | * | supakeen quit (Remote host closed the connection) |
15:08:02 | * | supakeen joined #nim |
15:08:54 | FromDiscord | <planetis> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/857988846141833283): my guess is sumWithDefault and sumWithOpt are optimized away so tomck#5836 you weren't benchmarking anything useful (confirmed) |
15:11:38 | FromDiscord | <tomck> planetis: Hmmm how so? it's not like they take 0 time, they take time proportional to how big the table is |
15:12:08 | FromDiscord | <planetis> i confirmed it |
15:12:17 | FromDiscord | <tomck> so what's it spending time doing when it takes 3ms |
15:12:23 | FromDiscord | <planetis> look at the assembly really quick |
15:13:43 | FromDiscord | <tomck> doesn't look optimised away, is there an earlyr eturn or something i'm not spotting? might be optimised away on your compiler, i'm on 1.5.1 |
15:14:22 | FromDiscord | <tomck> oh no, looks like i'm on nightly? i'm on the 1.5.1 tag on gitnim, idk what that means |
15:14:58 | FromDiscord | <planetis> better question is what's your c compiler, mine is clang |
15:15:32 | FromDiscord | <tomck> err i have a bunch, how does nim choose |
15:15:50 | FromDiscord | <tomck> it's either gcc7.5 or clang 9 |
15:16:13 | FromDiscord | <tomck> regardless, it's not optimised away on mine, & i'm seeing 8x slowdown |
15:16:24 | FromDiscord | <tomck> if it was optimised away i'd be seeing like 100000x slowdown |
15:16:55 | FromDiscord | <planetis> --cc\:clang/gcc/.. |
15:16:55 | FromDiscord | <planetis> make it first argument (after nim c ) |
15:16:55 | FromDiscord | <planetis> make it first argument |
15:18:04 | FromDiscord | <planetis> then your are not compiling with -d\:danger |
15:18:08 | FromDiscord | <tomck> yeah it's not optimising it away with clang |
15:18:26 | FromDiscord | <tomck> i tried both danger & release, although i'm not sure i waant to compile with a flag called 'danger' lol |
15:18:51 | FromDiscord | <tomck> yeah under danger on clang it's optimising the default one away |
15:19:31 | FromDiscord | <tomck> not optimising the hasKey check though, i'm still getting 8x slower than haskey, so it's obviously still an issue |
15:19:38 | FromDiscord | <planetis> ok gcc |
15:20:02 | FromDiscord | <tomck> what? |
15:20:44 | FromDiscord | <planetis> im not getting useful numbers |
15:21:21 | FromDiscord | <planetis> either way you need to make sure stuff doesn't get optimized away |
15:26:21 | FromDiscord | <gerwy> how to setup nimble? |
15:27:33 | FromDiscord | <kaushalmodi> In reply to @Life Sucks "how to setup nimble?": It gets installed as part of nim installations.β΅β΅What does a setup mean? |
15:28:01 | FromDiscord | <gerwy> or maybe other wayβ΅what advantages i get when creating nimble project? Does i really need it? |
15:29:34 | FromDiscord | <kaushalmodi> sent a long message, see http://ix.io/3r6h |
15:30:31 | FromDiscord | <kaushalmodi> See https://github.com/nim-lang/nimble#creating-packages for more info. |
15:30:33 | fn | <R2D299> itHub: 7"Package manager for the Nim programming language." |
15:30:47 | FromDiscord | <gerwy> oh right, i thought its easy only if it will be used as module, not if i was making an app |
15:31:06 | FromDiscord | <gerwy> also i already have git repo in that folder :<< |
15:31:11 | FromDiscord | <kaushalmodi> In reply to @Life Sucks "oh right, i": Nimble is useful for lib/app/hybrid packages -- all |
15:31:55 | FromDiscord | <gerwy> ooh i see there are other types of nimble projects |
15:31:57 | FromDiscord | <kaushalmodi> In reply to @Life Sucks "also i already have": That's OK. `nimble init` does the right thing whether you already have a project folder created or not. If you already have a git repo dir, cd to that dir and then do `nimble init`. |
15:31:59 | FromDiscord | <gerwy> thats so coool |
15:33:29 | FromDiscord | <gerwy> so if its an app, i do `binary`? |
15:34:12 | FromDiscord | <kaushalmodi> In reply to @Life Sucks "so if its an": Yes |
15:34:25 | FromDiscord | <gerwy> yaaay okay thank you<3 |
15:36:46 | FromDiscord | <gerwy> oh god i need to choose license too and i have no idea which is the best like always |
15:39:26 | FromDiscord | <kaushalmodi> In reply to @Life Sucks "oh god i need": You might get multiple answers here. I use MIT. |
15:40:20 | FromDiscord | <kaushalmodi> In reply to @Life Sucks "oh god i need": https://choosealicense.com/licenses/ |
15:41:19 | FromDiscord | <gerwy> yeah its probably the best for me, im not good at choosing which is better because i don't see so much difference |
15:42:13 | FromDiscord | <gerwy> but MIT seems right |
16:05:40 | * | Epsilon quit (Remote host closed the connection) |
16:05:58 | * | Epsilon joined #nim |
16:08:16 | FromDiscord | <planetis> @tomck I can confirm your numbers\: https://play.nim-lang.org/#ix=3r6v |
16:32:06 | FromDiscord | <planetis> https://play.nim-lang.org/#ix=3r6C |
16:34:27 | * | beshr quit (Read error: Connection reset by peer) |
16:47:04 | FromDiscord | <emef> are there any automatic source formatters for nim like go fmt or scalafmt? |
16:47:18 | FromDiscord | <emef> there is a nimfmt package on github that is abandoned and doesn't compile |
16:47:27 | FromDiscord | <leorize> nimpretty but it's not opinionated |
16:48:40 | FromDiscord | <emef> thanks will look into that |
16:48:48 | * | vicfred joined #nim |
16:49:21 | FromDiscord | <treeform> I also made `morepretty` that uses nimpretty but goes beyond and is even more opinionated. |
16:50:06 | * | deshordash joined #nim |
16:50:36 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3r6I |
16:50:49 | FromDiscord | <Canelhas> In reply to @treeform "I also made `morepretty`": this one, i assume?β΅https://github.com/treeform/morepretty |
16:50:51 | fn | <R2D299> itHub: 7"Morepretty - like nimpretty but with more stuff." |
16:51:02 | FromDiscord | <leorize> iterable is a typeclass now |
16:52:14 | * | deshordash quit (Remote host closed the connection) |
16:53:24 | * | PersonMcGuy joined #nim |
16:59:09 | PersonMcGuy | Hello, sorry if this a stupid question, but is it possible to have multiple types for the value in a table? i.e. Table[string, int | float] ? |
16:59:30 | FromDiscord | <treeform> It looks like this is the a function I want to work, but it just does not work for walk dir: https://github.com/def-/nim-iterutils/blob/master/src/iterutils.nim#L90 |
17:00:20 | FromDiscord | <treeform> I don't understand what this error is telling me: `Error: attempting to call routine: 'walkDir'β΅ found 'os.walkDir(dir: string, relative: bool, checkDir: bool) [declared in ....' of kind 'iterator'` |
17:05:59 | FromDiscord | <planetis> so this line\: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/tables.nim#L238-L241 makes `[]` 1-1.7x slower than getOrDefault even when not raising |
17:10:43 | FromDiscord | <zetashift> In reply to @PersonMcGuy "Hello, sorry if this": You could use a Variant for that |
17:15:18 | PersonMcGuy | @zetashift Thank you, looking into it now |
17:19:32 | FromDiscord | <hamidb80> i don't get it |
17:19:50 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/858033756073754674/unknown.png |
17:20:15 | FromDiscord | <hamidb80> i ran compile `utils.nim` directly without any error |
17:20:36 | FromDiscord | <hamidb80> but importing it in another module gives me this |
17:20:51 | FromDiscord | <hamidb80> In reply to @hamidb80 "i ran compile `utils.nim`": i can |
17:21:14 | FromDiscord | <tomck> @hamidb80 that's because it's a template |
17:21:28 | FromDiscord | <tomck> so when you call the template, it generated the code that calls mapIt in the module you call the template from |
17:21:37 | FromDiscord | <tomck> so the module you call the template from also needs to import mapIt, i believe (?) |
17:22:00 | FromDiscord | <hamidb80> hmm |
17:22:57 | FromDiscord | <hamidb80> template hygiene .. |
17:24:45 | FromDiscord | <tomck> i don't know if that's 'unhygeinic' |
17:25:41 | FromDiscord | <leorize> add `bind mapIt` to your template |
17:25:59 | FromDiscord | <leorize> then the mapIt symbol will be resolved to the one available at your implementation scope |
17:34:59 | * | vsantana joined #nim |
17:48:32 | * | vsantana1 joined #nim |
17:50:54 | * | vsantana quit (Ping timeout: 244 seconds) |
17:50:54 | * | vsantana1 is now known as vsantana |
17:53:37 | FromDiscord | <kaushalmodi> In reply to @leorize "add `bind mapIt` to": TIL about `bind`: https://nim-lang.github.io/Nim/manual#generics-bind-statement |
17:58:03 | * | PersonMcGuy quit (Quit: https://mibbit.com Online IRC Client) |
18:23:51 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
18:36:36 | * | rockcavera quit (Remote host closed the connection) |
18:36:58 | * | mst joined #nim |
18:40:48 | * | rockcavera joined #nim |
18:40:49 | * | rockcavera quit (Changing host) |
18:40:49 | * | rockcavera joined #nim |
18:44:09 | * | ozzz_ joined #nim |
18:45:28 | * | ozzz quit (Ping timeout: 265 seconds) |
18:48:08 | FromDiscord | <gerwy> In reply to @hamidb80 "": how did you got that crown in VS Code? It looks super cool |
18:49:35 | * | Gustavo6046 joined #nim |
18:58:42 | * | vsantana quit (Ping timeout: 258 seconds) |
19:01:02 | FromDiscord | <Elegantbeef> @gerwy\: https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme |
19:08:04 | * | hoijui quit (Quit: Leaving) |
19:16:13 | FromDiscord | <gerwy> Thank you :O |
19:36:42 | * | cyraxjoe quit (Ping timeout: 265 seconds) |
19:37:07 | * | cyraxjoe joined #nim |
19:38:32 | * | MightyJoe joined #nim |
19:42:06 | * | cyraxjoe quit (Ping timeout: 252 seconds) |
19:45:12 | FromDiscord | <checkersai> In reply to @checkersai "Just curious, is there": Found the answer to my question last night btw for anyone else that's curious: https://nim-lang.org/docs/system.html#compileOption%2Cstring |
19:47:23 | FromDiscord | <Traveler> Hello π , I am exploring nim a bit and I am wondering if anybody could help me pas std::string to nim. How does one achieve this?β΅typeβ΅ String {.importcpp: "std::string", header: "string".} = object This would give me the type, but do I also have to provide a proc for mapping nim strings to string and back? |
19:57:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3r7K |
19:58:39 | FromDiscord | <haxscramper> In reply to @haxscramper "I linked it mostly": There are also couple of libraries that provide `std::string` wrappers |
19:59:07 | FromDiscord | <haxscramper> In reply to @Traveler "Hello π , I": You need to wrap corresponding methods, first example does that for `c_str()` |
20:02:32 | FromDiscord | <Kermithos> does nim has an inbuilt function to convert a bool to an int? |
20:02:44 | FromDiscord | <Kermithos> couldnt find any docs |
20:02:58 | FromDiscord | <@bracketmaster-5a708063d73408ce4> !eval true.int |
20:03:00 | NimBot | Compile failed: /usercode/in.nim(1, 5) Error: expression 'int(true)' is of type 'int' and has to be used (or discarded) |
20:03:21 | FromDiscord | <@bracketmaster-5a708063d73408ce4> !eval echo true.int |
20:03:23 | NimBot | 1 |
20:03:28 | FromDiscord | <Kermithos> ah nice |
20:03:33 | FromDiscord | <Kermithos> I only checked toInt() |
20:03:34 | FromDiscord | <Kermithos> thanks |
20:03:53 | FromDiscord | <@bracketmaster-5a708063d73408ce4> yes - in this case, `int()` is an initializer |
20:09:00 | FromDiscord | <Avahe> Where are people relaying from that are "bots" in discord that isn't irc? |
20:09:23 | FromDiscord | <Traveler> @haxscramper thanks! What libraries do this by default? |
20:09:28 | FromDiscord | <leorize> matrixβ΅(@Avahe) |
20:09:47 | FromDiscord | <Avahe> Oh are there two matrix channels now? |
20:10:04 | FromDiscord | <leorize> there's only one matrix channel that's active |
20:12:43 | FromDiscord | <Traveler> @haxscramper i see in the chat from the first link indeed a similar issue I have that if I bind a class to nim and init it with a cstr the field of that class is empty; I can set it manually, but cannot construct it the way nim types are initialized |
20:14:57 | FromDiscord | <haxscramper> You mean what libraries wrap `std::string`? I think there are several in addtion to what I linker earlierβ΅(@Traveler) |
20:15:08 | FromDiscord | <haxscramper> But I don't use them, so I can't comment really |
20:15:32 | FromDiscord | <haxscramper> You have nim type with `std::string` field and want to construct it on the nim side?β΅(@Traveler) |
20:17:46 | FromDiscord | <haxscramper> Or you have C++-class and your problem is that you can't construct it using `Object(field: <std::string-expression>)` for field init? |
20:20:38 | FromDiscord | <Avahe> Oh I think I'm in the right one now |
20:25:45 | FromDiscord | <Traveler> In reply to @haxscramper "Or you have C++-class": I have a cpp class that I want to use inside nim |
20:26:52 | FromDiscord | <Traveler> It is a super simple class that has a `std::string` as a property. From the docs c_strings are no problem (which I can confirm); but wrapping it is, however i don't want to "reinvent" the wheel if already people have done the heavy lifting π |
20:28:29 | FromDiscord | <Traveler> sent a code paste, see https://play.nim-lang.org/#ix=3r7W |
20:29:18 | FromDiscord | <Traveler> changing the type from `string` to `cstring` in nim type (and cpp class) it works, but im stuborn and want my std::strings to work :P! |
20:29:25 | FromDiscord | <Traveler> also initializing it with cstring yields empty |
20:29:57 | FromDiscord | <Traveler> i.e. `var obj = SomeClass(name: "test"); echo obj.name` yields `''` |
20:30:12 | FromDiscord | <Traveler> but setting it after the fact works normally |
20:31:13 | FromDiscord | <kaushalmodi> In reply to @Traveler "It is a super": Are you looking for this? https://github.com/Clonkk/nim-cppstl/blob/master/cppstl/std_string.nim |
20:31:42 | FromDiscord | <kaushalmodi> See the example usages in https://github.com/Clonkk/nim-cppstl/blob/master/tests/tstring.nim |
20:33:49 | FromDiscord | <Traveler> epic |
20:33:56 | FromDiscord | <Traveler> that looks good thanks @kaushalmodi |
21:06:09 | FromDiscord | <xDd> yo guys are there some objective c tutorials/blog posts i wanna import few libs from objc to nim can someone point me there π |
21:06:46 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importobjc-pragma there is this showcase which should help, but no clue about tutorials |
21:08:09 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I was able to do this sometime ago - how do I access the name of a variable in nim? |
21:08:30 | FromDiscord | <xDd> Thanks @ElegantBeef i see this before but its very basic stuff π |
21:10:27 | FromDiscord | <Elegantbeef> what do you mean access the name of a variable, dump the name into a string? |
21:10:27 | FromDiscord | <@bracketmaster-5a708063d73408ce4> yes |
21:10:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> essentially, I have a proc, and it needs to print the name of the variable passed it |
21:10:45 | FromDiscord | <Elegantbeef> `astToStr` |
21:11:45 | FromDiscord | <Elegantbeef> !eval var a = 100; echo astToStr(a) |
21:11:45 | FromDiscord | <Elegantbeef> Damn nimbot letting me down |
21:11:47 | NimBot | a |
21:11:55 | FromDiscord | <Elegantbeef> Ah actually that doesnt work, that just converts the ident |
21:12:55 | FromDiscord | <Elegantbeef> Even if a wasnt in scope it'd output `a` |
21:13:43 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I remember having to use repr |
21:15:34 | FromDiscord | <Elegantbeef> So you want invoke a proc, and for it to print out the variables names passed in? |
21:15:36 | FromDiscord | <@bracketmaster-5a708063d73408ce4> yeah |
21:15:42 | FromDiscord | <@bracketmaster-5a708063d73408ce4> although proc may not be the way to go |
21:15:56 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I wonder if I'd have to more or less go with macro |
21:19:42 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3r87 |
21:19:42 | FromDiscord | <Elegantbeef> That will only echo out parameters which were passed as variables, so a literal wouldnt be printed |
21:19:42 | FromDiscord | <@bracketmaster-5a708063d73408ce4> hm - that's a neat idea |
21:22:41 | FromDiscord | <Elegantbeef> That's why they keep me around, that and i dont break any rules π |
21:22:42 | FromDiscord | <Elegantbeef> mostly the latter |
21:22:42 | FromDiscord | <@bracketmaster-5a708063d73408ce4> how long have you been nimming? |
21:29:49 | FromDiscord | <Elegantbeef> A year or 2 |
21:29:50 | FromDiscord | <Elegantbeef> I write more macros than probably good for my health |
21:29:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> you know what they say |
21:29:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> a macro a day keeps the doctor away |
21:36:00 | FromDiscord | <Elegantbeef> The issue is the doctor it keeps away is the brain doctor |
21:38:06 | FromDiscord | <deech> How do I use the `[: T]` syntax for things like `ref` and `ptr`, `[: ptr T]` doesn't seem to work. |
21:39:09 | FromDiscord | <Elegantbeef> You sure? https://play.nim-lang.org/#ix=3r8b |
21:39:27 | FromDiscord | <Elegantbeef> that `[: T]` is for the method call syntax not procedure definitions |
21:41:03 | FromDiscord | <deech> https://play.nim-lang.org/#ix=3r8c |
21:42:09 | FromDiscord | <Elegantbeef> What are you even trying to do convert it back to `ptr int`? |
21:42:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @elegantbeef\:matrix.org \: how can I change your doSomething proc to have the following signature `proc doSomething(a: int, name="default") = echo name`, and then have echoParams call `doSomething(a, name=`str`)`? |
21:43:37 | FromDiscord | <Elegantbeef> this how can i sounds more like "how can you" π |
21:43:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> well... |
21:44:21 | FromDiscord | <deech> The equivalent of `MyInt(10).cint` but of the type of `MyInt` was `MyInt = distinct ref int`. |
21:44:51 | FromDiscord | <deech> Or `distinct ptr int`. |
21:45:46 | FromDiscord | <Elegantbeef> Just changing it to `varargs[untyped]` works for that |
21:45:47 | FromDiscord | <Elegantbeef> Nah that's not the equivlent |
21:45:48 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3r8f |
21:45:57 | FromDiscord | <Elegantbeef> The `[: T]` is specifically for method call syntax for passing generics which is why it doesnt work here, you arent passing generics you're attempting to convert |
21:46:20 | FromDiscord | <deech> Ah makes sense. |
21:46:30 | FromDiscord | <deech> Thought I'd try my luck |
21:46:59 | FromDiscord | <Elegantbeef> cause when you do `a.someProc[T]()` it's evaluated as \`\`[]`(someproc(a), T)` not `someProc[T](a)` |
21:47:57 | FromDiscord | <Elegantbeef> Well i fucked the formatting but either way, it's not a conversion method, it's a specifically for generic method calls |
21:48:55 | FromDiscord | <Elegantbeef> one of the most simple examples i can talk about is something like `10.newSeq[: float]()` cs `10.newSeq[float]` |
21:50:12 | FromDiscord | <Elegantbeef> The first one compiles properly, the second one fails due to it trying `[](newSeq(10), float)` instead of the proper `newSeq[float](10)` |
21:50:44 | FromDiscord | <Elegantbeef> Hopefully that's not overly redundant and actually explains what's going on |
21:51:30 | FromDiscord | <deech> Makes a ton of sense. Thanks1 |
21:51:37 | FromDiscord | <deech> (edit) "Thanks1" => "Thanks!" |
21:53:08 | FromDiscord | <Elegantbeef> [BracketMaster (Yehowshua Immanuel)](https://matrix.to/#/@bracketmaster-5a708063d73408ce4f8ad7ee:gitter.im)\: The untyped version working for you? |
21:53:21 | FromDiscord | <@bracketmaster-5a708063d73408ce4> the untyped version? |
21:53:38 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sent a code paste, see https://play.nim-lang.org/#ix=3r8i |
21:53:40 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm trying to do something like that |
21:54:11 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oh - I didn't try that? is that what I need? |
21:54:12 | FromDiscord | <Elegantbeef> replacing `varargs[typed]` with `varargs[untyped]` |
21:54:18 | FromDiscord | <@bracketmaster-5a708063d73408ce4> typed/untyped doesn't seem to be my issue |
21:54:44 | FromDiscord | <Elegantbeef> Well `name` isnt a parameter so `name =` will fail |
21:55:02 | FromDiscord | <Elegantbeef> if it's untyped you'll be able to use named parameter calls with no issue |
21:55:31 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm afraid I don't quite follow |
21:56:00 | FromDiscord | <Elegantbeef> when doing `echoParams(doSomething, a, name = "hmm")` name isnt a parameter of the macro so it'll fail |
21:56:07 | FromDiscord | <Elegantbeef> due to being a typed macro |
21:56:24 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3r8j but as soon as you make it untyped, you can use the same syntax you'd use in a procedure and it just works https://play.nim-lang.org/#ix=3r8j |
21:56:27 | FromDiscord | <Elegantbeef> Lol double paste |
21:56:30 | FromDiscord | <Elegantbeef> I'm good at life |
21:56:34 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I don't want to pass name to the macro |
21:56:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I want the macro to pass name to doSomething |
21:56:42 | FromDiscord | <@bracketmaster-5a708063d73408ce4> lol |
21:56:48 | FromDiscord | <Elegantbeef> That's my point |
21:57:24 | FromDiscord | <Elegantbeef> `name =` will not work due to the macro not having a parameter of name if the args are typed, but if it's untyped it's just grabbed as is and can be passed along |
21:57:53 | FromDiscord | <Elegantbeef> Just look at that new link and run it, it does what you want without any effort |
21:58:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> what I mean is that we should be calling `echoParams(doSomething, a)` not `echoParams(doSomething, a, name = "hmmmm")` |
21:58:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> echoParams then calls doSomething and overides the name default |
21:59:15 | FromDiscord | <Elegantbeef> I dont see what the issue is? |
21:59:35 | FromDiscord | <Elegantbeef> You want echo params to have a default name parameter? |
22:00:28 | * | max22- quit (Quit: Leaving) |
22:00:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> calling `echoParams(doSomething, a)` should call `doSomething(a, name="a")` |
22:00:48 | FromDiscord | <Elegantbeef> ok |
22:00:48 | FromDiscord | <@bracketmaster-5a708063d73408ce4> calling `echoParams(doSomething, b)` should call `doSomething(b, name="b")` |
22:00:51 | FromDiscord | <@bracketmaster-5a708063d73408ce4> so on and so forth |
22:01:00 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sorry - I wasn't very clear |
22:03:26 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3r8m |
22:04:27 | FromDiscord | <Elegantbeef> I am wondering if there is even a point to this macro to allow any procedure since it seems like you're using `doSomething` only |
22:04:45 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'll send you a snippet of how I actually end up using it |
22:04:47 | FromDiscord | <@bracketmaster-5a708063d73408ce4> thanks |
22:04:51 | FromDiscord | <@bracketmaster-5a708063d73408ce4> it will make sense |
22:05:02 | FromDiscord | <Elegantbeef> I wouldnt be so sure of myself |
22:06:51 | * | rockcavera quit (Remote host closed the connection) |
22:23:57 | * | supakeen quit (Remote host closed the connection) |
22:24:20 | * | supakeen joined #nim |
22:48:14 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @elegantbeef\:matrix.org \: https://play.nim-lang.org/#ix=3r8s |
22:48:37 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm making a simulator for the POWERPC architecture\: https://github.com/BracketMaster/nimulatorPPC/tree/ad362bd0376a12ae829592ea5e6b8003f0cea214 |
22:48:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oops\: https://github.com/BracketMaster/nimulatorPPC |
22:48:52 | fn | <R2D299> itHub: 7"A POWER9 emulator written in nim." |
22:49:12 | FromDiscord | <@bracketmaster-5a708063d73408ce4> To help debug, I need to be able to see what registers have changed between instructions |
22:49:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> so that's why |
22:49:22 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I hope it makes sense now |
22:50:10 | FromDiscord | <Elegantbeef> How large is the state? |
22:50:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> power has roughly 2000 general purpose registers |
22:50:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> but only up to 5 change every instruction |
22:50:49 | FromDiscord | <Elegantbeef> Ah you're holding state anyway |
22:51:07 | FromDiscord | <Elegantbeef> i can show you what i'd do |
22:51:13 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sure |
22:56:07 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3r8t this might be better |
22:57:23 | FromDiscord | <Elegantbeef> Well obviously changing it so it prints the index π |
22:58:13 | FromDiscord | <Elegantbeef> And you can always define a debug switch |
22:59:00 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3r8u as such here |
22:59:09 | FromDiscord | <Elegantbeef> without `-d:debugRegs` it does nothing, but with it will print out reg changes |
23:00:01 | FromDiscord | <Elegantbeef> and of course i made a typo, should be `defined` |
23:00:02 | FromDiscord | <@bracketmaster-5a708063d73408ce4> this is actually very elegant |
23:00:18 | FromDiscord | <@bracketmaster-5a708063d73408ce4> you should change your name to elegantNim |
23:00:30 | FromDiscord | <Elegantbeef> Lol |
23:01:00 | FromDiscord | <Elegantbeef> I mean it's about doing the most with the least, the simplest solution is often the most elegant |
23:01:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> one slight problem |
23:01:20 | FromDiscord | <@bracketmaster-5a708063d73408ce4> https://github.com/BracketMaster/nimulatorPPC/blob/main/src/cpu/regfiles.nim#L6 |
23:01:25 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I have 15 other regfiles |
23:01:42 | FromDiscord | <Elegantbeef> They're all `openArray[int]` |
23:02:13 | FromDiscord | <Elegantbeef> Unless the implication is that they can all change inside a single block |
23:02:42 | FromDiscord | <Elegantbeef> If that's the case you can cache all of them before hand, which will ofc be tedious to setup but be the exact same logic |
23:03:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> they can all change in a single block |
23:03:50 | FromDiscord | <Elegantbeef> Ok so time for macro magic then cause i'm a lazy curmudgen |
23:04:26 | FromDiscord | <@bracketmaster-5a708063d73408ce4> hah - its ok. I think you're solution would work quite well if I wasn't doing such a niche thing |
23:04:44 | FromDiscord | <Elegantbeef> Nyet, my solution will be used! π |
23:04:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> alrighty then! |
23:05:32 | FromDiscord | <@bracketmaster-5a708063d73408ce4> feel free to make a pull request on the simulator once I upstream the diffRegfile implementation |
23:05:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> prefferrably after I get the UART-\>Terminal fully working |
23:26:41 | FromDiscord | <pyautogui> NimConf 2021 is going to be interesting. Really looking forward to https://www.youtube.com/Min-implementing-a-programming-languag-with-Nim-(NimConf-2021). |
23:27:10 | FromDiscord | <Elegantbeef> [BracketMaster (Yehowshua Immanuel)](https://matrix.to/#/@bracketmaster-5a708063d73408ce4f8ad7ee:gitter.im)\: Well here's what i got https://play.nim-lang.org/#ix=3r8z π |
23:27:21 | FromDiscord | <Elegantbeef> Aw shit it doesnt do the defined check |
23:28:48 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I should mention that I would need to run regChangeBase at some root level |
23:28:54 | FromDiscord | <Elegantbeef> There https://play.nim-lang.org/#ix=3r8B |
23:28:58 | FromDiscord | <@bracketmaster-5a708063d73408ce4> regs could be changed throughout many files |
23:29:12 | FromDiscord | <Elegantbeef> Ah then this doesnt track each change |
23:29:18 | FromDiscord | <Elegantbeef> It just tracks total changes |
23:29:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> well that's fine |
23:30:07 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I would probably insert regChangeBase right here\: https://github.com/BracketMaster/nimulatorPPC/blob/main/src/nimulatorPPC.nim#L11 |
23:30:14 | FromDiscord | <Elegantbeef> Well then this should work |
23:30:36 | FromDiscord | <Elegantbeef> When the entire block changes it'll output all the register changes |
23:31:12 | FromDiscord | <Elegantbeef> and of course you can use it nested for specific debugging |
23:31:12 | FromDiscord | <@bracketmaster-5a708063d73408ce4> the actually reg change statements occur in these files\: https://github.com/BracketMaster/nimulatorPPC/tree/main/src/instructions/implementations |
23:31:17 | FromDiscord | <checkersai> sent a code paste, see https://play.nim-lang.org/#ix=3r8C |
23:31:36 | FromDiscord | <checkersai> (edit) "https://play.nim-lang.org/#ix=3r8C" => "https://play.nim-lang.org/#ix=3r8D" |
23:31:57 | FromDiscord | <checkersai> Also when I run with `nim c -r --gc:arc` |
23:31:58 | FromDiscord | <leorize> to check for gcArc you should use `defined(gcArc)` |
23:32:08 | FromDiscord | <leorize> compileOption is a bit unreliable at times |
23:32:47 | FromDiscord | <Elegantbeef> Yea i think a nice feature is two option strings for start/end message for a sort of stacktrace |
23:33:16 | * | supakeen quit (Remote host closed the connection) |
23:33:40 | * | supakeen joined #nim |
23:34:23 | FromDiscord | <checkersai> In reply to @leorize "to check for gcArc": that still returns false |
23:35:57 | FromDiscord | <leorize> do you happen to have a config file that set --gc\:refc? and what Nim version are you using?β΅(@checkersai) |
23:40:48 | FromDiscord | <Elegantbeef> Well this is my promise to be last change, https://play.nim-lang.org/#ix=3r8F i'm now stopping the progression π |
23:41:07 | FromDiscord | <Elegantbeef> If i continue working on this someone needs to ban me π |
23:44:27 | FromDiscord | <checkersai> In reply to @leorize "do you happen to": I'm using 1.4.4 |
23:44:42 | FromDiscord | <checkersai> And to my knowledge I haven't set refc in any config |
23:44:46 | FromDiscord | <retkid> Have anyone done stuff with nim in gamebox or unreal |
23:46:28 | fn | <ForumUpdaterBot99> New post on r/nim by RattleyCooper: Is there a list of weird nim rules for noobs?, see https://reddit.com/r/nim/comments/o7zflk/is_there_a_list_of_weird_nim_rules_for_noobs/ |
23:49:47 | FromDiscord | <checkersai> Also I'm on windows currently if that matters |
23:50:14 | FromDiscord | <Elegantbeef> What's gamebox |
23:50:15 | FromDiscord | <@bracketmaster-5a708063d73408ce4> mordern ones anyways |
23:50:20 | FromDiscord | <@bracketmaster-5a708063d73408ce4> 10,000 lines of code so far |
23:50:26 | FromDiscord | <@bracketmaster-5a708063d73408ce4> nimulatorPPC is possibly my largest nim project yet |
23:50:32 | FromDiscord | <checkersai> oh wait |
23:50:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> CPUs are kinda complex |
23:50:45 | FromDiscord | <checkersai> shuffling the argument fixed it |
23:50:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> modern ones anyways |
23:51:04 | FromDiscord | <Elegantbeef> Larger than anything i have |
23:51:06 | FromDiscord | <@bracketmaster-5a708063d73408ce4> to be fair, I generated the largest files - such as the decoder\: https://github.com/BracketMaster/nimulatorPPC/blob/main/src/isa/bitpat_pairings.nim |
23:51:10 | FromDiscord | <checkersai> running `nim c -r --gc:arc .\src\oatmeal.nim` gets the expected behavior |
23:51:10 | FromDiscord | <@bracketmaster-5a708063d73408ce4> by manually parsing the POWER manual\: https://ibm.ent.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv |
23:51:39 | FromDiscord | <checkersai> so does `nimble --gc:arc run` |
23:51:48 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oh yes - it needs to go before not after |
23:51:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> good catch |
23:51:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> i overlooked that |
23:52:09 | FromDiscord | <gogolxdong (liuxiaodong)> @retsyo what are you going to do? |
23:52:53 | FromDiscord | <retkid> In reply to @Elegantbeef "What's gamebox": An engine |
23:53:04 | FromDiscord | <Elegantbeef> I figured that but i couldnt find anything on it π |
23:53:26 | FromDiscord | <leorize> sounds like a nimble and/or compiler bug, you should file an issue for itβ΅(@checkersai) |
23:54:11 | FromDiscord | <retkid> In reply to @Elegantbeef "I figured that but": Think I got the engines name confused in my brain |
23:54:53 | FromDiscord | <@bracketmaster-5a708063d73408ce4> before, you were trying to do\: `nim c -r .\src\oatmeal.nim --gc:arc` |
23:55:12 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I read in the nim manual that args pass after the file name are passed to the program |
23:55:22 | FromDiscord | <@bracketmaster-5a708063d73408ce4> if this is the case - seems like expected behavior? |
23:55:39 | FromDiscord | <leorize> yea that's expected if nim was called like that |