00:00:05 | * | Hideki_ joined #nim |
00:02:15 | FromGitter | <zacharycarter> thanks for the help! I'm going to try to go back to sleep now :) |
00:04:38 | * | Hideki_ quit (Ping timeout: 268 seconds) |
00:05:32 | * | matlock quit (Read error: Connection reset by peer) |
00:09:04 | * | exelotl quit (Ping timeout: 264 seconds) |
00:13:40 | FromDiscord | <Volund> so I only just learned about this language and am reading up on it. It's looking pretty spectacular so far. |
00:19:31 | * | doesntgolf joined #nim |
00:24:57 | * | matlock joined #nim |
00:27:33 | FromDiscord | <Rika> sets dont have augmented assignment? |
00:38:27 | * | mibr quit (Ping timeout: 240 seconds) |
00:57:47 | * | owl_000 joined #nim |
00:58:29 | owl_000 | how to `echo` type objects? do i need to make overloaded `$` for that type? |
01:09:24 | * | ng0_ joined #nim |
01:11:12 | * | ng0 quit (Ping timeout: 260 seconds) |
01:11:18 | FromDiscord | <demotomohiro> try `echo foo.repr` |
01:17:21 | FromDiscord | <Rika> is `"a string".items` supposed to not work? how do i make a seq from strings? |
01:23:18 | shashlick | I just figured out the boehm crash on feud |
01:23:45 | shashlick | One line code change back in January! |
01:24:10 | shashlick | Unbelievable |
01:24:36 | FromDiscord | <demotomohiro> @Rika, Do you want to do `for i in "a string":echo i`? |
01:24:44 | shashlick | https://github.com/nim-lang/Nim/commit/06e3d3ab4dea4aa11a1728c849799ce6aeecb3a4 |
01:25:29 | * | endragor joined #nim |
01:27:17 | * | endragor_ joined #nim |
01:29:58 | FromDiscord | <Rika> @demotomohiro i want to group 2 chars together into a seq |
01:30:03 | FromDiscord | <Rika> w/o a for loop if possible |
01:30:41 | FromDiscord | <Rika> like "aabbcc" into @["aa", "bb", "cc"] |
01:30:42 | FromDiscord | <Rika> or so |
01:30:52 | * | endragor quit (Ping timeout: 245 seconds) |
01:36:47 | owl_000 | what happens when we add `[]` after a variable |
01:37:20 | shashlick | Dereference pointer |
01:39:41 | disruptek | shashlick: wow, what was the feud bug? |
01:40:55 | owl_000 | https://play.nim-lang.org/#ix=1X6R please look at the comments |
01:41:37 | disruptek | yes, it's a copy, owl_000. |
01:42:57 | disruptek | use `typeof` instead of `type`. also, the convention is to Uppercase your type names. |
01:44:13 | * | endragor joined #nim |
01:45:20 | owl_000 | thanks, but last two line type(x) is list, i do understand, but why type(y) is list:ObjectType, what does it mean |
01:45:26 | owl_000 | what is the difference |
01:46:33 | disruptek | list is a reference to an object; when you deref x with [] you return an object. hence the type() output. |
01:47:11 | * | endragor_ quit (Read error: Connection reset by peer) |
01:47:44 | disruptek | x and y are not the same type, in case that wasn't obvious. |
01:48:46 | owl_000 | oh, let me think for a moment. |
01:49:28 | disruptek | eg. you change ln15 to `let y: list = x[]` and you'll get a compile error. |
01:49:50 | shashlick | @disruptek - someone disabled interior pointer checking in boehm |
01:50:01 | shashlick | See the commit link I posted |
01:50:04 | disruptek | shashlick: yes, but did you have a pointer into a global? |
01:50:46 | shashlick | I need to go back and verify that |
01:50:59 | owl_000 | `let y = x[]` this line actually copied information of ref object and become object??, not a duplicate of x. |
01:51:05 | shashlick | But disabling that code fixed my crash |
01:51:13 | disruptek | ah. see, i'm wondering if there's actually a bug that you provoked that isn't in your code. |
01:51:24 | disruptek | owl_000: correct. |
01:51:54 | owl_000 | thanks a lot disruptek :) |
01:52:11 | disruptek | you created a y which has a different type; you stripped the "ref" from the list type you defined. |
01:52:42 | disruptek | because it wasn't a ref, the value was copied and not the reference. |
01:52:49 | * | endragor quit (Remote host closed the connection) |
01:53:07 | shashlick | Well I have tables all over the place and there must be pointers in the C generated |
01:53:32 | shashlick | I don't see how that change is a good idea |
01:53:38 | disruptek | but as we cannot control the impl, it seems to me that we cannot afford that patch by default. |
01:54:00 | disruptek | we can't be crashing just because you have a table on a global. |
01:54:19 | shashlick | "... or on the heap point to the interior of an object rather than the beginning." |
01:54:40 | disruptek | that could be anything, anywhere. |
01:54:49 | shashlick | It isn't just globals |
01:54:56 | disruptek | right. |
01:55:25 | shashlick | It crashes cause the data structure gets garbage collected and emptied out |
01:55:54 | disruptek | i guess you don't have a repro yet, but it shouldn't be hard to provoke it. |
01:56:19 | disruptek | what did you do, bisect? |
01:56:30 | shashlick | Well I built with and without it and could consistently crash or work |
01:57:30 | shashlick | I started with a bisect |
01:57:44 | shashlick | but it didn't work after a point since I ran into broken commits |
01:57:58 | shashlick | also i had to pull old code of every package |
01:58:01 | shashlick | too many commits |
01:58:03 | shashlick | 1000+ |
01:58:22 | shashlick | so then I started looking at the history of changes in the GC related to boehm |
01:58:30 | shashlick | there were only two real candidates |
01:58:58 | disruptek | that's the main reason i'm wanted for murder in ireland. damned broken commits in master. |
01:59:30 | disruptek | not that i'm guilty, of course. |
01:59:53 | shashlick | tell me about it |
01:59:55 | disruptek | i just, y'know, can't visit the emerald isle anymore. |
02:00:08 | disruptek | i can fly through shannon though, so it's fine. |
02:00:54 | shashlick | I've wasted literally 6 months fighting this issue - first i was stuck with 0.19.x and after that it was neverland |
02:00:58 | disruptek | does this mean you're back on the feud horse? |
02:01:29 | shashlick | i am but i don't know where to start cause its been months in the doldrums |
02:01:50 | shashlick | i'll have to clean up all the junk code i added trying to work around this nonsense |
02:02:10 | disruptek | start with something you can polish and use right away. something user-facing. that'll restore your motivation. 😉 |
02:02:11 | shashlick | and that whole shared seq and string project |
02:02:39 | disruptek | you're ripping that out? |
02:02:43 | shashlick | i need to finish nimterop and nimarchive first, very easy to get distracted |
02:02:51 | shashlick | no point keeping it in right |
02:03:24 | disruptek | well, it could be useful. is it in its own lib? |
02:03:57 | shashlick | yes it is |
02:04:08 | shashlick | https://github.com/genotrance/shared |
02:04:15 | disruptek | out it goes! |
02:04:31 | shashlick | was great experience working on it tho |
02:04:47 | shashlick | with boehm and newruntime, it doesn't have a long life |
02:05:32 | shashlick | anyway, need to see what Araq thinks about removing that commit |
02:06:02 | disruptek | did you test that the env var works to disable the poor behavior? |
02:06:29 | shashlick | i was on an airplane so didn't have the env var name to test |
02:06:34 | shashlick | i'll try it later |
02:06:43 | shashlick | but i'm wondering whether it is during compile time or runtime |
02:06:47 | shashlick | if it is runtime, it's useless |
02:07:11 | shashlick | unless i can set it in the exe on startup |
02:07:32 | shashlick | regardless, this doesn't seem like something that makes sense for most users |
02:08:15 | disruptek | seems to be compile-time. |
02:08:42 | shashlick | how can you tell? |
02:09:12 | disruptek | nevermind, this doc says it's runtime: |
02:09:16 | disruptek | https://github.com/ivmai/bdwgc/blob/3c571c7ad66a90e33e4701afe3dc4d2113c60adc/doc/README.environment |
02:11:34 | shashlick | https://wiki.freepascal.org/garbage_collection |
02:12:27 | disruptek | right, there's some confusing docs out there. |
02:12:42 | shashlick | ya i need to check if it will work if the exe sets the env on startup |
02:12:51 | disruptek | i am inclined to go with the boehmgc text though. |
02:13:01 | shashlick | regardless, it is torture for most users to figure this out on their own |
02:13:10 | disruptek | you could twiddle it in your code. |
02:13:26 | disruptek | i mean, you shouldn't have to resort to configuring the gc via the user's env. |
02:13:32 | disruptek | even inside your app. |
02:13:46 | shashlick | i agree, i think it should be turned on by default |
02:14:09 | disruptek | just too dangerous. |
02:14:21 | shashlick | anyway, felt awesome on figuring it out |
02:14:27 | shashlick | then disillusioned that i need to continue working on feud :) |
02:14:31 | disruptek | yeah, that's a huge win, man. congrats. |
02:14:56 | disruptek | i've watched you struggle with that thing on what feels like weekly basis. |
02:15:16 | shashlick | well, problem was that i sank so much time on it that i didn't do much else |
02:15:40 | disruptek | time to come up with some insane ideas on how to use mq in it. |
02:15:41 | shashlick | finally broke off and started working on getHeader else i'd still be frustrated |
02:16:23 | shashlick | heeh not anytime soon - near term goal is to split out the plugin system into a package so that anyone can use it |
02:16:46 | shashlick | of course, need to fix all the random bugs and start using feud fulltime |
02:17:23 | disruptek | yay dogfood |
02:17:46 | shashlick | i need to think more about the UX though, i'm not impressed with the workflow |
02:18:13 | shashlick | but i think an editor in Nim will be a good demo of the power |
02:18:26 | * | doesntgolf quit (Ping timeout: 240 seconds) |
02:19:19 | disruptek | could be amazing. 🤩 |
02:19:37 | shashlick | what OS do you use |
02:20:13 | disruptek | linux |
02:20:42 | shashlick | terminal or gui |
02:20:49 | disruptek | terminal. |
02:21:04 | disruptek | i just can't seem to be productive with a mouse. |
02:21:14 | shashlick | feud doesn't need a mouse |
02:21:29 | shashlick | everything is shortcuts and command-line like |
02:21:36 | shashlick | but it is GUI so that it can be fast |
02:22:21 | disruptek | everything is fast on my machine. i honestly don't know how anyone else gets anything done. |
02:22:36 | disruptek | i sit down at a windows machine and i immediately assume it's compromised. |
02:23:00 | shashlick | not much choice, windows is my daily driver |
02:23:28 | shashlick | i prefer linux any day |
02:24:03 | shashlick | but having to maintain cross-platform libs means i need to cover osx as well |
02:24:39 | disruptek | i have osx and windows on this box, but thinking about it, i really think windows might be contaminated. it would be a first for me. |
02:24:48 | disruptek | i haven't booted osx in almost a year. |
02:25:21 | disruptek | though it used to be my dev env. |
02:25:31 | shashlick | presume you have a browser and stuff tho |
02:25:39 | shashlick | not 100% terminal |
02:25:49 | disruptek | i left linux for osx because i felt like i spent most of my time tweaking it. when i came back, i was sorry i left. |
02:27:26 | disruptek | yeah, i mean, i'm not a luddite. but i almost never have any wayland clients that aren't chromium or kitty. |
02:28:04 | FromDiscord | <SrMordred> question about language design choices: why "for x in array.mitems" instead of something like "for var x in array" ? |
02:28:26 | disruptek | you can `for x in array` but i wouldn't recommend it, stylistically. |
02:29:14 | disruptek | there's no var/let modifier simply because that's not where the mutability stems from and it's gratuitous to have it as return type isn't a source of dispatch. |
02:30:05 | disruptek | does that make sense? return type isn't a mechanism for method dispatch... |
02:31:29 | disruptek | btw, if you're annoyed that you can't typecheck your loop variables, you can use this: https://github.com/disruptek/foreach |
02:31:46 | FromDiscord | <SrMordred> @disruptek i´m coming from D where u have "foreach(ref x ; array )" when u want to modify values on the loop. so i'm looking for equivalents 😛 |
02:32:37 | disruptek | i'd guess the equivalent is `for x in arr.mitems:` ... |
02:33:16 | disruptek | i dunno why they chose an `m` prefix beyond the obvious. |
02:33:45 | FromDiscord | <SrMordred> @disruptek yes, but thats my point wouldnt be interesting to have a syntatic sugar to lower code to that with "for var x in arr" for ex? |
02:34:10 | disruptek | yes, i'd rather it worked that way because it'd be more explicit. |
02:35:00 | FromDiscord | <DeltaPHC> Or `for x in var arr` |
02:35:13 | shashlick | @disruptek - well I'm off for now, thanks for celebrating |
02:35:21 | disruptek | shashlick: have a good one. |
02:38:09 | FromDiscord | <SrMordred> @DeltaPHC yes, but its odd for me. i see var as a new variable that´s mutable. so var array didnt make sense for me. |
02:38:43 | * | rayman22201 quit (Quit: Connection closed for inactivity) |
02:38:45 | disruptek | but you need to be thinking that the target isn't the array per se, it's a special iterator instantiated for the loop. |
02:39:28 | disruptek | that's part of why i now use `.items` or `.pairs` explicitly; it helps convey the behavior. |
02:39:51 | FromDiscord | <DeltaPHC> The meaning of `var` is slightly oveloaded anywho. Like in a proc argument: `proc foo(a: var MyObject) = ...` |
02:40:01 | disruptek | point being, it could be a "mutable iterator", in which case the "var" symbolizes that pretty well. |
02:40:32 | disruptek | either one works. i'm not sure which could be easier to implement, but probably DeltaPHC's version. |
02:41:18 | disruptek | maybe i can even add that to `foreach`. |
02:43:03 | FromDiscord | <SrMordred> yes, thinking as iterators this make sense. |
02:43:03 | FromDiscord | <SrMordred> i´m used to think on mutability of the variable side. (as D, C++ etc) |
02:43:25 | disruptek | right. |
02:43:51 | disruptek | i think this would be a for loop macro and it'd be DeltaPHC's syntax. |
02:43:52 | FromDiscord | <SrMordred> that´s something that i´m liking in nim: |
02:43:52 | FromDiscord | <SrMordred> looked at your code and realized that i can emulate this with macros 🙂 |
02:44:11 | FromDiscord | <DeltaPHC> You can do a heckuva lot with macros |
02:44:25 | disruptek | yeah, that silly thing came out of this same sorta shit-shooting because i was whining about it. |
02:44:39 | disruptek | finally realized i could just do it myself and 20mins later, it was done. |
02:45:29 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
02:45:38 | FromDiscord | <SrMordred> i frying my head today learning about macros. never worked with ast manipulation before |
02:45:41 | FromDiscord | <SrMordred> im |
02:45:44 | FromDiscord | <DeltaPHC> Bit of a tangent, but macros and templates are kind of a double-edged sword to me. Very powerful, and allows you express some very readable, concise syntax. But on the other hand, use it a *lot* and doesn't really resemble Nim anymore, lol |
02:46:17 | disruptek | right, that's the risk. you want people to be able to understand what's happening if they have to read the code. |
02:46:34 | * | laaron joined #nim |
02:46:58 | disruptek | here's 1.2MM loc all generated by macros: https://github.com/disruptek/atoz |
02:47:50 | FromDiscord | <SrMordred> @DeltaPHC yes, i can understand this. too much power 😛 |
02:47:50 | FromDiscord | <SrMordred> the first thing that i did with nim when saw templates was making`+` do minus internally. just to see if was possible xD |
02:48:16 | FromDiscord | <DeltaPHC> That sounds evil. I like it |
02:48:47 | disruptek | nim is the kinda language that would let you shoot yourself in the foot and even load the gun. |
02:48:51 | disruptek | i love that about it. |
02:49:55 | FromDiscord | <SrMordred> @disruptek yes, loving it because of this too. i really loved D because of its meta-capabilities and nim is way "worst" 😛 |
02:51:01 | disruptek | you should do the `var` as a for loop macro. maybe call it `mutable`. it'll just help document/check the iteration, maybe? i don't think you'd want to create mutable vars from immutable inputs. |
02:51:29 | disruptek | hah, nim is way worse! that's great. 😁 |
02:52:14 | disruptek | technically, you could automatically invoke `mitems` or `mpairs` if you wanted to be clever. |
02:53:01 | FromDiscord | <SrMordred> @disruptek that´s a nice first macro 'project', ill give it a try |
02:53:22 | disruptek | you'll be surprised how easy it is. |
02:54:24 | FromDiscord | <DeltaPHC> Most of the learning is just figuring how Nim code translates to AST types. Beyond that, it's just normal Nim code |
02:57:42 | * | theelous3_ joined #nim |
02:58:46 | * | theelous3 quit (Remote host closed the connection) |
02:59:10 | * | theelous3 joined #nim |
02:59:47 | * | theelous3 quit (Read error: Connection reset by peer) |
03:02:32 | * | theelous3_ quit (Ping timeout: 245 seconds) |
03:09:01 | * | endragor joined #nim |
03:16:51 | FromDiscord | <SrMordred> oh, i just discovered dumpAstGen. now things got easier |
03:24:11 | * | matlock quit (Read error: Connection reset by peer) |
03:50:44 | * | rockcavera quit (Remote host closed the connection) |
03:51:48 | FromDiscord | <SrMordred> now that i get it, is indeed easy |
03:57:21 | * | chemist69 quit (Ping timeout: 246 seconds) |
03:59:28 | * | chemist69 joined #nim |
04:07:12 | FromDiscord | <Shield> is there a library to translate AST back to normal nim code? |
04:13:26 | leorize | echo it |
04:13:38 | leorize | use `repr` actually |
04:14:53 | FromDiscord | <treeform> disruptek, do you have a similar thing for google APIs? |
04:15:00 | FromDiscord | <treeform> as you do for aws? |
04:15:45 | FromDiscord | <treeform> I started manually doing that for GCP and its not pretty... https://github.com/treeform/googleapi |
04:16:46 | * | theelous3_ joined #nim |
04:18:10 | FromDiscord | <Shield> @leorize can I get a small example? |
04:19:45 | leorize | `echo repr NimNode` |
04:20:55 | leorize | if you need more context then: https://play.nim-lang.org/#ix=1X7t |
04:21:07 | leorize | switch to debug view or else you won't see anything |
04:21:37 | leorize | Zevv, disruptek: so.. I've added a shiny new "find project file" feature |
04:21:42 | leorize | anyone wanna try? |
04:21:58 | leorize | you can now open any file in your project and nim.nvim will find the correct project file |
04:24:50 | * | navinmistry joined #nim |
04:27:27 | * | navinmistry quit (Remote host closed the connection) |
04:30:02 | * | theelous3_ quit (Ping timeout: 245 seconds) |
04:37:56 | * | laaron quit (Remote host closed the connection) |
04:40:57 | FromDiscord | <Shield> leorize: thanks! |
04:54:51 | * | mpcjanssen quit (Ping timeout: 240 seconds) |
04:55:21 | * | laaron joined #nim |
04:56:27 | * | nsf joined #nim |
04:56:53 | * | pbb quit (Ping timeout: 276 seconds) |
04:57:46 | * | pbb joined #nim |
04:59:06 | * | laaron quit (Client Quit) |
05:00:02 | * | laaron joined #nim |
05:02:03 | * | pbb_ joined #nim |
05:02:39 | * | owl_000 quit (Ping timeout: 265 seconds) |
05:04:41 | * | pbb quit (Ping timeout: 276 seconds) |
05:14:10 | Zevv | leorize: do you even sleep? |
05:16:44 | * | pbb_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:17:15 | * | pbb joined #nim |
05:22:25 | * | navinmistry joined #nim |
05:23:20 | * | NimBot joined #nim |
05:35:51 | * | narimiran joined #nim |
05:45:30 | FromDiscord | <Shield> https://forum.nim-lang.org/t/5232 |
05:45:45 | FromDiscord | <Shield> i think this post require a more correct answer |
05:46:09 | * | navinmistry quit (Remote host closed the connection) |
05:46:13 | FromDiscord | <Shield> especially about 'not' needing the shared libraries for boehm and go |
05:53:10 | leorize | Zevv: maybe :) |
05:53:41 | leorize | jokes aside I just implement this based on Araq's project finding logic in the compiler |
05:53:57 | leorize | with a few tweaks so that it works better |
05:54:14 | * | skoude joined #nim |
05:54:19 | leorize | if everything goes well I'll adjust the one in the compiler |
05:55:38 | * | teimosso joined #nim |
05:57:01 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
05:58:04 | * | laaron joined #nim |
06:00:29 | * | laaron quit (Client Quit) |
06:03:15 | * | laaron joined #nim |
06:04:20 | Araq | leorize, can you backport these tweaks to the compiler please? |
06:05:32 | leorize | I'll give them a test drive in nim.nvim |
06:05:46 | Araq | nice, thanks |
06:06:35 | * | laaron quit (Client Quit) |
06:07:19 | leorize | disruptek, narimiran, Zevv: please pull from 'find-project' branch if you're interested in testing the "automated project file finder" :) |
06:07:36 | * | skoude quit (Ping timeout: 240 seconds) |
06:08:14 | * | solitudesf joined #nim |
06:08:55 | leorize | so far it worked well for the compiler and some nimble packages, but please let me know if it targets the wrong file :) |
06:20:09 | * | laaron joined #nim |
06:22:51 | * | laaron quit (Client Quit) |
06:29:43 | * | skoude joined #nim |
06:33:45 | * | dddddd quit (Ping timeout: 268 seconds) |
06:34:40 | * | dddddd joined #nim |
06:36:48 | * | teimosso quit (Quit: teimosso) |
06:37:22 | Yardanico | Yay, Patreon is available for Nim now. How much % Patreon gives the authors? |
06:44:46 | Araq | I don't know :-) |
06:46:50 | * | dddddd quit (Remote host closed the connection) |
06:53:09 | FromDiscord | <Kiloneie> 9% for existing and 12% for new users patreon takes |
06:53:34 | FromDiscord | <Kiloneie> not THAT much but... why the fucking difference for new and old users... |
06:54:35 | FromDiscord | <Kiloneie> about that, it says based on high earnings it changes bla bla.. |
06:54:46 | leorize[m] | guess the 9% was a guarantee to people signed up back then |
06:55:19 | FromDiscord | <Kiloneie> i had that mail sitting in my inbox for a month, then i didn't make one... |
06:55:24 | FromDiscord | <Kiloneie> -.-.... |
06:55:51 | FromDiscord | <Kiloneie> Also yay my #1 beat my most viewed video of all times |
06:57:07 | Yardanico | @Kiloneie how old should my account be? I just found out my Patreon account was registered in Jan 2016 |
06:57:25 | FromDiscord | <Kiloneie> it was like 6 months ago, so you get the low fee |
06:57:29 | Yardanico | Or you mean it depends on author's time since registration? |
06:57:41 | FromDiscord | <Kiloneie> pretty sure it said on registration date |
06:57:56 | FromDiscord | <Kiloneie> but really, it doesn't matter |
06:58:20 | FromGitter | <zacharycarter> If anyone knows of any game dev / Nim related jobs - please let me know as I'm looking again |
06:58:22 | FromDiscord | <Kiloneie> 9-12% cut is negligable, and it depends on your monthly income on patreon.... something |
06:58:28 | * | Vladar joined #nim |
06:59:34 | FromDiscord | <Kiloneie> Imma probably setup my patreon in like a good week, then pray to the sun i will get some love D: |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:08 | * | laaron joined #nim |
07:04:42 | * | gmpreussner joined #nim |
07:05:53 | FromDiscord | <Kiloneie> why does google say different information on ads monetization on classic and studio beta... classic says you need 10K subs and or 5000 watched hours, whilst the studio beta says just be 18... oO weird stuff |
07:08:29 | FromDiscord | <Kiloneie> no wait, they changed it a bit, 4000 hours, 1000 subs... okay that is far more feasible, but 4000 watch hours uff... im at like 1% D: |
07:09:26 | Yardanico | why would you want monetization so early? |
07:09:35 | Yardanico | I think you wouldn't earn anything real until you get like 10k subs |
07:09:51 | FromDiscord | <Kiloneie> i don't know how much i would actually get... |
07:10:20 | FromDiscord | <Kiloneie> well patreon first anyways, pretty sure that would be more than ads |
07:10:34 | * | ng0_ is now known as ng0 |
07:12:09 | * | krux02 joined #nim |
07:15:45 | Zevv | zacharycarter: oh sorry to hear that, how long were you here? A year and a bit? |
07:16:20 | FromGitter | <zacharycarter> not even - 5 months |
07:16:23 | FromGitter | <zacharycarter> studio got shut down |
07:16:30 | * | mibr joined #nim |
07:17:00 | FromGitter | <zacharycarter> it's all good though - I get severance and there are a lot of opportunities here and elsewhere I'm having luck with |
07:17:05 | Araq | wait what? they hired you and then went out of business 5 months later? |
07:17:09 | FromGitter | <zacharycarter> but just in case anyone has an in or knows of a sweet job coding in Nim |
07:17:25 | FromGitter | <zacharycarter> well Wargaming isn't going out of business, but they decided to shutdown our studio yeah |
07:17:26 | FromDiscord | <Kiloneie> Where do you live ? |
07:17:35 | FromGitter | <zacharycarter> I'm currently in Helsinki, Finland |
07:18:02 | FromDiscord | <Kiloneie> if you found a Nim job there, wau, pretty sure in my country that will be in like 20 years |
07:18:19 | FromGitter | <zacharycarter> well - I'm not really tied to any location, I'm originally from the states |
07:18:28 | Yardanico | @Kiloneie what country are you in if that's not a secret? |
07:18:32 | FromGitter | <zacharycarter> as long as I can bring my dog with me, I'm willing to work pretty much anywhere |
07:18:41 | FromDiscord | <Kiloneie> oh yeez, did you just fly an ocean for a job D: ? |
07:18:49 | FromDiscord | <Kiloneie> im from Slovenia, not much going on here |
07:19:20 | FromGitter | <zacharycarter> I did indeed |
07:19:32 | FromDiscord | <Kiloneie> you can drive from the furthest part of slovenia to the other in like 3 hours smthing |
07:19:39 | Yardanico | that's very good |
07:19:50 | FromGitter | <zacharycarter> I don't regret it though, getting to live in a new country half way across the world is a neat experience many don't get |
07:20:13 | FromGitter | <zacharycarter> and Finland / Helsinki are cool - I don't think I'd want to retire here but you never know :) |
07:20:21 | FromDiscord | <Kiloneie> not my cup of tea, i don't like new situations xD |
07:22:37 | FromGitter | <zacharycarter> I could always transfer to another wargaming studio - but I don't know |
07:22:48 | FromGitter | <zacharycarter> the project they're working on is ambitious to say the least |
07:36:21 | * | skoude quit (Ping timeout: 265 seconds) |
07:36:48 | * | skoude joined #nim |
07:37:36 | * | asymptotically joined #nim |
07:41:34 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
07:42:17 | * | laaron joined #nim |
07:47:55 | Zevv | Ony of my customers is always looking for engineers; video/streaming/android(system level)/OpenGL. |
07:48:06 | Zevv | Based in the middle of NL, but no dogs in the office (I asked) |
07:48:43 | FromGitter | <zacharycarter> I'm okay with no dogs in the office |
07:48:54 | FromGitter | <zacharycarter> although I did have cooper in the office yesterday haha |
07:49:01 | FromGitter | <zacharycarter> it was his first and last time there though |
07:49:17 | FromGitter | <zacharycarter> I brought him in kind of as a joke to offer "emotional support" |
07:53:14 | * | laaron quit (Remote host closed the connection) |
07:57:14 | * | sealmove quit (Quit: WeeChat 2.6) |
07:57:31 | Araq | wow this is a great read: https://code.kx.com/q4m3/0_Overview/#00-the-evolution-of-q |
07:58:28 | Zevv | zacharycarter: how is your OpenGL? |
07:59:32 | FromGitter | <zacharycarter> good |
07:59:52 | FromGitter | <zacharycarter> I've done quite a bit with OpenGL - https://github.com/zacharycarter/zengine |
08:01:34 | FromGitter | <zacharycarter> so with `strformat` is it possible to do &"{obj.prop}" |
08:02:07 | Zevv | Ah that was you :) We have a project where we're mass virtualizing Android and remoting the GL stream to thin clients. There's $magic involved in optimizing the GL, it's not a simple serialization because we want to avoid round trips. Stuff is working at the POC level, but the original GL guy wants to step out and noone (Except me a bit) knows anything about GL. So if you're interested to move to .nl, I can |
08:02:13 | Zevv | introduce you. Very international team, all over europe |
08:02:26 | Yardanico | how can I pass a top-level proc as a closure? |
08:02:43 | FromGitter | <zacharycarter> Zevv: that sounds very neat - yeah I'd definitely be interested in an introduction :) |
08:03:09 | Yardanico | even when I define it it like `obj.field = proc ...` it says "asyncstreams.nim(226, 73) Error: type mismatch: got <proc (s: AsyncStream, size: int): Future[system.string]{.gcsafe, locks: <unknown>.}> but expected 'proc (s: AsyncStream, size: int): Future[system.string]{.closure, gcsafe.}'" |
08:03:19 | Yardanico | (trying to fix vegansk's AsyncStreams module for latest nim) |
08:03:21 | leorize[m] | Yardanico: you can't if it doesn't capture anything |
08:03:42 | Zevv | zacharycarter. Can you drop your resume at [email protected]? |
08:03:50 | FromGitter | <zacharycarter> doing so now |
08:03:57 | Yardanico | he used cast[type(res.readDataImpl)](sockReadData) to do that but it's not possible anymore |
08:04:15 | leorize[m] | isn't there asyncstream in the stdlib? |
08:04:34 | FromGitter | <zacharycarter> Zevv: sent |
08:05:12 | Yardanico | leorize[m]: vegansk's AsyncStream contains implementation for async socket , async string and async file |
08:05:44 | Zevv | zacharycarter: Thanks. I'll put it in the normal recruiting pool and give a little personal introduction with it. |
08:05:50 | Yardanico | well maybe I'll implement my own async socket stream based on asyncstreams stdlib module |
08:06:32 | FromGitter | <zacharycarter> much appreciated! |
08:06:41 | leorize[m] | that module got the unstable tag though |
08:07:15 | Yardanico | leorize[m]: well it's okay :) |
08:07:47 | FromGitter | <zacharycarter> okay weird |
08:08:15 | FromGitter | <zacharycarter> `echo &"{i} : {prop.name} : {prop.description}"` results in : `template/generic instantiation of `&` from here` |
08:08:37 | FromGitter | <zacharycarter> but `echo &"{i} : {{prop.name}} : {{prop.description}}"` compiles |
08:08:51 | FromGitter | <zacharycarter> however I have a feeling it's not correct |
08:09:07 | leorize[m] | well, what's the error? |
08:09:57 | leorize[m] | that message is just a note |
08:09:58 | FromGitter | <zacharycarter> `undeclared field: 'name' for type vulkan.VkLayerProperties [declared in C:\Users\carte\projects\fore\vulkanim\vulkan.nim(833, 3)]` |
08:10:06 | FromGitter | <zacharycarter> oh |
08:10:10 | FromGitter | <zacharycarter> yeah I guess I should have tried compiling |
08:10:17 | FromGitter | <zacharycarter> :P |
08:10:20 | FromGitter | <zacharycarter> sorry for being dumb |
08:10:26 | leorize[m] | well you should still open a bug though |
08:10:38 | leorize[m] | i don't think that message should be there unless there are errors |
08:10:48 | FromGitter | <zacharycarter> okay I will |
08:10:58 | FromGitter | <zacharycarter> yeah - it's slightly confusing |
08:12:24 | leorize[m] | lol |
08:13:05 | * | skoude quit (Ping timeout: 265 seconds) |
08:14:36 | FromGitter | <zacharycarter> I will say - not having to go into work but still getting paid is nice |
08:23:24 | * | skoude joined #nim |
08:23:47 | * | floppydh joined #nim |
08:27:48 | * | skoude quit (Ping timeout: 245 seconds) |
08:29:27 | Zevv | zacharycarter: how long will that last? |
08:30:55 | * | navinmistry joined #nim |
08:34:27 | * | asymptotically quit (Remote host closed the connection) |
08:34:47 | * | asymptotically joined #nim |
08:37:38 | FromDiscord | <mratsim> @ Shield > is there a library to translate AST back to normal nim code? |
08:37:38 | FromDiscord | <mratsim> I use toStrLit |
08:37:49 | FromDiscord | <mratsim> @Shield ^ |
08:37:56 | Zevv | repr |
08:40:04 | FromGitter | <zacharycarter> Zevv: well - I probably won't have a job anymore sometime next week |
08:40:07 | FromGitter | <zacharycarter> so only a few more days :P |
08:40:14 | FromGitter | <zacharycarter> but until then I'm going to enjoy / make the most of it! |
08:40:27 | Zevv | Well, I'll tell HR you're available next week then :) |
08:41:23 | FromGitter | <alehander42> Schield : or renderer.nim |
08:41:31 | FromGitter | <alehander42> if you need it on runtime |
08:42:30 | * | laaron joined #nim |
08:42:44 | FromGitter | <zacharycarter> Zevv :D cool - I probably am going to go back to the states for a few weeks to visit with the family but I'm pretty flexible in terms of timing |
08:43:33 | * | laaron quit (Client Quit) |
08:46:59 | * | owl_000 joined #nim |
08:59:35 | * | skoude joined #nim |
09:05:33 | FromDiscord | <Kiloneie> how much does the flight cost you ? |
09:07:10 | FromGitter | <zacharycarter> it was about $900 USD to get over here |
09:08:11 | FromDiscord | <Kiloneie> Uff, that's almost 3 months of living for me here |
09:08:13 | FromGitter | <zacharycarter> it's about $1500 round trip to go back to the states and back to Helsinki |
09:08:32 | FromDiscord | <Kiloneie> well you probably earned a lot more than i did with my last job xD |
09:08:39 | FromGitter | <zacharycarter> oh wait that's wrong |
09:08:45 | FromDiscord | <Kiloneie> bloody physical labor, pays dirt |
09:08:58 | FromGitter | <zacharycarter> I'm seeing round trip fares in Mid october for < $700 USD |
09:09:10 | FromGitter | <zacharycarter> well - I took a big pay cut to come over here |
09:09:18 | FromDiscord | <Kiloneie> yeah it depends on the time |
09:09:20 | FromGitter | <zacharycarter> but that's the games industry for you, you get paid shit and treated like shit |
09:09:22 | FromGitter | <zacharycarter> but you get to work on games |
09:09:38 | FromDiscord | <Kiloneie> pretty sure you got payed over 2x of me still 😛 |
09:09:49 | FromGitter | <zacharycarter> everything is relative :) |
09:09:56 | FromDiscord | <Kiloneie> i know games industry is the worst in the programming world |
09:10:17 | FromDiscord | <Kiloneie> well i got like 20-25% more than minimum wage |
09:10:41 | FromGitter | <zacharycarter> I wouldn't say the games industry is the worst - I think it largely depends on what's important to the individual |
09:10:54 | FromGitter | <zacharycarter> if you want to make the highest salary then yes, you'd be better off looking elsewhere |
09:11:13 | FromGitter | <zacharycarter> but IMO money isn't the most important thing |
09:11:25 | FromGitter | <zacharycarter> enjoying what you do is |
09:11:30 | FromDiscord | <Kiloneie> i know, that's why i quit my job xD |
09:11:41 | FromDiscord | <Kiloneie> i like making videos like 1000x times more than that crap |
09:11:45 | FromGitter | <zacharycarter> :) |
09:11:54 | FromDiscord | <Kiloneie> it was supposed to be 2-3 months, then well big badluck |
09:12:02 | FromGitter | <zacharycarter> well - if you want to make money programming, you might want to pick a more popular language |
09:12:08 | FromGitter | <zacharycarter> hard to get hired as a Nim developer |
09:12:24 | FromDiscord | <Kiloneie> i just need 350$ a month making videos that's all |
09:12:32 | FromDiscord | <Kiloneie> and im all good |
09:12:39 | FromGitter | <zacharycarter> but if you want to make videos, Nim is probably a good candidate for that as it's only going to grow in popularity after hitting 1.0 |
09:12:47 | FromDiscord | <Kiloneie> that was the plan |
09:12:53 | FromDiscord | <Kiloneie> and im the first making these |
09:13:04 | FromDiscord | <Kiloneie> so one day it should pay off |
09:13:10 | FromGitter | <zacharycarter> well I wish you luck! I personally cannot stand video tutorials, but I know a lot of people like them |
09:13:24 | FromDiscord | <Kiloneie> i can be doing this for about 6+ months till i start running out of money |
09:13:31 | FromDiscord | <Kiloneie> thanks 🙂 |
09:13:48 | FromGitter | <zacharycarter> then you can start your pro twitch game streaming career :P |
09:13:53 | FromGitter | <zacharycarter> since you'll already have the setup |
09:14:25 | FromGitter | <zacharycarter> maybe my stupid game will be done by then :P |
09:14:25 | FromDiscord | <Kiloneie> well i do want to be a GM |
09:14:35 | FromGitter | <zacharycarter> game master? |
09:14:41 | FromDiscord | <Kiloneie> i am a master in heroes of the storm, i wanna get to GM, i don't have the time D: |
09:14:54 | FromGitter | <zacharycarter> oh haha |
09:15:02 | FromDiscord | <Kiloneie> because i was beating the crap out of GMs easy, that's how i know |
09:15:16 | FromGitter | <zacharycarter> shows you how much I know about HotS |
09:15:37 | FromDiscord | <Kiloneie> i didn't know how good i was until i found on a stats website that it ranked me Master, so i went on the ladder, and yep, Master lol |
09:15:44 | FromDiscord | <Kiloneie> yeah i know, nothing |
09:16:07 | FromGitter | <zacharycarter> I decided what kind of game I'm going to make though |
09:16:22 | FromGitter | <zacharycarter> I was going down the RTS route, and eventually I do want to make an RTS |
09:16:31 | FromDiscord | <Kiloneie> i really want to stream and play with people watching, but that's a far harder path to take than making these videos |
09:16:33 | FromGitter | <zacharycarter> but for my first game, I'm going to do my golf battle royale idea |
09:16:41 | FromDiscord | <Kiloneie> if you do make RTS, make sure it's unique |
09:16:46 | FromDiscord | <Kiloneie> noone will care otherwise |
09:16:56 | FromGitter | <zacharycarter> well - everything has been done before |
09:17:03 | FromDiscord | <Kiloneie> no, it hasn't |
09:17:12 | FromGitter | <zacharycarter> I think it's more about having a fun game |
09:17:19 | FromDiscord | <Kiloneie> well as mods a lot has, but as actual games, no |
09:17:33 | FromGitter | <zacharycarter> if your game isn't fun, no one is going to play it no matter how unique it is |
09:18:03 | FromDiscord | <Kiloneie> i have a very fun game in mind because i played a mod that was extremely fun in Warcraft 3, but lol did i not get to finish it with my limited knowledge at age 15, in Game Maker which could not deliver, it was too slow |
09:18:56 | FromDiscord | <Kiloneie> what i tried to tell you is, a lot of people make game clones, TOO similar to existing good ones, and it ends up not getting looked at, at all. |
09:19:12 | FromDiscord | <Kiloneie> make a platformer game ? Good luck, there are so many |
09:19:19 | FromGitter | <zacharycarter> ah yes, that's definitely not my goal |
09:19:37 | FromGitter | <zacharycarter> eh, you can always put a personal spin on a genre |
09:19:48 | FromDiscord | <Kiloneie> people actually make very good games that don't sell at all because they are almost copies of other games, too similar |
09:19:49 | FromGitter | <zacharycarter> but yes if you try to make a buck by re-creating mario good luck |
09:20:05 | FromGitter | <zacharycarter> although this is a pretty widespread practice in the mobile space |
09:20:07 | * | thomasross quit (Remote host closed the connection) |
09:20:13 | FromDiscord | <Kiloneie> yes those assholes... |
09:20:16 | FromGitter | <zacharycarter> and lots of people do make lots of money |
09:20:31 | * | thomasross joined #nim |
09:20:35 | FromGitter | <zacharycarter> by ripping assets and writing the same game someone else published |
09:20:48 | FromDiscord | <Kiloneie> someone makes a flash game a good one, yay a few million plays, makes a angry birds clone of that, makes millions or a billion even... |
09:20:53 | FromGitter | <zacharycarter> but no - my golf game idea is pretty unique, I dont think it's been done before |
09:21:31 | FromDiscord | <Kiloneie> i view mobile games, and people who got rich on them as a joke, fake money. |
09:21:37 | * | thomasross quit (Remote host closed the connection) |
09:22:01 | * | thomasross joined #nim |
09:22:12 | FromDiscord | <Kiloneie> like the richest guy in my country made Tom Cat, made a billion, the damn thing is a ripp off, of so many things, it's nothing special, and it made a billion because kids and clicking everywhere including the ads |
09:22:48 | FromDiscord | <Rika> im thinking of making a version of youtube-dl in nim but i have no time lmao |
09:22:51 | FromDiscord | <Kiloneie> like Bill Gates you earned that money, some people just didn't |
09:23:23 | FromGitter | <zacharycarter> earning money is more about opportunity and initiative than doing anything to be honest |
09:23:40 | FromDiscord | <Kiloneie> yeh... and blatant steal |
09:24:01 | FromGitter | <zacharycarter> well - if you can get away with it |
09:24:05 | FromGitter | <zacharycarter> more power to you |
09:24:33 | FromDiscord | <Kiloneie> like i think Smosh youtube channel once asked for 100K $ to make a game, when they were making millions... like YOU WOT MATE !? |
09:25:00 | FromDiscord | <Kiloneie> and people still watch such assholes |
09:25:13 | FromDiscord | <Kiloneie> they are clueless |
09:25:18 | FromGitter | <zacharycarter> I mean did King invent match 3? No those games existed before video games were a thing |
09:25:31 | FromGitter | <zacharycarter> yet they make billions of dollars of revenue off of it per year |
09:25:47 | FromGitter | <zacharycarter> should we hate them for it? probably not - they just took an idea and refined it into a money making machine, so good for them |
09:26:00 | FromGitter | <zacharycarter> it'd be smarter to try and learn from their success and figure out a way to emulate it |
09:26:22 | owl_000 | marketing can sell poop |
09:26:31 | FromDiscord | <Kiloneie> fortnight 😛 |
09:26:39 | FromDiscord | <Kiloneie> the #1 game marketing of the century |
09:26:52 | owl_000 | artist shit, https://en.wikipedia.org/wiki/Artist%27s_Shit |
09:27:24 | FromDiscord | <Kiloneie> that game was a flop, then they decided lets make a battle royale, and throw millions at the screen, and now they own probably the best cow cash in the world |
09:27:31 | * | skoude quit (Ping timeout: 265 seconds) |
09:28:03 | FromDiscord | <Kiloneie> xD lol 127K for that xD, some people |
09:28:34 | owl_000 | white canvas, 15million |
09:29:02 | owl_000 | https://www.bloomberg.com/opinion/articles/2014-11-14/why-pay-15-million-for-a-white-canvas |
09:29:47 | FromDiscord | <Kiloneie> might have been a transaction really |
09:30:14 | FromDiscord | <Kiloneie> hei let me buy this for 15 million, for that service/product of yours that is not that painting of nothing at all 🙂 |
09:30:29 | FromDiscord | <Kiloneie> rich people make very shady things often lol |
09:31:13 | FromDiscord | <Kiloneie> Banks of America, they make economic crysis, and they get to keep all their money and position. ETA on the next crysis, SOON. |
09:31:52 | owl_000 | later the can of poop proved as fraud, there was no actual artist shit inside the can |
09:32:07 | FromDiscord | <Kiloneie> xD |
09:32:14 | owl_000 | lol |
09:32:20 | * | laaron joined #nim |
09:38:01 | * | skoude joined #nim |
09:40:02 | * | navinmistry quit (Ping timeout: 240 seconds) |
09:40:11 | * | navinmistry joined #nim |
09:42:02 | * | skoude quit (Ping timeout: 240 seconds) |
09:48:17 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
09:48:44 | * | laaron joined #nim |
09:48:51 | livcd | there's one studio in France that specializes in ripping off games |
09:48:55 | livcd | makes a lot of money |
09:50:53 | livcd | Honestly $3m would be enough for me for the rest of my life |
09:51:33 | Araq | for most people that would be enough |
09:56:30 | * | skoude joined #nim |
09:56:32 | livcd | well it's 50y of 60k pa which is not that much. But if it's net income after taxes it's a lot more than one can hope for. |
09:57:17 | FromGitter | <alehander42> ripping off is not nice |
09:57:44 | Zevv | unless you're the one doing the ripping |
09:58:09 | FromGitter | <alehander42> and i cant imagine not working at all for 50y |
09:58:29 | FromGitter | <alehander42> Zevv, noo |
09:58:33 | FromDiscord | <Shield> can you even not rip off somebody somewhere sometime? creativity is dead |
09:58:57 | FromGitter | <alehander42> i prefer like having a short ~20 hour work week |
09:59:00 | FromDiscord | <Shield> everything that can be done is already done |
09:59:04 | livcd | alehander42: you could work on things that do not have to make money |
09:59:05 | FromGitter | <alehander42> and doing what i want in the other time |
09:59:39 | FromGitter | <alehander42> which i can do with a short work week as well |
09:59:50 | livcd | sure if it pays enough i guess |
10:00:11 | Zevv | Shield: that's what I used to think. But still I sometimes make stuff that seems to amaze tens or hundreds of people, and I'm not the artist type or an especially creative guy. |
10:00:29 | * | Perkol joined #nim |
10:00:31 | Zevv | and it is always the stupid obvious things I just make for myself which kind of leak out |
10:00:32 | owl_000 | living in city is becoming more expensive, which increasing thirst of money. |
10:01:04 | Perkol | When I compile executables with -d:ssl, is SSL linked statically? |
10:01:33 | livcd | also most (if not all?) of commerce is driven by consumption. You could focus on things that will probably never make enough money to sustain your lifestyle. Things that will never stimulate more consumption |
10:03:52 | FromGitter | <alehander42> livcd ok, i tried that once or twice and i have to tell you |
10:03:58 | FromGitter | <alehander42> i wasnt very productive or creative |
10:04:06 | FromGitter | <alehander42> maybe i was for short periods of time |
10:04:22 | FromGitter | <alehander42> but for probably 80% of the time, eh |
10:04:54 | narimiran | there is a difference between "don't have to work" and "don't work" |
10:07:00 | FromGitter | <alehander42> i agree, just trying to say doing meaningful stuff on your own is often harder |
10:07:06 | FromGitter | <alehander42> than usual work |
10:07:07 | FromDiscord | <Shield> it's not easy to be productive |
10:07:08 | Zevv | well, if there is no unit test, it don't have to work. |
10:08:40 | * | navinmistry quit (Remote host closed the connection) |
10:09:09 | livcd | alehander42: that's true. self discipline is hard. But I would prefer to have to work on my self discipline than to work in a mundae corporate job :-) |
10:09:45 | FromGitter | <zacharycarter> +1 |
10:10:00 | FromGitter | <alehander42> i agree, but there are many jobs which are not |
10:10:05 | FromGitter | <alehander42> the typical corporate job |
10:10:46 | FromGitter | <zacharycarter> yeah but they are hard to find |
10:11:03 | FromGitter | <zacharycarter> if the company is large enough - you're almost guaranteed to run into the same bullshit politics / policies no matter where you go |
10:11:14 | FromGitter | <alehander42> but there are so many small companies |
10:11:18 | * | navinmistry joined #nim |
10:11:21 | FromGitter | <alehander42> especially in software |
10:11:26 | FromGitter | <zacharycarter> and if it's not large enough to include those, you're probably not making much money / future of the company is uncertain |
10:11:44 | FromGitter | <alehander42> well, maybe it's ok to make less money |
10:11:49 | FromGitter | <alehander42> for a job that makes me happier |
10:11:53 | FromGitter | <zacharycarter> oh I agreee |
10:11:55 | FromGitter | <alehander42> or less miserable |
10:11:56 | FromGitter | <zacharycarter> that's why I'm in gamedev :P |
10:12:09 | FromGitter | <alehander42> yes, just trying to figure it out :P |
10:12:56 | Zevv | consider going freelancer |
10:13:30 | Zevv | it might take some guts, and you need to start a bit of a network, but the risks are not any higher then working a regular job (look at zachary), the flexibility is amazing and the pay is fair |
10:14:18 | FromDiscord | <Shield> starting as a freelancer is hard... |
10:14:32 | FromDiscord | <Shield> (still there) |
10:14:36 | livcd | alehander42: my corporate job is providing me the safety of the comfort zone I've built. It's hard to change once you have established a life balance with a fat paycheck (well by fat I mean..better than what you get in a small company) |
10:14:43 | owl_000 | freelancing is bad |
10:14:53 | Zevv | owl_000: elaborate |
10:14:59 | FromGitter | <alehander42> Zevv i've donesomething like a bit of freelancing when i was young |
10:15:03 | FromGitter | <alehander42> er* |
10:15:08 | federico3 | you are all welcome to #nim-offtopic :) |
10:15:29 | Zevv | federico3: as soon as anyone starts talkin Nim, we'll shut up :) |
10:15:36 | livcd | +1 |
10:15:36 | * | navinmistry quit (Ping timeout: 240 seconds) |
10:15:43 | FromDiscord | <Shield> btw don't some companies force you to not code even in your free time if there's a conflict of interests? |
10:15:48 | FromGitter | <alehander42> this is almost valid syntax |
10:15:52 | owl_000 | in short, in freelancing nothing is certain. i hate uncertainty most. |
10:16:27 | Zevv | owl_000: I beg to differ. I have three customers I work for through the week. One can kick me out, and I still work for the others. Zachary had one job, and now he has none. |
10:16:46 | FromGitter | <alehander42> but he has a dog |
10:16:56 | Zevv | dang, you got me there :( |
10:18:28 | narimiran | so, nim talk needed? ok, lets see.... |
10:18:46 | narimiran | did you know that you can now support nim on patreon? https://www.patreon.com/araq |
10:18:55 | FromGitter | <alehander42> Araq, i still need some clarifications for the `init` part of the spec |
10:20:29 | FromGitter | <alehander42> what happens if one writes type A = object nonNilable: NonNilable .. ⏎ var a = A() ⏎ call(a) ⏎ proc call(a: A) = ⏎ echo a.nonNilable.field [https://gitter.im/nim-lang/Nim?at=5d8de26d741d186e7e676691] |
10:20:55 | Araq | you can't write 'var a = A()' |
10:21:01 | FromGitter | <alehander42> ok |
10:21:01 | Araq | you need to fill out A's fields |
10:21:10 | FromGitter | <alehander42> but then what if it's autoinit |
10:21:15 | FromGitter | <alehander42> e.g. the proc returns A |
10:21:35 | FromGitter | <alehander42> so if you don't write anything, it just returns A() |
10:21:46 | Araq | that's why this idea is closely connected to 'no implicit init' |
10:22:02 | FromGitter | <alehander42> yeah, i can feel that, but wasn't sure how no implicit init works |
10:22:10 | Araq | every path through the proc must set 'result' |
10:22:30 | * | navinmistry joined #nim |
10:23:00 | FromGitter | <alehander42> but only for nonref object return type? |
10:23:43 | FromGitter | <alehander42> oh, it should be for all types that have a non-autoinitable subfield somewhere |
10:24:00 | FromGitter | <alehander42> e.g. A(b: B(nonNilable: value)) |
10:24:45 | FromGitter | <alehander42> so the non-implicit-initness is lifted from sub fields |
10:26:50 | * | navinmistry quit (Ping timeout: 240 seconds) |
10:30:07 | * | navinmistry joined #nim |
10:31:48 | * | skoude quit (Ping timeout: 265 seconds) |
10:34:42 | * | navinmistry quit (Ping timeout: 265 seconds) |
10:37:40 | * | navinmistry joined #nim |
10:41:04 | * | neceve joined #nim |
10:42:02 | * | navinmistry quit (Ping timeout: 240 seconds) |
10:45:14 | * | navinmistry joined #nim |
10:46:07 | * | skoude joined #nim |
10:49:16 | * | navinmistry quit (Ping timeout: 240 seconds) |
10:52:50 | * | navinmistry joined #nim |
10:54:15 | FromDiscord | <Kiloneie> Can the compiler determine data type for any value ? (other than the ones made in type sections, which shouldn't work) |
10:57:14 | * | navinmistry quit (Ping timeout: 240 seconds) |
11:00:25 | * | navinmistry joined #nim |
11:00:37 | leorize[m] | there's a type for every value in nim :p |
11:01:21 | FromDiscord | <Kiloneie> what about the wacky ones you can make in type section, the compiler shouldn't be able to figure that one out with an initialiation value ? |
11:01:54 | FromDiscord | <Kiloneie> If Nim can figure it all out, then declarations of types are only useful for sizes ?... |
11:03:39 | FromGitter | <alehander42> can you givean example |
11:03:59 | FromDiscord | <Kiloneie> Uhh maybe... |
11:04:06 | Zevv | I think he means if you say `var a = 3`, you don't need to make it explicit that you want an int |
11:04:46 | FromGitter | <alehander42> i see, so yeah, some languages work with less type annotations for functions, and more inference |
11:04:49 | FromGitter | <alehander42> e.g. haskell and crystal |
11:04:53 | * | navinmistry quit (Ping timeout: 245 seconds) |
11:04:58 | FromDiscord | <Kiloneie> yeh that, so the compiler can figure out the type for ANY type ? But it won't figure out if you type var a = 127 which should be int8, so no sizes |
11:05:01 | FromGitter | <alehander42> but you still need the base type definitions like our type sections |
11:05:19 | FromGitter | <alehander42> well, thats one example |
11:05:34 | Zevv | Kiloeine: So you can do either `var a = 127'8` or `var a = 127.uint8` |
11:05:35 | FromGitter | <alehander42> but not only that, overally inference has other issues |
11:05:41 | FromGitter | <alehander42> full program inference* |
11:05:53 | FromGitter | <alehander42> it's much slower iirc |
11:06:34 | FromDiscord | <Kiloneie> yeah but then you are telling the compiler you want an int8, which it won't know by itself, it will make a default int which is int64 depending on your OS BIT... edition ?.. |
11:07:06 | leorize[m] | it's the reasonable default |
11:07:27 | FromDiscord | <Kiloneie> will it make it a int32 if you got a 32 bit Nim version ? |
11:07:30 | FromGitter | <alehander42> so you ask if there are types |
11:07:41 | FromGitter | <alehander42> where you can't write var a = <value of it> |
11:07:45 | FromGitter | <alehander42> and nim figure it out |
11:07:50 | leorize[m] | yep, unless the value is bigger |
11:08:02 | * | navinmistry joined #nim |
11:08:24 | FromDiscord | <Kiloneie> and if you made a lot of variables by not stating it's type, the program would run slower ? |
11:08:33 | FromGitter | <alehander42> no |
11:08:38 | FromGitter | <alehander42> it doesnt have anything to do with that |
11:08:47 | FromGitter | <alehander42> the compiler always figures out types for each variable |
11:08:51 | leorize[m] | no |
11:08:53 | FromGitter | <alehander42> otherwise you'll get a compiler error |
11:09:00 | FromGitter | <alehander42> e.g. if you writa var a = @[] |
11:09:04 | FromGitter | <alehander42> iirc thats error |
11:09:23 | leorize[m] | !eval var a = @[] |
11:09:25 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: cannot infer the type of the sequence |
11:09:44 | FromGitter | <alehander42> so here you indeed need to var a: seq[stuff] or to cast |
11:10:50 | FromDiscord | <Kiloneie> so if i were to say type inference only works for basic types would that be correct ? |
11:11:13 | leorize[m] | not really |
11:11:30 | leorize[m] | !eval echo typeof (1,2) |
11:11:33 | NimBot | (int, int) |
11:11:51 | leorize[m] | ^ the compiler still knows that this is a tuple |
11:12:47 | FromDiscord | <Kiloneie> it seems to me like you don't really ever need to declare a type yourself like in Python. |
11:12:53 | * | navinmistry quit (Ping timeout: 265 seconds) |
11:12:57 | FromDiscord | <Kiloneie> as long as you give it a value |
11:13:04 | leorize[m] | I'd say that type inference will always work unless it's too ambiguous |
11:13:09 | leorize[m] | python uses dynamic typing |
11:13:27 | leorize[m] | the type can change during the course of the program |
11:13:42 | FromDiscord | <Kiloneie> i know it does, other than not being able to change a variable's type, it works pretty much the same no ? |
11:14:10 | leorize[m] | well it's slower in python case |
11:14:25 | FromDiscord | <Kiloneie> static typing for the win |
11:14:37 | FromDiscord | <Kiloneie> i don't get why people like dynamic... |
11:14:44 | leorize[m] | since you'll have to keep track of the type of every variable as the program runs |
11:15:29 | FromDiscord | <Kiloneie> you have to do that in any case, static typing just makes it easier, if you do it wrong the compiler will whine usually even before compilation, if not, during one |
11:15:36 | FromDiscord | <Kiloneie> python won't... ever... |
11:15:41 | * | navinmistry joined #nim |
11:15:55 | leorize[m] | nah, python can still whine |
11:16:01 | FromDiscord | <Kiloneie> and then one wonders why their code isn't acting the way it should |
11:16:04 | FromDiscord | <Kiloneie> yeah but rarely... |
11:16:07 | leorize[m] | it's just too late by the time you saw that |
11:16:14 | FromDiscord | <Kiloneie> yep |
11:16:58 | leorize[m] | if you really wants to wonder why your code don't work as you wanted it to |
11:17:00 | leorize[m] | try JS |
11:17:15 | FromDiscord | <Kiloneie> no thanks, had that in Game Maker |
11:17:18 | FromDiscord | <Kiloneie> lost my mind |
11:17:43 | FromDiscord | <Kiloneie> write big chunks of code, then run it, and nothing works... |
11:17:57 | leorize[m] | python still have a fair share of safeguards |
11:17:59 | FromDiscord | <Kiloneie> compiler says nothing... no errors... just nothing xD |
11:18:06 | leorize[m] | everything is possible in js |
11:18:37 | FromDiscord | <Kiloneie> isn't that a good reason to use Nim to compile to JS ? so you avoid that crap ? |
11:18:58 | leorize[m] | yep |
11:19:17 | leorize[m] | i have never written any native js :p |
11:19:22 | FromDiscord | <Kiloneie> That is very nice ^^. |
11:19:39 | FromDiscord | <Kiloneie> Nim has a lot of use cases |
11:19:55 | FromDiscord | <Kiloneie> and people keep comparing it to languages that can't do those things |
11:20:02 | * | navinmistry quit (Ping timeout: 245 seconds) |
11:20:24 | leorize[m] | nim can do everything, but it's hard to spell that out :p |
11:20:36 | FromDiscord | <Kiloneie> yeh people are very touchy about saying that |
11:20:51 | FromDiscord | <Kiloneie> "there can't be a language that does it all !!!" |
11:20:57 | FromDiscord | <Kiloneie> blashphemy ! |
11:21:05 | * | Vladar quit (Read error: Connection reset by peer) |
11:21:19 | leorize[m] | to be fair you can do everything in every language if you're brave enough |
11:21:32 | FromDiscord | <Kiloneie> yeah ... and die trying |
11:22:21 | leorize[m] | it's just that Nim got the right balance |
11:22:52 | FromDiscord | <Kiloneie> Yep. |
11:24:03 | FromDiscord | <Kiloneie> So when do people declare types in Nim other than when it's too ambigous/complex ? ? I think a use case is for like GBA to declare smaller types like int8, smaller float and such |
11:24:40 | leorize[m] | when they need it :p |
11:25:50 | FromDiscord | <Shield> can anybody help here? I get an "invalid http version [Protocol error]" when i give the bot multiple requests to send the file at the same time |
11:25:50 | FromDiscord | <Shield> https://play.nim-lang.org/#ix=1X98 |
11:26:05 | FromDiscord | <Kiloneie> I am trying to show declaration in my video, but it would nice to have a reason for it, and now i don't know anymore xD |
11:27:32 | * | skoude quit (Ping timeout: 276 seconds) |
11:27:43 | FromDiscord | <Kiloneie> okay i have one, for when you make a variable for later and you need it empty |
11:28:31 | * | navinmistry joined #nim |
11:29:47 | FromGitter | <alehander42> var a: seq[int] = @[] |
11:30:13 | FromGitter | <alehander42> but indeed var a: seq[int] |
11:30:17 | FromGitter | <alehander42> should be the same |
11:30:23 | FromGitter | <alehander42> yeah, empty values |
11:30:35 | FromGitter | <alehander42> basically where literals are ambigious |
11:30:39 | FromGitter | <alehander42> e.g. var a = nil |
11:30:46 | FromGitter | <alehander42> what is nil? it can be many things |
11:30:52 | FromGitter | <alehander42> var a: NilableRef |
11:32:37 | FromDiscord | <Kiloneie> okay, i have 2 use cases now |
11:33:27 | * | navinmistry quit (Ping timeout: 268 seconds) |
11:33:29 | leorize[m] | to be fair, the only ambiguous values are empty values :p |
11:33:31 | FromDiscord | <Kiloneie> i know someone is making a game for GBA, pretty sure he declares his types because GBA is very limited |
11:33:52 | FromDiscord | <Kiloneie> ah okay ^^ |
11:34:00 | leorize[m] | yes, but no |
11:35:09 | FromDiscord | <Kiloneie> wouldn't it matter if you used a ton of variables of int64 ALL the time with lots of objects when you could use INT8 or Int16 ? |
11:35:34 | leorize[m] | nope |
11:35:35 | FromDiscord | <Kiloneie> actually... probably no... |
11:35:46 | leorize[m] | the cpu access them at the same pace :p |
11:36:01 | FromDiscord | <Kiloneie> yeh... i just remembered that |
11:36:08 | * | navinmistry joined #nim |
11:36:13 | FromDiscord | <Kiloneie> the reason why i had to switch from windows xp to win 7... |
11:36:22 | FromDiscord | <Kiloneie> i didn't want to D:... but i had to |
11:36:43 | FromDiscord | <Kiloneie> also windows 10, because ryzen doesn't like win 7 D: |
11:36:47 | leorize[m] | if you miss win xp there's reactos :p |
11:36:53 | FromDiscord | <Kiloneie> NAH |
11:37:09 | FromDiscord | <Kiloneie> once i switched and used win 7 and now win 10, i realized its pretty awesome |
11:37:29 | FromDiscord | <Kiloneie> but before that, i was glued to win xp, because i used it since i was like 5-6 years old |
11:37:34 | leorize[m] | win 10 is anything but awesome :p |
11:37:50 | FromDiscord | <Kiloneie> yeah it's missing stuff... but it's a lot nicer to use than win 7 |
11:38:00 | FromDiscord | <Kiloneie> some old games don't work... |
11:38:09 | FromDiscord | <Kiloneie> last i tried was crysis 1, it would not open... |
11:38:13 | FromDiscord | <Kiloneie> -.- |
11:38:33 | leorize[m] | it shuts down my system while I was doing compute stuff |
11:38:37 | leorize[m] | because updates |
11:38:51 | FromDiscord | <Kiloneie> uhh that's your fault |
11:38:55 | FromDiscord | <Kiloneie> you didn't set that up |
11:38:59 | FromDiscord | <Kiloneie> mine NEVER does that |
11:39:14 | leorize[m] | and turns out that microsoft won't let you work on a computer for more than 5 hours a day |
11:39:15 | FromDiscord | <Kiloneie> always gives me, restart and update, update and shutdown options |
11:39:24 | FromDiscord | <Kiloneie> WHAT !? |
11:39:29 | FromDiscord | <Kiloneie> im here all day |
11:39:44 | leorize[m] | they improved the situation now |
11:39:52 | FromDiscord | <Kiloneie> when did that happen ? |
11:40:14 | leorize[m] | windows 10 older than 1607 |
11:40:14 | FromDiscord | <Kiloneie> i've never heard of that |
11:40:16 | * | navinmistry quit (Ping timeout: 240 seconds) |
11:40:23 | FromDiscord | <Kiloneie> i got win 10 like... |
11:40:29 | FromDiscord | <Kiloneie> 1 year 1-2 months ago |
11:40:56 | FromDiscord | <Kiloneie> well Microsoft does listen to users, removing dumb ideas |
11:41:25 | FromDiscord | <Kiloneie> basically with microsoft every second OS they make sucks because their new ideas aren't refined enough |
11:41:39 | FromDiscord | <Kiloneie> win xp YAY, vista NOPE, win 7 YAY, win 8 NOPE, Win 10 YAY ? |
11:41:54 | leorize[m] | ofc they will listen if you threaten them with a lawsuit :p |
11:42:06 | FromDiscord | <Kiloneie> companies did that ? |
11:42:31 | leorize[m] | individuals |
11:42:37 | FromGitter | <zacharycarter> I think I might be half way through required vulkan setup :P : https://gist.github.com/zacharycarter/4791d46dee831ba78bb0d643fc66babc |
11:42:44 | FromDiscord | <Kiloneie> i don't watch much news, only last year i started watching tech news for gpus and processors |
11:42:44 | * | navinmistry joined #nim |
11:42:55 | FromDiscord | <Kiloneie> other than that im on youtube and coding and stuff |
11:42:57 | Zevv | masochist |
11:43:34 | * | clyybber joined #nim |
11:43:48 | FromDiscord | <Kiloneie> Who oO ? |
11:44:14 | FromGitter | <zacharycarter> pretty much! |
11:44:18 | * | navinmistry quit (Remote host closed the connection) |
11:44:18 | leorize[m] | zacharycarter |
11:44:38 | FromGitter | <zacharycarter> yessir |
11:44:41 | FromDiscord | <Kiloneie> i had to google that meaning xD |
11:44:43 | leorize[m] | you can't be more masochist than trying to use vulkan :p |
11:45:01 | FromDiscord | <Kiloneie> i've heard it's really really low level and a pain in the ass... yeh... |
11:45:11 | FromGitter | <zacharycarter> well - my line of thinking is that I'm better served trying to learn Vulkan than continuing to use BGFX |
11:45:13 | leorize[m] | well other than writing vimscript :p |
11:45:46 | clyybber | leorize[m]: Vulkan is great |
11:45:47 | FromGitter | <zacharycarter> also - since vulkan is so low level I think at the same time you're learning it, it can lead to a stronger understanding of the graphics pipeline overall |
11:45:54 | clyybber | Exactly |
11:46:26 | FromGitter | <zacharycarter> but it's definitely a LOT of effing boilerplate setup code |
11:46:36 | FromGitter | <zacharycarter> if anyone feels like making a library |
11:46:41 | FromGitter | <zacharycarter> ;) |
11:47:00 | leorize[m] | the library is called opengl :p |
11:47:17 | FromGitter | <zacharycarter> true true |
11:49:26 | Calinou | well, OpenGL will be reimplemented over Vulkan one day |
11:49:28 | Zevv | I need to do vulkan in the forseeable future. Not sure if I want that, but we need that for gen2 |
11:49:34 | Calinou | (there are WIP implementations out there right now) |
11:49:57 | clyybber | gfx-rs is also really interesting. |
11:50:54 | FromGitter | <zacharycarter> I still don't see that as a reason not to learn / use Vulkan |
11:51:09 | FromGitter | <zacharycarter> Vulkan kind of exposes you to the things OpenGL does behind the scenes |
11:51:17 | FromGitter | <zacharycarter> understanding all of that isn't necessarily a bad thing |
11:51:27 | leorize | yea, it's good to learn vulkan |
11:51:55 | leorize | but you shouldn't use it just because it's there |
11:52:01 | * | navinmistry joined #nim |
11:52:37 | Zevv | zacharycarter: I still don't see that as a reason not to learn / use assembly. Machine code kind of exposes you to the things C or Nim do behind the scenes. understanding all of that isn't necessarily a bad thing. |
11:52:49 | Zevv | All very true, but is it *fun* I ask? |
11:52:51 | clyybber | vulkan isn't really that bad |
11:53:00 | clyybber | and yeah it is *fun* |
11:53:05 | Zevv | you're hired |
11:53:06 | Zevv | :) |
11:53:11 | clyybber | lol |
11:53:11 | Zevv | when can you start |
11:53:17 | * | rockcavera joined #nim |
11:53:18 | FromGitter | <zacharycarter> well the setup code isn't that fun but once you've written it you've written it |
11:53:44 | Zevv | you should just rip it somewhere |
11:53:45 | FromGitter | <zacharycarter> and if I can eventually replace it all with an OpenGL over vulkan call, perks |
11:54:05 | clyybber | One thing that really isn't fun is writing sType: <HEYLETSWRITETHENAMEALLOVERAGAIN> |
11:54:17 | clyybber | But I blame that on nim not having default object field values (yet) |
11:54:24 | Zevv | or casting a GL extel function pointer in C++ |
11:55:15 | leorize | ooh, narimiran updated nim basics |
11:55:21 | narimiran | yeah he did :) |
11:55:26 | leorize | and the first thing I saw was fira mono/code |
11:55:32 | Zevv | He ripped my stylesheet, did you guys know that? |
11:55:32 | narimiran | finally a readable pdf version |
11:55:39 | narimiran | leorize: that was there before |
11:56:08 | * | navinmistry quit (Ping timeout: 245 seconds) |
11:56:13 | leorize | use a better font :P |
11:56:25 | narimiran | Zevv: now i tweaked some details, just to cover my ass :P |
11:56:38 | Zevv | ghehe:) |
11:56:45 | narimiran | leorize: let me hear, what do you prefer? |
11:56:58 | leorize | but I do like the free advertisement for nim.nvim :P |
11:57:06 | * | navinmistry joined #nim |
11:57:07 | narimiran | yep, that part is new |
11:57:13 | leorize | I use iosevka |
11:57:33 | leorize | but since most people can't consume the narrow fonts, source code pro would do |
11:57:50 | shashlick | @Araq you here? Did you see this: https://irclogs.nim-lang.org/27-09-2019.html#01:23:18 |
11:57:55 | narimiran | i used to use it personally, and i tried to use it for nim basics, but i decided for something wider |
11:58:10 | leorize | to be fair I just hate fira code over the letter 'r' |
11:58:14 | leorize | it's a fine font otherwise |
11:59:21 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
12:00:19 | leorize | so, uh, anyone tried nim.nvim 'find-project' branch? |
12:00:33 | narimiran | not yet, and i'm not sure what does it even do |
12:00:51 | clyybber | it finds your project :P |
12:01:21 | leorize | yep, open any file in compiler/ and you'll see that nimsuggest will be launched against compiler/nim.nim \o/ |
12:01:33 | * | navinmistry quit (Ping timeout: 245 seconds) |
12:01:39 | narimiran | clyybber: oh, that's great! 'cause i've been wanting to start some new personal project, but didn't know what exactly. if this plugin can tell me.... wow! |
12:01:55 | leorize | no more red texts when you start editing an include file \o/ |
12:01:58 | Zevv | stupid question, but what does that solve, nimsuggestwise? |
12:02:03 | clyybber | narimiran: A real productivity booster |
12:02:15 | * | navinmistry joined #nim |
12:02:16 | Zevv | If I edit a file I am only interested in its imports, because that is where its stuff comes from, right? |
12:02:20 | narimiran | Zevv: iiuc, you don't have to first open some file in the root of the project |
12:02:44 | Zevv | But I don't? I can just open my sub-file and happily work and suggest in there? |
12:03:00 | leorize | it's useful in projects where include files are used |
12:03:03 | leorize | like the compiler |
12:03:15 | leorize | you wouldn't have to open the root file for the module graph to populate first |
12:03:56 | narimiran | so this should prevent multiple nimsuggest instances for the same project? |
12:04:08 | leorize | yes |
12:05:11 | Zevv | ah ok |
12:06:25 | leorize | I start worked on a project and found opening the root file everytime just unproductive :P |
12:06:45 | * | navinmistry quit (Ping timeout: 268 seconds) |
12:06:53 | narimiran | yeah, it will save me some time too |
12:07:15 | leorize | if you complained I'd have fixed it sooner lol |
12:07:32 | narimiran | naaah, i bother you enough with other stuff |
12:07:33 | * | rockcavera quit (Read error: Connection reset by peer) |
12:07:50 | * | rockcavera joined #nim |
12:07:51 | * | rockcavera quit (Changing host) |
12:07:51 | * | rockcavera joined #nim |
12:07:51 | leorize | anyhow, if everything goes well, this is going to the compiler |
12:08:12 | * | nif quit (Quit: ...) |
12:08:12 | * | thomasross quit (Remote host closed the connection) |
12:08:23 | * | navinmistry joined #nim |
12:08:24 | * | nif joined #nim |
12:08:24 | leorize | then even vscode-nim can benefit from it |
12:08:35 | * | thomasross joined #nim |
12:08:57 | leorize | and I'm pretty sure PMunch wanted something like this for nimlsp also |
12:09:37 | * | mwbrown quit (Ping timeout: 245 seconds) |
12:10:19 | leorize | narimiran: I can't have more users if the module doesn't work well ergonomically :P |
12:11:40 | clyybber | narimiran: Do you have a means of contacting GULPF? I would love to get https://github.com/GULPF/tiny_sqlite/pull/1 merged because its a blocker for a Nim bugfix. |
12:11:45 | Perkol | I remember there was function for getting cpu arch somewhere in stdlib. |
12:11:48 | narimiran | i really think a readme/wiki instructions for non-asyncomplete would be beneficial. i'm ok with AC, but others might prefer something else, and might not know that your plugin is not limited just on AC |
12:11:54 | * | mwbrown joined #nim |
12:12:14 | narimiran | clyybber: nothing better than pinging him by @GULPF, sorry |
12:12:15 | leorize | I'll be waiting for @zetashift :P |
12:12:49 | * | navinmistry quit (Ping timeout: 265 seconds) |
12:12:52 | clyybber | PMunch == zetashift? |
12:13:06 | leorize | what? |
12:13:25 | clyybber | That was a question ;p |
12:13:25 | * | navinmistry joined #nim |
12:13:33 | leorize | no lol |
12:17:38 | * | navinmistry quit (Ping timeout: 240 seconds) |
12:20:04 | * | navinmistry joined #nim |
12:20:58 | FromGitter | <awr1> @zacharycarter i would reccomend trying V-EZ |
12:21:30 | * | dddddd joined #nim |
12:21:58 | FromGitter | <awr1> you can get a stronger understanding of the pipeline overall without vulkan, vulkan is just explicit and says "okay, you have t synchronize everything, have fun" |
12:22:56 | FromDiscord | <Kiloneie> if someVariable.type == string #this doesn't work i know, you can't do this because string is a TYPE not a value right ? if i put $ infront of both it works like intended. |
12:23:27 | leorize | echo typeof("var") == string |
12:23:30 | leorize | !eval echo typeof("var") == string |
12:23:32 | NimBot | Compile failed: /usercode/in.nim(1, 20) Error: type mismatch: got <type string, type string> |
12:23:52 | leorize | !eval echo typeof("var") is string |
12:23:55 | NimBot | true |
12:24:10 | leorize | @Kiloneie: ^ there you go |
12:24:17 | * | navinmistry quit (Ping timeout: 240 seconds) |
12:24:20 | leorize | it's just that we don't use the `==` operator for typedesc |
12:25:06 | leorize | also, you should use `typeof` instead, it has less bugs |
12:25:11 | FromDiscord | <Kiloneie> so string, int, float are called typedesc ? |
12:25:12 | * | navinmistry joined #nim |
12:25:26 | FromDiscord | <Shield> async is driving me insane, why would calling a function twice crash the bot they should be queued? |
12:25:33 | leorize | yep, the type of types are typedesc |
12:25:58 | Zevv | and the type of typedesc? |
12:26:19 | leorize | !eval echo typeof typeof typeof string |
12:26:22 | NimBot | string |
12:26:39 | leorize | nope that doesn't exist :P |
12:27:00 | leorize | !eval echo typeof typedesc[typedesc[string]] |
12:27:02 | NimBot | string |
12:27:25 | clyybber | Thats about the only "bug" with type() instead of typeof() |
12:28:53 | FromGitter | <zacharycarter> @awr1 `V-EZ` does indeed look nice |
12:29:03 | FromGitter | <zacharycarter> are there Nim bindings for it? |
12:29:57 | FromGitter | <zacharycarter> doesn't look like it |
12:30:03 | * | navinmistry quit (Ping timeout: 264 seconds) |
12:31:29 | FromGitter | <awr1> also Vulkan is still a layer of abstraction and its impl towards its design purpose is not without controversy |
12:31:52 | * | navinmistry joined #nim |
12:31:55 | FromGitter | <awr1> for instance the whole Subpass-inside-RenderPass thing is basically not helpful in non-tiled GPU archs |
12:32:01 | FromGitter | <awr1> i dont think so |
12:32:05 | FromGitter | <awr1> RE: V-EZ |
12:32:08 | FromGitter | <zacharycarter> might have to cook some up |
12:32:22 | FromGitter | <zacharycarter> or just go back to using OpenGL / BGFX |
12:32:44 | FromGitter | <zacharycarter> I don't know what the right answer is :P |
12:32:57 | leorize | well if it's a personal project, go for the fun route |
12:34:23 | Zevv | Real men program GPU |
12:34:35 | Zevv | GPU's from the datasheet, straight into the MIO registers and DMA buffer |
12:34:36 | Zevv | s |
12:34:38 | FromGitter | <zacharycarter> I guess I'll just continue on the vulkan path I'm going down |
12:35:00 | FromGitter | <zacharycarter> since I'd probably spend just as much time writing bindings to V-EZ |
12:36:00 | FromGitter | <awr1> what was wrong with bgfx |
12:36:26 | * | navinmistry quit (Ping timeout: 276 seconds) |
12:36:38 | FromGitter | <zacharycarter> nothing necessarily - I just figured that using OpenGL / Vulkan might look better on a resume than using BGFX |
12:36:50 | FromGitter | <zacharycarter> since I'm interested in eventually procuring work in the field |
12:36:57 | * | navinmistry joined #nim |
12:37:46 | FromGitter | <awr1> gotcha |
12:37:47 | FromGitter | <zacharycarter> also bgfx is a pretty big dependency |
12:39:21 | * | Serrellanos joined #nim |
12:40:16 | * | laaron joined #nim |
12:40:54 | FromGitter | <awr1> just be wary that vulkan is very tricky to use, setting up the boilerplate and initializing everything might as well be the easy part |
12:41:20 | * | navinmistry quit (Ping timeout: 252 seconds) |
12:41:33 | clyybber | Yeah, synchronization and memory management is oof. |
12:42:06 | FromGitter | <awr1> sync is a nightmare and the debug layers will only help you up to a point |
12:42:39 | clyybber | But hey, you learn something worthwhile while at it |
12:43:36 | * | navinmistry joined #nim |
12:46:20 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
12:46:23 | FromGitter | <zacharycarter> I'm leaning towards just starting with opengl and if I want vulkan later, adding an additional rendering backend then |
12:46:46 | FromGitter | <zacharycarter> Maybe sokol gfx would be a good option as well |
12:47:57 | * | navinmistry quit (Ping timeout: 245 seconds) |
12:48:16 | clyybber | Zevv: Real man program in AMDGCN |
12:48:24 | Calinou | heh, bgfx isn't magic :) |
12:48:27 | * | laaron joined #nim |
12:48:55 | FromGitter | <awr1> lol i was looking at a GCN assembler a while ago |
12:49:15 | FromDiscord | <kodkuce> hi i frogot and this is not easy to find fast, but how to i get last element or 2 before last, as i remmeber in python there is [:-1] or soemthing like that hows in nim |
12:49:24 | FromGitter | <awr1> if you do use Vulkan i strongly reccomend using something like VMA |
12:49:25 | FromGitter | <zacharycarter> I think BGFX is good, just a large dependency |
12:49:44 | * | navinmistry joined #nim |
12:50:12 | clyybber | kodkuce: [^1] |
12:50:38 | FromDiscord | <kodkuce> ty |
12:52:06 | * | laaron quit (Client Quit) |
12:53:34 | clyybber | np |
12:54:00 | * | daddoo joined #nim |
12:54:22 | FromGitter | <awr1> agh i have a physics exam later today |
12:54:38 | FromGitter | <zacharycarter> ooph |
12:55:24 | * | laaron joined #nim |
12:55:43 | * | navinmistry quit (Ping timeout: 250 seconds) |
12:56:20 | clyybber | awr1: Good luck. What are you studying? |
12:56:33 | FromGitter | <awr1> thermodynamics, electric fields |
12:56:43 | * | navinmistry joined #nim |
12:57:14 | FromGitter | <awr1> neither of which i'm very interested in but its a required class for my to finish my CS bachelors |
13:00:00 | * | laaron quit (Client Quit) |
13:01:09 | * | navinmistry quit (Ping timeout: 265 seconds) |
13:01:13 | * | laaron joined #nim |
13:02:03 | * | navinmistry joined #nim |
13:03:28 | * | sealmove joined #nim |
13:06:17 | * | navinmistry quit (Ping timeout: 240 seconds) |
13:07:21 | FromGitter | <zacharycarter> krux02: https://github.com/nim-lang/sdl2/pull/121 |
13:08:56 | * | navinmistry joined #nim |
13:11:13 | FromGitter | <alehander42> " ⏎ The ^ operator, which specifies that an index is relative to the end of the sequence." |
13:11:14 | FromGitter | <alehander42> https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#indices-and-ranges |
13:11:18 | FromGitter | <alehander42> c# got ^1 |
13:13:14 | * | navinmistry quit (Ping timeout: 240 seconds) |
13:14:18 | * | navinmistry joined #nim |
13:17:57 | clyybber | krux02: Do you have an idea on what might cause https://github.com/nim-lang/Nim/issues/12282 ? |
13:18:18 | FromGitter | <awr1> why is backwards indexing not relative to the high end of a seq |
13:18:38 | FromGitter | <awr1> and instead its length |
13:18:52 | FromGitter | <awr1> i.e. why ^1 and not ^0 |
13:19:02 | * | navinmistry quit (Ping timeout: 265 seconds) |
13:19:04 | clyybber | awr1: There is no particular reason other than that it makes sense too. |
13:19:21 | clyybber | When you start indexing at 0 from the start you can start at 1 from the end |
13:19:25 | clyybber | And the other way around |
13:19:40 | FromGitter | <awr1> It would make more sense if ranges were exclusive in Nim |
13:19:42 | FromGitter | <awr1> but they aren't |
13:20:27 | FromGitter | <awr1> which is why the slice syntax works in D - i.e. `x[0 .. $]` even though $ is length |
13:20:44 | * | navinmistry joined #nim |
13:21:08 | clyybber | I think inclusive ranges are much more intuitive than exlucsive ones |
13:21:38 | * | narimiran quit (Ping timeout: 240 seconds) |
13:21:38 | FromGitter | <awr1> i mean i agree |
13:21:47 | clyybber | But yeah that ^1 thing is arguable. Python does it this way I think. So nim just copied it |
13:22:30 | FromGitter | <alehander42> no i dont agree |
13:22:33 | FromGitter | <awr1> i'm saying `^0` could have been used if ranges were exclu. |
13:22:33 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
13:22:35 | FromGitter | <alehander42> because you have `..<` |
13:22:40 | FromGitter | <alehander42> which is better as exclusive |
13:22:42 | FromGitter | <awr1> ahhh hmmmmmm |
13:22:56 | FromGitter | <alehander42> i think a[0 .. ] |
13:23:05 | FromGitter | <alehander42> can still be equivalent to a[0 .. ^1] |
13:23:06 | FromGitter | <awr1> wait does `[0 ..< ^0]` even work |
13:23:12 | FromGitter | <alehander42> not sure why it is not |
13:23:16 | clyybber | awr1: Probably not |
13:23:32 | FromGitter | <alehander42> i dont think `^0` makes sense in the nim model |
13:23:55 | FromGitter | <alehander42> probably it's a grammar thing |
13:23:59 | FromGitter | <alehander42> `..` not being postfix |
13:24:06 | FromGitter | <alehander42> and prefix but only infix |
13:24:48 | clyybber | Well you could implement a ..< or a .. which takes a BackwardsIndex as the 2nd param |
13:25:05 | clyybber | But afaik array indexing with .. is special cased somewhere for some reason |
13:25:41 | * | navinmistry quit (Ping timeout: 268 seconds) |
13:27:03 | * | navinmistry joined #nim |
13:27:43 | clyybber | disruptek: Hey, I found a way to make string streams work at compile time |
13:28:41 | disruptek | whaaa how? |
13:29:06 | clyybber | With a `when nimvm:` in readChar |
13:29:13 | clyybber | I'm gonna send a PR out. |
13:29:41 | disruptek | hmm, did it ever work? |
13:29:44 | clyybber | But I'm gonna try making it work for the js backend too first. |
13:30:20 | disruptek | maybe that will get us closer to parsing json for the js backend. |
13:30:35 | clyybber | disruptek: I think that will make it "just work" TM |
13:30:37 | disruptek | you give me hope that i could actually figure out the problem there. |
13:30:43 | disruptek | sweet! |
13:31:09 | FromDiscord | <kodkuce> i decided i will do 2 exercism a day in Nim, i forgot a lot of stuff |
13:31:13 | clyybber | Imma get something to eat first tho |
13:31:36 | * | navinmistry quit (Ping timeout: 265 seconds) |
13:33:29 | * | navinmistry joined #nim |
13:37:37 | * | navinmistry quit (Ping timeout: 240 seconds) |
13:37:44 | clyybber | disruptek: Whats the error you get when you tr parsing json for the js backend? |
13:38:04 | clyybber | Is it "undeclared identifier: 'newStringStream'"? |
13:38:56 | Zevv | I have this nagging question about streams in nim. They're called "streams", but the are not really - file and string stream are both backed by one single complete blob of data that lives somewhere. I can not use a stream like a real stream: feeding it on one end while consuming it at the other. Then what is the use, apart from abstracting away the type of blob under the hood? |
13:39:22 | Zevv | Is there something obvious I miss? |
13:39:48 | * | navinmistry joined #nim |
13:39:53 | Araq | well streams are not queues or channels |
13:40:02 | Araq | so they are uni-directional |
13:40:35 | Zevv | ok, but I was doing all this fuzz to get npeg work on top of streams, until I realized I can just seek back at leasure to collect whatever I need after parsing |
13:40:53 | Zevv | But then again, why would I even bother putting it on top of a stream, if the backed data is available either as as string or memFile? |
13:41:42 | Zevv | leorize was discussing the scenario where he wanted to parse network data as it came in, incrementally. But you can't use a stream for that either, only by appending all incoming data into the string backing the stream |
13:43:00 | * | floppydh quit (Quit: WeeChat 2.6) |
13:43:40 | disruptek | Zevv: you want true stream parsing so you can truly parse an unending stream. it happens sometimes. |
13:43:56 | disruptek | i mean, good on you for going down that road. |
13:43:57 | * | navinmistry quit (Ping timeout: 240 seconds) |
13:44:02 | * | navinmis_ joined #nim |
13:44:33 | sealmove | hum... |
13:44:57 | Araq | Zevv, I'm not following you. I can parse 16GB json files without needing 16GB of RAM with Nim's streams |
13:45:10 | Araq | and that's what matters, it's lazy |
13:46:12 | disruptek | clyybber: i dunno anymore; since npeg doesn't support js backend, i don't have a test that triggers it. |
13:46:42 | disruptek | treeform ping |
13:46:50 | Zevv | clyybber: well, yes, no, wait. Npeg supports js backend, but the js backend broke npeg-on-js just 8 commits before 1.0 |
13:47:10 | Araq | :D |
13:47:21 | Araq | the more we work, the more we break |
13:47:24 | Zevv | Araq: ok, fair enough, we use streams as a window to slide over huge data. |
13:47:24 | clyybber | disruptek, Zevv: Just put some test in a static: block and run nim js |
13:47:59 | * | navinmistry joined #nim |
13:48:05 | * | navinmis_ quit (Read error: Connection reset by peer) |
13:48:28 | Zevv | clyybber: also one of these things that confuse me: I can make a proc, put i full with npeg stuff and have it return its value into a cons. Then it is called compile time and that is fine. But I can not run inside a static: block |
13:48:32 | Zevv | how is that different? |
13:49:03 | clyybber | Zevv: Huh, whats the error? |
13:50:08 | Zevv | clyybber: please ignore that last one, I'm mistaking |
13:50:12 | disruptek | clyybber: well, parseJson wants to importc parseNativeJson so that's a dealbreaker. |
13:50:42 | Zevv | I'm confusing with the js backend problem - that gives me "Error: request to generate code for .compileTime proc: newGrammar" |
13:50:45 | disruptek | maybe we can fix npeg and then i can use that to parse json at compile-time. 😜 |
13:51:07 | clyybber | disruptek: Or we just put a few when nimvm: here and there |
13:51:53 | clyybber | Zevv: Oh, so its not as easy as doing when nimvm? |
13:52:49 | * | navinmistry quit (Ping timeout: 268 seconds) |
13:54:53 | * | navinmistry joined #nim |
13:56:49 | Zevv | I don't follow, I should probably shut up a bit. |
13:57:04 | Zevv | But my lines turn yellow when someone types 'npeg' or 'zevv' and I feel obliged to type letters |
13:57:11 | clyybber | lol |
14:00:57 | FromDiscord | <Shield> what client are you using Zevv? |
14:01:16 | * | navinmistry quit (Ping timeout: 240 seconds) |
14:01:32 | Zevv | irsi |
14:02:20 | Zevv | but to get back to the streams again: if all stream backends always support seeking back, it should be fairly trivial for me to integrate, although it only adds overhead over raw strings or memfiles. |
14:02:25 | * | navinmistry joined #nim |
14:04:19 | Araq | look man, I use 'lexbase', I know, I know, nobody likes it. but lexbase doesn't have "seek back", you can only go forward, a 8K buffer is good enough for processing unlimited length files, it's magic |
14:06:29 | clyybber | disruptek: Done, though its a bit messy |
14:06:45 | disruptek | don't tease me, brah! |
14:06:52 | Zevv | Yeah, I know lexbase of course. but this was more about the philosphy behind streams. Your 4G-file-without-4G-mem is a good reason indeed |
14:07:25 | Zevv | I have no problems with lexbase, but it does not add anything for me - I can just eat chunks of arbritary size and handle them as they come in |
14:07:26 | * | navinmistry quit (Ping timeout: 276 seconds) |
14:07:27 | clyybber | disruptek: Now I gotta test with json, but this small example works: http://ix.io/1Xa5 |
14:07:43 | shashlick | @Araq ping |
14:08:01 | Zevv | clyybber: so how did you fix that? |
14:08:42 | clyybber | I just duplicated the procs, made them {.compileTime.} put it in a when defined(js) and removed the stuff thats not working at compile time anyways. |
14:08:48 | Araq | shashlick, pong |
14:08:48 | disruptek | ugh i don't think streams should support random seek. |
14:09:03 | * | navinmistry joined #nim |
14:09:05 | shashlick | @Araq figured out the boehm issue yesterday |
14:09:07 | Araq | disruptek, they don't it's optional |
14:09:13 | Araq | :O |
14:09:14 | shashlick | https://irclogs.nim-lang.org/27-09-2019.html#01:23:18 |
14:09:17 | Araq | tell me! |
14:09:52 | shashlick | Celebrated with @disruptek yesterday |
14:10:08 | shashlick | But need to know whether we can revert that commit |
14:10:35 | Araq | I'd rather figure out where the interior pointer comes from |
14:10:48 | Araq | because in theory it's very safe to do this for ordinary Nim code |
14:11:25 | Araq | and it's a bit annoying because I actually thought about this change, never told you about it because I tought "can't be the problem" |
14:11:34 | disruptek | lol |
14:11:51 | disruptek | sorry, i shouldn't laugh, that was bloodletting right there. |
14:12:04 | Araq | 'lol' is always fine |
14:12:11 | clyybber | lol |
14:12:15 | disruptek | lol |
14:12:44 | shashlick | Can you define what would be an interior pointer in Nim |
14:13:03 | shashlick | Cause I thought boehm would work on the c implementation |
14:13:10 | shashlick | Which would have pointers all over the place |
14:13:12 | disruptek | seems to me this should happen all the time. |
14:13:16 | * | navinmistry quit (Ping timeout: 240 seconds) |
14:13:35 | Araq | Nim's native GCs don't give a shit about "interior" pointers either |
14:13:41 | Araq | it looks something like |
14:14:11 | Araq | myheapObject.p = addr(otherHeapObject.bar) # don't collect otherHeapObject itself |
14:14:11 | * | navinmistry joined #nim |
14:14:23 | clyybber | disruptek: Should FileStreams work at ct? |
14:14:31 | clyybber | Or rather, do they? |
14:14:36 | Araq | only 'addr' can produce these in Nim land |
14:14:53 | Araq | but 'addr' is unsafe and GC unfriendly and everybody knows this |
14:15:15 | disruptek | dunno about filestreams. i think not but i was able to remove them. |
14:16:41 | shashlick | They may be unsafe but this is an obscure limitation |
14:17:20 | shashlick | Since boehm does support it by default |
14:17:47 | Araq | but it slows down boehm and it's our best option for many things still |
14:17:58 | Araq | see our attempts to support threading or dlls |
14:18:01 | * | navinmis_ joined #nim |
14:18:05 | * | sealmove quit (Quit: WeeChat 2.6) |
14:18:28 | shashlick | Ok let me look at my code and see how this is impacting me |
14:18:43 | * | navinmistry quit (Ping timeout: 268 seconds) |
14:19:16 | Araq | do you use 'addr' in your code? |
14:19:23 | shashlick | For sure |
14:20:05 | Araq | :O what? why? |
14:20:14 | * | Hideki_ joined #nim |
14:22:02 | * | navinmis_ quit (Ping timeout: 240 seconds) |
14:23:47 | Araq | btw do you use thread local storage emulation= |
14:23:49 | Araq | ? |
14:24:07 | * | navinmistry joined #nim |
14:25:45 | shashlick | yes i use threads and tls |
14:25:51 | shashlick | emulation |
14:26:58 | Araq | turn off TLS emulation |
14:27:16 | Araq | emulated TLS might introduce these evil interior pointers |
14:28:13 | * | navinmistry quit (Ping timeout: 245 seconds) |
14:28:27 | shashlick | not a single use of addr is interior, mainly for interacting with C libs |
14:30:29 | Araq | course it isn't they are not common at all |
14:32:33 | clyybber | disruptek: PR is up, can you test it: https://github.com/nim-lang/Nim/pull/12284 ? |
14:33:32 | shashlick | okay i'll try without tls and get back |
14:34:50 | FromDiscord | <Shield> @shashlick how did you even find that out |
14:35:43 | shashlick | i was trying a full nim bisect between 0.19.0 and 0.20.0 |
14:35:49 | shashlick | but ran into commits that didn't work at all |
14:35:54 | clyybber | Streams seem like a perfect candidate for inheritance or concepts. |
14:36:04 | shashlick | then just thought of looking at the boehm specific changes |
14:37:05 | shashlick | who knew 1 line could torture me for 6 months |
14:37:31 | krux02 | clyybber: sorry I don't know |
14:38:17 | FromDiscord | <Shield> i thought you gave up, glad you didn't, good job |
14:38:38 | clyybber | krux02: Thanks for looking at it anyways :) |
14:38:40 | FromDiscord | <Shield> does 'addr' return an interior pointer or a start pointer? |
14:41:13 | shashlick | it depends - like Araq's example |
14:41:42 | * | Hideki_ quit (Remote host closed the connection) |
14:41:53 | disruptek | clyybber: yeah, i'll test it. |
14:42:24 | * | Hideki_ joined #nim |
14:43:10 | Araq | it's not "just one line of codd" |
14:43:18 | Araq | there is something going on we still don't understand |
14:43:19 | Araq | bbl |
14:46:36 | * | Hideki_ quit (Ping timeout: 240 seconds) |
14:46:55 | zedeus | will Nim participate in Hacktoberfest this year? |
14:47:02 | * | Perkol quit (Quit: Leaving) |
14:47:27 | disruptek | clyybber: what can i test? |
14:47:54 | disruptek | looks like stringstreams. |
14:48:36 | disruptek | my issue is that we can't importc the native json parser in js mode, though. |
14:48:50 | * | Hideki_ joined #nim |
14:49:32 | disruptek | and a yellow line: now that npeg doesn't work, i dunno what my next blocker is. |
14:50:06 | * | Hideki_ quit (Remote host closed the connection) |
14:51:27 | shashlick | nope, turning off tlsEmulation didn't help |
14:52:20 | clyybber | disruptek: Arrgh, I see |
14:53:03 | Zevv | should I type something? |
14:53:03 | disruptek | how could you not have interior pointers frequently? seems you couldn't do much pointer work at all otherwise. |
14:53:10 | disruptek | lol |
14:53:48 | disruptek | clyybber: but, stringstreams in js is certainly useful, thanks. 😊 |
14:53:54 | shashlick | that's what i think |
14:54:55 | disruptek | i mean, i wouldn't expect normal alloc to yield interior pointers, obviously, but i'd definitely expect other stuff to reach in as a matter of course. |
14:55:25 | clyybber | disruptek: Unfortunately I can't fix the json parsing, since that would require when nimvm in toplevel code, which isn't possible rn. |
14:56:11 | disruptek | it's okay; maybe we can get zevv to type something. 😉 |
14:56:18 | Zevv | tell me |
14:56:27 | Zevv | I just finished my beer |
14:56:30 | disruptek | lol |
14:56:47 | Zevv | What do I pull for the stringstreams? |
14:57:04 | disruptek | well, openapi could maybe work on js. it doesn't matter to anyone today, but maybe some day. so let's not assume going forward that npeg will never run on js. |
14:57:14 | clyybber | Zevv: https://github.com/nim-lang/Nim/pull/12284 |
14:57:59 | Zevv | clybber/strstratct? |
14:58:04 | clyybber | yeah |
14:58:15 | Zevv | you were in my remotes already |
14:58:28 | disruptek | it'll yield the same newGrammer err. |
14:58:28 | clyybber | I feel honored :) |
14:59:55 | Zevv | Ha isn't this fun. I have a t.nims and a t.nim in the same directory. Guess what happens when I do `nim c t.nim` |
15:00:36 | disruptek | i wish `nim c t` didn't append a `.nim`. |
15:02:01 | Zevv | yeah well, streams now imports, but the newGrammar .compileTime proc is still there of course |
15:02:30 | zedeus | Zevv: nim e t.nims ? |
15:02:43 | Zevv | /home/ico/external/Nim/lib/pure/streams.nim(261, 7) Error: undeclared identifier: 'copyMem' |
15:02:52 | Zevv | :) |
15:02:58 | Zevv | I'm your nimbot today |
15:03:09 | zedeus | lol |
15:03:25 | clyybber | Oh yeah. Only readLine and readChar and lines works |
15:03:39 | clyybber | Because read[T] isn't possible with the VM |
15:03:55 | clyybber | Though maybe I can make readAll work |
15:05:02 | clyybber | Ideally the VM should ignore when defined(js) I suppose |
15:06:11 | clyybber | Araq: WDYT? |
15:06:50 | * | vsantana joined #nim |
15:06:56 | Zevv | I guess there should be some other common define instead |
15:08:04 | * | Vladar joined #nim |
15:09:15 | clyybber | Zevv: There should be `when defined(jsct)` which won't be ignored by the VM |
15:09:24 | clyybber | Similarily for all other backends |
15:10:06 | Zevv | what is the 'ct' part? |
15:10:43 | clyybber | compile time |
15:12:53 | Zevv | right |
15:16:32 | * | vsantana quit (Quit: leaving) |
15:17:15 | * | abm joined #nim |
15:18:34 | * | theelous3 joined #nim |
15:20:22 | disruptek | that would work but i'm not sure that's what we want. |
15:21:18 | clyybber | disruptek: The alternative is duplicating code yay |
15:21:20 | disruptek | i haven't looked at any code, but just looking at the error message i can tell you that i dunno why i can't have importc in my compiler without regard to my backend. |
15:21:52 | disruptek | to me, that's the first define to fix. |
15:22:32 | * | couven92 joined #nim |
15:22:44 | disruptek | why do we need to know it's js ct versus any other backend ct? |
15:23:15 | disruptek | "Q programs are stored and executed as simple text files called scripts." |
15:23:16 | clyybber | disruptek: Those `when defined(jsct)` will be rare |
15:23:21 | disruptek | Q IS BLOWING MY MIND RIGHT NOW |
15:23:33 | disruptek | i don't even think they should exist. |
15:23:59 | clyybber | disruptek: They should. Sometimes they could be useful I suppose. |
15:24:14 | clyybber | But I'm not sure this can even work |
15:24:19 | disruptek | can't we just `defined(ct) and defined(js)`? |
15:24:26 | clyybber | Thats the thing |
15:24:31 | clyybber | There is no defined(ct) |
15:24:41 | clyybber | there is only `when nimvm` |
15:24:54 | disruptek | i know, but i'm saying conceptually... |
15:24:56 | clyybber | And you cant do `when defined(js) and nimvm` |
15:25:10 | disruptek | why do you want a separate ct codepath for _any_ backend? |
15:25:31 | clyybber | I don't know, but surely there is someone who wants that |
15:25:44 | * | Hideki_ joined #nim |
15:25:57 | disruptek | 👍this guy👍 doesn't want it. |
15:26:38 | FromDiscord | <moigagoo> Will Nim participate in Hacktoberfest this year? |
15:26:42 | * | couven92 quit (Ping timeout: 245 seconds) |
15:28:56 | federico3 | ah, we should |
15:34:26 | FromGitter | <awr1> what is Q |
15:34:38 | clyybber | Some APL |
15:35:48 | FromGitter | <awr1> does APL have any actual significance |
15:35:56 | disruptek | hell yeah. |
15:36:02 | FromGitter | <awr1> i know it only as the language that uses its own char set |
15:36:20 | FromGitter | <awr1> and that math people like it or something. |
15:37:20 | disruptek | it's a bit hard to describe in a sentence or two, but it's mathematically pure in that it's designed to model math in a way that is more native to that discipline. |
15:42:44 | FromGitter | <alehander42> araq |
15:42:55 | FromGitter | <alehander42> what can be redefinition of helper`gensym23434 |
15:43:02 | FromGitter | <alehander42> (not a quote, similar) |
15:43:13 | FromGitter | <alehander42> i know you changed gensym |
15:43:16 | disruptek | the idea of having pl data structures memory mapped to the fs is intriguing, i gotta say. |
15:43:21 | FromGitter | <alehander42> but i get the error from inocation of proc helper(o: JsObject): JsObject ⏎ ⏎ ``` {.importcpp: `importString`, gensym.}``` [https://gitter.im/nim-lang/Nim?at=5d8e2e19741d186e7e6766c8] |
15:43:22 | FromGitter | <alehander42> in jsffi |
15:43:29 | FromGitter | <alehander42> macro . |
15:43:39 | FromGitter | <alehander42> so its not obvious to me what is wrong |
15:43:45 | clyybber | How can I create a mutable slice? |
15:43:49 | clyybber | Of a string? |
15:43:58 | clyybber | As in a view |
15:44:28 | FromGitter | <awr1> @disruptek in the context of what |
15:44:38 | disruptek | this is why i like the idea of collection mutability as slice-based views, ditto iteration. |
15:44:58 | disruptek | i'm reading this Q overview. |
15:45:23 | FromGitter | <awr1> like in general mmap() or some kind of broader notion about working within a language |
15:45:34 | disruptek | imagine a pl where any data is persisted to disk 100% of the time. any data in memory. |
15:45:53 | disruptek | (the key innovation being that it's across the whole language) |
15:45:55 | FromGitter | <zacharycarter> will cstrings by default be nil or empty? |
15:46:25 | FromGitter | <alehander42> i think openarray |
15:46:30 | FromGitter | <alehander42> should work as a view |
15:46:32 | FromGitter | <alehander42> but not sure |
15:47:24 | disruptek | holdon, lemme just run `javascript:(function() { $('#chat-input-wrapper').remove(); $('.right-toolbar').classList.add("collapsed"); $('div .root').remove(); })();` so i can actually read the gitter web-page. |
15:48:46 | clyybber | alehander42: Yeah, it should but I can't do this `someProcThatTakesVarOpenarrayChar(somestring[1..3])` |
15:49:09 | clyybber | because string slicing copies and is immutable |
15:49:21 | * | Hideki_ quit (Ping timeout: 265 seconds) |
15:49:38 | lqdev[m] | @zacharycarter afaik it should be nil since it's merely a `char *` under the hood |
15:49:56 | FromGitter | <zacharycarter> thanks |
15:51:03 | disruptek | yes, but is it a string holding only one element, '\0', and if so is it == nil or is it merely == "" or is it merely == "\0"? |
15:51:24 | disruptek | or is it foo[] == nil? |
15:53:23 | disruptek | the answer is that an uninit'd cstring != "" but == nil and .len == 0 |
15:54:42 | disruptek | and set it to "" and the zero'th element is == 0, ('\0', so to speak) |
15:58:06 | shashlick | @disruptek - need your help - does this help describe my issue? https://github.com/nim-lang/Nim/issues/12286 |
16:00:55 | FromDiscord | <SrMordred> is possible to use allocators in nim? |
16:02:25 | clyybber | krux02: Regarding https://github.com/nim-lang/Nim/pull/10746/files#diff-26f94e9f706df25bd6d075ca5f41cf0aR365, is that for loop still neccessary for performance? |
16:02:36 | leorize | @SrMordred what do you mean? |
16:02:45 | clyybber | Or can it be replaced by a string slice |
16:04:37 | FromDiscord | <SrMordred> @leorize something like `newSeq[int, CustomAllocator]()` |
16:05:02 | leorize | that's not available yet |
16:07:29 | FromDiscord | <SrMordred> @leorize so there are plans? 🙂 |
16:07:44 | leorize | yea, allocators are part of new runtime |
16:07:55 | leorize | no documentations exist atm though |
16:09:20 | FromDiscord | <SrMordred> nice, i can wait ^^ |
16:09:43 | leorize | do you have an usecase in mind? |
16:09:46 | disruptek | shashlick: it's pretty good, but it gets fuzzy between when the data is in the table and the table gets cleared. after callbacks is setup, is it immediately operated upon to call a callback? because it doesn't look that way to me. |
16:12:07 | FromDiscord | <SrMordred> @leorize i think the most used case is arenas. but maybe nim does this internally? don´t know, i´m just a few days into nim |
16:12:17 | disruptek | look at regions. |
16:12:56 | leorize | nah, gc regions doesn't do that |
16:13:18 | disruptek | you could build it. |
16:13:44 | leorize | you can't reuse a region's memory |
16:14:06 | disruptek | so? |
16:14:15 | shashlick | @disruptek - it's not immediate but whenever it gets called |
16:14:32 | * | kevinsjoberg joined #nim |
16:14:35 | leorize | isn't arenas == memory pool? |
16:15:10 | disruptek | well, this is the problem, shashlick. ;-) can you gc log and/or put some debug in before the crash? |
16:15:27 | kevinsjoberg | Greetings! 👋 I just decided to start learning Nim. Coming from 10+ years of Ruby/JavaScript and some limited C-programming knowledge. |
16:15:43 | disruptek | welcome 😁 |
16:16:20 | shashlick | I could log when gc does it's cleanup, not sure how to intercept that |
16:16:20 | FromDiscord | <SrMordred> Welcome 🙌 |
16:16:50 | leorize | @SrMordred well there's something similar to what you'd want |
16:17:04 | leorize | nim now have pluggable GCs |
16:17:08 | shashlick | But my point is that it is a table of procs and still there seems to be interior pointers involved |
16:17:10 | leorize | the interface is not documented |
16:17:12 | disruptek | you might even do your logging outside boehm and learn what you need to know about what's happening in boehm path. |
16:17:23 | FromGitter | <zetashift> @kevinsjoberg enjoy the ride! |
16:17:36 | leorize | but here's one of those "pluggable" gcs: https://github.com/araq/araqsgc |
16:17:41 | kevinsjoberg | Thank you all. |
16:17:44 | disruptek | i know, it's a problem. |
16:18:41 | disruptek | when you can define your own region you can define you own allocator that uses that region. |
16:19:54 | FromDiscord | <SrMordred> @leorize thanks, ill take a look. |
16:19:54 | FromDiscord | <SrMordred> i can implement some simple structures to handle this anyway. just curious if there was part of the language (so i don´t have to create anything 😛 ) |
16:20:08 | FromDiscord | <SrMordred> @disruptek there are docs about this regions? |
16:20:25 | * | nif quit (Quit: ...) |
16:20:35 | * | nif joined #nim |
16:21:01 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim |
16:26:26 | * | mo87 joined #nim |
16:26:34 | FromDiscord | <treeform> I think --gc:regions are all or nothing. You can't mix existing ref counting with --gc:regions... unless you make your own region thingy with malloc. |
16:26:34 | * | mo87 left #nim (#nim) |
16:26:49 | leorize | yea, you can't mix gcs |
16:28:51 | FromGitter | <awr1> @disruptek "all data persisted to disk 100% of the time" seems to me a kind of futuristic ideal |
16:28:53 | disruptek | treeform: i'm using openapi to generate all the google stuff. |
16:29:08 | FromGitter | <awr1> contingent on the development of https://en.wikipedia.org/wiki/Universal_memory |
16:29:25 | FromDiscord | <treeform> disruptek, is it working? |
16:29:36 | FromDiscord | <treeform> do you have a github repo? |
16:29:42 | disruptek | yes, but i haven't written the request signing yet. |
16:30:05 | disruptek | see my `openapi` tree, though it won't work for you without a compiler hack. |
16:30:08 | FromDiscord | <treeform> request signing is hard, you can copy my code which I copied from some place else |
16:30:38 | disruptek | okay, i will push it today and you can add it or at least get started. |
16:31:36 | Araq | any news on shashlick's problem? |
16:31:59 | FromDiscord | <treeform> the thing with the Google APIs as they are usually so nearly, but what you want is a single thing out of them... so you write your own wrapper around whatever you need anyways. |
16:32:28 | disruptek | right, and that's kinda the design with my openapi impl. it lets you create a custom client with just the bits you want. |
16:32:35 | shashlick | @Araq - I created https://github.com/nim-lang/Nim/issues/12286 |
16:32:45 | disruptek | it's pretty low-level but it does the heavy lifting for you, in theory. |
16:32:56 | clyybber | Araq: Is it possible to patch the VM so it ignores `when defined(js)` ? So that one can use things at CT regardless of the backend you are compiling to. |
16:32:58 | shashlick | i tried without tlsEmulation, didn't help |
16:33:00 | disruptek | it needs your websocket, btw. |
16:36:18 | clyybber | disruptek, Zevv: readAll should now work at CT too |
16:36:21 | Araq | onDepends*: proc(plg: var Plugin, cmd: var CmdData) |
16:36:33 | Araq | but Plugin is a 'ref' already, suspicious |
16:36:46 | Araq | not the cause of the bug though, just a random remark |
16:37:18 | Zevv | clyybber: sweet |
16:37:21 | FromDiscord | <treeform> Araq, can you tell us more about https://github.com/Araq/araqsgc ? Will this replace --newruntime? |
16:37:33 | shashlick | i pass Plugin all over the place so ref was most sensible |
16:37:46 | Araq | shashlick: sure but then you don't need the 'var' parameter |
16:38:02 | Araq | treeform: that's the competing design |
16:38:39 | FromDiscord | <Shield> why so many designs? |
16:38:48 | FromDiscord | <treeform> because GC is hard? |
16:39:15 | leorize | memory management is never solved :P |
16:40:43 | * | nif quit (Quit: ...) |
16:40:48 | Araq | shield: well it's two new designs, the old stuff either works or is abandoned |
16:40:49 | FromDiscord | <Shield> why not have the ability to mix newruntime with gc? not everything needs to be one thing or the other, i'd rather still use gc for things that don't need fine control |
16:40:53 | * | nif joined #nim |
16:41:22 | Araq | but that's what both designs do |
16:41:56 | Araq | they use all the work that went into destructors |
16:42:05 | Araq | they disagree on what to do with 'ref' |
16:43:14 | leorize | so... what is the different between --gc:destructors and --newruntime? |
16:43:15 | FromDiscord | <Shield> isn't countref enough for them |
16:43:19 | leorize | differences* |
16:44:13 | clyybber | owned |
16:44:25 | Araq | leorize: --gc:destructors is a shared heap GC, --newruntime introduces 'owned ref' |
16:44:43 | shashlick | should be pwned |
16:44:46 | Araq | and 'owned ref' is a breaking change, it affects most libs |
16:44:54 | FromDiscord | <treeform> --gc:destructors can be used with threads? |
16:44:58 | Zevv | narimiran[m]: nice pdf render! |
16:45:04 | FromDiscord | <Shield> also instead of forcing a a whole gc collection, i would like to force an immediate collection on certain variables, something like 'reset' |
16:45:08 | Araq | treeform: yes |
16:45:30 | Araq | Shield: You just described the the GC's 'dispose' feature |
16:45:34 | leorize | in araqsgc you said the user has total control |
16:45:37 | leorize | what does that mean? |
16:45:50 | Araq | it means you need to 'collect' on your own |
16:46:17 | * | endragor quit (Remote host closed the connection) |
16:46:27 | Araq | as they are no sync-points (yet?) |
16:46:34 | clyybber | Zevv: Does that make npeg work? |
16:46:52 | Zevv | clyybber: well, not yet because of the other issue, sorry |
16:46:52 | FromDiscord | <Shield> dispose isn't even documented.. a lot of things go unnoticed because of this |
16:47:00 | FromDiscord | <treeform> Araq, so with this system you can ship your own GC? The thing I want to use is normal GC for high level and then arenas for tight loops. |
16:47:13 | shashlick | @Araq - any ideas yet? let me know if you need any more info |
16:47:28 | FromDiscord | <SrMordred> @treeform that´s what i want too |
16:47:59 | FromDiscord | <Shield> i agree with treeform |
16:49:11 | FromDiscord | <treeform> Thats similar to what C++ AAA game devs use. They use arenas for tight loops such as frames/levels and manual alloc/free for high level stuff. |
16:49:34 | FromDiscord | <treeform> They figured out how to write the fastest memory code... |
16:49:51 | clyybber | Zevv: What other issue? |
16:50:02 | Zevv | I'm privmsg you |
16:50:20 | clyybber | Araq: So WDYT about making the vm ignore `when defined(somebackend)`? Could that work? |
16:50:22 | FromDiscord | <treeform> disruptek, why does it need my websocket? The google API? |
16:51:03 | FromDiscord | <Shield> okay i checked 'dispose' and it seems that it unrefs a cell, what i want is the gc doing something like "freeing any specified variable i mark exactly when i call it, then automatically handle anything else" |
16:52:17 | * | owl_000 quit (Ping timeout: 240 seconds) |
16:52:37 | leorize | @treeform: fwiw the current gc does accumulate small allocations for a big free later on |
16:55:19 | FromDiscord | <treeform> leorize, cool |
16:58:41 | leorize | Araq: so what does --gc:destructors alone do? or do you have to use it with an external gc? |
17:05:33 | disruptek | clyybber: i think you broke something in your branch. 😢 |
17:08:02 | * | narimiran joined #nim |
17:08:47 | disruptek | yeah, i'm getting an undefined reference to some random symbol in my c code. |
17:09:12 | clyybber | disruptek: Huh, how? |
17:09:20 | clyybber | I'm not doing anything crazy afaict |
17:09:33 | disruptek | i think it's a constant of tuples of enums and strings. |
17:09:49 | disruptek | constant seq that is. |
17:10:01 | disruptek | you know i like my seqs constantly. |
17:11:14 | disruptek | it's a line that looks like this: var remainder = input.hydratePath(segments[1 ..^ 1]) |
17:11:19 | clyybber | disruptek: Can you paste me the error? |
17:12:05 | disruptek | https://gist.github.com/disruptek/13e1f9aa7dd0724f01794b7a5e0d4d58 |
17:12:07 | clyybber | disruptek: Also, you sure that broke with one of my commits? |
17:12:31 | krux02 | clyybber: regarding your comment if the for loop is stiff neccessary for performanc, I don't know what for loop you are talking about. |
17:13:29 | clyybber | krux02: I linked it here: https://github.com/nim-lang/Nim/pull/10746/files#diff-26f94e9f706df25bd6d075ca5f41cf0aR365 |
17:13:47 | clyybber | If the link doesnt work its in lib/pure/streams.nim line 365 |
17:14:25 | clyybber | After you click on the link you have to scroll up a bit (because github is retarded), it should be marked in yellow |
17:14:35 | disruptek | clyybber: your compiler can't build the compiler for me. |
17:14:50 | clyybber | disruptek: I didn't change the compiler :P |
17:14:52 | Zevv | haha |
17:15:00 | Zevv | disruptek: I just did that, so it's probably something else |
17:15:08 | disruptek | on his branch? |
17:15:24 | Zevv | yes. After that I *did* accidently check out master instaed of devel, which barfs on the 'is' thing |
17:15:28 | Zevv | but that wouldn't happen to you, right? |
17:15:34 | * | bigode10 joined #nim |
17:15:39 | disruptek | nah. |
17:16:03 | Zevv | bummer. Would be sweet if you did just that :) |
17:16:06 | disruptek | jeeze, i just did two build alls to try to be sure and they both failed and now i switched back and it works again. |
17:16:29 | disruptek | but my code still fails. |
17:16:47 | disruptek | ah, and now i can't rebuild the compiler. |
17:16:56 | disruptek | curiouser and curiouser. |
17:17:05 | clyybber | nuke the cache just in case |
17:17:46 | Zevv | leorize: find-project wants me to hit enter at startup, is that a debug thing? |
17:18:04 | disruptek | it's a test. |
17:18:38 | disruptek | clyybber: well, my code still breaks with your branch and not devel. |
17:18:59 | clyybber | the same error as before? |
17:19:05 | disruptek | yeah. |
17:20:11 | bigode10 | Does anyone here uses CentOS 6? I cannot install nim from source on that distro, koch fails to compile... |
17:20:13 | clyybber | I'm pretty sure thats not my changes |
17:20:25 | clyybber | disruptek: As you can see I only changed streams.nim |
17:21:05 | disruptek | okay, lemme update devel and see. |
17:21:18 | disruptek | i think you were ahead of me. |
17:21:21 | Zevv | bigode10: I don't have a centos running, can you dump your error logs on a pastebin somewhere? |
17:21:52 | disruptek | ah, yeah, something recent broke me. |
17:22:06 | disruptek | you're off the hook, clyybber. 😜 |
17:22:10 | clyybber | heh |
17:23:30 | leorize | Zevv: nope, that's a bug |
17:23:36 | Zevv | \o/ |
17:23:37 | leorize | how did you get it? |
17:23:44 | Zevv | Just open a nim file |
17:24:25 | leorize | I... can't reproduce? |
17:25:16 | Zevv | https://asciinema.org/a/ed4yte3tvRBqwn7r5GmrbjnaP |
17:26:05 | Zevv | hm I hit enter a too fast, but at 00:06 it stalls waiting for ENTER |
17:26:18 | krux02 | clyybber: if you can replace the for loop with something better, go ahead. I could not at the time of writing it. |
17:26:35 | leorize | Zevv: I think i know why |
17:26:42 | krux02 | a for loop iterating bytes is basically the worst thing you can have at compile time |
17:26:46 | leorize | it might be a debugging artifact |
17:27:02 | Zevv | leorize: 'k. And then the second question: how do I actually see if the finding *works*? |
17:27:08 | clyybber | krux02: Ok, imma try |
17:27:30 | leorize | Zevv: you open htop and see if nimsuggest was launched against the correct file :P |
17:27:57 | bigode10 | Zevv: The error is: fatal.nim(39) sysFatal |
17:28:00 | Zevv | :q |
17:28:22 | leorize | I should probably add a message everytime a project is spawned :P |
17:28:23 | bigode10 | How can I get a more verbose/debug error? |
17:28:52 | leorize | bigode10: can we hav the entire build log? |
17:28:52 | Zevv | bigode10: you don't get a more complete stack trace? |
17:29:13 | disruptek | don't use the d:danger or d:release switches. |
17:29:43 | bigode10 | @Zevv Nay, just that... It occurs when I run "bin/nim c koch" |
17:30:04 | Zevv | bigode10: that's nasty. Let me see if I can spawn a centos somewhere |
17:30:06 | bigode10 | The first step (compiling nim itself) runs fine |
17:30:38 | Zevv | leorize: yes, confirmed that works. I don't see any change in actual *Behaviour* though, nimsuggest seems to be hapyy for me to be launched on the wrong file, but I don't care: stuff works! |
17:31:03 | bigode10 | @Zevv Ok! Thanks for looking into it! I am running: CentOS release 6.10 (Final) |
17:32:18 | leorize | Zevv: here's a perk then: you can now get all nimsuggest features in a new file within your project without having to save it to disk |
17:32:33 | Zevv | hm dang, I wanted to use the vms at work, but there's only centos 7.2 in there these days, the recently migrated the old stuff out. |
17:32:50 | Zevv | leorize: aah, that makes sense! |
17:33:30 | Zevv | bigode10: downloading live centos 6.2 iso |
17:34:13 | bigode10 | Zevv: Ok! :) |
17:36:53 | Zevv | Ha, centos is so old it can't even connect to nim-lang.org on https |
17:37:13 | * | NimBot joined #nim |
17:38:00 | bigode10 | Yep, you need to update some ssl related stuff |
17:39:29 | leorize | Zevv: I tried to add some notifications upon starting a project so you can find out which file it started with |
17:39:34 | leorize | the message just doesn't show up |
17:40:34 | Zevv | ha |
17:41:58 | Zevv | bigode10: takes longer, live CD does not want to run properly, so need to install a vm |
17:42:54 | bigode10 | :( |
17:42:57 | bigode10 | Hmmm |
17:43:09 | bigode10 | I can create a user for you on my machine |
17:43:16 | bigode10 | If that helps... |
17:43:34 | Zevv | nah I should be ok here |
17:43:55 | bigode10 | Ok, let me know if you need anything |
17:44:06 | Zevv | and you should't trust strangers on the internet, my mommy told me! |
17:44:22 | Zevv | just giving me your front door key like that |
17:44:43 | disruptek | zevv is about as strange as they come; i don't trust him. |
17:44:47 | bigode10 | Well, it is one of my "toys" servers |
17:45:04 | disruptek | i don't trust him with my honeypot. |
17:45:04 | Zevv | i wouldn't trust me |
17:45:14 | bigode10 | Lol |
17:46:20 | bigode10 | I tend to trust people, maybe I am too naive |
17:47:48 | * | ni291187 joined #nim |
17:47:57 | * | ni291187 quit (Remote host closed the connection) |
17:48:40 | FromDiscord | <Kiloneie> I tend not to trust anyone 😛 |
17:48:53 | Zevv | I trust dogs |
17:49:00 | FromDiscord | <Kiloneie> i don't trust dogs |
17:49:06 | leorize | the last time the nim playground trusted Zevv he broke it for several months |
17:49:12 | FromDiscord | <Kiloneie> i prefer cats that don't just instantly love you |
17:49:35 | disruptek | yeah that's no cats. |
17:49:40 | bigode10 | The only people I don't trust is people that don't drink alcohol |
17:49:46 | disruptek | 'cept for this arubian woman i knew who was bi-polar. |
17:50:04 | FromDiscord | <Kiloneie> xD |
17:50:06 | disruptek | my dog doesn't like fat people. |
17:50:24 | FromDiscord | <Kiloneie> he would me, a lot of meat D: |
17:50:31 | disruptek | he hates buffering, too. |
17:50:36 | Zevv | "oh I'm so sorry madam... No, no, he only does that to fat people" |
17:50:43 | disruptek | pretty much. |
17:50:48 | FromDiscord | <Kiloneie> bones then |
17:50:56 | disruptek | he doesn't like republicans, either. |
17:51:51 | Zevv | you liead bigode10, there's a second error message! |
17:52:04 | bigode10 | Not on my side... |
17:52:06 | daddoo | okay, I've been on here for a few days and quiet until I learned "the lay of the land", but I have to ask, disruptek - how does he know? |
17:52:11 | Zevv | Error: unhandled exception: index -16 not in 0 .. 9 [IndexError] |
17:52:20 | disruptek | i think he can smell fear. |
17:52:21 | Zevv | what an utter useless crap excuse not to build koch |
17:52:22 | bigode10 | Yes, i pasted it |
17:52:27 | Zevv | oh I missed that :) |
17:52:30 | daddoo | heh |
17:52:36 | bigode10 | Dont call me a liar sir! |
17:52:41 | bigode10 | Haha |
17:52:55 | Zevv | hmm yes so now what |
17:53:18 | Zevv | folks, how do I build the csources compiler with debugging? I want a stack trace |
17:53:31 | disruptek | he's an insane dog. he watches tv avidly and gets excited when he sees any kinda animal -- not just trump, but like, cartoons, 2d images, even a stylized logo or an animal made from animated objects. |
17:53:33 | leorize | you generate a new one |
17:53:42 | disruptek | super smart doge. |
17:54:36 | Zevv | leorize: bwah |
17:56:52 | Zevv | what's the recipe for that then? |
17:57:03 | leorize | ./koch csource |
17:57:07 | Zevv | ta |
17:57:30 | Zevv | does *boom* for me |
17:57:50 | Zevv | http://ix.io/1Xb2 |
17:57:53 | Zevv | on fresh 1.0.0 |
17:58:05 | leorize | from what I can see, csource seems to be the normal compiler |
17:58:34 | Zevv | well, I'll build devel |
17:59:16 | narimiran | Zevv: are you trying to do `./koch boot`, or am i missing something? |
17:59:18 | leorize | Zevv: try grabbing the prebuilt binaries: https://nim-lang.org/install_unix.html |
17:59:38 | Zevv | And see if that can build itself on centos, right |
18:00:43 | Zevv | yeaaah dream on |
18:00:48 | Zevv | a prebuilt on a 1998 OS |
18:01:06 | Zevv | with a glibc looong past |
18:02:33 | Zevv | nope, ld-linux.so.2 and similar complaints |
18:02:52 | Araq | treeform: you can do that, yes |
18:03:08 | leorize | Zevv: want me to build you a musl-libc based one? :P |
18:03:09 | Araq | leorize: --gc:destructors only works with a custom GC, yes |
18:04:15 | Zevv | leorize: building a static |
18:04:30 | Zevv | *if* that wants to run on a 2.6 kernel |
18:04:41 | Araq | but 'ptr' exists since forever, managing memory in arenas is not hard with Nim v1, you don't need this newer fancy, undocumented stuff |
18:04:55 | leorize | Zevv: if it doesn't work I'll give you a static musl one |
18:05:17 | Zevv | this is so much fun, it's just like work |
18:05:22 | Araq | and probably I'm over-thinking it a bit. 'ptr' vs 'ref' is very well designed |
18:06:10 | Zevv | FATAL: Kernel too old. Whaaaha |
18:06:45 | disruptek | Zevv: lol |
18:07:11 | leorize | Zevv: so do you want the binary with stacktrace? |
18:07:32 | Zevv | the story is that I built a nim from csources, but this nim is not able to build nim or koch |
18:07:46 | Zevv | so I probably need csources for a debug compiler |
18:09:21 | disruptek | treeform: https://github.com/disruptek/gcplat |
18:09:41 | narimiran | ok, let me try once again with the stupid question: Zevv, wouldn't `koch temp` be enough for what you're trying to do? |
18:09:53 | leorize | he can't compile koch |
18:09:56 | Zevv | nope :) |
18:10:05 | narimiran | leorize: oh! |
18:10:08 | Zevv | but I just did a 'nim c -c compiler/nim.nim' on my own pc |
18:10:18 | Zevv | and are now copying the .cache/nim c sources to the target |
18:10:38 | leorize | lol |
18:11:04 | leorize | well I got a static nim binary now |
18:11:10 | leorize | it should work with kernel 2.6 |
18:11:17 | leorize | do you want it? |
18:11:22 | Zevv | yes please |
18:11:31 | Zevv | unless my compile succeeds in 5 seconds |
18:13:18 | leorize | there's a problem... idk where to upload this :P |
18:13:21 | Zevv | gcc 4 just ate the nim sources for breakfast! |
18:13:28 | Zevv | nevermind, progress |
18:14:13 | Zevv | what now. unknown magic might crash the compiler |
18:15:00 | Zevv | oh stuff has changed since 1.0.0 already? I can't build 1.0.0 with devel |
18:18:02 | * | sealmove joined #nim |
18:18:42 | Zevv | Sorry for all the rambling, but does http://ix.io/1Xb2 make sense to anyone? |
18:18:44 | Araq | Zevv: the CIs are green though |
18:18:55 | lmariscal | Is there a way in Nim docs to set new line like in markdown double space or latex \\? |
18:19:03 | Zevv | araq: yeah but this is on centos 6.2, is that CI'ed ? |
18:19:08 | disruptek | this is what i'm dealing with zevv. |
18:19:25 | Araq | no, your centos/gcc miscompiled Nim and then Nim fails to process system.nim |
18:19:42 | Zevv | right |
18:20:10 | Zevv | and to be clear, it's not *my* centos! I'm not touching that stuff |
18:20:30 | shashlick | Araq: do you think I should remove ref from Plugin or not use var in proc signature? |
18:20:48 | Araq | do not use 'var' in the proc signature |
18:21:06 | shashlick | any other tips? |
18:21:34 | sealmove | secret black magic |
18:21:41 | * | narimiran quit (Remote host closed the connection) |
18:22:05 | Araq | Zevv: what's the GCC version? |
18:22:33 | Zevv | 4.4.7 B.C. |
18:22:35 | Araq | lmariscal: RST has the | | | construct |
18:22:43 | Araq | 4.4.7 is ancient crap |
18:22:52 | Zevv | B.C. -> before christ |
18:23:01 | sealmove | ancient secret black magic |
18:23:31 | Zevv | But but but Lua 5.4 compiles on Turbo C 1.0! |
18:23:50 | disruptek | turbo c... i remember that. |
18:24:06 | disruptek | had the big book, the whole nine. |
18:24:07 | Zevv | https://www.youtube.com/watch?v=-jvLY5pUwic |
18:24:38 | Zevv | This is the last one I published, but it still works for 5.4 :) |
18:25:45 | lmariscal | Thanks Araq |
18:25:47 | Araq | check out an old version of C sources |
18:25:56 | * | Hideki_ joined #nim |
18:25:58 | Araq | like 0.16 or something |
18:26:08 | Araq | (yes, C sources are tagged too) |
18:26:22 | Araq | build an old Nim |
18:26:36 | Araq | and then .. I dunno, use an old Nim? |
18:26:37 | Araq | :D |
18:26:39 | Zevv | haha |
18:26:56 | Araq | or try to bootstrap through the versions... |
18:27:23 | Zevv | bigode10: Well, you heard the man. I'm not sure if it makes sense to continue from here... |
18:27:24 | Araq | but some version will produce the C sources that your GCC miscompile, so ... |
18:28:14 | Zevv | ok, one more try then, using tcc :) |
18:28:14 | FromDiscord | <treeform> I am trying to compile an older nim as I am trying to track down an issue in my code. But old nim does not want to compile this version here: 1a770402784ed99099f1905e1e4c201020e03bca says `Error: ambiguous call; both system.alloc(size: Natural) [declared in /p/Nim/lib/system.nim(2359, 10)] and system.alloc(size`gensym117652: Natural)` |
18:28:24 | FromDiscord | <treeform> Do you guys have any tips on how to compile older nim version? |
18:29:13 | FromDiscord | <treeform> Is this a problem with csrouces bering newer then the new I am trying to compile it with? |
18:29:52 | FromDiscord | <treeform> hmm csources are saying `Wed Jun 5 20:52:57 2019` so probably not that |
18:31:17 | * | Hideki_ quit (Ping timeout: 245 seconds) |
18:31:35 | shashlick | @Araq - changed all instances of `var X` => `X` where X was a ref object - still crashes |
18:34:12 | bigode10 | @Zevv Yep, thanks a lot for looking into it! I guess I will have to update my server ;) |
18:35:57 | Zevv | that's generally a good idea for anyony running centos 6.2 |
18:36:12 | * | disruptek runs for the exit. |
18:36:41 | FromDiscord | <Kiloneie> """ """ is this called 3 double quotation marks ? |
18:36:52 | disruptek | looks like six to me. |
18:37:03 | FromDiscord | <Kiloneie> so they are called quotes then |
18:37:18 | FromDiscord | <Kiloneie> my english needs more knowledge |
18:37:31 | disruptek | it's called a `triple double`, as popularized in the song. |
18:38:00 | FromDiscord | <Kiloneie> okay |
18:38:03 | FromDiscord | <Kiloneie> thanks 🙂 |
18:38:52 | * | daddoo quit (Quit: Leaving) |
18:42:09 | * | abm quit (Quit: Leaving) |
18:42:58 | clyybber | I've got a puzzle.. |
18:43:07 | clyybber | can you spot the difference? http://ix.io/1Xb7 |
18:43:23 | clyybber | http://ix.io/1Xb7/nim |
18:44:24 | FromDiscord | <Kiloneie> there isn't any |
18:44:32 | Zevv | there is |
18:44:39 | clyybber | Oh, sorry not between the snippets, between the two blocks |
18:44:42 | clyybber | lol |
18:45:10 | FromDiscord | <Kiloneie> one has nim ?... |
18:45:28 | solitudesf | between `block` statements |
18:45:28 | clyybber | <Quote> Not between the snippets |
18:45:31 | Yardanico | @kiloneie in the code itself, there are two blocks |
18:45:42 | * | bigode10 left #nim (#nim) |
18:45:52 | Araq | treeform: it's not hard but you need to use a newer version of system.nim and of alloc.nim |
18:45:58 | Araq | or an older one |
18:46:26 | Araq | shashlick: ok, but the code is better now :P |
18:46:35 | FromDiscord | <treeform> Araq, but I am using the one that comes from git at that version? |
18:46:39 | * | exelotl joined #nim |
18:47:17 | Araq | are you? |
18:47:31 | Araq | but your Nim is too new, new Nim binary is picky |
18:47:48 | Araq | a new Nim cannot compile an old Nim, an old Nim can usually compile a newer one |
18:48:06 | FromDiscord | <Kiloneie> Yeah im not qualified to answer that. |
18:48:08 | FromDiscord | <treeform> I don't think it using choosenim version |
18:48:20 | FromDiscord | <treeform> I am just using github and csource which is Jan build? |
18:48:34 | Araq | I don't know what you use |
18:48:35 | shashlick | @Araq - okay, was super easy with nimgrep |
18:48:39 | clyybber | Zevv: But should there be? |
18:49:15 | Araq | shashlick: anyway, did you try to set the envvar to influence boehm? |
18:49:25 | shashlick | that didn't work for me - i did try |
18:49:38 | Araq | but changing that one line did the trick? |
18:51:11 | Araq | treeform: https://nim-lang.org/download/nim-$version.tar.xz unpack, build it, success. the tarballs only depend on GCC and stuff |
18:51:38 | Araq | and ship with C sources that work |
18:51:48 | FromDiscord | <Kiloneie> Man my english teaching of programming gets me lost so hard so fast that i make a ton of mini clips xD... i got like 19 for 4-5 minutes of video and i got over a full page of A4 long of a script D: |
18:51:53 | Araq | that's how I build old Nim versions and it never failed me |
18:52:03 | FromDiscord | <treeform> got it |
18:52:13 | FromDiscord | <treeform> My goal is to find which git commit broke my code. |
18:52:44 | Araq | oh not this again |
18:52:59 | Araq | it's "von hinten durch die Brust ins Auge" |
18:53:22 | Araq | just tell me your problem, it's likely I can tell you how we broke it |
18:53:48 | shashlick | Yes changing one line was enough to get everything working |
18:54:21 | Araq | shashlick: windows specific problem? |
18:55:21 | FromDiscord | <treeform> Araq, I am hitting this error in in ccgexprs.nim internalError(p.config, n.info, "expr: param not init " & sym.name.s & "_" & $sym.id) |
18:55:34 | FromDiscord | <treeform> Araq, i have a ton of nested templates |
18:56:02 | Araq | treeform: my gensym fixes. does --oldgensym:on work? |
18:56:04 | * | al_ joined #nim |
18:56:12 | FromDiscord | <treeform> https://gist.github.com/treeform/9c981ce4b549dcac7558d00a04bdeafc |
18:56:22 | FromDiscord | <treeform> I'll try --oldgensym:on |
18:57:37 | FromDiscord | <treeform> Yes --oldgensym:on does work. |
18:58:25 | shashlick | No way to tell since the app is only for Windows |
18:58:35 | shashlick | Though the plug-in system should work on Linux as is |
18:58:51 | Araq | it's my commits to compiler/evaltempl.nim compiler/semtempl.nim |
18:59:19 | shashlick | If I ref object has a ref object as one of its fields why wouldn't that be an interior pointer from boehm's perspective |
18:59:19 | FromDiscord | <treeform> Looking at https://nim-lang.org/docs/manual.html#templates-hygiene-in-templates |
18:59:21 | Araq | but given that no bugs are known for the new gensym handling, we're in a world of fun |
18:59:29 | FromDiscord | <treeform> so I need to {.inject.} to get it to work |
19:00:17 | Araq | shashlick: because the pointer does not *point* inside a different object |
19:00:30 | Araq | it points to the beginning of the object |
19:00:42 | Araq | there is no other way unless you use addr/unsafeAddr |
19:01:05 | Araq | treeform: sure but the compiler shouldn't crash :-/ |
19:02:06 | disruptek | right, the gc doesn't know anything about the hierarchial structure of the data in your code. it just has blobs of memory. that's why i don't understand how you could do any pointer work and not end up pointing to an interior unsafely. |
19:02:06 | Araq | shashlick: interior pointers are not "oh inside some other object", interior pointers point into the middle of some other object |
19:02:46 | disruptek | i guess it's possible that none of those values are known to the gc though. |
19:05:27 | FromGitter | <Varriount> shashlick: What's nimarchive? |
19:06:55 | * | laaron joined #nim |
19:08:58 | * | laaron quit (Client Quit) |
19:11:56 | * | teimosso joined #nim |
19:14:13 | * | laaron joined #nim |
19:19:52 | * | nsf quit (Quit: WeeChat 2.5) |
19:19:56 | * | laaron quit (Ping timeout: 260 seconds) |
19:20:19 | * | skoude joined #nim |
19:21:00 | shashlick | So I don't have any addr calls araq |
19:21:09 | shashlick | I'm not sure what to look for |
19:21:33 | shashlick | @Varriount: it is a wrapper for libarchive |
19:22:45 | shashlick | @Araq so your point is that this shouldn't affect me unless we do pointer arithmetic |
19:23:16 | shashlick | But I presume the generated c code doesn't do that either |
19:24:36 | * | skoude quit (Ping timeout: 240 seconds) |
19:24:50 | * | clyybber quit (Quit: WeeChat 2.6) |
19:25:41 | FromDiscord | <treeform> @Araq, thank you with your help I fixed my code. I was making proc inside a template (for encapsulation only) which made a generated a ton of procs. I moved the proc outside the template - everything works. I tried to make a minimal example but I can't make it happen on a minimal example. |
19:28:36 | * | rayman22201 joined #nim |
19:29:57 | Yardanico | wow https://twitter.com/github/status/1177614249754972160 |
19:30:04 | FromDiscord | <exelotl> :O |
19:30:08 | Yardanico | (github retweeted nim's 1.0 tweet) |
19:32:45 | rayman22201 | oh dang! That's big. cool |
19:35:45 | FromGitter | <zetashift> first reaction is "@CrystalLanguage will follow soon :)", that's not cool. |
19:35:57 | FromGitter | <zetashift> However still glad it got tweeted by github |
19:45:06 | FromDiscord | <exelotl> hey, so as far as I remember, this kind of macro will work across modules https://play.nim-lang.org/#ix=1Xbm |
19:45:45 | FromDiscord | <exelotl> will that still be the case with incremental compilation enabled? |
19:46:25 | disruptek | microsoft azure apis https://github.com/disruptek/bluu |
19:47:54 | * | Jesin quit (Quit: Leaving) |
19:51:04 | * | al_ quit (Quit: al_) |
19:51:52 | * | nsf joined #nim |
19:53:58 | Araq | exelotl: yes but you need to use the macrocache lib |
19:54:44 | shashlick | @Araq - what next? i can work with a custom nim but we need to understand what's going on here |
19:55:02 | shashlick | else boehm won't be as useful to everyone |
19:57:05 | FromDiscord | <exelotl> ah, thanks |
19:57:23 | * | Jesin joined #nim |
19:57:36 | Araq | shashlick: we can undo it and ship it for 1.0.2 |
19:57:52 | Araq | but I'm still thinking what the cause might be |
19:58:06 | shashlick | okay I'll leave you alone for some time, will use the workaround for now |
19:58:16 | shashlick | there's an issue to remind us |
19:58:20 | Araq | do you use channels? |
19:58:25 | shashlick | no |
19:58:35 | Araq | really? |
19:58:44 | FromDiscord | <treeform> dispruptek, it looks like a lot of the API's you just pass JSON to it? Example: https://github.com/disruptek/gcplat/blob/master/src/gcplat/bigquery_v2.nim#L3228 Is this expected? |
19:58:47 | Araq | but you do use threads:on |
19:59:03 | shashlick | i use shared objects |
19:59:54 | FromDiscord | <treeform> dispruptek, in theory call calls could just be call(url, json) ? Where you draw the line at this is json and this is not json? |
20:00:43 | FromDiscord | <treeform> dispruptek, i guess, expected nim objects that are typed checked then passed to the calls that turns to json on the inside. |
20:01:33 | * | sschwarzer joined #nim |
20:01:47 | shashlick | @Araq - do you think a table of procs makes any difference? |
20:01:57 | disruptek | not sure what you mean, but there are generally (at least) two forms of call: one with json inputs, and one with native inputs. |
20:02:12 | disruptek | both are typechecked. |
20:02:12 | sschwarzer | Hi, I know I'm a bit late, but congratulations on version 1.0! You made it! Thank you. :-) |
20:02:23 | Araq | sschwarzer: oh thanks! |
20:03:21 | Zevv | clybber: what exactly is your problem with the two-block snippet? The second one is different, s[c..<b] is s[1..<1], which ends up as nothing, right? So you just throw out b[0], leaving an empty string |
20:03:28 | disruptek | but atoz might be a better source of examples; the gcp and azure apis are just temporary until i add signing and start to deconstruct everything. ie. nim object types are gonna go in; you can see them in the openapi code... |
20:05:56 | FromDiscord | <treeform> disruptek, oh I see the two calls now. In my experience google API wants these big deep nested objects. I just want to see where the object are 🙂 |
20:07:56 | disruptek | yeah, it's part of a progressive rendering that i'm finishing in openapi. i just want to make sure it works for all swagger definitions first. |
20:07:59 | FromDiscord | <Kiloneie> Here i go again !: https://youtu.be/a0qAcCC_Mhk |
20:08:33 | disruptek | for example, azure uses objects with names that aren't valid nim identifiers, etc. |
20:11:39 | FromDiscord | <Kiloneie> I wanted to keep recording, it felt like i made a 3-4 minute video xD, guess i was wrong. It's getting easier and easier making these(besides Da Vinci Resolve giving me headaches) |
20:20:43 | rayman22201 | have you heard of this @kiloneie? https://owickstrom.github.io/komposition/ |
20:21:02 | rayman22201 | I don't make videos, but it looks like neat software. I've wanted to try it. |
20:23:28 | disruptek | treeform: which gcp api do you need specifically, and can you point me at what you have for the auth flow? |
20:28:18 | * | Hideki_ joined #nim |
20:28:37 | FromDiscord | <moigagoo> Is it possible to add a default value for DateTime type? Because it doesn't, I can't have Option[DateTime] without the "Cannot prove is initialized" warning, even if it's none DateTime. |
20:29:12 | FromDiscord | <moigagoo> If it's doable, I'd like to submit a PR during Hacktoberfest 🙂 |
20:29:44 | * | solitudesf- joined #nim |
20:31:12 | FromDiscord | <Kiloneie> i seen a part that he could drop silent parts, that seems useful, other than that it's 0.01% of what Da vinci resolve is |
20:31:28 | FromDiscord | <Kiloneie> da vinci is massive... i don't think i will ever learn it all... |
20:32:26 | * | Hideki_ quit (Ping timeout: 240 seconds) |
20:32:37 | * | solitudesf quit (Ping timeout: 240 seconds) |
20:32:43 | rayman22201 | I understand. I used to do a lot of work with Adobe Premiere and Adobe After Effects in another life. You might not need all 99% of it. Which is kind of the point of specialized software. |
20:33:41 | FromDiscord | <Kiloneie> yeah, will give it a try |
20:34:54 | * | Vladar quit (Remote host closed the connection) |
20:34:59 | rayman22201 | no pressure though. I just thought it was neat software :-P at the end of the day, you have to use what ever works best for you :-) |
20:35:52 | FromDiscord | <Kiloneie> yep, and whatever can help speed my process up is appreciated. i don't like making micro edits because i make delays in some parts talking |
20:36:09 | FromDiscord | <Kiloneie> i do that... i make micro scopic edits xD |
20:36:18 | FromDiscord | <Kiloneie> like 0.1 seconds and all |
20:37:35 | rayman22201 | lol. Yeah. It's easy to get sucked in to trying to make the frame-perfect cut. |
20:38:40 | FromDiscord | <Kiloneie> i don't wanna prolong the video unnecessarily, if i can cut 20 seconds like that, that's good |
20:39:00 | Araq | moigagoo: maybe if you change Option[T] to use a case object inside |
20:39:01 | FromDiscord | <Kiloneie> usually i just do 0.5 cuts in between talkings, sometimes i lose my words |
21:05:52 | * | daddoo joined #nim |
21:16:43 | * | sschwarzer quit (Quit: leaving) |
21:24:53 | * | Serrellanos quit (Ping timeout: 245 seconds) |
21:48:53 | * | solitudesf- quit (Ping timeout: 268 seconds) |
21:58:51 | FromGitter | <alehander42> https://github.com/alehander42/Nim/blob/nilcheck-spec/doc/nilcheck.rst |
21:59:59 | FromGitter | <strokirk> Hi, is there any good guide on handling `nil` types and working with JSON data? I'm getting a lot of errors that I can't really figure out https://play.nim-lang.org/#ix=1XbX |
22:00:00 | FromGitter | <alehander42> Araq : i updated with the `proc` and other fixes |
22:00:21 | FromGitter | <alehander42> and sketched of the initialization section |
22:00:48 | FromGitter | <strokirk> The compiler doesn't seem to warn when I try to echo something that can be potentially `nil`. Is there any type annotation I can manually add to get that kind of check? |
22:00:50 | FromGitter | <alehander42> but i need to understand if my todo list seems right |
22:01:32 | FromGitter | <alehander42> @strokirk i am just working on a spec for the last thing (non-nilable vs nilable types) |
22:01:55 | FromGitter | <strokirk> Ah, lovely. |
22:01:59 | FromGitter | <alehander42> currently you can use `Typename not nil` in some cases for some ref objects |
22:02:05 | disruptek | nil is the absence of a reference; a valid value for JsonNode, since it's a ref. an empty JObject isn't nil, but a JNull node isn't either -- it's a representation of JSON's `null` value. |
22:02:11 | FromGitter | <alehander42> but most of the checking is still todo |
22:02:33 | Araq | alehander42: I don't understand how "procedures" can be locations |
22:03:33 | FromGitter | <strokirk> @disruptek: Ah, that makes sense. So you need to be careful. I noticed it's not possible to catch nil referencing errors with try-catch, is there some other idiom to use there? |
22:03:51 | disruptek | sure; `if somevariable != nil: ...` |
22:03:55 | Araq | don't you dare, don't catch bug, avoid bugs |
22:03:56 | FromGitter | <alehander42> that's right, i should just mention them in the "what is dereference" list |
22:04:07 | FromGitter | <strokirk> (I come from a Python background and usually work with pretty sketchy data so error management is important to me. Very long time since I did any C....) |
22:04:16 | Araq | "if, while, case, and, or" |
22:04:21 | Araq | ^ not for 'case' |
22:04:43 | FromGitter | <alehander42> well, in my previous PR i had a bit contrived |
22:04:45 | FromGitter | <alehander42> test case |
22:04:56 | FromGitter | <alehander42> i think it was `case a.isNil: of true: .. of false: ..` |
22:05:02 | rayman22201 | @strokirk, or check if the key is in the table: https://play.nim-lang.org/#ix=1XbY |
22:05:35 | disruptek | well, no point in {} in that case -- just use []. |
22:05:36 | FromGitter | <strokirk> @Araq: While I can appreciate that, when it comes to JSON you can't trust the source data so you have to catch the bugs rather than "avoid" them. |
22:05:54 | disruptek | exceptions should be exceptional, not normal control flow. |
22:06:10 | disruptek | in contrast to python... |
22:06:29 | * | Slagar joined #nim |
22:06:40 | FromGitter | <alehander42> @strokirk do you have many missing values, or do you have many actual `null` json values ? |
22:06:58 | Araq | strokirk: the json api compensates for that |
22:07:25 | FromGitter | <strokirk> Missing, as in I'm not trusting the APIs I'm calling to return consistent data structures (and I want to return as good an error log as possible) |
22:07:42 | Araq | newSeqWithInit(length): |
22:07:42 | Araq | Object(a: it) |
22:07:52 | Araq | alehander42: don't introduce this, it's not necessary |
22:08:05 | Araq | don't add features before the need arises |
22:08:32 | FromGitter | <strokirk> @disruptek: I'm not really concerns if it's exceptions or nil checks or whatever, as long as I can quit gracefully (or recover from the error). |
22:08:33 | FromGitter | <alehander42> well, the json api should raise an exception e.g. if you use [], or you can use getOrDefault if a default exists |
22:08:46 | FromGitter | <alehander42> Araq, well this fixes several sequtils |
22:09:01 | FromGitter | <alehander42> methods without needing `unsafeDefault` iirc |
22:09:14 | Araq | but so does unsafeDefault which you *also* added anyway |
22:09:15 | FromGitter | <strokirk> @disruptek: As long as you can get helped by the type system both approaches are good in my book |
22:09:20 | disruptek | just stay away from exceptions when they aren't absolutely necessary, which is practically never imo. |
22:09:24 | FromGitter | <alehander42> i think you added it :P |
22:09:34 | Araq | exactly |
22:09:43 | FromGitter | <alehander42> well, i'd say newSeqWithInit is fully safe |
22:09:51 | FromGitter | <alehander42> and unsafeDefault is *the* escape hatch |
22:09:58 | FromGitter | <alehander42> but i agree its a bit on the edge |
22:10:01 | Araq | and even that is probably overkill, 'default' already exists and can be documented to produce 'nil' |
22:10:02 | disruptek | you will find yourself doing this: assert foo != nil and foo.kind == JString, "i expected a string but..." |
22:10:05 | FromGitter | <strokirk> @disruptek: Any reason why? If the code you're calling throws them you don't really have a choice, right? |
22:10:16 | disruptek | what code throws them? |
22:10:39 | disruptek | parseJson is the only thing you need to catch. |
22:10:42 | FromGitter | <alehander42> @strokirk exceptions vs errors is a big ideological battle, everybody has his own opinion on that |
22:10:53 | rayman22201 | @strokirk, use `[]` instead `{}` in your case, as @disruptek was saying. It will behave more as you expect. |
22:10:56 | FromGitter | <alehander42> Araq, maybe that's true |
22:11:00 | FromGitter | <strokirk> @disruptek: JsonNode[] for example https://nim-lang.org/docs/json.html#%5B%5D%2CJsonNode%2Cstring |
22:11:21 | disruptek | if you are going to handle the case where the key is missing, then you may as well just handle it without an exception. |
22:11:23 | FromGitter | <strokirk> @alehander42 Sure, just asking for clarification. |
22:11:24 | Araq | alehander42: but it's really good work, don't get me wrong |
22:11:39 | Araq | it's my job to cut out 50% of it |
22:11:48 | disruptek | if key in node: ... node[key] ... else: ... key ain't in the node! |
22:12:03 | Araq | node.getOrDefault(key, ...) |
22:12:04 | FromGitter | <strokirk> Sure, much cleaner. |
22:12:12 | Araq | the {} accessor |
22:12:18 | Araq | learn the API. |
22:12:35 | rayman22201 | the {} does a bit too much magic imo |
22:12:37 | disruptek | foo = node{key} ... if foo != nil: ... i found it |
22:12:38 | FromGitter | <strokirk> @Araq There's rarely a default in the cases I'm experimenting right now |
22:12:42 | Araq | plenty of people used it in anger and it never failed them. exception: disruptek |
22:12:56 | FromGitter | <strokirk> But `in` works perfectly, I'm kind of facepalming I didn't try that right away... |
22:13:01 | FromGitter | <alehander42> i just see <withInit> as a natural extension of the shrink/grow idea : ⏎ ⏎ we cut setLen into shrink and grow, because shrink is safe ⏎ we cut grow into (growWithLoop or growWithInit) and just grow + default, because growWithLoop is safe ⏎ we keep the last thing because no choice [https://gitter.im/nim-lang/Nim?at=5d8e896c428cda40131c1992] |
22:13:05 | disruptek | i am probably one of the heaviest users of json, honestly. |
22:13:06 | rayman22201 | in is very python-y lol |
22:13:28 | Araq | alehander42: new runtime already has 'grow' and 'shrink' |
22:13:45 | Araq | disruptek: tried my packedjson? |
22:13:54 | disruptek | pointless for me. |
22:14:02 | FromGitter | <strokirk> @disruptek: Thanks for the examples! |
22:14:09 | Araq | hmm fair enough, I guess |
22:16:24 | FromGitter | <strokirk> @ rayman22201: Thanks for your fiddle-link, that explains why I got errors earlier. Missing import... Was a bit unclear from the error message. As soon as I added `import tables` I could call `j.getEntries()` |
22:16:33 | disruptek | strokirk: lotsa examples of json validation in this tree: https://github.com/disruptek/atoz/blob/master/src/atoz/s3_20060301.nim -- all of this is use of the json api that was written by macros. |
22:17:20 | rayman22201 | ah, sorry, I should have mentioned the import. I did that almost on instinct! you need to import `tables` to get the `$` tostring operation for tables. |
22:17:24 | FromGitter | <strokirk> @disruptek: Thanks, I'll look into it. Validation is important! |
22:17:49 | FromGitter | <strokirk> And echo does tostring / `$` by default, right? |
22:17:53 | rayman22201 | yes |
22:18:05 | FromGitter | <strokirk> Lots of vocabulary to learn when trying out a new language. :) |
22:18:32 | FromGitter | <alehander42> Araq, but if we dont have newSeqWithLoop by default, maybe it still makes sense to add `unsafeDefault` , similarly to the other `unsafe`-s: |
22:19:09 | FromGitter | <alehander42> as there would be more cases where we would have to trust the programmer to fill his seq-s |
22:19:25 | disruptek | exceptions are not purely ideological: https://github.com/nim-lang/Nim/issues/11081 |
22:20:25 | Araq | bugs are not ideology |
22:20:56 | disruptek | i appreciate your agreement. |
22:21:14 | FromGitter | <strokirk> Error management have many paths, though. |
22:21:18 | * | traviss joined #nim |
22:21:25 | * | Travis__ joined #nim |
22:21:25 | * | Travis__ quit (Client Quit) |
22:22:21 | Araq | disruptek: as I keep saying, I don't like exceptions but so far nothing better was proposed, except maybe my own "quirky" variant of it but the last thing Nim needs is yet more controversial features |
22:22:29 | * | traviss quit (Client Quit) |
22:22:49 | * | traviss joined #nim |
22:23:16 | disruptek | i don't disagree, but that doesn't mean i don't think the use of exceptions as they sit isn't controversial. i don't think people should use them, period. i expect that you disagree. we can agree this is controversy, right? |
22:23:41 | Araq | Rust is full quit() calls instead that do stack unwinding to cleanup resources ... which is exception handling as far as I'm concerned |
22:23:55 | disruptek | i like quirky. i even like alloc-free exceptions. but i don't like #11081 and you won't change my mind easily. |
22:24:09 | disruptek | i like quit() too. it hasn't failed me yet. |
22:24:25 | Araq | disruptek: 1. I will try to fix 11081 |
22:24:50 | Araq | 2. we don't disagree at all, I also think people shouldn't use exceptions :-) |
22:25:02 | disruptek | i think that would make it much easier for me to go to bat for you. 😉 |
22:25:03 | rayman22201 | #11081 is obviously a codegen bug in cpp? right? all philosophical stuff aside. |
22:25:31 | disruptek | i don't want to tell people not to use exceptions. i only feel i must warn them. |
22:25:50 | * | Kaivo quit (Quit: WeeChat 2.6) |
22:26:04 | * | traviss quit (Client Quit) |
22:26:21 | * | traviss joined #nim |
22:26:27 | * | Travis__ joined #nim |
22:27:05 | Araq | rayman22201: I don't even know what kind of bug it is, it's strange |
22:27:14 | disruptek | also, quirky doesn't need to be controversial in the same way that other features co-exist and aren't controversial, such as different gc, newruntime, etc. |
22:27:34 | rayman22201 | lol. Well, it sure as hell shouldn't segfault, whatever it does :-P |
22:27:49 | disruptek | it's pretty uncomfortable, isn't it? |
22:28:06 | * | asymptotically quit (Quit: Leaving) |
22:28:32 | Araq | make newruntime the default with its "dangling ref detected, quitting" and watch it become controversial |
22:29:17 | * | traviss quit (Client Quit) |
22:29:17 | * | Travis__ quit (Client Quit) |
22:29:18 | disruptek | well i can see that getting exciting. |
22:29:30 | disruptek | fair point. 🤣 |
22:29:33 | * | traviss joined #nim |
22:29:55 | * | Traviss__ joined #nim |
22:32:50 | FromGitter | <alehander42> ok Araq updated with more visible examples and less features |
22:33:41 | FromGitter | <alehander42> preserving the additional features in a `nilcheck_maybe.rst` to make me feel well |
22:33:49 | Araq | „case can be used as well“ no, it’s silly, nobody uses it |
22:34:17 | FromGitter | <alehander42> well technically you can write such an example |
22:34:24 | FromGitter | <alehander42> and it would lead to a segfault |
22:34:31 | Araq | technically I don't care |
22:34:33 | FromGitter | <alehander42> i guess the cfg deals well with `case` anyway |
22:35:36 | Araq | case a.isNil: |
22:35:36 | Araq | of true: |
22:35:36 | Araq | discard |
22:35:38 | Araq | of false: |
22:35:40 | Araq | echo a.a # doesn’t compile, use an if statement you hippie |
22:35:54 | * | daddoo quit (Quit: Leaving) |
22:35:55 | Araq | however |
22:36:01 | Araq | what about: |
22:36:07 | Araq | if x == nil: return |
22:36:17 | Araq | use x[] everywhere else |
22:36:40 | FromGitter | <alehander42> yes, this should be written down as well |
22:37:00 | Araq | I think this edge case should be decided by the implementation |
22:37:09 | Araq | with the CFG it'll be easy though |
22:37:22 | FromGitter | <alehander42> well, it doesn't feel like an edge case to me: and i did support it in the ast-based impl as well |
22:37:30 | FromGitter | <alehander42> so it shouldn't be so hard |
22:37:39 | Araq | anyway this is getting good enough for an RFC and then people can vote about the syntax and whether we should do it |
22:37:53 | FromGitter | <alehander42> one can easily auto-insert else for the other section for this analysis |
22:43:18 | Araq | ok, so add it to the spec |
22:43:52 | FromGitter | <alehander42> ok, i did |
22:43:57 | Araq | I wanted to suggest you show how a red-black-tree-rotation would look like with these rules |
22:44:12 | Araq | but with .nilChecks: off it's pointless |
22:44:12 | * | nsf quit (Quit: WeeChat 2.5) |
22:44:30 | Araq | for heavy pointer stuff I can disable it. but shouldn't |
22:44:53 | FromGitter | <alehander42> 1) a specific "If we do a check in a e.g. if, the other branches (e.g. else) assume the opposite fact about the nilability of a value." i wanted to explained it with a "fork" but it's too low level |
22:45:00 | FromGitter | <alehander42> anyway |
22:45:14 | Araq | true |
22:45:57 | FromGitter | <alehander42> the nilCheck pragma would work as a normal pragma, right? on a function level, push-able and on a module level |
22:46:10 | FromGitter | <alehander42> what i wonder is should it work on a block level |
22:46:18 | FromGitter | <alehander42> e.g. `{nilCheck:off}: some code` |
22:46:32 | FromGitter | <alehander42> eh + {. .} |
22:47:00 | FromGitter | <alehander42> it's another escape hatch basically |
22:50:21 | Araq | just another pushable pragma |
22:50:31 | Araq | but it's not important, I don't expect it to be used much |
22:50:43 | Araq | the rules we have are really good |
22:51:37 | FromGitter | <alehander42> ok |
22:51:38 | FromGitter | <alehander42> https://github.com/alehander42/Nim/blob/nilcheck-spec/doc/nilcheck.rst#initialization-of-non-nilable-pointers |
22:51:50 | FromGitter | <alehander42> mostly this section remains not really finished |
22:53:18 | * | Serrellanos joined #nim |
22:56:08 | * | Serrellanos quit (Client Quit) |
22:56:53 | Araq | they are, but you need to remove the TODO |
22:57:04 | Araq | it's precisely what must happen |
23:00:38 | FromGitter | <alehander42> i rewrote them |
23:00:49 | FromGitter | <alehander42> ops, now i did |
23:00:58 | * | Hideki_ joined #nim |
23:01:08 | FromGitter | <alehander42> to order them a bit better and remove unsafeDefault |
23:01:18 | FromGitter | <alehander42> ok, i can put this in the RFC repo i guess |
23:04:36 | Araq | cool |
23:05:33 | FromGitter | <alehander42> oh man i can write rst in issues |
23:05:37 | FromGitter | <alehander42> cant* |
23:05:46 | FromGitter | <alehander42> i guess i have to PR it then |
23:11:17 | rayman22201 | ^ this is another cool feature I didn't even know was being worked on. |
23:16:39 | FromGitter | <alehander42> https://github.com/nim-lang/RFCs/pull/169/files |
23:16:50 | FromGitter | <alehander42> https://github.com/nim-lang/RFCs/pull/169/ * |
23:16:52 | FromGitter | <alehander42> ok |
23:17:38 | Araq | rayman22201: after we released 1.0 I thought "wait a sec, we can detect an ExecuteScriptingLayer effect but can't get 'nil' right..." |
23:17:58 | Araq | "that's just so wrong..." |
23:20:50 | * | krux02_ joined #nim |
23:21:00 | rayman22201 | I agree. It also appeals to my "screw the Rust people" feelings :-P |
23:23:07 | FromGitter | <alehander42> to be perfectly honest, i expect i might still use sometimes nilable ref-s purely as an `option` alternative |
23:23:18 | FromGitter | <alehander42> but it be safe usage |
23:23:38 | * | krux02 quit (Ping timeout: 245 seconds) |
23:24:17 | FromGitter | <alehander42> would be * |
23:24:30 | Araq | good night |
23:28:44 | rayman22201 | gn |
23:29:39 | FromGitter | <alehander42> good night |
23:30:53 | * | Traviss__ quit (Quit: Leaving) |
23:31:10 | * | Traviss__ joined #nim |
23:38:49 | sealmove | curious about this: https://github.com/nim-lang/Nim/issues/12287 |
23:39:08 | * | krux02_ quit (Remote host closed the connection) |
23:54:54 | sealmove | !eval system.Inf |
23:54:56 | NimBot | Compile failed: /usercode/in.nim(1, 7) Error: expression '0x0000000000000000'f64' is of type 'float64' and has to be discarded |
23:55:24 | sealmove | !eval system.Inf == 0.0 |
23:55:26 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: expression 'false' is of type 'bool' and has to be discarded |
23:56:00 | sealmove | !eval echo system.Inf == 0'f64 |
23:56:03 | NimBot | false |
23:56:59 | * | traviss quit (Quit: Leaving) |
23:56:59 | * | Traviss__ quit (Quit: Leaving) |