00:01:28 | * | JappleAck quit (Quit: Leaving) |
00:46:24 | watzon | Ok here's a question: how do you type closures? For instance I want to create a proc that accepts 3 parameters, an object, a string, and a proc. |
00:46:30 | watzon | Is this correct? `proc handle*(b: Telebot, command: string, p: proc (b: TeleBot, message: Message)):` |
00:47:01 | watzon | Other than obviously needing `=` instead of `:` |
00:52:02 | ipjk | Looks right. |
00:55:31 | Yardanico | watzon, yes that's right |
01:05:49 | * | Yardanico quit (Remote host closed the connection) |
01:13:18 | * | libman joined #nim |
01:26:09 | * | ipjk quit (Read error: Connection reset by peer) |
01:35:58 | * | Jesin joined #nim |
01:41:01 | * | kunev quit (Ping timeout: 240 seconds) |
01:43:09 | * | kunev joined #nim |
01:59:06 | * | ryanhowe joined #nim |
02:00:39 | * | ryanhowe quit (Client Quit) |
02:01:31 | * | ryanhowe joined #nim |
02:07:44 | * | ryanhowe quit (Quit: Mutter: www.mutterirc.com) |
02:27:01 | * | def-pri-pub joined #nim |
02:36:06 | * | ryanhowe joined #nim |
02:40:44 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:58:53 | * | ryanhowe quit (Quit: Mutter: www.mutterirc.com) |
03:11:43 | * | ryanhowe joined #nim |
03:13:29 | * | endragor joined #nim |
03:13:39 | * | ryanhowe quit (Client Quit) |
03:20:01 | * | gokr quit (Ping timeout: 240 seconds) |
03:46:16 | * | ryanhowe_ quit (Read error: Connection reset by peer) |
03:54:16 | * | def-pri-pub quit (Quit: Leaving.) |
04:18:05 | * | endragor quit (Ping timeout: 240 seconds) |
04:41:17 | * | pilne joined #nim |
04:45:59 | * | pilne quit (Quit: Quitting!) |
04:52:52 | * | def-pri-pub joined #nim |
04:55:49 | * | solitudesf joined #nim |
05:28:13 | * | def-pri-pub quit (Quit: Leaving.) |
05:29:37 | * | solitudesf quit (Ping timeout: 248 seconds) |
05:36:19 | * | dddddd quit (Remote host closed the connection) |
05:42:17 | * | MyMind joined #nim |
05:42:27 | * | Sembei quit (Ping timeout: 240 seconds) |
06:00:16 | * | miran joined #nim |
06:27:41 | watzon | How would I get a section of a string from `a` to the end? I've tried this `myString.str[5..-1]` but `-1` doesn't seem to work in this case. |
06:27:57 | miran | ^1 |
06:28:02 | watzon | And by `a` I mean variable `a`, not the letter a |
06:28:37 | watzon | miran: Thanks! |
06:29:17 | watzon | I know I could use len(myString), but there's usually another way to do it haha |
06:29:41 | miran | watzon: there is also `high(myString)` |
06:30:13 | watzon | Difference between `high()` and len()`? |
06:30:19 | watzon | Difference between `high()` and `len()`? |
06:30:23 | miran | len = high + 1 |
06:30:30 | watzon | Ahhhh |
06:30:34 | watzon | That makes sense |
06:30:45 | watzon | So len is the standard array length |
06:30:49 | watzon | High is the actual count |
06:30:59 | miran | high is the highest index |
06:31:19 | watzon | Interesting |
06:31:21 | watzon | And helpful |
06:32:29 | * | Arrrr joined #nim |
06:32:30 | * | Arrrr quit (Changing host) |
06:32:30 | * | Arrrr joined #nim |
06:33:00 | miran | for example: `let a: array[3..5, int] = [9, 8, 7]` |
06:33:14 | miran | high(a) == 5 |
06:36:22 | FromGitter | <citycide> @watzon instead of `-1` in the range use `^1` |
06:36:34 | FromGitter | <citycide> so for example `str[5..^1]` |
06:36:58 | watzon | citycide thanks for that, but miran beat you to it haha |
06:37:06 | FromGitter | <citycide> oh ha I see it now |
06:37:14 | watzon | I feel like I knew this stuff a few months ago |
06:37:19 | watzon | But it all left |
06:37:37 | FromGitter | <citycide> me, I wipe things after 30 days. archive & purge |
06:38:09 | watzon | Lol. Makes it hard to get back into things. I find myself asking a lot of the same questions again |
06:38:29 | watzon | It's hard knowing 7+ languages and keeping everything stored |
06:48:15 | * | endragor joined #nim |
06:49:47 | FromGitter | <mratsim> @gokr for play.nim-lang.org I also asked with we could build an URL so we can drectly link from the doc a runnable code. We can though we have to urlencode the code: https://play.nim-lang.org/?code=let%20test |
07:08:05 | * | nitely quit (Ping timeout: 252 seconds) |
07:10:15 | * | Arrrr quit (Ping timeout: 246 seconds) |
07:23:06 | * | libman quit (Quit: Connection closed for inactivity) |
07:24:00 | * | voiceftp quit (Quit: Leaving) |
07:26:57 | * | endragor quit (Ping timeout: 240 seconds) |
07:37:05 | * | Vladar joined #nim |
07:38:14 | watzon | Ok how tf do you call an anonymous proc? |
07:38:34 | watzon | do you just do `anonymousProc()`? |
07:40:45 | watzon | The very short "Anonymous Procs" section in the manual is not helpful at all |
07:49:28 | FromGitter | <stisa> watzon : what do you mean? Something like https://play.nim-lang.org/?gist=d42eef8e763ad1f03259b181041c7467 ? |
07:51:28 | * | themagician joined #nim |
07:53:28 | watzon | More something like this https://play.nim-lang.org/?gist=eb02a25e2eba198eee0a4e3cfa4151dc |
07:54:27 | watzon | Like javascripts `call` method |
07:54:49 | watzon | Or Ruby's |
07:56:41 | FromGitter | <stisa> It's `p("hello")`, but `p` doesn't return anything so it fails to compile |
07:57:09 | watzon | Well that makes sense |
08:01:30 | FromGitter | <mratsim> Time to upgrade to my mac to High Sierra, wish me luck, I may never return. |
08:02:49 | FromGitter | <krux02> Is it possible in nimble to depend on a fork of a library? |
08:03:51 | FromGitter | <krux02> currently my readme contains line to manually clone my fork of a library and use nimble install |
08:04:21 | watzon | krux02 you can just use `user/fork` |
08:04:28 | FromGitter | <stisa> @krux02 I think you can require a github repo |
08:04:32 | watzon | For instance `watzon/telebot.nim` |
08:04:43 | watzon | You can also use the full git url |
08:05:02 | watzon | Or append a commit hash |
08:05:45 | watzon | See https://github.com/nim-lang/nimble#dependencies |
08:25:18 | * | claudiuinberlin joined #nim |
08:28:47 | * | Pisuke joined #nim |
08:29:51 | * | MyMind quit (Ping timeout: 248 seconds) |
08:52:39 | * | couven92 joined #nim |
09:05:57 | miran | Araq: is there any chance that we might see slightly changed `case` syntax, like this: https://gist.github.com/anonymous/b7cf1316c54e645aa723bfa25a67347a ? |
09:06:19 | miran | or to make it possible to do thing both ways? |
09:07:31 | * | smt` joined #nim |
09:07:45 | miran | IIRC pascal has something similar |
09:10:34 | * | smt quit (Ping timeout: 264 seconds) |
09:12:29 | * | sleepyqt joined #nim |
09:19:49 | * | PMunch joined #nim |
09:28:28 | * | x86128 joined #nim |
09:35:41 | * | x86128 quit (Quit: Mutter: www.mutterirc.com) |
09:38:37 | * | x86128 joined #nim |
09:39:53 | * | solitudesf joined #nim |
09:40:23 | * | x86128 quit (Remote host closed the connection) |
09:40:39 | * | x86128 joined #nim |
09:46:47 | * | gokr joined #nim |
09:52:36 | * | zolk3ri joined #nim |
09:58:15 | * | x86128 quit (Remote host closed the connection) |
10:04:33 | FromGitter | <mratsim> Interesting, that reminds me of Rust and Haskell syntax. |
10:09:29 | * | m712 quit (Quit: bye-nyan!) |
10:12:02 | * | Sentreen quit (Ping timeout: 260 seconds) |
10:13:17 | miran | mratsim - that is a plus, i guess? :) |
10:24:17 | * | miran quit (Ping timeout: 260 seconds) |
10:24:22 | * | Sentreen joined #nim |
10:28:37 | * | Arrrr joined #nim |
10:28:37 | * | Arrrr quit (Changing host) |
10:28:37 | * | Arrrr joined #nim |
10:30:29 | * | x86128 joined #nim |
10:35:28 | * | m712 joined #nim |
10:40:39 | dom96 | miran: so just getting rid of the 'of'? |
10:40:44 | dom96 | and 'else' |
10:40:47 | * | x86128 quit (Quit: Mutter: www.mutterirc.com) |
10:40:56 | dom96 | Araq plans to add pattern matching to the case statement |
10:41:18 | * | x86128 joined #nim |
10:41:29 | dom96 | but changing the case statement this way is against Nim's principles |
10:43:13 | * | elrood joined #nim |
10:44:02 | x86128 | Why does asyncSleep is not uses system timers (like timerfd on Linux) for waiting with epoll, poll or select? |
10:44:32 | dom96 | because that's not been implemented yet |
10:45:19 | x86128 | Is implementation in some near future plans? |
10:45:34 | dom96 | I'm pretty sure it's implemented in the upcoming asyncdispatch |
10:54:11 | * | x86128 quit (Remote host closed the connection) |
10:55:52 | * | ipjk joined #nim |
11:02:14 | * | Snircle joined #nim |
11:10:57 | * | solitudesf quit (Ping timeout: 248 seconds) |
11:12:38 | * | x86128 joined #nim |
11:14:39 | * | awal quit (Ping timeout: 248 seconds) |
11:15:25 | * | x86128 quit (Client Quit) |
11:17:15 | * | JappleAck joined #nim |
11:19:07 | * | awal joined #nim |
11:22:27 | * | Sentreen quit (Ping timeout: 240 seconds) |
11:35:26 | * | Sentreen joined #nim |
12:17:12 | * | endragor joined #nim |
12:18:49 | * | dddddd joined #nim |
12:18:55 | * | Trustable joined #nim |
12:24:54 | * | endragor quit (Quit: Leaving...) |
12:25:19 | FromGitter | <luka-mikec> hi, is there a way to make the built-in set (or some other hash-based structure from the standard library) save elements of size less than 1 byte? I need many set["uint4"] objects, so the set[uint8] is too large (16 vs 256 bits) ⏎ one solution is to use enums with up to 16 elements, like set[en16], but I'd prefer to use numbers somehow; something like "set[bits=16]" ⏎ also - is there any throughout |
12:25:19 | FromGitter | ... documentation/specification of Nim? the manual is incomplete, and I'm having hard time finding things out from the source code ... |
12:31:11 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
13:03:29 | * | miran joined #nim |
13:05:10 | miran | dom96: sorry, had to go offline |
13:05:58 | miran | dom96: "changing the case statement this way is against Nim's principles" - why is putting `of` only to the beginning of a case against nim's principles? |
13:06:26 | miran | for those who joined later, i'm talking about this: https://gist.github.com/anonymous/b7cf1316c54e645aa723bfa25a67347a |
13:14:25 | gokr | Playing with LXC for the first time, nice stuff |
13:32:58 | * | Yardanico joined #nim |
13:33:01 | dom96 | miran: I prefer it as is for readabilities sake. |
13:33:24 | dom96 | The way I think of Nim is that it prefers keywords rather than operators for things like this. |
13:33:30 | dom96 | This is why we have `and` not `&&` |
13:33:38 | miran | heh, and i thought the proposed way is more readable :) |
13:34:12 | miran | keywords vs operators - that's for else vs _? |
13:34:15 | dom96 | I also don't think it's a good idea to have too many ways to do the same thing |
13:34:37 | miran | lol, how many ways there is to call u function? :D |
13:34:52 | dom96 | yeah, well, me and Araq don't always agree :P |
13:35:34 | miran | ok, then i might have more luck with Araq :D |
13:35:55 | dom96 | perhaps |
13:35:57 | dom96 | :) |
13:36:16 | Yardanico | miran, at least 3 ways |
13:36:21 | dom96 | I think this syntax is growing on me though. |
13:36:28 | dom96 | Now that I look at it again hah |
13:36:36 | miran | nice to hear :) |
13:36:39 | dom96 | It might fit well if we decide to support pattern matching |
13:37:31 | miran | well, even if there is `else` instead of `_`, putting `of` just at the first line (and then indent cases) might be more readable, no? |
13:37:39 | Yardanico | echo function(myarg); echo function myarg; echo myarg.function(); echo myarg.function |
13:37:43 | Yardanico | 4 ways :) |
13:39:18 | Yardanico | hi everyone btw |
13:42:41 | miran | hi Yardanico, to see what we're talking about see this: https://gist.github.com/anonymous/b7cf1316c54e645aa723bfa25a67347a |
13:42:44 | Yardanico | hmm, nice new feature, but I didn't notice it before :Phttps://github.com/blog/2415-introducing-embedded-code-snippets |
13:42:47 | Yardanico | miran, yeah, I saw that |
13:43:23 | miran | your opinion? :) |
13:43:53 | Yardanico | well, personally I use first style, but second style is probably better for pattern matching |
13:44:01 | Yardanico | I didn't see second style before btw |
13:44:09 | Yardanico | oh wait |
13:44:15 | Yardanico | it's not in the language yet ? :) |
13:44:23 | miran | because it doesn't work (currently. but one can hope... :)) |
13:45:41 | zolk3ri | bracessssss |
13:45:57 | Yardanico | ? :) |
13:46:03 | zolk3ri | :P |
13:46:08 | miran | dom96: yeah, pattern matching would be a nice addition to the language, hopefully it will come before 1.0 |
13:46:09 | zolk3ri | cyka |
13:46:26 | Yardanico | zolk3ri, there are russian speakers, watch your mouth :D |
13:46:31 | zolk3ri | lol |
13:46:35 | zolk3ri | Yardanico: I have some kompot xD |
13:46:48 | Yardanico | miran, according to todo.txt it should |
13:46:54 | Yardanico | but I didn't see any work on it |
13:47:02 | Yardanico | (maybe it's too easy to implement?) |
13:47:14 | miran | link to the todo? |
13:47:24 | Yardanico | miran, in the main repo lol |
13:47:25 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/todo.txt |
13:47:42 | * | nsf joined #nim |
13:47:56 | miran | Yardanico: it is easier to ask you than to search :P |
14:10:24 | * | pilne joined #nim |
14:11:23 | FromGitter | <zetashift> Wasnt there a lib that added pattern matching? |
14:14:44 | * | lastjedi joined #nim |
14:18:37 | FromGitter | <gokr> Patty IIRC. |
14:21:39 | FromGitter | <gokr> @mratsim One could of course also use an argument that is a permanent URL into the proper source file in github + a line number interval. |
14:25:43 | Yardanico | zetashift, gokr: but Patty works only for variant objects |
14:26:57 | * | gokr quit (Ping timeout: 240 seconds) |
14:27:27 | * | solitudesf joined #nim |
14:28:36 | Yardanico | btw, what libraries for events are there in nim? IIRC there was a type-safe library |
14:28:42 | Yardanico | (because events in stdlib is not type-safe) |
14:29:41 | Yardanico | ah, it's https://github.com/xomachine/metaevents |
14:32:59 | dom96 | hrm, should we remove the events module from stdlib? |
14:35:20 | PMunch | Huh, that's actually pretty interesting |
14:41:21 | * | firstjedi joined #nim |
14:44:38 | * | lastjedi quit (Ping timeout: 246 seconds) |
14:51:29 | Yardanico | dom96, well it's still used by *some* repos, but yeah, I think it should be removed/reworked before 1.0 |
14:51:41 | Yardanico | by some I mean very few |
14:51:41 | dom96 | what repos? |
14:52:30 | Yardanico | https://github.com/search?utf8=%E2%9C%93&q=language%3ANim+%22import+events%22&type=Code |
14:52:42 | Yardanico | mostly it's nim repo forks |
14:52:46 | Yardanico | so they don't count |
14:53:00 | Yardanico | also https://github.com/acleverpun/frag |
14:53:07 | Yardanico | (it's not zachary's events) |
14:53:38 | Yardanico | *zachary's FRAG |
14:54:53 | Yardanico | basically less than1 0 |
14:55:22 | Yardanico | ah, sorry, zacharycarter's frag uses events too |
14:55:23 | Yardanico | https://github.com/fragworks/frag |
14:55:33 | Yardanico | but I don't think that FRAG will be developed further |
14:55:45 | dom96 | why? |
14:55:59 | Yardanico | dom96, because zacharycarter said that |
14:56:02 | Yardanico | he's developing zengine |
14:56:08 | Yardanico | https://github.com/zacharycarter/zengine |
14:56:28 | dom96 | I see |
14:56:53 | Yardanico | but I really think that stdlib should be reviewed before 1.0 |
14:57:00 | Yardanico | and some modules moved to nimble/removed |
14:57:07 | dom96 | yes, that's the plan |
14:57:31 | dom96 | problem is reviewing it is incredibly boring :) |
14:57:52 | Yardanico | well we'll have to do that only once |
14:58:02 | Yardanico | and we should check all "XXX" and "TODO"'s in nim repo |
14:58:17 | dom96 | Yardanico: wanna help? :) |
14:58:50 | Yardanico | btw, I really don't understand: where tinyc is used in nim compiler? |
15:00:14 | dom96 | no idea |
15:01:42 | Yardanico | dom96, what's the command to update all nimble packages? |
15:01:53 | dom96 | there isn't one |
15:02:10 | Yardanico | hmm, https://github.com/nim-lang/Nim/search?utf8=%E2%9C%93&q=language%3Anim+tinyc&type= |
15:02:12 | Yardanico | (about tcc) |
15:03:30 | PMunch | There was a lot of talk about tcc as people tried to make REPLs for Nim |
15:03:42 | PMunch | Basically tcc is fast enough that it felt like a REPL |
15:03:49 | Yardanico | PMunch, https://github.com/nim-lang/Nim/blob/5f685bb0e6b2d68b9796e6a7d29469ce3f3b38ec/tools/nimrepl.nim |
15:03:57 | Yardanico | last commit by Araq: "nimrepl compiles again (but doesn't work)" |
15:04:01 | Yardanico | 29 jun 2015 |
15:04:15 | PMunch | So each line you typed would be added to a file and then nim with tcc would run the file |
15:04:26 | Yardanico | well yeah, that would be very good |
15:04:43 | Yardanico | wut |
15:04:58 | Yardanico | gtk2-1.0/glib2.nim(3492, 47) Error: ')' expected |
15:05:03 | Yardanico | (nimble package) |
15:05:24 | Yardanico | ah, nvm |
15:05:30 | PMunch | Problem was that it didn't do anything with errors.. So if you wrote something that crashed the program it would still be added to the file and crash the program every time.. |
15:09:21 | Yardanico | dom96, https://github.com/nim-lang/dialogs/pull/2 :D |
15:09:57 | dom96 | Yardanico: Digital Ocean should send you two Hacktoberfest T-shirts :) |
15:10:44 | miran | :D |
15:11:41 | miran | speaking of which - they'll contact us by the end of the month, or how that goes? |
15:12:03 | Yardanico | miran, yeah, they will |
15:12:04 | Yardanico | by email |
15:12:40 | miran | great! (i've managed to find some low hanging fruits, it was easier than i expected) |
15:13:32 | Yardanico | dom96, one more https://hacktoberfestchecker.herokuapp.com/?username=dom96 |
15:16:27 | Yardanico | btw guys, off-topic, but: reactos recently migrated to github: https://github.com/reactos/reactos |
15:17:51 | Yardanico | btw, I hope hacktoberfest t-shirts can be delivered to Russia |
15:18:25 | Yardanico | I'll probably ask them |
15:18:50 | dom96 | I'm sure it's in their FAQ |
15:21:35 | Yardanico | dom96, it's not it seems |
15:21:51 | federico3 | 13 - I want a hoodie! |
15:22:16 | dom96 | hoodie? |
15:22:56 | Yardanico | dom96, "a hooded sweatshirt or jacket." |
15:23:01 | Yardanico | google translate has helped me with this one |
15:23:21 | dom96 | You get a hoodie if you make 13 PRs?! |
15:23:30 | Yardanico | dom96, nah |
15:23:35 | Yardanico | federico3 just says that he made a lot of PRs |
15:23:38 | Yardanico | and he wants a hoodie |
15:23:39 | miran | he WANTS a hoodie |
15:23:46 | dom96 | oh |
15:23:47 | * | Sentreen quit (Ping timeout: 258 seconds) |
15:31:38 | * | durandu joined #nim |
15:33:35 | PMunch | What is this hacktoberfest you keep going on about? |
15:34:24 | Yardanico | PMunch, https://hacktoberfest.digitalocean.com/ |
15:34:31 | Yardanico | 4 PRs on github - free t-shirt |
15:35:46 | PMunch | Huh, only 4? |
15:36:24 | Yardanico | yep |
15:36:31 | Yardanico | and they don't need to be merged :P |
15:36:47 | * | Sentreen joined #nim |
15:37:07 | PMunch | Hmm, I'll look into making some PRs then :P |
15:37:13 | PMunch | As soon as my server is back up and running.. |
15:39:11 | FromGitter | <zetashift> How would I go about making a JsonNode of a 'Time' type |
15:39:39 | FromGitter | <zetashift> currently trying to Nimify this: https://hackernoon.com/learn-blockchains-by-building-one-117428612f46 in my ongoing quest to learn Nim and programming |
15:40:23 | * | gelumicu joined #nim |
15:41:25 | Yardanico | zetashift: why would you need it? |
15:41:41 | Yardanico | time in this article is just a float representing unix epoch |
15:41:55 | dom96 | just use a float |
15:42:01 | dom96 | there is a way to convert Time to a float |
15:42:04 | dom96 | or you can just use epochTime |
15:44:51 | FromGitter | <zetashift> sweet I'll do that |
15:45:20 | FromGitter | <zetashift> I thought it made more sense to directly from time to jsonnode |
15:45:27 | Yardanico | no |
15:45:35 | Yardanico | there's no Time type in JSON |
15:47:24 | FromGitter | <zetashift> alright thanks! |
15:48:00 | Yardanico | I will do a lot of PRs here it seems :P https://github.com/btbytes/nim-cookbook/pulls |
15:53:29 | miran | Yardanico: leave these easy topic for us beginners ;) |
15:54:03 | Yardanico | miran, well this is a cookbook :) so it should contain beautiful & short code if possible |
15:55:01 | * | yglukhov joined #nim |
15:59:39 | darkn0de | is there an easy way to do list comprehensions? something like args = [quoteShell(arg) for arg in args] |
15:59:51 | darkn0de | (or is that the wrong way to safely quote args before joining? |
16:00:17 | Yardanico | darkn0de, well there is |
16:00:32 | darkn0de | btw, Yardanico can you take paypal where you are |
16:00:33 | Yardanico | darkn0de, https://nim-lang.org/docs/future.html |
16:00:33 | * | durandu quit (Quit: Page closed) |
16:00:52 | darkn0de | awesome |
16:01:07 | darkn0de | that's so awesome |
16:01:14 | Yardanico | darkn0de, well I probably can |
16:01:17 | * | darkn0de is now known as jamieson |
16:01:21 | Yardanico | why are you asking ? :) |
16:01:38 | jamieson | i'm looking to hire someone to port the userify shim to nim. it's probably a two day job. |
16:01:48 | * | jamieson is now known as jamiesonbeckerx |
16:02:06 | jamiesonbeckerx | did you see that or did it come across during my nick change ;) |
16:02:35 | Yardanico | jamiesonbeckerx, yeah, I saw your message |
16:02:40 | jamiesonbeckerx | cool |
16:02:44 | * | jamiesonbeckerx is now known as darkn0de |
16:03:29 | darkn0de | i'm actually working on it but then realized that you all would probably do it faster and better ;) |
16:03:37 | darkn0de | (and wow nim is fun to code in) |
16:05:52 | darkn0de | https://github.com/userify/shim/blob/master/shim.py#L456 will probably be not as clean in nim. |
16:06:25 | darkn0de | but hopefully all that sslcontext stuff will be fixed up nicely soon (whereas in python, it's all legacy code) |
16:08:39 | * | TjYoco joined #nim |
16:09:24 | darkn0de | (if you're checking it out now, the operation will necessarily change to be a long-running process) |
16:10:13 | * | gelumicu quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) |
16:11:10 | * | gelumelu joined #nim |
16:11:54 | * | gelumelu is now known as durandu |
16:14:56 | * | yglukhov_ joined #nim |
16:16:01 | * | yglukhov quit (Ping timeout: 248 seconds) |
16:22:24 | * | elrood quit (Quit: Leaving) |
16:24:40 | * | yglukhov joined #nim |
16:26:29 | * | Sembei joined #nim |
16:28:26 | * | yglukhov_ quit (Ping timeout: 255 seconds) |
16:28:57 | * | Pisuke quit (Ping timeout: 240 seconds) |
16:28:58 | * | yglukhov quit (Read error: Connection reset by peer) |
16:29:43 | * | yglukhov joined #nim |
16:35:05 | * | Trustable quit (Remote host closed the connection) |
16:39:01 | * | HoloIRCUser3 joined #nim |
16:39:22 | Yardanico | darkn0de, I can probably try, but how I can test it? |
16:46:26 | darkn0de | Let's discuss offline? shoot me an email and I'll get a test vm set up |
16:46:51 | darkn0de | first at firstlast.com |
16:50:34 | * | nsf quit (Quit: WeeChat 1.9) |
16:55:35 | * | TjYoco quit (Ping timeout: 240 seconds) |
17:09:25 | * | TjYoco joined #nim |
17:09:40 | miran | to count number of occurrences in a sequence - is there a better/idiomatic way than filtering it and then taking a `len` of that? |
17:12:40 | * | Yardanico quit (Remote host closed the connection) |
17:13:03 | * | darkn0de quit (Quit: back to code) |
17:21:33 | * | lastjedi joined #nim |
17:23:46 | * | firstjedi quit (Ping timeout: 264 seconds) |
17:30:00 | FromGitter | <stisa> miran : maybe `toCountTable` ? Not sure if it increases the count while creating the table though |
17:34:02 | miran | stisa: yeah, that might work too |
17:34:03 | * | SusWombat quit (Read error: Connection reset by peer) |
17:35:22 | * | firstjedi joined #nim |
17:38:17 | * | lastjedi quit (Ping timeout: 260 seconds) |
17:39:51 | Arrrr | you have to make your own proc, but would be a nice addition to sequtils |
17:47:45 | * | sleepyqt quit (Ping timeout: 248 seconds) |
17:50:21 | * | gokr joined #nim |
17:54:25 | * | PMunch quit (Quit: leaving) |
17:57:47 | * | x86128 joined #nim |
17:59:57 | * | x86128 quit (Client Quit) |
18:00:06 | miran | Arrrr: ok, i'll try my luck with adding it to sequtils |
18:32:27 | * | firstjedi quit (Ping timeout: 240 seconds) |
18:33:41 | * | durandu left #nim ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is") |
18:34:13 | * | gelumelu joined #nim |
18:34:47 | * | lastjedi joined #nim |
18:35:41 | * | gelumelu quit (Client Quit) |
18:36:01 | * | gelumelu joined #nim |
18:37:05 | * | gelumelu is now known as durandu |
18:38:33 | * | durandu quit (Client Quit) |
18:38:57 | FromGitter | <GooRoo> Is there any way to document every object field separately so they are nicely rendered in documentation? |
18:39:25 | miran | Arrrr: PR submitted. now let's see what the big guys have to say about it... :) |
18:39:26 | * | durandu joined #nim |
18:41:25 | * | firstjedi joined #nim |
18:42:05 | FromGitter | <GooRoo> cool! I'm looking forward to seeing it in official release |
18:43:53 | * | lastjedi quit (Ping timeout: 258 seconds) |
18:48:14 | * | yglukhov quit (Ping timeout: 252 seconds) |
18:48:25 | * | onlyjedi joined #nim |
18:51:28 | * | firstjedi quit (Ping timeout: 240 seconds) |
18:54:28 | * | ofelas joined #nim |
19:01:26 | FromGitter | <stisa> @GooRoo you can do something like this https://nim-lang.org/docs/httpclient.html#HttpClientBase (click on `source` to view the code) |
19:01:38 | Arrrr | Nice, you could add an overload that accepts a proc |
19:02:55 | * | gokr quit (Ping timeout: 248 seconds) |
19:03:49 | FromGitter | <stisa> miran: `openarray` instead of `seq` maybe? |
19:12:51 | * | durandu quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) |
19:16:44 | * | lastjedi joined #nim |
19:18:41 | * | onlyjedi quit (Ping timeout: 240 seconds) |
19:20:42 | * | Nobabs27 joined #nim |
19:22:19 | * | firstjedi joined #nim |
19:24:08 | * | libman joined #nim |
19:25:21 | * | lastjedi quit (Ping timeout: 248 seconds) |
19:26:53 | FromGitter | <kdheepak> Is there a way for a fully functioning repl to work in Nim? What would something like that entail? |
19:28:38 | dom96 | There is, but it's not easy. |
19:28:45 | dom96 | You'd need to implement the FFI for Nim's VM |
19:29:51 | * | Nobabs25 joined #nim |
19:30:39 | FromGitter | <kdheepak> I'm curious as to why you say that is not easy to do? |
19:30:56 | FromGitter | <kdheepak> Do you think that is the only thing that prevents a fully functioning repl? |
19:31:02 | federico3 | kdheepak what's the use case for a REPL in Nim? |
19:31:54 | dom96 | kdheepak: because the creator of Nim tried to implement it and failed |
19:32:05 | * | Nobabs27 quit (Ping timeout: 240 seconds) |
19:32:19 | * | ofelas quit (Quit: shutdown -h now) |
19:33:32 | FromGitter | <kdheepak> I'm interested in using a data analysis type workflow in Nim, ( I'm basically trying to replace a lot of my existing workflow that is in Python with Nim ) and having a fully functioning repl is really important to me. |
19:34:20 | FromGitter | <kdheepak> Creating visualizations to explore data without a REPL seems rather challenging. |
19:34:45 | FromGitter | <kdheepak> I'd be willing to contribute my efforts to this, if someone could point me in the right direction. |
19:35:27 | FromGitter | <kdheepak> Haha @dom96 I figured it might be challenging but didn't know it was THAT challenging. |
19:36:48 | Araq | dom96: actually I succeeded but I don't want to maintain it and the edge cases cannot be resolved |
19:36:57 | FromGitter | <stisa> @kdheepak I assume you already know about `nim secret`, what's missing from it? |
19:37:09 | FromGitter | <kdheepak> I also think the REPL is a easiest way to introduce new comers to Nim. `nim secret` is great for this though but it would be nice to know something is planned for the language that is more functioning. |
19:38:28 | FromGitter | <kdheepak> @stisa my understanding is that you cannot use FFI or imports from `nim secret`. If I'm building my own visualization package in Nim I wouldn't be able to import it in `nim secret` ( someone correct me if I'm wrong ). |
19:38:56 | FromGitter | <kdheepak> @Araq Can you point me to this? I'm curious to take a look at it. |
19:39:23 | FromGitter | <GooRoo> @stisa don't really like how it looks https://nim-lang.org/docs/httpclient.html#HttpClientBase, but thanks |
19:40:07 | FromGitter | <kdheepak> @Araq when you say edge cases cannot be resolved, is this something you think will be hard to fix or not possible in nim-lang? |
19:41:54 | Araq | the edge cases are like "C proc takes an pointer", does it write to it or not? 'const' cannot be relied upon and so you have to do Nim internal representation --> conversion to blob --> C call --> conversion from blob back to Nim's internal representation |
19:42:35 | Araq | or "C takes a function pointer we have an Nim proc with bytecode, what now?" |
19:43:59 | Araq | not to mention problems like "I have a packed array of objects in RAM, now I changed the type declaration to have one more field, you have to update the representation" |
19:44:37 | Araq | there are widespread systems that solved these problems long ago. they are called databases. |
19:44:54 | FromGitter | <Yardanico> @kdheepak you can import modules from nim secret |
19:48:16 | Araq | @kdheepak: the implementation is in compiler/evalffi.nim |
19:49:46 | Araq | bootstrap with -d:useFFI to enable it but it probably won't compile out of the box anymore |
19:50:22 | FromGitter | <kdheepak> @Araq thanks for those answers. Those do seem like challenging issues. |
19:52:15 | Araq | kdheepak: our best bet seems to be the externally maintained LLVM backend |
19:52:17 | FromGitter | <kdheepak> @Yardanico Thanks! I should check. So I guess it's only the FFI that's missing in `nim secret`? This then in turn results in std modules not being available. ( is that a correct assessment? ) |
19:53:36 | Araq | I would look at Nim's LLVM backend and see what it takes to leverage LLVM to get a decent REPL |
19:53:47 | Araq | the VM is a deadend for this |
19:54:56 | Araq | or maybe patch the C codegen so that lookups to global variables go through an indirection so that you can keep them in shared memory, but that too seems much work |
19:56:00 | Araq | sooner or later the symbolic representation in the VM that has nothing to do with Nim's/C's native representation will break your neck |
19:56:42 | Araq | so yeah, once again, patch something that produces native code. |
19:57:00 | FromGitter | <kdheepak> Thanks for the detailed answers! This is good information. It sounds like you've thought about it in detail. And it does seem like leveraging LLVM might be a way to go. |
19:57:40 | FromGitter | <kdheepak> What did you mean by Nim's LLVM backend? I thought Nim currently only supported c/cpp/js? |
19:59:42 | Araq | https://github.com/arnetheduck/nlvm |
20:01:00 | Araq | I really wish people would help this project more, it's also a key project to get better debugging support off the ground |
20:01:36 | FromGitter | <kdheepak> Wow! Great. |
20:02:54 | FromGitter | <kdheepak> On a somewhat unrelated note, there must be a way to get github to support nim syntax highlighting, right? |
20:03:14 | Araq | huh? it does highlight Nim code |
20:03:59 | Araq | the highlighting is a bit outdated though and I don't buy these arbitray semantic nuances but that's a different topic |
20:05:15 | Araq | speaking of which VS Code highlights 'and' the same as 'uint32', that's wrong, one is a keyword the other a builtin |
20:05:19 | FromGitter | <kdheepak> Oh! It does. One of my chrome extensions is interfering with this. I'm able to see syntax highlighting fine in incognito mode. I need to find the culprit. |
20:06:18 | Araq | and 'case' has a different color than 'of' |
20:06:46 | Araq | the logic behind it seems to be "Hauptsache bunt" |
20:07:22 | Araq | (something like "at least it's colorful") |
20:08:58 | miran | stisa ("`openarray` instead of `seq` maybe?") - yeah, this might me a good idea |
20:12:04 | FromGitter | <kdheepak> Does (Will?) Nim support unicode variable names? @Araq what are your thoughts about this subject? |
20:13:01 | * | Arrrr quit (Read error: Connection reset by peer) |
20:13:36 | dom96 | It already supports them |
20:14:15 | dom96 | !eval let £ = 4.43; echo(£) |
20:14:16 | miran | stisa - on the other hand, only three functions in `sequtils` use `openarray`, all others have `seq` as parameter :/ |
20:14:18 | NimBot | 4.43 |
20:14:31 | FromGitter | <kdheepak> I learn something new everyday. |
20:14:53 | FromGitter | <kdheepak> (What?! I didn't know about NimBot. That's so cool!) |
20:16:39 | * | TjYoco quit (Ping timeout: 258 seconds) |
20:17:59 | FromGitter | <kdheepak> Wow that's great. It even works on function names. I can imagine it'll make for really nice syntax in a lot of packages. |
20:20:09 | * | TjYoco joined #nim |
20:21:34 | FromGitter | <kdheepak> I see it in the manual now, but don't remember seeing this in the tutorial |
20:30:26 | * | rauss quit (Read error: Connection reset by peer) |
20:32:37 | * | rauss joined #nim |
20:33:46 | * | gokr joined #nim |
20:37:40 | FromGitter | <gokr> Regarding the problems of a REPL - the Smalltalk VMs (and language) were designed to be able to handle all these issues (like for example, migration of class changes). A complex language like Nim, not having designed for it from the start, I would say it's very hard to make it work. But you can get VERY far with an 80%-solution. |
20:38:47 | * | miran quit (Ping timeout: 252 seconds) |
20:39:54 | FromGitter | <gokr> So for example, code reloading (.dll, .so) with some kind of reasonable handling of existing data in memory, and not doing "shape changes" - that could be very useful in larger systems (like games for example). |
20:42:16 | FromGitter | <gokr> Another approach - is to use a "scripting language" inside Nim. For example, Spry that I am fiddling with is meant to be 100% live. But that of course requires two languages, which is not optimal perhaps. On the other hand, I would argue that a statically typed, macro heavy language like Nim isn't ideal for "exploratory programming" in REPL style. |
20:44:00 | FromGitter | <gokr> Sidenote: Anyone liking REPLs should at least once take a look at a real Smalltalk environment. |
20:44:54 | federico3 | the REPL for exploring the language and Jupiter https://try.jupyter.org/ sound like two different use cases |
20:46:30 | * | lastjedi joined #nim |
20:48:35 | * | firstjedi quit (Ping timeout: 240 seconds) |
20:54:21 | * | TjYoco quit (Ping timeout: 240 seconds) |
20:57:34 | * | firstjedi joined #nim |
20:59:53 | * | sleepyqt joined #nim |
21:01:01 | * | lastjedi quit (Ping timeout: 240 seconds) |
21:13:24 | * | skrylar joined #nim |
21:13:29 | skrylar | http://www.graficaobscura.com/future/futnotes.html :p |
21:16:35 | * | solitudesf quit (Ping timeout: 240 seconds) |
21:26:08 | * | derlafff quit (Quit: No Ping reply in 180 seconds.) |
21:27:24 | * | derlafff joined #nim |
21:40:38 | * | Yardanico joined #nim |
21:41:47 | FromGitter | <Yardanico> @kdheepak many stdlib modules are pure-nim |
21:41:50 | FromGitter | <Yardanico> so they work in VM |
21:42:09 | * | TjYoco joined #nim |
21:42:56 | FromGitter | <Yardanico> e.g. tables, sequtils, strutils, algorithm, sets, lists, deques, intsets, critbits, etc... |
21:42:59 | FromGitter | <Yardanico> many of them |
21:47:39 | * | Vladar quit (Quit: Leaving) |
21:52:01 | * | firstjedi quit (Ping timeout: 248 seconds) |
21:52:09 | * | nsf joined #nim |
21:56:52 | * | JappleAck quit (Quit: Leaving) |
21:57:15 | FromGitter | <kdheepak> @federico3 There are definitely different use cases. In my mind the two use cases most relevant when discussing a REPL and learning and exploration (of data and the language). The learning and exploring a language is useful when one wants to introduce a language to a newcomer. A REPL is really useful in aiding that learning experience, but not necessary. Jupyter can also help with that but Jupyter embodies so much |
21:57:15 | FromGitter | ... more. Jupyter aims to decrease the time between a thought and an outcome. It's easy to type `1 * 2 + 3` to see what it produces in a REPL to learn what happens in a language, but a Jupyter notebook is really useful when one types say `df[interesting_columns].mean(axis=1).plot()` to visualize data. From thought (what i ... [https://gitter.im/nim-lang/Nim?at=59ebc2bbb20c642429300caf] |
21:58:15 | FromGitter | <kdheepak> Nim with a REPL with make the perfect companion to someone's Jupyter workflow. Fast efficient computation in C/CPP with potentially interactive visualization in JS. |
21:59:57 | Yardanico | there are already nim kernels for jupyter btw |
21:59:59 | FromGitter | <kdheepak> This quote from the Nim manual is relevant. ⏎ ⏎ > "Complexity" seems to be a lot like "energy": you can transfer it from the end user to one/some of the other players, but the total amount seems to remain pretty much constant for a given task. -- Ran ⏎ ⏎ It's more work to undertake to build a working REPL, but would decrease complexity on the user end. Ideally, there would be no changes required to any of |
21:59:59 | FromGitter | ... Nim's features and just an additional REPL would be added that is available to people that are interested in using it. [https://gitter.im/nim-lang/Nim?at=59ebc35f8808bed73d109289] |
22:00:03 | Yardanico | but they're in alpha state it seems |
22:00:26 | Yardanico | e.g. https://github.com/stisa/INim |
22:00:34 | Yardanico | or https://github.com/stisa/jupyter-nim-kernel |
22:00:44 | Yardanico | first one is a complete rewrite (everything is in nim) |
22:00:50 | Yardanico | second one uses python as a kernel |
22:01:28 | Yardanico | btw https://github.com/stisa/INim has visualization support |
22:01:41 | Yardanico | via matplotlib wrapper |
22:04:20 | FromGitter | <kdheepak> Wow! looks really interesting. I will experiment with this. Thanks for sharing. Do you understand how this works? Looking through the code, I see the implementation of the jupyter kernel, but how does the text from the notebook get evaluated? |
22:05:07 | Yardanico | kdheepak: probably by writing to the file and compiling it |
22:05:42 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:06:48 | Yardanico | NOTE: running a notebook with this creates a directory inimtemp in which it stores blocks of code, pngs, compiled outputs, etc. |
22:07:10 | FromGitter | <kdheepak> Thanks. I think you are right. I see the use of tinycc in the private/sockets.nim folder |
22:07:37 | Yardanico | yeah it works |
22:08:11 | Yardanico | kdheepak: but it doesn't use tinycc |
22:08:44 | Yardanico | ah wait |
22:08:45 | Yardanico | it does :) |
22:08:59 | Yardanico | ah no |
22:09:09 | Yardanico | only if you use #>tinycc magic |
22:09:45 | FromGitter | <kdheepak> This line (https://github.com/stisa/INim/blob/master/private/sockets.nim#L207)? |
22:10:02 | Yardanico | tcc_path will be empty here |
22:10:06 | Yardanico | https://github.com/stisa/INim/blob/master/private/sockets.nim#L181 |
22:10:14 | Yardanico | also it almost doesn't share contexts |
22:50:01 | * | TjYoco quit (Ping timeout: 240 seconds) |
22:54:08 | Yardanico | Araq, any status on https://github.com/nim-lang/ui/pull/7 ? :) |
22:57:03 | * | TjYoco joined #nim |
22:58:55 | * | beatmox quit (Remote host closed the connection) |
22:59:26 | * | beatmox joined #nim |
23:01:11 | * | HoloIRCUser3 quit (Ping timeout: 255 seconds) |
23:08:25 | * | nsf quit (Quit: WeeChat 1.9) |
23:12:41 | * | zolk3ri quit (Remote host closed the connection) |
23:20:01 | * | gokr quit (Ping timeout: 248 seconds) |
23:23:31 | * | themagician quit () |
23:25:48 | FromGitter | <zetashift> @Yardanico you there by any chance? |
23:25:53 | Yardanico | yep |
23:26:38 | FromGitter | <zetashift> sweet I still am on that nimifying that blockchain article but it has this line in python: guess = f'{last_proof}{proof}'.encode() |
23:26:51 | FromGitter | <zetashift> I have no idea what the equivalant of that would be? last proof and proof are ints |
23:27:08 | FromGitter | <zetashift> $(last_proof + proof)? |
23:27:37 | FromGitter | <Yardanico> ($last_proof & $proof) |
23:27:43 | FromGitter | <Yardanico> f is string interpolation from python 3.6 |
23:27:53 | FromGitter | <zetashift> I know, my google-fu isn't that weak! |
23:27:57 | FromGitter | <zetashift> I think... |
23:28:08 | FromGitter | <zetashift> but thanks ;D |
23:28:08 | FromGitter | <Yardanico> well I did use f-strings in the past :) |
23:28:14 | FromGitter | <Yardanico> and there are already nim libraries for string interpolation |
23:28:19 | FromGitter | <zetashift> I should just use your python hehe |
23:28:24 | FromGitter | <zetashift> py2nim incoming |
23:28:35 | FromGitter | <Yardanico> well it's just a simple PoC |
23:28:46 | FromGitter | <Yardanico> it should be something like https://github.com/google/grumpy |
23:29:09 | * | TjYoco quit (Quit: Leaving) |
23:29:57 | FromGitter | <zetashift> I saw that project, I found it meh. I even took a stab at Go, but I found Nim way more comfy |
23:30:16 | FromGitter | <Yardanico> well I mean how it does python - go |
23:31:30 | FromGitter | <Yardanico> hmm |
23:31:31 | FromGitter | <zetashift> ah okay |
23:31:40 | FromGitter | <Yardanico> they parse python in python :P |
23:32:04 | FromGitter | <Yardanico> so python code does python-grumpy compilation |
23:32:54 | FromGitter | <Yardanico> hhmm I don't think this is the best solution |
23:32:55 | FromGitter | <Yardanico> maybe it is |
23:34:13 | FromGitter | <zetashift> Does nim have an equivalent of [:x] of python builtin? |
23:34:16 | FromGitter | <zetashift> x being an index |
23:34:40 | FromGitter | <Yardanico> it's a slice from 0 to x, right? |
23:34:59 | FromGitter | <zetashift> no a slice from the end to (end - x) |
23:35:10 | * | sleepyqt quit (Remote host closed the connection) |
23:35:18 | FromGitter | <Yardanico> can you show full code line? |
23:35:42 | FromGitter | <zetashift> guess_hash[:4] == "0000" so the last 4 digits of the var ends with 0000 |
23:36:08 | FromGitter | <zetashift> currently have len(array)-4 .. len(array) |
23:36:23 | FromGitter | <Yardanico> well that's "items from the beginning through end-1" |
23:36:31 | FromGitter | <Yardanico> so guess_hash[0..^4] |
23:36:37 | FromGitter | <Yardanico> ah |
23:36:37 | FromGitter | <Yardanico> sorry |
23:36:48 | FromGitter | <Yardanico> guess_hash[0..4] |
23:36:57 | FromGitter | <Yardanico> or guess_hash[0..3] |
23:37:04 | FromGitter | <Yardanico> one of these |
23:37:05 | FromGitter | <zetashift> alright thanks |
23:41:14 | * | Jesin quit (Quit: Leaving) |
23:56:10 | * | ipjk quit (Quit: Leaving) |
23:56:13 | libman | Public service announcement: 41.396% of Nim repos on GitHub are missing a license file (that GitHub can auto-detect). |
23:56:20 | FromGitter | <kdheepak> @zetashift ⏎ ⏎ ```guess_hash = "12345678" ⏎ print(guess_hash[:4]) # "1234" ⏎ print(guess_hash[-4:]) # "5678"``` [https://gitter.im/nim-lang/Nim?at=59ebdea3614889d475e43450] |
23:56:32 | libman | https://github.com/lbmn/libman.org/blob/master/piki/tiole.md#nim-github-repos |
23:56:56 | Yardanico | libman, if they're missing a license file - that doesn't mean they're copyfree :P |
23:57:07 | Yardanico | they may still contain license in source files |
23:57:10 | Yardanico | but nice one |
23:57:32 | Yardanico | libman, btw, should I paste license in my source files if I have LICENSE file in root project dir? |
23:57:33 | libman | Yeah, but the goal is to make Nim the most legalese-free programming experience. |
23:58:17 | libman | GitHub is the trend-setter, so whatever it auto-detects is the standard way. |
23:59:43 | FromGitter | <zetashift> Makes even more sense now thanks @kdheepak |