01:03:54 | * | systemdsucks joined #nim |
01:23:10 | * | via quit (Server closed connection) |
01:23:17 | * | via joined #nim |
01:28:36 | * | derpydoo joined #nim |
03:39:43 | * | azimut quit (Remote host closed the connection) |
03:40:10 | * | azimut joined #nim |
03:45:50 | * | hernan quit (Server closed connection) |
03:46:05 | * | hernan joined #nim |
03:54:20 | * | xet7 quit (Remote host closed the connection) |
04:16:20 | * | rockcavera joined #nim |
04:17:38 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4ywq |
04:18:04 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#ix=4ywq" => "https://paste.rs/1cOw4" |
04:22:39 | FromDiscord | <Elegantbeef> Iterate all elements creatiing a set |
04:24:39 | FromDiscord | <heysokam> but i don't know how to iterate the thing correctly in the first place. that's the question, really |
04:25:20 | * | azimut quit (Ping timeout: 240 seconds) |
04:26:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/YiHeE |
04:27:06 | FromDiscord | <graveflo> Whats the deal with the `out` keyword. I cant find documentation on it |
04:27:40 | FromDiscord | <Elegantbeef> In devel it's used for definite assignment analysis and slightly more explicit C interop |
04:28:43 | FromDiscord | <graveflo> in this link: https://github.com/nim-lang/Nim/wiki/Nim-for-Java-programmers it is tied to the same weird java syntax that I used that one time |
04:28:51 | FromDiscord | <michaelb.eth> In reply to @graveflo "Whats the deal with": cf. https://discord.com/channels/371759389889003530/768367394547957761/1118909269782298715↵and Araq's replies that follow |
04:28:53 | FromDiscord | <graveflo> at least I think. I'm not a java guru either |
04:29:51 | FromDiscord | <Elegantbeef> It's purely `var` but ensure you assign it |
04:30:38 | FromDiscord | <graveflo> oh ic. I read that message in internals too and forgot about it |
04:32:04 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4yws |
04:32:27 | FromDiscord | <Elegantbeef> Are you trying to fold this into a single list? |
04:32:47 | FromDiscord | <graveflo> use difference then and prune on the empty set |
04:32:50 | FromDiscord | <heysokam> multiple, its a filter to a bunch of -W flags etc |
04:32:54 | FromDiscord | <Elegantbeef> if so replace `HashSet[string]` with `seq[string]` and `incl` with `add` |
04:32:58 | FromDiscord | <Elegantbeef> Wait you want all the names shared? |
04:33:06 | FromDiscord | <heysokam> i need the flags that are in all of the entries, but also the differences |
04:33:59 | FromDiscord | <heysokam> In reply to @Elegantbeef "Wait you want all": yeah, the names that are in -all- of them, so i can do `baseflags = @[....]` and then `release_flags = baseflags & @[ ... ]` |
04:35:01 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4ywt |
04:35:41 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#ix=4ywt" => "https://play.nim-lang.org/#ix=4ywu" |
04:35:42 | FromDiscord | <Elegantbeef> use a `seq[HashSet[string]]` instead is what i'd suggest |
04:36:12 | FromDiscord | <heysokam> In reply to @Elegantbeef "use a `seq[HashSet[string]]` instead": im not following at all 🤔 |
04:36:27 | FromDiscord | <Elegantbeef> If you want all shared flags it's a union of all sets |
04:37:09 | FromDiscord | <graveflo> ye i messed that up its union. Then if you want the difference for each you diff their set with the union set |
04:37:09 | FromDiscord | <Elegantbeef> Sorry not a union but an intersection |
04:37:13 | FromDiscord | <Elegantbeef> A union gives you all flags |
04:37:25 | FromDiscord | <graveflo> god damn it |
04:37:38 | FromDiscord | <Elegantbeef> A union - intersect gives you the ones that are not shared |
04:37:58 | FromDiscord | <heysokam> i understand how to filter the things |
04:38:03 | FromDiscord | <heysokam> the question is how to iterate them |
04:38:27 | FromDiscord | <graveflo> you are currently doing that. You might need to just move them to more suitable containers |
04:38:47 | FromDiscord | <graveflo> you posted the code that iterates them |
04:39:03 | FromDiscord | <heysokam> but it feels hacky. im repeating checks agains the same elements |
04:39:13 | FromDiscord | <graveflo> not if you do what beef said |
04:39:24 | FromDiscord | <graveflo> just move them into has containers in the loop or before the loop |
04:39:33 | FromDiscord | <graveflo> (edit) "has" => "hash" |
04:39:54 | FromDiscord | <heysokam> i don't quite get how, that's the issue |
04:40:06 | FromDiscord | <graveflo> define a hash set that will be the intersection of all seqs |
04:40:16 | FromDiscord | <graveflo> iterate over the list of seqs and update the hashset |
04:40:24 | FromDiscord | <graveflo> then you have the set of all shared |
04:40:46 | FromDiscord | <graveflo> if you want the difference between a given subset of all seqs then take the intersection of that seq and the union set |
04:40:56 | FromDiscord | <graveflo> (edit) "union" => "intersection" |
04:41:21 | FromDiscord | <graveflo> (edit) "intersection" => "difference" |
04:41:26 | FromDiscord | <graveflo> damn this set terminology |
04:41:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/8H2D8 |
04:41:36 | FromDiscord | <Elegantbeef> I've saved you grave 😄 |
04:41:40 | FromDiscord | <graveflo> thank you |
04:42:30 | FromDiscord | <Elegantbeef> We could even do an optimisation here and save the len of all elements and allocate those to allocate more than we ever will need |
04:43:21 | FromDiscord | <Elegantbeef> shucks `+=` isnt defined which I guess makes sense |
04:43:25 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4yww |
04:43:55 | FromDiscord | <Elegantbeef> Not exactly |
04:44:08 | FromDiscord | <Elegantbeef> It's practically the same but not internally |
04:44:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/s6IiT |
04:45:09 | FromDiscord | <heysokam> ah so without the extra allocs |
04:45:13 | FromDiscord | <Elegantbeef> I was just writing code quickly, to explain |
04:45:40 | FromDiscord | <Elegantbeef> `toSet` allocates a new set on top of the one we're using so it's not that great, no clue if RVO kicks in |
04:45:54 | FromDiscord | <Elegantbeef> It should kick in |
04:45:57 | FromDiscord | <heysokam> whats the intersection doing in the next part? |
04:46:07 | FromDiscord | <Elegantbeef> Gives you all the shared flags |
04:46:12 | FromDiscord | <Elegantbeef> union gives you all the flags |
04:46:22 | FromDiscord | <Elegantbeef> difference holds all the flags that are not in all the seqs |
04:47:19 | FromDiscord | <heysokam> so difference = some, intersection = all, and union = irrelevant↵the names are giga-confusing |
04:47:48 | FromDiscord | <heysokam> but that's probably just my 🐠 brain |
04:47:53 | FromDiscord | <Elegantbeef> I'm using the set terms to describe it cause I have 0 clue what you're interested in |
04:48:26 | FromDiscord | <Elegantbeef> An intersection is like bitwise `and`, a union is like bitwise `and` |
04:48:43 | FromDiscord | <Elegantbeef> union is like bitwise or\ |
04:48:50 | FromDiscord | <Elegantbeef> My brain no worky |
04:50:05 | FromDiscord | <Elegantbeef> As such the union variable has all the flags. The intersection only the ones every sequence has atleast one of. The difference the ones that come up 1..str.high - 1 times |
04:50:46 | FromDiscord | <graveflo> are there "inplace" set operations in nim? It looks like the `sets` module keeps making new sets |
04:51:01 | FromDiscord | <Elegantbeef> `incl` `excl` |
04:51:44 | FromDiscord | <graveflo> oh ok you just have to do the loops yourself. That's fair |
04:51:56 | FromDiscord | <Elegantbeef> No `incl` and `excl` take `HashSet[T]` |
04:52:14 | FromDiscord | <Elegantbeef> so the above `union +=` is really `union.incl st` |
04:52:38 | FromDiscord | <graveflo> yea but youll have to make your own say "difference update" routine using those procs if you want an inplace version of it |
04:53:08 | FromDiscord | <Elegantbeef> Right |
04:53:14 | FromDiscord | <Elegantbeef> "PRs welcom" 😄 |
04:53:18 | FromDiscord | <toma400> Out of curiosity, is there any Ruby interop library for Nim? |
04:53:49 | FromDiscord | <Elegantbeef> Use crystal then interop using crystal as a system library 😛 |
04:53:56 | FromDiscord | <Elegantbeef> https://nimble.directory/search?query=ruby |
04:57:53 | FromDiscord | <heysokam> your loop outputs the same text that i did, but without the seq hack. thx beef ✍️ |
05:00:03 | FromDiscord | <Elegantbeef> Data types are magical |
05:01:21 | FromDiscord | <heysokam> indeed |
05:03:52 | * | derpydoo quit (Ping timeout: 240 seconds) |
05:06:14 | * | rockcavera quit (Remote host closed the connection) |
05:30:40 | * | ntat joined #nim |
05:48:01 | FromDiscord | <heysokam> 500 lines down to 90 with the sets trim 🙌 |
06:26:11 | FromDiscord | <demotomohiro> Nim interop C + Ruby interop C = Nim interop Ruby ? |
07:22:06 | FromDiscord | <eerbium> Can I write as low level code as Rust in Nim |
07:22:54 | FromDiscord | <obi3112> In reply to @Elegantbeef "Data types are magical": is this a bot or user? |
07:22:58 | FromDiscord | <eerbium> like manual memory management on embedded system/baremetal, kernels, userspaces, etc |
07:23:09 | FromDiscord | <obi3112> nvm its a user |
07:23:16 | FromDiscord | <eerbium> In reply to @obi3112 "is this a bot": its an interop from the telegram or some other |
07:23:29 | FromDiscord | <obi3112> oh ok andrew ;D |
07:23:38 | FromDiscord | <Elegantbeef> Matrix to be precise |
07:23:43 | FromDiscord | <Elegantbeef> Yes Nim is as low level as Rust |
07:23:43 | FromDiscord | <eerbium> yes |
07:23:45 | FromDiscord | <heysokam> In reply to @eerbium "Can I write as": yes |
07:23:50 | FromDiscord | <obi3112> Breathe Air! |
07:24:28 | FromDiscord | <eerbium> So I suppose it should be possible to do anything in Nim? |
07:24:33 | FromDiscord | <heysokam> yep |
07:24:33 | FromDiscord | <Elegantbeef> Yes |
07:24:37 | FromDiscord | <eerbium> Like it covers all usecases? |
07:24:55 | FromDiscord | <heysokam> anything a systems language can do, yes |
07:25:20 | FromDiscord | <eerbium> no like i mean all usecases |
07:25:27 | FromDiscord | <eerbium> not only systems |
07:25:29 | FromDiscord | <heysokam> define -all- |
07:25:52 | FromDiscord | <heysokam> a systems language can do anything related to systems |
07:26:05 | FromDiscord | <heysokam> C, Rust, Cpp, are all systems languages |
07:26:09 | FromDiscord | <eerbium> In reply to @heysokam "define -all-": things that the mainstream languages are used for (python ts c# rust clojure elixir etc) |
07:26:10 | FromDiscord | <heysokam> python is not, its interpreted |
07:26:55 | FromDiscord | <heysokam> In reply to @eerbium "things that the mainstream": it can do everything python and rust can, if that helps solving your question from your frame of reference |
07:27:25 | FromDiscord | <heysokam> the question is a bit non-sensical, so its hard to answer it so that you get closure for it |
07:27:54 | FromDiscord | <heysokam> nim can do anything you want, saying "but can it do literally anything" after the first is answered, is what is losing me |
07:27:57 | FromDiscord | <eerbium> but can it be used for data processing like julia or concurrency handling like elixir |
07:28:13 | FromDiscord | <eerbium> In reply to @heysokam "nim can do anything": I meant just systems by that |
07:28:20 | FromDiscord | <eerbium> (edit) "that" => "the first questions" |
07:28:21 | FromDiscord | <eerbium> (edit) "questions" => "question" |
07:28:27 | FromDiscord | <heysokam> but a systems language can do literally anything already |
07:28:31 | FromDiscord | <eerbium> by the second question I mean everything in the realm of computer sicnece |
07:28:40 | FromDiscord | <heysokam> giving it another layer after that makes not much sense |
07:29:04 | FromDiscord | <eerbium> In reply to @heysokam "but a systems language": C is not used for an AI website |
07:29:08 | FromDiscord | <heysokam> the fact that they are not -usually- used for other things is not that it cant be done, just that for x or y reasons its -easier- to do in other langs |
07:29:21 | FromDiscord | <demotomohiro> It seems Nim can do anything C can do. |
07:29:22 | FromDiscord | <eerbium> (edit) "In reply to @heysokam "but a systems language": C is not used for an AI website ... " added "(eg)" |
07:29:24 | FromDiscord | <heysokam> In reply to @eerbium "C is not used": but it could |
07:29:59 | FromDiscord | <heysokam> you would write C that you compile to wasm or wasi and run that from a simple ts/js glue layer |
07:30:08 | FromDiscord | <heysokam> and you would have your ai website in C |
07:30:27 | FromDiscord | <eerbium> hm well then why is nim not widely adopted |
07:30:47 | FromDiscord | <heysokam> because its very niche, and people tend to not like python syntax |
07:31:05 | FromDiscord | <heysokam> but feature-wise, its up to par to cpp/c/rust/python/younameit |
07:31:07 | FromDiscord | <eerbium> the 2nd part is understandable but how is it niche? |
07:31:16 | FromDiscord | <heysokam> 🤷♂️ |
07:31:24 | FromDiscord | <graveflo> are you asking if nim is turing complete? |
07:31:32 | FromDiscord | <heysokam> i heard different opinions. but nobody knows is the only real one i assume |
07:31:50 | FromDiscord | <heysokam> (edit) "nobody knows" => ""nobody knows"" |
07:32:21 | FromDiscord | <eerbium> languages like Zig are not even 1.0 yet they are seeing widespread adoption but not nim |
07:34:15 | FromDiscord | <heysokam> sent a long message, see http://ix.io/4ywV |
07:35:12 | FromDiscord | <heysokam> imo, nim is better than those just because prototyping speed is ridiculously faster, due to the syntax and stdlib↵but... everybody has their preferences |
07:35:12 | FromDiscord | <evissim> Popularity is usually more complicated than good = popular, with how a language markets itself, what projects use it and get exposure etc |
07:35:21 | FromDiscord | <demotomohiro> Maybe there are many people don`t like python-like syntax? |
07:35:41 | FromDiscord | <graveflo> yea I think that content creators could do a lot to increase nims popularity |
07:36:05 | FromDiscord | <heysokam> ^ in my experience, a lot of them. like a lot |
07:36:34 | FromDiscord | <heysokam> imo its more rare to find a systems programmer that likes python syntax than the opposite |
07:36:43 | FromDiscord | <heysokam> (edit) "syntax" => "syntax," |
07:36:50 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/wiki/Organizations-using-Nim |
07:37:12 | FromDiscord | <toma400> In reply to @heysokam "because its very niche,": That was one of the reasons I so fell in love with Nim... it's so clean language to write code in, unlike C-syntaxed ones |
07:37:21 | FromDiscord | <heysokam> yeah agreed |
07:38:08 | FromDiscord | <heysokam> its so hard to write ugly nim. like you have try really hard, and it still looks somewhat clean |
07:38:44 | FromDiscord | <Elegantbeef> You can just read sokam's code for ugly nim |
07:39:02 | FromDiscord | <Elegantbeef> `a : t` is just wrong 😛 |
07:40:31 | FromDiscord | <demotomohiro> Nim is detected by antivirus softwares can be another reason:↵https://internet-of-tomohiro.netlify.app/nim/faq.en.html#nim-compiler-is-nimslashnimble-virus-or-malwareqmark |
07:40:54 | FromDiscord | <graveflo> oh yea I forgot about that one |
07:40:59 | FromDiscord | <heysokam> tru 🙈 |
07:41:12 | FromDiscord | <heysokam> but it would be `a :Type` though |
07:41:44 | FromDiscord | <demotomohiro> I heard Nim is detected by antivirus soft and some companys dont allow to use Nim. |
07:44:05 | FromDiscord | <graveflo> couple goofballs write some malware and now the standard library has a false positive fingerprint. Again an exposure problem. Clean examples in the wild would improve the heuristic scanners |
07:44:31 | FromDiscord | <eerbium> well I mean the thing is Nim doesnt have any unique reason to use it |
07:44:52 | FromDiscord | <eerbium> Most people in a job know python, js, java |
07:45:13 | FromDiscord | <eerbium> They will just use that they dont have any need to take the effort to use nim |
07:45:31 | FromDiscord | <graveflo> I understand the reasoning. Sometimes you want to know what the gimmick is. Its essentially syntax, meta-programming and feature implementation |
07:46:26 | FromDiscord | <graveflo> there is a way to do things in nim that exposes high level design patterns in a simple low level way. It's pretty remarkable when you start to learn the ropes |
07:49:17 | FromDiscord | <toma400> In reply to @eerbium "well I mean the": If you love Python, but are annoyed by lack of private access modifiers, poor strict typing or performance, Nim is absolutely has all reasons to use it |
07:49:31 | FromDiscord | <eerbium> I dont mean for production |
07:49:32 | FromDiscord | <toma400> And in my case, it's also gateway to low-level, as it is optional in Nim |
07:49:34 | FromDiscord | <eerbium> I mean for prototyping |
07:50:07 | FromDiscord | <graveflo> performance is pretty much the only issue in python tbh |
07:50:10 | FromDiscord | <Elegantbeef> Nim is great for prototyping |
07:50:14 | FromDiscord | <eerbium> during production most companies use languages they developed themselves |
07:50:24 | FromDiscord | <Elegantbeef> Yea like C/C++/Rust |
07:50:33 | FromDiscord | <Elegantbeef> Totally languages developed in house |
07:50:49 | FromDiscord | <Elegantbeef> There are only a few places that use in house languages |
07:50:52 | FromDiscord | <Elegantbeef> Shiro games being one |
07:50:53 | FromDiscord | <toma400> In reply to @graveflo "performance is pretty much": The only issue that is very solid. Dynamic system is two-sided sword, so it's huge issue, but also huge benefit. |
07:50:58 | FromDiscord | <eerbium> I dont mean like the top 10 companies |
07:51:26 | FromDiscord | <Elegantbeef> Also left out distributing python isnt great |
07:51:28 | FromDiscord | <eerbium> Almost every person I know with a job in the tech sector says that they code in some language you wont even find on google |
07:51:46 | FromDiscord | <Elegantbeef> Why don't I believe that |
07:52:29 | FromDiscord | <graveflo> because it would be a nightmare. Your friends work for companies that makes questionable decisions |
07:53:15 | FromDiscord | <toma400> In reply to @eerbium "Almost every person I": This doesn't make sense honestly, it's a suicidal decision to take |
07:53:34 | FromDiscord | <eerbium> well a lot of them are in TCS and Infosys which are the largest tech companies in India with |
07:53:46 | FromDiscord | <eerbium> (edit) removed "with" |
07:54:01 | FromDiscord | <graveflo> unless we are talking about weird scripting langs that are basically bloated config files made for people who don't know how to code |
07:54:08 | FromDiscord | <toma400> Like, even picking Nim (googlable thing) is hard because of how niche it is, thus making use of libraries harder, as there isn't too big range of them to choose↵That pushes you back a lot when creating whatever service |
07:54:43 | FromDiscord | <toma400> In reply to @graveflo "unless we are talking": You reminded me of times I "coded" mods for Battle for Wesnoth ❤️ |
07:54:43 | FromDiscord | <eerbium> but doesnt Nim have interop with c/cpp/js? |
07:54:44 | FromDiscord | <emanresu3> Anyone else sad about Nim usage in stackoverflow's 2023 survey? |
07:54:55 | FromDiscord | <Elegantbeef> Hey it's in SO's survey |
07:54:58 | FromDiscord | <Elegantbeef> That's a first |
07:55:01 | FromDiscord | <graveflo> In reply to @eerbium "but doesnt Nim have": yes |
07:55:06 | FromDiscord | <toma400> In reply to @eerbium "but doesnt Nim have": It has, yeah. I got to learn using C libs in my code indeed. |
07:55:12 | FromDiscord | <Elegantbeef> You still have to write the bindings |
07:55:25 | FromDiscord | <Elegantbeef> Futhark exists but no one wants to use Nim to just write C |
07:56:35 | FromDiscord | <graveflo> true that. One of the biggest things that I think nim could alleviate compared to C is in build systems. C and C++ build systems make me want to swallow pills |
07:56:35 | FromDiscord | <Elegantbeef> Also grave, grats on the first PR 😄 |
07:56:40 | FromDiscord | <graveflo> ty |
07:56:46 | FromDiscord | <eerbium> I think I will still go with typescript and rust better to use the language better in their thing than an all rounder |
07:57:01 | FromDiscord | <Elegantbeef> Have fun |
07:58:57 | FromDiscord | <Elegantbeef> Who really expects the person with tate as a pfp to be sensible 😄 |
08:00:22 | FromDiscord | <eerbium> yeah if that were the case nim would be the one in job searches not js |
08:06:30 | FromDiscord | <toma400> sent a long message, see http://ix.io/4yx3 |
08:07:25 | FromDiscord | <Elegantbeef> Well the language might have some warts but it's a really good premise |
08:08:07 | FromDiscord | <Elegantbeef> I have very little interest in using anything else myself, as someone that technically is a hobbyist there just is not anything that really stands out |
08:27:13 | FromDiscord | <toma400> sent a long message, see http://ix.io/4yx8 |
08:47:36 | FromDiscord | <heysokam> sent a code paste, see https://paste.rs/8kyBK |
08:48:49 | FromDiscord | <graveflo> you want to simply silence it or is it causing a breakage? |
08:49:01 | FromDiscord | <heysokam> just silence it, since its not relevant to this project |
08:49:12 | FromDiscord | <graveflo> redirect stdout and srderr |
08:49:19 | FromDiscord | <graveflo> (edit) "srderr" => "stderr" |
08:49:33 | FromDiscord | <heysokam> how? im just launching `nimble mytask` from console |
08:50:21 | FromDiscord | <heysokam> and the rest of the output is great, and useful for everything im doing. not all of stdout is useless, only those messages |
08:50:37 | FromDiscord | <graveflo> I'm not sure if nim has a boxed up way to do this but you should be able to give that nimble invokaction a pipe for stdout and stderr. You can filter the messages from this pipe and re-emit them to the real stdout and stderr |
08:51:01 | FromDiscord | <graveflo> or re-emit a filtered version |
08:51:13 | FromDiscord | <heysokam> wouldn't that be system-specific for my pc? |
08:51:57 | FromDiscord | <graveflo> yes but it's a common thing. It either exists already for nim or you can make it without too much grief. Dont quote me on that. There might be a simpler way but thats all I know |
08:52:12 | FromDiscord | <graveflo> what proc are you using to start the subprocess? |
08:52:33 | FromDiscord | <heysokam> then it defeats the purpose of using nimble at all. i would rather just write my own script than require every user of the buildsystem to do that as a pre-requisite 😔 |
08:53:05 | FromDiscord | <graveflo> well I mean you can support nix and windows and pretty much have all your bases covered |
08:53:08 | FromDiscord | <heysokam> In reply to @graveflo "what proc are you": `nimble mytask` |
08:53:26 | FromDiscord | <graveflo> oh so they run nimble straight up not from a nim program? |
08:53:30 | FromDiscord | <heysokam> yeah |
08:53:36 | FromDiscord | <heysokam> no not from a nim program |
08:53:39 | FromDiscord | <graveflo> then you might have to modify nimble LOL |
08:53:43 | FromDiscord | <graveflo> or PR it or something |
08:54:01 | FromDiscord | <heysokam> its just nimble being there for solving the dependency, and launching the buildsystem app |
08:54:52 | FromDiscord | <graveflo> you could make your system such that there is a valid nimble path and that nimble path runs the bootstrap for your program |
08:55:08 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4yxe |
08:55:33 | FromDiscord | <heysokam> its just easier to self-contain everything with nimble solving the dependency auto |
08:56:42 | FromDiscord | <heysokam> In reply to @graveflo "you could make your": i thought about distributing nim like zig does, but i think that might be overkill 🤔 |
08:56:48 | FromDiscord | <graveflo> well I idk how to change the way nimble works without modifying nimble or messing with it using code beforehand. Maybe it's ok that confy must be installed. That is very normal requirement in these scenarios |
08:57:07 | FromDiscord | <graveflo> unless you require a launcher but thats even more complicated |
08:57:46 | FromDiscord | <heysokam> In reply to @graveflo "well I idk how": but the user is already installing cmake, rust, and nim to build this project specifically↵i think one less friction point should be good |
08:58:22 | FromDiscord | <heysokam> confy does not require those, so its fine for other stuff. but this project is already a bit dependency-heavy |
08:58:27 | FromDiscord | <graveflo> hey installers and package managers make this really easy for users on the OS level |
08:58:50 | FromDiscord | <graveflo> not that supporting every linux distro is easy though 😆 |
08:58:56 | FromDiscord | <heysokam> yeah, the same can be argued about anything. you can do all of it manually. its just that removing one step is never a bad thing |
08:59:12 | FromDiscord | <heysokam> the less steps the less friction |
09:00:38 | FromDiscord | <graveflo> yea I can only think that modifying nimble to have a warning suppression flag or having a launcher are your two ways to make that happen. I can't see how it would be possible otherwise |
09:01:01 | FromDiscord | <heysokam> yeah i figure. i was just wondering if that flag already exists in nimble |
09:01:42 | FromDiscord | <graveflo> there is `--silent` |
09:01:58 | FromDiscord | <graveflo> but that has no filter |
09:02:37 | FromDiscord | <graveflo> wait a minute how are you going to pass the flag in the first place |
09:02:45 | FromDiscord | <heysokam> and the user needs to add it themselves, otherwise it would be good enough i guess |
09:02:47 | FromDiscord | <graveflo> something isn't adding up here |
09:03:11 | FromDiscord | <graveflo> oh if the user has to add it then that is even worse then requiring the install i say |
09:03:20 | FromDiscord | <heysokam> yeah |
09:03:58 | FromDiscord | <graveflo> I wouldn't worry about it. A tool that solves a problem is worth a single command |
09:04:14 | FromDiscord | <graveflo> especially if you have a build script or an installer / package |
09:04:19 | FromDiscord | <graveflo> no one will care |
09:04:52 | FromDiscord | <heysokam> yeah for sure. but im just looking for ways to improve the usability. and those messages there are irrelevant noise to the person who doesn't know they are irrelevant noise |
09:05:11 | FromDiscord | <graveflo> understandable |
09:06:19 | FromDiscord | <heysokam> i could change my `build.nim` file to make it have the same name as the project, and that would solve the warning. but that would require an extra step for setting up the basic structure. and the whole point is to not have any setup unless needed |
09:07:41 | FromDiscord | <heysokam> well, only the hint would be solved, though i believe |
09:07:48 | FromDiscord | <heysokam> the warning would still be there if im not mistaken |
09:08:04 | FromDiscord | <heysokam> (edit) "solved, though" => "solved though," |
09:08:43 | FromDiscord | <graveflo> I imagine that just pulling up the folder and running a single command would be ideal regardless of the setup. Like if someone could just go to the folder and type `confy build` and then it just works. It doesnt matter what needs to be installed really |
09:09:01 | FromDiscord | <graveflo> a simple setup script might be the key if you want prime usability |
09:09:07 | FromDiscord | <heysokam> that would mean i have to distribute a binary |
09:09:15 | FromDiscord | <heysokam> but the buildsystem is a library |
09:09:27 | FromDiscord | <heysokam> i thought about that, but im not liking the launcher idea so far 🤔 |
09:09:35 | FromDiscord | <graveflo> or you could use nimble. It could build the cli tool that drops the file and auto installs in a single command |
09:10:11 | FromDiscord | <heysokam> In reply to @graveflo "a simple setup script": you mean something that initializes the project like git init or nimble init? |
09:10:27 | FromDiscord | <graveflo> yea basically |
09:10:45 | FromDiscord | <heysokam> not a bad idea. but how do you do that with just source code and no binary? |
09:11:16 | FromDiscord | <heysokam> would be a useful feature if i went the `nimble install confy` route, and distribute some basic launcher functionality |
09:11:20 | FromDiscord | <graveflo> nimble can create the binary on install I think.. Ive never used it so I might be totally wrong |
09:12:01 | * | marcus quit (Remote host closed the connection) |
09:12:07 | FromDiscord | <heysokam> yeah totally. but the idea about confy is that it is not a binary, so i don't have to hardcode what you will do. i can keep it configurable thanks to the code just being a set of functions that are called from the scripts |
09:12:34 | FromDiscord | <heysokam> (edit) "the" => "your" |
09:13:17 | FromDiscord | <heysokam> so while in buildsystems you usually setup a script that is run from a harcoded binary... in confy your script is actually a true app that you build |
09:13:32 | FromDiscord | <heysokam> (edit) "run" => "run/interpreted" |
09:13:45 | FromDiscord | <heysokam> (edit) "so while in buildsystems you usually setup a script that is run/interpreted from a harcoded binary... in confy your script is actually a true app that you build ... " added "yourself" |
09:13:58 | FromDiscord | <graveflo> I guess what I'm saying is you can make a cli tool that automates the setup process to make nimble happy. It even has the potential to branch out into bigger things like auto downloading known working install configs. Ah well maybe this is just getting complicated. I'm sure just installing confy through nimble is best for now |
09:14:02 | * | marcus joined #nim |
09:14:08 | FromDiscord | <heysokam> (edit) "yourself" => "yourself. the usability im looking for is making this last step easy to do" |
09:14:48 | FromDiscord | <heysokam> In reply to @graveflo "I guess what I'm": for the launcher route it definitely is the simplest way, yeah |
09:23:39 | * | robertmeta quit (Server closed connection) |
09:24:15 | * | robertmeta joined #nim |
09:53:55 | NimEventer | New thread by alexeypetrushin: Why json hooks doesn't work for CountTable[int], see https://forum.nim-lang.org/t/10281 |
10:07:49 | FromDiscord | <Require Support> iirc nim ny default builds a debug build but using `when defined(debug)` does not run the code within. what is wrong? |
10:08:28 | FromDiscord | <Require Support> (edit) "ny" => "by" |
10:12:56 | FromDiscord | <graveflo> manually pass `-d:debug` to define it |
10:13:10 | FromDiscord | <graveflo> idk if that is intentional or not on nims side |
10:25:27 | FromDiscord | <spotlightkid> Or use `when not defined(release)` |
10:25:55 | FromDiscord | <graveflo> is there a proc that dumps all defined variables? I would have used that multiple times by now |
11:04:33 | FromDiscord | <graveflo> It's the `dump` cli option. How do I always misread those |
11:08:36 | * | ixmpp quit (Server closed connection) |
11:12:39 | FromDiscord | <gogolxdong666> Does Nim support macOS m2? |
11:17:39 | FromDiscord | <graveflo> it builds from system compiler so I would guess so. I don't know for sure though |
11:18:32 | FromDiscord | <spotlightkid> why wouldn't it? |
11:20:00 | FromDiscord | <spotlightkid> If you want to build for macos arm64 on macos intel, you probably have to use the right `--passC:` / `--passL:` options. |
11:20:27 | FromDiscord | <graveflo> M2s still have objectivec support right? |
11:20:54 | FromDiscord | <graveflo> or more accurately, the other way around |
11:32:14 | FromDiscord | <tauruuuuuus> does anyone know if there is a way to check for cygwin/mingw within a nim.cfg file? It seems like `@if windows:` is not enough |
11:51:45 | FromDiscord | <Saint> Does the nim lsp support listing all symbols? |
11:52:13 | FromDiscord | <Saint> Also does anyone have thoughts on mojo compared to nim? |
11:58:22 | FromDiscord | <toma400> In reply to @Saint "Also does anyone have": Mojo isn't even publicly available, right? It feels very speculative at the moment to me, so I wait for real implementation |
12:02:36 | FromDiscord | <emanresu3> hype is everything |
12:03:40 | FromDiscord | <Saint> https://github.com/nim-lang/langserver |
12:03:49 | FromDiscord | <Saint> Anyone use this vs https://github.com/PMunch/nimlsp |
12:03:53 | FromDiscord | <Saint> @pmunch |
12:04:14 | FromDiscord | <Saint> Is there a lot of work to get workspace/symbol in nimlsp? |
12:04:39 | * | azimut joined #nim |
12:07:22 | FromDiscord | <Saint> Oooh nim-langserver already is in nvim-lspconfig |
12:07:26 | FromDiscord | <Saint> Will give it a spin |
12:24:35 | FromDiscord | <pmunch> They're pretty similar, mostly different architectures around the same base tool (nimsuggest). Workspace/symbol shouldn't be too hard I believe, I think nimsuggest already has that information on offer |
12:31:43 | FromDiscord | <salt rock lamp> I have been meaning to try adding nimlsp to nvim-lspconfig for a while |
12:32:23 | FromDiscord | <salt rock lamp> It's not that hard to add a new config |
12:49:32 | * | Onionhammer quit (Ping timeout: 240 seconds) |
12:49:44 | FromDiscord | <michaelb.eth> In reply to @tauruuuuuus "does anyone know if": one approach would be to use an MSYS2 environment and check if env var `MSYSTEM` is set, assuming nim.cfg can check env vars (config.nims can do that) |
12:52:40 | * | Onionhammer joined #nim |
13:34:43 | FromDiscord | <krab4t> what the difference between langserver and nimlsp? |
13:43:09 | * | derpydoo joined #nim |
13:44:52 | FromDiscord | <krab4t> ` Both nimlangserver and nimlsp are based on nimsuggest, but the main difference is that nimlsp has a single specific version of nimsuggest embedded in the server executable, while nimlangserver launches nimsuggest as an external process. This allows nimlangserver to handle any nimsuggest crashes more gracefully. ` |
14:26:51 | NimEventer | New thread by mantielero: Macro - global var behaviour, see https://forum.nim-lang.org/t/10282 |
14:26:53 | FromDiscord | <krab4t> https://pastebin.com/ZaVWet1g something fishy happens here |
14:27:11 | FromDiscord | <krab4t> it prints |
14:27:37 | FromDiscord | <krab4t> result is sequence of 2 strings |
14:27:52 | FromDiscord | <krab4t> of first iteration: `1. result1` |
14:28:12 | FromDiscord | <krab4t> on second: `1. result1\n 1.result1\n 2.result2\n` |
14:28:43 | FromDiscord | <krab4t> result1 result2 just a text |
14:28:51 | NimEventer | New thread by mantielero: Play nim - not working?, see https://forum.nim-lang.org/t/10283 |
14:34:10 | FromDiscord | <Yardanico> In reply to @krab4t "https://pastebin.com/ZaVWet1g something fishy happe": `myText.add("$1$2. $3\n" % [myText, $pos, r])` |
14:34:12 | FromDiscord | <Yardanico> you're adding myText to itself |
14:40:14 | FromDiscord | <krab4t> yes |
14:40:42 | FromDiscord | <Yardanico> so what is the issue? |
14:41:25 | FromDiscord | <krab4t> twice result1 |
14:41:28 | FromDiscord | <odexine> Because you’re adding my text to itself |
14:41:39 | FromDiscord | <Yardanico> In reply to @krab4t "twice result1": after first iteration your myText will have 1. result1 |
14:41:45 | FromDiscord | <Yardanico> and on the second iteration you're adding myText to myText |
14:41:47 | FromDiscord | <odexine> You’re doing result = result + result + other stuff |
14:41:48 | FromDiscord | <krab4t> https://pastebin.com/1dZpeR4H same in python works fine |
14:41:57 | FromDiscord | <Yardanico> In reply to @krab4t "https://pastebin.com/1dZpeR4H same in python": it is not the same |
14:42:05 | FromDiscord | <Yardanico> in Nim you're `.add` ing to the string |
14:42:06 | FromDiscord | <odexine> You’re doing a set = not an add |
14:42:09 | FromDiscord | <Yardanico> in Python you're changing the string itself |
14:42:26 | FromDiscord | <krab4t> rip |
14:42:27 | FromDiscord | <odexine> Nim add is Python append |
14:42:54 | FromDiscord | <Yardanico> also can't you rework this to actually use `add` without having to reassign text itself? |
14:42:57 | FromDiscord | <Yardanico> it should be simpler too |
14:43:35 | FromDiscord | <krab4t> i see i did assignment in python |
14:44:43 | FromDiscord | <krab4t> nimlangserver https://i.imgur.com/jieGeXG.png |
14:45:49 | FromDiscord | <Yardanico> is that with vscode? |
14:46:06 | FromDiscord | <Yardanico> maybe your IDE is opening a different lsp "project" for each file |
14:46:22 | FromDiscord | <Yardanico> I'm happy with nimsaem in vscode without lsp, but I've used nimlsp before (not nimlangserver) and it didn't lead to a lot of processes like this |
14:46:26 | FromDiscord | <Yardanico> (edit) "I'm happy with nimsaem in vscode without lsp, but I've used nimlsp before (not nimlangserver) ... and" added "in other editors" |
14:49:13 | FromDiscord | <Yardanico> oh nvm i see, it's nimlangserver itself doing this |
14:49:32 | FromDiscord | <Yardanico> well, nimlsp bundles nimsuggest as a library so it might be better, give it a try :) |
14:52:24 | FromDiscord | <krab4t> now just one with projectMapping configuration as described on github page |
14:53:48 | FromDiscord | <krab4t> my telegram bot in python variant uses 50mb, and just 1mb in nim ... |
15:03:21 | FromDiscord | <krab4t> working with sqlite relations in norm https://pastebin.com/B1pecktW most pepega thing ive ever seen |
15:05:01 | FromDiscord | <krab4t> in ponyorm https://pastebin.com/GeZ1Nu17 |
15:16:06 | * | rockcavera joined #nim |
15:54:48 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
15:55:15 | * | antranigv joined #nim |
16:12:29 | FromDiscord | <tauruuuuuus> In reply to @michaelb.eth "one approach would be": I can't believe I've been working without knowing that config.nims was a thing... |
16:12:37 | FromDiscord | <tauruuuuuus> so much easier and clean, thanks a lot! |
16:39:54 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4yz1 |
16:40:37 | FromDiscord | <Ras> i tried narrowing it down and removing cruft which i thought might be causing this, like removing the global var seq etc, but nothing seemed to help at all |
16:44:31 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4yz2 |
16:44:56 | * | azimut quit (Ping timeout: 240 seconds) |
16:49:52 | FromDiscord | <Ras> testing it now, it seems to always happen on the fifth opened connection |
16:55:23 | FromDiscord | <yg0068> Hey guys. Never thought I'd be asking this, but does nimble develop work for anyone since it was reimplemented? How do I make project A see dependency B, which is only available locally? |
17:13:13 | FromDiscord | <Ras> In reply to @Ras "testing it now, it": interestingly enough, when i add something like printing the `seq[Player]` after every connection, the second connection already crashes it |
17:14:00 | FromDiscord | <Ras> if i change things around so that less is printed, then the third connection crashes it |
17:14:15 | FromDiscord | <Ras> is this some sort of gc thing? it kind of smells like it |
17:15:57 | FromDiscord | <k0ts> In reply to @yg0068 "Hey guys. Never thought": I've heard that `nimble develop --global` makes it work similarly to the old behavior |
17:15:59 | FromDiscord | <Ras> yeah, if i do `--gc:none`, i don't get any crashes |
17:16:02 | FromDiscord | <Ras> how do i appease the gc gods? |
17:20:56 | FromDiscord | <Ras> that doesn't look good |
17:20:58 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4yz8 |
17:21:30 | FromDiscord | <Ras> (this is me experimenting with `useMalloc`, which also crashes) |
17:26:02 | FromDiscord | <Ras> so what am i doing wrong? |
17:26:03 | FromDiscord | <Ras> sent a code paste, see https://paste.rs/Fp86n |
17:33:38 | FromDiscord | <yg0068> In reply to @k0ts "I've heard that `nimble": Yeah, that doesn't work for me. The link is created, but Nim just doesn't see it :(. That's why I wonder if anyone really uses it, or just "heard of it" 🙂 |
17:34:29 | FromDiscord | <k0ts> I just tried it with a dummy project and local dependency and it worked |
17:35:57 | FromDiscord | <Yardanico> In reply to @Ras "yeah, if i do": how long ago you installed devel? |
17:36:12 | FromDiscord | <Yardanico> it might be a but with orc, meanwhile try `--mm:refc`, it's the old GC |
17:36:14 | FromDiscord | <Yardanico> (edit) "but" => "bug" |
17:36:16 | FromDiscord | <Ras> about 30 minutes ago, `choosenim devel --latest` |
17:36:37 | FromDiscord | <Ras> but it was also happening with the one that's installed without `--latest` |
17:36:43 | FromDiscord | <Yardanico> `--mm:arc` won't really work for you because async has cycles which `arc` doesn't deal with (only `orc` does) |
17:37:33 | FromDiscord | <Yardanico> In reply to @Ras "but it was also": it'll probably work with `--mm:refc`, but please report it on github issues anyway, orc issues are pretty important |
17:38:26 | FromDiscord | <Ras> you're right, refc works great |
17:39:12 | FromDiscord | <Ras> i'll try to report it, problem is making a minimal proof of concept... |
17:39:23 | FromDiscord | <Ras> it doesn't _seem_ to be happening with something minimal like a chat server |
17:39:28 | FromDiscord | <Ras> and i'm not really sure what is triggering it |
17:39:41 | FromDiscord | <Yardanico> In reply to @Ras "i'll try to report": i think it's worth to report it even in the current state, your project doesn't look too complex |
17:39:49 | FromDiscord | <Yardanico> seems like you're trying to write a minecraft server? |
17:40:11 | FromDiscord | <Ras> yep, for classic (initially, then implement the classic extensions as well) |
17:40:26 | FromDiscord | <Ras> good guess :D |
17:41:45 | FromDiscord | <Yardanico> In reply to @Ras "more complete stack trace:": btw, the usual way to debug memory stuff with orc is with `-d:useMalloc --mm:orc` and then run that with `valgrind --leak-check=full ./binary` |
17:45:02 | FromDiscord | <k0ts> In reply to @yg0068 "Yeah, that doesn't work": After doing nimble develop, do you then compile your project through nimble (with `nimble build` or something) or directly with `nim c`? If the latter, you might need to `nimble setup` first so Nim knows where to find the local dependency. |
17:53:11 | FromDiscord | <Ras> In reply to @yardanico "btw, the usual way": hmmm, it doesn't seem to crash when running it with valgrind, is this.. normal? |
17:58:47 | FromDiscord | <yg0068> In reply to @k0ts "After doing nimble develop,": Interesting. I'm using `nim c`. Just did `nimble develop -g` in project A, went to project B, and did `nimble setup`. New files appeared, but they don't mention A, and B doesn't compile. Am I doing it wrong? |
17:59:10 | FromDiscord | <Yardanico> In reply to @Ras "hmmm, it doesn't seem": It might not crash but it should show errors |
18:00:15 | FromDiscord | <Ras> oh yeah, `ERROR SUMMARY: 3257 errors from 183 contexts (suppressed: 0 from 0)` |
18:01:42 | FromDiscord | <k0ts> In reply to @yg0068 "Interesting. I'm using `nim": Odd, I'm doing the exact same thing and it works for me. |
18:04:30 | FromDiscord | <k0ts> Right, did you add requires "A" to B.nimble? |
18:04:51 | FromDiscord | <yg0068> In reply to @k0ts "Odd, I'm doing the": Ah, one of the dependencies was missing from the nimble file. It seems to do better now. Thanks @k0ts |
18:05:32 | FromDiscord | <k0ts> glad I could help |
18:11:35 | FromDiscord | <basilajith> In reply to @Elegantbeef "I have very little": I'm willing to stick to front-end development (I want to do back-end dev more), just so that I won't have to learn other languages like TypeScript, Go, PHP, C# (.NET) etc. However, I am a bit wary about the lack of contributors in the web dev space for Nim. I'm a bit sad that people like dom96 left the Nim core team (his writing was really good).↵↵Of course, if I had the expertise, I |
18:11:52 | FromDiscord | <michaelb.eth> In reply to @tauruuuuuus "so much easier and": Glad to help! |
18:30:57 | * | krux02 joined #nim |
18:39:13 | * | nyeaa492842301 quit (Ping timeout: 265 seconds) |
18:42:07 | * | nyeaa492842301 joined #nim |
18:42:39 | * | Ekho quit (Server closed connection) |
18:55:30 | * | derpydoo quit (Ping timeout: 240 seconds) |
18:57:23 | * | Ekho joined #nim |
19:20:00 | * | ntat quit (Quit: Leaving) |
19:20:08 | FromDiscord | <Elegantbeef> @basilajith as someone that doesnt do web dev, I can only joke "Good you can now work on better things" 😄 |
19:25:44 | FromDiscord | <voidwalker> are there some known issues with argument matching for generic procs? Or maybe I am just stupid |
19:25:58 | FromDiscord | <Elegantbeef> Depends, likely the latter |
19:26:16 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4yzu |
19:27:06 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4yzv |
19:27:26 | FromDiscord | <voidwalker> If I call with `udpTrackerScrape("125b77979ba4b183eb702f4ff00df9ff22c452d7", "udp://tracker.opentrackr.org:1337/announce")` - it works |
19:27:30 | FromDiscord | <Elegantbeef> `[1]: seq[string]` |
19:27:48 | FromDiscord | <Elegantbeef> People really need to stop using generics for overloading |
19:28:33 | FromDiscord | <voidwalker> yeah I get a seq[string] there but I shouldn't have a seq[string], hextoByte returns `seq[byte]` |
19:30:15 | FromDiscord | <Elegantbeef> Wait it's erroring that it's a `@[...]` which means this is erroing at line 10 |
19:30:53 | FromDiscord | <Elegantbeef> Or you've provided incorrect code |
19:30:57 | FromDiscord | <Elegantbeef> Cause there is no `@[...]` |
19:30:59 | FromDiscord | <voidwalker> it errors at the last line, when I call |
19:31:10 | FromDiscord | <Elegantbeef> But it's created a sequence |
19:31:15 | FromDiscord | <Elegantbeef> You are not passing a sequence |
19:31:21 | FromDiscord | <Elegantbeef> `udpTrackerScrape("125b77979ba4b183eb702f4ff00df9ff22c452d7", parseUri("udp://tracker.opentrackr.org:1337/announce"))` |
19:31:23 | FromDiscord | <Elegantbeef> Does not have a sequence |
19:31:32 | FromDiscord | <Elegantbeef> So where the hell does the sequence get injected?! |
19:32:49 | FromDiscord | <voidwalker> well the second generic/overload proc should make it into a sequence, cause the main proc is written to take a sequence. But it should not be a `seq[string]`, but `seq[seq[byte]` |
19:33:00 | FromDiscord | <voidwalker> ` await udpTrackerScrape(@[infoHash], tracker)` |
19:33:04 | FromDiscord | <Elegantbeef> Cool, but that's not what's happening |
19:33:28 | FromDiscord | <Elegantbeef> We're not even getting into that proc |
19:33:29 | FromDiscord | <Elegantbeef> It's converting your string into a sequence then erroring |
19:34:57 | FromDiscord | <Elegantbeef> Do you accidentally have another usage somewhere with `@["mystring"]` inside it |
19:34:59 | FromDiscord | <Elegantbeef> Cause that's what it looks like |
19:35:13 | FromDiscord | <Elegantbeef> You either forgot to save, forgot to delete a line, or forgot to implement something |
19:36:44 | FromDiscord | <voidwalker> welp 😦 that was it. hidden between the forest of code, was a template that I written long ago to do the overload |
19:38:09 | FromDiscord | <voidwalker> time for more overloads now : P |
19:38:28 | FromDiscord | <Elegantbeef> As much as people complain about Nim's errors, many times the code they're compiling is worse 😛 |
19:45:34 | FromDiscord | <voidwalker> what is a good strategy here ? I made the main function to work with seq cause the protocol is supposed to allow n hashes to query. And I want to call it with hexstring(s), binary data, string url, Uri |
19:45:54 | FromDiscord | <Elegantbeef> I'd use distinct strings myself, but you do you |
19:47:10 | FromDiscord | <voidwalker> distinct strings for hex hash params ? |
19:47:28 | FromDiscord | <Elegantbeef> Yep |
19:48:18 | FromDiscord | <voidwalker> oh like type casted string in the calling proc ? |
19:48:28 | FromDiscord | <Elegantbeef> `type HexString = distinct string` |
19:48:44 | FromDiscord | <Elegantbeef> then if you want to use hex string you do `yourProc(HexString myString)` |
19:49:09 | * | mad_toothbrush joined #nim |
19:50:46 | * | derpydoo joined #nim |
19:52:27 | mad_toothbrush | Hi folks. A question. Is it possible to get formatted output using echo in a --os=standalone environment ? I was hoping I could provide a low level 'putc' like implementation and register it somehow with Nim. Kind of like Rust's fmt::Debug trait. Is that possible ? Thanks. |
19:53:02 | FromDiscord | <Elegantbeef> You could implement your own echo variation |
19:53:52 | FromDiscord | <Elegantbeef> https://hatebin.com/asjyrgralz |
19:54:03 | FromDiscord | <Elegantbeef> replace `yourPrinter` with whatever you decide for your `putc` variation |
19:54:51 | FromDiscord | <Elegantbeef> Nim is designed quite nicely in a way that 90% of things are implemented in userspace which means you can pretty much replicate most things the system module does |
19:55:26 | FromDiscord | <voidwalker> is this too awful ? : D |
19:55:28 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4yzB |
19:55:46 | FromDiscord | <Elegantbeef> Yes you've successfully re-implemented overloading |
19:56:05 | FromDiscord | <Elegantbeef> God you like repeating yourself |
19:56:44 | mad_toothbrush | Thanks Elegantbeef! :) I'm looking at your hatebin example. For some reason play.nim-lang.org won't open. |
19:57:45 | mad_toothbrush | I'm a complete Nim n00b so please bear with me but wouldn't I need to implement the business logic for different format specifiers on a case by case basis ? (I must be missing something very obvious - apologies!) |
19:58:05 | FromDiscord | <Elegantbeef> you could use `std/strformat` but Nim's echo doesnt do any formatting |
19:58:14 | mad_toothbrush | Ah, I see. |
19:58:52 | FromDiscord | <Elegantbeef> `myEcho fmt"{a}, {b}, {c}"` or `myEcho "$#, $#, $#" % [$a, $b, $c]` from strutils |
20:03:44 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4yzD |
20:04:25 | FromDiscord | <Elegantbeef> If you want a plugin system you'll want to use system libraries or wasm |
20:04:38 | FromDiscord | <Elegantbeef> I'm pretty preferential to using wasm, but system libraries work aswell |
20:06:06 | FromDiscord | <toma400> In reply to @Elegantbeef "I'm pretty preferential to": Could you guide me to some resources? ^^ |
20:06:36 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/dynlib.html |
20:06:42 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasm3 |
20:06:55 | FromDiscord | <Elegantbeef> I'd say that unless you really really need a plugin system this is not wise |
20:07:03 | FromDiscord | <Elegantbeef> My entire game compiles in like 4 seconds |
20:08:32 | FromDiscord | <dissolved.girl> What's the performance like using wasm? Much overhead when calling stuff from wasm? |
20:08:47 | FromDiscord | <Elegantbeef> No clue don't really care |
20:09:12 | FromDiscord | <Elegantbeef> It's meant for agnostic scripting, wasm3 is a fast enough vm for that |
20:09:47 | FromDiscord | <toma400> In reply to @Elegantbeef "I'd say that unless": Well, I'm working on playground right now, so it's more on experimental side anyway. And I want to see how much python-like systems I can bring into Nim, it gives a lot of space for users to dynamically embbed scripts.↵Thanks a lot for the links ^^ |
20:10:12 | FromDiscord | <Elegantbeef> Well proper Nim doesnt allow what you did so you have to do what you'd do in C/C++ |
20:10:59 | FromDiscord | <Elegantbeef> In wasm's case you'd compile your modules to `wasm` then load them and interact with them, with system libraries you'd compile to `.so` `.dll` or `dynlbi` |
20:11:02 | FromDiscord | <Elegantbeef> `dynlib` even |
20:11:34 | FromDiscord | <Elegantbeef> The major downside is that the system library isnt sandboxed and if you want to ship it to another OS you have to recompile for that platform |
20:11:45 | FromDiscord | <Elegantbeef> Wasm is really nice that it is quite literally compile once, run anywhere |
20:23:36 | FromDiscord | <jmgomez> NimScript may also work for you. I’m loading 100K+ loc sub 100ms at runtime. There are a lot of limitations compared to native Nim oc |
20:25:04 | FromDiscord | <jmgomez> If your goal is to tweak things quickly rather than shipping it may work. But it does require a lot of work to build all the necessary stuff for it to be useful though |
20:29:33 | FromDiscord | <toma400> sent a long message, see http://ix.io/4yzK |
20:30:55 | FromDiscord | <Andreas> In reply to @toma400 "I wanted to create": maybe `include` can help ? |
20:32:17 | FromDiscord | <Elegantbeef> They could make a macro to include all their directories, but it's not dynamic at runtime |
20:32:26 | FromDiscord | <jmgomez> For shipping, the real consideration to have in mind is that it performs really bad. Theoretically it can be improved but doing so it’s a project in itself. I would take a look a wasm as beef said if you want to ship it and requires decent perf |
20:33:31 | FromDiscord | <jmgomez> There are more trade off besides the perf in NimScript as it’s a subset of nim but depending on what you want to do it may no really matter |
20:33:56 | FromDiscord | <Elegantbeef> Plus there are 3000 different runtimes to choose for wasm some have JIT which can make performance even less of a concern |
20:34:18 | * | mad_toothbrush quit (Ping timeout: 252 seconds) |
20:45:24 | FromDiscord | <toma400> I will look into those resources given, so thanks a lot for those ideas from you both ^^ |
20:45:44 | FromDiscord | <toma400> Also this could be neat nudge for me to remind myself some C, I haven't spent enough time with this language yet |
22:08:29 | * | disso-peach joined #nim |
22:08:36 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yA1 |
22:24:22 | FromDiscord | <arathanis> i think const needs to be knowlable at compile time but before anything in the vm runs |
22:37:36 | FromDiscord | <voidwalker> should a proc that takes a `seq[seq[uint8]]` also be able to take a `seq[array[20, uint8]]` ? Cause i have no compile error, but I get `execution of an external program failed` in this scenario |
22:38:31 | FromDiscord | <arathanis> those types are not compatible as far as i know |
22:38:36 | FromDiscord | <arathanis> i would expect that to not work |
22:38:43 | FromDiscord | <arathanis> weird that the compiler says nothing though |
22:43:37 | FromDiscord | <voidwalker> oh I think I know what happens, it goes into infinite recursion, not actually calling the proc I wanted but the overloading one |
22:44:14 | FromDiscord | <demotomohiro> In reply to @arathanis "i think const needs": Maybe initializing const variables before running compile time code supposed to be doesn't cause strange result. |
23:23:08 | * | rockcavera quit (Remote host closed the connection) |
23:24:20 | * | rockcavera joined #nim |
23:34:19 | * | krux02 quit (Remote host closed the connection) |
23:38:06 | FromDiscord | <voidwalker> https://www.youtube.com/watch?v=iiHpi0ZkX_I&t=194s |
23:38:08 | FromDiscord | <voidwalker> this is so funny |