00:05:33 | FromDiscord | <Quibono> Okay I fixed it, thanks Rika. |
00:05:50 | FromDiscord | <Quibono> If anyone wants to know, Nimcrypt is faster at SHA2 than Nimsha2. |
00:05:58 | FromDiscord | <Quibono> By like 4 us. |
00:06:00 | FromDiscord | <Quibono> lol |
00:30:46 | * | Guest96 joined #nim |
00:31:51 | * | Guest96 left #nim (#nim) |
00:40:46 | * | hmmm quit () |
00:44:00 | FromDiscord | <Rebel> Rika do you have any idea about my conundrum yesterday? Why would adding the async pragma to it cause it to not compile :/ |
00:48:39 | * | abm quit (Quit: Leaving) |
00:58:22 | * | bung joined #nim |
01:02:10 | * | abm joined #nim |
01:02:55 | * | bung quit (Ping timeout: 256 seconds) |
01:38:45 | FromDiscord | <Rika> uh can ya link me where it is |
01:38:51 | FromDiscord | <Rika> @Rebel sorry for the late reply |
01:42:19 | FromDiscord | <Rebel> https://play.nim-lang.org/#ix=2FCP remove async and it works just fine |
01:42:22 | FromDiscord | <Rebel> also all good π |
01:46:54 | FromDiscord | <Rika> #14447 |
01:46:56 | disbot | https://github.com/nim-lang/Nim/pull/14447 -- 6fix #14421 items uses lent T ; snippet at 12https://play.nim-lang.org/#ix=2pTy |
01:48:02 | FromDiscord | <Rika> hmm |
01:52:46 | FromDiscord | <Rika> idk sorry, i dont know how openarray works exactly |
01:53:40 | FromDiscord | <Rika> regards memory safety i mean |
01:53:54 | FromDiscord | <Rebel> I guess I could try a seq |
02:00:27 | FromDiscord | <Rebel> Compiling with the workaround still produced same error when using openarray |
02:10:45 | * | Q-Master quit (Ping timeout: 240 seconds) |
02:10:50 | FromDiscord | <shadow.> any way to get the value of a variable by its name in string form? |
02:12:04 | * | Q-Master joined #nim |
02:12:09 | FromDiscord | <shadow.> would parseExpr work for this purpose |
02:12:57 | FromDiscord | <ElegantBeef> What're you trying to do? |
02:14:23 | FromDiscord | <shadow.> making a version of fmt string |
02:14:30 | FromDiscord | <shadow.> to learn macros |
02:14:43 | FromDiscord | <shadow.> i guess a dumbed-down version if you will lol |
02:22:57 | * | apahl_ quit (Ping timeout: 272 seconds) |
02:24:28 | * | apahl joined #nim |
02:31:45 | FromDiscord | <ElegantBeef> I dont know why you'd use parsestmt there |
02:31:48 | FromDiscord | <ElegantBeef> or parse expr |
02:33:37 | FromDiscord | <ElegantBeef> I do see fmt uses it but i'm uncertain why |
02:35:01 | * | lritter joined #nim |
02:37:10 | * | lritter quit (Client Quit) |
02:37:32 | * | lritter joined #nim |
02:39:11 | FromDiscord | <ElegantBeef> Ah nvm i get it now that i think about it π |
02:40:23 | FromDiscord | <ElegantBeef> but yes parseExpr is what you'd use to get the string as what you'd want internally |
02:49:22 | * | lritter quit (Quit: Leaving) |
02:50:43 | * | lritter joined #nim |
03:16:09 | * | zielmicha__ quit (Ping timeout: 272 seconds) |
03:16:25 | * | zielmicha__ joined #nim |
03:16:26 | * | qwertfisch quit (Read error: Connection reset by peer) |
03:17:05 | * | qwertfisch joined #nim |
03:18:47 | FromDiscord | <shadow.> oh ok thanks |
03:42:16 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
03:43:35 | * | pbb joined #nim |
03:54:19 | * | abm quit (Read error: Connection reset by peer) |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:36 | * | supakeen joined #nim |
04:33:10 | FromDiscord | <Bahaa> sent a code paste, see https://play.nim-lang.org/#ix=2FKI |
04:33:44 | FromDiscord | <Bahaa> This isn't all of the code, I've trimmed it for conciseness. `line` is just a line from a file |
04:34:48 | * | lritter quit (Ping timeout: 272 seconds) |
04:35:04 | * | lritter joined #nim |
04:36:58 | FromDiscord | <InventorMatt> that error is because you don't need the discard statement there |
04:37:16 | FromDiscord | <InventorMatt> the add proc doesn't return anything |
04:37:38 | FromDiscord | <Bahaa> Ah. Thank you so much! I added that discard when I was debugging some time ago and forgot to remove it. |
04:40:42 | * | vicfred joined #nim |
04:57:08 | * | vicfred quit (Quit: Leaving) |
05:02:26 | FromDiscord | <Bahaa> Is it possible to get a type's field value with a string field name? For example if I have the string `"email"`, can I use something that would act like `Contact[email]` to give me the value of that field for a particular instance of it? |
05:02:53 | FromDiscord | <Rebel> a table? |
05:05:13 | FromDiscord | <Bahaa> In this instance I have more than two fields and can't use a table |
05:05:52 | * | vicfred joined #nim |
05:06:05 | FromDiscord | <Bahaa> I'm searching the contacts for a specific value which can be in any of the fields (specified by user) |
05:06:23 | FromDiscord | <Bahaa> so `email [email protected]` will look into all the `email` fields for `[email protected]` |
05:07:58 | FromDiscord | <Rebel> How efficient does this have to be |
05:08:54 | FromDiscord | <Bahaa> Ideally it can directly get the fields by their string names but I'm not looking for over the top efficiency (otherwise I would've used a database, I'm implementing this to learn Nim not really for a real-world usecase) |
05:11:08 | FromDiscord | <Rebel> I still think a table is the way to go if you know your keys will be unique if you have more than two fields couldn't the key be a tuple? Should be able to hash the tuple |
05:11:45 | * | thomasross quit (Ping timeout: 240 seconds) |
05:11:56 | FromDiscord | <InventorMatt> You could create a ``[]`` proc that takes a string as an input and have a case statement for your options |
05:12:15 | * | bung joined #nim |
05:13:09 | FromDiscord | <Bahaa> But I'll be querying only one for those fields at a time |
05:13:20 | FromDiscord | <Bahaa> That's an option for sure |
05:13:26 | FromDiscord | <Bahaa> Ideally there'd be something like Go's `reflect` |
05:13:39 | FromDiscord | <Bahaa> But yeah switch case is alright |
05:14:15 | FromDiscord | <Bahaa> (edit) "alright" => "alright, my only problem with it is it'd have to run once for every contact in the list" |
05:17:25 | FromDiscord | <InventorMatt> Does the attribute you are trying to access change each time? If you are looping through it you should be able to just normally access it like an attribute |
05:17:42 | FromDiscord | <InventorMatt> Like contact.email |
05:18:37 | FromDiscord | <Bahaa> But I'm not aware of a way to use that .email for every contact in the list |
05:18:48 | FromDiscord | <Bahaa> It's the same .email but they're different contacts |
05:19:58 | * | lritter quit (Quit: Leaving) |
05:23:12 | FromDiscord | <InventorMatt> would it not look something like this while you are looping through https://play.nim-lang.org/#ix=2FKR |
05:26:29 | FromDiscord | <InventorMatt> but if you do want an indexed string approach you can do this https://play.nim-lang.org/#ix=2FKS |
05:26:45 | * | vicfred quit (Quit: Leaving) |
05:27:39 | * | vicfred joined #nim |
05:34:21 | FromDiscord | <Bahaa> Looks to be the same thing as an in-loop case from an efficiency standpoint but I guess I don't have too many other options |
05:34:33 | FromDiscord | <Bahaa> Thanks for your help, InventorMatt and Rebel! |
05:37:51 | FromDiscord | <ElegantBeef> @Bahaa you can use the `static` keyword with when to generate procs more akin to generics where it's body is created at compile time https://play.nim-lang.org/#ix=2FKV |
05:38:10 | FromDiscord | <ElegantBeef> This talks about it if interested https://forum.nim-lang.org/t/7155 |
05:38:45 | FromDiscord | <ElegantBeef> Guess this link makes more sense to link π https://nim-lang.org/docs/manual.html#special-types-static-t |
05:39:53 | FromDiscord | <ElegantBeef> I do tend to suggest bad ideas π |
05:41:22 | * | mbomba joined #nim |
05:42:00 | * | vicfred quit (Quit: Leaving) |
05:42:47 | * | vicfred joined #nim |
05:43:13 | * | mbomba quit (Client Quit) |
05:44:06 | FromDiscord | <Bahaa> Sorry, I don't really understand how using the static keyword in this context would differ from not using it? |
05:58:42 | FromDiscord | <Gyllou> has anybody done prim's in nim? |
05:58:49 | FromDiscord | <Gyllou> jw, too lazy rn |
05:58:52 | FromDiscord | <Gyllou> also drunk |
05:59:05 | FromDiscord | <ElegantBeef> It really doesnt, it's just another (probably sillier) way of doing it |
05:59:48 | FromDiscord | <Gyllou> seems a shame i can't find it implemented, what with all that sweet alliteration |
05:59:58 | FromDiscord | <Gyllou> rhyme? idk |
06:00:01 | FromDiscord | <ElegantBeef> Rhyme |
06:00:10 | FromDiscord | <Gyllou> lol |
06:00:45 | FromDiscord | <ElegantBeef> Yea nothing on github search with "prim language:nim" |
06:00:59 | FromDiscord | <Gyllou> thats alright ill do it tomorrow |
06:01:16 | FromDiscord | <ElegantBeef> Do it now, it'll be funnier |
06:01:21 | FromDiscord | <Gyllou> lol |
06:01:33 | FromDiscord | <Gyllou> im gonna level my grim dawn character, got a new build i gotta test |
06:01:40 | FromDiscord | <Gyllou> also like 3 beers in |
06:01:54 | FromDiscord | <Gyllou> the graph lib is coming along well! |
06:02:06 | FromDiscord | <Gyllou> im excited |
06:02:14 | FromDiscord | <Gyllou> i hope it helps people |
06:05:02 | FromDiscord | <ElegantBeef> Outside the scope of my knowledge so it wont help me, so you'e failed as i am pepople |
06:05:07 | FromDiscord | <ElegantBeef> people |
06:13:53 | FromDiscord | <Gyllou> lol fair, i feel like graphs are a standard data structure though and i hope if adds to the tools people have for nim |
06:15:19 | FromDiscord | <Gyllou> the usefulness of graphs are just now trickling down to the average engineer so i feel like itll be useful. i love nim so far, easily my favorite language so anything i can do to help. |
06:15:49 | FromDiscord | <Gyllou> next up is the reinforcement learning lib and the graph neural network lib |
06:16:14 | FromDiscord | <Gyllou> can't build shodan without them |
06:17:25 | * | vicfred quit (Quit: Leaving) |
06:22:48 | * | vicfred joined #nim |
06:28:05 | * | narimiran joined #nim |
06:41:06 | FromDiscord | <ProfessorEevee> So when is it a good idea to call procs without parentheses? |
06:42:00 | FromDiscord | <ElegantBeef> I mean whenever you want really |
06:42:38 | FromDiscord | <ProfessorEevee> Just wondering if there's a sort of standard or rule of thumb, really |
06:42:55 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
06:43:06 | FromDiscord | <ElegantBeef> Not much of a suggestion where to use it |
06:43:30 | narimiran | if it is your own code: whenever you like |
06:44:31 | FromDiscord | <ProfessorEevee> Yeah, I guess. I was thinking maybe there's a structure like Python's PEP 8 |
06:45:14 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/nep1.html |
06:45:34 | FromDiscord | <ElegantBeef> We've got that, but i dont think it really mentions command syntax |
06:51:06 | FromDiscord | <ProfessorEevee> I see, I suppose I'll just try to use what makes the most sense and looks easier to read |
06:54:26 | * | Perkol joined #nim |
07:05:20 | narimiran | A release candidate for Nim 1.4.2 is out! Get it from the nightlies: https://github.com/nim-lang/nightlies/releases/tag/2020-11-28-version-1-4-74c687e395c946111652c7bef4780b0aa2391cbf or using choosenim: choosenim @74c687e |
07:18:40 | * | bung quit (Ping timeout: 246 seconds) |
07:30:05 | * | vicfred quit (Ping timeout: 240 seconds) |
07:43:14 | * | bung joined #nim |
07:54:41 | FromDiscord | <Imperatorn> Is there any process of translating C# to Nim? I know I'm just dreaming, but asking anyway |
07:58:21 | FromDiscord | <ElegantBeef> I believe there was someone embarking on that using the DLR |
07:58:28 | FromDiscord | <ElegantBeef> Or similar |
08:12:28 | * | vicfred joined #nim |
08:22:20 | FromGitter | <bung87> I've implemented a async form parser, as api to end developer, question is should I raise exception during parsing ? |
08:23:12 | FromGitter | <bung87> http multipart form data |
08:24:48 | FromGitter | <bung87> parsing on end user's demand |
08:32:09 | FromDiscord | <Imperatorn> Cool |
08:38:06 | bung | :) |
09:01:55 | FromDiscord | <Imperatorn> I've been through a marathon of evaluating about 50 languages. I see hope for Nim. It just has to gain momentum. What efforts are made to grow the Nim community and/or funding? π€ |
09:05:24 | FromDiscord | <Imperatorn> Tried to spend a week with every language |
09:05:25 | * | habamax joined #nim |
09:05:26 | FromDiscord | <Bahaa> Not to push your message up, but I very much agree. I've tipped my toes into Go and Nim, and while I believe that Nim is more flexible and in many ways simpler, I think Nim's biggest problem is its lack of momentum. (honestly I prefer some aspects of Go more but I think Nim can still easily win, especially with the better performance and easier-to-write code.) |
09:06:46 | FromDiscord | <mratsim> Nim is pretty much a community language so it will work as people addresses their own community needs |
09:07:05 | FromDiscord | <mratsim> I've seen a lot of efforts on the Japanese, Chinese and Russian Nim users for example |
09:07:19 | FromDiscord | <mratsim> I'm doing my part in Data Science/Machine Learning and high Performance computing |
09:07:32 | FromDiscord | <mratsim> Some are doing that for music and audio processing |
09:07:54 | FromDiscord | <mratsim> Python grew the same but had 20 years move advantage. |
09:08:01 | FromDiscord | <Imperatorn> My primary language is C# then C and D |
09:08:04 | FromDiscord | <Imperatorn> Yeah |
09:08:27 | FromDiscord | <Imperatorn> Python is slow tho. Nim should replace Python |
09:08:36 | FromDiscord | <nikki> why is momentum a problem for your project(s)? |
09:08:37 | * | natrys joined #nim |
09:08:51 | FromDiscord | <mratsim> Dynamic language have their place, Python is very good at rapid prototyping |
09:09:02 | FromDiscord | <Imperatorn> I'm thinking about packages primarily |
09:09:56 | FromDiscord | <nikki> some times it's an opportunity bc. you can lay those foundations and the space is less saturated in that particular language |
09:10:18 | FromDiscord | <Bahaa> Lack of packages -- less widespread support -- restricts your usage of the language to hobbyist usage since there's no real work you can do with itβ΅These are things that I can think of and it's not an exhaustive list and does not represent what other people think |
09:10:46 | FromDiscord | <ElegantBeef> Except Nim can wrap C libraries, rather easily, and there is almost always a C library π |
09:10:47 | FromDiscord | <nikki> those aren't problems i think, it should just be factored into when the language is used |
09:11:29 | FromDiscord | <ElegantBeef> Or you can always rewrite it in Nim, for that pureness |
09:11:30 | FromDiscord | <nikki> and like if the principles / impl of the language is believed in, through its use where it makes sense, it may grow over time. it's just at a particular point in that timeline |
09:11:53 | FromDiscord | <ElegantBeef> It's a chicken and an egg problem and that egg will never hatch if everyone avoids it cause "It's not used" |
09:11:56 | FromDiscord | <Bahaa> For it to be transpiled back into C? π |
09:11:57 | FromDiscord | <Imperatorn> How "easy" is it to wrap C libs? |
09:12:00 | FromDiscord | <nikki> but a lot of times it can be an opportunity because its application to a particular problem domain may unlock some potential that previously was untapped |
09:12:12 | FromDiscord | <Imperatorn> Can Nim do c++ as well? |
09:12:14 | FromDiscord | <ElegantBeef> Depends on the library, but we've got c2nim to ease it |
09:12:15 | FromDiscord | <ElegantBeef> Yes |
09:12:19 | FromDiscord | <Idefau> yes it can do c++ |
09:12:22 | FromDiscord | <Idefau> js too |
09:12:23 | FromDiscord | <Imperatorn> Cool |
09:12:43 | FromDiscord | <nikki> yes. it's up to you to take all of the tools available and do something that pushes the curve imo. interop with and compilation to c is part of the toolset and the strength |
09:12:52 | FromDiscord | <Bahaa> I totally agree and I intend to use Nim more once I'm more comfortable with compiled languages -- IMO Go is a great stepping stone since I've been using JS and Python almost exclusively |
09:12:56 | FromDiscord | <Imperatorn> Like, so I could probably use vcpkg and use it with Nim? |
09:13:01 | FromDiscord | <nikki> only nim can interop so well with c++ templates bc. of the backend |
09:13:20 | FromDiscord | <Imperatorn> Cool, that's a limitation in D |
09:13:48 | FromDiscord | <Imperatorn> In Dlang we have dpp, cpp2d, dstep etc, but none is good enough π’ |
09:13:49 | FromDiscord | <Idefau> i have no experience with vcpkgs but you probably can use it if you do the wrapper correctly |
09:14:08 | FromDiscord | <ElegantBeef> Yea we arent perfect, but nimterop/c2nim are both tools to get you there |
09:14:19 | FromDiscord | <ElegantBeef> As i was typing you can include C source code directly and wrap it |
09:14:35 | FromDiscord | <ElegantBeef> My favourite example is what impbox did here https://github.com/ftsf/nico/blob/master/nico/stb_vorbis.nim |
09:14:44 | FromDiscord | <nikki> i use the c and c++ wrapping p extensively in a game engine proj and it works p well |
09:14:48 | FromDiscord | <Imperatorn> Cool, will take a look |
09:14:50 | FromDiscord | <nikki> including wrapping c++ templates |
09:15:03 | FromDiscord | <nikki> as generic procs in nim |
09:15:16 | FromDiscord | <nikki> which not a lot of "ffi" style layers can handle |
09:15:21 | FromDiscord | <ElegantBeef> I just love how silly you can go with emit, and just include an entire header file π |
09:15:22 | FromDiscord | <nikki> and go's c ffi is basically a joke |
09:15:26 | FromDiscord | <nikki> cuz of the overhead |
09:15:45 | FromDiscord | <Imperatorn> Oh, didn't know about {.emit |
09:15:49 | FromDiscord | <ElegantBeef> Also worth noting iirc Go doesnt have macros |
09:15:59 | FromDiscord | <nikki> yeah it helps for some cases esp. when wrapping an iteratir |
09:16:01 | FromDiscord | <ElegantBeef> So you cant have fun like we ca nhere |
09:16:18 | FromDiscord | <ElegantBeef> ~~All my published nim libraries are about using macros to reduce redundant code~~ |
09:16:22 | FromDiscord | <ElegantBeef> It's like my niche |
09:16:39 | FromDiscord | <ElegantBeef> !repo constructor |
09:16:43 | FromDiscord | <ElegantBeef> Did i bot wrong |
09:16:45 | FromDiscord | <nikki> https://github.com/nikki93/ng-public/blob/public/src/core/kernel.nim wrapping entt here |
09:16:46 | FromDiscord | <ElegantBeef> I think i did |
09:16:54 | FromDiscord | <Imperatorn> Imo, any language that wants to take over the world has to do C src with ease. Sad but true... |
09:17:06 | FromDiscord | <ElegantBeef> Well that's what Zig is doing |
09:17:17 | FromDiscord | <ElegantBeef> But zig is just "modern C" |
09:17:20 | FromDiscord | <Imperatorn> Yeah, but it's too small |
09:17:27 | FromDiscord | <nikki> i just care about good tools for the particular things i use it for |
09:17:28 | FromDiscord | <ElegantBeef> Well it's still very young |
09:17:38 | FromDiscord | <nikki> "take over the world"-style fads don't help |
09:17:43 | FromDiscord | <ElegantBeef> I just care if what i'm using is fun to use and works well |
09:17:45 | FromDiscord | <Imperatorn> Yeah, Nim is more mature |
09:17:53 | FromDiscord | <ElegantBeef> <https://github.com/beef331/constructor> this is the library i wanted to link |
09:18:00 | FromDiscord | <nikki> zig is p solid at c ing |
09:18:06 | FromDiscord | <nikki> esp embedding a compiler lol |
09:18:07 | FromDiscord | <ElegantBeef> Macros are great and i'll shoot anyone that says otherwise π |
09:18:18 | FromDiscord | <nikki> and parsing header files for decls automatically ish |
09:18:21 | FromDiscord | <mratsim> spray and tell |
09:18:26 | FromDiscord | <ElegantBeef> You can use the zig compiler for nim, so we can go three levels deep |
09:18:29 | FromDiscord | <Imperatorn> I eakt a professional C replacement |
09:18:40 | FromDiscord | <mratsim> Nim probably has the best C++ interop of all languages out there |
09:18:40 | FromDiscord | <Imperatorn> Been writing D for some time |
09:18:52 | FromDiscord | <mratsim> can even wrap header only libraries |
09:18:58 | FromDiscord | <nikki> yeah i think its c++ interop is unparalleled |
09:19:06 | FromDiscord | <Imperatorn> π |
09:19:09 | FromDiscord | <nikki> having entt work is like, i don't think u can do that in any other lang |
09:19:14 | FromDiscord | <Imperatorn> Gotta check it out |
09:19:29 | FromDiscord | <nikki> yup. once you do that we can discuss concrete details |
09:19:34 | FromDiscord | <ElegantBeef> Arent you doing it a tad odd though nikki? |
09:19:35 | FromDiscord | <Idefau> nimterop is also great for automating wrapping |
09:19:41 | FromDiscord | <nikki> instead of blanket statements lol |
09:19:44 | FromDiscord | <mratsim> This is a simple BigInt header only library that I wrapped: https://github.com/status-im/nim-ttmath/blob/master/src/ttmath.nim |
09:19:49 | FromDiscord | <ElegantBeef> like you arent just `nim cpp ./main.nim` |
09:19:58 | FromDiscord | <nikki> @ElegantBeef it'd work w/ that tbh |
09:20:10 | FromDiscord | <nikki> i just do it thru cmake only so the wasm build etc. is configureable |
09:20:15 | FromDiscord | <ElegantBeef> Ah |
09:20:17 | FromDiscord | <Imperatorn> In D we have nice C interop with dpp. You can actually just #include |
09:20:21 | FromDiscord | <mratsim> And this is replacing CMake with Nim as a build system for C++ DLLs π https://github.com/numforge/agent-smith/blob/master/third_party/ale_build.nim |
09:20:35 | FromDiscord | <Imperatorn> What's the process like in Nim? |
09:20:41 | FromDiscord | <ElegantBeef> Look at the nico git link |
09:20:45 | FromDiscord | <ElegantBeef> the stb_vorbis |
09:20:53 | FromDiscord | <Imperatorn> Will do |
09:21:02 | FromDiscord | <ElegantBeef> the procs are imported from that emited c Code |
09:21:02 | FromDiscord | <nikki> we sent some links that contain the actual code for doing it |
09:21:27 | FromDiscord | <ElegantBeef> It's a bit more work since Nim's type system diferentiates C types from Nim types |
09:21:31 | FromDiscord | <nikki> but it's as easy as proc foo() {.importc.} |
09:21:34 | FromDiscord | <ElegantBeef> But it's easy |
09:21:46 | FromDiscord | <ElegantBeef> I assume D doesnt even know that a different type of int exists |
09:21:52 | FromDiscord | <mratsim> example of bindings with C++: https://github.com/numforge/agent-smith/blob/master/third_party/std_cpp.nim |
09:21:53 | FromDiscord | <nikki> there's more options than that, but that's what it boils down to |
09:22:14 | FromDiscord | <mratsim> well not bindings, it's using C++ std:vector |
09:22:14 | FromDiscord | <Imperatorn> Is there an alternative to emit? π€ |
09:22:23 | FromDiscord | <mratsim> just look at the code |
09:22:33 | FromDiscord | <ElegantBeef> Yea there is |
09:22:40 | FromDiscord | <nikki> unclear yet whether links actually help lol |
09:22:43 | FromDiscord | <ElegantBeef> Emit is just what impbox did so it wasnt an extra dependancy |
09:23:00 | FromDiscord | <ElegantBeef> He didnt want to carry around a C file, so he just included into the nim source |
09:23:05 | FromDiscord | <nikki> alternative depends on what ur tryna do |
09:23:09 | FromDiscord | <Imperatorn> Yeah, yeah... On the phone atm. Will take a proper look soon π |
09:23:24 | FromDiscord | <nikki> cool. here's a summary: it's gonna be great |
09:23:39 | FromDiscord | <nikki> https://nim-lang.org/docs/manual.html |
09:23:48 | FromDiscord | <nikki> meanwhile some phone reading |
09:24:27 | FromDiscord | <nikki> the funny thing is i wrote the importc thing within the message, right before the q about emit lol |
09:25:16 | FromDiscord | <Imperatorn> Hmm, so about .importcpp |
09:26:09 | FromDiscord | <Imperatorn> Can it include an entire header with corresponding procs for functions? |
09:26:39 | FromDiscord | <mratsim> you need to define a nim proc per C++ function you want |
09:26:42 | FromDiscord | <nikki> importcpp is a pragma on your own prototype defn |
09:27:00 | FromDiscord | <nikki> the manual is pretty clear about this |
09:27:02 | FromDiscord | <mratsim> you can use c2nim or nimterop to automate that |
09:27:11 | FromDiscord | <Imperatorn> Ok rtfm I get it |
09:27:15 | FromDiscord | <nikki> yup |
09:27:19 | FromDiscord | <ElegantBeef> Well nimterop is rather limited on c++ atm, right? |
09:27:22 | FromDiscord | <mratsim> though recursive parsing of headers is not yet supported alas :/ |
09:27:26 | FromDiscord | <mratsim> yes |
09:27:38 | FromDiscord | <nikki> machine generated wrappers seem kinda silly to me |
09:28:00 | FromDiscord | <Imperatorn> Why |
09:28:04 | FromDiscord | <nikki> unless it's actually as smooth as zig's stuff |
09:28:09 | FromDiscord | <mratsim> It's not |
09:28:26 | FromDiscord | <nikki> yeah, i think it needs to be cached as part of the build system |
09:28:29 | FromDiscord | <nikki> and transparent |
09:28:33 | FromDiscord | <ElegantBeef> In Nim's case you kinda have to go deeper to make it idiomatic |
09:28:55 | FromDiscord | <nikki> otherwise; tbh i think you should be thinking about each proc and wrapping things only as needed while defining a higher level api |
09:28:55 | FromDiscord | <mratsim> This would be a pain to do manually: https://github.com/numforge/nim-clblast/blob/master/src/generated/clblast_c.nim, https://github.com/unicredit/nimcuda/blob/master/nimcuda/cublas_api.nim |
09:28:55 | FromDiscord | <ElegantBeef> Let's be honest who wants to use a C api like it's C in Nim π |
09:29:32 | FromDiscord | <Imperatorn> Hmm |
09:29:53 | FromDiscord | <nikki> sure, i just think it should be a build artifact. but, it's just a file to think about differently now otherwise |
09:30:09 | FromDiscord | <nikki> this may not be concrete enough to reason about haha, sry |
09:30:22 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:31:02 | FromDiscord | <mratsim> it really depends, for big stuff I just c2nim them, for smaller scale I c2nim and then touch up the declaration to replace ptr by var or byref for example |
09:31:47 | FromDiscord | <mratsim> it also depends on how stable the API is, i.e. is that something I can generate once and be done for years or is it moving fast upstream. |
09:31:56 | FromDiscord | <nikki> one case where it makes a lot of sense actually is when vendoring the dep |
09:32:12 | FromDiscord | <mratsim> and also, will I need to write a high-level wrapper anyway or will it be use at a low-level in any case |
09:32:14 | FromDiscord | <nikki> if the dep is versioned with the wrapper |
09:32:31 | FromDiscord | <nikki> does the nim main source repo include gen'd wrappers |
09:32:31 | FromDiscord | <mratsim> Like if I need to write a wrapper, I don't mind using the raw API |
09:32:36 | FromDiscord | <nikki> like for pg and sqlite etc |
09:32:39 | FromDiscord | <nikki> or is it handwritten |
09:32:50 | FromDiscord | <mratsim> if the use is low-level, I'd rather have proper var/byref, openarray |
09:33:44 | FromDiscord | <nikki> agreed on those aspects, just a tradeoff between writing the wrappers as-needed in the higher level lib |
09:33:52 | FromDiscord | <nikki> vs. generating upfront |
09:33:57 | FromDiscord | <mratsim> For example this has been edited https://github.com/status-im/nim-blscurve/blob/master/blscurve/blst/blst_abi.nim#L247-L250β΅β΅Because use is low-level, I changed ptr to var and ptr+len to openarray, with proper handling of cstring or arrays of bytes: https://github.com/status-im/nim-blscurve/blob/master/blscurve/blst/blst_abi.nim#L247-L250 |
09:35:04 | FromDiscord | <ElegantBeef> I look at stuff like this and dont even know how you'd wrap it all without ending the night shooting yourself |
09:36:33 | FromDiscord | <mratsim> it's really 5 min to find the proper c2nim command, 30 min to edit the code produced, then 2-6 hours for the high-level API + tests. |
09:36:44 | FromDiscord | <ElegantBeef> Yea i meant manually without any tool assist |
09:36:48 | FromDiscord | <mratsim> ah right |
09:36:57 | FromDiscord | <mratsim> yes, and this is a small one |
09:37:25 | FromDiscord | <ElegantBeef> It also doesnt seem to be that complex of an API |
09:38:17 | FromDiscord | <mratsim> I want to wrap libTorch for ML https://github.com/SciNim/minitorch/issues/1 but it's 25 or so C++ headers that are recursive ... and with new ML layers being added on a weekly basis. |
10:37:44 | * | krux02 joined #nim |
10:59:16 | * | bung quit (Ping timeout: 240 seconds) |
11:01:43 | FromDiscord | <Recruit_main707> I believe haxcramper was creating a tool based on clang to create wrappers for big projects easily, or was it just a clang wrapper? |
11:03:16 | FromDiscord | <haxscramper> It is a tool for wrapping projects based on libclang wrapper |
11:04:09 | FromDiscord | <Recruit_main707> And how is it going? |
11:05:49 | FromDiscord | <haxscramper> With moderate success I guess. It is just extremely frustrating most of the time and main problems are just related to figuring out how to just parse C++ code reliably with liblcang |
11:06:07 | FromDiscord | <haxscramper> E.g. figuring out all little details for C++ """"""build system"""""" |
11:06:23 | FromDiscord | <haxscramper> And edge-casing everything |
11:09:45 | FromDiscord | <Recruit_main707> Do you have a repo? Personally I donβt think I could help you, but maybe someone else does |
11:09:56 | FromDiscord | <Recruit_main707> can |
11:17:26 | FromDiscord | <haxscramper> In short - it is not guaranteed that a particular header file contains all necessary information to be parsed. For example `std::string` header is made out of ~ten separate files that cannot be parsed separately |
11:17:46 | FromDiscord | <haxscramper> And so I need to build a header dependency graph and determine which header should be wrapped on its own |
11:18:05 | FromDiscord | <haxscramper> And which ones cannot even be parsed separately |
11:18:40 | FromDiscord | <haxscramper> And by extension - struct defined in file does not mean it should be placed on the wrapper for particular header file |
11:20:21 | FromDiscord | <haxscramper> I need to have separate wrappers for different header files because otherwise (if I put everything on one giant file) wrapped types are not recognized as equal, and the two libraries that use let's say `std::vector<T>` in it's API cannot interoperate |
11:20:27 | FromDiscord | <haxscramper> Due to types being different |
11:20:57 | * | bung joined #nim |
11:22:17 | FromDiscord | <mratsim> mmmh but doesn't libclang handle that for you? |
11:23:00 | FromDiscord | <haxscramper> Well, I can parse header file of course, the problem is determining which stuff goes where |
11:24:34 | FromDiscord | <haxscramper> E.g. if two files use `std::string` it should be wrapped separately, but forward declarations of the `std::string` (I just fucking love C++ - even string is template with three generic parameters, defined in separate header) is a single "API chunk" |
11:31:15 | FromDiscord | <mratsim> that seems like the plot of a horror movie |
11:34:35 | * | Perkol quit (Remote host closed the connection) |
11:36:30 | FromDiscord | <haxscramper> Well, I suppose (my current idea on how to fix this) is that I simply need to build dependency graph for headers, and wrap nodes with `degree > 1` as separate headers |
11:37:39 | FromDiscord | <haxscramper> And then just add more heuristics for this stuff. Thankfully libclang provides all information about include directives |
11:53:27 | * | vicfred quit (Ping timeout: 256 seconds) |
11:56:28 | narimiran | A release candidate for Nim 1.4.2 is out! Get it from the nightlies: https://github.com/nim-lang/nightlies/releases/tag/2020-11-28-version-1-4-74c687e395c946111652c7bef4780b0aa2391cbf or using choosenim: choosenim @74c687e |
11:57:04 | ForumUpdaterBot | New thread by Brett351364: How to rewrite nim programming langauge to be pythonic as possible? , see https://forum.nim-lang.org/t/7170 |
12:04:07 | * | hsh joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:34 | * | supakeen joined #nim |
12:08:03 | FromDiscord | <lqdev> ^ is this a troll post? |
12:08:37 | FromDiscord | <lqdev> gosh we have to stop marketing as a "better python" |
12:11:15 | FromDiscord | <Imperatorn> Why would you want it to be as pythonic as possible? π€ |
12:18:10 | FromDiscord | <Rika> How do I write rust code to be as C++ idiomatic as possible |
12:26:41 | FromDiscord | <lqdev> just because we have a python-like indentation sensitive syntax doesn't mean we're a "better python", @dom96 |
12:27:08 | FromDiscord | <lqdev> in my experience writing python and writing nim considerably different |
12:27:14 | FromDiscord | <lqdev> (edit) "in my experience writing python and writing nim ... considerably" added "is" |
12:27:59 | FromDiscord | <dom96> I disagree π |
12:29:31 | FromDiscord | <dom96> Nim is similar enough to Python and Python is popular enough that it makes sense for us to push it as a better alternative to Python |
12:29:56 | FromDiscord | <dom96> Go/Rust are also pushed as a "better Python" and they are even less similar |
12:30:02 | FromDiscord | <Quibono> I kinda agree with Dom, as a newbie who converted because I wanted a better python. |
12:30:31 | FromDiscord | <Quibono> But I think the language is plenty pythonic |
12:32:21 | FromDiscord | <Quibono> Shamelessly stealing python libraries on the other hand... |
12:42:13 | supakeen | Eh. |
12:43:02 | FromDiscord | <lqdev> i find it more similar to c than python |
12:43:16 | FromDiscord | <Idefau> i find it more similar to a mix of pascal and c |
12:43:21 | FromDiscord | <lqdev> yeah |
12:43:31 | FromDiscord | <ProfessorEevee> I mean coming from Python, learning Nim has been a lot easier than other languages |
12:43:37 | FromDiscord | <ProfessorEevee> for me, I mean |
12:43:47 | FromDiscord | <lqdev> in python you never have to deal with pointers etc |
12:44:12 | FromDiscord | <Quibono> Yeah, what Eevee said. Itβs a good language if you already know some python. |
12:44:16 | FromDiscord | <lqdev> and the syntax is quite a bit different |
12:44:26 | FromDiscord | <ProfessorEevee> I mean in general Python is really easy, but I mean learning Nim definitely feels like a better learning experience than Python |
12:44:30 | FromDiscord | <lqdev> more reminiscent of pascal |
12:44:38 | FromDiscord | <Idefau> nim has similarities with python that make it easier to learn if you come from python sure, but that doesnt make it "pythonic" |
12:44:41 | FromDiscord | <ProfessorEevee> What you learn in Nim, you could end up using in other languages that aren't Pythonic |
12:45:05 | FromDiscord | <lqdev> eh |
12:45:10 | FromDiscord | <ProfessorEevee> I'm thinking mostly languages like Java or C++ |
12:45:37 | FromDiscord | <ProfessorEevee> which C++, I find very hard to learn even understanding a fair amount of Python |
12:45:47 | FromDiscord | <lqdev> how about we stop this discussion, it's just a waste of time :/ we all have different opinions on these matters anyways |
12:46:09 | FromDiscord | <ProfessorEevee> eh, I mean it's just discussion |
12:46:27 | FromDiscord | <lqdev> in the end it doesn't matter as long as you like the language |
12:46:37 | FromDiscord | <ProfessorEevee> Not saying it matters, but it is nice seeing other POVs |
12:46:38 | FromDiscord | <Quibono> Iqdev I think you can sort the camps into βfeels like pythonβ and βyeah but technically itβs very differentβ |
12:46:39 | FromDiscord | <Idefau> wrong, you must like it exactly as i say |
12:46:52 | FromDiscord | <Quibono> Lol @Idefau |
12:46:54 | FromDiscord | <ProfessorEevee> \π³ |
12:47:29 | FromDiscord | <ProfessorEevee> so is the best way to try and learn Nim through the manual? |
12:47:40 | FromDiscord | <ProfessorEevee> I'm finding it a little hard to learn certain things |
12:47:48 | FromDiscord | <Idefau> there's the tutorials, and manual is good |
12:48:08 | FromDiscord | <Deleted User 5bd78114> Honestly, writing Nim is way better then Python, so i'd rather keep the pythonic side away- |
12:48:38 | FromDiscord | <Deleted User 5bd78114> in my opinion |
12:48:39 | FromDiscord | <ProfessorEevee> wait maybe I mean the tutorials and not the manual |
12:49:11 | FromDiscord | <Quibono> Have you read through Nim by example? That helps me a bunch |
12:49:23 | FromDiscord | <Idefau> that too |
12:50:17 | FromDiscord | <ProfessorEevee> I got through a fair bit of it, but even it is a little confusing |
12:50:43 | FromDiscord | <ProfessorEevee> Something like this |
12:50:44 | FromDiscord | <ProfessorEevee> https://i.imgur.com/2p0uV6l.png |
12:51:07 | FromDiscord | <Quibono> What about that? |
12:51:31 | FromDiscord | <ProfessorEevee> oh you know what. this whole time I thought it was one module |
12:51:44 | FromDiscord | <ProfessorEevee> I didn't even bother to read the comments |
12:51:59 | FromDiscord | <ProfessorEevee> I was so confused as to how the `` was making it work \π€¦ |
12:52:26 | FromDiscord | <Quibono> Also thereβs like another tutorial on the main page in two parts, which helped on some stuff Nim by example didnβt. |
12:52:49 | FromDiscord | <Idefau> yea |
12:53:13 | FromDiscord | <Quibono> Between those two, reading the docs, and asking for help 20 times a day lol Iβm slowly getting by |
12:53:26 | FromDiscord | <Idefau> i learned nim by reading the manual and working on a project |
12:53:33 | FromDiscord | <ProfessorEevee> I feel like maybe I'm skipping some reading in the tutorials, then |
12:53:37 | FromDiscord | <Idefau> and nim by example |
12:57:19 | * | Vladar joined #nim |
13:01:59 | FromDiscord | <Quibono> I just read the Nim memory model on the website, are there any other types besides seqs that automatically go on the heap? |
13:02:15 | FromDiscord | <Quibono> Like what do I need to avoid for stack only memory |
13:02:31 | FromDiscord | <krisppurg> Are there any other games made with nico apart from ftsf / jez impbox |
13:03:09 | * | bung quit (Ping timeout: 256 seconds) |
13:04:25 | * | habamax quit (Ping timeout: 240 seconds) |
13:05:39 | * | habamax joined #nim |
13:06:12 | * | antranigv_ joined #nim |
13:07:12 | * | antranigv quit (Ping timeout: 260 seconds) |
13:08:02 | FromDiscord | <lqdev> @Quibono seqs, strings, and refs are all allocated on the heap |
13:08:09 | FromDiscord | <lqdev> everything else goes on the stack |
13:16:22 | FromDiscord | <Idefau> i made some |
13:19:04 | * | filpAM joined #nim |
13:20:49 | FromDiscord | <krisppurg> any link? |
13:21:30 | FromDiscord | <Idefau> https://github.com/IDF31/door-o-bot |
13:27:06 | * | hmmm joined #nim |
13:27:11 | hmmm | hallo |
13:27:30 | FromDiscord | <Idefau> sup |
13:32:27 | Zevv | Araq: can we have disruptek back? |
13:35:11 | * | zahary joined #nim |
13:38:04 | * | bung joined #nim |
13:43:15 | * | PMunch joined #nim |
13:46:25 | FromDiscord | <krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=2FNa |
13:50:48 | * | antranigv_ quit (Quit: ZNC 1.8.2 - https://znc.in) |
13:51:16 | FromDiscord | <haxscramper> `pointer` and `ptr T` are different types. You need to `cast[poitner](addr buffer[offset])` |
13:51:45 | FromDiscord | <haxscramper> oh, waut |
13:52:02 | * | xet7 quit (Quit: Leaving) |
13:52:25 | * | antranigv joined #nim |
13:52:43 | FromDiscord | <haxscramper> Use `csize(t)` - https://nim-lang.org/docs/system.html#csize |
13:56:27 | FromDiscord | <lqdev> @krisppurg maybe you're running an outdated version of sdl2_nim |
13:56:38 | FromDiscord | <lqdev> csize is deprecated |
13:56:52 | FromDiscord | <Idefau> hmm i tried compiling my game with the nim nightly and it worked |
13:57:16 | Clonkk[m] | Why does the doc says it's not the same things if it's just deprecated ? Are there plan to use csize for something else ? |
13:57:58 | FromDiscord | <mratsim> use csize_t |
13:58:18 | FromDiscord | <lqdev> csize is signed which is not the same as size_t in C |
13:58:23 | FromDiscord | <mratsim> the differences is that cfoo types are supposed to be like in C but csize was mapped to int instead of uint |
14:01:18 | Clonkk[m] | For my curiosity, why define another m instead of fixing it ? |
14:02:04 | FromDiscord | <krisppurg> im using nim v1.4.0 |
14:05:52 | FromDiscord | <lqdev> @Clonkk lots of code already used csize when csize_t was introduced |
14:06:00 | FromDiscord | <lqdev> and the two aren't compatible |
14:06:06 | FromDiscord | <lqdev> for a few reasons |
14:06:14 | FromDiscord | <lqdev> the most obvious one being signedness |
14:06:32 | FromDiscord | <lqdev> but also that unsigned types are not range checked |
14:13:59 | FromDiscord | <tomck> Is there any way i can do a mapIt with a `var` iterator var? |
14:14:30 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2FNq |
14:14:39 | FromDiscord | <tomck> or something from zero_functional, e.g. `myList --> map(...)` |
14:15:36 | Zevv | hm that kind of goes against what map() is doing, right? Do you mean apply() instead? |
14:16:39 | FromDiscord | <tomck> nope, i want an impure map |
14:17:00 | Zevv | it's not there |
14:17:08 | FromDiscord | <tomck> alright, thanks |
14:17:09 | * | abm joined #nim |
14:17:15 | FromDiscord | <lqdev> just use a for loop with mitems |
14:17:26 | Zevv | or make your own map, it's trivial |
14:17:53 | FromDiscord | <lqdev> or don't because it's useless and decreases readability because mitems exists |
14:18:07 | FromDiscord | <tomck> solution with a for loop is like 5 lines |
14:18:10 | FromDiscord | <tomck> i'll probably write my own |
14:18:13 | FromDiscord | <lqdev> no? |
14:18:26 | Zevv | we can't stop you, right |
14:18:29 | Zevv | it's a free internet |
14:18:29 | FromDiscord | <lqdev> `for it in mitems(myList): it += 1` |
14:18:44 | FromDiscord | <tomck> sent a long message, see https://paste.rs/hpJ |
14:18:58 | FromDiscord | <lqdev> uh... why? |
14:19:02 | FromDiscord | <lqdev> you can just use mapIt |
14:19:13 | FromDiscord | <tomck> no, b/c `it` in mapIt isn't var |
14:19:23 | FromDiscord | <lqdev> but why would it be |
14:19:32 | FromDiscord | <lqdev> what on earth are you trying to do |
14:20:31 | FromDiscord | <tomck> i have a solution now, it's fine - but for you curiosity, I have a function to transform X -> Y, but X has a field to store the result of this transformation for subsequent calls |
14:20:42 | FromDiscord | <tomck> So i need a `var X` in order to cache the result inside the X for future calls |
14:21:12 | FromDiscord | <Rika> But now it's not functional |
14:21:32 | FromDiscord | <Rika> Why use functional style functions if you're not gonna use functional style anyway |
14:21:46 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2FNx |
14:21:58 | FromDiscord | <tomck> b/c 'functional style' functions are incredibly terse |
14:23:35 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2FNy |
14:23:51 | FromDiscord | <tomck> doesn't need to be pure, there are plenty of 'loop + collect' operations that aren't pure |
14:28:28 | * | filpAM quit (Ping timeout: 246 seconds) |
14:32:58 | bung | @mratsim in chronos if I use TLS ,read write should through new stream ? |
14:33:25 | FromDiscord | <krisppurg> I've updated nim and still getting same error even updated sdl2_nim |
14:33:36 | FromDiscord | <krisppurg> |
14:33:57 | FromDiscord | <krisppurg> ^ |
14:34:05 | FromDiscord | <krisppurg> (edit) "" => "^" |
14:38:26 | FromDiscord | <lqdev> then try updating nico? |
14:46:04 | * | hmmm quit (Ping timeout: 256 seconds) |
14:48:46 | FromDiscord | <krisppurg> i have also |
14:48:54 | FromDiscord | <krisppurg> (edit) "also" => "already" |
14:48:58 | FromDiscord | <krisppurg> @lqdev |
14:49:07 | FromDiscord | <lqdev> no clue |
14:49:10 | FromDiscord | <lqdev> cc @impbox |
14:54:49 | * | fredrikhr quit (Read error: Connection reset by peer) |
15:18:31 | FromDiscord | <krisppurg> whenever I set my executable icon to (attachment) I get a compiler error saying that the file format isn't recognised https://media.discordapp.net/attachments/371759389889003532/782264163749593118/escape_the_cube.ico |
15:20:04 | FromDiscord | <lqdev> since when does the compiler allow you to set the executable icon? |
15:22:50 | FromDiscord | <krisppurg> https://discordapp.com/channels/371759389889003530/371759607934353448/704378657812250944 |
15:23:47 | * | PMunch quit (Quit: leaving) |
15:23:48 | FromDiscord | <lqdev> huh |
15:24:04 | FromDiscord | <lqdev> interesting |
15:38:08 | bung | I cant see image ,windows icon is custom format and havn' seen the format definition |
16:04:11 | * | lritter joined #nim |
16:27:58 | * | rockcavera quit (Remote host closed the connection) |
16:33:01 | FromDiscord | <trickster0> Hello quick question, do you know how to wrapSocket or implement SSL on AsyncHttpServer ? |
16:46:37 | * | Guest94576 joined #nim |
16:48:13 | * | hmmm joined #nim |
16:51:01 | * | nixfreak joined #nim |
16:51:27 | * | Zevv quit (Quit: Lost terminal) |
16:52:12 | * | Zevv joined #nim |
16:54:41 | * | pietroppeter joined #nim |
16:56:50 | FromGitter | <HJarausch_gitlab> List comprehension : official example fails β From github.com/nim-lang/Nim/blob/devel/tests/macros/tcollect.nim β I have copied β β ```import sugar β echo collect(for i in 0..3: i)``` ... [https://gitter.im/nim-lang/Nim?at=5fc281520219b46a266543ff] |
16:57:50 | narimiran | see the documentation for collect: https://nim-lang.github.io/Nim/sugar.html#collect.m%2Cuntyped%2Cuntyped |
16:58:51 | narimiran | i have no idea how you came to `tcollect` |
16:59:08 | narimiran | which is a test file for `collect` written in that file. not for sugar.collect |
17:00:36 | FromGitter | <HJarausch_gitlab> Oh, I see. I thought it is a test for sugar/collect |
17:00:53 | narimiran | it doesn't even import sugar |
17:01:17 | Zevv | for narimiran, love from zevv: https://github.com/zevv/aoc2020 |
17:01:20 | narimiran | even still, generally it is better to read the documentation of the module, than some random test |
17:01:26 | Zevv | we'll see when you bail out again, boi |
17:01:35 | narimiran | Zevv: :) |
17:02:13 | narimiran | Zevv: btw, today i solved 2018, day25, as a preparation |
17:02:35 | narimiran | and then i remembered my biggest problem with AoC β i can't read. |
17:03:12 | Zevv | yeah, it feels like me fixing a random ticket pushed in by some sales or product guy |
17:03:16 | Zevv | "done!" |
17:03:20 | Zevv | nooo, you're not |
17:06:01 | ForumUpdaterBot | New thread by Mildred: How to unwrap a seq to a varargs[] procedure argument?, see https://forum.nim-lang.org/t/7171 |
17:13:10 | FromGitter | <HJarausch_gitlab> ```code paste, see link``` β β This works, but I haven't managed to use a 'collect' expression directly as parameter of function call like β β echo collect .... ... [https://gitter.im/nim-lang/Nim?at=5fc28526226043667c1f3da3] |
17:22:23 | FromDiscord | <mratsim> @Bung87 no idea unfortunately |
17:24:24 | planetis[m] | works: https://play.nim-lang.org/#ix=2FOx |
17:27:14 | planetis[m] | i know why it doesn't work there is a pending fix |
17:27:22 | planetis[m] | https://github.com/nim-lang/Nim/pull/16089 |
17:29:40 | planetis[m] | meanwhile you can try my package: https://github.com/planetis-m/looper |
17:37:39 | * | avass quit (Remote host closed the connection) |
17:39:08 | FromGitter | <HJarausch_gitlab> @planetis Thanks! What can I do if I want to import both *sugar* and *looper* . Currently there is a name clash |
17:39:27 | narimiran | import sugar except foo |
17:41:21 | planetis[m] | wait let me update it, somehow i forgot pushing |
17:41:30 | * | nixfreak quit (Quit: Lost terminal) |
17:43:55 | planetis[m] | done |
17:46:55 | planetis[m] | narimiran can you merge https://github.com/nim-lang/fusion/pull/46 please :) |
17:47:34 | narimiran | merged |
17:48:20 | planetis[m] | you 're awesome |
17:53:21 | FromDiscord | <krisppurg> im having troubles with linking an icon to my nim executable had a look online about converting a png file to an o file, still cant even know how to convert to that is there any other way of adding an icon to an executable? |
17:56:48 | FromDiscord | <lqdev> maybe https://github.com/electron/rcedit ? |
17:57:16 | FromDiscord | <lqdev> you'll need to convert your png to an ico file |
17:59:25 | FromDiscord | <Daniel> there is neel which i think is similar to electron, not sure |
17:59:46 | FromDiscord | <Daniel> !neel |
18:00:49 | FromDiscord | <krisppurg> I've already converted my png to an ico file |
18:01:07 | FromDiscord | <Daniel> (edit) "!neel" => "!repo neel" |
18:01:14 | FromDiscord | <krisppurg> !repo neel |
18:02:55 | FromDiscord | <Quibono> Iβm trying to spread the good word of Nim. |
18:05:58 | FromDiscord | <Quibono> Posted in the algo trading subreddit saying itβs awesome |
18:06:28 | FromDiscord | <lqdev> @Daniel uh? |
18:06:34 | FromDiscord | <lqdev> i was just linking to a resource editing tool |
18:07:20 | FromDiscord | <lqdev> `value.nim(147, 14) Error: invalid type: 'Object' in this context: 'proc (v: Value): bool' for proc` |
18:07:21 | FromDiscord | <lqdev> ummmmmm |
18:07:22 | FromDiscord | <lqdev> what? |
18:07:30 | FromDiscord | <lqdev> anyone could help me decode this error? |
18:10:33 | FromDiscord | <Daniel> @lqdev i misunderstood, sry. |
18:10:40 | FromDiscord | <lqdev> np |
18:10:51 | * | vicfred joined #nim |
18:30:56 | * | xet7 joined #nim |
18:35:52 | * | vsantana joined #nim |
18:36:55 | disbot | https://github.com/beef331/constructor -- 9constructor: 11Nim macros to aid in object construction including event programming, and constructors. 15 3β 0π΄ 7& 2 more... |
18:36:55 | disbot | β₯ Wrapping |
18:37:05 | disbot | https://github.com/Niminem/Neel -- 9Neel: 11A Nim library for making Electron-like HTML/JS GUI apps, with full access to Nim capabilities. 15 52β 2π΄ |
18:37:07 | disbot | β₯ buildAst fixe crash with method call syntax |
18:37:09 | disbot | β₯ add collect with infered init, refs #16078 fixes #14332 |
18:40:11 | FromDiscord | <lqdev> β¦what happened here? |
18:41:04 | * | Guest94576 quit (Quit: Guest94576) |
18:45:18 | * | thomasross joined #nim |
18:46:25 | * | bung quit (Ping timeout: 264 seconds) |
18:46:44 | FromDiscord | <Idefau> yes |
18:54:34 | Zevv | does anyone know if this compiler crash (sigsegv on stack overflow) fits in an open github issue? https://play.nim-lang.org/#ix=2FPf |
19:04:00 | * | pietroppeter quit (Quit: Connection closed for inactivity) |
19:04:19 | * | vsantana quit (Quit: Leaving) |
19:04:34 | Zevv | new one then https://github.com/nim-lang/Nim/issues/16175 |
19:04:36 | disbot | β₯ Compile crash (stack overflow) on recursive generic type ; snippet at 12https://play.nim-lang.org/#ix=2FPp |
19:09:40 | Prestige | Is there something like Positive but for floats? |
19:11:22 | FromDiscord | <nikki> [0.0..Inf] ? |
19:11:30 | FromDiscord | <nikki> includes 0 tho |
19:11:48 | Prestige | oh cool, thanks |
19:11:51 | FromDiscord | <nikki> !echo [0.0..Inf] |
19:12:06 | FromDiscord | <nikki> wups |
19:12:17 | FromDiscord | <nikki> !eval echo [0.0..Inf] |
19:12:21 | NimBot | [0.0 .. inf] |
19:13:36 | FromDiscord | <Recruit_main707> r/wooooosh |
19:18:07 | FromDiscord | <Idefau> reddit moment(big chungus 1000 keanu reeves 1000) |
19:19:58 | FromGitter | <bung87> https://github.com/simdjson/simdjson |
19:20:19 | FromGitter | <bung87> look what i found |
19:21:21 | FromDiscord | <Idefau> interesting |
19:22:14 | FromDiscord | <Recruit_main707> compare it to flatbuffers & msgpack |
19:22:18 | * | nixfreak joined #nim |
19:22:26 | FromDiscord | <Recruit_main707> then it might be interesting |
19:23:07 | nixfreak | going though the nim in action book and getting errors with asyncdispatch. Does asyncdispath.poll() have to a have a default timeout also? |
19:23:47 | nixfreak | Chat application started |
19:23:48 | nixfreak | Connecting to 127.0.0.1 |
19:23:48 | nixfreak | /home/nixfreak/nim/practice/Chat_project/src/client.nim(30) client |
19:23:48 | nixfreak | /home/nixfreak/.choosenim/toolchains/nim-1.4.0/lib/pure/asyncdispatch.nim(1626) poll |
19:23:50 | nixfreak | /home/nixfreak/.choosenim/toolchains/nim-1.4.0/lib/pure/asyncdispatch.nim(1316) runOnce |
19:23:53 | nixfreak | Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError] |
19:23:56 | FromDiscord | <Recruit_main707> wowowow |
19:24:01 | Zevv | nikki: now make me that range excluding 0 |
19:24:17 | FromDiscord | <nikki> nope |
19:24:23 | Zevv | pff rude. |
19:25:13 | nixfreak | I don't even see an asyncdispatch.poll() in the manual |
19:25:48 | FromGitter | <bung87> its internal use |
19:27:14 | FromGitter | <bung87> you can just use waitfor |
19:29:32 | nixfreak | is the code correct for client.nim for version 1.4 ? |
19:32:09 | FromGitter | <bung87> dont know whats the problem by reading your error message |
19:34:01 | nixfreak | http://sprunge.us/PzYR8O |
19:39:49 | * | abm quit (Ping timeout: 264 seconds) |
19:45:59 | * | vsantana joined #nim |
19:47:22 | * | vsantana left #nim (#nim) |
19:52:52 | * | vsantana joined #nim |
20:04:43 | * | FromGitter quit (Read error: Connection reset by peer) |
20:05:40 | * | superbia joined #nim |
20:06:11 | * | FromGitter joined #nim |
20:08:49 | * | habamax quit (Quit: leaving) |
20:10:53 | * | bung joined #nim |
20:11:00 | FromDiscord | <treeform> Is there a way to make nim doc also generate `exported modules`? |
20:12:22 | FromDiscord | <dom96> nixfreak: you're never calling `connect`, see here for this example: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim |
20:15:31 | * | bung quit (Ping timeout: 256 seconds) |
20:23:40 | nixfreak | ok thanks dom96 |
20:32:49 | nixfreak | got it thanks again |
20:37:49 | * | abm joined #nim |
20:37:59 | * | rockcavera joined #nim |
20:51:45 | * | vsantana quit (Read error: Connection reset by peer) |
20:52:26 | * | bung joined #nim |
20:55:21 | * | mbomba joined #nim |
20:56:45 | * | bung quit (Ping timeout: 240 seconds) |
21:06:16 | * | oculuxe joined #nim |
21:06:20 | * | natrys quit (Quit: natrys) |
21:06:52 | * | oculux quit (Ping timeout: 256 seconds) |
21:11:36 | * | hmmm quit (Ping timeout: 240 seconds) |
21:19:13 | * | hnOsmium0001 joined #nim |
21:21:09 | * | Mortir joined #nim |
21:21:28 | * | nixfreak quit (Ping timeout: 246 seconds) |
21:23:11 | Mortir | is nim still planning to target c++ by default? |
21:25:36 | * | narimiran quit (Ping timeout: 240 seconds) |
21:26:38 | * | azed joined #nim |
21:27:19 | FromDiscord | <haxscramper> I've never heard about nim planning to use C++ by default, so most likely no |
21:27:36 | FromDiscord | <haxscramper> But this is just `nim c` vs `nim cpp` to compile your project |
21:29:16 | * | rockcavera quit (Remote host closed the connection) |
21:30:54 | FromDiscord | <ElegantBeef> isnt `c` short for compile, so if you modify your base `nim.cfg` you can get it to default cpp? |
21:33:25 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2FQw |
21:34:45 | FromDiscord | <haxscramper> But I guess there is more than one way to send compilation backend, so yeah, `--backend:cpp` probably would also work |
21:38:57 | * | hmmm joined #nim |
21:42:34 | Mortir | https://forum.nim-lang.org/t/4022#25037 |
21:53:10 | * | nixfreak joined #nim |
21:58:34 | * | mwbrown quit (Quit: Exiting) |
21:59:20 | * | a_chou joined #nim |
22:17:40 | * | a_chou quit (Remote host closed the connection) |
22:21:56 | Mortir | gotta go now, if anybody can answer, i will check the logs tomorrow. |
22:22:13 | Mortir | goodnight |
22:22:20 | * | Mortir quit (Quit: leaving) |
22:25:45 | * | Prestige quit (Quit: Prestige) |
22:25:59 | * | mwbrown joined #nim |
22:27:16 | * | Prestige joined #nim |
22:28:52 | * | azed quit (Quit: WeeChat 2.9) |
22:33:57 | * | Jesin quit (Quit: Leaving) |
22:35:16 | * | pietroppeter joined #nim |
22:39:07 | * | avass joined #nim |
22:44:16 | * | Jesin joined #nim |
22:52:59 | * | NimBot joined #nim |
22:54:15 | FromDiscord | <iWonderAboutTuatara> I'm still having more issues with raylib forever |
22:55:22 | * | ChanServ quit (*.net *.split) |
22:56:17 | FromDiscord | <iWonderAboutTuatara> has anyone used it? |
22:56:51 | FromDiscord | <iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2FQS |
23:04:47 | * | mwbrown joined #nim |
23:06:42 | * | Vladar quit (Remote host closed the connection) |
23:10:12 | * | mbomba quit (Quit: WeeChat 3.0) |
23:16:04 | FromDiscord | <ElegantBeef> Do you have the `libraylib.so`? |
23:16:41 | FromDiscord | <ElegantBeef> @iWonderAboutTuatara |
23:16:48 | FromDiscord | <iWonderAboutTuatara> no |
23:16:52 | FromDiscord | <iWonderAboutTuatara> I odn't know where to find it? |
23:17:00 | FromDiscord | <iWonderAboutTuatara> Do I have to download it from raylib repo itself? |
23:19:00 | FromDiscord | <ElegantBeef> https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux |
23:50:10 | * | ryanhowe joined #nim |