<< 25-08-2017 >>

00:03:53*maksima joined #nim
00:04:10*Jesin joined #nim
00:04:26FromGitter<zacharycarter> whoa cool
00:04:44FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=599f699cba0f0f6e38ddb58a]
00:04:47FromGitter<zacharycarter> graphql with Nim
00:05:02maksimahello, can somebody tell me what is wrong with this program: https://pastebin.com/wpabbbhM
00:08:09FromGitter<zacharycarter> you're declaring an empty sequence
00:08:13FromGitter<zacharycarter> and then trying to assign a value to index 1
00:08:32FromGitter<zacharycarter> https://play.nim-lang.org/?gist=8f10b9197fadf147855281eab13cbaec
00:08:33FromGitter<zacharycarter> try that
00:11:03maksimaFromGitter: So what does .add method do ? it reserves a new slot within the sequence?
00:11:04FromGittermaksima, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
00:14:29FromGitter<zacharycarter> https://nim-lang.org/docs/system.html#add,seq%5BT%5D,openArray%5BT%5D
00:16:13*maksima quit (Quit: Page closed)
00:20:32FromGitter<zacharycarter> wow nim jsffi is killer
00:21:01*Jesin quit (Quit: Leaving)
00:25:54FromGitter<zacharycarter> if I could just figure out the answer to my first question
00:25:59FromGitter<zacharycarter> about why I can't invoke that function
00:26:29*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
00:26:56*vivus joined #nim
00:33:56*yglukhov joined #nim
00:34:22FromGitter<zacharycarter> figured out a solution
00:34:26FromGitter<zacharycarter> now I need to figure out how to access this
00:34:37*itseris quit (Quit: Konversation terminated!)
00:36:00*gangstacat quit (Quit: Leaving)
00:38:05*yglukhov quit (Ping timeout: 240 seconds)
00:45:36*hobomatic quit (Quit: Leaving)
00:53:04*Jesin joined #nim
00:55:10*sleepyqt quit (Quit: WeeChat 1.9)
00:57:26TheManiacWould appreciate any pointers from you or Araq on how to do this properly...
00:57:47TheManiacdom96: Thanks for the pointer. I've made it work, but it took hacking `osproc` - see https://github.com/nim-lang/Nim/issues/6275
00:58:45TheManiacsleep time now
01:00:19*rauss joined #nim
01:03:35*vlad1777d quit (Remote host closed the connection)
01:13:41FromGitter<zacharycarter> hrm is there any way to use async / await with JS and Nim?
01:14:17*demi- quit (Quit: Server shutdown in 3... 2... 1...)
01:28:22*ShalokShalom quit (Remote host closed the connection)
01:35:00*pilne joined #nim
01:35:53*yglukhov joined #nim
01:40:21*yglukhov quit (Ping timeout: 252 seconds)
01:49:27*dddddd quit (Remote host closed the connection)
01:50:02Demos[m]ahhhb the bug here is where the compiler's nimcache parameter can not contain a "short" filename
01:58:00FromGitter<zacharycarter> escape it?
01:58:03FromGitter<zacharycarter> `short`
01:58:07FromGitter<zacharycarter> ``short``
01:58:10FromGitter<zacharycarter> damnit
01:58:13FromGitter<zacharycarter> use backticks lol
01:58:30*chemist69 quit (Ping timeout: 252 seconds)
02:02:38*vivus quit (Quit: Leaving)
02:10:00*big_num quit (Quit: WeeChat 1.7)
02:12:19*chemist69 joined #nim
02:56:09*skrylar joined #nim
02:56:25*skrylar appears for a ponderance: is making a macro for transform matrices worthwhile
02:56:49skrylarOn one hand you don't *usually* make them by hand. On the other, when you do it reads a lot nicer if you can just say "pitch x, scale y"
03:07:16*endragor joined #nim
03:08:47*endragor quit (Remote host closed the connection)
03:09:14FromGitter<jrdlph> this is one of the reasons I am playing around with nim in the first place. Efficient graphics requires you to encode geometry in terms of linear algebra, but linear algebra isn't very intuitive (to me at least)
03:18:50FromGitter<jrdlph> like, I don't want to transform the coordinate space to rotate an object. You don't turn the whole damn room in order to face your coffee cup in a different direction. Yet capturing this inversion of control can lead to other weirdness if you are doing it at runtime in terms of encapsulation rather than at compile time in terms of a syntactic transformations
03:37:53*yglukhov joined #nim
03:41:57*yglukhov quit (Ping timeout: 240 seconds)
03:44:42*endragor joined #nim
03:48:49*rauss quit (Quit: WeeChat 1.9)
03:49:46*rauss joined #nim
03:58:00*endragor quit (Remote host closed the connection)
04:02:36skrylarjrdlph yea. macros are nice
04:05:52skrylari'm mostly dodging C++. but meh
04:05:56skrylarhate those slow compile times.
04:06:25skrylaralthough ccache and nim seem to be getting along weirdly. it keeps trying to build a new stdlib_system for each module; but they all have the same compile flags, so it shouldn't be doing so
04:08:17*endragor joined #nim
04:08:20*mahmudov quit (Remote host closed the connection)
04:12:49*endragor quit (Ping timeout: 248 seconds)
04:13:22skrylari saw the godot devs were recommending people use [quake maps] for prototypes. i thought that was amusing
04:13:31skrylarwell they said constructive solid geometry, but that usually means quake maps
04:17:24skrylarnow the saurbraten thing i would like to see happen more :(
04:17:32skrylarits basically a big octree with some edge deformation
04:24:22*PrimordialHelios joined #nim
04:24:38PrimordialHeliosWhat's the difference between method and proc?
04:27:46skrylarPrimordialHelios, methods have dispatch procs dont
04:29:00skrylarmethods are basically virtual calls but they aren't implemented like that
04:31:26PrimordialHeliosThanks!
04:39:36*PrimordialHelios quit (Quit: Leaving)
04:48:29skrylarmeh. can't wait to be done with yak shaving and play around with bgfx2
04:59:29*endragor joined #nim
05:06:02*haha_ joined #nim
05:13:54skrylari always wonder if these sandbox worlds are inherently unoptimizable or if people simply don't try
05:14:47skrylarpartly because Sauerbraten has an amazing map format/editor setup, and its "just" a shooter. But it has a built-in LOD strategy that works indoors and outdoors. But then I see these block games, and they aren't even doing basic instancing
05:23:40*pilne quit (Quit: Quitting!)
05:40:08*yglukhov joined #nim
05:40:57*haha_ quit (Quit: haha_)
05:41:44*endragor quit (Remote host closed the connection)
05:44:21*yglukhov quit (Ping timeout: 240 seconds)
05:45:50*skrylar wonders what the recommended way to deal with tls sockets on nim currently is
06:01:01*gangstacat joined #nim
06:02:10*endragor joined #nim
06:06:48*endragor quit (Ping timeout: 240 seconds)
06:10:04*Yardanico joined #nim
06:11:07*rauss quit (Quit: WeeChat 1.9)
06:21:57*arnaud2 quit (Quit: WeeChat 1.9)
06:29:11*haha_ joined #nim
06:29:35*jackv quit (Quit: WeeChat 1.8)
06:32:05Yardanicoskrylar, probably https://nim-lang.org/docs/net.html#SslContext ?
06:32:35*haha_ quit (Client Quit)
06:32:36FromGitter<Yardanico> you can wrap your socket with ssl context
06:33:15FromGitter<Yardanico> https://nim-lang.org/docs/net.html#wrapSocket ⏎ ⏎ but it says there that it is untested
06:33:34FromGitter<Yardanico> ah
06:33:36FromGitter<Yardanico> they'wrong
06:33:39FromGitter<Yardanico> it's actually tested
06:33:44FromGitter<Yardanico> https://github.com/nim-lang/Nim/blob/5f685bb0e6b2d68b9796e6a7d29469ce3f3b38ec/tests/async/tasyncssl.nim
06:34:08FromGitter<Yardanico> well yeah, no one tested it for security vulnerabilities
06:36:25*nsf joined #nim
06:38:38*endragor joined #nim
06:43:24*endragor quit (Ping timeout: 252 seconds)
06:46:56FromGitter<jrdlph> regarding nimble, is there a way to specify dependencies not published in a local/remote repository?
06:48:48FromGitter<jrdlph> *is thinking maybe a project-local repository/registry in which he associates package names with urls*
06:51:27skrylartbh i don't use nimble to manage my packages. i use it to find them and then use git submodules
06:51:29Yardanicoyes there is
06:51:35skrylarwhich in turn don't help with private packages tho :(
06:51:41Yardanicoyou can specify git repositories IIRC
06:51:59FromGitter<jrdlph> where at? directly in the 'requires' directive?
06:52:22*Sembei joined #nim
06:52:57FromGitter<jrdlph> i know you can make your own user-level package lists with .config/nimble/nimble.ini , just not sure how to do something similar at the package level
06:54:01*Pisuke quit (Ping timeout: 240 seconds)
06:58:19FromGitter<zacharycarter> yes @jrdlph
06:58:36FromGitter<zacharycarter> right in the requires directive
06:58:38*haha_ joined #nim
06:58:39FromGitter<jrdlph> alright
06:58:42FromGitter<zacharycarter> requires "giturlhere"
06:58:49FromGitter<jrdlph> excellent
06:59:11Yardanicoand probably mercurial url will work too
06:59:33FromGitter<zacharycarter> I think for mercurial it tries to use some h2git
06:59:39Yardaniconah
06:59:42skrylarmercurial is ok
06:59:46Yardanicoit uses your hg client :)
06:59:50FromGitter<zacharycarter> oh
06:59:57skrylari liked the patch queues
07:00:02*MyMind joined #nim
07:00:10*Sembei quit (Ping timeout: 240 seconds)
07:00:18*FromGitter * jrdlph wonders if he could get it to use darcs
07:00:19FromGitter<zacharycarter> does anyone know if it's possible to make a js proc async in Nim?
07:01:20skrylarjavascript doesn't have asynchronicity though
07:01:31FromGitter<zacharycarter> I mean for the node backend sorry
07:02:00skrylaryea, but node doesn't have it either. it just has some clever juggling
07:02:12Yardanicopython range in nim: https://play.nim-lang.org/?gist=2fdd06608f53a11a867943dfed9e0b1b I consider it a bit hacky (probably because of dummy = false), but it's the only way to distinguish templates vs iterators
07:02:15Yardanicobut I'm amazed
07:02:28Yardanicothat you can port a function from dynamically typed language to statically typed one
07:02:39skrylarthat's always been true, Yardanico
07:02:43Yardanicoit works even with range(0, -10, -2)
07:02:50skrylarit just requires more punches to the face in the form of syntax boilerplate
07:03:19*Arrrr joined #nim
07:03:33skrylarpondering if it would be worth using a macro to do this vector code :\
07:04:07skrylarit's a toss-up because macros and nim doc tend to react stupid with each other, though hand-writing versions of vector math procs has no value
07:06:18*PMunch joined #nim
07:06:29skrylaralso the person who requested the native toml4 reader *might* get their wish
07:06:37skrylarthe bson thing i was working on is almost done
07:15:17*yglukhov joined #nim
07:16:48*yglukhov quit (Remote host closed the connection)
07:17:00*yglukhov joined #nim
07:34:20skrylari'll admit i barely understand most of this math
07:34:40skrylarthis book shows a wall of calculus as 'proof' for ray/plane intersection and its just like. ok
07:37:21*couven92 joined #nim
07:41:19*gangstacat quit (Quit: Leaving)
07:43:10*gangstacat joined #nim
07:44:53*gangstacat quit (Client Quit)
07:50:22*endragor joined #nim
07:55:01*endragor quit (Ping timeout: 240 seconds)
07:57:43*BitPuffin|osx joined #nim
07:57:58Yardanicolol
07:59:25Yardanicohttps://gist.github.com/Yardanico/200b607b790a7b79c1d2d95c7f56bca3 with using pylib and without specifying specific int types it's only 180 msec
07:59:31Yardanicoand pure nim version is 120 msec
08:00:02Yardanico(also you can see other than "var", @[] instead of @, and some types it looks like python version :D
08:01:02Yardanicobut some things in pylib are VERY hacky
08:01:35Yardanicofor example I needed to add pythons version of "int" to str conversion, and it shadows system's int, so I created another template
08:02:13*nhywyll joined #nim
08:03:54Yardanicohttps://github.com/Yardanico/nimpylib but I know that my code here is very hackish
08:04:02YardanicoVERY hackish
08:05:03*endragor joined #nim
08:05:28*vlad1777d joined #nim
08:05:56Yardanicobut honestly I'm amazed it's so fast
08:06:07YardanicoI didn't optimize procedures at all
08:06:34skrylarc code can be
08:06:59Yardanicoskrylar, well did you look at this gist? it looks almost like python yet it's much faster
08:09:35YardanicoI get 1.3 seconds with Python 3.6, 0.18 with pylib version, and 0.12 with pure version
08:09:54*yglukhov quit (Remote host closed the connection)
08:10:58*yglukhov joined #nim
08:11:08skrylarYardanico, try -d:release :p
08:11:15Yardanicoskrylar, it's with -d:release :P
08:11:18skrylarah
08:11:29skrylaryea looks mean nothing. as far as machine code is concerned
08:11:33Yardanicoskrylar, pure version is as fast as C and C++
08:11:42skrylarthe thing with nim is you can easily make sugar for stuff but that doesn't really exist in c
08:11:50Yardanicoit's from here https://blog.famzah.net/2016/09/10/cpp-vs-python-vs-php-vs-java-vs-others-performance-benchmark-2016-q3/
08:12:05Yardanicodef- helped me to optimize my first version of this microbenchmark
08:12:59Yardanicohttps://gist.github.com/def-/fd6f528e51683f7b1baa60518b426d74
08:15:10*yglukhov quit (Ping timeout: 240 seconds)
08:16:30*vlad1777d quit (Ping timeout: 240 seconds)
08:20:41FromGitter<jrdlph> the difference between ref and ptr is garbage collection? Or is it something else?
08:20:51Yardanicoyeah
08:21:02YardanicoAFAIK ref is a traced reference
08:21:08Yardanicoptr is an untraced reference
08:21:20Yardanicobut I may be wrong because I don't use ptr
08:21:24Yardanico(only for C FFI)
08:21:41FromGitter<jrdlph> yes, the manual says 'traced' but i wasn't entirely sure that that had anything to do with garbage collection. Sounded very garbage-collectionie though
08:29:43*vlad1777d joined #nim
08:57:08*Vladar joined #nim
08:59:27PMunchTraced references(ref) point to objects of a garbage collected heap, untraced references(ptr) point to manually allocated objects or to objects somewhere else in memory. Thus untraced references(ptr) are unsafe. However for certain low-level operations (accessing the hardware) untraced references(ptr) are unavoidable.
08:59:41PMunchFrom the manual, italics mine for clarity
09:00:35PMunchTypically you will use ptr when dealing with C code wrappers as they allocate and deallocate their own memory and you only need the pointer to pass between functions
09:04:33FromGitter<zacharycarter> I'm about to play with nim cuda
09:04:42FromGitter<zacharycarter> see if I can get an example running before my presentation
09:08:19*jinshil quit (Quit: Good-bye!)
09:12:57*haha_ quit (Quit: haha_)
09:12:58*chemist69 quit (Ping timeout: 276 seconds)
09:15:38*xet7 joined #nim
09:17:26*haha_ joined #nim
09:21:27*MyMind quit (Ping timeout: 240 seconds)
09:23:30FromGitter<zacharycarter> damn I wish I understood how to run this
09:24:06*MyMind joined #nim
09:25:57*yglukhov joined #nim
09:26:15*chemist69 joined #nim
09:26:39*yglukhov quit (Read error: Connection reset by peer)
09:27:07*yglukhov joined #nim
09:31:18*yglukhov quit (Ping timeout: 240 seconds)
09:34:55*vlad1777d quit (Ping timeout: 248 seconds)
09:37:03*skrylar quit (Remote host closed the connection)
09:41:52*yglukhov joined #nim
09:43:12PMunchzacharycarter, how to run CUDA code?
09:44:34Yardanicois there something wrong with this code?
09:44:34Yardanicohttps://gist.github.com/Yardanico/371ccbc984c07f0de7b52f643e060a64
09:44:38Yardanicoit crashes the compiler
09:44:49YardanicoI'll make an issue, but maybe I'm misusing concepts?
09:46:43PMunchRunning it on the playground it throws a compiler error, but doesnt' crash
09:46:43Yardanicohttps://github.com/nim-lang/Nim/issues/6277
09:46:52PMunchSays it's got a type mismatch
09:47:02Yardanicomaybe because there was concept improvemenents in 0.17.0?
09:47:20PMunchWhat does the playground run?
09:47:24Yardanico0.16.0
09:47:30PMunchAh, that might be it then
09:47:52PMunchI unfortunately don't have Nim installed here so I can't check it out for you :(
09:48:24Yardanicohmm
09:48:28Yardanicoit seems to be array-specific issue
09:48:30Yardanicoworks with sequence
09:49:48PMunchWell, arrays are a bit strange in Nim
09:50:26FromGitter<stisa> @zacharycarter did you see https://github.com/jcosborn/cudanim ? It was in the presentation linked here some days ago, it has some demos
09:50:28PMunchBut I still don't see why the compiler should crash because of it
09:51:17Yardanicoline 839 is var first = intLiteral(firstOrd(ty))
09:52:36Yardanicoso yeah it's indeed something to do with arrays
09:52:40Yardanicoproc is called proc genArrayElem(p: BProc, x, y: PNode, d: var TLoc) =
09:52:59FromGitter<zacharycarter> @stisa yup! I'm trying to run said demos now
09:53:20FromGitter<zacharycarter> @PMunch yeah - trying to run the cuda examples from nimcuda
09:53:50Yardanicoah
09:54:04Yardanicothis procedure somehow gets "Iterable[int, Iterable]"
09:54:08Yardanicoas an array type?
09:54:14FromGitter<zacharycarter> oh wow it worked
09:55:41PMunch:)
09:56:20PMunchYardanico, I think that is a type with two generics
09:57:11PMunchI think it struggles to determine what T is supposed to be
09:57:22YardanicoPMunch, so genBracketExpr creates ty variable, which is "array[0..4, int]", and accepts n nimnode, which is "iter[i]"
09:57:33PMunchTry to do something like "var s:int = sum([1, 2, 3, 4, 5])
09:57:54Yardanicosame error
09:58:13Yardanicobasically it tries to get minimal value of tyUserTypeClassInst type
09:58:36Yardanicomaybe this is a concept limitation currently?
09:59:01Yardanicohmm, no
09:59:10Yardanicoif I change concept to "x.items() is T", error is the same
09:59:38PMunchHmm, the items iterator for array is a bit different than the rest..
09:59:52PMunchMaybe that's why array fails why sequence does not
10:05:13FromGitter<zacharycarter> still curious how I can produce async procs for the nodejs backend
10:34:11*dddddd joined #nim
10:38:06FromGitter<stisa> @zacharycarter You probably need to use emit or change the js backend to emit `async function` instead of `function` when the proc has the async pragma
10:39:07FromGitter<zacharycarter> @stisa yeah - I was playing around with wrapping graphql last night and I was getting reasonable results but I couldn't figure out how to create async callbacks for koa
10:40:03FromGitter<zacharycarter> an actual Nim graphql implementation would be killer
10:40:10FromGitter<zacharycarter> but it looks like a lot of work
10:47:45*haha_ quit (Quit: haha_)
10:48:46*haha_ joined #nim
11:00:49*Araq_ joined #nim
11:01:06Yardanicowow
11:01:11Yardanicothat was fast
11:01:24Yardanicoah, auto-ban
11:01:57FromGitter<jrdlph> @Yardanico it works with a simpler sum function (that specifies the iterable is over ints), and if you use the right syntax for specifying that the argument is iterable. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a003a4ba0f0f6e38e017d5]
11:02:27Yardanicojrdlph, ah, so it's probably my fault
11:03:08FromGitter<jrdlph> but if you, for instance, specify the argument type for sum like `sum(things: Iterable[int]):int` it barfs
11:03:18FromGitter<jrdlph> XD
11:03:58Yardanicowell I know it would be easy with ints, I want it to work with any types
11:04:16FromGitter<jrdlph> well, the types would have to have +
11:04:24FromGitter<jrdlph> and T does not
11:04:28FromGitter<Yardanico> lol wait
11:04:29FromGitter<Yardanico> waaait
11:05:02FromGitter<Yardanico> ```code paste, see link``` ⏎ ⏎ Why this works? Lol [https://gitter.im/nim-lang/Nim?at=59a0045d76a757f808e05c99]
11:05:12FromGitter<jrdlph> i have no idea
11:05:32FromGitter<jrdlph> put in some tuples see what happens
11:06:00FromGitter<Yardanico> is nim compiler so smart that it can detect the type of iterable?
11:06:44FromGitter<jrdlph> it does not typecheck on my side
11:07:14FromGitter<Yardanico> what do you mean?
11:07:19FromGitter<Yardanico> it doesn't work for you?
11:07:39FromGitter<jrdlph> specifying sum like that for me leads to a type error in the invocation of sum()
11:07:43FromGitter<jrdlph> with a list of ints
11:07:53FromGitter<Yardanico> well I have nim devel
11:07:56FromGitter<Yardanico> not 0.17.0
11:07:57FromGitter<jrdlph> oh
11:08:09FromGitter<jrdlph> i thought you were still in the playground
11:08:12FromGitter<Yardanico> ah
11:08:14FromGitter<Yardanico> 1) 16.0 is very old
11:08:20FromGitter<Yardanico> playground uses 0.16.0 atm
11:08:36FromGitter<jrdlph> it really should not be doing that though. I don't think its sound
11:08:58FromGitter<jrdlph> at least not for how this sort of thing should work in my head
11:09:09FromGitter<Yardanico> And in 0.17.0 a lot of improvements were done to concepts
11:09:25FromGitter<Yardanico> well I don't know how this works, maybe we can ask ⏎ @zah or Araq?
11:10:01*FromGitter * jrdlph now has to get devel and play around with this
11:10:23Yardanicowell you can try 0.17.0
11:10:35FromGitter<jrdlph> im on 0.17.0 release
11:10:39Yardanicohmm, ok then
11:10:49Yardanicomaybe this is a bug
11:11:07FromGitter<jrdlph> did you try to call sum with something without addition?
11:11:30FromGitter<jrdlph> a distinct of anything should do
11:11:34Yardanicoyes
11:11:44Yardanicoit shows proper type mismatch
11:11:47Yardanicofor echo sum(["x", "y"])
11:12:09Yardanicosince strings doesn't have "+" procedure
11:12:50FromGitter<jrdlph> Ok, yeah that is blowing my mind then.
11:12:54FromGitter<jrdlph> lol
11:13:44Yardanicoah
11:13:45YardanicoThe concept types can be parametric just like the regular generic types:
11:13:47*vendethiel joined #nim
11:13:48Yardanicomaybe because of this
11:13:54Yardanicohttps://nim-lang.org/docs/manual.html#generics-generic-concepts-and-type-binding-rules
11:13:58*vendethiel is now known as Ven``
11:14:06YardanicoUnbound static params will be inferred from expressions involving the == operator and also when types dependent on them are being matched:
11:16:01Yardanicooh wait
11:16:07Yardanicowe are noobs LOL
11:16:17Yardanicoit was just calling built-in sum function :D
11:16:41FromGitter<jrdlph> oh. well that makes sense then, yeah i didn't have math imported haha
11:17:31*haha_ quit (Quit: haha_)
11:17:35FromGitter<jrdlph> yeah because T is still unbound in the body of sum there. To assume it has + doesn't seem like it would make sense, unless it was doing something like generating a specialization of it or something
11:21:57YardanicoI'll wait for some info on compiler crash then
11:22:54Yardanicothe problem is - I can't even do something like "when T is array: error"
11:23:29FromGitter<jrdlph> But you could also make an 'Addable' that implements +
11:23:48FromGitter<jrdlph> and constrain T to Addable
11:23:57FromGitter<jrdlph> or Addible, idk
11:25:33FromGitter<jrdlph> well, it would need +, and also 0, or else empty lists couldnt work
11:26:03FromGitter<jrdlph> i think thats called a monoid
11:29:03FromGitter<jrdlph> so something like ⏎ ⏎ ```type CanPlusAndZero = category a,b, type T ⏎ 0 is T ⏎ a + b``` [https://gitter.im/nim-lang/Nim?at=59a009fe614889d47586434f]
11:33:17*haha_ joined #nim
11:34:10*sleepyqt joined #nim
11:34:53Yardanicojrdlph: it wouldn't help
11:35:13Yardanicothere's no error with + proc
11:35:26Yardanicothere's an error passing array which matches the concept to proc which accepts it
11:35:44YardanicoI'll show you
11:35:47FromGitter<jrdlph> ok
11:35:58*dom96|w joined #nim
11:38:57dom96|wzacharycarter: why are you trying to use Nim on node?
11:39:37Yardanicojrdlph: https://gist.github.com/Yardanico/4f9aa86bc4b3bff6254958cb3ca59aff
11:44:21Yardanicowell it's probably that arrays are very special
11:47:58FromGitter<jrdlph> its partly to do with how the type arguments are introduced
11:48:14dom96|walso, why isn't the Nim playground running 0.17.0?
11:48:23FromGitter<jrdlph> here, I have something very similar, that comples fine, but then segfaults when it runs
11:48:35Yardanicohmm, maybe zacharycarter didn't have time to upgrade it, but I don't know
11:48:52FromGitter<Yardanico> @zacharycarter
11:49:28FromGitter<Yardanico> @jrdlph can you share it?
11:49:31FromGitter<jrdlph> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a00ecbee5c9a4c5ffa718b]
11:50:02FromGitter<Yardanico> it does not crash for me
11:50:12FromGitter<jrdlph> when you run the program?
11:50:17FromGitter<Yardanico> yes
11:50:20FromGitter<Yardanico> it echoes 10
11:50:33FromGitter<jrdlph> i get a segfault
11:50:47FromGitter<jrdlph> (on 0.17.0 release)
11:51:20FromGitter<Yardanico> well with this proc sum only works for arrays
11:51:26FromGitter<jrdlph> lol
11:53:00FromGitter<jrdlph> I think maybe this potato needs to go back into the oven to bake for a while
11:53:11FromGitter<jrdlph> not quite ready
11:53:53Yardanicowell this seems to be an array-specific issue only
11:53:59Yardanicoconcepts can be very complex
11:54:02Yardanicoand they work
11:54:57FromGitter<jrdlph> that any of it works is a wonder to me. its a very slick system
11:56:40euantorIt would be neat if the playground could let you run you code on a choice of versions with a dropdown (similar to the rust playground where you can run on rust nightly or standard)
11:57:04Yardanicoit would require a build system :) even simple one, but a build system :)
11:57:18Yardanicoto build nightly at least once a day
11:57:35Yardanicobut yeah, would be very nice
11:58:49euantorIt's all ran in Docker containers, so could always have a nightly Docker image that gets rebuilt at 1AM every day or something
11:59:34dom96|windeed :)
11:59:46dom96|wMake a PR :P
12:00:25euantorI'll need to find some free time first but I'll try
12:00:33Yardanicowell currently playground is only 150 lines of nim
12:10:09*kunev quit (Ping timeout: 248 seconds)
12:15:36*endragor quit (Remote host closed the connection)
12:18:18*endragor joined #nim
12:25:52*kunev joined #nim
12:29:23*Snircle joined #nim
12:32:48*dddddd quit (*.net *.split)
12:32:48*Arrrr quit (*.net *.split)
12:32:48*Yardanico quit (*.net *.split)
12:32:48*Jesin quit (*.net *.split)
12:32:48*gmpreussner quit (*.net *.split)
12:32:48*niv quit (*.net *.split)
12:33:09*Jesin joined #nim
12:33:13*Arrrr joined #nim
12:33:13*Arrrr quit (Changing host)
12:33:13*Arrrr joined #nim
12:33:14*niv joined #nim
12:33:17*dddddd joined #nim
12:33:18*Yardanico joined #nim
12:33:21*gmpreussner joined #nim
12:35:17*yaiyan quit (Ping timeout: 260 seconds)
12:36:57*yaiyan joined #nim
12:39:38*nsf quit (Quit: WeeChat 1.9)
12:42:02*pilne joined #nim
12:45:21*endragor quit (Remote host closed the connection)
12:49:15FromGitter<zacharycarter> @dom96 I was trying to play around with using the node graphql api
12:49:28FromGitter<zacharycarter> @dom96 it's using whatever version docker is
12:53:05FromGitter<zacharycarter> if docker hub is up to date, I probably need to rebuild the image
12:55:30Yardanicoit's 0.17.0 afaik
12:55:51*endragor joined #nim
12:55:56FromGitter<zacharycarter> hrm I'll try to rebuild the dockerhub image
12:55:58Yardanicolatest-regular
12:59:21FromGitter<zacharycarter> I just rebuilt the docker image
12:59:23FromGitter<zacharycarter> so hopefully it's up to date now
13:07:03*arnetheduck joined #nim
13:10:02Yardanicoyglukhov, it seems that everything apart from 64-bit gcc is affected
13:10:05Yardanico(on linux)
13:10:54yglukhovYardanico: maybe you're just lucky enough? try run it in a while true in sh
13:11:29*ludocode quit (Ping timeout: 248 seconds)
13:11:46Yardanicoyglukhov, running it now, no, it doesn't crash at all
13:12:13yglukhovthats strange...
13:13:10yglukhovon macos i cant get this code to work properly no matter gcc or clang, 64 or 32.
13:13:18*endragor quit (Remote host closed the connection)
13:13:34yglukhovthe results are somewhat random but always wrong
13:13:36Yardanicoyglukhov, what is your gcc?
13:13:48Yardanicoyglukhov, I have 7.1.1
13:13:57Yardanicoand clang 4.0.1
13:14:19yglukhovwell... my gcc is kinda llvm...
13:14:19yglukhov=)
13:14:24yglukhovConfigured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
13:14:24yglukhovApple LLVM version 8.1.0 (clang-802.0.42)
13:14:24yglukhovTarget: x86_64-apple-darwin16.7.0
13:14:26yglukhovThread model: posix
13:14:28yglukhovInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
13:14:31Yardanicoah
13:14:44Yardanicoisn't this a clang emulating gcc?
13:15:16Yardanicook, doesn't matter
13:15:26*endragor joined #nim
13:15:58yglukhovdunno, its not a symlink or smth, but i recall apple used gcc frontend with llvm backend a while ago, maybe thats the case
13:16:22*ludocode joined #nim
13:17:59YardanicoI use clang on linux because it has faster compilation :)
13:18:34yglukhovthere are rumors that gcc often produces faster binaries though ;)
13:18:47Yardanicoyglukhov, well yeah I know about this
13:18:53Yardanicoprobably it's true considering how old GCC is
13:19:11Yardanicobut clang is the future I would say
13:19:23yglukhovyup, just like nim is :D
13:20:35*endragor quit (Ping timeout: 240 seconds)
13:21:55Yardanicoyglukhov, compiling a small file: with gcc - 1.6sec, with clang - 0.9 sec (in release mode)
13:22:08Yardanicoand speed is identical
13:22:28Yardanicoclang even produces smaller binary
13:22:37Yardanico64kb vs 96kb
13:23:17yglukhovyeah, i think clang was initially designed with compilation speed in mind. while for gcc it was too late when the problem was realized =)
13:25:44Yardanicoyglukhov, well yeah, clang is more modern and it can learn a lot from bad/good things in gcc
13:26:33federico3yglukhov: "rumors"?
13:27:18yglukhovfederico3: theres ';)' at the end
13:39:01*yglukhov quit (Remote host closed the connection)
13:45:28*yglukhov joined #nim
13:46:17*nattefrost joined #nim
13:46:20*yglukhov quit (Read error: Connection reset by peer)
13:46:42*yglukhov joined #nim
13:48:48*haha_ quit (Quit: haha_)
13:51:22*yglukhov quit (Ping timeout: 264 seconds)
13:52:19*rauss joined #nim
14:02:30*nhywyll quit (Quit: nhywyll)
14:07:20*PMunch quit (Quit: Leaving)
14:10:34*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:13:48*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
14:16:03*dom96|w joined #nim
14:20:43*relax joined #nim
14:21:52*endragor joined #nim
14:25:13*PMunch joined #nim
14:25:13*yglukhov joined #nim
14:25:30*Yardanico quit (Ping timeout: 240 seconds)
14:28:18*Yardanico joined #nim
14:28:33*relax quit (Remote host closed the connection)
14:28:48Yardanicowow
14:28:48Yardanicohttps://gist.github.com/anonymous/d0328affcae3be6ab6b734899bc70e25
14:29:20YardanicoI just copy-pasted this simple class and only changed exception calling
14:29:25Yardanicoand nim can successfully parse it with a macro
14:31:02Yardanicowell nothing big here
14:32:02FromGitter<Varriount> Yardanico: Aiming for python to Nim translator?
14:32:53Yardanicowell just playing around :) but honestly I want to have a starting point for someone (or me) to start implementing actual python-to-nim translator
14:33:05YardanicoI think nim is closer to python than Go, for example (grumpy)
14:34:45*nattefrost quit (Remote host closed the connection)
14:34:53Yardanicofor example if you have isistance in Python, you can make a generic proc in nim with a couple of "when"
14:35:07dom96|wYardanico Nice!
14:35:11dom96|wThis is exactly what I envisioned
14:35:56*dom96|w had this idea as well :)
14:36:03FromGitter<Varriount> I wouldn't even mind something that does a partial translation
14:36:11dom96|wAwesome to see it working so well.
14:36:36dom96|wAlso, exceptions will hopefully soon become: raise Exception(msg: "foobar")
14:36:42Yardanicohmm, nice
14:36:47dom96|wWe just need to change all exceptions to be refs
14:36:57YardanicoVarriount: well yeah I'm trying to make something which would do at least a partial translation
14:39:24dom96|wYardanico: Please write an article on nim-lang.org about this :D
14:40:19Yardanicodom96|w, there's nothing big here yet for an article :) everyone (experienced nim programmer) can port some simple python functions to nim and make a macro like this
14:40:39dom96|wI disagree, this is big enough for an article.
14:42:45FromGitter<zetashift> Seconded; also it be a nice comfy intro to macros?
14:44:06Yardanicolol
14:44:25Yardanicosimplest one works:
14:44:38Yardanicohttps://gist.github.com/Yardanico/50dc03c2503a39ae9419e80f8a86d2d6
14:44:54Yardanicobut you have to specify object types yourself
14:45:15Yardanicohmm
14:45:18Yardanicomaybe not fully
14:45:31Yardanicoah, I forgot to import my "pylib" file
14:46:09Yardanicoah no it actually works
14:46:35Yardanicoupdated the gist
14:49:55*vlad1777d joined #nim
14:50:42*Sentreen quit (Ping timeout: 252 seconds)
14:59:12Yardanicodoing proper newClassName() proc generation
14:59:22Yardanicoinstead of calling init manually :)
15:01:05*francisl joined #nim
15:03:04*couven92 quit (Quit: Client disconnecting)
15:03:34*Sentreen joined #nim
15:09:05*Matthias247 joined #nim
15:09:27*relax joined #nim
15:09:52*vlad1777d quit (Ping timeout: 260 seconds)
15:11:56Yardanicook it now works but macro became very hacky, so I need to split it into procs (for example - 1 proc generates code for constructor, 2 proc generates usual procedures)
15:15:35*Trustable joined #nim
15:16:12*endragor quit (Remote host closed the connection)
15:22:26*endragor joined #nim
15:22:29*vlad1777d joined #nim
15:23:16*linsword joined #nim
15:24:05*linsword quit (Client Quit)
15:26:04*miran joined #nim
15:30:10YardanicoI've updated my gist again :) https://gist.github.com/Yardanico/50dc03c2503a39ae9419e80f8a86d2d6
15:33:24federico3TIL https://github.com/goby-lang/goby
15:34:27Yardanicowow
15:34:48Yardanicodomain-specific language?
15:34:51Yardanicoit seems
15:35:08miranhi, it's me again with my beginner questions:
15:35:45miranhow to create an array consisting for example of ints [1..1000]?
15:36:18Yardanicomiran, var data: array[1..1000, int]
15:36:23Yardanicobut you'll have to access it from 1 index
15:36:32mirani've found there's a list comprehension in `future` module. anything "non-futuristic"?
15:36:42Yardanicomiran, not yet
15:37:01Yardanicomaybe we'll have something when for becomes an expression
15:37:21relaxoooo list comprehensions -- are they expected to make it out of future eventually?
15:37:50Yardanicorelax, probably after making "for" an expression it would be possible to remove typing
15:38:23Yardanicoor at least you'll write list comprehensions in more nice-looking syntax
15:38:27relaxwhat's the upshot there, doesn't the => operator already kind of do that?
15:38:51Yardanicorelax, you can't currently write [for x in data: x]
15:39:24*Arrrr quit (Quit: Leaving.)
15:39:25Yardanicoeven with a macro
15:39:44relaxoh sorry, I'm mixing up anonymous functions and list comprehensions
15:39:53miranYardanico: thanks for that `data: array` solution, it will do it for now
15:40:03Yardanicomiran, what do you mean "for now"?
15:41:16mirani thought there might be a better way than iterating through indices (by creating an array with wanted values)
15:41:55Yardanicomiran, type Customer = ref object
15:41:55Yardanico name: string
15:41:55Yardanico balance: float
15:41:55Yardanicoclass Customer(object):
15:41:55Yardanico """A customer of ABC Bank with a checking account. Customers have the
15:41:56Yardanico following properties:
15:41:58Yardanico Attributes:
15:42:00Yardanico name: A string representing the customer's name.
15:42:02Yardanico balance: A float tracking the current balance of the customer's account.
15:42:06Yardanico """
15:42:08Yardanico def init(self, name, balance=0.0):
15:42:10Yardanico """Return a Customer object whose name is *name* and starting
15:42:12Yardanico balance is *balance*."""
15:42:14Yardanico self.name = name
15:42:16Yardanico self.balance = balance
15:42:18Yardanico def withdraw(self, amount):
15:42:20Yardanico """Return the balance remaining after withdrawing *amount*
15:42:22Yardanico dollars."""
15:42:24Yardanico if amount > self.balance:
15:42:26Yardanico raise newException(ValueError, "Amount greater than available balance.")
15:42:28Yardanico self.balance -= amount
15:42:30Yardanico return self.balance
15:42:32Yardanico def deposit(self, amount):
15:42:36Yardanico """Return the balance remaining after depositing *amount*
15:42:38Yardanico dollars."""
15:42:40Yardanico self.balance += amount
15:42:42Yardanico return self.balance
15:42:44Yardanicolet c = newCustomer("Tiberium", 500)
15:42:46Yardanicoecho "new balance = ", c.withdraw(250.0)
15:42:48Yardanicoecho "new balance = ", c.deposit(1337.0)
15:42:50Yardanicotype Shape = ref object
15:42:52Yardanico x, y: float
15:42:54Yardanico description, author: string
15:42:56Yardanico#An example of a class
15:42:58Yardanicoclass Shape:
15:43:00Yardanico def init(self, x, y):
15:43:02Yardanico self.x = x
15:43:06Yardanico self.y = y
15:43:08Yardanico self.description = "This shape has not been described yet"
15:43:10Yardanico self.author = "Nobody has claimed to make this shape yet"
15:43:12Yardanico def area(self):
15:43:14Yardanico return self.x * self.y
15:43:16Yardanico def perimeter(self):
15:43:18Yardanico return 2 * self.x + 2 * self.y
15:43:20Yardanico def describe(self, text):
15:43:22Yardanico self.description = text
15:43:24Yardanico def authorName(self, text):
15:43:26Yardanico self.author = text
15:43:28Yardanico def scaleSize(self, scale):
15:43:30Yardanico self.x = self.x * scale
15:43:32Yardanico self.y = self.y * scale
15:43:36Yardanicolet sh = newShape(5.0, 15.3)
15:43:38Yardanicoecho sh.area()
15:43:40Yardanicoomg
15:43:42YardanicoSORRY!
15:43:44Yardanicohttps://nim-lang.org/docs/algorithm.html
15:43:46Yardanicomiran, ^
15:43:48Yardanicothere's "fill" proc
15:44:17*linsword13 joined #nim
15:44:49miranYardanico: thanks, will look into that!
15:45:23Yardanicomiran, e.g. you have "var data: array[0..100, int]" and then you just do "data.fill(42)"
15:46:01*linsword13 left #nim (#nim)
15:46:10miran"what do you mean "for now"?" -> indices work if i want consecutive numbers, but if i want for example just even numbers, than comprehensions might be the way to go....
15:46:38miran"what do you mean "for now"?" -> indices work if i want consecutive numbers, but if i want for example just even numbers, then comprehensions might be the way to go....
15:46:45miran(sorry for double post)
15:46:51Yardanicomiran, yeah, list comprehension creates a sequence
15:49:58miranthanks! i'll continue with my learning/experimenting, and i'll be back with more questions for sure :)
15:57:14FromGitter<zacharycarter> Yardanico: I keep forgetting you're tiberium
15:57:19FromGitter<zacharycarter> also your py2nim thing doesn't compile for me
15:57:35Yardanicowell py2nim isn't mine, it's created by Araq
15:57:42Yardanicoand currently I use quote do which is fixed in devel
15:57:49Yardanicoyou mean py2nim.nim file?
15:58:02FromGitter<zacharycarter> I mean the gist you just shared with us
15:58:23Yardanicoah, it works only with devel right now
15:58:24*pilne quit (Quit: Quitting!)
15:58:36YardanicoI have a repository: https://github.com/Yardanico/nimpylib
15:58:51FromGitter<zacharycarter> gotcha
15:59:00Yardanicobecause why not share :)
15:59:02FromGitter<zacharycarter> pretteh cool!
16:03:53relaxmiran: if you don't need the syntactic sugar for comprehensions theres sequtils.map
16:04:34miranthanks relax, will try it
16:05:51*Matthias247 quit (Read error: Connection reset by peer)
16:14:25*MyMind quit (Ping timeout: 248 seconds)
16:15:36PMunchhttps://play.nim-lang.org/?gist=5745b74158aae6649b1bdf7fa1baf51b
16:15:59PMunchDrawing stuff in a terminal with braille Unicode characters :)
16:16:32*MyMind joined #nim
16:16:49*arnetheduck quit (Ping timeout: 246 seconds)
16:17:07YardanicoPMunch, veery cool
16:17:31PMunchThe idea is from Drawille
16:17:39PMunchA Python library for doing the same thing
16:20:02*endragor quit (Remote host closed the connection)
16:28:54*nsf joined #nim
16:34:27FromGitter<BigEpsilon> Hi, I'm trying to wrap stl cpp vector into a safe wrapper, but I have some trouble with for wrapping the [] operator
16:34:40FromGitter<BigEpsilon> proc unsafeIndexT (this: var vector[T], i: csize): T {.importcpp: "operator[]", header: "vector".} ⏎ proc `[]`*T (this: var vector[T], i: csize): var T {.noinit, inline.} = ⏎ ⏎ ```if not defined release: ⏎ assert(0 <= i and i < this.size) ⏎ this.unsafeIndex(i)``` [https://gitter.im/nim-lang/Nim?at=59a051a0c101bc4e3a571c96]
16:36:30FromGitter<BigEpsilon> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a0520e578b44a046e9cc32]
16:37:00PMunchHmm, the playground really doesn't like live view..
16:37:10PMunchie. infinite loop with sleep and update
16:38:04PMunchhttp://ix.io/zpp
16:38:13PMunchRun that little snippet those who like :)
16:38:27PMunchA nice updating sine graph in your terminal with a tracking line
16:38:34FromGitter<BigEpsilon> the problem lies here in the generated code ⏎ ⏎ ```int* result = this_0.operator[](i);``` [https://gitter.im/nim-lang/Nim?at=59a0528a210ac26920bf5033]
16:39:10FromGitter<BigEpsilon> and sorry for interrupting in the middle of an ungoing conversation
16:39:24PMunchNo, the fault is mine
16:39:37PMunchDidn't realise you were in the middle of saying something :)
16:40:04FromGitter<BigEpsilon> what would have been correct is : ⏎ ⏎ ```int& result = this_0.operator[](i);``` [https://gitter.im/nim-lang/Nim?at=59a052e3614889d47587aa61]
16:40:09FromGitter<BigEpsilon> I'm slow :)
16:40:20*Pisuke joined #nim
16:42:23YardanicoPMunch, oh my god it's so beautiful
16:42:33PMunchHaha
16:42:37*MyMind quit (Ping timeout: 260 seconds)
16:42:52Yardanicoand you're doing it with ansi sequences? wow
16:43:00PMunchI hope you have a font that shows the braille characters correctly, otherwise it's probably pretty hideous :P
16:43:18PMunchOh yeah, the clearing of the active drawing region is ANSI sequences
16:43:32YardanicoPMunch, well I do
16:43:42PMunchThe dots are basically an abuse of UTF braille characters :P
16:45:12FromGitter<BigEpsilon> Yes indeed verry beautiful
16:48:39*linsword13 joined #nim
16:51:35*linsword13 left #nim (#nim)
16:55:03dom96|wlol, yeah, please don't paste so much code here :)
16:56:24PMunchThe gitter bot should just turn the entire paste into one link and not bother with the excerpt
16:59:31YardanicoPMunch, well probably dom96|w said this to me :)
16:59:57PMunchOh, haha was too busy working on this drawing stuff to notice you had spammed the channel :P
17:00:26YardanicoPMunch, well I wanted to give miran a link, but instead pasted my class macro examples
17:01:32dom96|woh yeah, sorry, should have highlighted Yardanico
17:05:42PMunchHmm, dom96|w what is the standard for example files in nimble packages?
17:05:55PMunchskipFile and let people grab them manually from GitHub?
17:07:44*Jesin quit (Quit: Leaving)
17:09:22dom96|wPMunch: For now, yes.
17:09:31dom96|wPut them in an `examples` dir
17:09:37PMunchFor now? Anything cool in the pipe?
17:09:38dom96|wNimble will support that in the future
17:09:43dom96|wand install them somewhere
17:10:54Yardanicoalso, about this class macro: I don't know how, but nimsuggest is still able to detect procedures which are unused and give a hint
17:11:21PMunchHmm, I don't think most people really want to keep that stuff around. You run them once and then discard them. So maybe have a "nimble examples <package name>" which basically pulls all the example files from git and puts them in a directory in the current directory?
17:11:36FromGitter<Yardanico> (https://files.gitter.im/nim-lang/Nim/bp3D/image.png)
17:12:17*Jesin joined #nim
17:12:56*ofelas joined #nim
17:20:31FromGitter<jrdlph> yeah nimsuggest seems to be extremely clever about macros
17:21:08FromGitter<jrdlph> generally i break the compiler before nimsuggest XD
17:21:19Yardanicobut rarely it can crash, or even take all your ram :(
17:21:25YardanicoI encountered this today
17:21:43Yardanicoout of nothere all my ram was eaten by nimsuggest + it started swapping to disk - needed reboot
17:22:03*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:22:11FromGitter<jrdlph> the price for playing with such arcane magic
17:22:16Yardanicoand sometimes it doesn't work on complicated files
17:23:34*haha_ joined #nim
17:24:21FromGitter<jrdlph> yeah I haven't actually pushed it too far. I just don't remember any other language's macro system interactive nicely with IDEs/IDE backends
17:24:56FromGitter<jrdlph> interacting*
17:25:40FromGitter<jrdlph> its generally about there that ide support even stop trying to work
17:25:56Yardanicohmm, does rust ides support macros?
17:26:03Yardanicoand is there any rust ide's with smart auto-complete?
17:26:35Yardanicoactually there are several nim tools for IDEs
17:26:44Yardanico"nim check" which reports errors in the file
17:26:50Yardanicoand "nimsuggest" which gives suggestions
17:31:42Zevvtalking about nimsuggest: what's the best way for Vim integration. I found several projects but all with no recent updates
17:32:33Zevvoh look https://github.com/nim-lang/Nim/wiki/Editor-Support
17:33:12FromGitter<jrdlph> yeah I have grown pretty fond of vscode recently, and fortunately the VScode experience for nim is pretty good
17:35:01YardanicoZevv, it seems that this supports nimsuggest: https://github.com/baabelfish/nvim-nim
17:35:16Yardanicoand this doesn't: https://github.com/zah/nim.vim/
17:35:27Yardanicoor I'm wrong :)
17:35:31Zevvyea, looking into nvim-vim
17:35:44Zevvbut last updates are 2 years ago
17:39:03miranjrdlph: i'm just starting with nim, and i'm using vs code too - so far so good
17:45:29Yardanicoyeah I'm using it for a while now
17:45:45Yardanicoalso I've installed vscode-icons extension to have nim icons :)
17:46:06FromGitter<zacharycarter> yikes! presentation in 15 mins
17:46:08FromGitter<zacharycarter> wish me luck!
17:46:45Yardanicogood luck! :P
17:47:52FromGitter<zacharycarter> thanks :D
17:48:49*nhywyll joined #nim
17:48:49*Ven`` quit (Ping timeout: 248 seconds)
18:35:38FromGitter<jrdlph> i am having a hard time parsing the explanation of the 'mixin' keyword in the manual. Is it saying that it forces the compiler to look for a the symbol wherever some generic proc that uses it is instantiated? And where would that even be? Is it the module scope of the call site, the inner most scope of the call site?
18:39:31FromGitter<jrdlph> (not necessarily proc i guess, but in the context of generic proc's is how I am trying to understand it at the moment)
18:45:35*relax quit (Ping timeout: 240 seconds)
18:49:38FromGitter<jrdlph> at the moment, it seems obvious what 'where its instantiated' means for macros and templates, but not for generics.
18:50:02dom96I think 'mixin init' means that 'init' will be looked up in the scope of the call to the generic.
18:50:14dom96a generic is instantiated when the procedure is called
18:50:19FromGitter<jrdlph> ok
18:52:11Yardanicohttps://forum.nim-lang.org/t/3121/1 it seems that this already works
18:52:31*demi- joined #nim
18:59:19FromGitter<zacharycarter> presentation went well
19:00:20Yardanicoreally? nice
19:00:31FromGitter<zacharycarter> only about six people
19:00:33FromGitter<zacharycarter> lol
19:00:34Yardanicoehm
19:00:36Yardanicolol
19:00:44FromGitter<zacharycarter> hahaha
19:07:47*Jesin quit (Quit: Leaving)
19:10:12FromGitter<zacharycarter> one of my co-workers asked if you could target multiple backends
19:10:23FromGitter<zacharycarter> like wrap some JS code and wrap some C code and have them call each other
19:10:37FromGitter<zacharycarter> you figure out how to write that language and I think you win
19:10:49*sz0 quit (Quit: Connection closed for inactivity)
19:12:32FromGitter<jrdlph> you mean like actually call the c code from the js code? In what context would this execute?
19:13:15*FromGitter * jrdlph suspects he just didn't understand
19:13:25*gangstacat joined #nim
19:14:44*haha_ quit (Quit: haha_)
19:16:20FromGitter<zacharycarter> it wouldn't
19:16:29FromGitter<zacharycarter> I think you understood fine - he's asking about mixing contexts
19:16:54FromGitter<zacharycarter> something that's not possible
19:18:48FromGitter<jrdlph> maybe once webassembly lands and everybody is targeting it
19:19:15PMunchIs there a way using nim doc to generate an .md file?
19:19:25PMunchFor GitHub README files
19:22:08FromGitter<zacharycarter> @jrdlph yeah true
19:25:36FromGitter<jrdlph> @zacharycarter its such a fantastic idea though (webassembly) that the pessimist in me thinks i will probably fall over dead before it ever happens
19:27:39*Yardanico quit (Remote host closed the connection)
19:30:21FromGitter<jrdlph> @PMunch i don't think so, but github markdown allows (a limited subset of) inline html, so you might be able to cut out everything but the body and rename it to .md and have it just work
19:30:42PMunchHmm, I think I'll have to play around with it
19:30:57PMunchMaybe I'll create a pull request :)
19:32:04PMunchhttps://github.com/PMunch/drawille-nim
19:36:55*relax joined #nim
19:38:16PMunchThere, now drawille is on GitHub: https://github.com/PMunch/drawille-nim
19:38:31PMunchAnd as soon as dom96 accepts the pull request it will be on nimble as well :)
19:39:00FromGitter<zacharycarter> bluenote10: around by any chance?
19:39:29*Vladar quit (Quit: Leaving)
19:42:02dom96PMunch: reviewed
19:51:10*rauss quit (Quit: WeeChat 1.9)
20:04:24*francisl quit (Quit: francisl)
20:04:47PMunchdom96, fixed
20:05:17*francisl joined #nim
20:06:00dom96PMunch: okay, cool. Next time please put it at the bottom though.
20:09:18*Arrrr joined #nim
20:09:18*Arrrr quit (Changing host)
20:09:18*Arrrr joined #nim
20:13:41FromGitter<zacharycarter> found a use for Nim at work maybe - using bluenote 10's data frame api
20:13:52FromGitter<zacharycarter> if it had outer joins I could really sell it
20:14:18dom96zacharycarter: awesome that you did a presentation :)
20:14:29dom96What were your colleagues thoughts?
20:15:10FromGitter<zacharycarter> I think overall they were impressed by the language, they had some good questions too
20:15:31FromGitter<zacharycarter> they really liked how I could wrap JS with Nim
20:15:48FromGitter<zacharycarter> I showed them an example of using an existing node package from nim with Nim
20:15:59FromGitter<zacharycarter> sorry from npm*
20:16:10FromGitter<zacharycarter> among other things
20:16:20*francisl quit (Quit: francisl)
20:16:41*francisl joined #nim
20:17:08*miran quit (Quit: Leaving)
20:21:53*relax quit (Ping timeout: 248 seconds)
20:22:29*vivus joined #nim
20:24:19*rauss joined #nim
20:28:08FromGitter<Yardanico> @dom96, yeah, I would release it as a nimble package
20:30:31FromGitter<Yardanico> It needs a readme which shows what is implemented
20:34:44FromGitter<Yardanico> And I'll need a LOT of tests
20:36:58FromGitter<jrdlph> @Yardanico your intuition about generics when we were messing with concepts were correct, and mine were wrong. It generally doesn't work like this in other languages, but nim does in fact sort of narrow some unbound type parameter T to 'some type T for which the assumptions made in the body of this proc are true'. I don't completely understand the implications, but I like it. It means there is no dependency between some
20:36:58FromGitter... interface specification and the type that safisfied it. So like type safe ducktyping. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59a08a699acddb2407cbfa92]
20:38:11*sleepyqt quit (Quit: WeeChat 1.9)
20:49:46*gokr quit (Ping timeout: 276 seconds)
20:57:20*francisl quit (Quit: francisl)
20:59:33*gokr joined #nim
21:02:27*Snircle joined #nim
21:03:24*rauss quit (Quit: WeeChat 1.9)
21:06:57*sz0 joined #nim
21:13:57*gangstacat quit (Quit: Leaving)
21:25:14*francisl joined #nim
21:25:59*couven92 joined #nim
21:27:39*itseris joined #nim
21:27:52*itseris quit (Client Quit)
21:43:44*nhywyll quit (Quit: nhywyll)
21:46:49*Jesin joined #nim
21:47:05*ofelas quit (Quit: shutdown -h now)
22:04:43FromGitter<zacharycarter> def-pri-pub: I'll have some stuff for zengine tonight / over the weekend
22:05:37*francisl quit (Quit: francisl)
22:10:02PMunchdom96, ah sorry. I've just tried to keep my packages next to each other :P
22:13:29PMunchHmm, I wonder if I can do something cool with drawille..
22:14:08PMunchI mean you can do a lot of random fun stuff, but anything actually practical and cool
22:18:04PMunchhttps://raw.githubusercontent.com/yaronn/blessed-contrib/master/docs/images/line.gif
22:18:11PMunchOoh graphs would be cool
22:32:22PMunchHard to make the colours cross though since they are 2x4 characters .P
22:32:50*linsword13 joined #nim
22:37:36*Matthias247 joined #nim
22:40:26*linsword13 quit (Quit: WeeChat 1.9)
22:41:27*Trustable quit (Remote host closed the connection)
22:41:50*linsword13 joined #nim
22:44:55*nsf quit (Quit: WeeChat 1.9)
22:52:28*linsword13 quit (Quit: WeeChat 1.9)
22:53:21*yglukhov quit (Remote host closed the connection)
22:55:22*gokr quit (Quit: Leaving.)
22:59:51*Arrrr quit (Read error: Connection reset by peer)
23:23:32*gokr joined #nim
23:27:48*gokr quit (Ping timeout: 240 seconds)
23:34:56*vlad1777d quit (Ping timeout: 248 seconds)
23:44:26FromGitter<Varriount> Hm. Anyone know a term for a non-empty string?
23:55:36FromGitter<zacharycarter> initialized string
23:55:41FromGitter<zacharycarter> I dunno