00:01:03 | * | lf-araujo quit (Ping timeout: 252 seconds) |
00:01:44 | shashlick_ | @Araq: https://gist.github.com/genotrance/b835bd9318dadb7541c0db5d9fe45ec7 |
00:35:07 | dom96 | djazz: Why did you have to do this for Celeste? |
00:36:07 | dom96 | Zevv: maybe you'd like to put that nim memory into an article for nim-lang.org? :) |
00:46:36 | * | envoyt joined #nim |
00:50:39 | FromDiscord_ | <djazz> dom96: Celeste is a fun and quite known game! |
00:51:30 | FromDiscord_ | <djazz> Why not? |
00:51:31 | dom96 | Yes, I know. But why did you need to process its assets? |
00:51:36 | dom96 | or why did you want to? |
00:52:15 | FromDiscord_ | <djazz> RPi3 cant handle Celeste's 4096x4096 texture atlases |
00:52:36 | FromDiscord_ | <djazz> Rpi3 supports max 2048x2048 |
00:52:50 | FromDiscord_ | <djazz> So I had to repack them |
00:54:56 | FromDiscord_ | <djazz> Sorry I misread your first question |
00:54:59 | FromDiscord_ | <djazz> I need sleep |
00:55:05 | FromDiscord_ | <djazz> 3 am here now .. |
01:10:06 | * | lritter quit (Ping timeout: 258 seconds) |
01:47:46 | * | oculuxe joined #nim |
01:48:49 | * | oculux quit (Ping timeout: 258 seconds) |
01:55:02 | * | Senketsu_ joined #nim |
01:58:12 | * | Senketsu quit (Ping timeout: 272 seconds) |
02:00:19 | * | envoyt quit (Ping timeout: 258 seconds) |
02:00:35 | * | Snircle quit (Read error: Connection reset by peer) |
02:01:27 | * | Snircle joined #nim |
02:03:52 | * | JStoker quit (Read error: Connection reset by peer) |
02:04:44 | * | mrgaturus joined #nim |
02:10:26 | * | mrgaturus quit (Remote host closed the connection) |
02:13:56 | * | JStoker joined #nim |
02:34:56 | * | theelous3_ joined #nim |
02:35:02 | * | theelous3 quit (Ping timeout: 245 seconds) |
02:38:21 | * | sagax quit (Ping timeout: 244 seconds) |
02:40:25 | * | steshaw joined #nim |
02:45:20 | * | laaron- joined #nim |
02:47:52 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:48:52 | * | leorize quit (Ping timeout: 260 seconds) |
02:49:35 | * | leorize joined #nim |
03:20:01 | * | vlad1777d__ quit (Ping timeout: 248 seconds) |
03:45:06 | * | theelous3 joined #nim |
03:49:37 | * | theelous3 quit (Ping timeout: 245 seconds) |
03:58:33 | * | laaron- quit (Remote host closed the connection) |
04:00:31 | * | laaron joined #nim |
04:00:58 | * | actuallybatman joined #nim |
04:10:30 | * | laaron quit (Remote host closed the connection) |
04:10:56 | * | laaron joined #nim |
04:28:12 | * | dddddd quit (Read error: Connection reset by peer) |
04:54:31 | * | brett-soric joined #nim |
05:09:11 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:39:27 | * | hoijui joined #nim |
05:40:10 | * | brett-soric left #nim (#nim) |
05:45:42 | * | hoijui quit (Ping timeout: 252 seconds) |
05:52:51 | * | jmiven quit (Quit: co'o) |
05:53:37 | * | jmiven joined #nim |
05:53:38 | * | brakmic joined #nim |
05:58:04 | * | brakmic quit (Read error: Connection reset by peer) |
05:58:14 | * | solitudesf joined #nim |
05:58:42 | * | brakmic joined #nim |
06:00:28 | * | narimiran joined #nim |
06:43:20 | * | eterps joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:26 | Zevv | dom96: Let me see if I get to finish it first, lots to do still. But feel free to use it of course |
07:04:40 | * | gmpreussner joined #nim |
07:10:02 | * | actuallybatman quit (Ping timeout: 245 seconds) |
07:14:39 | * | eterps quit (Ping timeout: 250 seconds) |
07:23:22 | * | narimiran quit (Ping timeout: 245 seconds) |
07:36:39 | * | stefanos82 joined #nim |
07:47:48 | * | theelous3_ quit (Ping timeout: 272 seconds) |
07:54:06 | * | dwdv joined #nim |
07:58:30 | * | laaron- joined #nim |
07:58:59 | * | laaron quit (Remote host closed the connection) |
08:49:50 | * | NimBot joined #nim |
08:51:36 | * | cyraxjoe quit (Quit: I'm out!) |
09:02:08 | * | brakmic quit (Ping timeout: 245 seconds) |
09:02:12 | * | brakmic_ joined #nim |
09:02:50 | * | brakmic joined #nim |
09:06:41 | * | brakmic_ quit (Ping timeout: 248 seconds) |
09:09:52 | * | nsf joined #nim |
09:10:20 | * | tjmac joined #nim |
09:16:48 | * | natrys joined #nim |
09:39:24 | * | kungtotte joined #nim |
09:43:34 | FromDiscord_ | <djazz> I am awake. Only 1 message in 9 hours? Hmm |
09:45:33 | * | fredrik92 joined #nim |
09:46:05 | * | fredrik92 quit (Remote host closed the connection) |
09:46:10 | * | freddy92 joined #nim |
09:46:23 | * | freddy92 quit (Client Quit) |
09:50:53 | leorize | @djazz: #11621 should take care of the leaky paths in the generated binary |
09:51:22 | * | Vladar joined #nim |
09:52:26 | FromDiscord_ | <djazz> Yay |
10:23:52 | * | jokul quit (Ping timeout: 244 seconds) |
10:27:46 | cfv[m] | I remember I saw a good resource about type conversions in Nim but I can't recall where. Could someone send a link? |
10:29:31 | * | zyklon joined #nim |
10:29:39 | Zevv | More nim terminology: the manual does not speak of scalar or compound/aggregate types. Are these the right terms to use in Nim lingo when referring to native types vs objects/tuples? |
10:29:57 | FromGitter | <alehander42> hm |
10:31:52 | * | uvegbot quit (Ping timeout: 246 seconds) |
10:34:05 | cfv[m] | <cfv[m] "I remember I saw a good resource"> Like string to int, char to int and so on |
10:39:24 | FromGitter | <alehander42> probably @kaushalmodi |
10:39:26 | FromGitter | <alehander42> s blog |
10:39:47 | lqdev[m] | Zevv: I just call them primitive types and compound types, no fancy terminology |
10:39:53 | lqdev[m] | I don't think there is any |
10:42:24 | Zevv | right |
10:50:39 | * | jokul joined #nim |
10:52:45 | * | sagax joined #nim |
10:54:06 | * | PMunch joined #nim |
11:25:06 | FromGitter | <kaushalmodi> @alehander42 Thanks for the ping. |
11:25:26 | FromGitter | <kaushalmodi> cfv[m]: You mean this? https://scripter.co/notes/nim/#representing-one-type-in-another |
11:27:29 | * | solitudesf quit (Ping timeout: 248 seconds) |
11:31:53 | * | lf-araujo joined #nim |
11:43:59 | * | stefanos82 quit (Quit: Quitting for now...) |
11:53:07 | * | sz0 quit (Quit: Connection closed for inactivity) |
11:59:59 | FromGitter | <Toshiyuki-Tega> Is there any way to compile in release mode with nimble? Something like `nimble install`, but I'd just like to build without installing the executable. |
12:00:16 | PMunch | nimble build -d:release? |
12:00:46 | FromGitter | <Toshiyuki-Tega> Oh, it works. Thanks :) |
12:01:56 | PMunch | No problem, all the flags you pass to nimble build will just get passed on to the nim compiler |
12:16:34 | * | lf-araujo quit (Ping timeout: 252 seconds) |
12:17:40 | * | narimiran joined #nim |
12:18:42 | * | Snircle joined #nim |
12:20:02 | * | steshaw quit (Quit: Connection closed for inactivity) |
12:24:37 | * | lritter joined #nim |
12:26:42 | * | lf-araujo joined #nim |
12:31:25 | * | lf-araujo quit (Ping timeout: 250 seconds) |
12:45:55 | * | natrys quit (Ping timeout: 246 seconds) |
12:46:06 | * | nsf quit (Quit: WeeChat 2.4) |
12:55:09 | * | jchev joined #nim |
12:57:36 | * | natrys joined #nim |
12:59:28 | jchev | hi all, when i write (1..20) what type is it? |
13:01:42 | jchev | currently i have to call .toSeq before i can map the values, is there some other way to avoid the intermediate step? |
13:05:34 | PMunch | It's a range |
13:05:46 | PMunch | Basically it's stored as the upper and lower limit |
13:06:05 | PMunch | What are you trying to do with it? |
13:06:20 | * | brakmic quit (Read error: Connection reset by peer) |
13:06:48 | * | brakmic joined #nim |
13:09:02 | * | brakmic_ joined #nim |
13:09:52 | * | clyybber joined #nim |
13:11:19 | * | stefanos82 joined #nim |
13:12:18 | * | brakmic quit (Ping timeout: 258 seconds) |
13:15:41 | * | xet7 quit (Quit: Leaving) |
13:17:48 | Zevv | If anyone is bored and wants to do some early reviewing: http://zevv.nl/div/nim-memory.html |
13:17:54 | * | brakmic joined #nim |
13:18:39 | Zevv | I'm not sure if I'm happy with the RFC-style drawings, but that will do for now |
13:18:50 | PMunch | Zevv, just a sec and I'll give it a read |
13:19:03 | * | xet7 joined #nim |
13:19:05 | PMunch | Peeked at it yesterday, and I like the RFC-style drawings :) |
13:19:13 | * | jchev quit (Ping timeout: 245 seconds) |
13:19:39 | Zevv | hehe |
13:20:51 | xace | Zevv: did you use a program to generate those drawings? |
13:21:13 | xace | *was a program used to draw them... |
13:21:17 | * | brakmic_ quit (Ping timeout: 245 seconds) |
13:21:25 | * | dddddd joined #nim |
13:21:45 | * | theelous3 joined #nim |
13:22:22 | Zevv | yeah, vi |
13:22:43 | xace | hehe okay |
13:22:58 | Zevv | This is my default style, sometimes I feed them through ditaa or plantuml, but I don't particulary like the output of these |
13:23:42 | Zevv | I tried colorful hand drawings, which works quite well but it is a lot of work do right. It does raise my kids' interest though "Hey dad, what are you doing with my markers?!" |
13:25:03 | xace | Yeah I get it. I know i've been looking for a program to draw ascii diagrams with before but never managed to find something i was happy with... but I like the style of your post as it is now... |
13:25:45 | Zevv | I believe vim has some modes to make this easer to allow cursor movement beyond the end of line, but I always forget how to enable it |
13:27:31 | xace | Zevv: yeah, im aware of such things but to me it feels like suddenly im forcing my text editor to do things out of my designed workspace... |
13:27:49 | Zevv | then you're using the wrong editor :) |
13:28:24 | xace | lol... nah i try to keep my vim as vanilla as possible... |
13:28:45 | xace | so that when i move to another machine i dont feel too far away from home... |
13:29:30 | PMunch | :set ve=all |
13:29:39 | PMunch | ve for virtualedit |
13:29:59 | xace | im suppose to trim down the nim neovim plugin for regular vim, but i dont recall which computer i was working on when i made some changes... |
13:30:29 | Zevv | PMunch: yeah that was it, thanks |
13:33:02 | leorize[m] | xace: remove all the calls from ftdetect/nim.vim which will disable the nimsuggest integration |
13:34:45 | xace | leorize[m]: Thanks Ill write it down incase i never find the version i had tinkered with |
13:41:03 | * | narimiran quit (Remote host closed the connection) |
13:42:32 | PMunch | Nice explanation of a stack there Zevv, but maybe introduce the concept of a stack "frame" before the illustration? And make it clearer that temporary data is stored within the stack frame of the current procedure |
13:43:06 | PMunch | It's kinda hard to read this kinda stuff when you know the details already, but I think that might not be obvious if you don't already know how this works |
13:46:09 | * | jchev joined #nim |
13:50:28 | * | jchev quit (Ping timeout: 245 seconds) |
13:55:40 | Zevv | yeah, same problem here. I originally intended to assume all that known to the reader, but then my first proof reader seemed to have only a global understanding of stacks and heaps, and I decided to put it all in |
13:55:50 | Zevv | good catch about the stack frame, will change that |
13:56:18 | Zevv | and its just full of lies for sake of simplicity |
13:57:17 | PMunch | Oh yeah, but it kinda has to be :P |
13:57:35 | PMunch | After all it's a short article about memory in Nim, not a course on computer architecture :P |
13:58:38 | * | clyybber quit (Quit: WeeChat 2.5) |
13:59:23 | Zevv | true :) |
13:59:43 | Zevv | and now I'll have a beer out in the shade |
14:00:01 | PMunch | Bastard.. |
14:00:08 | PMunch | Here it's raining and 3C degrees.. |
14:07:23 | FromGitter | <rokups> im so good at breaking nim it seems π https://github.com/nim-lang/Nim/issues/11622 |
14:12:42 | stefanos82 | PMunch: where do you live, in North Pole or something?! O.o |
14:12:46 | stefanos82 | here it's so darn hot |
14:12:55 | stefanos82 | 43+ Celsius |
14:13:53 | * | couven92 quit (Quit: Client disconnecting) |
14:14:15 | FromGitter | <rokups> is there a replacement for deprecated list comprehensions from sugar module? docs do not mention anything, nor do i find info in changelogs |
14:18:26 | disruptek | i use this for creating graphics in vi: http://nomnoml.com/ |
14:18:54 | * | jchev joined #nim |
14:21:03 | PMunch | stefanos82, I live closer to the North Pole than to Paris.. |
14:21:19 | stefanos82 | PMunch: I'm in Cyprus, not Paris |
14:21:24 | jchev | sorry for slow reply |
14:21:42 | PMunch | I know, but Paris is closer to me than Cyprus |
14:21:48 | stefanos82 | but yeah, the entire Europe is under super heatwave with lots of deaths and wildfires |
14:21:54 | jchev | i am solving project euler question 5 by breaking each number into its prime factors then combining the maximum number of each factor required |
14:21:56 | jchev | https://gist.github.com/jchevertonwynne/b782e16ef05e89dcd062dccf3c030051 |
14:22:14 | PMunch | And at about the same angle from where I am |
14:22:28 | PMunch | stefanos82, not the entire Europe.. |
14:22:33 | PMunch | (I'm in Europe) |
14:22:35 | stefanos82 | so where are you exactly? |
14:22:38 | stefanos82 | Finland? |
14:22:38 | jchev | as in to make 20 you need 2x2x5 and to make 8 you need 2x2x2. so you need minimum 3 2s to make somethign that has 20 and 8 as factors |
14:22:44 | PMunch | TromsΓΈ, Norway |
14:22:50 | stefanos82 | ah cool |
14:23:20 | jchev | so i take 1..20, find the prime factors for all of those and combine them |
14:23:25 | PMunch | Yes, very cool, about 3 degrees C.. |
14:23:30 | PMunch | :P |
14:25:10 | jchev | so is there a way i can remove the .toSeq before i map the values? |
14:27:18 | PMunch | Well, you can probably use the list comprehension stuff from the sugar module |
14:31:16 | PMunch | Oh wait, maybe not.. |
14:33:59 | PMunch | I mean you could just do what map does: https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/sequtils.nim#L223-L240 |
14:34:07 | PMunch | Or implement that for iterators |
14:34:40 | PMunch | Or ranges rather, iterators don't have a length so you can't easily initialize the sequence |
14:34:58 | leorize | @rokups: use a for loop, it's superior :p |
14:35:59 | jchev | i was hoping for some way to avoid building all of a seq at once :( |
14:36:32 | leorize | what do you mean? |
14:37:00 | jchev | i was looking for some way to just generate the next value as i need it |
14:37:10 | jchev | rather than make a potentially big seq right at the start |
14:37:28 | leorize | closure iterator is what you want |
14:39:46 | jchev | just updated my gist with a proc that returns an iterator that *should* run through a range but it fails on compilation 'Error: execution of an external compiler program 'clang -c -w -I/<path> -I/<path> -o <path>/test.nim.c.o <path>/test.nim.c' failed with exit code: 1 |
14:40:28 | jchev | funnily enough, it compiles if i remove the echo command from the end |
14:40:40 | * | nsf joined #nim |
14:41:17 | * | rockcavera quit (Remote host closed the connection) |
14:41:25 | leorize | looks like a compiler bug |
14:41:36 | leorize | can you file a bug report for this? |
14:42:49 | jchev | sure! |
14:43:07 | jchev | what's the process? |
14:43:21 | leorize | https://github.com/nim-lang/Nim/issues |
14:43:34 | leorize | then click "new" |
14:43:46 | leorize | there's a template available for this |
14:44:17 | jchev | thanks! |
14:44:19 | * | jchev quit (Quit: WeeChat 2.5) |
14:44:35 | leorize | also, from what I can see here, your latest revision doesn't change anything from the prev... |
14:44:45 | * | nsf quit (Client Quit) |
14:50:07 | leorize | @rokups: here's a non-deprecated list comprehension: https://github.com/alehander42/comprehension |
15:12:36 | PMunch | Zevv, slight mistake in the "Memory organization in Nim" section |
15:12:58 | PMunch | You say that addr(x) and unsafeAddr(x) on an object of type T has a result of type addr T |
15:13:06 | PMunch | But it's actually of type ptr T |
15:13:24 | PMunch | And you use the correct name in the next sentence |
15:14:13 | * | PMunch quit (Remote host closed the connection) |
15:25:48 | * | lritter quit (Read error: Connection reset by peer) |
15:27:41 | * | solitudesf joined #nim |
15:50:37 | Zevv | yeah right, thanks! |
15:57:31 | Zevv | Man. 3Β°C, that's quite a contrast. I guess the good thing of being where you are is that you can go out and sit in the shade 24 hours a day this time of year... |
16:04:03 | * | gmpreussner_ joined #nim |
16:04:16 | * | gmpreussner quit (Ping timeout: 268 seconds) |
16:06:56 | FromGitter | <kaushalmodi> Zevv: very cool to see your post on Nim memory. |
16:07:08 | FromGitter | <kaushalmodi> You converted our discussion into a real post :) |
16:09:06 | FromGitter | <kaushalmodi> I read the very early first draft yesterday. I see that now you have more figures, will give another read tonight. Thanks for putting this together. |
16:10:11 | FromGitter | <kaushalmodi> What does the "div" folder stand for? |
16:12:20 | FromGitter | <kaushalmodi> Zevv: that "maintains" word looks extra in "the program maintains needs to keep .." |
16:20:23 | * | actuallybatman joined #nim |
16:23:04 | noonien | are there any zero size types that i can pass as a generic parameter? |
16:28:07 | leorize | `void`? |
16:30:58 | * | Jesin quit (Quit: Leaving) |
16:35:10 | * | Jesin joined #nim |
16:44:22 | disruptek | Zevv: this memory article is going to be a valuable contribution, thanks for taking the time to put it together. i would submit some PRs if you put it on github, where edits could be performed trivially right from the site. |
16:46:47 | * | eterps joined #nim |
16:49:44 | Zevv | kaushalmodi, good catch, wil fix |
16:49:56 | Zevv | disruptek: it is on github, check the top of the document for the url |
16:51:19 | Zevv | kaushalmodi: /div is my autocleaning stash bin |
16:51:22 | * | eterps quit (Read error: Connection reset by peer) |
16:51:35 | Zevv | I put stuff in there, and it gets moved out automatically after 7 days |
16:51:45 | Zevv | 'div' is of 'diversen', which is 'miscellanious' in dutch |
16:52:33 | Zevv | the rest of my site is all outdated stuff, I should clean it up one day |
16:56:58 | deech__ | Operationally is there a difference between 'proc f(i: static int):int {.compileTime.} = ...' and 'proc f(i:int):int {.compileTime.} = ...'? |
16:57:30 | * | obn07 joined #nim |
16:58:13 | leorize | I think not |
16:58:29 | disruptek | oh duh, lol :-P |
17:07:30 | FromGitter | <deech> Currently static default arguments are evaluated whether they are used or not, so this will "launch the missiles" at compile time whether the function is called or not: β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d179ad2aa095d404cdf5a16] |
17:08:15 | FromGitter | <deech> A default argument should not be evaluated unless needed. |
17:11:29 | FromGitter | <deech> Not what I'm working on but came across it ... |
17:28:10 | * | nsf joined #nim |
17:30:19 | deech__ | Static proc arguments also don't currently work: 'proc p(f: static proc(a,b:int):int)...' |
17:34:03 | deech__ | But this does: type P = proc(a,b:int):int; proc p (f: static P) ....' |
17:35:53 | deech__ | Once 1.0 is officially released people will run into these left and right. |
17:36:02 | FromGitter | <rokups> leorize thanks |
17:37:37 | leorize | deech__: static[T] is an experimental feature |
17:38:05 | leorize | I doubt people would touch it |
17:38:30 | deech__ | It does not say that in the manual: https://nim-lang.org/docs/manual.html#special-types-static-t |
17:39:18 | leorize | looks like the experimental annotation has been removed |
17:39:42 | deech__ | leorize, I disagree. When C++ people see that Nim has compile time evaluation they will push on it. |
17:40:05 | leorize | static proc is a bit too much :p |
17:40:17 | leorize | and people have already done compile time evaluation with Nim |
17:40:53 | deech__ | I meant the larger population of C++ devs, those who will only try it if it's 1.0. |
17:41:23 | leorize | iirc Araq disliked static[T] |
17:42:09 | leorize | and static[T] is not even CTFE |
17:42:30 | leorize | it's really misleading |
17:42:47 | deech__ | leorize: it is though, https://gitter.im/nim-lang/Nim?at=5d179ad2aa095d404cdf5a16 |
17:43:08 | leorize | proc smt(param: static int) means that everytime the `smt` proc is called the compiler will generate a version with that parameter inlined |
17:44:01 | leorize | yes, it evaluates the parameter at compile time |
17:44:08 | leorize | but it won't generate the result at compile time |
17:44:10 | * | obn07 quit (Ping timeout: 268 seconds) |
17:44:17 | leorize | it will generate a proc with that parameter inlined instead |
17:45:47 | deech__ | I agree with Araq that it needs to go away. |
17:47:14 | leorize | as of currently I think @mratsim is static[T] biggest user |
17:48:20 | leorize | I'd say that static expressions and blocks are great, but static param is terrible |
17:48:39 | deech__ | Yep, agree. |
17:51:05 | * | ertp07 joined #nim |
17:52:06 | leorize | the compiler should also try to evaluate more stuff at compile time imo, but it might not be as easy as I would think |
17:57:48 | deech__ | That would be nice but I'm happy to have to explicitly do that if it means sound semantics and a simpler compiler. |
18:02:10 | * | lf-araujo joined #nim |
18:02:13 | FromGitter | <danielecook> having trouble posting on the forum |
18:04:31 | FromGitter | <danielecook> I'm putting together a CLI tool for working with datasets similar to XSV (https://github.com/BurntSushi/xsv) and wanted to get feedback on it if anyones interested in taking a look: https://github.com/danielecook/tut/tree/development. Hope to build out added functionality and unique tools. Currently it's quite a bit slower than xsv though and hoping to speed it up. |
18:04:44 | FromGitter | <Varriount> @danielecook What problem are you encountering? |
18:06:00 | FromGitter | <danielecook> with regard to the forum - when I click create thread nothing happens |
18:06:14 | FromGitter | <Varriount> Hm. Do you have JavaScript enabled? |
18:06:34 | FromGitter | <danielecook> `Failed to load resource: the server responded with a status of 400 ()` |
18:06:38 | FromGitter | <danielecook> yes |
18:06:48 | FromGitter | <Varriount> Hm, odd |
18:07:06 | FromGitter | <danielecook> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d17a8cada128007c694039f] |
18:07:52 | * | SenasOzys joined #nim |
18:11:38 | FromGitter | <Varriount> What browser are you using? |
18:12:34 | FromGitter | <Varriount> @danielecook I'm able to create a post. |
18:13:34 | FromGitter | <Varriount> Could you put the raw text (title and body) in a gist/paste service? One theory is that the server is choking on some piece of formatting |
18:18:04 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
18:18:34 | * | laaron joined #nim |
18:20:22 | * | tjmac left #nim ("-bye") |
18:22:36 | * | actualman joined #nim |
18:24:15 | * | actuallybatman quit (Ping timeout: 268 seconds) |
18:32:19 | FromGitter | <danielecook> ah hah! |
18:32:20 | FromGitter | <danielecook> {"errorFields":[],"message":"You need to confirm your email before you can post"} |
18:32:27 | FromGitter | <danielecook> But I don't see that message anywhere |
18:33:21 | FromGitter | <danielecook> I also don't have any email to confirm..lemme look in settings |
18:36:37 | lqdev[m] | GitHub Nim syntax highlighting is broken: https://github.com/liquid600pgm/planet-overgamma/blob/rapid/src/planet_overgamma.nim#L40 only highlights `&` after strings, but not other tokens' |
18:46:36 | * | nsf quit (Quit: WeeChat 2.4) |
18:46:36 | * | ertp07 quit (Read error: Connection reset by peer) |
18:48:04 | * | lf-araujo_ joined #nim |
18:51:32 | * | lf-araujo quit (Ping timeout: 272 seconds) |
18:51:33 | * | lf-araujo_ is now known as lf-araujo |
18:55:49 | * | SenasOzys quit (Remote host closed the connection) |
19:05:56 | dom96 | yeah, there are multiple bugs in GitHub's syntax highlighting of Nim |
19:06:02 | dom96 | AFAIK it uses the Sublime Text highlighter |
19:06:08 | dom96 | We need to collect these bugs somewhere |
19:15:46 | lqdev[m] | does `json.to` support default values? |
19:18:38 | dom96 | nope |
19:18:54 | dom96 | but you can have optional values, and then use `get` on them with a default value |
19:19:11 | * | lf-araujo quit (Quit: lf-araujo) |
19:21:37 | * | lf-araujo joined #nim |
19:24:48 | * | ertp07 joined #nim |
19:26:56 | lqdev[m] | nice, that should do the trick |
19:35:23 | zestyr_ | dom96: https://github.com/github/linguist |
19:35:33 | * | zestyr_ is now known as zestyr |
19:43:23 | FromGitter | <palash25> If I want to refer to a field in my object as a table type, what is the correct syntax for that? β β Lets say I want to do this β β ```type β Cache ref object of RootObject β ttl: int β objectDict: Table``` ... [https://gitter.im/nim-lang/Nim?at=5d17bf5b490abf627a4294ca] |
19:44:37 | leorize | just like for when you create a table, use: `Table[<type for key>, <type for value>]` |
19:47:04 | FromGitter | <palash25> thanks π |
20:10:51 | FromGitter | <palash25> ok so I did that β β ```code paste, see link``` β β this gives me an error `type mismatch: got <Table[system.string, system.string], string, string>` [https://gitter.im/nim-lang/Nim?at=5d17c5cbddd2c007c72cec0c] |
20:11:04 | FromGitter | <palash25> on the last line |
20:11:14 | * | moigagoo joined #nim |
20:11:56 | leorize | if you want to mutate a table, change CacheMap to `var CacheMap` |
20:12:37 | FromGitter | <palash25> but I wanted CacheMap as an object to be able to define methods on it |
20:13:08 | leorize | I mean changing `self: CacheMap` to `self: var CacheMap` |
20:13:16 | leorize | which is needed to modify the parameter |
20:13:27 | FromGitter | <palash25> oh |
20:14:35 | dom96 | You might want to change CacheMap to be a ref |
20:15:51 | FromGitter | <palash25> you mean `CacheMap = ref object of RootObject` something like that? sorry for the silly questions, just started Nim today π
|
20:16:49 | leorize | you might want to read the manual a few times :p |
20:17:09 | leorize | I believe you come from Go, right? |
20:17:26 | FromGitter | <palash25> yeah I know, I have been a little impatient so I jumped straight into writing a small lib |
20:17:38 | FromGitter | <palash25> yup mostly Go and previously python |
20:18:02 | dom96 | palash25: yep, that's what I mean :) |
20:18:58 | leorize | @palash25 the capitalized proc name is a dead giveaway :p |
20:19:23 | leorize | usually in Nim we only capitalize the type name and constants |
20:19:55 | FromGitter | <palash25> oh yes π
been writing too much Go lately π |
20:19:56 | leorize | see https://nim-lang.org/docs/nep1.html for a style guide |
20:20:49 | leorize | this might also be useful: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
20:21:13 | FromGitter | <palash25> I am installing the vs code plugin to warn me for such stylistic errors |
20:22:01 | leorize | I don't think it will |
20:22:38 | leorize | unlike Go we don't have a concrete format like `gofmt` |
20:23:01 | leorize | there's a `nimpretty` tool in development, but I'm not even sure what it does |
20:23:22 | * | lf-araujo quit (Ping timeout: 246 seconds) |
20:23:56 | FromGitter | <palash25> that sucks, but I can understand that language is still pretty young so the tooling will take time to mature, nvm will keep referring to the style guide till then |
20:24:00 | FromGitter | <palash25> thanks for all the help |
20:24:55 | * | abm joined #nim |
20:25:14 | leorize | fwiw nim is older than go :P |
20:26:07 | FromGitter | <JasperJenkins> There is `--styleCheck:hint` |
20:26:13 | FromGitter | <kaushalmodi> nimpretty acts like gofmt |
20:26:36 | FromGitter | <kaushalmodi> just try it out.. |
20:26:39 | leorize | I'm not sure, last time I tried it didn't camelCase everything for me :p |
20:26:59 | FromGitter | <kaushalmodi> it does do a lot of other things though |
20:27:11 | FromGitter | <kaushalmodi> indenting lines to 2 spaces, etc. |
20:27:21 | FromGitter | <palash25> > *<leorize>* fwiw nim is older than go :β P β β what? didn't know that. |
20:27:57 | FromGitter | <kaushalmodi> look at the amount of tests for nimpretty: https://github.com/nim-lang/Nim/tree/dd252ce640c7f624acc08a6702193ec15fd7359b/nimpretty/tests |
20:28:36 | FromGitter | <kaushalmodi> it takes this ( https://github.com/nim-lang/Nim/blob/dd252ce640c7f624acc08a6702193ec15fd7359b/nimpretty/tests/exhaustive.nim ) and converts to https://github.com/nim-lang/Nim/blob/dd252ce640c7f624acc08a6702193ec15fd7359b/nimpretty/tests/expected/exhaustive.nim |
20:30:59 | leorize | it needs to be better at indenting though, because my nim.nvim plugin has already beat it to an extent :p |
20:32:04 | * | Vladar quit (Remote host closed the connection) |
20:34:53 | * | abm quit (Quit: Leaving) |
20:35:02 | * | steshaw joined #nim |
20:35:22 | shashlick_ | @Araq - appreciate a review when you get a chance |
20:35:26 | shashlick_ | https://gist.github.com/genotrance/b835bd9318dadb7541c0db5d9fe45ec7 |
20:35:46 | shashlick_ | Shared string and seq |
20:36:17 | shashlick_ | Still very early times and inefficient but a good foundation |
20:36:41 | FromGitter | <arnetheduck> if anyone wants to work on nimpretty, the state of the art can be found in `clang-format` and `yapf` which use scoring-based formatting - basically, it assigns costs to different variations for line breaks and chooses the one with the lowest cost, resulting in really good handling of tricky stuff |
20:37:34 | FromGitter | <arnetheduck> https://github.com/google/yapf#algorithm-design |
20:53:28 | * | actualman quit (Ping timeout: 246 seconds) |
21:01:19 | FromGitter | <arnetheduck> Araq, which of `system.hostOs` and `system.platform.targetOS` and `when defined(XXX)` is the official way of detecting for which os the code is being compiled for? |
21:04:32 | Zevv | shashlick_: why do you do locking at the global level instead of on the sharedObj? And convention is type names start with a capital, so that would be SharedObj I guess :) |
21:05:12 | FromDiscord_ | <djazz> My first public nim code ^^ https://github.com/daniel-j/celeste-textureshrinker |
21:05:56 | Zevv | \o/ |
21:06:33 | * | laaron quit (Remote host closed the connection) |
21:06:34 | lqdev[m] | wow, I didn't know you could run Celeste on an RPi :o |
21:08:20 | * | laaron joined #nim |
21:08:50 | FromDiscord_ | <djazz> https://youtu.be/iTBUNb6IKHo |
21:08:56 | * | nolanv quit (Quit: WeeChat 2.4) |
21:09:08 | FromDiscord_ | <djazz> I just finished writing the guide for it ^^ |
21:10:28 | Zevv | platformers were never my thing, but I've heard celeste is worth a try |
21:10:40 | lqdev[m] | it totally is |
21:10:57 | lqdev[m] | it's so great I played through it multiple times |
21:11:25 | FromDiscord_ | <djazz> yeah its great |
21:14:07 | * | laaron quit (Remote host closed the connection) |
21:14:29 | * | laaron joined #nim |
21:20:43 | FromGitter | <arnetheduck> also interestingly, compiler/platforms supports more cpu's than system.nim ... hmm ... |
21:22:43 | * | dwdv quit (Quit: quit) |
21:25:04 | * | brakmic quit () |
21:44:01 | * | ertp07 quit (Ping timeout: 248 seconds) |
21:45:19 | * | ertp07 joined #nim |
21:46:40 | * | actualman joined #nim |
21:53:11 | FromDiscord_ | <djazz> lqdev[m]: https://hackmd.io/@djazz/HyMRXfreS |
21:55:28 | * | solitudesf quit (Ping timeout: 245 seconds) |
22:05:20 | * | ertp07 quit (Ping timeout: 272 seconds) |
22:24:24 | * | lritter joined #nim |
22:32:15 | * | natrys quit (Quit: natrys) |
22:44:09 | * | steshaw quit (Quit: Connection closed for inactivity) |
23:41:35 | shashlick_ | Thanks Zevv makes sense - any other suggestions? |
23:43:33 | * | actualman quit (Remote host closed the connection) |
23:43:41 | shashlick_ | Actually I have a global lock since the sharedString can be copied across threads, only the ssptr is shared |
23:43:56 | shashlick_ | And you cannot access the ssptr without a lock |
23:44:19 | * | actualman joined #nim |
23:44:33 | shashlick_ | So only place would be a global array of locks of anything |
23:44:39 | * | actualman is now known as actuallybatman |
23:44:47 | shashlick_ | If |
23:44:58 | * | actuallybatman quit (Client Quit) |
23:53:37 | * | lritter quit (Ping timeout: 258 seconds) |