00:03:15 | FromDiscord | <pruno> Well, gonna fix that, for the help guys :) |
00:08:01 | * | Guest6683 joined #nim |
00:08:24 | Guest6683 | Hello |
00:08:45 | FromDiscord | <Elegantbeef> Hello |
00:11:01 | Guest6683 | I am getting a somewhat rare error or at least nothing hits on google. I am trying to use the pegs module. I am a total beginner with Nim, and have no experience with PEGs, but I am trying to parse lines like `1997 <-> 1645, 1746` and am trying to compile a program with a peg `const line_expr = peg"""{\d+} \s* '<' '-' '>' \s* { \d+ ( ',' \s* |
00:11:01 | Guest6683 | \d+ )*}"""` and I am getting an error `pegs.nim(1863, 28) Error: {} must have the set type` |
00:11:38 | Guest6683 | I have absolutely no clue what I am doing wrong there, if anyone can help |
00:11:44 | FromDiscord | <Elegantbeef> Are you trying to learn PEG or do you just want to parse that line? |
00:12:23 | Guest6683 | I am trying to learn how to use the peg module. I would otherwise just split(", ") and such |
00:12:35 | FromDiscord | <Elegantbeef> Psh you disappoint me |
00:12:55 | FromDiscord | <Elegantbeef> `line.scanf("$i <-> $i, $i", a, b, c)` 😛 |
00:13:30 | FromDiscord | <Elegantbeef> I dont know much of PEG syntax, I do know the NPeg package is fancier |
00:13:35 | Guest6683 | lol, that would work too, but in general the right hand side will have a comma seperated list, so maybe a more involved scanf |
00:13:47 | FromDiscord | <Elegantbeef> Ah |
00:14:04 | Guest6683 | I am just confused as to what is wrong with my peg |
00:15:03 | Guest6683 | The full program would be `import pegs |
00:15:03 | Guest6683 | const line_expr = peg"""{\d+} \s* '<' '-' '>' \s* { \d+ ( ',' \s* \d+ )*}""" |
00:15:04 | Guest6683 | proc partOne(x:string):int= |
00:15:04 | Guest6683 | for line in x.splitLines(): |
00:15:05 | Guest6683 | var matches = newSeq[string](0) |
00:15:05 | Guest6683 | let t = match(line,line_expr,matches) |
00:15:06 | Guest6683 | echo matches |
00:15:06 | Guest6683 | return 0 |
00:15:07 | Guest6683 | doAssert(partOne("""0 <-> 2 |
00:15:07 | Guest6683 | 1 <-> 1 |
00:15:08 | Guest6683 | 2 <-> 0, 3, 4 |
00:15:08 | Guest6683 | 3 <-> 2, 4 |
00:15:09 | Guest6683 | 4 <-> 2, 3, 6 |
00:15:09 | Guest6683 | 5 <-> 6 |
00:15:10 | Guest6683 | 6 <-> 4, 5""")==6)` which of course will fail the assert, but I will fix that later |
00:15:18 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/ |
00:15:42 | Guest6683 | https://play.nim-lang.org/#ix=3NDh |
00:15:42 | FromDiscord | <Elegantbeef> IRC doesnt support code blocks as you probably know so that's horrendeous 😛 |
00:15:52 | Guest6683 | I just found out, thank you |
00:17:14 | FromDiscord | <Elegantbeef> The error is due to https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/pegs.nim#L1863 so i dont know why |
00:17:27 | Guest6683 | I am doing the advent of code to learn nim and am trying to use different parts of the language, and thought this would be a good time to try the pegs module |
00:17:34 | Guest6683 | https://adventofcode.com/2017/day/12 |
00:17:58 | Guest6683 | I saw that and thought the error made no sense |
00:17:58 | FromDiscord | <Elegantbeef> I'd love to help but yea i know nothing of PEG |
00:18:06 | Guest6683 | Thanks for looking at least |
00:18:28 | FromDiscord | <Elegantbeef> Quite possible the library has a bug and no one has hit it? |
00:18:58 | FromDiscord | <Elegantbeef> That error goes away with `let` instead of const |
00:19:07 | FromDiscord | <Elegantbeef> So perhaps `pegs` doesnt work at CT? |
00:20:29 | Guest6683 | Ah, thanks! I just assumed it would be fine with const |
00:20:34 | Guest6683 | thank you very much |
00:21:19 | FromDiscord | <Elegantbeef> I just took a guess, dont know if it's supposed to work at CT |
00:24:03 | * | Guest6683 quit (Quit: Client closed) |
00:55:35 | NimEventer | New Nimble package! lrparser - A SLR parser written in Nim with compile-time and run-time grammar generation., see https://github.com/vanyle/lrparser/ |
00:59:17 | * | cyraxjoe quit (Ping timeout: 240 seconds) |
01:00:11 | * | cyraxjoe joined #nim |
01:07:39 | FromDiscord | <sharpcdf> is there a way to make only one c file when running `nim cc main.nim`? |
01:21:03 | FromDiscord | <leorize> nope |
01:29:58 | * | vicecea quit (Remote host closed the connection) |
01:30:19 | * | xet7 quit (Quit: Leaving) |
01:30:28 | * | vicecea joined #nim |
01:32:18 | * | xet7 joined #nim |
01:33:22 | * | jmdaemon quit (Ping timeout: 268 seconds) |
01:36:17 | FromDiscord | <sharpcdf> rip |
01:37:39 | * | jmdaemon joined #nim |
01:49:30 | FromDiscord | <Tetralux> Is it considered correct that `0..-1` tries to do `(0)..-(1)` rather than `(0)..(-1)` ? |
01:51:34 | FromDiscord | <Elegantbeef> yes |
01:51:49 | FromDiscord | <Elegantbeef> Nim allows user defined operators so `..-` could be declared |
01:52:52 | FromDiscord | <Elegantbeef> `0 .. -1` solves it |
01:53:35 | FromDiscord | <Tetralux> In reply to @Elegantbeef "`0 .. -1` solves": This is true, but that seems a bit odd that you need a space there _for that case only_.↵If you always needed that space for that syntax to work, then sure.↵Dunno - Not sure how I feel about that 😄 |
01:53:59 | FromDiscord | <Tetralux> Just something surprising that I came across. |
01:56:19 | FromDiscord | <leorize> it happens more than one would expect tbf |
01:57:03 | FromDiscord | <leorize> nim tries to group as many continuous characters as possible into an operator |
01:59:04 | FromDiscord | <Elegantbeef> It's any case with contiguous operators |
01:59:20 | FromDiscord | <leorize> an example that sometimes bites me\: `%` is the toJson operator and `$` can be used to stringify a json node, so you'd expect to write `$%obj` and get json as a string. But that would become the `$%` operator which doesn't exist and will raise an error. Instead you'd have to use `$ %obj` |
01:59:20 | FromDiscord | <Elegantbeef> `echo 1 -3` |
01:59:44 | FromDiscord | <Tetralux> In reply to @leorize "an example that sometimes": Oh wow. That's... kinda icky 🤣 |
02:00:18 | FromDiscord | <Elegantbeef> I mean `%` was a mistake imo 😛 |
02:00:26 | FromDiscord | <Elegantbeef> But since Nim has macros there are valid operators that might not be considered valid in other scopes |
02:00:45 | FromDiscord | <Elegantbeef> Take https://github.com/CosmicToast/pipe for instance |
02:00:52 | FromDiscord | <Tetralux> Yeah - That particular example may be better with an explicit call to `toJson` or whatever-it's-called, rather than relying on operators like `%` (wut), but yeah - that is still a good example of the problem you can run into. |
02:01:31 | FromDiscord | <Elegantbeef> There's not really a good solution though |
02:02:01 | FromDiscord | <Elegantbeef> If you dont have a `..-` operator are you supposed to start randomly chunking the operator to find one that compiles 😀 |
02:02:27 | FromDiscord | <leorize> I mean that is certainly possible |
02:02:32 | FromDiscord | <Tetralux> To be fair, who said anyone wanted a `..-` operator? 😄 |
02:02:37 | FromDiscord | <Rika> Is it a good idea though |
02:02:53 | FromDiscord | <leorize> we actually have `..^` as an operator because people so often write it like that |
02:02:56 | FromDiscord | <Rika> You cannot assume no one would want any arbitrary operator |
02:03:35 | FromDiscord | <leorize> the actual stuff is `a .. ^b`, but people writes it as `a..^b` so often that it grew into an operator on its own |
02:04:09 | * | vicfred quit (Quit: Leaving) |
02:04:23 | FromDiscord | <Elegantbeef> To me having user defined operators when you have macros is a no brainer |
02:04:27 | FromDiscord | <Tetralux> In reply to @Rika "You cannot assume no": While that is indeed true, I can very much have an opinion on whether an operator makes sense in any given situation, obviously.↵Like - I could use `%%=` (assuming that's a valid operator to overload) to mean `multiply by two and add one`, but I wouldn't, because I want to be able to understand my code. 😄 |
02:04:31 | FromDiscord | <Elegantbeef> It allows you to extend the language in an expressive matter |
02:04:52 | FromDiscord | <Elegantbeef> I mean i agree your operator should make sense |
02:04:54 | FromDiscord | <Tetralux> In reply to @leorize "the actual stuff is": Huh. Yeah, that's definitely the same problem as I had 😄 |
02:04:57 | FromDiscord | <Elegantbeef> Which is why i dislike the json operators |
02:05:22 | * | jmdaemon quit (Ping timeout: 250 seconds) |
02:05:25 | FromDiscord | <Elegantbeef> There isnt an empirical rule of "operators that makes sense" 😀 |
02:05:53 | FromDiscord | <leorize> obviously we just need "smart" operator grouping \:P |
02:05:57 | FromDiscord | <Elegantbeef> Lol |
02:06:02 | FromDiscord | <Tetralux> In reply to @Elegantbeef "There isnt an empirical": You could maybe make one 😏 😛 |
02:06:10 | FromDiscord | <Elegantbeef> Just need people to understand operators grouped together are considered one |
02:06:24 | FromDiscord | <Elegantbeef> You cant make one since user operators can be for specific domains and make sense only there |
02:06:26 | FromDiscord | <Tetralux> Like...↵`..` => range↵`^` => xor (for example)↵`..^` => nonsensical, so cannot be overloaded |
02:06:31 | FromDiscord | <Elegantbeef> For instance unicode operators |
02:06:36 | FromDiscord | <Elegantbeef> But it's not nonsensical |
02:06:48 | FromDiscord | <Elegantbeef> Nim doesnt use `^` for xor |
02:07:13 | FromDiscord | <Elegantbeef> Nim uses `^` for `BackwardsIndex` and in urnary raising to power |
02:07:14 | FromDiscord | <Elegantbeef> in binary\ |
02:07:18 | FromDiscord | <Tetralux> Alright - but let's assume that it was XOR for a moment...↵To that, I could just ask, "In what situation does it make sense to have a 'ranged-xor'?" |
02:07:34 | FromDiscord | <Elegantbeef> But that disregards any case where it might make sense |
02:07:40 | FromDiscord | <Tetralux> Name one. |
02:07:46 | FromDiscord | <Elegantbeef> And in the case of Nim it makes sense as an iterator |
02:07:57 | FromDiscord | <Rika> That's the issue, what people seem as sensible differs a lot across people |
02:08:04 | FromDiscord | <Rika> Deem, not seem |
02:08:06 | FromDiscord | <leorize> https://github.com/zevv/npeg |
02:08:21 | FromDiscord | <leorize> ^ look at that for the biggest collection of operators in a special habitat |
02:08:25 | FromDiscord | <Elegantbeef> Nim has macros which means operators can be used for a ton of power |
02:08:37 | FromDiscord | <Elegantbeef> And they can make sense |
02:08:48 | FromDiscord | <Elegantbeef> Take `-->` |
02:08:54 | FromDiscord | <Elegantbeef> negative less than? |
02:09:09 | FromDiscord | <Elegantbeef> Greater than \ |
02:09:20 | FromDiscord | <Elegantbeef> https://github.com/zero-functional/zero-functional |
02:09:24 | FromDiscord | <Elegantbeef> It uses it for chaining |
02:09:39 | FromDiscord | <Elegantbeef> It's the same with `|>` or greater doesnt make any sense |
02:09:46 | FromDiscord | <Elegantbeef> But pipe uses it |
02:10:01 | FromDiscord | <Tetralux> In reply to @leorize "https://github.com/zevv/npeg": Oh man... I feel like I'd have to learn a whole new language just to read that 😄 |
02:10:12 | FromDiscord | <Elegantbeef> You kinda do |
02:10:27 | FromDiscord | <Elegantbeef> But you need to learn a new language for any pattern matching logic |
02:11:12 | FromDiscord | <Tetralux> In reply to @Elegantbeef "It's the same with": One could make an argument that one is more easily recognised, in fairness, since that's actually well-known operator already. |
02:11:35 | FromDiscord | <Elegantbeef> Sure but the point is the language doesnt define what is acceptable and things can grow naturally |
02:11:49 | FromDiscord | <Elegantbeef> Nim is a relatively small language that is implemented mostly in libraries |
02:12:35 | FromDiscord | <Tetralux> I think there's some merit to that -- though, I could see that leading to ungrokkable code pretty easily, which is a touch concerning. 🤔 |
02:12:49 | FromDiscord | <Elegantbeef> Sure, shun bad use of operators |
02:12:55 | FromDiscord | <Elegantbeef> Join me and my quest to shunning them |
02:13:07 | FromDiscord | <Tetralux> I won't hesitate in doing so 😄 |
02:13:18 | FromDiscord | <Elegantbeef> Hell 1.6.0 introduced unicode operators for those science nerds |
02:13:35 | FromDiscord | <Rika> Well choose, strange operators or Java level verbosity |
02:13:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NDF |
02:13:48 | FromDiscord | <Elegantbeef> And it's a lovely sensible solution |
02:14:01 | FromDiscord | <Tetralux> In reply to @Elegantbeef "So the following is": That's more grounded though, since those symbols really do have an actual meaning, which I'm guessing is what they're used for there. |
02:14:24 | FromDiscord | <Elegantbeef> Indeed, but in other places that have locked off operators that's n ot allowed |
02:14:32 | FromDiscord | <Tetralux> I wonder how viable it would be to have it fall back to parsing it as `(0)..(-1)` if no `..-` was defined for the type combination 🤔 |
02:14:34 | FromDiscord | <Rika> I'd say it's just as bad since now I need to figure out how to type them |
02:14:36 | FromDiscord | <Elegantbeef> Bad operators are bad regardless |
02:14:48 | FromDiscord | <Elegantbeef> well what if you have a `.-` operator? |
02:15:03 | FromDiscord | <Tetralux> `..-` you mean? |
02:15:05 | FromDiscord | <Elegantbeef> I dont think a fallback makes sense |
02:15:07 | FromDiscord | <Rika> No |
02:15:12 | FromDiscord | <Elegantbeef> No just `.-` |
02:15:19 | FromDiscord | <Elegantbeef> Take the ZF example |
02:15:36 | FromDiscord | <Tetralux> `0 . .- 1` -> is this valid syntax? |
02:15:43 | FromDiscord | <Elegantbeef> `->` exists in sugar `-->` is what ZF uses |
02:16:01 | FromDiscord | <Tetralux> (edit) "syntax?" => "syntax?↵Because if not, I'm not sure how that would affect this case." |
02:16:16 | FromDiscord | <Elegantbeef> No, but i think trying to reason what operators are valid in a case is fruitless |
02:16:39 | FromDiscord | <Elegantbeef> It requires a bunch of recursive checking and enables hidden behaviour |
02:17:14 | FromDiscord | <Tetralux> One could argue that doing a bunch of logic to "smartly" figure out what operator was meant, when there's only one that compiles, is in line with Nim's wish to be maximally 'useful', in that sense. |
02:17:33 | FromDiscord | <Tetralux> Not that I'm necessarily seriously suggesting it. |
02:17:58 | FromDiscord | <Elegantbeef> I think it's a relatively complex thing to manage and to do it properly |
02:18:00 | FromDiscord | <Elegantbeef> The compiler doesnt compile in the case it's confuse instead of attempting to be right |
02:18:55 | FromDiscord | <Tetralux> Sure - but one could argue that negative numbers aren't exactly a hidden technology from the moon, exactly. 😛 |
02:19:01 | FromDiscord | <Tetralux> (edit) "Sure - but one could argue that negative numbers aren't exactly a hidden technology ... from" added "that comes" |
02:19:08 | FromDiscord | <Elegantbeef> Sure but that's a hard coded solution |
02:19:16 | FromDiscord | <Elegantbeef> You dont do hard code logic in a compiler |
02:19:31 | FromDiscord | <Elegantbeef> Atleast not generally |
02:19:52 | FromDiscord | <Elegantbeef> unary `-` is not any more special than unary anything |
02:19:56 | FromDiscord | <Tetralux> I mean, yeah - you actually _have to_ hardcode some logic into the compiler - but I get what you're meaning. |
02:20:35 | FromDiscord | <Elegantbeef> Yea you ideally do things as general as possible and everything falls into rules, stuff does need to be hardcoded but it's best to cast a wide net |
02:21:14 | FromDiscord | <Tetralux> Let us test that logic: "Why is the JSON operator still `%` ?" |
02:21:18 | FromDiscord | <Elegantbeef> `10 --+ 11` falls into the "what's right" to me |
02:21:50 | FromDiscord | <Elegantbeef> Not many appreciate that as an operator and i think it wont be coming with the json rewrite |
02:21:58 | FromDiscord | <Tetralux> (edit) "?"" => "?"↵"Why--in spite of seemingly not being a good operator for that--has it not been changed?"" |
02:23:52 | FromDiscord | <Tetralux> Ah - so it's just an obscure thing that's not been addressed because nobody cares enough about it? |
02:23:56 | FromDiscord | <Rika> backwards compatibility and not breaking old code |
02:24:17 | FromDiscord | <Elegantbeef> Nim 2.0 is coming which means we can break libraries |
02:24:27 | FromDiscord | <Elegantbeef> Either performance or ugly code is getting addressed |
02:24:55 | FromDiscord | <Rika> or both xd |
02:25:02 | FromDiscord | <Tetralux> In reply to @Rika "backwards compatibility and not": Right - Though, one could make a case that's a point against having arbitrary operators, since bad ones will stick around. 🤔 |
02:25:18 | FromDiscord | <Rika> it is indeed |
02:25:32 | FromDiscord | <Rika> i just mean it cannot be changed because |
02:25:49 | FromDiscord | <Rika> once its in stable theres no going back pretty much |
02:26:19 | FromDiscord | <Tetralux> It's an interesting problem. 🤔 |
02:26:58 | FromDiscord | <Elegantbeef> You want to support arbitrary operators cause they enable expressive code, but dont want them to be used cause someone was having a laugh 😛 |
02:27:15 | FromDiscord | <Tetralux> 😄 |
02:27:20 | FromDiscord | <Tetralux> I'm all for people having a laugh! |
02:27:34 | FromDiscord | <Elegantbeef> I'm not for it when it makes my code ugly 😛 |
02:28:00 | FromDiscord | <Elegantbeef> `%` should've been `toJson` and if you wanted a unary operator you could alias it or the package could've provided it |
02:28:05 | FromDiscord | <Tetralux> Maybe people should be able to vote on Nimble packages, and downvote those with bad operators. 😄 ↵Then 'bad' packages become advised against by the package system when you try to install it. 😏😛 |
02:28:23 | FromDiscord | <Rika> that is complicated |
02:28:24 | FromDiscord | <Tetralux> In reply to @Elegantbeef "`%` should've been `toJson`": That's probably what I would have done, if that had been my decision. |
02:28:33 | FromDiscord | <Elegantbeef> Eh we already have that if the repo includes "beef331" it's probably a bad package |
02:28:55 | FromDiscord | <Tetralux> Beef331? 🧐 |
02:29:03 | FromDiscord | <Elegantbeef> That's my github |
02:29:07 | FromDiscord | <Elegantbeef> I'm saying i'm a shit programmer |
02:29:11 | FromDiscord | <Tetralux> Ah! |
02:29:12 | FromDiscord | <Rika> xd |
02:29:12 | FromDiscord | <Tetralux> Gotcha! |
02:29:18 | FromDiscord | <Rika> imagine needing to explain a joke |
02:29:25 | FromDiscord | <Tetralux> HEY |
02:29:37 | FromDiscord | <Tetralux> I CANNOT BE IN ON LITERALLY EVERY JOKE |
02:29:39 | FromDiscord | <Tetralux> I'M SORRY |
02:29:41 | FromDiscord | <Tetralux> 😛 |
02:30:09 | FromDiscord | <Elegantbeef> Also to make it even more complicated for "sensible operators" `/../` exists 😛 |
02:30:28 | FromDiscord | <Tetralux> Also - sidenote - this is a fairly good first impression of this community. |
02:30:32 | FromDiscord | <Tetralux> So kudos |
02:30:36 | FromDiscord | <Tetralux> 👍😄 |
02:30:37 | FromDiscord | <Elegantbeef> Fuck we were too nice |
02:30:42 | FromDiscord | <Elegantbeef> Now they'll never leave |
02:30:44 | FromDiscord | <Rika> fuck you beef |
02:30:48 | FromDiscord | <Tetralux> 😈 |
02:30:51 | FromDiscord | <Elegantbeef> Do it yourself coward |
02:30:54 | FromDiscord | <Rika> beef is dumb |
02:31:05 | FromDiscord | <Rika> i cant believe youre still here beef smh |
02:31:12 | FromDiscord | <Elegantbeef> Same |
02:31:25 | FromDiscord | <Rika> In reply to @Elegantbeef "Do it yourself coward": 😳 |
02:31:43 | FromDiscord | <Elegantbeef> I'm surprised my rambling didnt result in tetra being annoyed by this community |
02:31:48 | FromDiscord | <Rika> xd |
02:31:54 | FromDiscord | <Rika> your assumptions are strange |
02:32:11 | FromDiscord | <Elegantbeef> Speaking of the subreddit doesnt link to any of the realtime chats |
02:32:23 | FromDiscord | <Elegantbeef> Who wants to yell at one of the subreddit mods |
02:36:45 | FromDiscord | <Tetralux> In reply to @Elegantbeef "I'm surprised my rambling": More people need to have the "Don't take yourself too seriously + sense of humour" attitude. 😄👍 |
02:37:11 | FromDiscord | <Elegantbeef> Well i just accepted i'm a joke |
02:37:23 | FromDiscord | <Tetralux> Don't kid yourself - we all are 😈 |
02:37:24 | FromDiscord | <Tetralux> 😄 |
02:41:21 | * | noeontheend joined #nim |
02:41:50 | * | krux02 quit (Remote host closed the connection) |
02:43:44 | FromDiscord | <Elegantbeef> But hey atleast i'm actually working on my game so... take that! |
02:47:29 | FromDiscord | <impbox [ftsf]> omg |
02:47:56 | FromDiscord | <Elegantbeef> Damn it i broke git again |
02:48:03 | FromDiscord | <impbox [ftsf]> the whole thing? |
02:48:10 | FromDiscord | <Rika> git gud |
02:48:11 | FromDiscord | <Elegantbeef> Well for my project |
02:48:23 | FromDiscord | <impbox [ftsf]> you ruined the whole decentralised network |
02:48:35 | FromDiscord | <Elegantbeef> every time i commit it's outputting the output of a command i ran |
02:48:36 | FromDiscord | <impbox [ftsf]> guess no more work for me today |
02:48:40 | FromDiscord | <Elegantbeef> This happenedbefore |
02:48:49 | FromDiscord | <impbox [ftsf]> feature! |
02:49:46 | FromDiscord | <Rika> poggers no more programming |
02:50:57 | NimEventer | New thread by Tsojtsoj: Macro question: "undeclared identifier", but identifier is declared?, see https://forum.nim-lang.org/t/8847 |
02:51:02 | FromDiscord | <Elegantbeef> Good thing i borked it after all my refactoring/implementing |
03:13:39 | * | arkurious quit (Quit: Leaving) |
03:21:42 | * | jmdaemon joined #nim |
03:29:27 | FromDiscord | <Tetralux> Does defining a `iterator items(x: MyType)` just allow `for e in x` to work? |
03:29:40 | FromDiscord | <Tetralux> (edit) "Does defining" => "Just to confirm:" | "just allow" => "allows" | "work?" => "work, right?" |
03:29:47 | FromDiscord | <Tetralux> (edit) "Just to confirm: ... a" added "declaring" |
03:30:22 | FromDiscord | <Elegantbeef> Yes but using implicit `items` will result in bugs with generics |
03:31:06 | FromDiscord | <Tetralux> As in `iterator items[T]` + `for e in x` ? |
03:31:11 | FromDiscord | <Elegantbeef> Nah |
03:31:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NDX |
03:31:56 | FromDiscord | <Tetralux> Is the workaround to just do `for x in a.items:` there then? |
03:32:03 | FromDiscord | <Elegantbeef> `.items` isnt properly used in this case, I'm going to try to fix it but need to put fresh eyes on it |
03:32:06 | FromDiscord | <Elegantbeef> Yes |
03:32:16 | FromDiscord | <Tetralux> Gotcha. Cheers for the heads up. |
03:32:18 | FromDiscord | <Tetralux> 👍 |
03:32:24 | FromDiscord | <Elegantbeef> it doesn know it's supposed to mixin `items` and explicitly mixing it in doesnt work |
03:32:38 | FromDiscord | <Tetralux> I haven't got to mixins yet 😄 |
03:33:11 | FromDiscord | <Elegantbeef> They're just a part of generics saying "for this symbol add the scope of instantiation" |
03:33:50 | FromDiscord | <Tetralux> Hmmm. I'll have to look more into that to see how they work. |
03:34:00 | FromDiscord | <Tetralux> Oh - also - `for i, e in x` is enabled by `iterator enumerate(x: MyType): tuple[IntType, ElType]` ? |
03:34:12 | * | rienske quit (Ping timeout: 250 seconds) |
03:34:16 | FromDiscord | <Elegantbeef> `pairs` |
03:34:19 | FromDiscord | <Tetralux> Ah! |
03:34:21 | FromDiscord | <Tetralux> Gotcha. |
03:34:23 | FromDiscord | <Elegantbeef> there is `std/enumerate` |
03:34:34 | FromDiscord | <Elegantbeef> which lets you do `for x, y in enumerate myType.items` |
03:34:47 | FromDiscord | <Elegantbeef> Allows you to enumerate any iterator |
03:35:28 | FromDiscord | <Elegantbeef> And if you want more iterator examples or utillities https://github.com/beef331/slicerator/blob/master/src/slicerator.nim is full of them 😛 |
03:39:15 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NDZ |
03:39:25 | FromDiscord | <Elegantbeef> `for x in a[10]` works |
03:39:26 | FromDiscord | <Tetralux> (edit) "https://play.nim-lang.org/#ix=3NDZ" => "https://play.nim-lang.org/#ix=3NE0" |
03:39:27 | FromDiscord | <Tetralux> (edit) "https://play.nim-lang.org/#ix=3NE0" => "https://paste.rs/A4J" |
03:39:44 | FromDiscord | <Elegantbeef> well in the example it's `for x in a[1..3]` |
03:39:47 | FromDiscord | <Elegantbeef> Nim slices presently copy |
03:40:23 | FromDiscord | <Tetralux> `for x in arr_val[1..3]` iterates over a copy of a range of the array? |
03:40:34 | FromDiscord | <Elegantbeef> In default Nim yes |
03:40:54 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NE1 |
03:40:56 | FromDiscord | <Tetralux> (edit) "https://play.nim-lang.org/#ix=3NE1" => "https://paste.rs/0fb" |
03:41:03 | FromDiscord | <Elegantbeef> Yes it does a non copy iteration of the slice |
03:41:10 | FromDiscord | <Tetralux> (edit) "https://paste.rs/UIl" => "https://play.nim-lang.org/#ix=3NE2" |
03:41:34 | FromDiscord | <Tetralux> And that's only resolved to in the target of a for loop, correcT? |
03:41:35 | FromDiscord | <Tetralux> (edit) "correcT?" => "correct?" |
03:41:38 | FromDiscord | <Tetralux> (edit) "resolved to" => "resolved-to" |
03:41:43 | FromDiscord | <Tetralux> Since it's an iterator? |
03:41:51 | FromDiscord | <Elegantbeef> Yep |
03:41:56 | FromDiscord | <Tetralux> Right. Huh. Interesting. |
03:42:02 | FromDiscord | <Elegantbeef> It's only invoked in the case the compiler wants the iterators |
03:42:07 | FromDiscord | <Tetralux> That's gonna take some grokking 😄 |
03:42:15 | FromDiscord | <Elegantbeef> which is `for x in y` or when you have a template that has `t: iterable` |
03:42:57 | FromDiscord | <Tetralux> Going back to `for i, e in x`, how does one make `e` a `var ElType` ? |
03:43:04 | FromDiscord | <Tetralux> So that `e = ...` works in the loop? |
03:43:46 | * | rie joined #nim |
03:43:54 | FromDiscord | <Tetralux> Do you just define an iterator that returns `: var T` instead? |
03:44:06 | FromDiscord | <Elegantbeef> enumerate might work, but nim doesnt have an abillity to safely capture `var T` so `(int, var T)` doesnt work |
03:44:19 | FromDiscord | <Elegantbeef> `mitems` is defined for collections, and yes that does work |
03:44:29 | FromDiscord | <Tetralux> In reply to @Elegantbeef "`mitems` is defined for": That I saw, yeah. |
03:44:35 | FromDiscord | <Tetralux> Hmm. That's unfortunate. |
03:44:54 | FromDiscord | <Tetralux> Though, you could do it for `for e in x` presumably? |
03:45:01 | FromDiscord | <Elegantbeef> Yea |
03:45:08 | FromDiscord | <Tetralux> Gotcha. Cheers. 👍 |
03:45:30 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L76-L82 is an example at how you might emulate this |
03:46:12 | FromDiscord | <Tetralux> Here's another: How about slices with no end-bounds?↵So a way to write `thing[0..]` or `thing[0..end]` instead of `thing[0..thing.len-1]` - etc? |
03:46:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NE3 |
03:46:24 | FromDiscord | <Elegantbeef> `thing[0..^1]` |
03:46:40 | FromDiscord | <Tetralux> In reply to @Elegantbeef "`thing[0..^1]`": What's the type of `0..^1` ? |
03:46:41 | FromDiscord | <Elegantbeef> And we go full circle |
03:46:51 | FromDiscord | <Elegantbeef> `HSlice[int, BackwardsIndex]` |
03:47:27 | FromDiscord | <Tetralux> What type should one use to define `[]` on a custom type which you want to be able to slice with either a forward, or backwards, slice? |
03:47:45 | FromDiscord | <Tetralux> Or is it a case of defining two overloads: `Slice[T]` and `HSlice[T, BackwardsIndex]` ? |
03:47:56 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L5-L13 |
03:48:18 | FromDiscord | <Tetralux> Ah, so two overloads it is then 😄 |
03:49:16 | FromDiscord | <Elegantbeef> You can also defined `a[10, 20]` by doing `(a: T, b: Y, c: Z)` |
03:49:45 | FromDiscord | <Tetralux> Gotcha 👍 |
03:50:42 | FromDiscord | <Elegantbeef> The same rules apply to the `{}` operator |
03:52:02 | FromDiscord | <evoalg> I read somewhere that `x .. y` is preferred style over `x..y` ... so I've been using `x ... y` ever since? |
03:52:29 | FromDiscord | <Elegantbeef> I mean i do `x..y` but if there are expressions i do `x + 1 .. y - 1` |
03:53:20 | FromDiscord | <Elegantbeef> `x..y` reads nicer to me and `x + 1 .. y - 1` is easier to see the logic |
03:54:25 | FromDiscord | <evoalg> I used to think `x+1` was easier too but I changed to `x + 1` ... eg if I'm doing `y = x + 1` |
03:55:18 | FromDiscord | <evoalg> :w |
03:55:25 | FromDiscord | <evoalg> gosh |
03:55:54 | FromDiscord | <evoalg> I was just updating my "where beefy is wrong" notes ... it's very short |
03:57:17 | FromDiscord | <Elegantbeef> Lol |
03:57:55 | FromDiscord | <evoalg> it only has that and how you think that -20 degree celsius isn't that cold |
03:58:10 | FromDiscord | <Elegantbeef> Well it's not |
03:58:48 | FromDiscord | <congusbongus> doesn't it depend on what you're wearing |
04:00:20 | FromDiscord | <Tetralux> If you have your own string type (`str`), and want to be able to do `str"some text"`, but manually manage the memory of the resulting `str`, do you need to copy the `string`'s data, or is there a way to avoid ever creating the `string` at all there? |
04:00:43 | FromDiscord | <Tetralux> (edit) "manually manage" => "have `str` be non-owning on" | "memory of the resulting `str`," => "bytes," |
04:00:58 | FromDiscord | <Elegantbeef> The string lit is a constant in the case there |
04:01:06 | FromDiscord | <Tetralux> (edit) "If you have your own string type (`str`), and want to be able to do `str"some text"`, but have `str` be non-owning on the bytes, ... do" added "and be manually-managed memory," |
04:01:27 | FromDiscord | <Rika> strings are never manually managed as well no? |
04:01:38 | FromDiscord | <Elegantbeef> Well their string is |
04:01:39 | FromDiscord | <Tetralux> In reply to @Elegantbeef "The string lit is": Does that mean that the string's data points into RODATA, and so there's no need to copy the bytes? |
04:01:57 | FromDiscord | <leorize> pretty much |
04:02:02 | FromDiscord | <Tetralux> Cool 👍 |
04:02:22 | FromDiscord | <Tetralux> Relatedly, does `str("some text")` work the same way in this case? |
04:02:38 | FromDiscord | <Elegantbeef> Same thing just one is a raw lit |
04:02:42 | FromDiscord | <Elegantbeef> The first is a raw lit |
04:03:52 | FromDiscord | <Elegantbeef> `echo"hello\nworld"` vs `echo "hello\nworld"` |
04:03:59 | FromDiscord | <Tetralux> Hmm. |
04:04:02 | FromDiscord | <Rika> i assume str is the type and not a conversion proc |
04:04:32 | FromDiscord | <Elegantbeef> I assumed it was a conversion procedure |
04:07:51 | FromDiscord | <Tetralux> `str` is the type, but I assume I couldn't do `str("some text")` anyway in that case. |
04:07:54 | FromDiscord | <Tetralux> (edit) "assume" => "imagine" |
04:08:20 | FromDiscord | <Tetralux> (edit) "`str` is ... thetype" added "actually" | "type," => "type in realitry," |
04:08:23 | FromDiscord | <Tetralux> (edit) "realitry," => "reality," |
04:10:04 | FromDiscord | <Tetralux> I _wouldn't_ want to define a `converter` procedure for this, since Nim will let me use a runtime-known string, or a constant string, but the GC won't know if I'm still using the string data, correct? |
04:10:43 | FromDiscord | <Elegantbeef> `convert toMyStr(aStr: static string): MyStr` could work, i dont recall though |
04:10:48 | FromDiscord | <Elegantbeef> converter\ |
04:11:02 | FromDiscord | <Tetralux> Ahhh. Interesting, yeah. |
04:11:03 | FromDiscord | <Elegantbeef> Nim does allow you to have procedures that only work on compile constants |
04:11:13 | FromDiscord | <Tetralux> `static[string]`, eh? |
04:11:34 | FromDiscord | <Rika> not a converter, a conversion proc |
04:11:57 | FromDiscord | <Rika> toJson is a conversion proc |
04:12:04 | FromDiscord | <Rika> if it existed |
04:13:16 | FromDiscord | <Tetralux> In reply to @Elegantbeef "`convert toMyStr(aStr: static string):": This makes progress, but it doesn't want to work here, it seems - since `str` takes the address of the data. 🤔 |
04:13:20 | FromDiscord | <Elegantbeef> I'd argue having `MyStr` and a `myStr` proc |
04:13:20 | FromDiscord | <Tetralux> (edit) "the" => "its" |
04:14:08 | FromDiscord | <Elegantbeef> Yea i dont know |
04:14:14 | FromDiscord | <Tetralux> Hmm. |
04:14:37 | FromDiscord | <Elegantbeef> My view is just use `string` you arent really going to need a different type of string in 99% of use cases |
04:15:24 | FromDiscord | <Tetralux> I'm exploring just how well supported manual memory management is in Nim by seeing how far I get without it 😛 |
04:16:10 | FromDiscord | <Tetralux> I made custom allocators, dynamic arrays, slices (like Go's) work already - and a stringview too - but string literals was a detail I hadn't totally worked out yet. |
04:16:12 | FromDiscord | <Elegantbeef> Well you can make macros or procedures that do what you need |
04:16:42 | FromDiscord | <Elegantbeef> a macro that takes a `static string` iterates over it and allocates your string isnt too hard |
04:17:40 | FromDiscord | <Tetralux> In reply to @Elegantbeef "a macro that takes": Ideally though, I'd avoid allocation and just use the pointer into RODATA. 🤔 |
04:17:48 | FromDiscord | <Tetralux> I'm just not sure how to get at that 😄 |
04:18:29 | FromDiscord | <Elegantbeef> You'd need the constant to be compiled so i dont see how you'd do it |
04:19:05 | FromDiscord | <Elegantbeef> Aside from using the codegendecl pragma |
04:19:12 | FromDiscord | <Tetralux> Compiled |
04:19:13 | FromDiscord | <Tetralux> (edit) "Compiled" => "Compiled?" |
04:20:04 | FromDiscord | <Elegantbeef> Well to use the RODATA it needs to be compiled into the program, but you want to only reuse the pointer if it's in the RODATA |
04:20:38 | FromDiscord | <Elegantbeef> so `proc toMyStr(s: static string): MyStr` doesnt work since it's not given to C |
04:20:47 | FromDiscord | <Elegantbeef> Or atleast it might not be |
04:21:59 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NE8 |
04:22:10 | FromDiscord | <Elegantbeef> Templates exist |
04:22:26 | FromDiscord | <Tetralux> Whatcha thinking? 😄 |
04:23:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NE9 |
04:23:22 | FromDiscord | <Elegantbeef> dont need the backticks |
04:23:49 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NEa |
04:24:06 | FromDiscord | <Elegantbeef> Yes |
04:24:22 | FromDiscord | <Elegantbeef> Just making the point to use a template before a macro 😛 |
04:24:57 | FromDiscord | <Tetralux> Presumably because a template basically just does the `quote do:` thing anyway - whereas macros are more about building up an expr from AST procs? |
04:25:16 | FromDiscord | <Elegantbeef> Yes and templates dont use the VM so are slightly faster |
04:25:24 | FromDiscord | <Tetralux> Ah, interesting. Cheers. |
04:25:48 | FromDiscord | <Elegantbeef> Faster to compile\ |
04:26:19 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NEb |
04:26:26 | FromDiscord | <Elegantbeef> yes |
04:26:33 | FromDiscord | <Elegantbeef> cause templates replace any instance of their fields |
04:26:38 | FromDiscord | <Tetralux> (edit) "https://play.nim-lang.org/#ix=3NEb" => "https://play.nim-lang.org/#ix=3NEc" |
04:26:41 | FromDiscord | <Elegantbeef> you dont need to backtick the symbols in templates |
04:27:05 | FromDiscord | <Elegantbeef> That behaviour catches a lot of people |
04:27:20 | FromDiscord | <Elegantbeef> If any identifier matches the name of a parameter it's getting replaced |
04:27:27 | FromDiscord | <Tetralux> Ah! So in a template, any mention of `s` just becomes the value `s` has as-passed to it --- whereas, in a macro, you have to use backticks to escape the params to get the same behavior? |
04:27:42 | FromDiscord | <Elegantbeef> Well inside `quote do` |
04:28:06 | FromDiscord | <Elegantbeef> macros are not quote do, quote do is a special tool that allows quasi quoting like in macros |
04:28:11 | FromDiscord | <Elegantbeef> like in templates\ |
04:28:59 | FromDiscord | <Elegantbeef> `genasts` is a module with an alternative quasi quote that doesnt rely on backtick replaces |
04:29:00 | FromDiscord | <Tetralux> Right, right - yeah. |
04:29:32 | FromDiscord | <Tetralux> So the backticks are part of the implementation of `quote`, rather than of `macro`s, then. |
04:29:40 | FromDiscord | <Elegantbeef> Yep |
04:29:43 | FromDiscord | <Tetralux> Gotcha. |
04:29:59 | FromDiscord | <Elegantbeef> Macros are really just interpreted user defined compiler passes |
04:30:18 | FromDiscord | <Tetralux> Interesting 😄 |
04:31:05 | FromDiscord | <Elegantbeef> Generally you use genast/quote as a tool to make specific AST inside a larger macro |
04:31:19 | FromDiscord | <Tetralux> Right. |
04:31:21 | FromDiscord | <Elegantbeef> What language do you come from btw? |
04:31:43 | FromDiscord | <Tetralux> Everything, basically 😄 ↵Everything from VB.NET to Odin 🤣 |
04:31:56 | FromDiscord | <Tetralux> (edit) "↵Everything" => "↵Everything" |
04:31:57 | FromDiscord | <Elegantbeef> Lol |
04:32:05 | FromDiscord | <Elegantbeef> Hey the odin has to make you feel at home somewhat |
04:32:09 | FromDiscord | <Elegantbeef> Both Nim and Odin are pascally |
04:32:41 | FromDiscord | <Rika> pascallian |
04:32:45 | FromDiscord | <Elegantbeef> Though i know odin is much more magic free |
04:32:50 | FromDiscord | <Elegantbeef> Wirthian |
04:32:52 | FromDiscord | <Tetralux> That it is 😄 |
04:33:03 | FromDiscord | <Elegantbeef> Wirth using |
04:34:43 | FromDiscord | <Tetralux> I take there's no way to make `str"some text"` work?↵Closest I can get is `toStr"some text"` where `toStr` is the name of the proc?↵Unless I define a `converter`, but then it's implicitly converted _everywhere_, right? |
04:35:39 | FromDiscord | <Elegantbeef> No you'd have ambiguity |
04:35:49 | FromDiscord | <Elegantbeef> You could do `Str` as the type then use `str` |
04:36:00 | FromDiscord | <Rika> LIKE NIM TELLS YOU TO xdddd |
04:36:04 | FromDiscord | <Rika> well, nep |
04:36:06 | FromDiscord | <Tetralux> 😄 |
04:36:13 | FromDiscord | <Elegantbeef> And if you want to reduce allocations you'll want a macro |
04:36:38 | FromDiscord | <Elegantbeef> Since right now you're allocating a Nim string to make your string |
04:36:45 | FromDiscord | <Tetralux> Oh yeah. Good point 🤔 |
04:38:14 | FromDiscord | <Tetralux> But can you get the address into RODATA from a string literal 🤔 |
04:38:49 | FromDiscord | <Elegantbeef> Probably |
04:38:58 | FromDiscord | <Tetralux> Alas, I'm not sure how 😄 |
04:39:15 | FromDiscord | <Elegantbeef> You'd need `str(input: string)` to do that but i dont know if it'd be wise |
04:39:57 | * | noeontheend quit (Ping timeout: 240 seconds) |
04:43:25 | FromDiscord | <Tetralux> Hmm. |
04:43:33 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3NEe |
04:43:38 | FromDiscord | <Elegantbeef> There's how you'd use a macro here |
04:44:42 | * | k0mpjut0r joined #nim |
04:44:43 | FromDiscord | <Elegantbeef> You could make a `proc asgn(a: var MyStr, data: openArray[char])` which does the same as this |
04:44:58 | FromDiscord | <Elegantbeef> Allocate and copy mem over |
04:45:26 | FromDiscord | <Tetralux> That seems like there's no way to avoid the allocation 🤔 |
04:48:35 | FromDiscord | <Elegantbeef> I havent looked at the C code for a `str(myStr: openArray[char]` |
04:49:14 | * | k0mpjut0r quit (Ping timeout: 260 seconds) |
04:51:01 | * | k0mpjut0r joined #nim |
04:52:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NEg |
04:52:07 | FromDiscord | <Elegantbeef> Hmmm |
04:55:37 | FromDiscord | <Tetralux> Interesting. |
04:56:07 | FromDiscord | <Elegantbeef> Stringlits are stack allocated and copied to a string heap when |
04:56:15 | FromDiscord | <Elegantbeef> So i think you can do it using a bit of stack 😀 |
04:57:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NEi |
04:58:10 | FromDiscord | <Tetralux> Hmm. |
04:58:46 | FromDiscord | <Elegantbeef> Basically if it's a lit you can safely point to the data, otherwise you'd need to alloc |
05:01:24 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NEk |
05:01:41 | FromDiscord | <Tetralux> (My Str type doesn't allow you to mutate the elements currently.) |
05:03:08 | FromDiscord | <Elegantbeef> If you wanted to you could make `MyStrConst` as a distinct `MyStr` with a small subsection of `MyStr` functionality |
05:03:58 | FromDiscord | <Tetralux> I could, but mutate the elems of a Str isn't really something I need to do. |
05:04:11 | FromDiscord | <Elegantbeef> Ah |
05:05:18 | FromDiscord | <Tetralux> (edit) "mutate" => "mutating" |
05:34:07 | FromDiscord | <demotomohiro> sent a long message, see http://ix.io/3NEp |
05:34:41 | FromDiscord | <Elegantbeef> I do not know i assumed it was stack 😀 |
05:39:41 | FromDiscord | <demotomohiro> Stack is allocated when a function is called and dellocated when returning. Memory locations global variables are placed is different from stack in C. It always exists while a program is running |
05:41:50 | * | k0mpjut0r quit (Quit: Quit) |
05:42:34 | * | k0mpjut0r joined #nim |
05:46:30 | * | k0mpjut0r quit (Client Quit) |
05:46:44 | * | k0mpjut0r joined #nim |
06:17:40 | NimEventer | New thread by Niminem: Generating javascript from nim code evaluation at runtime, see https://forum.nim-lang.org/t/8848 |
06:30:53 | * | rockcavera quit (Remote host closed the connection) |
06:35:48 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NEA |
06:47:02 | FromDiscord | <Elegantbeef> I'd look at the C gen to be certain but probably not |
06:48:47 | FromDiscord | <demotomohiro> let s = "Hello" copies "Hello" but let p = s[0].unsafeAddr doesn't copy. |
06:49:16 | Zevv | Tetralux: well it *is* a whole new language |
06:49:28 | Zevv | but a language that is much closed to your problem domain then the Nim programming language is |
06:49:51 | Zevv | than |
06:51:30 | * | Nuc1eoN joined #nim |
06:54:37 | FromDiscord | <Tetralux> In reply to @demotomohiro "let s = "Hello"": Huh. It appears so, since it seems to crash upon mutation. 🤔 |
06:54:46 | FromDiscord | <Tetralux> (edit) "so," => "that it might in fact be in RODATA," |
06:59:06 | FromDiscord | <Tetralux> Yeah - Just checked the C code - no copy anywhere. |
06:59:11 | FromDiscord | <Tetralux> That's useful to know! |
06:59:25 | FromDiscord | <Elegantbeef> Well there you go |
06:59:42 | FromDiscord | <Tetralux> There I do, indeed 😄 |
07:01:03 | FromDiscord | <Tetralux> Oh wait - nope I'm an idiot 🤣 |
07:11:34 | * | xiamx quit (Quit: Client limit exceeded: 20000) |
07:24:04 | * | k0mpjut0r quit (Quit: Quit) |
07:24:18 | * | k0mpjut0r joined #nim |
07:28:02 | * | k0mpjut0r quit (Client Quit) |
07:28:16 | * | k0mpjut0r joined #nim |
07:35:22 | * | k0mpjut0r quit (Read error: Connection reset by peer) |
07:35:37 | * | k0mpjut0r joined #nim |
07:40:05 | * | k0mpjut0r quit (Ping timeout: 252 seconds) |
07:41:06 | * | k0mpjut0r joined #nim |
07:49:18 | * | jjido joined #nim |
07:49:52 | Amun-Ra | can allocCStringArray (alloc0) return nil or is the error handled by nim itself? |
07:50:06 | * | xiamx joined #nim |
07:52:57 | FromDiscord | <Elegantbeef> The error being what? |
07:54:37 | FromDiscord | <Elegantbeef> I didnt even know C's malloc could return null |
07:55:16 | FromDiscord | <konsumlamm> it returns null if no memory could be allocated |
07:55:48 | FromDiscord | <Elegantbeef> Yea i got that |
07:56:54 | FromDiscord | <Elegantbeef> Just didnt expect it cause in modern times not being able to allocate your data seems absurd |
07:58:36 | FromDiscord | <Rika> ? malloc isnt a modern thing though |
07:58:58 | FromDiscord | <Elegantbeef> I know |
07:59:07 | FromDiscord | <demotomohiro> C's malloc returns null when it failed to allocate heap. But alloc0 in Nim doesn't throw exception when it failed? |
07:59:19 | FromDiscord | <Elegantbeef> It's just I didnt think about actually not being able to allocate |
07:59:47 | FromDiscord | <Tetralux> If your PC has 4GB of RAM, you'd better believe it. 😄 |
07:59:53 | FromDiscord | <Tetralux> ... or if you have enough tabs open. |
07:59:55 | FromDiscord | <Tetralux> Like I do. |
08:00:09 | FromDiscord | <Tetralux> Memory allocation failure is really not an unexpected condition. |
08:00:17 | FromDiscord | <Rika> i have a lot of tabs open too, on 32gb 😛 |
08:00:26 | FromDiscord | <Elegantbeef> I almost always sit a 4gb used |
08:00:31 | FromDiscord | <Elegantbeef> So i have like 12gb just sitting there |
08:00:32 | FromDiscord | <Tetralux> In reply to @Rika "i have a lot": Likewise 😛 |
08:00:53 | FromDiscord | <Rika> ~~over 4000 from what i recall~~ |
08:01:07 | FromDiscord | <Elegantbeef> I have one tab open |
08:01:08 | FromDiscord | <Elegantbeef> Take that |
08:01:15 | FromDiscord | <Rika> damn thats a lot |
08:01:17 | FromDiscord | <Rika> is it matrix? |
08:02:10 | FromDiscord | <Elegantbeef> Nah i just mean in my browser |
08:02:16 | FromDiscord | <Elegantbeef> I use an application |
08:02:25 | FromDiscord | <Rika> i mean you could have been using matrix on the browsere |
08:03:02 | FromDiscord | <Elegantbeef> Yea i dont do webapps i close my browser when i'm not using it |
08:03:07 | FromDiscord | <Rika> i think i currently have under 30 on my alt browser (i really need to fix the situ on my main, but i dont have time rn) |
08:06:48 | FromDiscord | <Elegantbeef> "alt browser" jesus |
08:13:35 | FromDiscord | <Rika> well i only installed it because it got out of hand on the other one |
08:13:44 | FromDiscord | <Rika> for now im on here |
08:13:53 | FromDiscord | <Rika> i'll fix it once i have time AKA february |
08:15:31 | Amun-Ra | Elegantbeef: I have ~20GB taken by the firefox only |
08:17:08 | FromDiscord | <Rika> LOL |
08:17:36 | FromDiscord | <Rika> yeah same here but more like 26 in my case i think |
08:18:24 | emery | I have one tab open, but just to keep firefox from closing |
08:18:27 | FromDiscord | <Tetralux> Hmmm. That's odd. I just wrote a quick test program where I allocate more than I have, then iterate through it, writing to every last byte.↵It never dies, and exits normally, despite accessing more RAM than I have... 🤔 |
08:18:56 | FromDiscord | <Elegantbeef> Did you go into swap? |
08:19:05 | FromDiscord | <Tetralux> I'm on Windows. 😄 |
08:19:42 | FromDiscord | <Tetralux> It must be paging some of it out - I'm just curious how.↵I'm guessing that Nim's allocation setup is doing that. |
08:19:54 | FromDiscord | <Tetralux> Because I can tell you right now that malloc _doesn't_ do that 😄 |
08:20:17 | FromDiscord | <Tetralux> Or at least it didn't last I experimented with this stuff. |
08:21:28 | * | rie is now known as rienske |
08:28:14 | FromDiscord | <Elegantbeef> Does "3 messages deleted" mean that you tested and it did work in C? |
08:30:28 | FromDiscord | <Tetralux> It means that I wrote the equivalent Odin program, and it made it further than I thought it would. 😄 |
08:30:30 | FromDiscord | <Tetralux> However |
08:30:34 | FromDiscord | <Tetralux> It ultimately didn't make it. |
08:30:42 | FromDiscord | <Tetralux> Which makes me wonder what sorcery is going on here. |
08:32:28 | FromDiscord | <Tetralux> Oh wait, no. |
08:32:33 | FromDiscord | <Tetralux> I was just fucking up the code 🤣 |
08:32:35 | FromDiscord | <Tetralux> Both make it. |
08:32:45 | FromDiscord | <Tetralux> Huh. That's very interesting. |
08:33:00 | FromDiscord | <Tetralux> I guess it must be doing the equivalent of swapping on Windows, eh. |
08:33:17 | FromDiscord | <Elegantbeef> Probably |
08:33:22 | FromDiscord | <Elegantbeef> Go to something like 1 bazillion GB |
08:33:23 | FromDiscord | <Elegantbeef> 😛 |
08:33:48 | FromDiscord | <Tetralux> I would like to still have a functioning computer afterwards 😆 |
08:36:18 | FromDiscord | <Elegantbeef> I mean the allocation will fail |
08:37:16 | * | PMunch joined #nim |
08:37:38 | FromDiscord | <Elegantbeef> Yea i just tried allocatin `int 1e30` and it instantly said "out of memory" |
08:37:43 | FromDiscord | <Elegantbeef> It's a hard crash |
08:37:53 | FromDiscord | <Tetralux> Nope |
08:37:58 | FromDiscord | <Tetralux> Nim just works anyway |
08:38:10 | FromDiscord | <Elegantbeef> I just tried it |
08:38:24 | FromDiscord | <Tetralux> I tried 80GB 😄 |
08:38:39 | FromDiscord | <Elegantbeef> `discard create(byte, int 1e30)` |
08:38:39 | FromDiscord | <Tetralux> How are you allocating? |
08:38:46 | FromDiscord | <Tetralux> Ah |
08:39:08 | FromDiscord | <Tetralux> I did `system.alloc(80 1024 1024 1024)` |
08:39:51 | FromDiscord | <Tetralux> Ah-ha! It does immediately exit when I ask for 120GB 🤣 |
08:40:34 | FromDiscord | <demotomohiro> Maybe Nim or backend compiler removed iteration code as it doesn't affect output of your program. |
08:44:51 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:45:48 | FromDiscord | <Tetralux> It was doing it in debug mode too. |
08:45:54 | FromDiscord | <Tetralux> Interesting thought though 😄 |
08:47:08 | FromDiscord | <Rika> Integer can hold 1e30? |
08:47:13 | FromDiscord | <eyecon> Doesn't Windows just lie to you and say "suure, I just did" |
08:47:17 | FromDiscord | <Elegantbeef> No |
08:47:21 | FromDiscord | <eyecon> I thought I read something like that |
08:47:32 | FromDiscord | <Elegantbeef> My no was to rika |
08:47:36 | FromDiscord | <eyecon> Ah |
08:47:38 | FromDiscord | <Tetralux> That's Linux you're thinking of @eyecon 😜 |
08:47:40 | FromDiscord | <Rika> Then why are you doing it |
08:47:51 | FromDiscord | <eyecon> In reply to @Tetralux "That's Linux you're thinking": Yeah |
08:47:56 | FromDiscord | <Elegantbeef> `echo int 1e30`outputs a big number of `5076964154930102272` |
08:48:09 | FromDiscord | <Elegantbeef> I could do `int.high` of course |
08:48:09 | FromDiscord | <eyecon> I mean, it does kinda make sense in a modern system with swap |
08:48:15 | FromDiscord | <Rika> Was going to say |
08:48:47 | FromDiscord | <Tetralux> While that's true - overcommitting memory can easily make your system all but unusable if you start paging. |
08:48:57 | FromDiscord | <Tetralux> You really don't want that to happen. |
08:49:16 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=3NEV |
08:49:16 | FromDiscord | <Elegantbeef> Sure but you also dont want your program to crash! |
08:49:36 | FromDiscord | <eyecon> All hail the OOM killer mechanism |
08:49:49 | FromDiscord | <Rika> OOM has reaped my Firefox before hahaha |
08:49:56 | * | k0mpjut0r quit (Ping timeout: 252 seconds) |
08:49:58 | FromDiscord | <eyecon> In reply to @Rika "OOM has reaped my": Ooof |
08:50:12 | * | k0mpjut0r joined #nim |
08:50:22 | FromDiscord | <Forest> The config https://www.toptal.com/developers/hastebin/agobapeyoq.nim↵↵The main.nim https://www.toptal.com/developers/hastebin/acoxinoyun.nim |
08:50:48 | FromDiscord | <Forest> (edit) "config" => "config.nims" |
08:50:51 | FromDiscord | <Rika> No problem, I have redundant backup systems in case my absurd number of tabs are lost |
08:52:30 | FromDiscord | <Rika> I’m not joking though |
08:54:53 | * | jjido joined #nim |
08:58:59 | FromDiscord | <Forest> :p |
09:03:05 | * | k0mpjut0r quit (Ping timeout: 250 seconds) |
09:03:27 | FromDiscord | <demotomohiro> @Forest That error message looks like you don't have `shell_minimal.html` in current directory. |
09:04:22 | * | k0mpjut0r joined #nim |
09:05:05 | FromDiscord | <Phil> In reply to @Rika "No problem, I have": It's so damn tempting to have hundreds of tabs, I've gotten into the habit of "cleaning" them up on the regular in order to keep the number to a manageable 20-50 |
09:06:04 | * | szahid| joined #nim |
09:06:42 | FromDiscord | <Rika> I already do that, I just haven’t had the time for my old tab count |
09:07:52 | PMunch | I set my Firefox to start afresh whenever I open it |
09:07:55 | FromDiscord | <Phil> You have a... backlog of tabs to clean up? 😄 I'll admit that sounds funny |
09:08:07 | FromDiscord | <Phil> In reply to @PMunch "I set my Firefox": The absolute madman! |
09:08:12 | PMunch | I have a few tabs which are "pinned", my email, some work stuff, etc. |
09:08:28 | PMunch | And then I can bookmark or temporarily pin anything I might want to read later |
09:08:41 | PMunch | It has really saved my from the tab mess I was dealing with before |
09:08:52 | PMunch | I think I had almost 200 tabs at one point |
09:09:12 | FromDiscord | <Rika> Bookmarks don’t work for me |
09:09:43 | * | szahid quit (Quit: WeeChat 3.4) |
09:11:21 | jmdaemon | I should really make a habit of cleaning out my tabs more frequently so they don't pile up |
09:11:40 | FromDiscord | <Elegantbeef> Ah this is how we awaken the nim community talk about browser tahbs |
09:11:47 | FromDiscord | <Elegantbeef> Nice typo, but still makes sense |
09:12:05 | FromDiscord | <Elegantbeef> Also pmunch fix the subreddit description, add the real time chats! |
09:12:08 | jmdaemon | nim browser when |
09:13:22 | PMunch | jmdaemon, I was actually trying to make one at one point |
09:13:31 | PMunch | By using the Chromium embedded framework |
09:13:40 | PMunch | @Elegantbeef, fix it? |
09:14:05 | jmdaemon | how far were you able to get PMunch ? |
09:14:23 | PMunch | I got CEF working and opened a window :P |
09:14:27 | FromDiscord | <BhamidipatiNikhil> You guys won't believe what i tried today....↵today i tried implementing to find the number with the largest Collatz sequence in all numbers less than 10 million....↵This was the code i tried |
09:14:46 | FromDiscord | <BhamidipatiNikhil> sent a long message, see http://ix.io/3NF0 |
09:14:47 | PMunch | But by that time I had spent so much time just trying to get CEF to work I was tired of the whole project.. |
09:14:52 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/936187493081022464/image.png |
09:14:56 | FromDiscord | <Rika> Lol |
09:15:00 | FromDiscord | <Elegantbeef> It's not properly linked |
09:15:06 | FromDiscord | <Elegantbeef> New reddit |
09:15:37 | FromDiscord | <BhamidipatiNikhil> sent a code paste, see https://play.nim-lang.org/#ix=3NF1 |
09:15:41 | jmdaemon | ah what was so difficult about making it work? What problems were you having PMunch ? |
09:16:15 | FromDiscord | <Rika> Someone’s gonna get mad at you for using epoch time instead of mono time for benchmarking |
09:16:53 | FromDiscord | <BhamidipatiNikhil> and i was able to get the answer in 5.5 secs |
09:16:56 | FromDiscord | <BhamidipatiNikhil> Image |
09:17:10 | FromDiscord | <Rika> Now is it correct |
09:17:11 | FromDiscord | <BhamidipatiNikhil> https://media.discordapp.net/attachments/371759389889003532/936188075778904074/unknown.png |
09:17:12 | PMunch | @Elegantbeef, it's not my problem your client doesn't properly do styling: https://uploads.peterme.net/redditsidebar.png |
09:17:50 | FromDiscord | <BhamidipatiNikhil> The same program took 9 secs in c++ |
09:17:52 | FromDiscord | <BhamidipatiNikhil> https://media.discordapp.net/attachments/371759389889003532/936188247502110800/unknown.png |
09:17:57 | PMunch | jmdaemon, the wrapper was just outdated, and not lot of people are using CEF so it's not exactly easy to find help for random issue |
09:19:09 | FromDiscord | <Elegantbeef> Pmunch you're on old reddit! |
09:19:10 | FromDiscord | <BhamidipatiNikhil> I was so shell shocked.... freaking c++ took 9 secs and nim took 5.5 secs.... it was basically the same logic, but nim outshined c++ left and right.... |
09:19:35 | FromDiscord | <Phil> In the "About Community" section it does not display as well from the official reddit page (new reddit design) |
09:19:45 | FromDiscord | <Phil> (edit) "In the "About Community" section it does not display ... as" added "correctly" |
09:19:48 | PMunch | @Elegantbeef, of course I am, what kind of maniac uses new reddit? |
09:20:21 | FromDiscord | <Elegantbeef> BuT NiM is GceD |
09:20:27 | FromDiscord | <Elegantbeef> Uhh |
09:20:28 | FromDiscord | <Phil> https://media.discordapp.net/attachments/371759389889003532/936188897841516564/Screenshot_from_2022-01-27_10-20-01.png |
09:20:38 | FromDiscord | <BhamidipatiNikhil> In reply to @Rika "Someone’s gonna get mad": should i use mono time ?? |
09:20:46 | FromDiscord | <Phil> Not that I actually use new reddit, just not logged in on this laptop |
09:21:01 | FromDiscord | <Elegantbeef> You should use monotime |
09:21:06 | FromDiscord | <Phil> In reply to @BhamidipatiNikhil "should i use mono": Do you care about the actual point in time or the difference between two points in time? |
09:21:22 | FromDiscord | <BhamidipatiNikhil> the difference between 2 points in time... |
09:21:26 | FromDiscord | <Phil> monotime it is |
09:21:44 | FromDiscord | <Elegantbeef> Also what are the compiler flags? |
09:22:12 | FromDiscord | <BhamidipatiNikhil> nim c -d:release -r CollatzInNim.nim |
09:22:20 | FromDiscord | <Forest> In reply to @demotomohiro "<@909883978717204561> That error message": Oh i forgot about that rip |
09:22:29 | FromDiscord | <Elegantbeef> cmon do `-d:danger --gc:arc` 😀 |
09:22:39 | * | k0mpjut0r quit (Read error: Connection reset by peer) |
09:23:01 | FromDiscord | <Elegantbeef> oh i forgot `--passL:"-flto" ` |
09:23:12 | FromDiscord | <Elegantbeef> does that need the `--passC:"-flto"` aswell? |
09:23:38 | * | szahid| is now known as szahid |
09:24:00 | FromDiscord | <Elegantbeef> Not that the GC matters much here |
09:24:09 | FromDiscord | <Elegantbeef> Arc might even make it slower |
09:24:37 | PMunch | So does new reddit not support styling in those messages? |
09:25:22 | FromDiscord | <Elegantbeef> I think it does but I do not know |
09:26:05 | FromDiscord | <Elegantbeef> I think it doesnt |
09:26:10 | FromDiscord | <Elegantbeef> Fucking silly then |
09:26:44 | FromDiscord | <Elegantbeef> It does support things like |
09:26:51 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/936190510916337694/image.png |
09:27:12 | FromDiscord | <Elegantbeef> I dont see why it'd not allow linking from descriptions |
09:27:13 | PMunch | Best performance I got was with -d:danger, but without -flto and arc |
09:27:58 | PMunch | Ah well, maybe slightly better actually with -flto and arc |
09:28:09 | PMunch | I didn't run it a lot of times to test, but now I did three runs and it was faster |
09:29:21 | FromDiscord | <Elegantbeef> Hey we're code golf those flags generally |
09:29:27 | PMunch | @Elegantbeef, better? |
09:29:30 | FromDiscord | <Elegantbeef> Though in this program arc might do more harm than good since there arent any allocations |
09:29:46 | PMunch | If there aren't any allocations it shouldn't do anything |
09:30:01 | PMunch | Although this prints a lot of stuff, so it has to allocate strings and deallocate them again |
09:30:27 | PMunch | By the way @BhamidipatiNikhil printing is super slow, if you want speed you should remove those echos |
09:30:49 | FromDiscord | <Elegantbeef> Well by "any" i mean few |
09:31:11 | FromDiscord | <BhamidipatiNikhil> In reply to @PMunch "By the way <@764483963422375946>": Then how should i print? |
09:32:11 | PMunch | Just don't print :P |
09:32:20 | FromDiscord | <Rika> Print after the benchmark |
09:32:28 | PMunch | It's not `echo` in Nim which is slow, it's just printing in general which is slow |
09:33:31 | FromDiscord | <BhamidipatiNikhil> In reply to @Elegantbeef "cmon do `-d:danger --gc:arc`": After trying what the bot wanted me to do... i optimised my code by 1 more second... https://media.discordapp.net/attachments/371759389889003532/936192187346071582/unknown.png |
09:33:55 | FromDiscord | <Elegantbeef> Make a large memfile and write then instead, then close it 😛 (I'm kidding dont print in benchmarks other than results) |
09:33:55 | FromDiscord | <Elegantbeef> I'm not a bot |
09:34:03 | FromDiscord | <Elegantbeef> I'm a human with... ok i dont have feelings but i'm not a bot! |
09:34:09 | FromDiscord | <BhamidipatiNikhil> 😑 |
09:34:39 | FromDiscord | <Elegantbeef> And yea pmunch it's better |
09:34:41 | FromDiscord | <Rika> Shut up bot |
09:34:47 | FromDiscord | <demotomohiro> @BhamidipatiNikhil Said it took 5.5 seconds, so I think slowness of echo is small enough in this case |
09:34:48 | FromDiscord | <Elegantbeef> Ok |
09:34:55 | FromDiscord | <Elegantbeef> No more compiler bug fixes from me now |
09:35:00 | FromDiscord | <Elegantbeef> Thank rika |
09:35:40 | FromDiscord | <BhamidipatiNikhil> What the hell? Are these above bots written in nim?? |
09:35:51 | PMunch | We're not bots -_- |
09:36:11 | PMunch | We're users on different platforms, all the live chats are bridged together |
09:36:12 | FromDiscord | <Rika> In all seriousness they’re just using different chat systems |
09:36:17 | PMunch | So in Discord it shows us as bots |
09:36:17 | FromDiscord | <Elegantbeef> No we're humans using chat bridges to talk to people in discord |
09:36:17 | FromDiscord | <Elegantbeef> I swear people dont believe us when we say that |
09:36:41 | FromDiscord | <Phil> I wonder how many times a week you guys have to deal with this debate |
09:36:49 | FromDiscord | <Rika> Once a day I believe |
09:36:52 | FromDiscord | <Elegantbeef> Discord users dont show as a bot to us though comically enough 😀 |
09:36:52 | FromDiscord | <Phil> The answer is definitely also too many times |
09:37:01 | PMunch | I guess we should take it as a compliment that people think the Nim community casually writes bots that pass the Touring test (apart from having "bot" right next to their name) |
09:37:22 | FromDiscord | <Elegantbeef> Nim's sitting on super intelligence |
09:37:24 | PMunch | Wait, it's Turing test.. |
09:37:24 | FromDiscord | <Phil> I do it every tuesday after sport |
09:37:26 | FromDiscord | <Phil> Easy peasy |
09:37:44 | FromDiscord | <Phil> Well those bots I write every Saturday morning after breakfast |
09:37:57 | FromDiscord | <Rika> I failed the Turing test |
09:37:59 | FromDiscord | <Elegantbeef> Yea after Alana touring |
09:38:03 | PMunch | Each member of the Nim community has written a bot that answers like the user itself would, that way we can always be online! |
09:38:27 | FromDiscord | <Elegantbeef> I didnt study for it myself |
09:38:32 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:38:42 | FromDiscord | <Elegantbeef> I havent said enough swears recently for that to be true |
09:39:20 | FromDiscord | <BhamidipatiNikhil> I am not finding any information about these bots even on googling https://media.discordapp.net/attachments/371759389889003532/936193652085125150/unknown.png |
09:39:58 | FromDiscord | <Elegantbeef> Is this a joke? |
09:40:25 | FromDiscord | <Clonkk> We're just some of @mratsim experiment in data science that became self aware↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
09:41:54 | FromDiscord | <Rika> In reply to @Elegantbeef "Is this a joke?": I can’t tell anymore tbh |
09:42:20 | FromDiscord | <Clonkk> Error\: module humour not found↵(@Rika) |
09:42:51 | FromDiscord | <Rika> In reply to @Clonkk "Error\: module humour not": Did you miss the part where everyone else stopped joking about it |
09:43:03 | FromDiscord | <Elegantbeef> I swear people are just joking, between the frontend gdb programmer and this one i just dont believe people think we're bots |
09:43:41 | FromDiscord | <Clonkk> Maybe we are bots who have been programmed to believe otherwise |
09:43:59 | FromDiscord | <Clonkk> After all, the evidence is plain \: there is a "bot" right next to our name. Would discord lie to you ? |
09:45:07 | FromDiscord | <Rika> They have plenty of times hahaha |
09:46:07 | PMunch | I'm actually surprised by how many of you are on IRC. After I set up the plug-in to extract the names from FromDiscord and replace them I can't tell the difference anymore and just assumed you where all Discord people |
09:46:37 | PMunch | @Elegantbeef, and I'm pretty sure he's just messing with you at this point |
09:46:51 | PMunch | @Clonkk, frond-end GDB programmer? |
09:47:19 | FromDiscord | <Elegantbeef> The person that made gdb frontend |
09:47:29 | FromDiscord | <Elegantbeef> They were certain i was a bot or joking for minutes |
09:47:41 | FromDiscord | <Elegantbeef> I'm on matrix like you should be! |
09:48:47 | FromDiscord | <eyecon> The quality of these bots are truly exceptional, they sound even self-aware and making meta-jokes |
09:49:13 | FromDiscord | <Elegantbeef> Maybe you're the bot and we're humans! |
09:49:36 | PMunch | Aah, right :P |
09:49:43 | FromDiscord | <eyecon> Never thought of that possibility, can't be sure that it isn't the case |
09:49:49 | PMunch | But I like IRC :( |
09:50:00 | FromDiscord | <eyecon> If there's no one to call out a bot, is it still a bot |
09:50:16 | FromDiscord | <Elegantbeef> If the bot falls in the forest does it make a "beep boop"? |
09:51:24 | FromDiscord | <Rika> Is life raycasted |
09:51:27 | FromDiscord | <eyecon> Let's try it with a sacrificial bot and a recorder |
09:51:48 | FromDiscord | <Elegantbeef> Where's all the fun Nim code? |
09:51:52 | FromDiscord | <NicoIas> sent a code paste, see https://play.nim-lang.org/#ix=3NF3 |
09:51:57 | FromDiscord | <Elegantbeef> Damn |
09:51:58 | FromDiscord | <Elegantbeef> I ask and it comes in |
09:52:16 | FromDiscord | <Elegantbeef> `+textPadding` is a unary operator |
09:52:16 | FromDiscord | <Rika> Spacing is important in Nim |
09:52:16 | FromDiscord | <eyecon> The fun Nim code, at your service |
09:52:29 | FromDiscord | <Elegantbeef> operators touching identifiers are taken as unary |
09:52:41 | FromDiscord | <Rika> In reply to @Elegantbeef "operators touching identifiers are": Touching one identifier |
09:52:44 | FromDiscord | <Elegantbeef> Second operator question in one day |
09:52:52 | FromDiscord | <Elegantbeef> Ah yes sorry |
09:53:19 | FromDiscord | <Elegantbeef> `a+b` == `a + b` `a +b` == `a +(b)` |
09:53:35 | FromDiscord | <Rika> ? |
09:53:47 | FromDiscord | <Rika> Or `a(+b)` |
09:53:53 | FromDiscord | <eyecon> In reply to @NicoIas "what is going on": In short: `textEnd.x += hours.width +textPadding` is `textEnd.x += hours.width(+textpadding)` |
09:53:58 | FromDiscord | <Rika> Yes |
09:54:39 | FromDiscord | <eyecon> If it is a function at least |
09:54:47 | FromDiscord | <NicoIas> oh I get it! Took me a solid 2 minutes to understand what you guys meant ahah |
09:54:55 | FromDiscord | <NicoIas> I see, that's a bit unexpected |
09:55:03 | FromDiscord | <Rika> Well it will be like that regardless since it’s a syntax thing and not a semantic thing |
09:55:15 | FromDiscord | <Elegantbeef> unary is an operator that has a single parameter, binary is an operator with two ... |
09:56:01 | PMunch | @NicoIas, if you want to be properly confused turn on whitespace math ordering :P |
09:56:06 | FromDiscord | <Elegantbeef> Nim binds unary operators regardless of context in the case, if `+textPadding` was invalid you would have got a "unknown `+` operator" |
09:56:11 | PMunch | Or has that feature been removed? |
09:56:25 | FromDiscord | <Elegantbeef> I've never heard of it |
09:56:31 | FromDiscord | <eyecon> In reply to @PMunch "<@179174721764458496>, if you want": Do we beginners want to know what that is |
09:56:53 | FromDiscord | <Rika> In reply to @PMunch "Or has that feature": I don’t think it was ever added? |
09:56:58 | FromDiscord | <Elegantbeef> I think it's either removed or not documented anymore |
09:57:10 | PMunch | @eyecon, definitely not :P |
09:57:22 | PMunch | I'm pretty sure it was an experimental feature at some point |
09:57:54 | FromDiscord | <Tetralux> I'm gonna take a wild guess: `3+2 8` == `(3+2) 8` |
09:58:12 | FromDiscord | <Elegantbeef> Yes |
09:58:13 | FromDiscord | <eyecon> I see, shutting off my senses now |
09:58:20 | FromDiscord | <eyecon> Too late 😦 |
09:58:21 | FromDiscord | <Tetralux> 🤣 |
09:58:31 | FromDiscord | <eyecon> Nooo |
09:58:38 | FromDiscord | <Elegantbeef> unary biinding is only if there isnt a space proceding the operator |
09:59:05 | FromDiscord | <Elegantbeef> Otherwise it's a binary operator |
09:59:32 | FromDiscord | <demotomohiro> !eval echo 3+2 8 |
09:59:33 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: invalid token: (\29) |
09:59:48 | FromDiscord | <eyecon> Wut |
10:00:13 | FromDiscord | <eyecon> !eval echo (3+2 8) |
10:00:15 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: invalid token: (\29) |
10:00:17 | PMunch | Duscard for some reason converts * to a dot, which breaks all code pastes and NimBot interaction :P |
10:00:26 | FromDiscord | <demotomohiro> !eval echo 3+2 \ 8 |
10:00:26 | PMunch | !eval echo 3+2 * 8 |
10:00:28 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: invalid token: (\29) |
10:00:29 | NimBot | 19 |
10:00:30 | FromDiscord | <Rika> It’s likely the bridge actually |
10:00:46 | PMunch | See, mine works fine from IRC |
10:00:49 | FromDiscord | <Elegantbeef> It's 100% the bridge `` as pmunch said isnt ever right |
10:00:55 | FromDiscord | <eyecon> In reply to @PMunch "Duscard for some reason": Ah, surprises do not cease here |
10:01:07 | PMunch | Wait, it's the bridge which does that? |
10:01:10 | PMunch | Why?! |
10:01:29 | FromDiscord | <Elegantbeef> Well it's not discord doing it |
10:01:31 | FromDiscord | <Rika> Lol don’t ask me |
10:01:42 | FromDiscord | <Rika> Yardanico made it so ask them |
10:01:42 | PMunch | Oh wait, maybe it's trying to do *bold* or something |
10:01:46 | FromDiscord | <Elegantbeef> The client properly shows `` 😛 |
10:02:01 | FromDiscord | <eyecon> !eval echo 3+2 \ 8 |
10:02:03 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: invalid token: (\29) |
10:02:15 | FromDiscord | <demotomohiro> `\` doesn't fix the problem? |
10:02:16 | PMunch | !eval echo 3+2 8 |
10:02:17 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: invalid token: (\2) |
10:02:22 | FromDiscord | <eyecon> It doesn't make a difference if a backspace is in front of it |
10:02:27 | FromDiscord | <Elegantbeef> https://github.com/Yardanico/ircord/issues/19 |
10:02:30 | FromDiscord | <eyecon> I just tried |
10:02:57 | PMunch | It was apparently called "strong spaces" |
10:03:23 | FromDiscord | <Rika> Make it weak then |
10:03:32 | FromDiscord | <Elegantbeef> I think i seen some conversations about it but never really seen it in action |
10:04:18 | FromDiscord | <eyecon> In reply to @PMunch "It was apparently called": Why... the.. |
10:04:38 | FromDiscord | <eyecon> What converts it in the first place |
10:04:40 | FromDiscord | <Elegantbeef> Where are the newer Nim queries?! |
10:04:43 | FromDiscord | <Elegantbeef> It worked last time |
10:04:48 | FromDiscord | <Elegantbeef> Should work again! |
10:05:44 | PMunch | Run this snippet: https://play.nim-lang.org/#ix=3NF7 |
10:05:51 | PMunch | And then change the version to 0.19.6 |
10:06:13 | FromDiscord | <Elegantbeef> Ah yes i remember now |
10:06:21 | PMunch | @Elegantbeef, what are you talking about? |
10:06:33 | FromDiscord | <Elegantbeef> tighly bound binary operators overrides precedence |
10:06:57 | FromDiscord | <Elegantbeef> The last time i said "what about Nim code" someone asked a question 😛 |
10:07:19 | PMunch | Oh, haha :P |
10:12:30 | PMunch | You can work on this if you want @Elegantbeef: https://github.com/nim-lang/Nim/issues/19449 |
10:13:28 | FromDiscord | <Elegantbeef> But but i've been working on my game again |
10:30:28 | PMunch | Oooh, gotten any further? |
10:30:42 | PMunch | This is still Linerino right? |
10:31:42 | * | jjido joined #nim |
10:39:03 | * | NimBot joined #nim |
10:39:05 | FromDiscord | <Elegantbeef> Nim doesnt have left to right inference do `[0u32 ,2, 4, 6]` |
10:39:07 | FromDiscord | <Goel> But why if is in the same line of the declaration? |
10:40:03 | FromDiscord | <Elegantbeef> Do you want the technical reason or are you ok with me just repeating what i said? 😀 |
10:40:49 | FromDiscord | <Rika> I’m at least interested in the technical reason |
10:40:50 | FromDiscord | <Rika> Unless I already know |
10:41:16 | FromDiscord | <Elegantbeef> Nim's array semantic check does not take in an assumed type, and as such sem's it as an `array[4, int]` which does not convert implicitly to `array[4, uint32]` |
10:41:42 | FromDiscord | <konsumlamm> ~~the technical reason is that Nim doesn't have left to right inference~~ |
10:42:15 | FromDiscord | <Elegantbeef> Matrix bridge made it seem like I waited until rika asked 😀 |
10:43:02 | FromDiscord | <Rika> Good enough though |
10:43:15 | FromDiscord | <Rika> Could have just not said that and none of us here woulda known |
10:45:35 | FromDiscord | <konsumlamm> i'm really losing motivation to work with Nim rn, this is the 3rd bug in 5 days |
10:45:40 | FromDiscord | <konsumlamm> maybe it's all the same bug |
10:46:10 | FromDiscord | <konsumlamm> but something is going on with variables being incorrectly moved or something |
10:46:27 | FromDiscord | <konsumlamm> does moving/destructor stuff also happen for refc? |
10:47:40 | arkanoid | konsumlamm, what's the problem? do you have a minimal example? |
10:48:22 | FromDiscord | <konsumlamm> this is part of it: https://github.com/nim-lang/Nim/issues/19457 |
10:48:27 | arkanoid | I'm also finding some bugs when dealing with OOP + destructors + ARC, but so far seems that there are workarounds for every situation |
10:48:53 | FromDiscord | <konsumlamm> there are workarounds |
10:49:05 | FromDiscord | <Elegantbeef> move semantics shouldnt be used for refc |
10:49:28 | FromDiscord | <konsumlamm> but... i don't want to use workarounds when it's for compiler bugs |
10:50:22 | FromDiscord | <konsumlamm> i wouldn't trust a language where i constantly need to work around compiler bugs |
10:50:40 | arkanoid | sure, I mean, for example here I have to use code reordering otherwise my destructors are not called: https://github.com/nim-lang/Nim/issues/19402#issuecomment-1022921122 |
10:51:09 | FromDiscord | <konsumlamm> i don't even use destructors (just the default ones) |
10:51:17 | arkanoid | konsumlamm, you have to weight these with issue you'd have with other system programming languages |
10:51:40 | FromDiscord | <konsumlamm> in Rust i encountered exactly zero bugs so far ¯\_(ツ)_/¯ |
10:53:20 | FromDiscord | <konsumlamm> anyway, i have some code that works fine as is, but if i insert `echo`s, it fails... (using refc too) |
10:53:57 | arkanoid | yes, but you have to write your code how rust likes, and you have to bend the patterns you know to fit the patterns enforced by rust. It is ok given the fact that those patterns are *safer*, but yet is turning human into machine |
10:54:01 | FromDiscord | <xflywind> Rust is already a mature and successful language with massive supports and developers. Nim should be compared to Crystal or Vlang which also has many compiler bugs. |
10:54:38 | FromDiscord | <konsumlamm> i'd never touch V ever |
10:55:44 | arkanoid | I feel nim is still the sweet spot |
10:56:06 | arkanoid | but yes, there are severe compiler bugs |
10:56:07 | FromDiscord | <konsumlamm> Crystal and D are fair comparisons, i just mentioned Rust because arkanoid was talking about other system languages and that's the only system language i really know |
10:56:28 | FromDiscord | <konsumlamm> i mean, there's a reason i'm not using crystal or D instead, but it's still pretty annoying |
10:56:41 | FromDiscord | <konsumlamm> idk how common compiler bugs are for those |
10:56:50 | arkanoid | me neither |
10:58:18 | arkanoid | but with rust you cannot implement new language features using language itself, and that makes things easier for compiler devs |
10:58:55 | FromDiscord | <konsumlamm> ~~you can if you're fine with wrapping everything in a macro~~ |
10:59:05 | arkanoid | also you don't have to rely on multiple backends that spits out code in different languages, but just LLVM IR |
10:59:24 | FromDiscord | <konsumlamm> i mean attribute macros can be used to make new language features sort of |
10:59:33 | arkanoid | are you saying that rust macros are 1:1 with nim macros? I don't feel that |
10:59:50 | FromDiscord | <konsumlamm> no, i'm saying that you can use them to implement new "language features" |
11:03:31 | FromDiscord | <konsumlamm> In reply to @konsumlamm "anyway, i have some": it also only happens when run in the VM |
11:04:24 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:07:20 | FromDiscord | <konsumlamm> but not when i extract the call that fails... |
11:10:03 | PMunch | Do we know who created the original Nim badger? |
11:10:08 | PMunch | I think I've asked this before.. |
11:10:36 | arkanoid | the point that keeps me from using nim (that I do anyway) is that there are advanced features that you want to use, but then the same features are the source of wrong behaviours and so general guidelines want you sto stick with easier code |
11:11:01 | arkanoid | so you end up doing things in defensive mode |
11:16:23 | PMunch | The problem is that the advanced features aren't used as often, so you might just do something that has never been tried before, and which no-one anticipated during the design of that feature |
11:17:01 | PMunch | Most workarounds seems to be just doing it the way the feature was designed to work |
11:17:50 | PMunch | Which is still bad though |
11:18:24 | arkanoid | yes |
11:18:53 | PMunch | To be fair, after having used Nim for quite a while I tend to run into fewer and fewer bugs |
11:19:17 | PMunch | Probably because I program more the way Nim was intended to be programmed, but still |
11:19:58 | arkanoid | if foo.nim is a nim file that doesn't compile, but it is `include`d in bar.nim that compiles correctly, is foo.nim still considered a "module" according to docs? or just bar.nim is? |
11:21:58 | PMunch | Good question |
11:22:12 | PMunch | Depends on what you mean by "according to docs" |
11:22:31 | FromDiscord | <hmmm> meh the comparisons with rust are always unfair they have 10x-100x times the eyeballs and possibly 100x - 1000x funding, wtf are we talking about 🧐 |
11:23:38 | PMunch | I mean it's still fair to critique Nim for having unstable features |
11:24:13 | PMunch | ARC is still a bit experimental, which is why it isn't the default |
11:25:36 | PMunch | I ran --expandArc on @konsumlamm's example |
11:25:37 | PMunch | http://ix.io/3NFk |
11:25:39 | FromDiscord | <hmmm> meh, if you use incredibly niche comfy lang, you should calibrate your expectations accordingly. It's obvious nim can't have the battle testing and mileage to iron the rough edges |
11:26:02 | PMunch | It looks like b is turned into a cursor, then it is assigned to c and c is promptly destroyed |
11:26:28 | * | adigitoleo quit (Quit: adigitoleo) |
11:27:04 | PMunch | If you scope 'c' to be outside the loop it works fine |
11:27:22 | PMunch | Like so: http://ix.io/3NFl |
11:27:26 | arkanoid | hmmm, yes, but no. There's line between experimental and not experimental, and nim does have this line, but silent bugs on simple tests are also before this line |
11:27:34 | PMunch | But this is of course a bug |
11:28:07 | arkanoid | btw: I still consider nim the best language ever |
11:28:39 | FromDiscord | <Rika> Y’all let’s all become rich and fund Nim to explosion |
11:31:33 | PMunch | Didn't Nim recently get a huge chunk of donations? |
11:34:15 | arkanoid | PMunch: are you referring to the 100K in bitcoin? |
11:36:19 | PMunch | Yup |
11:37:02 | PMunch | I guess those depreciated massively recently.. |
11:37:15 | PMunch | Hopefully they took my advice and invested some |
11:37:26 | FromDiscord | <Rika> Well if it wasn’t converted |
11:37:38 | FromDiscord | <Rika> Though USD has been dropping too I assume |
11:40:36 | FromDiscord | <Rika> I assume?? I mean I think |
11:42:25 | FromDiscord | <Tanguy> Seems to be sitting here https://www.blockchain.com/btc/address/1BXfuKM2uvoD6mbx4g5xM3eQhLzkCK77tJ |
11:43:34 | FromDiscord | <Tanguy> Seems to be sitting here https://www.blockchain.com/btc/address/bc1qzgw3vsppsa9gu53qyecyu063jfajmjpye3r2h4 |
11:45:10 | FromDiscord | <Rika> F |
11:46:42 | FromDiscord | <Forest> In reply to @Forest "Oh i forgot about": Added the shell_minimal.html file, but got this error: https://www.toptal.com/developers/hastebin/wunokirihe.nim |
11:47:12 | FromDiscord | <Forest> I don't know how to fix the android-glob error but i don't have any other device with emscripten |
11:47:37 | szahid | Do you know some good CMS for documentation? |
11:49:15 | * | k0mpjut0r joined #nim |
11:56:58 | PMunch | szahid, I use CouchCMS for my website, it's pretty neat |
11:57:08 | PMunch | But I'm going to try out HTMX for some stuff soon |
12:00:32 | * | k0mpjut0r quit (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
12:00:49 | * | k0mpjut0r joined #nim |
12:42:31 | FromDiscord | <Forest> Anyone? :p |
12:57:28 | Amun-Ra | nope |
12:58:49 | FromDiscord | <Forest> Rip |
13:01:15 | PMunch | @Forest, well you need that library in a path where wasm-ld can find it |
13:05:13 | FromDiscord | <Forest> Does it not use my normal library path? |
13:05:27 | FromDiscord | <Forest> How would i allow emscripten to see it? |
13:07:59 | PMunch | I've got no idea what wasm-ld uses |
13:08:12 | PMunch | I assume it uses the normal library path |
13:08:32 | FromDiscord | <Forest> Hm then there should be no issue :/ |
13:38:36 | * | rockcavera joined #nim |
13:38:36 | * | rockcavera quit (Changing host) |
13:38:36 | * | rockcavera joined #nim |
13:52:06 | l1x | is there a https library / option for import asynchttpserver, asyncdispatch |
14:18:05 | FromDiscord | <mratsim> In reply to @Rika "F": Araq had the key on a discarded disk and is now looking for it in a dump. |
14:18:14 | FromDiscord | <Rika> oh god |
14:18:28 | FromDiscord | <Rika> i feel like ive heard this before but forgot |
14:19:28 | FromDiscord | <mratsim> posting in #offtopic |
14:44:58 | * | arkurious joined #nim |
14:54:37 | FromDiscord | <Tanguy> sent a code paste, see https://play.nim-lang.org/#ix=3NG7 |
14:57:49 | FromDiscord | <Clonkk> I think `collect` does something like this ?↵(@Tanguy) |
14:58:32 | FromDiscord | <Clonkk> https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped |
15:00:51 | * | PMunch quit (Quit: leaving) |
15:17:22 | * | cornfeedhobo quit (Remote host closed the connection) |
15:29:20 | arkanoid | which options do I have to solve the circular dependency problem in nim? I know: A) bundle everything in single module B) forward declarations, else? |
15:29:48 | * | cornfeedhobo joined #nim |
15:30:17 | FromDiscord | <dom96> put all your types in a types.nim file |
15:31:23 | FromDiscord | <mratsim> In reply to @arkanoid "which options do I": mixin |
15:32:05 | FromDiscord | <mratsim> sometimes you can put your imports after the proc needed for the dependency in the other module are defined. |
15:33:15 | arkanoid | mratsim, mixin as in C++ mixin? |
15:33:56 | FromDiscord | <mratsim> Nim mixin |
15:34:18 | FromDiscord | <mratsim> only works in generics or templates though |
15:34:42 | FromDiscord | <mratsim> basically it tells the compiler "don't try to look for this symbol now, the caller will have it in its scope" |
15:40:18 | FromDiscord | <Phil> Is there a way to get nim to shut up about circular dependencies every time I import db_sqlite >_> ? |
15:40:27 | FromDiscord | <Phil> (edit) ">_>" => ">\_>" |
15:40:42 | arkanoid | mmmm ok |
15:52:59 | Zevv | arkanoid: the ciruclar dependency problem has been my main issue with nim for a long time - every time I try to make a decent sized project in Nim, I run into this. It's hard to keep modules decoupled end you do end up with one single file with dozens of type definitions. |
15:53:19 | Zevv | I've heard rumours that there is work done on this, but I'm not aware of any other solutions yet |
15:53:45 | Zevv | People usally say my code is bad if I need circular types |
15:53:56 | Zevv | so it must be me. |
15:55:00 | arkanoid | yeah, it's bad design usually, but here I'm trying to refactor a nim library that is done in the "one huge module with dozen of forward declarations" |
15:56:13 | Zevv | I'd even argue against the bad design - it's pretty common to have things pointing at each other. I have a thing containing things, and I want the individual things to be able to point to the thing they're in. It's a pretty common pattern. C offers simple opaque types for that, but in Nim this is a pita |
15:56:52 | Zevv | for the forward declarations, you might get away with enabling code reordering, experimental feature. Usually works just fine for me |
15:57:00 | Zevv | but not with types, only with functions |
15:57:38 | Amun-Ra | you can have forward-alike type declarations in the same type block |
15:57:47 | arkanoid | yes but code reordering seems to not work between nim modules "include"'ing each other "not import" |
15:57:51 | Zevv | yes, that's the restriction. The same type block |
15:58:16 | arkanoid | I already have all types in single `type` bock, problem are procs |
16:00:16 | Zevv | anyway, this is an old problem that keeps coming up every so often. iirc there's an rfc somewhere about it, you might want to poke that |
16:00:50 | Zevv | https://github.com/nim-lang/RFCs/issues/6 2016 |
16:00:57 | Amun-Ra | #6 |
16:04:17 | arkanoid | yeah, been there in the last months, yet there's no solutions |
16:04:25 | FromDiscord | <hmmm> I thought the general solution people used was matrioska boxes? A is the boss and imports whatever it wants, B is miniboss, imports whatever except from A, C is working class, no A and B but can import D and D is peon and cannot import from anyone 🤔 |
16:04:44 | Zevv | software architecture is not always a nice tree |
16:04:49 | FromDiscord | <hmmm> hmm |
16:04:51 | Zevv | sometimes it's a graph. bidirectional |
16:06:28 | FromDiscord | <hmmm> the last time I had the problem I tried to make a module just for the imports but it didn't work so I had to change a bunch of code to fit the matrioska model |
16:07:36 | Zevv | the last time I had the problem I decided to drop nim for a while |
16:07:41 | FromDiscord | <hmmm> haha |
16:08:10 | arkanoid | The extreme case I'm dealing with sees a single main .nim file doing "include" of a dozen others, and one is "types.nim". Code is full or forwarding declarations. I'm trying to make things better, but apparently this is the only solution |
16:08:24 | Zevv | yes |
16:09:02 | arkanoid | and this sucks |
16:09:08 | FromDiscord | <hmmm> yea honestly it's probably the worst thing happened to me in my smol nim experience. Since nim usually gets nicely out of the way it was strange I had to change a bunch of code to fit nim |
16:11:32 | arkanoid | sigh, this means that I'm doomed to fail in my effor to make things better |
16:12:36 | FromDiscord | <enthus1ast> i had good experience with splitting everything even more |
16:12:49 | FromDiscord | <enthus1ast> so for every module i also created a types file |
16:13:01 | FromDiscord | <enthus1ast> foo.nim ; typesFoo.nim |
16:13:22 | FromDiscord | <enthus1ast> that whay you can use typesFoo.nim where you just need the typdefs from this module |
16:13:37 | arkanoid | enthus1ast: you do import or include? |
16:13:46 | FromDiscord | <enthus1ast> and i made it so that importing foo.nim also exports typesFoo.nim for convenience |
16:13:47 | FromDiscord | <enthus1ast> import |
16:14:22 | arkanoid | I don't see how this can fix the circular depedency problem |
16:15:01 | FromDiscord | <enthus1ast> what are you circular dependencies= |
16:15:02 | FromDiscord | <enthus1ast> ? |
16:16:24 | arkanoid | module foo has "proc fooProc = barProc()" and module bar has "proc barProc = fooProc()" |
16:16:49 | arkanoid | if you import bar in foo, and foo in bar, you end up with something that won't compile |
16:17:35 | FromDiscord | <enthus1ast> if these modules are so intertwinded, maybe they are no different modules but belong to one? |
16:18:35 | FromDiscord | <enthus1ast> or maybe you could have them import a non intertwined "implementation" module |
16:22:05 | arkanoid | also, the "one file with all types" solution is not possible if you're using finalizers: "Error: type bound operation `delete` can be defined only in the same module with its type" |
16:23:42 | arkanoid | it's a chain reaction that drives to not use import at all |
16:26:25 | Zevv | your code is bad and you should feel bad |
16:29:02 | arkanoid | I do |
16:40:41 | FromDiscord | <mratsim> finalizers? |
16:40:53 | FromDiscord | <mratsim> with ref objects? |
16:41:11 | FromDiscord | <mratsim> one file with many types isn't too bad. |
16:42:01 | FromDiscord | <mratsim> @Zevv agree on the cyclic import part. Sometimes you refactor and it rears its ugly head and then what you thought was a nice evening now becomes just painful copy-pasta night |
16:47:33 | Zevv | right. it kind of ruined the fun of programming Nim for me on the last largish project I did, so for the thing after I moved back to C++ |
17:03:50 | FromDiscord | <Phil> Say I want to express in a proc that if you pass it a given variable as parameter, that memory is now owned by the proc, you don't get to have access to it anymore. How do I annotate this?↵Connection shall now be owned by recycleConnection if it is being used↵`proc recycleConnection(connection: DbConn) {.gcsafe.} =` |
17:04:12 | FromDiscord | <Phil> DbConn is a pointer of the Sqlite3 type |
17:04:48 | FromDiscord | <Phil> (edit) "anymore." => "anymore outside of the proc." | "anymore outside of the proc.How do I annotate ... this?↵Connection" added "this? Can I even do" |
17:14:27 | FromDiscord | <Phil> I found "https://nim-lang.org/docs/destructors.html"↵Which says to use `sink` to ↵`proc recycleConnection(connection: sink DbConn) {.gcsafe.} =`↵I mostly want to be on the safe side that I'm understanding this correctly |
17:23:05 | arkanoid | what's the meaning of "type Bar" in "proc test(foo: type Bar)"? I know "proc test[T]" and "proc test(foo: typedesc)" |
17:24:44 | FromDiscord | <michaelb> In reply to @arkanoid "what's the meaning of": might more often be expressed like `proc test(T: type Bar)`, and you can invoke it with `Bar.test` |
17:26:27 | FromDiscord | <michaelb> a use case is defining init proc for a type, involving logic and default param values that you don't get by calling `Bar()` directly |
17:26:47 | FromDiscord | <michaelb> `proc init(T: type Bar, ...): T` |
17:26:54 | FromDiscord | <Rika> same as typedesc[Bar] i believ |
17:26:55 | FromDiscord | <Rika> (edit) "believ" => "believe" |
17:27:03 | FromDiscord | <Rika> in this case |
17:27:34 | FromDiscord | <Rika> type in proc signature -> typedesc↵type in proc body -> typeof |
17:28:24 | FromDiscord | <michaelb> (edit) "...): T`" => "a = 123, b = "stuff"): T = Bar(a: a, b: b)`" |
17:29:41 | arkanoid | ok, thanks. I do know the init based on typedesc[MyType] so I'm ok with it. the problem with "type Bar" in my context is that I'm getting a circular dependency warning in the code I'm trying to refactor, here: https://play.nim-lang.org/#ix=3NH9 |
17:30:20 | arkanoid | I don't see where the circular dependency is, basically |
17:30:35 | FromDiscord | <michaelb> if I'm wrapping a C lib with a function with a parameter of type `wchar_t`, what's the best thing to do? Nim's system lib doesn't have an alias for `wchar_t` and it's not cleary to me if I std/widestrs provides a way to deal with it |
17:30:52 | FromDiscord | <michaelb> (edit) "cleary" => "clear" |
17:31:00 | FromDiscord | <michaelb> (edit) removed "I" |
17:44:40 | FromDiscord | <Shiba> why does nim generates those .o files https://media.discordapp.net/attachments/371759389889003532/936315788237897728/Capture.PNG |
17:45:04 | FromDiscord | <Rika> ? because C generates them |
17:45:39 | FromDiscord | <Shiba> the c compiler ? |
17:46:13 | FromDiscord | <Rika> yeah |
17:48:52 | FromDiscord | <Shiba> why? |
17:48:56 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3NHk |
17:49:41 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3NHk" => "https://play.nim-lang.org/#ix=3NHl" |
17:52:15 | FromDiscord | <Shiba> In reply to @Rika "yeah": is there a configuration to stop generating those object files |
17:52:22 | FromDiscord | <Rika> uh no |
17:52:27 | FromDiscord | <Rika> well maybe |
17:52:29 | FromDiscord | <Rika> but why? |
17:53:25 | FromDiscord | <tandy> is a `var object` allowed? |
17:56:14 | FromDiscord | <konsumlamm> did you try it? |
17:56:41 | FromDiscord | <tandy> im geting this error↵`Error: invalid type: 'MatrixClient' for var` |
17:57:54 | FromDiscord | <mratsim> In reply to @Isofruit "Hmmm my test fails": I think sink is a type-bound operation, you need to create your own type that wraps int in that case if you want destructors to work. |
17:58:29 | FromDiscord | <Phil> In reply to @mratsim "I think sink is": Wouldn't my second example with `myType` qualify for that? |
18:02:02 | FromDiscord | <tandy> hmm nvm |
18:12:08 | * | noeontheend joined #nim |
18:22:18 | * | wsantos joined #nim |
18:25:31 | * | wsantos quit (Client Quit) |
18:26:11 | FromDiscord | <Goel> Does the compiler doesn't warn anymore in case of unused variables? |
18:30:44 | FromDiscord | <Phil> It still warns you, believe me, it very much still does |
18:31:46 | FromDiscord | <Goel> Uhm no doesn't (in case of a global var i mean) |
18:32:04 | * | kayabaNerve quit (Ping timeout: 250 seconds) |
18:33:48 | FromDiscord | <Phil> Ah, for a global variable, hmm |
18:34:08 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=3NHA |
18:34:25 | FromDiscord | <Phil> complain = error for you? |
18:34:36 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=3NHA" => "https://play.nim-lang.org/#ix=3NHB" |
18:35:04 | FromDiscord | <Goel> Yeah i suppose in past that was a Warning, not a soft Hint, but i may be wrong |
18:36:13 | FromDiscord | <Phil> I'd count the hint as complaining, different terminology then↵`/home/isofruit/dev/tinypool/src/tinypool/pool.nim(176, 7) Hint: 'a' is declared but not used [XDeclaredButNotUsed]` |
18:36:31 | FromDiscord | <Phil> (edit) "I'd count the hint as complaining, different terminology ... then↵`/home/isofruit/dev/tinypool/src/tinypool/pool.nim(176," added "usage" |
18:40:00 | arkanoid | how can I get more info on this error? it points to internal code. " Error: cannot bind another '=destroy' to: QObject:ObjectType; previous declaration was constructed here implicitly: /home/jack/.choosenim/toolchains/nim-1.6.0/lib/system/arc.nim(210, 7)" |
18:41:01 | * | jjido joined #nim |
18:52:51 | * | neceve joined #nim |
18:57:23 | * | noeontheend quit (Ping timeout: 268 seconds) |
18:58:18 | FromDiscord | <Yardanico> some code is defining a destructor for that type after it was initialized in code |
18:58:28 | FromDiscord | <Yardanico> so that custom destructor conflicts with the default Nim one |
18:59:13 | FromDiscord | <Yardanico> you should place the destructor declaration for that type right after it is declared before it's used |
19:04:59 | * | krux02 joined #nim |
19:10:52 | NimEventer | New Nimble package! tinypool - A minimalistic connection pooling package, see https://github.com/PhilippMDoerner/TinyPool |
19:18:20 | FromDiscord | <Phil> Pool, I can finally... install my own package! |
19:18:26 | FromDiscord | <Phil> (edit) "Pool," => "Cool," |
19:22:47 | * | vicfred joined #nim |
19:28:18 | * | jmdaemon quit (Ping timeout: 256 seconds) |
19:29:16 | FromDiscord | <Forest> Anyone know of a wasmtime binding for Nim? |
19:31:14 | NimEventer | New post on r/nim by DrSalewski: First draft of the async/await chapter is now finally available, see https://reddit.com/r/nim/comments/se6h0x/first_draft_of_the_asyncawait_chapter_is_now/ |
19:32:20 | FromDiscord | <Forest> Also why does Nim not use the C types? Why does it provide it's own layer over it? |
19:32:45 | FromDiscord | <Forest> (`cint` vs `int`, `cstring` vs `string`) |
19:39:07 | FromDiscord | <mratsim> In reply to @Forest "Also why does Nim": cint are int32, we use the machine pointer size. |
19:39:18 | FromDiscord | <mratsim> cstring are slow because they don't have the length. |
19:54:09 | * | neurocyte0917090 joined #nim |
20:00:16 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:08:17 | * | PMunch joined #nim |
20:11:48 | FromDiscord | <no name fits> So I was trying to make a program that could calculate the probability of getting m unique faces with n amount of dice that has k number of faces. Someone told me the formula for it would be something like↵`1/k^n k!/(k-m)! S(n,m)` where S is the Stirling partition of the second degree, and I'm completely lost on how to approach this |
20:12:53 | * | jmdaemon joined #nim |
20:13:08 | FromDiscord | <Forest> In reply to @mratsim "cint are int32, we": Ah okay |
20:15:56 | NimEventer | New thread by Leccine: Is there a HTTPS enabled HTTP server in Nim?, see https://forum.nim-lang.org/t/8849 |
20:18:10 | * | jmdaemon quit (Ping timeout: 256 seconds) |
20:27:44 | FromDiscord | <xx_ns> huh |
20:28:15 | FromDiscord | <xx_ns> the nim forum told me "You can change anyone's rank! With great power comes great responsibility" or something like that |
20:28:18 | FromDiscord | <xx_ns> even though i just registered |
20:28:40 | FromDiscord | <xx_ns> could set my rank to be Troll, Admin, whatever |
20:28:46 | FromDiscord | <xx_ns> disappeared when i refreshed the page |
20:28:51 | FromDiscord | <xx_ns> should probably get that looked at |
20:36:07 | arkanoid | is it possible to partially compile a module that calls forward declarations, and link the real procs later on? |
20:42:29 | arkanoid | I mean, compile a file with declarations but no implementations |
20:52:55 | FromDiscord | <Elegantbeef> I do not think so |
20:55:01 | arkanoid | I'm stuck in an uroboro of nim code where I can't find a better solution that putting everything in a single huge nim module |
21:00:13 | FromDiscord | <Elegantbeef> You can do recursive imports if you structure them properly, it just takes know how |
21:01:34 | FromDiscord | <Elegantbeef> I forget how to explain how to structure them |
21:10:48 | FromDiscord | <Forest> https://haste.powercord.dev/exeguqahax.sql anyone able to help? I have no idea how to actually fix this |
21:12:53 | FromDiscord | <Yardanico> That's a bug of the termux-patched nim |
21:13:05 | arkanoid | Eleganbeef, my recipe for disaster is: A "type bound operation `delete` must be defined in the same module with its type", so "proc newFoo(): Foo = new(result, delete); result.setup()" has to be put in same module as "type Foo", but if "proc setup(foo: Foo)" does any logic that requires other modules, it creates spaghetti code |
21:13:08 | FromDiscord | <Yardanico> They added that landroid-glob to the Nim config file so it always applies |
21:13:13 | FromDiscord | <Yardanico> Even when cross compiling |
21:13:57 | FromDiscord | <Yardanico> https://github.com/termux/termux-packages/blob/master/packages/nim/build.sh#L38 |
21:14:04 | FromDiscord | <Yardanico> The seds they're doing are too broad |
21:17:25 | arkanoid | I picked nim to escape from python's difficulties when project size reaches a point, but I'm now facing the reality that also nim is no ready for large projects |
21:18:01 | * | jjido joined #nim |
21:33:57 | FromDiscord | <Phil> Beeeeeeef |
21:37:23 | FromDiscord | <Phil> If you've got any clue about this one I'll be very happy to hear it: https://discord.com/channels/371759389889003530/371759389889003532/936316844040650842 |
21:39:16 | FromDiscord | <Forest> In reply to @Yardanico "That's a bug of": Rip |
21:39:44 | FromDiscord | <Forest> Aight guess i'ma just try editing the config |
21:40:37 | FromDiscord | <Forest> Where will Nim's global config be in? |
21:42:10 | FromDiscord | <Forest> Or will i have to recompile Nim from scratch? |
21:42:17 | PMunch | arkanoid, you can use Nim for large projects. But you might have to leave some patterns you're used to in other languages behind |
21:42:54 | FromDiscord | <Phil> I was not familiar with calling a setup proc after initialization |
21:42:58 | FromDiscord | <Phil> What logic do you put in that? |
21:47:17 | FromDiscord | <kevin> sent a code paste, see https://play.nim-lang.org/#ix=3NIq |
21:47:54 | FromDiscord | <kevin> my lib loads fine mac/linux but Windows gives: `could not load: .\threadtest.dll` |
21:48:50 | FromDiscord | <kevin> sent a code paste, see https://play.nim-lang.org/#ix=3NIr |
21:50:30 | PMunch | Hmm, have you tried having a forward slash? |
21:50:34 | PMunch | Just curious |
21:50:42 | FromDiscord | <kevin> yeah, same result |
21:50:48 | FromDiscord | <Elegantbeef> remove the relative path |
21:51:23 | FromDiscord | <kevin> i also tried full path. are you saying just `threadtest.dll` instead of `.\threadtest.dll` ? |
21:51:54 | FromDiscord | <Elegantbeef> Yes |
21:52:54 | FromDiscord | <kevin> `could not load: threadtest.dll` |
21:53:16 | PMunch | Is it a loadable DLL? |
21:53:27 | PMunch | I don't know how to debug this kind of stuff on Windows.. |
21:54:00 | FromDiscord | <kevin> well I think it should be loadable... |
21:54:11 | FromDiscord | <kevin> It is loadable on mac and linux |
21:54:18 | FromDiscord | <Elegantbeef> @Phil\: what do you expect to happen? |
21:54:53 | FromDiscord | <kevin> sent a code paste, see https://play.nim-lang.org/#ix=3NIs |
21:54:59 | * | Gustavo6046 joined #nim |
21:55:02 | FromDiscord | <kevin> (edit) "https://play.nim-lang.org/#ix=3NIs" => "https://play.nim-lang.org/#ix=3NIt" |
21:55:17 | FromDiscord | <Phil> What I'm trying to find is a way that makes the code above explode when one tries to use the variable `i` whose "posession" I want to move into the proc |
21:55:27 | FromDiscord | <Elegantbeef> Nim's sink semantics copy if it cannot move |
21:56:34 | FromDiscord | <Phil> And it can't move because I access the variable outside of the proc so it says "well, I want this program to be valid, so can't move, have to copy" ? |
21:56:40 | FromDiscord | <Elegantbeef> You make the copy an error and it'll do that |
21:57:18 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/432 there are some solutions here |
21:58:06 | FromDiscord | <Phil> Check, I'll likely check those out tomorrow after getting some sleep.↵The fundamental reason why I want this is for my tinypool package again.↵After you recycle a connection back into the pool I don't want you to be able to use that connection anymore until you borrow the next one |
21:58:07 | FromDiscord | <Elegantbeef> Yes |
21:58:14 | FromDiscord | <Elegantbeef> Nim's move semantics copy when a move cannot be made |
21:58:35 | FromDiscord | <Elegantbeef> It's an intelligent and also annoying thing |
21:58:48 | FromDiscord | <Phil> (edit) "anymore until you" => "anymore.↵You shall have to" |
21:59:36 | FromDiscord | <Elegantbeef> The annoying part is you cannot disable it per scope presently |
21:59:36 | FromDiscord | <Elegantbeef> You can emit hints or make it an error globally but not locally |
21:59:36 | FromDiscord | <Phil> I guess it allows you to have things be simple 90% of the time and the remaining 10% are a bit harder because of it |
22:00:27 | FromDiscord | <Elegantbeef> Imo there should be a mechanism to disable implicit copies |
22:00:40 | FromDiscord | <Elegantbeef> You can also explicitly move if you want |
22:02:01 | FromDiscord | <Phil> Would that do what I'm describing? Make the code above explode as desired? |
22:02:10 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:05:40 | FromDiscord | <Elegantbeef> Yea there should be a `{.forceSink.}:` or similar that does not allow usage after moving |
22:07:38 | FromDiscord | <Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3NIz |
22:07:48 | FromDiscord | <Tetralux> (edit) "https://play.nim-lang.org/#ix=3NIz" => "https://play.nim-lang.org/#ix=3NIA" |
22:08:02 | FromDiscord | <Tetralux> (edit) "https://play.nim-lang.org/#ix=3NIA" => "https://play.nim-lang.org/#ix=3NIB" |
22:08:06 | FromDiscord | <Phil> In reply to @Elegantbeef "Yea there should be": Ohhhh a pragma. I was experimenting forever with `move` and whether that would have ot be called in the proc body, or the proc signature or whatever |
22:08:23 | FromDiscord | <Phil> Likely not called forceSink since that doesn't compile on the playground, but I'll look for a pragma |
22:08:41 | FromDiscord | <Phil> Example: https://play.nim-lang.org/#ix=3NIC |
22:10:46 | FromDiscord | <Phil> There's nodestroy, there's nosink, but no forceSink.↵It describes that you can make the `=copy` hook error out, which is useful sorta, but that's not the issue I'm trying to solve, hmmm |
22:11:12 | FromDiscord | <Elegantbeef> There isnt a way yet |
22:11:24 | FromDiscord | <Elegantbeef> you can do `iSinkKSth(move t)` |
22:12:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3NIE |
22:12:16 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3NIF |
22:12:28 | FromDiscord | <Elegantbeef> Nah tetralux there is a way to error copy |
22:13:14 | FromDiscord | <Tetralux> Hmm. |
22:13:17 | FromDiscord | <Phil> Waaaaait a sec, when you move the memory it leaves behind a "default" string (aka just "") ? huh |
22:13:32 | FromDiscord | <Elegantbeef> Yes it 0's the moved data |
22:13:42 | FromDiscord | <Elegantbeef> Matrix bridge slow so i look crazy |
22:14:18 | FromDiscord | <Phil> Hmmmmmm |
22:15:02 | FromDiscord | <Elegantbeef> What you could do iso is make a template that calls a procedure which forces a `move` |
22:15:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NIG |
22:15:39 | FromDiscord | <kevin> In reply to @kevin "Got a question about": Figured out that it fails to load the DLL if the Nim DLL is compiled with `--threads:on` |
22:15:53 | FromDiscord | <kevin> booo |
22:16:02 | FromDiscord | <Phil> In reply to @Elegantbeef "What you could do": OHHHH and then the templates could be public, while the procs are private! |
22:16:18 | FromDiscord | <Phil> No wait, the procs also need to be public so that the template can compile |
22:16:27 | FromDiscord | <ElegantBeef> No they dont |
22:16:38 | FromDiscord | <ElegantBeef> templates hold onto symbols |
22:16:40 | FromDiscord | <Phil> It's enough if they're in the template's context? |
22:16:42 | FromDiscord | <Phil> Nice! |
22:18:06 | FromDiscord | <Phil> I already have a "proc calls inner proc" setup where public `borrowConnection()` calls private `borrowConnection(POOL)` so that I can hide the global POOL variable, this fits perfectly into that, I just swap the outer `proc borrowConnection()` into a `template borrowConnection()` |
22:20:34 | * | neceve quit (Ping timeout: 256 seconds) |
22:20:37 | * | jjido joined #nim |
22:25:11 | * | jjido quit (Client Quit) |
22:29:37 | * | noeontheend joined #nim |
22:37:57 | * | noeontheend quit (Ping timeout: 240 seconds) |
22:45:13 | FromDiscord | <tandy> any big brained async users around? |
22:46:21 | FromDiscord | <Elegantbeef> Uh oh you fell for the "Is anyone around that does X" instead of just asking the issue |
22:46:26 | FromDiscord | <Elegantbeef> 0/10 tandy reporting to you satan |
22:46:43 | FromDiscord | <tandy> smh |
22:47:27 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3NIN |
22:47:37 | FromDiscord | <tandy> i can't understand why this doesnt work |
22:48:03 | FromDiscord | <tandy> sent a code paste, see https://paste.rs/OBX |
22:48:24 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3NIP |
22:49:07 | FromDiscord | <Elegantbeef> Shouldnt that be `waitFor` since it's inside the main loop? |
22:49:38 | FromDiscord | <tandy> hmm ok that works |
22:50:14 | FromDiscord | <tandy> but I don't get how to program around not having `waitFor` in js |
22:50:39 | * | jjido joined #nim |
22:52:30 | FromDiscord | <noow> is there a super simple way to create a string out of an array of bytes of known length but no zero terminator? |
22:54:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NIU |
22:54:14 | FromDiscord | <noow> thank you |
22:54:22 | FromDiscord | <Elegantbeef> Or is it just `newString(arr.len)` |
22:54:24 | FromDiscord | <Elegantbeef> I always forget |
22:55:13 | FromDiscord | <Elegantbeef> Alternatively you can just iterate over the collection and assign the values |
22:55:24 | FromDiscord | <noow> I prefer copyMem |
22:58:52 | FromDiscord | <noow> sent a code paste, see https://play.nim-lang.org/#ix=3NIV |
23:09:49 | * | jmdaemon joined #nim |
23:18:01 | PMunch | Ugh, I have to go to bed. Ten points to whoever manages to make the prettiest looking documentation template with pico.css by the time I get back :P |
23:18:59 | PMunch | I'm basically writing documentation for a project I'm working on, mostly guides with code samples, but it needs like a sidebar menu and somewhere to put my Nim-generated documentation. |
23:19:14 | PMunch | Bonus points for using few extra CSS rules |
23:19:20 | PMunch | Good night |
23:19:21 | * | PMunch quit (Quit: leaving) |
23:19:52 | FromDiscord | <Elegantbeef> Cmon why not nimibook? |
23:21:19 | * | jmdaemon quit (Ping timeout: 268 seconds) |
23:24:15 | FromDiscord | <pmunch> Seems complicated.. But I guess it does fit what I need to do |
23:31:14 | FromDiscord | <mratsim> In reply to @Elegantbeef "Yea there should be": isn't there a warning? maybe we can turn it into an error |
23:32:57 | FromDiscord | <Elegantbeef> I go into why it doesnt work inside that RFC |
23:33:13 | FromDiscord | <Elegantbeef> destructors do not respect pragma scope so you cannot turn it into an error locally |
23:34:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ihA |
23:34:50 | FromDiscord | <Elegantbeef> That does not work as one expects |
23:35:24 | FromDiscord | <Elegantbeef> The hint is toggled off in the first pass and then destructors dont re-enable the hint/error |
23:35:59 | FromDiscord | <Elegantbeef> Araq says it's the push/pop but even with explicit pragma's it doesnt owrk |
23:39:40 | FromDiscord | <evoalg> In reply to @Elegantbeef "0/10 tandy reporting to": You're calling tandy satan and you're reporting to them now? |
23:40:13 | FromDiscord | <Elegantbeef> No i'm calling myself dumb and incapable of writing words in order i intend them to be |
23:40:35 | FromDiscord | <Elegantbeef> God dammit i've broke my git instance again |
23:41:13 | FromDiscord | <evoalg> tandy, I'm also reporting to you, satan |
23:41:20 | FromDiscord | <tandy> fair |
23:41:26 | FromDiscord | <tandy> async programming is devilish |
23:41:47 | FromDiscord | <evoalg> tandy did you see the new chapter in the book re async? |
23:41:57 | FromDiscord | <tandy> yes |
23:42:06 | FromDiscord | <tandy> useful |
23:42:21 | FromDiscord | <evoalg> http://ssalewski.de/nimprogramming.html#_code_execution_with_asyncawait ... ok |
23:42:29 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/936405837444939836/image.png |
23:42:30 | FromDiscord | <Elegantbeef> Cursed git |
23:43:40 | FromDiscord | <tandy> ok this is based i just read it properly↵(@evoalg) |
23:43:55 | FromDiscord | <tandy> this just means i need to finish this PR |
23:43:58 | FromDiscord | <tandy> https://github.com/juancarlospaco/nodejs/pull/4 |
23:44:07 | FromDiscord | <tandy> so i never have to touch async again |
23:44:26 | FromDiscord | <tandy> because js will have a proper ish httpclient |
23:44:51 | * | jmdaemon joined #nim |
23:45:32 | FromDiscord | <evoalg> I haven't read it, and I've never tried async |
23:45:34 | * | rlp10 quit (Ping timeout: 256 seconds) |
23:46:54 | FromDiscord | <tandy> the main reason im forced to use async is because im working with js backend and the api bindings im writing only support jsfetch which is async |
23:47:04 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
23:47:13 | FromDiscord | <tandy> so with this i can refactor the bindings and use sync xmlhttprequest \>\:) |
23:50:37 | FromDiscord | <evoalg> In reply to @arkanoid "I picked nim to": which language will you try next? |
23:51:13 | * | Lord_Nightmare joined #nim |
23:53:07 | * | rlp10 joined #nim |
23:58:33 | FromDiscord | <Elegantbeef> Arkanoid i'd happily take a look at your code to see if it can be broken up nicely |
23:59:55 | FromDiscord | <Elegantbeef> Nim does support recursive imports if you declare them properly |