<< 14-09-2017 >>

00:01:14def-pri-pubIt's in `util.nim`. I think it might be better to go in it's own file and then imported by `util.nim`
00:02:42FromGitter<zacharycarter> agreed
00:02:48FromGitter<zacharycarter> I don't know if we'll ever get around to using it in zengine
00:05:38def-pri-pubWeren't you working on a website for zengine a while back?
00:06:57FromGitter<zacharycarter> I was but I stopped I didn't really get anywhere with it I got sidetracked trying to do soemthing with karax :P
00:07:00FromGitter<zacharycarter> I should start on one again
00:07:23jsgrantJust noticed; There's no nim2nix yet.
00:07:32FromGitter<zacharycarter> nim2nix?
00:07:44def-pri-pubyeah, I was just about to ask
00:07:58def-pri-pub(damn, the IRC logs are already logged in google)
00:08:38jsgrantCompat-layer for NixOS; Basically allows a prog-lang's packagemanager to talk to "nix" and install to the system proper to be run.
00:08:49jsgrantBecause you don't run local-binaries on NixOS.
00:09:10FromGitter<zacharycarter> dah fuq is NixOS?
00:09:19FromGitter<zacharycarter> ohhh yeah
00:09:21FromGitter<zacharycarter> this thing
00:09:35jsgrantAll but this machine (Fedora) are now on NixOS; Might be a fun-project ... still a year out before I do trivial Nim-hacking it looks. Ordering dom96's book tomorrow though. :^)
00:10:12*jsgrant is making a placeholder repo for now, as a reminder, regardless.
00:10:45FromGitter<zacharycarter> why are you waiting a year to start hacking on Nim?
00:12:11*mahmudov joined #nim
00:13:48jsgrantWell, more closely it's going to be a half-year once I start the beginning of the next on my self-imposed "curriculum"; This year has been a weird "reset/rebase" kind-of thing a lot of which is going through actual overly-romantic withdrawls from Lisp.
00:14:36jsgrantMore-or-less "reteaching" myself to program, non-trivially, outside of Lisp... which I haven't done in like 4-5 years to any notable degree and really not at all, sans the last few months, for like 3 years prior.
00:15:52FromGitter<zacharycarter> yeah I feel that's one problem (major) with lisp
00:16:19FromGitter<zacharycarter> most lisp programmers I talk to about other programming languages shudder at the thought of switching
00:16:59FromGitter<zacharycarter> I think it's the investment one has to make into lisp to become competent in it
00:17:54jsgrantOnce I finally, after like 2 years of bulling about it ... get my blog up, will eventually write about it; Just such an odd mindset I was in.
00:18:37jsgrantThe fact that I had any -- let-alone such strong feelings of "selling out" trying to move away from it, is literally crazy to me.
00:19:13FromGitter<zacharycarter> :P embrace the new! embrace the Nim!
00:19:43FromGitter<zacharycarter> I'm attempting to write a non-recursive flood fill algo implementation and it's not going well
00:21:24FromGitter<zacharycarter> is there any way to TCO optimize Nim code?
00:22:01jsgrantWas absurdly productive though, during that time; And what get's me is I don't know how much of it was actually due to nice lil quirks in Lisp & how much of it was the almost unshakeable "man on a mission" mindset I had.
00:23:09jsgrantThe latter, was certainly pushed in the community; And too (I think I've mentioned in here & certainly in other channels generally) I've been pensive to really peruse anything/any community that seems to mirror that ... namely Haskell.
00:23:45jsgrantThink there must be a sort-of "brain" that is apt to buy into that kind-of stuff in full-force. :^P
00:24:00FromGitter<zacharycarter> meh I gave CL a shot and just floundered for a few days trying to get things working
00:24:15FromGitter<zacharycarter> SDL wouldn't work and then I changed from SBCL to some other implementation and things still didn't work
00:24:31FromGitter<zacharycarter> then I tried out chicken scheme and the example project there didn't work
00:24:34jsgrantzach: One of the reasons Nim actually interested me initally, actually, is the Lispish macro-system.
00:24:59FromGitter<zacharycarter> makes sense
00:25:02jsgrantEver play with CEPL?
00:25:27*vlad1777d quit (Ping timeout: 240 seconds)
00:26:12FromGitter<zacharycarter> nope! is that like a C repl?
00:26:34jsgrant*Marco/DSL-Lust is also a big reason why I too started reorienting to Scala.
00:26:49*renarc joined #nim
00:26:50jsgranthttps://github.com/cbaggers/cepl
00:27:30jsgrantBaggers also has some pretty nice/decent demo's on his linked Youtube channel.
00:28:19jsgrantThere was a good half-dozen or so Lisp Gamedev projects about; When I was still about.
00:28:51jsgrantClinch was pretty nice too, really.
00:30:10FromGitter<zacharycarter> yeah I talked to a few lips users who were trying to get me to switch and were touting their game projects
00:30:17FromGitter<zacharycarter> I still think nim is better suited for gamedev
00:32:44jsgrantYeah, at this point I agree; But your mindset (and mine not-nearly-as-much) doesn't fall into that "Assimilate" modulus.
00:33:34FromGitter<zacharycarter> true
00:33:59jsgrantI was running Emacs + Stumpwm for like 80% of my environment (dev or otherwise); And that still wasn't enough for me.
00:34:53jsgrantYou sorta-kinda see that in "RIIR" (Rewrite It In Rust), but even then Lisp is a whole 'nother level because there are parties (myself included) who wanted LispMachines/LispOSes to "be a thing" again.
00:36:35FromGitter<zacharycarter> yeah
00:36:44FromGitter<zacharycarter> I def see it in the rust community
00:41:58*TjYoco joined #nim
00:42:59jsgrantBut yeah, basically I "have a history" of falling into some of these absolutist traps & once in, it's absurdly hard for me to crawl out of -- so I've more-or-less crafted the loosely aforementioned "curriculum" with the explicit goal if going slow & curbing my enthusiasm.
00:44:48jsgrantTrying to go the "slow, but gainful payoffs" game; Which is certainly very counterintuitive to me.
00:47:57jsgrantPretty sure I've functionally got to a point where I know what I'm doing -- but absolutely get why it sounds odd when I say, basically, "Oh yeah, I'm excited to play with Nim; Only going to take me 6+ months to a year to do anything non-trivial in!" :^P
00:55:18FromGitter<zacharycarter> hehe
00:55:26FromGitter<zacharycarter> makes sense
01:12:02*gangstacat quit (Quit: Ĝis!)
01:14:55*def-pri-pub quit (Quit: leaving)
01:18:25*TjYoco quit (Ping timeout: 248 seconds)
01:19:34subsetparkAraq dom96 : is there a handy list anywhere of the C types that Nim uses to represent its base types?
01:23:47FromGitter<zacharycarter> subsetpark: how goes the roguelike?
01:25:05subsetparkzacharycarter - I converted it to BLT and got roughly working everything already in place - however, I have this Nim/Python talk coming up soon so I have to work on my utility library for that instead.
01:26:08FromGitter<zacharycarter> gotcha
01:40:02*chemist69_ quit (Ping timeout: 255 seconds)
01:53:56*chemist69 joined #nim
01:58:47*endragor joined #nim
02:02:56*endragor quit (Ping timeout: 240 seconds)
02:56:31*Jesin quit (Quit: Leaving)
02:59:02*endragor joined #nim
03:01:59*Jesin joined #nim
03:03:47subsetparkzacharycarter: here's an extremely barebones, no-documentation first sketch: https://pypi.python.org/pypi/nim-types
03:03:54subsetpark`import ntypes`
03:26:26*onionhammer quit (Ping timeout: 240 seconds)
03:28:36*onionhammer joined #nim
03:29:52*dddddd quit (Remote host closed the connection)
03:37:05*onionhammer quit (Ping timeout: 248 seconds)
03:38:57*onionhammer joined #nim
03:41:21*onionhammer quit (Client Quit)
04:39:26*mahmudov quit (Remote host closed the connection)
04:53:23FromGitter<Bennyelg> When I am updating my package I should nimble publish again?
04:53:27FromGitter<Bennyelg> how is it working?
05:12:01*StarBrilliant quit (Ping timeout: 276 seconds)
05:13:08*miran joined #nim
05:19:06*StarBrilliant joined #nim
05:24:30*Vladar joined #nim
05:30:10Araq_benneyelg: no, you don't have to do that. if the URL changed, you need to create a manual PR I think
05:30:24Araq_if something else changed (dependencies) you don't need to do anything
05:30:53Araq_nimble loads the dependencies from your .nimble file on github and so its knowledge is always up to date
05:35:59*gangstacat joined #nim
06:02:27FromGitter<Bennyelg> Fantastic
06:02:32FromGitter<Bennyelg> https://github.com/Bennyelg/nimPresto ⏎ Is now on nimble
06:07:05*miran quit (Ping timeout: 240 seconds)
06:18:52*vlad1777d joined #nim
06:20:01*ShalokShalom quit (Remote host closed the connection)
06:22:53FromGitter<mratsim> @zacharycarter If you manage to implement a fast floodfill ping me. No one will tell you this but Go-playing engine are not compute or memory bound, they are floodfill bound since you have to run flood fill thousand of times per second in a go AI. ⏎ ⏎ Here is my implementation in Rust using functional iterators style: while let, filter_map, fighting the borrow checker: https:/
06:22:53FromGitter... /github.com/mratsim/rustygo/blob/master/src/main.rs#L358-L378
06:24:05*vlad1777d quit (Ping timeout: 240 seconds)
06:26:10*nsf joined #nim
06:39:28*jsgrant quit (Ping timeout: 240 seconds)
06:43:39*endragor quit (Remote host closed the connection)
06:46:44*spica joined #nim
06:51:59*ShalokShalom joined #nim
07:08:51*endragor joined #nim
07:12:06*yglukhov joined #nim
07:13:22*Arrrr joined #nim
07:13:22*Arrrr quit (Changing host)
07:13:22*Arrrr joined #nim
07:14:52*solitudesf joined #nim
07:16:52*yglukhov quit (Remote host closed the connection)
07:18:39*PMunch joined #nim
07:20:05*claudiuinberlin joined #nim
07:29:32*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:46:20*claudiuinberlin joined #nim
07:46:41*Sembei quit (Ping timeout: 240 seconds)
07:47:24*MyMind joined #nim
07:50:02*couven92 joined #nim
08:04:20*yglukhov joined #nim
08:07:45*spica quit (Ping timeout: 252 seconds)
08:08:31*yglukhov quit (Ping timeout: 248 seconds)
08:11:34*spica joined #nim
08:23:37*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:23:57FromGitter<Varriount> @mratsim Your Arraymancer library is really neat!
08:24:02*yglukhov joined #nim
08:24:08*couven92 quit (Quit: Client disconnecting)
08:27:10*claudiuinberlin joined #nim
08:31:46*couven92 joined #nim
08:33:11*Yardanico joined #nim
08:43:07FromGitter<Bennyelg> To whom using presto-db by facebook (sql engine) . ⏎ I created A nim connector :) ⏎ Now I'ts working pretty efficient ⏎ https://github.com/Bennyelg/nimPresto... [https://gitter.im/nim-lang/Nim?at=59ba411bbac826f054b7287f]
08:51:26ArrrrIf i have a `proc test[T](t: T)` and T is `seq[A]`, is it possible to get the `A`, for example: `proc test[T](t: T) = test2[T.A](t[0])`
08:56:45Araq_template elemType[T](a: seq[T]): typedesc[T] = T
08:56:57Araq_^ untested though
08:56:59*dom96|w joined #nim
09:02:49ArrrrGood shot https://play.nim-lang.org/?gist=1a755f0dd718bfd6513ac7bce41fec35
09:03:17*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
09:04:26Araq_for me the button keeps spinning
09:04:35Araq_I guess compiler endless loop?
09:04:56ArrrrIs a thing playground does sometimes
09:04:56Araq_oh now it works, ok
09:05:00PMunchIt did that for me as well, but then it suddenly worked
09:18:33FromGitter<Varriount> @Bennyelg "connect" is a rather ambiguous term - perhaps you should provide an additional procedure called prestoConnect, or connectToPresto?
09:20:11FromGitter<Grabli66> Is there "Any" type that i can use in runtime, not in compile time?
09:21:01dom96|wVarriount: I don't think that's necessary.
09:21:06PMunchYou can create a type with a kind field like the JSON module does
09:21:09dom96|wAs long as the `connect` proc works on a Presto type
09:22:13FromGitter<Varriount> dom96: It doesn't. It just takes a hostname, port, etc
09:22:28Araq_presto.connect
09:22:50Araq_not sure why people pretend we have no disambiguation means
09:23:12dom96|wyeah. I agree with Araq.
09:23:26dom96|wAraq_ you should kill your other BNC.
09:23:34dom96|wLog in to it and /msg *status disconnect
09:23:34Araq_I know
09:23:59*Araq quit (Quit: Bye!)
09:24:19*Araq_ is now known as Araq
09:24:20FromGitter<Grabli66> dom96|w, can i use ssl with jester?
09:24:23FromGitter<Varriount> Araq: Eh, I guess you have a point
09:24:48dom96|wGrabli66: yes, but not using Jester directly. You should put it behind nginx and set up SSL for it.
09:25:37PMunchI put mine behind Apache, worked pretty well
09:25:48FromGitter<Grabli66> dom96|w, do you plan to add native ssl support to jester?
09:26:09PMunchWhy? That is just more code to maintain with little benefit
09:26:26*Yardanico quit (Remote host closed the connection)
09:26:48*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:27:41FromGitter<Grabli66> I dont want use nginx or apache. :)
09:28:45FromGitter<Varriount> It would benefit webapps, and small applications
09:29:14FromGitter<Varriount> I wonder if flask (python) supports ssl
09:31:35PMunchWell, someone could probably write a small reverse-proxy in Nim :)
09:33:45dom96|wGrabli66: Sure. But it's not a high priority for me.
09:37:11PMunchVarriount, it appears that it does: https://blog.miguelgrinberg.com/post/running-your-flask-application-over-https
09:40:36*claudiuinberlin joined #nim
09:44:35couven92Hmm, @Araq_ I still get `msgs.nim(602, 32) Error: ambiguous call; both tables.[](t: var Table[[].A, [].B], key: A)[declared in lib\pure\collections\tables.nim(167, 5)] and tables.[](t: Table[[].A, [].B], key: A)[declared in lib\pure\collections\tables.nim(161, 5)] match for: (Table[system.string, system.int32], string)` on the 0.17.2 sources
09:45:20Araqcouven92: you still haven't fixed the vcc bug, so yeah
09:45:47couven92I have no idea what is going on here, so how am I to fix it? :O
09:46:30dom96|wif you want Jester to support SSL then asynchttpserver needs to support it first
09:46:42dom96|wand for that to happen you will likely need to wrestle quite a bit with openssl
09:47:00couven92yes, you pointed med at some function in some file, I still have no idea what I am looking at there... (I am reasonably sure it has something to do with the compiler, that's about as far as I got :P )
09:55:10FromGitter<Grabli66> dom96|w, asyncnet has ssl support.
09:55:32dom96|wGrabli66: Basic SSL support.
09:55:52dom96|wBut do try to add SSL support to asynchttpserver :)
09:56:05dom96|wIt might just work without any problems
10:00:08yglukhovdom96: btw, even "basic" ssl support needs improvement. cert validation almost never works (
10:00:35dom96|wYeah... SSL is tricky :\
10:00:55dom96|wIt took me months to get it this far.
10:02:27yglukhovGrabli66: https://github.com/yglukhov/variant
10:02:34dom96|wI think in the long run we should switch to BearSSL when it's ready https://bearssl.org/
10:03:23yglukhovoh, that is interesting. never heard
10:03:42FromGitter<Grabli66> yglukhov, thanks
10:04:07dom96|wIt should be possible for us to link to it statically, which would be awesome.
10:04:27dom96|wIn fact, it might be a good idea to start using it already.
10:05:31yglukhovyeah, i've also been thinking about nimble support for foreign static libs. i think it would be nice to put static libs for different platforms/archs right into the nimble package...
10:06:09FromGitter<Bennyelg> @Araq what is the disamiguation when I use connect?
10:06:23yglukhovas a matter of fact nimble can already allow that, so nevermind
10:07:12dom96|wYes, via submodules.
10:07:12yglukhovbut yeah, static ssl lib (with a lot of platform/arch variants) would be great
10:07:21dom96|w(git submodules)
10:07:35dom96|wIt would be awesome for Nimble to download dynamic libs too
10:08:25FromGitter<Bennyelg> @dom96 But the signature is unique to the presto, and you should import presto when use connect
10:08:34FromGitter<Bennyelg> @dom96 I don't see the problem
10:08:49FromGitter<Bennyelg> assuming you connect( with the right signature
10:08:53dom96|wBennyelg: hrm? I'm fine with your code. Varriount isn't.
10:09:23FromGitter<Grabli66> Is there plugin system for nim? I want to load from nim process a module with some interface and use it like plugin.
10:09:28FromGitter<Bennyelg> Oh,  sorry
10:11:35FromGitter<Bennyelg> @dom96 I read your comment on git about the 2 spaces convention. on my opinion is not enough when you read code 4 make a lot of different
10:11:52*sdw joined #nim
10:12:29FromGitter<Bennyelg> but it's just me I assuming it's an old habit
10:16:01*mahsav quit (Ping timeout: 248 seconds)
10:16:43*mahsav joined #nim
10:22:21*Yardanico joined #nim
10:23:10*spica quit (Ping timeout: 264 seconds)
10:24:46*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:26:46*ShalokShalom_ joined #nim
10:27:40couven92Araq, I tried as you suggested to do some GC_rec calls ( https://github.com/nim-lang/Nim/compare/devel...couven92:issue-6229 ) but that didn't help... -.-
10:29:39*ShalokShalom quit (Ping timeout: 252 seconds)
10:29:50*endragor quit (Remote host closed the connection)
10:34:07PMunchBearSSL looks really interesting dom96|w
10:34:17Araqcouven92: oh ok, hmmm
10:35:28*spica joined #nim
10:36:53FromGitter<Grabli66> It would be great if someone implements bearssl :)
10:37:17PMunch*hint hint*
10:37:52PMunchTry to run c2nim on it and see what happens
10:38:34*elrood joined #nim
10:38:42FromGitter<Grabli66> I am too old for that :)
10:41:16*mahsav2 joined #nim
10:41:41*mahsav quit (Ping timeout: 240 seconds)
10:45:39*Yardanico quit (Remote host closed the connection)
10:46:44FromGitter<mratsim> > @mratsim Your Arraymancer library is really neat! ⏎ ⏎ Thanks ! I’m almost done wrapping CUDA C so we can use custom GPU kernel in Arraymancer =)
10:46:54FromGitter<mratsim> @Varriount *
10:49:34*Ven`` joined #nim
10:49:47*dddddd joined #nim
10:50:01*vendethiel- quit (Ping timeout: 240 seconds)
10:50:16*endragor joined #nim
10:53:14*arnetheduck joined #nim
10:55:26*endragor quit (Ping timeout: 240 seconds)
11:02:08yglukhovBennyelg: +1, also prefer 4 spaces.
11:03:44PMunchGrabli66, saw your question about plugins. Are you talking about dynamic libraries? Because that is available in Nim
11:04:18Arrrr2 spaces masterrace
11:04:27*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:04:30FromGitter<Grabli66> PMunch, yes. Compile to dll, so, dynlib?
11:05:31PMunchhttps://rosettacode.org/wiki/Call_a_function_in_a_shared_library#Nim
11:05:52PMunchThat's a pretty bare-bones example of DLLs in Nim
11:05:58PMunchIt's pretty easy to work with
11:06:38spicaguys, was the / (string, string) removed from the lib?
11:06:47Araqno
11:06:51Araqwe all love it.
11:06:55FromGitter<Grabli66> PMunch, great
11:07:03Araqit's in ospaths now
11:07:19spicaoh
11:07:21spicaokay
11:07:23Araqcan play.nim get c2nim support? that would be so cool
11:07:31PMunchGrabli66, https://forum.nim-lang.org/t/2051 that's an example showing dynamic loading
11:07:57Araqspica: os.nim forwards to ospaths.nim though, so everything should work as before
11:08:02PMunchSo loading plugins and getting their procedures dynamically
11:08:07Araqdid we break something?
11:08:49spicaAraq, I was just reading through dom's book, and my code didn't compile. He only imported "os", so I thought you guys removed the operator
11:09:06spicaso you broke his book :))
11:09:22FromGitter<Grabli66> PMunch, thanks, it's what i want
11:10:26Araqhuh? as I said, it should still work
11:10:40Araqcan we get a proper bug report for this please?
11:11:09spicayou just said you've moved the proc into another module
11:11:24spicashould it work if just os is imported?
11:11:30Araqspica: yes.
11:11:39Araqos does 'export ospaths'
11:11:55spicaI am a dummy
11:12:10spicamy bad. I had this: "from os import nil" :)
11:12:16spicaso it's ok, sry
11:12:39FromGitter<BigEpsilon> @Araq , talking about c2nim: https://github.com/nim-lang/c2nim/pull/97
11:12:41FromGitter<ephja> are enum values limited to <int.high?
11:12:58Araqephja: I think so
11:14:13FromGitter<ephja> `int.high` raises OverflowError in semEnum. I'm gonna have a look
11:28:26*claudiuinberlin joined #nim
11:29:10*claudiuinberlin quit (Client Quit)
11:29:22*Snircle joined #nim
11:31:00*dom96|w joined #nim
11:42:05*Sentreen quit (Ping timeout: 240 seconds)
11:43:40*endragor joined #nim
11:43:43*claudiuinberlin joined #nim
11:48:41*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:50:27*Yardanico joined #nim
11:50:39*vendethiel- joined #nim
11:51:03*ShalokShalom_ quit (Ping timeout: 252 seconds)
11:51:27couven92Araq, I just realized: vcc does not seem to care about `vcc.options.debug`, what do I need to do to trigger the use of that configuration? I tried `nim c koch` and `nim c -d:debug koch`
11:51:53*ShalokShalom joined #nim
11:52:08*Ven`` quit (Ping timeout: 240 seconds)
11:55:02*Sentreen joined #nim
11:57:37Araqcouven92: huh, good question, --debugger:native ?
12:03:28*MyMind quit (Ping timeout: 240 seconds)
12:03:29*Pisuke joined #nim
12:05:56*claudiuinberlin joined #nim
12:06:56*sz0 joined #nim
12:09:36spicaguys, why does this fail? https://pastebin.com/HbeLkH7q unicode issues
12:10:26FromGitter<Grabli66> Is it possible to fix that https://play.nim-lang.org/?gist=b63a811237ba256c7821c174ed456553 ?
12:10:27Araqspica: are you on windows?
12:10:30spicai am
12:10:37spicadayum
12:10:43Araqrun start.bat that came with Nim
12:10:47spicaok
12:10:55Araqand retry your program
12:11:10Araqin that terminal/shell/console
12:12:23AraqGrabli66: that's impossible, you need to duplicate the valueType field
12:12:35FromGitter<Grabli66> ok
12:13:01Araqyou also might want to use JSonNode instead
12:14:41PMunchI think he's just doing it for fun Araq
12:14:52spicaAraq, that works. Is it just a displaying issue?
12:14:57FromGitter<ephja> does anyone actually use 'items' for enum types to iterate over enums with holes?
12:15:10Araqspica: yes. it's a Windows bug really.
12:15:35FromGitter<Grabli66> yglukhov, Your variant type is slow? :)
12:15:46spicayep, it works fine withot start.bat in mingw terminal
12:16:33Araqspica: look at start.bat's code to see the workaround
12:16:49*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:17:58spicasmall inconsistency issue in the api: unicode.runSubStr vs system.substr
12:19:18Yardanicowell it's runeSubStr
12:19:31*claudiuinberlin joined #nim
12:19:42FromGitter<ephja> should 'items' be left as it is and then have an iterator that accounts for holes?
12:20:25spicaYardanico, it is. but the Str is title cased, in system.substr it's not
12:20:36Yardanicospica, it doesn't matter
12:20:53Yardanicoyou can call it like "runesubstr" or "runeSubStr"
12:20:55spicaWell, it doesn't but it's a bit inconsistent
12:21:28Yardanicoecho "asdasd".runesubstr(5, 3)
12:21:31PMunchephja, what would be the purpose of an items iterator that didn't account for holes? When would you want to use that instead of one that accounted for them?
12:21:32Yardanicoif you like it
12:21:36*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
12:22:03PMunchrunE_suB_strinG
12:22:14PMunchReverse camel snake-case
12:22:21Yardanicoyeah
12:22:29spicalol
12:22:34YardanicorunE_suB_stR
12:22:45spicathat stll doesn't change the facts
12:22:49Yardanicowhy?
12:22:55Yardanicoyou can call it like you want
12:23:08spicalol
12:23:09Yardanicoit's not a big deal in nim
12:23:11spicaI do know that
12:23:30PMunchThat should be implemented as well, shorthand insensitivity :P proc sub{str|srting}
12:23:35spicabut the api is inconsistent
12:23:41spicawhatever
12:23:50spicanot a big deal, just saying
12:23:57FromGitter<ephja> PMunch: I dunno if it was done for reasons of simplicity or for some other reason
12:24:02spicalook at php, you don;t want to end up like that
12:24:09Yardanicolike what?
12:24:10spicaabsolute rubbish consistency
12:24:13PMunchI agree with spica, even though it doesn't matter in Nim the core modules should be consistent with the style guide
12:24:36Yardanicowell then you can say "Nim compiler should be consistent with the style guide" :P
12:24:56PMunchephja, ah I get you. Do a git blame on it and see who did it :P
12:25:06FromGitter<ephja> though it's not that difficult to account for holes in the compiler, but `e.low .. e.high` is very simple
12:25:41*TjYoco joined #nim
12:32:00Araqthe Nim compiler predates the style guide
12:32:31Yardanicoyeah, I know
12:32:39Yardanicobut maybe in the future
12:37:00*endragor quit (Remote host closed the connection)
12:37:08*ShalokShalom quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
12:38:40*endragor joined #nim
12:38:55*ShalokShalom joined #nim
12:42:13couven92Araq, sry, suddenly had to attend a meeting... Uhm, yes: `--debugger:native` did work...
12:42:59*ShalokShalom quit (Remote host closed the connection)
12:43:21*ShalokShalom joined #nim
12:43:34couven92Is there a way to set vcc.options for the usual case without using .always (since that also would affect `--opt:size` and `--opt:speed`?
12:45:50FromGitter<zacharycarter> subsetpark: nice!
12:49:21*kunev quit (Ping timeout: 252 seconds)
12:50:06*relax joined #nim
12:50:59*kunev joined #nim
12:51:29*dom96|w joined #nim
12:51:39spicahow does one convert a string into an array or seq or hashset? Is there any api for that?
12:52:34PMunchTurning "Hello, world" into ["H","e","l","l",...]?
12:52:54spicayes
12:53:51PMunchFirst init the seq to str.len then just iterate and set the fields
12:54:04PMunchNot sure if there is any code for that anywhere
12:54:10PMunchBut it would be like 5 lines of code
12:54:17*pilne joined #nim
12:55:00spicaYeah, I was just curious if there's a proc or something for this task.
12:55:44spicaso if you want to sort the chars of a string, make a seq first via loops, then sort. In python we can sort strings, so that's what I was after
12:56:11Araqyou can sort strings in Nim
12:56:18Araqno idea why you think you can't
12:57:15spicahow
12:57:26*relax quit (Ping timeout: 240 seconds)
12:57:28PMunchhttps://forum.nim-lang.org/t/3075
12:58:23*renarcii joined #nim
12:58:55spicaDayum. I was using sort(cmp[string]), that's why it failed
13:02:39*renarc quit (Remote host closed the connection)
13:02:50*renarcii is now known as renarc
13:03:18*Ven`` joined #nim
13:04:13*Sembei joined #nim
13:04:47*renarc quit (Quit: Leaving)
13:05:01*vendethiel- quit (Ping timeout: 255 seconds)
13:05:12FromGitter<zacharycarter> I think you can just do @"Hello World" spica
13:05:13*renarc joined #nim
13:05:40Yardanicoyeah
13:05:51*Pisuke quit (Ping timeout: 252 seconds)
13:06:11spicait wokrs
13:08:05yglukhovGrabli66: its superfast if wrapped type size is <= sizeof(pointer). otherwise, it allocates a copy, and still remains super fast ;)
13:08:37FromGitter<Grabli66> yglukhov, good :)
13:09:00yglukhovby "superfast" i mean it is as fast as it can be given its semantics =)
13:10:56*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:10:59FromGitter<Grabli66> Ok. I'll try to use it :)
13:13:52yglukhovGrabli66: it is worth mentioning though that such functionality is rarely needed. in most cases you can get away without losing compile time type tracking, or use nim obj variants. so i would suggest to revisit your program's concept before using variants.
13:13:56*onionhammer joined #nim
13:14:16*vlad1777d joined #nim
13:14:30FromGitter<Grabli66> Maybe later
13:15:34*renarc quit (Remote host closed the connection)
13:23:06subsetparkAraq: here's something interesting - the same code fails in the VM
13:23:12*claudiuinberlin joined #nim
13:23:37subsetparkhttps://www.irccloud.com/pastebin/jGgQombE/
13:29:57spicaworks fine on my system. nim32 on windows
13:30:03spicawith gcc
13:30:24spicabut what kind of shell is that?
13:30:54TjYocoworks on mine too
13:33:08Yardanicoguys, wrap this code in "static" block
13:33:10Yardanicoand try again :)
13:33:30YardanicoVM - compile-time VM for executing Nim macros and other stuff which is computed at compile-time
13:34:06FromGitter<krux02> spice: try calling "nim secret" on the command line
13:34:26FromGitter<krux02> on linux I recommend to use "rlwrap nim secret"
13:35:22spicayeah, sorting fails that way
13:36:40FromGitter<krux02> subsetpark: please create a bug report
13:39:30spicalol
13:40:05spica:((
13:40:22*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:40:40*relax joined #nim
13:41:29spica>>> var c=[1,2,3,4,-1]
13:41:29spica>>> sort(c, cmp)
13:41:37spicatry that one guys
13:41:40spicain nim secret
13:41:47spica Error: unhandled exception: value out of range
13:43:28TjYocowhere are you accessing the array
13:43:48*claudiuinberlin joined #nim
13:44:15spicawhat do you mean?
13:44:50spicasortin fails, not arr access
13:45:54FromGitter<krux02> yes the nim vm was my disillision to nim as well
13:46:22TjYocoIt worked for me in nim secret
13:46:51spicawhat nim ver?
13:46:57TjYoco0.17.2
13:47:01spicasame
13:47:06spicawindows ?
13:47:10TjYocoyeah
13:47:17spicanim 32 or 64?
13:47:55TjYoco64
13:48:16spicafails on 64 and 32...
13:48:46spicahttps://pastebin.com/QdehtiPz
13:51:20Yardanicoarch doesn't matter in VM
13:51:25YardanicoAFAIK
13:51:43Yardanicojust do a bugreport already :)
13:52:51*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:54:35*vlad1777d quit (Ping timeout: 240 seconds)
13:54:56FromGitter<Grabli66> Yardanico, can nimble watch changes in files and build?
13:55:11Yardanicowhat do you mean?
13:55:13Yardanicohot reloading?
13:55:21FromGitter<Grabli66> yes
13:55:37FromGitter<Grabli66> Build on changes in source files
13:56:10Yardanicowell I mean you want your app to be stopped and started again?
13:56:40Yardanicoif you want to do this without restarting the program itself (with a script or by hand) - your only way is dynamic libraries
13:57:08Yardanicobut no, I think nimble doesn't have a feature like that
13:58:22*claudiuinberlin joined #nim
13:58:22FromGitter<Grabli66> Vscode plugin can do that. But it not use nimble, just nim compiler
13:58:50Yardanicowell can you explain more precisely what do you want to do?
13:59:23*PMunch quit (Quit: Leaving)
14:00:19TjYocoGrabli66 do you mean you're making a nimble package and importing it elsewhere and want to know if it detects source code changes automatically?
14:01:12FromGitter<Grabli66> I want "nimble" looked for changes in the project and automatically began to build as if they were
14:01:32FromGitter<Grabli66> I use nimble for project managment
14:01:39Yardanicowell you would make a script for that
14:01:47Yardanicoah
14:01:52FromGitter<Grabli66> And build my project like "nimble build"
14:01:54Yardanicoor simple nim program (if you're on linux)
14:02:11FromGitter<Grabli66> And i want "nimble build watch" :)
14:02:27Yardanicowell there's no cross-platform way to do that in Nim currently
14:02:37Yardanicoand I don't think it would be a good feature for a package manager :)
14:02:53FromGitter<Grabli66> But it also a project manager
14:02:58Yardanicoyeah
14:03:00Yardanicomanager
14:03:00FromGitter<Grabli66> Build system, i mean
14:03:14Araqyup, I think it would be a cool nimble feature
14:03:38YardanicoAraq, currently we don't have cross-platform way to watch file changes, do we?
14:03:57Araqwe have fsmonitor
14:04:02Araqonly supports linux
14:04:14Araqapparently somebody has a Win implementation too
14:04:24Araqcheck the forum
14:04:40Yardanicoah, https://gist.github.com/mashingan/4a31d3a630e22cf9274eebf475ee60e6
14:05:05Yardanicowinim is this - https://github.com/khchen/winim
14:05:09*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
14:07:07*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:08:44*claudiuinberlin joined #nim
14:10:33Araqok, I see you volunteered.
14:10:37Araqnice
14:11:01YardanicoAraq, what ? :)
14:11:09FromGitter<Grabli66> Cool. We'll be waiting for results :)
14:11:21Araqgive fsmonitor a Windows implementation.
14:11:29Araqand then an OSX one.
14:11:53Araqand then a (Free)[BL]SD one
14:15:10*ShalokShalom quit (Remote host closed the connection)
14:15:21*endragor quit (Remote host closed the connection)
14:16:08*sz0 quit (Quit: Connection closed for inactivity)
14:16:42FromGitter<ephja> `errSetTooBig: "set is too large",` big or large? ;)
14:16:45*endragor joined #nim
14:17:14Araqsometimes it shows I'm no native speaker :P
14:17:20AraqPRs welcome
14:17:34*dom96|w joined #nim
14:18:13FromGitter<ephja> I'm not so sure myself, but "large" might be more formal
14:19:51Araq"set is too <insert dick joke here>"
14:19:59Araq^^ problem solved
14:20:23*endragor quit (Remote host closed the connection)
14:20:30*endragor joined #nim
14:20:55*endragor quit (Remote host closed the connection)
14:21:19TjYoco"Overflow Error: Hint: Try uinch8 instead of uinch4"
14:21:50Araq"your mother's set ..."
14:22:52FromGitter<ephja> roughly what is needed in order to assign a run time variable to the value that a compile time variable holds at the very end of the compile time scope?
14:23:20Yardanicowell I create new variable in a proc to do this
14:23:29*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
14:23:29Yardanicoe.g. in a proc: "var myvar = SomeConst"
14:23:34*endragor joined #nim
14:24:06FromGitter<k0pernicus> Hello!
14:24:16Yardanicohi
14:24:17Araq"Uncountable set detected, ask Cantor for help"
14:24:22FromGitter<k0pernicus> Is anybody here has trouble with example 4.26 from Nim in Action?
14:24:33FromGitter<krux02> ¡olleH
14:24:37FromGitter<k0pernicus> The code is ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ba9125210ac269202edb38]
14:24:47FromGitter<ephja> Yardanico: yes but sometimes it's not good enough
14:24:49*dom96|w joined #nim
14:25:01FromGitter<k0pernicus> I compiled the code with `nim c -d:ssl`
14:25:24FromGitter<Yardanico> @k0pernicus works fine for me
14:25:25FromGitter<Yardanico> with -d:ssl
14:25:38FromGitter<k0pernicus> But I got this error running it: `Error: unhandled exception: SSL support is not available. Cannot connect over SSL.`
14:25:56FromGitter<Yardanico> well maybe you've compiled it to another directory? :)
14:26:25FromGitter<k0pernicus> Oh well - sorry…
14:26:30FromGitter<k0pernicus> The error is: `Error: unhandled exception: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure`
14:26:43FromGitter<k0pernicus> Different from the previous one :-]
14:26:45FromGitter<Yardanico> oh
14:26:54FromGitter<Yardanico> something bad with your openssl?
14:27:03FromGitter<k0pernicus> Mmmmh...
14:27:33FromGitter<k0pernicus> I will update `brew`… just in case… but I don’t think so
14:27:38FromGitter<Yardanico> https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/861137
14:27:42FromGitter<k0pernicus> `Warning: openssl 1.0.2l is already installed`
14:28:15*endragor quit (Ping timeout: 248 seconds)
14:28:26FromGitter<ephja> @Yardanico one example is implementing opengl.loadExtensions without compiler support. lexicographic order shouldn't matter
14:29:00FromGitter<Yardanico> @k0pernicus are you sure nim uses this new ssl?
14:29:04FromGitter<ephja> well, I should figure it out myself eventually
14:29:23FromGitter<k0pernicus> @Yardanico It’s in the book
14:29:37FromGitter<k0pernicus> That’s why I asked if anybody has got troubles with the book’s code
14:29:44YardanicoIt's the error in OpenSSL
14:29:47Yardanicowhat's why I'm asking
14:29:59Yardanicoand I mean openssl by "ssl"
14:30:16FromGitter<k0pernicus> Oh ok, sorry
14:31:29Yardanicowell I don't really know, you can google this error
14:31:53FromGitter<k0pernicus> Yep, I tried
14:31:57dom96|wMac OS X's older openssl doesn't support cloudflare's SSL IIRC
14:32:48Yardanicobrew update && brew install openssl && brew link --force openssl && openssl version -a
14:32:54Yardanicobut this can break your system :)
14:33:08Yardanicobecause every program will use newer OpenSSL
14:33:09FromGitter<k0pernicus> @Yardanico openssl from brew is already installed ;-0
14:33:31Yardanicodid you do "brew link --force openssl" ?
14:33:35FromGitter<k0pernicus> Yep
14:33:46Yardanicowhat's the output of "openssl version -a" ?
14:33:54*relax quit (Ping timeout: 246 seconds)
14:34:00Yardanicoand if you did this right now, try to relogin or reboot
14:35:13*Calinou quit (Ping timeout: 248 seconds)
14:36:07FromGitter<k0pernicus> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ba93d7bc4647297432edd0]
14:36:08FromGitter<edubart> How to enable gcc warnings when compiling with nim? (disable the -w argument that nim passes to gcc to ignore all warnings)
14:36:45Yardanicoedit nim.cfg ?
14:37:05YardanicoyourNimCompilerDir/config/nim.cfg
14:37:15Yardanicomaybe there's a better way
14:37:22FromGitter<edubart> I've tried adding -passC:-Wall but gcc still ignores all warnings
14:37:36Yardanicoyou should try to edit nim config as I said
14:37:47Yardanicobut why do you want gcc warnings? just curious :)
14:38:15TjYocoIm trying to fix a dependency issue by using Generics, how should I fix this 'Field' is not a concrete type? https://gist.github.com/Tyler-Yocolano/ebe83c4b1051ec31d15b8cbb57ac3ad3
14:38:53FromGitter<edubart> why I need is explained in my comment on https://github.com/nim-lang/Nim/issues/6324
14:38:59Yardanicoyou can't have a seq of different types
14:39:09Yardanicogenerics are compile-time thing
14:39:12FromGitter<edubart> what line I have to add/edit in nim.cfg?
14:39:54Yardanicotry to edit line 128
14:39:58Yardanicoand remove "-w" here
14:40:09Yardanico(if you're on linux)
14:40:09TjYocoYardanico alright, thought they were all technically Field objects so that wouldn't matter
14:40:19YardanicoTjYoco, no, that would matter
14:40:26Yardanicohttps://forum.nim-lang.org/t/3167
14:41:06Yardanicogenerics are not a runtime thing
14:42:28TjYocoohhh gotcha
14:43:36FromGitter<k0pernicus> @Yardanico Does the code run well on your computer?
14:43:39FromGitter<k0pernicus> No exception?
14:43:59Yardanicoyes. I'm on linux (arch linux)
14:44:12FromGitter<k0pernicus> And what is your version of OpenSSL ?
14:44:41YardanicoOpenSSL 1.1.0f 25 May 2017 :)
14:45:05FromGitter<k0pernicus> Mmmmh ok
14:45:06Yardanicowell it's arch, here's everything has latest versions
14:45:24Yardanicodom96|w himself uses mac IIRC
14:45:44*relax joined #nim
14:45:45FromGitter<k0pernicus> @dom96 Are you using MacOS? Can you paste your OpenSSL please?
14:45:50*sz0 joined #nim
14:45:50dom96|wwhat URL are you trying to request?
14:45:58dom96|wI'm not on my MBP right now
14:45:59Yardanicodom96|w, he's trying to request nim-lang.org
14:46:07FromGitter<k0pernicus> Yep
14:51:55FromGitter<Grabli66> How to create an interface type in nim?
14:52:32Yardanicothere's no "interface" in Nim
14:52:50FromGitter<Grabli66> I know :)
14:53:02Yardanicowhat are you trying to do?
14:53:04FromGitter<Grabli66> But. I want something like interface
14:53:26Yardanicowell there should be a reason for that
14:53:40*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:53:54*nsf quit (Quit: WeeChat 1.9)
14:54:05FromGitter<Grabli66> Multiple inheritance
14:54:27Yardanicowell there should be a reason for that :D
14:54:37FromGitter<Grabli66> :)
14:54:50FromGitter<edubart> I've been absent from nim related stuff for about one year, how is the progress towards 1.0 since then? closer or farther?
14:54:53Yardanicowell, really, you can post your code (which you want to do)
14:55:01Yardanicoedubart: closer indeed
14:55:08FromGitter<Grabli66> I want object that has field from other two objects
14:55:15FromGitter<Grabli66> fields
14:55:51Yardanicoehh, you don't get me :D I mean why do you want to have an object like this? can you post a code which you're trying to make work?
14:56:32TjYocoI thought I read somewhere about composition instead of inheritance, something like the new object would have fields of the other ones instead of being a child of them... is that anywhere close to correct?
14:56:32Yardanicoalso this: http://openmymind.net/Interfaces-In-Nim/
14:57:01*arnetheduck quit (Ping timeout: 240 seconds)
14:57:17*claudiuinberlin joined #nim
14:57:47FromGitter<edubart> but I saw that the github issues is larger (I remember that were ~900 a year ago) and some looks scary, this gives me the feel that is farther
14:57:56FromGitter<Grabli66> Yardanico, Good trick :)
14:57:57*pilne quit (Quit: Quitting!)
14:58:15Yardanicoedubart: well because issues are closed and new ones are opened? :)
14:58:29FromGitter<Grabli66> Yardanico, Maybe there is a mixins?
14:58:35FromGitter<edubart> I am talking about open ones
14:58:35*Ven`` quit (Ping timeout: 240 seconds)
14:58:52Yardanicolook at rust or swift then :P
14:59:11Yardanicoah, swift doesn't have issues in github repo
15:00:37FromGitter<edubart> rust 2770 much more haha, however 19382 closed ones, they have a better ratio
15:00:50Yardanicobecause nim community is smaller
15:01:31Yardanicohttps://github.com/nim-lang/Nim/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20updated%3A%3E2016-09-14
15:01:32*Ven`` joined #nim
15:01:45Yardaniconot the best search, but still
15:01:48TjYocohow many issues though are "Q: I can't get this to work; A: You're doing it wrong, here's how"
15:01:56FromGitter<k0pernicus> @edubart The first release of Nim will be ok when `high-priority` issues will be fixed
15:02:06FromGitter<k0pernicus> (I think…)
15:02:08Yardanicowell Araq wanted to release 1.0 years ago IIRC
15:02:14Yardanicobut community stopped him
15:02:20*Jesin quit (Quit: Leaving)
15:02:20FromGitter<k0pernicus> Why?
15:02:38FromGitter<k0pernicus> (11 high-priority issues for the moment I think)
15:02:48FromGitter<edubart> we all I hope so, rhoughtly in how many years maybe 1.0 will be out?
15:03:14Yardanicono one can ask questions like this, there's no schedule
15:03:22FromGitter<k0pernicus> Maybe it’s too late for 2017… 2018?
15:03:32FromGitter<zacharycarter> these kind of questions are pointless
15:03:41FromGitter<edubart> is nim in feature freeze or it keeps adding new features often?
15:03:51AraqI'm still shooting for 2017 fwiw
15:04:00Araqevery year is Nim v1 year.
15:04:01FromGitter<zacharycarter> please look at the release notes if you want to see when features are added @edubart
15:04:09Yardanicoedubart: it's not feature freeze
15:04:50Yardaniconimble became much smarter in this year AFAIK
15:05:11Yardanicoor for example "The C/C++ code generator has been rewritten to use stable name mangling rules. This means that compile times for edit-compile-run cycles are much reduced."
15:05:13FromGitter<edubart> aside from bugs, is thread a roadmap or list of new features that will be added?
15:05:24FromGitter<edubart> is there*
15:05:47Yardanicowell, https://github.com/nim-lang/Nim/blob/devel/todo.txt, but i don't know if it's a good source
15:05:56Araqedubart: I'm working on a new one
15:06:05YardanicoAraq, yay
15:07:29Yardanicobut AFAIK not nil is not complete now
15:08:10Araqin a nutshell: make 'not nil' the default for 'ref', make 'nil' an invalid state for strings/seqs, make 'case' do pattern matching for objects
15:09:04*Jesin joined #nim
15:10:17FromGitter<edubart> other thing that I'm afraid a little is that the project itself is much dependent on Araq, I hope Araq keeps rocking and improving nim forever, however what happens in other scenario?
15:10:55Araqit's a valid concern, we hired "zahary" who knows pretty much everything too
15:11:29Araqmaking the bus factor 2 for Nim's core. Jehan too knows almost everything afaict but he is not very active either
15:11:41FromGitter<edubart> Araq, do you feel more tired of improving and fixing Nim compared with yourself years ago? will you keep rocking as much as you can?
15:12:50TjYocoDo you expect him to say No he's giving up soon?
15:12:52FromGitter<edubart> hmm, good to know that you are hiring others to help, I hope the active core developers grows
15:13:08AraqI'm improving Nim's ecosystem more than the compiler these days (sorry), we got "karax" for browser based frontends (SPAs), we're getting a unique ORM
15:13:09YardanicoTjYoco, well I think Araq wouldn't give up :)
15:13:21Yardanicoat least because there's large code bases written in Nim AFAIK :)
15:14:00Araqthat means two things:
15:14:11Araq- progress is slower than I would like
15:14:29Araq- I am having lots of fun with no signs of growing tired :D
15:14:39*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:14:53*vivus joined #nim
15:15:08TjYocoCouldn't someone just fork Nim and upgrade it their own way anyhow?
15:15:21YardanicoTjYoco, yes, if he knows Nim compiler internals
15:15:25Yardaniconim compiler is MIT
15:15:34FromGitter<edubart> improving the ecosystem is a good strategy, a good ecosystem will attract more people to help out, thus improving more the ecosystem in a recursive manner
15:15:42Yardanicobut I don't know any reason to fork Nim
15:15:54AraqI know most of you don't agree
15:16:19Araqbut the compiler is really not hard, complex algorithms have been avoided for the most parts
15:16:53FromGitter<ephja> I'm probably just slow
15:17:11*haha_ joined #nim
15:17:19TjYocoYardanico, I agree from what I've seen in the past month or so. Just saying if there were major concerns in the community or whatever then anyone can just make OtherNim
15:17:41Araqonce you get over my eccentric style of writing things ("hi, I am a single char variable. guess what it means") it's not all that hard
15:18:46Araqthere is the tendency though that hard bugs stay around for long. that's quite common in open source land.+
15:20:25Yardanicowell there's 160 issues with "feature"label
15:21:39*claudiuinberlin joined #nim
15:23:05Yardanicooh, we have 80 open PRs
15:26:50*jsgrant joined #nim
15:30:13*vlad1777d joined #nim
15:31:51FromGitter<krux02> Sorry I knew I am annoying, but it is annoying that by default the debug build has no debug symbols
15:33:04Araqkrux02: edit your nim.cfg and add --debugger:native
15:33:22FromGitter<krux02> nim.cfg is confusing
15:33:26FromGitter<krux02> and I did
15:34:13FromGitter<krux02> the result was the output "using config file ..." broke my code
15:34:30couven92@krux02 on Windows?
15:34:39couven92using vcc?
15:35:57FromGitter<krux02> https://github.com/nim-lang/nimble/issues/397
15:36:13FromGitter<krux02> couven92 I am on Linux only
15:36:34couven92okay... because i just found out some things about vcc :P
15:37:27FromGitter<krux02> Araq: so just editing nim.cfg actually breaks things
15:38:17Araqseems a nimble bug to me
15:38:35FromGitter<krux02> yea it is in the nimble bug tracker alread
15:39:56Araqcan't we fix the real issue here?
15:40:14FromGitter<krux02> The real issue to me here is that the debug build has no debug symbols
15:40:19Araqthis staticRead"nimble path" hack needs to die
15:40:31FromGitter<krux02> ah yea that one
15:41:38FromGitter<krux02> the compile command should accept arguments that are relative to the file it is in
15:41:50FromGitter<krux02> I thit that was the reason I did that hack in the first place
15:42:12FromGitter<krux02> I *think*
15:45:35FromGitter<Grabli66> What is wrong? https://play.nim-lang.org/?gist=7cdb8206df4b0f94d59ca883a336672a
15:45:44FromGitter<krux02> Araq: I think a pragma ``{.addCIncludePath: "some/path/".}`` with a relative path the the current file would fix this.
15:46:56Araqgrabli66: use 'of' instead of 'is' here.
15:47:26Araqkrux02: we have no way to ship C code with Nim code
15:47:46AraqI mean no official way.
15:47:56couven92we don't have custom GC finalizers (destructors) yes, do we?
15:47:59Araqjust a bunch of hacks people came up with
15:48:24Yardanicocouven92, I think we do
15:48:42FromGitter<krux02> Araq: well no official way, but this way here works pretty well: https://github.com/krux02/nimAntTweakBar/blob/master/AntTweakBar.nimble
15:48:47*haha_ quit (Quit: haha_)
15:48:54Yardanicocouven92, https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L220
15:49:19couven92oh! nice!
15:51:01FromGitter<krux02> couven92: I would be careful with the finalizers, test if they actually can do what you want
15:51:33FromGitter<krux02> I remember that I tried destructors in Nim and they ware pretty far away from being reliable
15:51:33*haha_ joined #nim
15:51:34Araqbtw I invented a new GC algorithm
15:51:41Araqhow can I get the fame?
15:51:51couven92Araq, WHAAAAT? :O
15:52:01FromGitter<krux02> whoohoo, party
15:52:11Araqit's just a variant of existing algorithms really
15:52:14Araqbut still.
15:52:18YardanicoAraq, ahh
15:52:22YardanicoI remember this link
15:52:29FromGitter<krux02> well isn't a variant of existing algorithm what we all do
15:52:38Araqyeah indeed.
15:52:46Yardanicoyou've said that you was experimenting with a new GC
15:55:12AraqI read about something similar in a children's book once.
15:56:33Yardanicoit seems I found it :P https://people.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf
15:56:38FromGitter<k0pernicus> In “Garbage Collection for kids” ?
15:56:46FromGitter<krux02> random information of the day: in gdb the command ``rbreak`` matches with regular expressions on function names and allows setting breakpoints in Nim functions pretty neatly
15:56:50Yardanico(found it again)
15:57:26FromGitter<krux02> and ``tui enable`` in gdb shows the sourcecode interactively
15:57:34YardanicoAraq, so new GC will arrive to Nim? or it's just an algorithm, not an implementation?
15:57:52*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:58:03FromGitter<krux02> I think it is already in Nim, we just never noticed it :D
15:58:41FromGitter<Grabli66> Araq, why there is "is" and "of" to check types?
15:58:42FromGitter<k0pernicus> @Araq Did you benchmarked it yet?
15:59:23FromGitter<krux02> @Grabli66 well I guess it has to do with inheritance and type aliases
15:59:47FromGitter<krux02> is just checks for type aliases and of also matches with super types
16:00:09*couven92 quit (Read error: Connection reset by peer)
16:00:16FromGitter<krux02> Araq: I broke the GC
16:00:28FromGitter<krux02> I made a change and now my test fails the GC initialization
16:04:30*solitudesf quit (Remote host closed the connection)
16:07:30*Trustable joined #nim
16:07:34*dom96|w joined #nim
16:08:43*miran joined #nim
16:08:47*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:09:56*claudiuinberlin joined #nim
16:11:56*couven92 joined #nim
16:12:37*spica left #nim ("Leaving")
16:13:17*vlad1777d quit (Remote host closed the connection)
16:15:08*vlad1777d joined #nim
16:15:42*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:21:01Araqwill look at it later, krux02
16:21:02Araqbbl
16:23:52FromGitter<ephja> hmm ⏎ ⏎ ```type E = enum a = <int.high ⏎ echo({a})``` [https://gitter.im/nim-lang/Nim?at=59baad18c101bc4e3ac882a7]
16:30:58*relax quit (Ping timeout: 264 seconds)
16:34:50Arrrrtry `type E = enum c = 0, a = <int.high`
16:36:07Arrrrmm what i'd like to have is a len(enum) proc
16:36:49*relax joined #nim
16:40:51*jolik69 joined #nim
16:41:34*haha_ quit (Quit: haha_)
16:44:17*Yardanico_ joined #nim
16:44:27*Yardanico_ quit (Client Quit)
16:44:43*Yardanico_ joined #nim
16:46:08*sz0 quit (Quit: Connection closed for inactivity)
16:46:15*salewski joined #nim
16:46:22*haha_ joined #nim
16:46:35*Yardanico quit (Ping timeout: 240 seconds)
16:48:52*Yardanico_ quit (Client Quit)
16:49:06*Yardanico joined #nim
16:49:12salewskigtype.h:#if GLIB_SIZEOF_SIZE_T != GLIB_SIZEOF_LONG || !defined __cplusplus
16:49:29*jolik69 quit (Quit: Leaving)
16:49:58salewskiHow do I test for cplusplus backend in Nim code? when defined(cplusplus)?
16:56:03FromGitter<k0pernicus> Hey
16:56:11FromGitter<k0pernicus> I am experimenting with `concept`
16:56:12salewskiMy guess was not bad, seems to be when defined (cpp). Bye.
16:56:30FromGitter<k0pernicus> This is the code I wrote: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bab4beb59d55b823f79373]
16:57:12Yardanicook?
16:57:18Yardanicoah, I see
16:57:32Yardanicoyou can't use concept as a concrete type
16:57:34FromGitter<k0pernicus> As I implement `<` for the `Nothing` type, it should be satified the `Comparable` concept, right?
16:57:45Yardanicoyes
16:57:52Yardanicobut your myMax is wrong
16:57:55Yardanicoyou can't return Comparable
16:57:58FromGitter<k0pernicus> Ow
16:58:26FromGitter<Yardanico> use something like this
16:58:29FromGitter<Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bab5357b7d98d30df5c81e]
16:59:43FromGitter<k0pernicus> Cool, it works!
16:59:46FromGitter<k0pernicus> Thanks a lot!
17:00:16FromGitter<k0pernicus> So, instead of returning a concept, we return a concrete type that is a “similar type” (or alias) of the concept type, right?
17:00:27FromGitter<Yardanico> nonono
17:00:54FromGitter<Yardanico> myMax will accept any type which satisfies "Comparable" concept, and myMax will return a result with this type
17:01:10FromGitter<k0pernicus> Ow ok, I see
17:01:13FromGitter<k0pernicus> Wrong deduction
17:01:15FromGitter<k0pernicus> Thanks :-)
17:01:32FromGitter<k0pernicus> (Actually, the `myMax` procedure is from the book)
17:02:07FromGitter<k0pernicus> (page 254)
17:02:12*couven92 quit (Quit: Client disconnecting)
17:02:19FromGitter<Yardanico> also you wouldn't have any concepts or generics at runtime, they all resolved at compile-time
17:02:43FromGitter<Yardanico> so for each type pair new C (or C++) function is generated
17:02:49FromGitter<k0pernicus> Yep
17:03:09FromGitter<Yardanico> Here it would be this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bab64d1081499f1f301e50]
17:03:56FromGitter<k0pernicus> (beautiful)
17:04:08FromGitter<k0pernicus> Like generics, right?
17:04:12FromGitter<k0pernicus> All in compile time
17:04:20FromGitter<Yardanico> yes
17:04:28FromGitter<Yardanico> also I've used generics in my code
17:04:31FromGitter<k0pernicus> (just saw your “generics at runtime” - sorry for that)
17:04:34FromGitter<Yardanico> myMax is a generic proc
17:04:40FromGitter<k0pernicus> I see
17:07:16*Jesin quit (Quit: Leaving)
17:07:44*yglukhov quit (Remote host closed the connection)
17:08:40*haha_ quit (Quit: haha_)
17:12:20*mahmudov joined #nim
17:16:12*relax quit (Ping timeout: 260 seconds)
17:18:01*Sentreen quit (Ping timeout: 240 seconds)
17:18:12*ShalokShalom joined #nim
17:18:35*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:21:41*adeohluwa joined #nim
17:23:36FromGitter<krux02> args
17:24:01FromGitter<krux02> spending enough time with gdb I start to like it
17:24:09FromGitter<krux02> even though I never thought I would ever do that
17:24:30FromGitter<krux02> it is all so complicated and needs a lot of knowledge to actually do anything
17:24:33*dom96|w joined #nim
17:26:30FromGitter<Grabli66> Can i create recursive iterator? Nim says "recursive dependency"
17:26:56FromGitter<krux02> well I tried that, too
17:27:33FromGitter<krux02> aparently, it doesn't seem so
17:27:40FromGitter<krux02> I even triey clusure iterators
17:27:44FromGitter<krux02> tried
17:28:06FromGitter<Grabli66> Success?
17:28:11FromGitter<krux02> nope
17:28:29FromGitter<krux02> my solution was to not use an iterator, but to write out the items into a seq
17:28:51FromGitter<krux02> for my use case that worked, too, but I would have preferred iterators
17:29:17*joby joined #nim
17:29:24FromGitter<Grabli66> Ohh. I know what to do
17:32:20*Sentreen joined #nim
17:33:17Araqseriously guys. iterators/generators vs coroutines
17:33:30Araqwithout a stack you can't have recursion
17:33:57FromGitter<krux02> Araq: yes, but aren't clusure iterators with a Stack?
17:34:10FromGitter<Grabli66> But we want :)
17:36:22FromGitter<krux02> It not that we all implemented iterators with the knowledge that recoursion would not be possible with it.
17:36:34FromGitter<krux02> We just try it and then realized that it doesn't work
17:36:40*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:36:45ehmryassuming that the stack can grow indefinitely is also not portable
17:38:32*haha_ joined #nim
17:39:03FromGitter<krux02> ehmry: sure
17:39:19*joby quit (Quit: Page closed)
17:40:14FromGitter<Grabli66> Ok. I can that understand. But why where is no interfaces? :(
17:44:52FromGitter<mratsim> Is there a way to tell the compiler not to optimise a proc? I’m trying this multiply by two on GPU but the resulting C is “optimized” via a CPU function. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bac0147b7d98d30df604a1]
17:45:07Yardanicoyeah
17:45:21FromGitter<Yardanico> ah
17:45:25FromGitter<Yardanico> you mean N_INLINE?
17:45:35FromGitter<mratsim> yes
17:45:53FromGitter<mratsim> I don’t want the *= to be replaced by stareq ….
17:45:56YardanicoIDK then
17:46:32FromGitter<Bennyelg> how do I push an update of package in nimble
17:46:47FromGitter<mratsim> create a new tag on github
17:46:54Yardanicomake a new tag and update version in .nimble file
17:46:58FromGitter<mratsim> and update your nimble
17:47:19FromGitter<Bennyelg> so new nimble publish ?
17:47:23Yardaniconooo
17:47:30Yardaniconew version tag on GitHub
17:47:41Yardanicomake a new commit which updates version in .nimble file
17:47:48Yardanicoand then create a tag which refers this commit
17:48:25FromGitter<Bennyelg> how do I create new tag
17:48:44FromGitter<krux02> what do you guys see in this gif https://camo.githubusercontent.com/bbec54f58f9f10beb07a20d5fe0465586d888763/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f6c314a3973363553576a486979614a656f2f67697068792e676966
17:49:00Yardanicobad performance? :)
17:49:21FromGitter<Bennyelg> Ok, i got the tag
17:49:24YardanicoBennyelg: https://github.com/VKBots/VBot/releases/new
17:49:26FromGitter<Bennyelg> and nimble version update
17:49:27FromGitter<Bennyelg> what now
17:49:43*yglukhov joined #nim
17:49:57FromGitter<krux02> bad performance?! why that?
17:49:58*couven92 joined #nim
17:50:00*haha_ quit (Quit: haha_)
17:51:04FromGitter<Bennyelg> :|
17:51:37FromGitter<Bennyelg> oh great
17:51:48FromGitter<Bennyelg> it's automatically after tag, thanks
17:54:05*yglukhov quit (Ping timeout: 240 seconds)
17:54:26*haha_ joined #nim
18:01:31FromGitter<mratsim> I see "Non-Image content-type returned"
18:03:54Araqmratsim: need more help with .emit?
18:05:19FromGitter<mratsim> Mmm, that may be a solution yes
18:06:09*haha_ quit (Quit: haha_)
18:06:54*relax joined #nim
18:08:51FromGitter<mratsim> got to go. ⏎ ⏎ I will start with emit before trying something else. ⏎ I was actually thinking of nim-templates: https://github.com/onionhammer/nim-templates... [https://gitter.im/nim-lang/Nim?at=59bac5b3b59d55b823f7f824]
18:10:23*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
18:11:08*yglukhov joined #nim
18:16:27FromGitter<adamrezich> can anyone tell me what I'm doing wrong such that this whole thing works except for the last test? https://play.nim-lang.org/?gist=b839e751c5b638b3fd339ac87fc9b16a still figuring out macros :/
18:18:59FromGitter<krux02> @adamrezich maybe you should use quote in macros
18:19:12FromGitter<krux02> it lets you create code blocks with actually using code
18:19:23FromGitter<krux02> ``````
18:20:13Arrrrdo not pass evproc directly to add. Use a variable first
18:20:27*Snircle joined #nim
18:20:43FromGitter<krux02> @adamrezich well that doesn't solve anything, but it helps to keep things simpler
18:20:48FromGitter<adamrezich> @krux02 I didn't know about that, I'll look into it though
18:21:08FromGitter<krux02> you can use packticks to insert nodes
18:21:14TjYocoadamrezich, this works too a.add(evproc(Tick, echo "hi"))
18:21:43FromGitter<adamrezich> @Arrrr the point is to make it as DSL-like as possible, so I'll probably make the actual proc that takes in an evproc into a macro too
18:22:06FromGitter<krux02> ```let node: NimNode = ... ⏎ result = quote do: ⏎ foo.bar(`node`)``` [https://gitter.im/nim-lang/Nim?at=59bac8cebac826f054ba5296]
18:23:03FromGitter<krux02> to my experience it works best, when you try to be minimal in what your dsl supports
18:23:29ArrrrYep, i know prefer to do everything with templates. Easier to maintain and understand
18:23:33Arrrr*now
18:23:33FromGitter<krux02> each feature needs to be maintained, documented
18:24:08FromGitter<krux02> Arrrr: I agree, when templates allow that, then I totally agree
18:24:19FromGitter<krux02> but not everything is possible
18:24:31Yardanicowell this example will be a bit wordy with quote do
18:24:44FromGitter<krux02> but if you try you will realize that a lot is actually possible with templates
18:24:55FromGitter<krux02> doesn't matter
18:25:02FromGitter<krux02> maybe it does
18:25:35FromGitter<krux02> I just don't like super long ``nnkXYP.newTree(...)`` expressions
18:25:47FromGitter<krux02> and not everything can be created with quote do
18:26:03FromGitter<krux02> quote do always creates nnkStmtList
18:26:09FromGitter<krux02> not always what you want
18:27:48FromGitter<adamrezich> the whole point of this is to cut down on code duplication and make defining game logic and stuff as simple and DSL-like as possible. I want to make it so users of this game engine can quickly define "event types": a tuple containing the event, and a proc type that takes in an Elem (game object) and said tuple type. this part works fine, but I want to take it a step further and allow users to easily create lambdas
18:27:48FromGitter... of that proc type and pass them to the event system. I wouldn't be worrying about this last part if Nim had the ability to use proc types when declaring lambdas like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59baca24c101bc4e3ac92324]
18:28:36FromGitter<adamrezich> but you can't do that without metaprogramming in nim for reasons I more or less understand (but I still wish that was a feature, though!)
18:29:23ArrrrWell is good to learn how to use macros and report bugs.
18:29:49FromGitter<adamrezich> yeah this was definitely a good excuse to take a couple hours and learn the macro/AST side of Nim c:
18:29:55LyndsySimonQuestion - is there a Nim library out there yet specifically for developing RESTful APIs?
18:30:26YardanicoLyndsySimon, no
18:30:31Arrrryou can search it: `nimble search rest`
18:30:33Yardanicospecifically for restful apis - no
18:33:28FromGitter<Araq> @adamrezich isn't that trivially solved with a helper template?
18:34:05Araqafter(getUpComp[TimestepMgr](elem).evTick, OnTick =
18:34:05Araq # body here
18:34:05Araq)
18:34:47LyndsySimonYardanico: Interesting. Is that something that would be useful, or is it easy enough that a library isn't needed?
18:35:18Araqis still full of boilerplate anyway
18:35:30FromGitter<adamrezich> @Araq: i-is it? like I said, I'm still new to nim's metaprogramming faculties. also can you paste that somewhere? gitter botched it
18:36:02FromGitter<adamrezich> oh it turned the () syntax into a markdown link lol
18:36:40Araqstill reads like a C++ "inspired" construct
18:37:31AraqLyndsySimon: does "produces JSON from SQL queries" count as "rest" library?
18:38:12FromGitter<adamrezich> which part? it's the best system I could come up with for making an event system with user-defined events attached to objects in the scene graph
18:38:35FromGitter<adamrezich> though I have been trying to be more nim-like, cutting down on ptrs and using refs where it makes sense haha
18:39:40Yardanicocan't you just do something like myObject.on(Tick): body ?
18:39:48Yardanicoand on would be some macro or template
18:42:46Yardanicoand generate all boilerplate yourself :)
18:43:31*haha_ joined #nim
18:59:24FromGitter<ephja> @krux02 I sometimes discard the statement list if necessary
19:03:08*couven92 quit (Ping timeout: 246 seconds)
19:08:47FromGitter<adamrezich> @Yardanico that would require the event system to be even more generic than it is but I think that's what I'm going to move towards
19:08:56Yardanicowell why? no
19:09:13Yardanicoyou would store some const variables and read them from macros to generate all the stuff you have now
19:09:40FromGitter<adamrezich> well also elements don't have events, components do, because i went down that crazy architectural route lol
19:10:15FromGitter<adamrezich> this all sounds really complicated but it's actually working really well and i'm enjoying writing it in nim
19:10:23Araqyeah don't do that. events are hard to debug. ;-)
19:10:58FromGitter<adamrezich> true!
19:11:04Araqwhy? because they turn control flow into data flow.
19:11:34Araqall the debugging tools attack control flow.
19:12:26LyndsySimonAraq: I'd say that's part of it (i.e., serializing/deserializing from SQL). There are other parts though, like dealing with pagination, enveloping, and error handling. Maybe even auth[n|r], depending on how thin you're trying to keep the library.
19:12:57Yardanicojester + ornim ? :P
19:13:01Yardanico+ some stuff
19:13:11*haha_ quit (Quit: haha_)
19:13:19Araqormin is vaporware but I'm testing it now...
19:13:31Yardanicowell would it be possible to add async to it?
19:14:10Araqoh yeah that's planned too but requires more changes -.-
19:14:32Yardanicowell you're free to do everything you want to do :)
19:15:36AraqLyndsySimon: pagination is just 'order by foo desc; limit 10 offset 20' :P
19:15:55*claudiuinberlin joined #nim
19:15:59Araqerror handling is try: ... except: sendError(getCurrentExceptionMsg)
19:16:09Araqauth is hard...
19:17:00Yardanicohttps://github.com/dom96/jester/issues/26
19:17:28Yardanicowell but you'll still have to implement auth yourself :P
19:18:34Araqwe need a jsongen library
19:18:55Araqsucks to produce a JSON in memory representation only to render it to strings anyway
19:19:20YardanicoAraq, also, some question about ornim - will it always parse .sql file, or maybe in some future you would be able to declare your DB tables from Nim?
19:19:46*haha_ joined #nim
19:19:57Yardanicoah, soorry, ormin, not ornim
19:20:00AraqYardanico: good question, I'm not too happy with the helper exe that parses the SQL
19:20:39Araqit's a weird setup that will cause problems for nimble package management etc
19:22:26*couven92 joined #nim
19:23:16AraqI think yeah, we should have a DSL for table creation too
19:24:06FromGitter<ephja> a DSL for DSLs?
19:24:19Yardanicolol
19:24:25Yardanicohmm, actually SQL is a DSL?
19:27:11Araqephja: SQL is easy to improve upon.
19:27:41Araqfor example, make 'not null' the default for every field declaration... *cough*
19:28:15YardanicoxDDD
19:28:20Araqstandardize on a "ID primary key auto increment" syntax.
19:28:37Araqstandardize the 'references table(column)' syntax
19:29:31FromGitter<ephja> does standard SQL not cover these aspects or do engines often diverge from it anyway?
19:29:53Araqstandard SQL is pretty weak and the db engines shit on it
19:30:12Araqthat means "both".
19:32:49*Matthias247 quit (Read error: Connection reset by peer)
19:40:59LyndsySimonAraq: One way to do pagination is through limit/offset, yes - but not the only way. For instance, it may be necessary to ensure that subsequent pages do not return records that were sent on previous pages.
19:41:24LyndsySimonAraq: To be clear, I'm not saying that's a requirement for anything I'm working on right now - but it is something that I've had to do in the past, and something that other languages' libraries support.
19:42:02Araqsure but I pagination can get tricky so I'm not sure how far it can be abstracted
19:42:07*LyndsySimon nods
19:42:29Araqit's so hard DBs support it out of the box with limit/offset ;-)
19:42:37LyndsySimonYeah, I'm not trying to nail down the details. I'm really just looking for a project I can sink my teeth into so I can come up to speed in Nim.
19:42:38*Jesin joined #nim
19:43:12*LyndsySimon remembers dealing with it manually in MS SQL Server.
19:43:25LyndsySimonMS SQL didn't get limit/offset support until 2012, I want to say.
19:43:46LyndsySimonIt's still not part of ANSI SQL, is it?
19:44:35Araqnot sure, ANSI SQL is like ANSI C. yes there is a standard but there also only a handful of implementations so you can safely ignore it
19:46:15Araqactually it's like most standards. who cares if it adheres to the HTML spec when all the browser agree on it. the spec will adapt soon enough to the real world.
19:46:51*Araq doesn't believe in standards.
19:53:35*ipjk joined #nim
19:54:15*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:55:48*nsf joined #nim
19:59:08*chemist69 quit (Ping timeout: 246 seconds)
20:00:12*Matthias247 joined #nim
20:03:30*claudiuinberlin joined #nim
20:11:29*adeohluwa quit (Quit: Connection closed for inactivity)
20:11:38*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:13:18*miran quit (Remote host closed the connection)
20:16:14*Jesin quit (Quit: Leaving)
20:17:48*chemist69 joined #nim
20:17:59*haha_ quit (Quit: haha_)
20:19:51*Yardanico quit (Remote host closed the connection)
20:21:08LyndsySimonI'm struggling to understand how this works: https://github.com/nim-lang/Nim/blob/devel/lib/impure/db_postgres.nim#L503-L523
20:21:27LyndsySimonThe "connection" parameter doesn't seem to be used for anything as far as I can tell.
20:22:01TjYocothe same proc is used for like 4 different db's
20:22:25TjYocoso if you switch to another one you still just call open
20:22:43LyndsySimonRight, that makes sense. So it's just a case of maintaining the same functional signature?
20:23:03*claudiuinberlin joined #nim
20:23:27TjYocoYeah, it was in Nim in Action, I'm pretty sure thats what it said.
20:24:05LyndsySimonGah. I didn't even see the note in the docstring :(
20:24:58Araqin retrospect I would do it differently. it's not really useful to have the same API for 'open'
20:26:12LyndsySimonFair. Do you take PRs on GitHub?
20:36:10Araqalways.
20:36:28LyndsySimonhttps://github.com/nim-lang/Nim/pull/6381
20:36:54LyndsySimonIt's a tiny, ridiculously small change - but I figure it's better to submit it as a PR than to demand someone else fix it.
20:37:20Araqer ... this is needs to be fixed differently then
20:37:30LyndsySimonThat works too :)
20:37:54Araq"host=localhost dbname=dbname" # you need to construct this string in 'open'
20:38:15AraqI take it back, a unified open proc is awesome for reasons like this
20:38:17LyndsySimonHmm? I tested it locally and it works.
20:38:28Araqyes it works, but it's not correct
20:38:44Araqthat's nuking the abstraction
20:38:48LyndsySimonOK. Let me know if I can correct it, or if I should leave it alone.
20:39:01Araqtry to understand what I mean
20:39:18Araqlet db = open("localhost", "user", "password", "dbname") # this is how it is supposed to work
20:39:28Araq# currently the 'localhost' is IGNORED
20:39:37Araqthat's the bug
20:40:04Araqwithin open you need to construct the
20:40:07LyndsySimonGotchya. I understand the concept of what needs to be done, then. I lack a few pieces of information but i can get them.
20:40:22Araq'host=localhost dbname=dbname' part
20:41:07*salewski quit (Quit: WeeChat 1.4)
20:41:10*LyndsySimon nods
20:42:55LyndsySimonThe connection param is intended to be in the format `<hostname>:<port>`, correct? E.g. `localhost:5432` in the default case?
20:43:08Araqyes
20:43:53*gokr joined #nim
20:44:10LyndsySimonGreat. Outside the scope of this discussion, have you considered supporting URI-style configuration in the standard library?
20:44:26Araqugh, the doc comment says
20:44:37Araq ## Example:
20:44:37LyndsySimonE.g.: `open("postgresql://username:password@localhost:5432/dbname")`
20:44:37Araq ## con = open("", "", "", "host=localhost port=5432 dbname=mydb")
20:45:18Araqno, we want less string parsing, not more
20:45:47Araqthe wrappers do not support runtime switching between DBs anyway
20:46:01*LyndsySimon nods
20:46:30*mahmudov quit (Remote host closed the connection)
20:46:33Araqthere is a nimble package for that though. then your app depends on sqlite.dll, postgre.dll and mysql.dll at the same time, a hallmark of good engineering
20:47:16LyndsySimonIf I build the string in `open`, should I also check to ensure that the host and port are not already specified in the `database` parameter? Not doing so would break backward compatibility.
20:47:59Araqyou break compat by checking the 'database' parameter, I think
20:48:04LyndsySimonLet me know if I'm asking too many questions, by the way. I'm definitely off on a tangent, but it is helping me understand things.
20:48:41Araqyou need to continue to support what the docs show, aka connection empty, stuff cooked up in the dbname section
20:49:08FromGitter<zacharycarter> hoping someone can help me figure out why this code is not exiting the while loop - https://gist.github.com/zacharycarter/dbb8a2561f64fe67ada0edb0e1d538d6#file-nimrl-nim-L53-L95
20:51:48TjYocoecho your queue.len in the while loop. Maybe checkValidity isnt working and you keep adding 4 for every 1 you pop
20:52:12ArrrrI have seen something strange:
20:52:14FromGitter<zacharycarter> yeah that is probably the case
20:52:24FromGitter<zacharycarter> as the queue seems to be growing like crazy
20:52:28ArrrrThis inside your while: dungeon[coord.column, coord.row] = CellKind.Floor
20:52:37ArrrrAnd this inside your check: dungeon[column, row].kind != CellKind.Floor
20:52:54Arrrri don't understand why is there a kind but not in the other place
20:53:01FromGitter<zacharycarter> ooo good catch
20:53:08FromGitter<zacharycarter> oh wait
20:53:14FromGitter<zacharycarter> because one is an assignment and one is checking the property
20:53:17FromGitter<zacharycarter> if you look further up in the code
20:53:28FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59baec48177fb9fe7ec02fc4]
20:53:57FromGitter<zacharycarter> TjYoco: yeah I'm thinking that's what's happening I'm just not sure why...
20:54:34Araqzacharycarter: it's an interesting bug, add a duplicate check
20:54:49FromGitter<Bennyelg> @zacharycarter What does `[]` and `[]=` means
20:54:58FromGitter<Bennyelg> and how do you call them
20:55:06Araqvar traversed = initHashSet[(int, int)]()
20:55:07FromGitter<zacharycarter> Araq: what do you mean a duplicate check?
20:55:22Araqif traversed.containsOrIncl((x, y)):
20:55:29Araq echo "cycle? ", x, y
20:55:48FromGitter<zacharycarter> I'll try that thanks Araq
20:56:17Araqbtw I love Nim's containers
20:57:05ArrrrI have written code like this before, move the CellKind.Floor assignment inside your ifs to gain speed.
20:57:23FromGitter<zacharycarter>
20:57:27FromGitter<zacharycarter> thanks for the protip
20:57:31Araqif checkValidity(dungeon, coord.column, coord.row - 1):
20:57:31Araq queue.addLast((coord.column, coord.row - 1))
20:57:44Araq4 times copied and pasted with minor modifications?
20:57:51FromGitter<zacharycarter> yeah
20:58:01Araquse a template here
20:58:09Araqeliminates typos
20:58:17FromGitter<zacharycarter> good idea
20:59:20FromGitter<zacharycarter> @Bennyelg they are operator overrides
21:01:16Arrrrmaybe is a bug in queue
21:05:13FromGitter<zacharycarter> Maybe
21:05:18ArrrrI compiled it in playground with the change i suggested and it works https://play.nim-lang.org/?gist=340671337ddf5a97bd252e014be5b8fb
21:05:32Arrrrless checks i suppose
21:06:25FromGitter<zacharycarter> Awesome thank you!
21:08:03*Vladar quit (Quit: Leaving)
21:12:03LyndsySimonI'll be glad when the staticly-typed nature of Nim is more natural to me :(
21:12:30LyndsySimonI'm calling a proc, and I want to pass an argument only if that argument is not an empty string; if it is an empty string I want to pass that argument as nil.
21:12:51*xet7 quit (Remote host closed the connection)
21:15:38Araqproc p(param = "")
21:15:45Arrrr(if str == "": string(nil) else: str)
21:16:56*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:17:27AraqArrrr: string(nil) will cease to exist
21:17:40Arrrrwhy is that
21:17:46*vlad1777d quit (Ping timeout: 255 seconds)
21:19:15*MyMind joined #nim
21:20:20ArrrrI suppose you are going to init seqs and strings by default. Will {.noinit.} work for them?
21:20:23*gokr left #nim (#nim)
21:21:05*Sembei quit (Ping timeout: 240 seconds)
21:27:46LyndsySimonAraq: Here you go, round 2 - https://github.com/nim-lang/Nim/pull/6381
21:27:53Araq"" will be mapped to 'nil' internally, Arrrr
21:27:53*vlad1777d joined #nim
21:28:11Araqbtw len(s) for s.isNil returns 0 already
21:28:18Araqand does so since quite some time
21:28:35*relax quit (Ping timeout: 240 seconds)
21:28:42Araqmaybe later we'll get a different string implementation
21:29:34Araqbut having both nil and "" sucks, always makes for subtle differences nobody should care about. if you do care, use an Option type
21:30:25AraqLyndsySimon: looks good
21:30:35LyndsySimonWoot!
21:30:35ArrrrSo, will "" consume memory or not, that's the question.
21:30:41*LyndsySimon celebrates
21:30:43Arrrrother than pointer that is
21:31:09LyndsySimonThe code is mostly copied from db_mysql, but still. I had to figure out what it was doing, I didn't just copypasta.
21:32:48AraqLyndsySimon: I suppose 'port' should be a parameter of open too :-)
21:33:01Araqbut that's a PR for another time
21:33:27LyndsySimonAraq: Yes, I agree. If we take the approach of "less string parsing is better", then that's what I would do to be consistent.
21:33:32AraqArrrr: no, we map it to 'nil', newString(0) will continue to allocate though
21:34:57LyndsySimonYou mentioned earlier that the package that lets you use URIs required your app to be dependent upon multiple DBs' DLLs. Is that necessarily the case, though? Couldn't you have compile-time code that parses the connection string and conditionally includes only the library that's appropriate? Assuming of course that the DB URI is not configurable at runtime.
21:36:26Araqthen the type would be static[string], not 'string'
21:38:36Araqbut string based DSLs are suspicious, I know the Nim syntax, I can construct a call like connect(database = "x") # use defaults for the other parameters
21:38:57Araqbut how do I the same in the string literal? it is not obvious
21:39:56Araqthe error messages are also likely worse when I get it wrong, the compiler's error messages are good, ymmv
21:40:41*couven92 quit (Ping timeout: 240 seconds)
21:47:34*couven92 joined #nim
21:51:10*vivus quit (Quit: Leaving)
22:00:59*elrood quit (Quit: Leaving)
22:12:44FromGitter<zacharycarter> Arrrr: I'd still like to know why my first post didn't work
22:12:54FromGitter<zacharycarter> because I don't think your solution gives me the results I'm expecting
22:13:02FromGitter<zacharycarter> unless there's another bug somewhere else in my code
22:14:45Araqzacharycarter: replace the queue with a seq to rule out a stdlib bug
22:15:22FromGitter<zacharycarter> will do
22:17:12*Trustable quit (Remote host closed the connection)
22:22:02FromGitter<zacharycarter> must be a bug in my implementation thanks for the suggestion Araq, doesn't work with a seq either
22:22:30Araqtrace it and it should become obvious
22:22:47Araqthere is something we're all missing :-)
22:28:10ipjkzacharycarter: mind pasting a link so I can have a go at it?
22:28:17FromGitter<zacharycarter> sure
22:28:36FromGitter<zacharycarter> I think I know the problem though - Araq hinted at it earlier, the same neighbors are getting added to the queue over and over again
22:28:59FromGitter<zacharycarter> ipjk: https://play.nim-lang.org/?gist=13389d1a61a89cbaceedc48f66b01b55
22:29:26Araqplay.nim-lang is so awesome :D
22:29:32FromGitter<zacharycarter> thank you! :D
22:29:40*nsf quit (Quit: WeeChat 1.9)
22:29:40Araqoh yeah
22:29:53Araqit's your work, good job
22:30:00Araqcan you add c2nim support?
22:30:14FromGitter<zacharycarter> probably - I'll take a stab at it over the weekend
22:30:21Araqthat would be so cool
22:30:31Araqoften I only need to translate C snippets
22:30:42Araqand creating a file, running c2nim on it etc is overkill
22:30:54FromGitter<zacharycarter> yeah that would be super handy I'm often doing the same thing
22:32:39Araqhuh, what's this? word wrap for the editor? is it 2017 already?
22:34:00FromGitter<zacharycarter> I wish we had a better editor for the playground
22:36:28FromGitter<zacharycarter> alright finally fully connected caves :D
22:37:38FromGitter<zacharycarter> https://imgur.com/a/HlLll
22:47:17AraqI still don't get why your cycle detection doesn't work :-)
22:47:35*Arrrr quit (Ping timeout: 240 seconds)
22:51:12FromGitter<zacharycarter> ¯\_(ツ)_/¯
22:51:37FromGitter<zacharycarter> time for some other type of dungeon
22:51:57FromGitter<zacharycarter> BSP I guess
23:03:09*yglukhov quit (Remote host closed the connection)
23:08:18TjYocoWhen I try nimble publish it tells me 'Host key verification failed. fatal: Could not read from remote repository.'
23:08:39TjYocoI have public_repo checked for my access token, is there anything else I need?
23:09:02Araqsorry, no idea
23:09:22*renarc joined #nim
23:11:42couven92Araq, any new ideas for the vcc regression bug?
23:12:03Araqcouven92: does it work without -d:release?
23:12:08couven92yes
23:12:33dom96TjYoco: That sounds like a git error
23:12:41dom96Is it setup correctly?
23:12:53*jsgrant quit (Ping timeout: 255 seconds)
23:13:30TjYocodom96 I have setup through VSCode and I can push and pull from remote
23:14:33dom96TjYoco: Can you git clone from command line?
23:14:38TjYocoalthough... it does say 'Command: git clone [email protected]:Tyler-Yocolano/packages' and my thing isnt called packages, but idk if thats a nimble thing
23:15:29TjYocodom96 yeah I just cloned my repo
23:15:30Araqcouven92: try to compile semcalls.c without optimization settings
23:15:48Araqit used to be easy to do that but I forgot
23:16:03couven92{.opt: none.}
23:16:06couven92?
23:20:21Araqno.
23:21:21couven92Yeah, that would have been too easy right? :P Well, would've been nice :P
23:22:12couven92Araq, can I run `nim compile -c compiler/nim` and then edit `nimcache/nim.json`?
23:22:52Araqno
23:23:35couven92what is the projectname.json for anyways? just randomly useful metadata or does nim actually use it?
23:26:53Araqmetadata for other tools
23:27:03Araqnim only produces it, it doesn't consume it
23:27:22couven92Araq, I can compile nim with a non-optimized semcalls.c manually from the command-line and see what happens
23:27:29couven92but that's really messy :(
23:28:07couven92since nim.json tells what I need to do... :)
23:28:19FromGitter<mratsim> @zacharycarter Is there a bug tracker/feature request on play.nim-lang.org? I would like to see ASM output similar to https://play.rust-lang.org/ or https://gcc.godbolt.org/ to understand where the compiler uses AVX and where I should give him a small nudge.
23:29:11FromGitter<mratsim> oh, and loop unrolling
23:30:37Araqcouven92: add this to nim.cfg
23:30:52Araqsemcalls.speed = ""
23:31:02Araqand pray it works :-)
23:31:15couven92WOW! okay, let's see :)
23:31:42couven92that would be in `compiler/nim.cfg`, right?
23:37:21couven92Araq, nope same error
23:37:41Araqcheck these options are used please
23:37:51Araqmaybe you need
23:38:05Araqsemcalls.speed = "-O0" or vcc's equivalent
23:38:50TjYocoIt says verified as Tyler-Yocolano, so that should mean my access token worked right? And my repo is public as seen https://github.com/Tyler-Yocolano/nimbomb and my token says "public_repo" not sure what else to try
23:38:56FromGitter<zacharycarter> @mratsim please just file an issue on github https://github.com/zacharycarter/nim-playground
23:40:34couven92Araq, uhm... that's weird... nim does not generate `nimcache/compiler_semcalls.c` at all... is semcalls included somewhere instead of imported?
23:41:24couven92which would also mean, that `semcalls.option` can't really work, right? since nim doesn't actually invoke the compiler for semcalls.nim
23:41:33Araqyeah
23:41:53Araqnimgrep for it
23:44:52couven92Araq, no match?
23:44:58dom96TjYoco: Afraid you'll need to create a PR manually
23:46:45couven92ah, semcall not semcalls and it's in sem.nim
23:47:11couven92so `sem.speed = "/Od"` in the config then? let's see...
23:49:06TjYocodom96 could you confirm that it should output: 'Command: git clone [email protected]:Tyler-Yocolano/packages ...' and not '[email protected]:Tyler-Yocolano/nimbomb', my actual package name? As well, I enable every tick mark under the access token and instead of outputting: 'Host key verification failed.', it read: `Permission denied (publickey).' That seems strange...
23:49:31dom96yes, it should
23:50:10TjYocodom96 whoops thats the nimble packages thing, duh
23:51:55couven92Araq, no setting `sem.speed = "/Od"` (with `/Od` being vcc's don't optimize) didn't do it... same error and nim.json shows `/O2` (optimize for speed)
23:53:06Araqsem.always = ?
23:56:59couven92Araq, nope and even with both configs there it doesn't affect anything... (maybe need `compiler` prefix, since it's in compiler?
23:57:46couven92AH! maybe do `sem.options.always`...
23:57:57couven92like with `vcc.options.always`