<< 21-10-2017 >>

00:01:28*JappleAck quit (Quit: Leaving)
00:46:24watzonOk 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:30watzonIs this correct? `proc handle*(b: Telebot, command: string, p: proc (b: TeleBot, message: Message)):`
00:47:01watzonOther than obviously needing `=` instead of `:`
00:52:02ipjkLooks right.
00:55:31Yardanicowatzon, 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:41watzonHow 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:57miran^1
06:28:02watzonAnd by `a` I mean variable `a`, not the letter a
06:28:37watzonmiran: Thanks!
06:29:17watzonI know I could use len(myString), but there's usually another way to do it haha
06:29:41miranwatzon: there is also `high(myString)`
06:30:13watzonDifference between `high()` and len()`?
06:30:19watzonDifference between `high()` and `len()`?
06:30:23miranlen = high + 1
06:30:30watzonAhhhh
06:30:34watzonThat makes sense
06:30:45watzonSo len is the standard array length
06:30:49watzonHigh is the actual count
06:30:59miranhigh is the highest index
06:31:19watzonInteresting
06:31:21watzonAnd helpful
06:32:29*Arrrr joined #nim
06:32:30*Arrrr quit (Changing host)
06:32:30*Arrrr joined #nim
06:33:00miranfor example: `let a: array[3..5, int] = [9, 8, 7]`
06:33:14miranhigh(a) == 5
06:36:22FromGitter<citycide> @watzon instead of `-1` in the range use `^1`
06:36:34FromGitter<citycide> so for example `str[5..^1]`
06:36:58watzoncitycide thanks for that, but miran beat you to it haha
06:37:06FromGitter<citycide> oh ha I see it now
06:37:14watzonI feel like I knew this stuff a few months ago
06:37:19watzonBut it all left
06:37:37FromGitter<citycide> me, I wipe things after 30 days. archive & purge
06:38:09watzonLol. Makes it hard to get back into things. I find myself asking a lot of the same questions again
06:38:29watzonIt's hard knowing 7+ languages and keeping everything stored
06:48:15*endragor joined #nim
06:49:47FromGitter<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:14watzonOk how tf do you call an anonymous proc?
07:38:34watzondo you just do `anonymousProc()`?
07:40:45watzonThe very short "Anonymous Procs" section in the manual is not helpful at all
07:49:28FromGitter<stisa> watzon : what do you mean? Something like https://play.nim-lang.org/?gist=d42eef8e763ad1f03259b181041c7467 ?
07:51:28*themagician joined #nim
07:53:28watzonMore something like this https://play.nim-lang.org/?gist=eb02a25e2eba198eee0a4e3cfa4151dc
07:54:27watzonLike javascripts `call` method
07:54:49watzonOr Ruby's
07:56:41FromGitter<stisa> It's `p("hello")`, but `p` doesn't return anything so it fails to compile
07:57:09watzonWell that makes sense
08:01:30FromGitter<mratsim> Time to upgrade to my mac to High Sierra, wish me luck, I may never return.
08:02:49FromGitter<krux02> Is it possible in nimble to depend on a fork of a library?
08:03:51FromGitter<krux02> currently my readme contains line to manually clone my fork of a library and use nimble install
08:04:21watzonkrux02 you can just use `user/fork`
08:04:28FromGitter<stisa> @krux02 I think you can require a github repo
08:04:32watzonFor instance `watzon/telebot.nim`
08:04:43watzonYou can also use the full git url
08:05:02watzonOr append a commit hash
08:05:45watzonSee 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:57miranAraq: is there any chance that we might see slightly changed `case` syntax, like this: https://gist.github.com/anonymous/b7cf1316c54e645aa723bfa25a67347a ?
09:06:19miranor to make it possible to do thing both ways?
09:07:31*smt` joined #nim
09:07:45miranIIRC 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:33FromGitter<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:17miranmratsim - 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:39dom96miran: so just getting rid of the 'of'?
10:40:44dom96and 'else'
10:40:47*x86128 quit (Quit: Mutter: www.mutterirc.com)
10:40:56dom96Araq plans to add pattern matching to the case statement
10:41:18*x86128 joined #nim
10:41:29dom96but changing the case statement this way is against Nim's principles
10:43:13*elrood joined #nim
10:44:02x86128Why does asyncSleep is not uses system timers (like timerfd on Linux) for waiting with epoll, poll or select?
10:44:32dom96because that's not been implemented yet
10:45:19x86128Is implementation in some near future plans?
10:45:34dom96I'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:19FromGitter<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:19FromGitter... 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:10mirandom96: sorry, had to go offline
13:05:58mirandom96: "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:26miranfor those who joined later, i'm talking about this: https://gist.github.com/anonymous/b7cf1316c54e645aa723bfa25a67347a
13:14:25gokrPlaying with LXC for the first time, nice stuff
13:32:58*Yardanico joined #nim
13:33:01dom96miran: I prefer it as is for readabilities sake.
13:33:24dom96The way I think of Nim is that it prefers keywords rather than operators for things like this.
13:33:30dom96This is why we have `and` not `&&`
13:33:38miranheh, and i thought the proposed way is more readable :)
13:34:12mirankeywords vs operators - that's for else vs _?
13:34:15dom96I also don't think it's a good idea to have too many ways to do the same thing
13:34:37miranlol, how many ways there is to call u function? :D
13:34:52dom96yeah, well, me and Araq don't always agree :P
13:35:34miranok, then i might have more luck with Araq :D
13:35:55dom96perhaps
13:35:57dom96:)
13:36:16Yardanicomiran, at least 3 ways
13:36:21dom96I think this syntax is growing on me though.
13:36:28dom96Now that I look at it again hah
13:36:36mirannice to hear :)
13:36:39dom96It might fit well if we decide to support pattern matching
13:37:31miranwell, 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:39Yardanicoecho function(myarg); echo function myarg; echo myarg.function(); echo myarg.function
13:37:43Yardanico4 ways :)
13:39:18Yardanicohi everyone btw
13:42:41miranhi Yardanico, to see what we're talking about see this: https://gist.github.com/anonymous/b7cf1316c54e645aa723bfa25a67347a
13:42:44Yardanicohmm, nice new feature, but I didn't notice it before :Phttps://github.com/blog/2415-introducing-embedded-code-snippets
13:42:47Yardanicomiran, yeah, I saw that
13:43:23miranyour opinion? :)
13:43:53Yardanicowell, personally I use first style, but second style is probably better for pattern matching
13:44:01YardanicoI didn't see second style before btw
13:44:09Yardanicooh wait
13:44:15Yardanicoit's not in the language yet ? :)
13:44:23miranbecause it doesn't work (currently. but one can hope... :))
13:45:41zolk3ribracessssss
13:45:57Yardanico? :)
13:46:03zolk3ri:P
13:46:08mirandom96: yeah, pattern matching would be a nice addition to the language, hopefully it will come before 1.0
13:46:09zolk3ricyka
13:46:26Yardanicozolk3ri, there are russian speakers, watch your mouth :D
13:46:31zolk3rilol
13:46:35zolk3riYardanico: I have some kompot xD
13:46:48Yardanicomiran, according to todo.txt it should
13:46:54Yardanicobut I didn't see any work on it
13:47:02Yardanico(maybe it's too easy to implement?)
13:47:14miranlink to the todo?
13:47:24Yardanicomiran, in the main repo lol
13:47:25Yardanicohttps://github.com/nim-lang/Nim/blob/devel/todo.txt
13:47:42*nsf joined #nim
13:47:56miranYardanico: it is easier to ask you than to search :P
14:10:24*pilne joined #nim
14:11:23FromGitter<zetashift> Wasnt there a lib that added pattern matching?
14:14:44*lastjedi joined #nim
14:18:37FromGitter<gokr> Patty IIRC.
14:21:39FromGitter<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:43Yardanicozetashift, 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:36Yardanicobtw, what libraries for events are there in nim? IIRC there was a type-safe library
14:28:42Yardanico(because events in stdlib is not type-safe)
14:29:41Yardanicoah, it's https://github.com/xomachine/metaevents
14:32:59dom96hrm, should we remove the events module from stdlib?
14:35:20PMunchHuh, that's actually pretty interesting
14:41:21*firstjedi joined #nim
14:44:38*lastjedi quit (Ping timeout: 246 seconds)
14:51:29Yardanicodom96, well it's still used by *some* repos, but yeah, I think it should be removed/reworked before 1.0
14:51:41Yardanicoby some I mean very few
14:51:41dom96what repos?
14:52:30Yardanicohttps://github.com/search?utf8=%E2%9C%93&q=language%3ANim+%22import+events%22&type=Code
14:52:42Yardanicomostly it's nim repo forks
14:52:46Yardanicoso they don't count
14:53:00Yardanicoalso https://github.com/acleverpun/frag
14:53:07Yardanico(it's not zachary's events)
14:53:38Yardanico*zachary's FRAG
14:54:53Yardanicobasically less than1 0
14:55:22Yardanicoah, sorry, zacharycarter's frag uses events too
14:55:23Yardanicohttps://github.com/fragworks/frag
14:55:33Yardanicobut I don't think that FRAG will be developed further
14:55:45dom96why?
14:55:59Yardanicodom96, because zacharycarter said that
14:56:02Yardanicohe's developing zengine
14:56:08Yardanicohttps://github.com/zacharycarter/zengine
14:56:28dom96I see
14:56:53Yardanicobut I really think that stdlib should be reviewed before 1.0
14:57:00Yardanicoand some modules moved to nimble/removed
14:57:07dom96yes, that's the plan
14:57:31dom96problem is reviewing it is incredibly boring :)
14:57:52Yardanicowell we'll have to do that only once
14:58:02Yardanicoand we should check all "XXX" and "TODO"'s in nim repo
14:58:17dom96Yardanico: wanna help? :)
14:58:50Yardanicobtw, I really don't understand: where tinyc is used in nim compiler?
15:00:14dom96no idea
15:01:42Yardanicodom96, what's the command to update all nimble packages?
15:01:53dom96there isn't one
15:02:10Yardanicohmm, https://github.com/nim-lang/Nim/search?utf8=%E2%9C%93&q=language%3Anim+tinyc&type=
15:02:12Yardanico(about tcc)
15:03:30PMunchThere was a lot of talk about tcc as people tried to make REPLs for Nim
15:03:42PMunchBasically tcc is fast enough that it felt like a REPL
15:03:49YardanicoPMunch, https://github.com/nim-lang/Nim/blob/5f685bb0e6b2d68b9796e6a7d29469ce3f3b38ec/tools/nimrepl.nim
15:03:57Yardanicolast commit by Araq: "nimrepl compiles again (but doesn't work)"
15:04:01Yardanico29 jun 2015
15:04:15PMunchSo each line you typed would be added to a file and then nim with tcc would run the file
15:04:26Yardanicowell yeah, that would be very good
15:04:43Yardanicowut
15:04:58Yardanicogtk2-1.0/glib2.nim(3492, 47) Error: ')' expected
15:05:03Yardanico(nimble package)
15:05:24Yardanicoah, nvm
15:05:30PMunchProblem 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:21Yardanicodom96, https://github.com/nim-lang/dialogs/pull/2 :D
15:09:57dom96Yardanico: Digital Ocean should send you two Hacktoberfest T-shirts :)
15:10:44miran:D
15:11:41miranspeaking of which - they'll contact us by the end of the month, or how that goes?
15:12:03Yardanicomiran, yeah, they will
15:12:04Yardanicoby email
15:12:40mirangreat! (i've managed to find some low hanging fruits, it was easier than i expected)
15:13:32Yardanicodom96, one more https://hacktoberfestchecker.herokuapp.com/?username=dom96
15:16:27Yardanicobtw guys, off-topic, but: reactos recently migrated to github: https://github.com/reactos/reactos
15:17:51Yardanicobtw, I hope hacktoberfest t-shirts can be delivered to Russia
15:18:25YardanicoI'll probably ask them
15:18:50dom96I'm sure it's in their FAQ
15:21:35Yardanicodom96, it's not it seems
15:21:51federico313 - I want a hoodie!
15:22:16dom96hoodie?
15:22:56Yardanicodom96, "a hooded sweatshirt or jacket."
15:23:01Yardanicogoogle translate has helped me with this one
15:23:21dom96You get a hoodie if you make 13 PRs?!
15:23:30Yardanicodom96, nah
15:23:35Yardanicofederico3 just says that he made a lot of PRs
15:23:38Yardanicoand he wants a hoodie
15:23:39miranhe WANTS a hoodie
15:23:46dom96oh
15:23:47*Sentreen quit (Ping timeout: 258 seconds)
15:31:38*durandu joined #nim
15:33:35PMunchWhat is this hacktoberfest you keep going on about?
15:34:24YardanicoPMunch, https://hacktoberfest.digitalocean.com/
15:34:31Yardanico4 PRs on github - free t-shirt
15:35:46PMunchHuh, only 4?
15:36:24Yardanicoyep
15:36:31Yardanicoand they don't need to be merged :P
15:36:47*Sentreen joined #nim
15:37:07PMunchHmm, I'll look into making some PRs then :P
15:37:13PMunchAs soon as my server is back up and running..
15:39:11FromGitter<zetashift> How would I go about making a JsonNode of a 'Time' type
15:39:39FromGitter<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:25Yardanicozetashift: why would you need it?
15:41:41Yardanicotime in this article is just a float representing unix epoch
15:41:55dom96just use a float
15:42:01dom96there is a way to convert Time to a float
15:42:04dom96or you can just use epochTime
15:44:51FromGitter<zetashift> sweet I'll do that
15:45:20FromGitter<zetashift> I thought it made more sense to directly from time to jsonnode
15:45:27Yardanicono
15:45:35Yardanicothere's no Time type in JSON
15:47:24FromGitter<zetashift> alright thanks!
15:48:00YardanicoI will do a lot of PRs here it seems :P https://github.com/btbytes/nim-cookbook/pulls
15:53:29miranYardanico: leave these easy topic for us beginners ;)
15:54:03Yardanicomiran, well this is a cookbook :) so it should contain beautiful & short code if possible
15:55:01*yglukhov joined #nim
15:59:39darkn0deis there an easy way to do list comprehensions? something like args = [quoteShell(arg) for arg in args]
15:59:51darkn0de(or is that the wrong way to safely quote args before joining?
16:00:17Yardanicodarkn0de, well there is
16:00:32darkn0debtw, Yardanico can you take paypal where you are
16:00:33Yardanicodarkn0de, https://nim-lang.org/docs/future.html
16:00:33*durandu quit (Quit: Page closed)
16:00:52darkn0deawesome
16:01:07darkn0dethat's so awesome
16:01:14Yardanicodarkn0de, well I probably can
16:01:17*darkn0de is now known as jamieson
16:01:21Yardanicowhy are you asking ? :)
16:01:38jamiesoni'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:06jamiesonbeckerxdid you see that or did it come across during my nick change ;)
16:02:35Yardanicojamiesonbeckerx, yeah, I saw your message
16:02:40jamiesonbeckerxcool
16:02:44*jamiesonbeckerx is now known as darkn0de
16:03:29darkn0dei'm actually working on it but then realized that you all would probably do it faster and better ;)
16:03:37darkn0de(and wow nim is fun to code in)
16:05:52darkn0dehttps://github.com/userify/shim/blob/master/shim.py#L456 will probably be not as clean in nim.
16:06:25darkn0debut 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:24darkn0de(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:22Yardanicodarkn0de, I can probably try, but how I can test it?
16:46:26darkn0deLet's discuss offline? shoot me an email and I'll get a test vm set up
16:46:51darkn0defirst 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:40miranto 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:00FromGitter<stisa> miran : maybe `toCountTable` ? Not sure if it increases the count while creating the table though
17:34:02miranstisa: 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:51Arrrryou 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:06miranArrrr: 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:57FromGitter<GooRoo> Is there any way to document every object field separately so they are nicely rendered in documentation?
18:39:25miranArrrr: 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:05FromGitter<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:26FromGitter<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:38ArrrrNice, you could add an overload that accepts a proc
19:02:55*gokr quit (Ping timeout: 248 seconds)
19:03:49FromGitter<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:53FromGitter<kdheepak> Is there a way for a fully functioning repl to work in Nim? What would something like that entail?
19:28:38dom96There is, but it's not easy.
19:28:45dom96You'd need to implement the FFI for Nim's VM
19:29:51*Nobabs25 joined #nim
19:30:39FromGitter<kdheepak> I'm curious as to why you say that is not easy to do?
19:30:56FromGitter<kdheepak> Do you think that is the only thing that prevents a fully functioning repl?
19:31:02federico3kdheepak what's the use case for a REPL in Nim?
19:31:54dom96kdheepak: 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:32FromGitter<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:20FromGitter<kdheepak> Creating visualizations to explore data without a REPL seems rather challenging.
19:34:45FromGitter<kdheepak> I'd be willing to contribute my efforts to this, if someone could point me in the right direction.
19:35:27FromGitter<kdheepak> Haha @dom96 I figured it might be challenging but didn't know it was THAT challenging.
19:36:48Araqdom96: actually I succeeded but I don't want to maintain it and the edge cases cannot be resolved
19:36:57FromGitter<stisa> @kdheepak I assume you already know about `nim secret`, what's missing from it?
19:37:09FromGitter<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:28FromGitter<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:56FromGitter<kdheepak> @Araq Can you point me to this? I'm curious to take a look at it.
19:39:23FromGitter<GooRoo> @stisa don't really like how it looks https://nim-lang.org/docs/httpclient.html#HttpClientBase, but thanks
19:40:07FromGitter<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:54Araqthe 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:35Araqor "C takes a function pointer we have an Nim proc with bytecode, what now?"
19:43:59Araqnot 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:37Araqthere are widespread systems that solved these problems long ago. they are called databases.
19:44:54FromGitter<Yardanico> @kdheepak you can import modules from nim secret
19:48:16Araq@kdheepak: the implementation is in compiler/evalffi.nim
19:49:46Araqbootstrap with -d:useFFI to enable it but it probably won't compile out of the box anymore
19:50:22FromGitter<kdheepak> @Araq thanks for those answers. Those do seem like challenging issues.
19:52:15Araqkdheepak: our best bet seems to be the externally maintained LLVM backend
19:52:17FromGitter<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:36AraqI would look at Nim's LLVM backend and see what it takes to leverage LLVM to get a decent REPL
19:53:47Araqthe VM is a deadend for this
19:54:56Araqor 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:00Araqsooner 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:42Araqso yeah, once again, patch something that produces native code.
19:57:00FromGitter<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:40FromGitter<kdheepak> What did you mean by Nim's LLVM backend? I thought Nim currently only supported c/cpp/js?
19:59:42Araqhttps://github.com/arnetheduck/nlvm
20:01:00AraqI really wish people would help this project more, it's also a key project to get better debugging support off the ground
20:01:36FromGitter<kdheepak> Wow! Great.
20:02:54FromGitter<kdheepak> On a somewhat unrelated note, there must be a way to get github to support nim syntax highlighting, right?
20:03:14Araqhuh? it does highlight Nim code
20:03:59Araqthe highlighting is a bit outdated though and I don't buy these arbitray semantic nuances but that's a different topic
20:05:15Araqspeaking of which VS Code highlights 'and' the same as 'uint32', that's wrong, one is a keyword the other a builtin
20:05:19FromGitter<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:18Araqand 'case' has a different color than 'of'
20:06:46Araqthe logic behind it seems to be "Hauptsache bunt"
20:07:22Araq(something like "at least it's colorful")
20:08:58miranstisa ("`openarray` instead of `seq` maybe?") - yeah, this might me a good idea
20:12:04FromGitter<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:36dom96It already supports them
20:14:15dom96!eval let £ = 4.43; echo(£)
20:14:16miranstisa - on the other hand, only three functions in `sequtils` use `openarray`, all others have `seq` as parameter :/
20:14:18NimBot4.43
20:14:31FromGitter<kdheepak> I learn something new everyday.
20:14:53FromGitter<kdheepak> (What?! I didn't know about NimBot. That's so cool!)
20:16:39*TjYoco quit (Ping timeout: 258 seconds)
20:17:59FromGitter<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:34FromGitter<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:40FromGitter<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:54FromGitter<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:16FromGitter<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:00FromGitter<gokr> Sidenote: Anyone liking REPLs should at least once take a look at a real Smalltalk environment.
20:44:54federico3the 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:29skrylarhttp://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:47FromGitter<Yardanico> @kdheepak many stdlib modules are pure-nim
21:41:50FromGitter<Yardanico> so they work in VM
21:42:09*TjYoco joined #nim
21:42:56FromGitter<Yardanico> e.g. tables, sequtils, strutils, algorithm, sets, lists, deques, intsets, critbits, etc...
21:42:59FromGitter<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:15FromGitter<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:15FromGitter... 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:15FromGitter<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:57Yardanicothere are already nim kernels for jupyter btw
21:59:59FromGitter<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:59FromGitter... 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:03Yardanicobut they're in alpha state it seems
22:00:26Yardanicoe.g. https://github.com/stisa/INim
22:00:34Yardanicoor https://github.com/stisa/jupyter-nim-kernel
22:00:44Yardanicofirst one is a complete rewrite (everything is in nim)
22:00:50Yardanicosecond one uses python as a kernel
22:01:28Yardanicobtw https://github.com/stisa/INim has visualization support
22:01:41Yardanicovia matplotlib wrapper
22:04:20FromGitter<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:07Yardanicokdheepak: probably by writing to the file and compiling it
22:05:42*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:06:48YardanicoNOTE: running a notebook with this creates a directory inimtemp in which it stores blocks of code, pngs, compiled outputs, etc.
22:07:10FromGitter<kdheepak> Thanks. I think you are right. I see the use of tinycc in the private/sockets.nim folder
22:07:37Yardanicoyeah it works
22:08:11Yardanicokdheepak: but it doesn't use tinycc
22:08:44Yardanicoah wait
22:08:45Yardanicoit does :)
22:08:59Yardanicoah no
22:09:09Yardanicoonly if you use #>tinycc magic
22:09:45FromGitter<kdheepak> This line (https://github.com/stisa/INim/blob/master/private/sockets.nim#L207)?
22:10:02Yardanicotcc_path will be empty here
22:10:06Yardanicohttps://github.com/stisa/INim/blob/master/private/sockets.nim#L181
22:10:14Yardanicoalso it almost doesn't share contexts
22:50:01*TjYoco quit (Ping timeout: 240 seconds)
22:54:08YardanicoAraq, 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:48FromGitter<zetashift> @Yardanico you there by any chance?
23:25:53Yardanicoyep
23:26:38FromGitter<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:51FromGitter<zetashift> I have no idea what the equivalant of that would be? last proof and proof are ints
23:27:08FromGitter<zetashift> $(last_proof + proof)?
23:27:37FromGitter<Yardanico> ($last_proof & $proof)
23:27:43FromGitter<Yardanico> f is string interpolation from python 3.6
23:27:53FromGitter<zetashift> I know, my google-fu isn't that weak!
23:27:57FromGitter<zetashift> I think...
23:28:08FromGitter<zetashift> but thanks ;D
23:28:08FromGitter<Yardanico> well I did use f-strings in the past :)
23:28:14FromGitter<Yardanico> and there are already nim libraries for string interpolation
23:28:19FromGitter<zetashift> I should just use your python hehe
23:28:24FromGitter<zetashift> py2nim incoming
23:28:35FromGitter<Yardanico> well it's just a simple PoC
23:28:46FromGitter<Yardanico> it should be something like https://github.com/google/grumpy
23:29:09*TjYoco quit (Quit: Leaving)
23:29:57FromGitter<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:16FromGitter<Yardanico> well I mean how it does python - go
23:31:30FromGitter<Yardanico> hmm
23:31:31FromGitter<zetashift> ah okay
23:31:40FromGitter<Yardanico> they parse python in python :P
23:32:04FromGitter<Yardanico> so python code does python-grumpy compilation
23:32:54FromGitter<Yardanico> hhmm I don't think this is the best solution
23:32:55FromGitter<Yardanico> maybe it is
23:34:13FromGitter<zetashift> Does nim have an equivalent of [:x] of python builtin?
23:34:16FromGitter<zetashift> x being an index
23:34:40FromGitter<Yardanico> it's a slice from 0 to x, right?
23:34:59FromGitter<zetashift> no a slice from the end to (end - x)
23:35:10*sleepyqt quit (Remote host closed the connection)
23:35:18FromGitter<Yardanico> can you show full code line?
23:35:42FromGitter<zetashift> guess_hash[:4] == "0000" so the last 4 digits of the var ends with 0000
23:36:08FromGitter<zetashift> currently have len(array)-4 .. len(array)
23:36:23FromGitter<Yardanico> well that's "items from the beginning through end-1"
23:36:31FromGitter<Yardanico> so guess_hash[0..^4]
23:36:37FromGitter<Yardanico> ah
23:36:37FromGitter<Yardanico> sorry
23:36:48FromGitter<Yardanico> guess_hash[0..4]
23:36:57FromGitter<Yardanico> or guess_hash[0..3]
23:37:04FromGitter<Yardanico> one of these
23:37:05FromGitter<zetashift> alright thanks
23:41:14*Jesin quit (Quit: Leaving)
23:56:10*ipjk quit (Quit: Leaving)
23:56:13libmanPublic service announcement: 41.396% of Nim repos on GitHub are missing a license file (that GitHub can auto-detect).
23:56:20FromGitter<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:32libmanhttps://github.com/lbmn/libman.org/blob/master/piki/tiole.md#nim-github-repos
23:56:56Yardanicolibman, if they're missing a license file - that doesn't mean they're copyfree :P
23:57:07Yardanicothey may still contain license in source files
23:57:10Yardanicobut nice one
23:57:32Yardanicolibman, btw, should I paste license in my source files if I have LICENSE file in root project dir?
23:57:33libmanYeah, but the goal is to make Nim the most legalese-free programming experience.
23:58:17libmanGitHub is the trend-setter, so whatever it auto-detects is the standard way.
23:59:43FromGitter<zetashift> Makes even more sense now thanks @kdheepak