<< 13-09-2017 >>

00:15:52*Elronnd quit (Ping timeout: 276 seconds)
00:16:17FromGitter<dom96> Hrm
00:17:18*mahtob quit (Quit: Leaving)
00:17:33*mahtob joined #nim
00:19:42*Elronnd joined #nim
00:22:11*jsgrant joined #nim
00:37:00*smt quit (Remote host closed the connection)
00:37:38*smt joined #nim
00:37:58*StarBrilliant quit (Ping timeout: 276 seconds)
00:38:19*smt quit (Max SendQ exceeded)
00:38:51*smt joined #nim
00:45:48*StarBrilliant joined #nim
01:01:52*yglukhov quit (Remote host closed the connection)
01:15:20shodan45hm, anyone seen this? http://langserver.org/
01:15:40shodan45might be interesting to support nim
01:36:02*nitely joined #nim
01:38:38*chemist69 quit (Disconnected by services)
01:38:43*chemist69_ joined #nim
01:41:19*nitely_ joined #nim
01:41:49*nitely_ quit (Client Quit)
01:59:41jsgrantshodan45: Was talked about/brought up by dom96 awhile ago on issue-tracker, but to my (very limited) knowledge hasn't been pursued.
01:59:46jsgrantWould be glad to see,
01:59:56jsgranthttps://github.com/nim-lang/nimsuggest/issues/59
02:00:39jsgrantBtw, dom96 getting my copy of 'Nim In Action' at the end of the week. :^)
02:01:19*ipjk_ joined #nim
02:01:45*def-pri-pub joined #nim
02:02:47jsgrantReally, it's something I'm shocked that is just now becoming somefactor of standard/expectation; Seems like something that would've been tried/done in the 90s to early 00s.
02:02:54def-pri-pubAraq, dom96, et. al: I'm going to be giving a lighting talk on Nim at a Indie Game Dev. Meetup in about a week. I'm looking to give a good overview of the features of the language without going into to heavy into code
02:03:07def-pri-pubAre there any other existing presentations I could take a look at?
02:03:17def-pri-pubOr is there anything that I should definatley mention about Nim?
02:03:55jsgrantdef-pri-pub: Going to be recorded?
02:04:02def-pri-pubNo
02:04:08jsgrant:^(
02:04:14def-pri-pubUnless I want it to. I'm only given 5-8 minutes
02:04:21*ipjk quit (Ping timeout: 240 seconds)
02:04:44jsgrantdef-pri-pub: You can mention the nim-godot bindings.
02:05:49def-pri-pubYeah, I'm goint to talk about zengine (what zacharycarter and I have been working on)
02:06:10jsgrantOh neat. One of the things on my list. :^)
02:06:11def-pri-pubI'm going to try to give a general overview, so I'm only looking to talk about what's avaialable
02:06:21def-pri-pub(We could use more help on zengine BTW)
02:06:59jsgrantToo "noob" at this point; Maybe in a good year.
02:07:09jsgrantEnd of 18, plan on doing gamejams again.
02:07:26jsgrantMaybe actually submit them publicly for once. :^)
02:08:12jsgrantThe amount of "hype" around Nim for Gamedev, has actually been a big push for me to get interested in it again & Nim generally.
02:08:48jsgrantWas talking about this the other day, not exactly sure why, but there does to seem like a strong focus here.
02:08:48def-pri-pubNim is still kind of bare-bones when it comes to game dev.
02:09:27def-pri-pubIt's not impossible to make a game in nim right now, it's just going to take more time that using a conventional (and well known) engine like Unreal & Unity
02:09:29jsgrantdef-pri-pub: Yeah, but the amount of excitement there seems to be is a big boon; Is what I'm getting at.
03:00:49*libman quit (Quit: Connection closed for inactivity)
03:06:34def-pri-pubI also wouldn't recommend Nim for gamejams just yet
03:07:13def-pri-pubI did that for the LGJ2017 (as well as some others). Since it was still a little bare bones I ended up doing more infrastrucutre work than game work.
03:11:16*def-pri-pub quit (Quit: leaving)
03:16:26*endragor joined #nim
03:17:24*libman joined #nim
03:27:57*dddddd quit (Remote host closed the connection)
04:16:54*mahtob quit (Remote host closed the connection)
04:18:40*renarc joined #nim
04:22:02*yglukhov joined #nim
04:26:27*yglukhov quit (Ping timeout: 240 seconds)
04:44:34jsgrantWell, at the earliest it'd be the tail-end of 18 -- but I get ya.
04:45:49jsgrantI'm fairly interested in the general architecture of a lot of this stuff, than the actual resulting-games at this point mostly anyways -- was just planning to use such a thing as a mechanism to push myself more in that direction.
04:47:22jsgrantI have a solid half-year prior to my dipping into Nim generally, anyways, to somewhat refactor my brain away from Lisp. :^)
04:47:55jsgrantSo at best, I have time & at worst I'll have some more motivation to dig deep in the nitty and/or gritty.
04:48:12*arnetheduck quit (Remote host closed the connection)
04:49:29*jsgrant hasn't written formally in like 3 years now ... and it's starting to show; The amount of accidental recurrence (combo-breakers) is getting annoying to him. Seem to be doing it all the time ... but "anyways".
04:51:30*arnetheduck joined #nim
05:07:36*miran joined #nim
05:08:44shodan45wait, there's already a nim-godot?
05:09:00shodan45that was a "shower thought" I had the other day
05:20:18*ipjk_ quit (Read error: Connection reset by peer)
05:28:17*yglukhov joined #nim
05:32:45*yglukhov quit (Ping timeout: 252 seconds)
05:38:32*rauss quit (Quit: WeeChat 1.9)
06:00:43*HoloIRCUser1 joined #nim
06:00:44*nitely quit (Read error: Connection reset by peer)
06:01:30*HoloIRCUser1 quit (Client Quit)
06:02:17SusWombatshodan45, https://github.com/pragmagic/godot-nim
06:03:42FromGitter<Grabli66> But it requires godot 3.0, that is not ready :)
06:04:26shodan45oh, well I guess that's "better" in a way
06:06:11*Vladar joined #nim
06:08:05*miran quit (Ping timeout: 240 seconds)
06:14:39FromGitter<Grabli66> But i dont see big difference between using gdscript and nim. Syntax is very similiar. But gdscript is native for godot.
06:14:50*jsgrant quit (Quit: jsgrant)
06:15:06*jsgrant joined #nim
06:16:07FromGitter<superfunc> From first glance, gdscript is dynamically typed, provides no real metaprogramming; those seem like non trivial differences to me
06:16:50*yglukhov joined #nim
06:17:07*jsgrant quit (Read error: Connection reset by peer)
06:17:17FromGitter<superfunc> Syntax is such a small part of a language, and one of the least important parts imo
06:20:57*nsf joined #nim
06:20:57*yglukhov quit (Ping timeout: 240 seconds)
06:23:33FromGitter<Grabli66> Why do you need metaprogramming for game development? :)
06:25:15FromGitter<superfunc> Metaprogramming is useful, to me, most times I need to do any kind of programming.
06:32:34*endragor quit (Remote host closed the connection)
06:34:21FromGitter<Grabli66> dom96, ping :) need help with jester
06:38:35*yglukhov joined #nim
06:40:31*endragor joined #nim
06:46:07*yglukhov quit (Remote host closed the connection)
06:47:45SusWombatgdscript is slow af
06:48:45SusWombatIts fast enough for most stuff. But good luck if you need tons of looping in your code
06:50:05FromGitter<Grabli66> Do you have a benchmark between gdscript and nim-godot?
06:50:32SusWombatno havent used nim-godot yet
06:53:45*endragor quit (Remote host closed the connection)
07:05:20*solitudesf joined #nim
07:06:15*PMunch joined #nim
07:09:24*couven92 joined #nim
07:27:28*claudiuinberlin joined #nim
07:31:01*claudiuinberlin quit (Client Quit)
07:35:34*Arrrr joined #nim
07:50:02Arrrrhttp://code.haxe.org/category/beginner/pattern-matching.html interesting ideas, you can switch on two values at the same time!
07:50:19*claudiuinberlin joined #nim
07:51:22FromGitter<Grabli66> Yeah, haxe is good. :)
07:52:52*yglukhov joined #nim
07:53:00*endragor joined #nim
07:54:46ArrrrI'm surprised is not as popular as nim on github.
07:57:42*yglukhov quit (Ping timeout: 260 seconds)
08:11:48*couven92 quit (Ping timeout: 246 seconds)
08:16:11*couven92 joined #nim
08:18:31*yglukhov joined #nim
08:29:31*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:36:29*claudiuinberlin joined #nim
08:43:48*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:06:57*vlad1777d joined #nim
09:25:05*claudiuinberlin joined #nim
09:26:26*mpc joined #nim
09:26:59FromGitter<dandevelop> Is there any way to specify variables like vcc.exe as command line arguments for the nim compiler instead of having them in a nim.cfg file?
09:28:40*mpc is now known as mpc___
09:29:21Araq_--cc:vcc
09:30:09*mpc___ quit (Remote host closed the connection)
09:32:06FromGitter<dandevelop> @Araq_ that is good for setting visual C++ as a compiler. Does what also work for setting variables like vcc.options.speed ?
09:32:26Araq_in theory, yes
09:32:37Araq_--vcc.options.speed="stuff here"
09:32:49Araq_in practice I never tested it :-)
09:34:03*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:50:01FromGitter<dandevelop> @Araq_ just tested it and it looks like it works! Thanks!
10:00:21*solitudesf quit (Ping timeout: 240 seconds)
10:10:15*couven92 quit (Quit: Client Disconnecting)
10:20:22*StarBrilliant quit (Ping timeout: 276 seconds)
10:22:00*StarBrilliant joined #nim
10:25:50*ShalokShalom_ joined #nim
10:29:27*ShalokShalom quit (Ping timeout: 240 seconds)
10:30:32*ShalokShalom_ is now known as ShalokShalom
10:32:11FromGitter<mratsim> Mmmh Haxe pattern matching is not that impressive compared to Haskell’s and Rust’s.
10:34:44FromGitter<mratsim> Both are also checked to make sure you handle all cases for common types iirc (enums …)
10:37:55*StarBrilliant quit (Ping timeout: 276 seconds)
10:39:02*StarBrilliant joined #nim
10:51:22ArrrrI thought it was quite complete.
10:53:54ArrrrNim type security: `uint16(random(int(high(uint16))))`
10:54:34*p0nce joined #nim
10:57:51Araq_ever used unsigned floats?
10:58:05*claudiuinberlin joined #nim
10:58:25Araq_if not, why is so uint16 so important? I never use unsigned and I'm a happy man.
10:58:46Araq_programming languages work better when you do not fight them constantly.
10:59:28p0nceunished is a tragedy in C family, Java did the right thing
10:59:34p0nceunsigned*
11:00:08*claudiuinberlin quit (Client Quit)
11:00:49*libman quit (Quit: Connection closed for inactivity)
11:01:59ArrrrYes and who needs manual memory management, and value types, and so forth. Python is the future but we are in the present.
11:04:11*Vladar quit (Quit: Leaving)
11:11:02FromGitter<zacharycarter> o/
11:11:28FromGitter<zacharycarter> gdscript is horrible btw
11:11:38FromGitter<zacharycarter> @Grabli66
11:19:27*Arrrr quit (Ping timeout: 248 seconds)
11:20:23*Yardanico joined #nim
11:22:10*Arrrr joined #nim
11:22:10*Arrrr quit (Changing host)
11:22:10*Arrrr joined #nim
11:24:32FromGitter<Grabli66> @zacharycarter , normal language, like python
11:26:53FromGitter<Yardanico> @Grabli66 well gdscript will be slower than any compiled language, I think you don't need benchmarks to understand this
11:32:53YardanicoGrabli66: well it's not general-purpose language
11:33:05Yardanicoit's for games only, and for godot :)
11:33:23Yardanicoand godot team may have used C# if microsoft would buy xamarin (mono) eariler
11:33:34Yardanicobecause microsoft changed mono license to MIT
11:43:11Araq_Arrrr: that doesn't follow at all. and I said, there is no "unsigned float" and the world is a better place
11:44:43ArrrrWe don't know that.
11:45:56Araq_yes we do. a plethora of primitive types causes serious interop problems everywhere, JSON doesn't support uint64, for example
11:48:02ArrrrAnything web-related is not a moral authority. JSON was made for people who don't care how many icebergs will melt as a result of my cpu casting 'firaga'.
11:48:03*dddddd joined #nim
12:06:40PMunchUnsigned has a place in data representation in constrained environments. Take for example an NFC Mifare Ultralight card with 64/192 bytes of memory, you don't want to spend precious bytes for something you don't need. Or in low level communication protocols, you want as little overheard as absolutely possible.
12:07:05FromGitter<Grabli66> @Yardanico , there is facts? :)
12:07:16Yardanicoabout what? speed?
12:07:33Yardanicohttps://godotengine.org/qa/3857/gdscript-vs-c-which-one-is-faster
12:07:41FromGitter<Grabli66> Speed
12:08:12Yardanicoif you really think that interpreted language can be faster than compiled language without VM - eh, I have nothing to say...
12:08:16FromGitter<Grabli66> It's vs C, not Nim and C#
12:08:28Yardanicovs c++
12:08:33Yardanicoand nim is compiled to c/c++
12:08:34FromGitter<krux02> unsigned is really overrated
12:08:50Araq_http://jakegoulding.com/blog/2011/02/06/sqlite-64-bit-integers/
12:09:01Yardanicoso you may expect that gdscript is ~70-100 times slower than Nim
12:09:04FromGitter<krux02> and I remember a talk from c++ developers where they said it was a mistage to make the size_t (size of std::vector) an unsigned integer
12:09:12FromGitter<krux02> a mistake everybody has to live with now
12:09:33FromGitter<krux02> unsigned is really not that important and should be avoided
12:09:36Araq_PMunch: you don't lose "precious" bytes, you lose a single bit
12:09:45FromGitter<Grabli66> Yardanico, again, no facts
12:09:48Yardanicolol
12:09:53Yardanicoreally LOL
12:10:04YardanicoThis is the fact - https://godotengine.org/qa/3857/gdscript-vs-c-which-one-is-faster
12:10:14Yardanicoand nim is compiled to C/C++, so
12:10:27*claudiuinberlin joined #nim
12:10:42FromGitter<krux02> just because nim is compiled to C doesn't make iit by definition as fast as C
12:10:46FromGitter<Grabli66> so. No facts :). There is benchmarks?
12:10:46PMunchAraq_, there's only 8 bits to a byte, they go by pretty fast.
12:10:47Yardanicoyeah I know
12:10:56FromGitter<krux02> it makes it at best as fast as C
12:10:58Yardanicobut it doesn't make it as slow as an interpreted language
12:11:21YardanicoGrabli66: do it yourself, it's pretty easy
12:11:28Yardanicobut there are facts - nim speed vs other languages speed
12:11:33FromGitter<krux02> well not really
12:11:47FromGitter<krux02> yes nim is faster that interpreted languages, but not just because it is compiled to C
12:12:23FromGitter<krux02> I am pretty sure somebody can write a python to C compiler that compiles everything, but without being faster that the interpreter
12:12:46PMunchkrux02, Cython?
12:13:00PMunchIt is faster than Python, but only a subset of the language
12:13:10YardanicoGrabli66 I don't say that nim is exactly 100 or 70 times faster , but it's definitely FASTER than gdscript
12:14:26FromGitter<krux02> how about changing the subject
12:14:34Yardanicoyeah, sorry
12:16:07Arrrr"What does SQLite do for a value outside of this range? As we saw earlier, it switches over into floating point" Bravo
12:17:34ArrrrWhat happens when your ass doesn't fit a chair? you split yourself in half.
12:18:26FromGitter<Bennyelg> @Arrrr no, you just start to eat less burgers
12:18:36Yardanicoso create smaller numbers ? :)
12:19:08ArrrrWell again, everything related to web happens in a non-euclidean space.
12:21:47*xet7 joined #nim
12:25:10*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:29:48*claudiuinberlin joined #nim
12:31:02FromGitter<krux02> we live in a non euclidean space.
12:31:48PMunchDoes that mean that we are web-technology? *shudders*
12:32:36FromGitter<zacharycarter> @Grabli66 just try godot out with gdscript and see how slow it is for yourself
12:32:49FromGitter<zacharycarter> there's a reason they advise you to write performance sensitive code in C++ and not GDscript
12:33:05FromGitter<krux02> well there are people who say that for game development the speed of the scripting engine in not important
12:33:11FromGitter<zacharycarter> but it is
12:33:24FromGitter<krux02> I like to disagree here, but only because I like games like factorio with huge simulations
12:33:40*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
12:33:43FromGitter<krux02> when you want to develop the new Zack McKracken, then speed might be secondary
12:33:48Yardanicobecause big games are all mostly made with C/C++/ even asm sometimes :)
12:34:02FromGitter<krux02> well that is not true anymore
12:34:10FromGitter<krux02> most games today are made in Unity
12:34:19Yardanicowell ok, game engines are made in C/C++ :)
12:34:37Yardanicobecause if you write some c# in unity, it calls C++ code in the game engines
12:34:40Yardanico*in uniyu
12:34:42Yardanicounity
12:34:51FromGitter<krux02> and other big engine games have their scripting engines so that the work of the level designers can be split from the programmers
12:35:08FromGitter<zacharycarter> Unity would not be popular if it didn't offer C# as a scripting language
12:35:14FromGitter<zacharycarter> and you had to write gameplay code in C++
12:35:25FromGitter<krux02> if you call a function in python it calls some C code
12:35:30FromGitter<krux02> that is not really an argument
12:35:44FromGitter<zacharycarter> GD script is a shitty version of Python though
12:35:48FromGitter<krux02> the logic you implement in the scripting engine is limited by the speed of the language
12:35:58FromGitter<zacharycarter> they would have been much better off adopting python or some other language as the scripting languge
12:36:00FromGitter<zacharycarter> instead of writing their own
12:36:16FromGitter<krux02> eventually gd script might die
12:36:20PMunchI think a simple game engine/editor in Nim could become pretty popular
12:36:24Yardanico+1
12:36:28FromGitter<zacharycarter> zengine
12:36:29FromGitter<zacharycarter> ...
12:36:34FromGitter<zacharycarter> just needs an editor!
12:36:45FromGitter<zacharycarter> it's already stupid simple
12:36:45Yardanicowell if you compare how easy is unity or godot
12:37:00FromGitter<krux02> or github.com/krux02/opengl-sandbox
12:37:00FromGitter<zacharycarter> yeah unity or godot have thousands of hours of multiple developers behind them
12:37:16FromGitter<zacharycarter> opengl-sadbox and zengine are like 4 people combined :P
12:37:23FromGitter<zacharycarter> sandbox
12:37:25FromGitter<zacharycarter> sorry not sadbox lol
12:37:34*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:37:53FromGitter<zacharycarter> if the community wants these things they need to help contribute to the projects
12:38:02FromGitter<zacharycarter> no one is going to swoop in and decide to build the next big game engine in Nim
12:38:03FromGitter<zacharycarter> it's too risky
12:38:05PMunchTBH, writing it in pure Nim + SDL + gamelib for the gamejam was pretty nice.
12:38:38PMunchSure, the result is a mostly single file hot mess of code, but it was easy to write and maintain for that short period of time.
12:38:47FromGitter<krux02> PMunch that is opengl-sandbox
12:39:14PMunchHuh?
12:40:02FromGitter<krux02> it is SDL2 + Opengl + glm + nim-macros for easy renderer development
12:40:28FromGitter<krux02> it does not create new abstractions on top of things that already exist
12:40:45PMunchI was talking about this: https://github.com/PMunch/TromsoGameJam2017
12:40:53PMunchThe game I made this weekend for a Game Jam
12:42:02FromGitter<krux02> does anybody of you know how to change the framerate of a gif?
12:42:46FromGitter<krux02> PMunch: sorry, what I meant is that opengl-sandbox is designed to be useful in a gamejam
12:43:17PMunchOh right, yeah I would imagine :)
12:43:19FromGitter<krux02> just to give you an example
12:43:40PMunchhttps://ezgif.com/speed
12:43:44FromGitter<krux02> two days ago I implemented an octree and I wanted to draw the octree with AABB (axis aligned bounding boxes)
12:43:51PMunchThat should probably work for changing your gif speed by the way
12:44:05FromGitter<krux02> I wrote an exporter that exported the AABB as pairs of Vec3
12:44:14FromGitter<krux02> (min, max: Vec3f)
12:44:55FromGitter<krux02> and then to render them I simply wrote a renderer that used instancing to draw all cubes at the same time
12:45:45FromGitter<krux02> I could use the values from ``seq[tuple[min,max: Vec3f]]`` instantly without conversion
12:46:14FromGitter<Grabli66> @zacharycarter I wrote a small game on godot with gdscript. Normal performance.
12:47:23Yardanicowell yeah, it wouldn't be noticeable for a small game
12:47:42Yardanicozacharycarter said: " there's a reason they advise you to write performance sensitive code in C++ and not GDscript"
12:48:45PMunchTry do something silly like implement an A* algorithm in gdscript and run a couple thousand instances of it simultaneously
12:49:06FromGitter<zacharycarter> exactly
12:49:10*claudiuinberlin joined #nim
12:50:34PMunchSomething which wouldn't be completely unthinkable in an RTS game
12:50:38FromGitter<Grabli66> Gdscript is not for calculation. It's for controling game entity. There is no need of great performance.
12:51:37*Yardanico quit (Remote host closed the connection)
12:52:22PMunchAh, that is a point with some validity. For high-level orchestration you probably don't need the best performance. But remember that things scale, a little bad performance here, a little bad performance there and suddenly everything is slow.
12:54:39FromGitter<Grabli66> For that there is a profiler, and possibility to write in C++ if need a performance
12:55:36PMunchYeah, that is a popular approach. I prefer to write my things optimized from the get-go. That way I don't have to deal with it later.
12:56:45PMunchAnd by optimized I don't mean squeezing every little drop of performance out of it, just using sensible algorithms and types get's you a long way
12:57:17PMunchAnd compiled > interpreted for speed, always
12:58:11*spica joined #nim
12:58:39spicaHi guys. Is it possible to remove data from simple sets? var xxx = {'a' .. 'z'}
12:59:11PMunchhttps://nim-lang.org/docs/sets.html#excl,HashSet[A],A
12:59:21FromGitter<Grabli66> You can write your "compiled" program that it will be slower than interpreted.
12:59:29PMunchOh wait, that was for hash sets
12:59:58spicayeah, so I guess they are immutable
13:00:07PMunchThe operation is still called excl for the built in set though
13:00:14PMunchhttps://nim-lang.org/docs/manual.html#types-set-type
13:01:45PMunchGrabli66, well it would take some work, but I guess you would be able to get worse performance
13:03:15FromGitter<krux02> https://camo.githubusercontent.com/bbec54f58f9f10beb07a20d5fe0465586d888763/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f6c314a3973363553576a486979614a656f2f67697068792e676966
13:03:18spicadoes anybody know if it's possible to get some ids for 'objects' like arrays, sets?
13:03:36spicarepr only works on seqs
13:03:41spicawhich are on the heap
13:04:14*renarc quit (Remote host closed the connection)
13:04:29FromGitter<krux02> what do you mean by id?
13:04:59FromGitter<krux02> you can call ``addr``
13:05:01spicain python there's the id method
13:05:05spicaoh
13:05:10spicalet me check that
13:05:17FromGitter<krux02> well it is usique
13:05:26FromGitter<krux02> but probably not what you want
13:05:50PMunchYeah, what are you trying to do spica?
13:06:24spicaI was trying to see the 'id' or a set b4 and after incl
13:06:29spicato see if it changes
13:07:56PMunchIt should change, I guess you could check with in or contains. Or just check if the card (number of elements in set) changes.
13:07:58spicakrux02: addr doesn't seem to work
13:08:17spicaPMunch, I was talking about the location of the set
13:08:20spicanot about the content
13:08:22PMunchaddr is the memory location of the object, which doesn't change if you add data to it :P
13:08:26spicathe memory loc
13:08:34PMunchOh, that's addr
13:09:03spicahow can I use it? not working on sets it seems, not even on seqs
13:09:18FromGitter<krux02> it does not work on let values
13:09:24FromGitter<krux02> only on var
13:09:26spicatrying on var
13:09:28spicabut not working
13:09:31Araq_unsafeAddr ftw
13:10:29PMunchWhat do you mean it doesn't work?
13:10:34Araq_but it's rather pointless for your purpose, it can change or not depending on mostly implementation details
13:10:57Araq_(It can be an object that refs a seq that grows, the object stays the same)
13:11:03spicaPMunch, my bad. I was trying to echo, it was complaining about the fact that $ is not defined... with repr it works
13:11:13PMunchOh yeah :P
13:11:27PMunch$ is not implemented for ptr set
13:11:43PMunchBut I still don't see what you would want to use this for
13:12:17PMunchAs Araq_ pointed out it's not really something that should be compared, since it can change or not just depending on implementation
13:12:50spicayeah
13:13:04spicasets seem to hve the same ref even after incl
13:13:08spicaokay
13:13:23PMunchBut it might not
13:13:28spicaI understand
13:13:36PMunchIt's not a rule, it's not something you can depend on
13:13:41spicagot it
13:14:56spicafor eg. the arr is different on sequences, after assignment. So I guess they are copied even if they are on the heap
13:15:58*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:16:11PMunchUhm, no. A seq can change it's addr when you add elements to it. But that again is not a rule. It does have value semantics though, so if you pass a seq to a proc it will be copied and get a different addr
13:16:50spicathat's what I was saying. I had a seq, and assigned it to another seq var, hoping to get a reference to it
13:16:59spicabut it's copied
13:17:12PMunchAh, you should create a ref seq in that case
13:17:13spicathe seq is a copy
13:17:18spicahow
13:17:22PMunchThen you can pass around the ref and not the seq
13:17:30spicaoh, ref in proc?
13:18:01*xet7 quit (Remote host closed the connection)
13:18:14*claudiuinberlin joined #nim
13:20:13PMunchvar x = new seq[int]
13:20:18PMunchThat gives you a ref seq[int]
13:20:29spicadidn't know that. thanls
13:21:28*ehmry quit (Ping timeout: 240 seconds)
13:21:48*byteflame quit (Ping timeout: 240 seconds)
13:21:49*hohlerde quit (Ping timeout: 240 seconds)
13:22:36spicayeah but .add(1) fails to work. How do I populate? @[1] also fails
13:23:00spicagot (seq[int]) but expected 'ref seq[int]'
13:23:05spicawhen assigning @[]
13:24:22*ldlework quit (Ping timeout: 260 seconds)
13:25:09*watzon quit (Ping timeout: 246 seconds)
13:25:17*Demos[m] quit (Ping timeout: 255 seconds)
13:25:17*TheManiac quit (Ping timeout: 255 seconds)
13:25:34*notdekka[m] quit (Ping timeout: 264 seconds)
13:25:34*Jipok[m] quit (Ping timeout: 264 seconds)
13:25:34*dyce[m] quit (Ping timeout: 264 seconds)
13:25:40*jivank[m] quit (Ping timeout: 276 seconds)
13:25:45*mindB quit (Ping timeout: 246 seconds)
13:25:46*MrAxilus[m] quit (Ping timeout: 246 seconds)
13:26:35*ldlework joined #nim
13:27:01def-spica: probably have to dereference with []
13:27:10def-xs[].add(1)
13:27:26def-you might also want to look into shallow and shallowCopy
13:27:44FromGitter<Bennyelg> if I want to "Inharitance" DbConn to a new connection I am build
13:27:51FromGitter<Bennyelg> what is the best way
13:28:58spicadef-: illegal storage access
13:29:03spicavar p = new seq[int]
13:29:03spicap[].add(12)
13:29:48def-you didn't call newSeq on it yet
13:30:19FromGitter<krux02> I just used git lfs (large file storage) and it was surprisingly simple
13:30:22spicawell, it worked with @[12]
13:30:41spicaand now add works
13:31:27FromGitter<krux02> spice: something tells me that you want to do something overly complicated that can be done much simpler
13:32:03FromGitter<krux02> I am not in your head, so I don't know want your goal is.
13:32:05spicakrux02, I'm actually not trying to do anything. I'm just curious (reading through Nim in action)
13:32:15FromGitter<krux02> ah
13:32:16FromGitter<krux02> ok
13:32:25FromGitter<krux02> I have the book as well
13:32:50Arrrr"Try do something silly like implement an A* algorithm in gdscript and run a couple thousand instances of it simultaneously" i'd say it would be equally slow with C. RTS use different pathfinding algorithms
13:32:57FromGitter<krux02> but it arrived when I already know most of what is written in the book
13:36:15*rauss joined #nim
13:36:39*TjYoco joined #nim
13:40:47*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:41:55*Vladar joined #nim
13:42:47spicalet x = new seq[int];x[].add(5) is this supposed to work? if the new keyword is not used, it fails to work (which I heard is expected)
13:43:46*loc8 joined #nim
13:44:25loc8Hey is there something like `super` for Nim types?
13:45:43loc8type B = object of A, inside the `newB` you call `super(self, arguments)` and it runs `newA` "using it" as the result
13:46:05*claudiuinberlin joined #nim
13:46:32*solitudesf joined #nim
13:47:16*Jipok[m] joined #nim
13:47:41Araq_proccall
13:47:41Arrrrspica: newSeq[int]()
13:49:36spicaArrr: yeah, I forgot it. take a look at this to see what I'm talking aobut: https://pastebin.com/yvUm8zpe
13:50:06spicaShould't y be immutable as well? x is
13:50:23*relax joined #nim
13:50:56TjYocoare you modifying a reference to y since you called new?
13:51:35spicait's not about the reference. It's about the content of the seq
13:51:40FromGitter<ephja> the immutability is not transitive
13:51:55spicaephja, what does that mean?
13:54:01Arrrrin the second case, the variable y contains a pointer. You cannot modify this variable, but you can modify the memory that is pointing to
13:54:08FromGitter<ephja> immutability is not recursive
13:54:20*ldlework quit (Changing host)
13:54:20*ldlework joined #nim
13:54:47*PMunch quit (Quit: Leaving)
13:55:06FromGitter<Bennyelg> Can i do something like this? ⏎ "$1=$2" & prop.split("=")
13:55:07FromGitter<Bennyelg> ?
13:55:09*solitudesf quit (Remote host closed the connection)
13:55:20*byteflame joined #nim
13:55:21*MrAxilus[m] joined #nim
13:55:21*ehmry joined #nim
13:55:22*Demos[m] joined #nim
13:55:22*dyce[m] joined #nim
13:55:22*watzon joined #nim
13:55:28*TheManiac joined #nim
13:55:28*notdekka[m] joined #nim
13:55:28*hohlerde joined #nim
13:55:29*mindB joined #nim
13:55:30*jivank[m] joined #nim
13:55:31*solitudesf joined #nim
13:56:00ArrrrHave a look at `strutils` module
13:56:19ArrrrThere is a proc that do what you need, but i don't remember the name right now.
13:57:08spicaArrr: ok
13:57:16spicaguys. what editors do you use for nim?
13:57:31*endragor quit (Remote host closed the connection)
13:57:39spicavscode is okay, but the completion also suggest stuff that's not relevant
13:58:11Arrrrnotepad++
13:58:49loc8type B = object of A, inside the `newB` you call `super(self, arguments)` and it runs `newA` "using it" as the result
13:58:53loc8Sry bug
13:59:11loc8(I mean that I sent the message as an accident)
14:00:01*endragor joined #nim
14:00:26FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b939fa614889d475f250ea]
14:00:39FromGitter<Bennyelg> additionalProperties is a seq[string]
14:00:56FromGitter<Bennyelg> I want to take all the properties from the even position
14:01:38FromGitter<ephja> proc(...): ReturnType = ...
14:01:54FromGitter<Bennyelg> Oo?
14:03:08FromGitter<ephja> try this: `proc(i: int, x: string): bool = i mod 2 == 0`
14:04:01FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b93ad0bac826f054b1c8c2]
14:04:20*endragor quit (Ping timeout: 246 seconds)
14:06:27FromGitter<ephja> oh. I dunno if it's possible to retrieve the index that way
14:10:02FromGitter<ephja> these interfaces don't take iterators. if they did then you could pass a "stride" iterator for example
14:12:17FromGitter<Bennyelg> can I create range(5) for example?
14:12:20FromGitter<Bennyelg> like python
14:12:30FromGitter<Bennyelg> any equivalent?
14:12:37FromGitter<krux02> 1) .<5
14:13:06FromGitter<Bennyelg> yea but Iwant actually create a seq
14:13:16FromGitter<krux02> well you can write one
14:13:18FromGitter<Bennyelg> seq[0..someOtherseq.len]
14:14:05spicaBennyelg, that doesn't work. seq expects a type not a range
14:14:17FromGitter<krux02> def range(arg: Int): seq[Int] = result.newSeq(arg); for i,v in arg.mpairs: v = i
14:14:33spicathis fails as well: var x: seq[int] = @[1 .. 10]
14:14:47spicathe range seem to work on SETs though
14:15:29FromGitter<ephja> import sequtils ⏎ let s = toSeq(0..5)
14:15:38FromGitter<ephja> I mean 4, or <5 ;)
14:16:16FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b93db0b59d55b823efa423]
14:16:17FromGitter<stisa> @Bennyelg about your question on `filter`, you can change the implementation in sequtils slightly like this: https://play.nim-lang.org/?gist=f05cec631375f5dc12e8dd7436dd5cb2
14:16:19FromGitter<Bennyelg> I managed
14:17:03FromGitter<Bennyelg> the range is something like @krux02
14:17:29TjYocoI think at that point a simple for loop is more legible, no?
14:17:45FromGitter<Bennyelg> maybe
14:17:49FromGitter<krux02> a for loop is not an expression
14:18:36TjYocokrux02, i meant replace the whole thing
14:19:24FromGitter<Bennyelg> I cant do something like: ⏎ ⏎ ``` for pop, val in evens, odds: ⏎ headers["X"] = "$1=$2" & (pop, val)``` [https://gitter.im/nim-lang/Nim?at=59b93e6c210ac2692027fad5]
14:19:40*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:25:18TjYocoBennelg, would this not be suitable for you https://www.hastebin.com/owixokosog.nim
14:25:32loc8(I mean that I sent the message as an accident)
14:25:36TjYocoBennyelg **
14:25:42*loc8 quit (Quit: WeeChat 1.9)
14:29:52*Matthias247 joined #nim
14:31:50*claudiuinberlin joined #nim
14:40:35*Arrrr quit (Quit: Leaving.)
14:45:47*solitude joined #nim
14:52:41*miran joined #nim
14:56:09*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:03:10FromGitter<krux02> @Bennyelg but you can write your own zip iterator
15:03:45FromGitter<krux02> so that you can write for pop, val in zipItems(evens,odds):
15:08:17*loc8 joined #nim
15:08:35loc8Hey, can you get a type property via key?
15:09:25FromGitter<krux02> what do you mean via key?
15:10:27loc8Say the property is called `name`
15:10:35loc8Something like `object["name"]`
15:10:40loc8Where I can access the property using a string
15:11:23FromGitter<krux02> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b94a9b319100804e2e2b5f]
15:11:32*Sentreen quit (Ping timeout: 246 seconds)
15:12:00FromGitter<krux02> this is not accessing via string, but via identifier
15:12:30FromGitter<krux02> might be exactly what you want
15:13:10FromGitter<krux02> you get a compilation failure when the type does not have the property
15:14:35loc8That's what I was looking for, yes! Thanks
15:14:36*Trustable joined #nim
15:15:24*fraya joined #nim
15:17:58*p0nce left #nim (#nim)
15:17:58*solitude quit (Read error: Connection reset by peer)
15:24:54*Sentreen joined #nim
15:30:26*claudiuinberlin joined #nim
15:48:46*haha_ joined #nim
15:50:51FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b953db210ac26920288029]
15:50:58FromGitter<Bennyelg> any one can explain me the problem?
15:51:36FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b95408319100804e2e6863]
15:52:43TrustableNew tests for strutils.countLines(): https://github.com/nim-lang/Nim/pull/6371/commits/83697135497f2b7a00fde91c0907e6bfba7e7eb7
15:55:14FromGitter<Yardanico> @Bennyelg yes, you can't pass a table to newHttpHeaders, pass your "eheaders" variable directly instead
15:56:03*arnetheduck quit (Remote host closed the connection)
16:02:53FromGitter<Yardanico> and btw, you can avoid doing stuff like creating a type, eheaders variable
16:03:46FromGitter<Yardanico> just do something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b956e2bac826f054b283a7]
16:05:47*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:09:22*relax quit (Ping timeout: 264 seconds)
16:10:18*yglukhov quit (Remote host closed the connection)
16:10:57*claudiuinberlin joined #nim
16:12:19*edubart joined #nim
16:13:30FromGitter<Bennyelg> I tried to pass it but it failed.
16:15:27FromGitter<Bennyelg> @Yardanico But I have an argument which I pass after i build it
16:15:38FromGitter<Yardanico> what do you mean?
16:16:04FromGitter<Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b959c3bc464729742c718b]
16:16:07FromGitter<Yardanico> You can do this as well
16:16:43FromGitter<Yardanico> @Bennyelg and you can pass it, just rename "value" to "val" in your "keyval" tuple type
16:16:55FromGitter<Yardanico> and you'll be able to pass eheaders variable directly
16:17:03*Sentreen quit (Ping timeout: 248 seconds)
16:19:34FromGitter<Bennyelg> how do you add value to ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b95a96cfeed2eb65052731]
16:20:42FromGitter<Yardanico> you can't add it, but you didn't specify that you need to modify it
16:20:46FromGitter<Yardanico> create a table, yes
16:21:11FromGitter<Yardanico> well I mean no
16:21:16FromGitter<Bennyelg> but lol when I create table I can assign it back to this shitty newhttpheader
16:21:19FromGitter<Bennyelg> this is so funny
16:21:25FromGitter<Bennyelg> like the egg and the chicken issue
16:21:30FromGitter<Bennyelg> who come first
16:21:31FromGitter<Yardanico> ok, don't create the table at all
16:21:41FromGitter<Yardanico> just create newHttpHeaders(), and add values to it, ok ?
16:21:46FromGitter<Bennyelg> how
16:21:48FromGitter<Yardanico> like myheaders["key"] = val
16:22:14FromGitter<Yardanico> you can create empty newHttpHeaders() variable
16:22:21FromGitter<Bennyelg> finally
16:22:27FromGitter<Bennyelg> thanks daniil
16:24:22*dave24 quit (Ping timeout: 255 seconds)
16:27:32*miran quit (Ping timeout: 260 seconds)
16:30:43*dave24 joined #nim
16:31:21*Sentreen joined #nim
16:32:31*nsf quit (Quit: WeeChat 1.9)
16:40:44*dom96|w joined #nim
16:41:33*Sentreen quit (Ping timeout: 252 seconds)
16:46:20*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:51:57*Vladar quit (Quit: Leaving)
16:52:01*TjYoco quit (Quit: Leaving)
16:54:46*Sentreen joined #nim
16:55:54FromGitter<Bennyelg> how to assign json list of string to seq[string]
16:55:59FromGitter<Bennyelg> this.resultSet.columns = data["columns"].elems
16:56:07FromGitter<Bennyelg> not good enouge because its jsonNode
16:56:15*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:56:31FromGitter<Yardanico> data["columns"].mapIt(it.str)
16:56:42FromGitter<Yardanico> like this, you should have "sequtils" imported
16:56:56FromGitter<Bennyelg> amaizing thanks
16:57:44*d10n-work joined #nim
16:58:41*yglukhov joined #nim
17:02:57*yglukhov quit (Ping timeout: 240 seconds)
17:03:46d10n-workIt feels like my small nim program is doing stuff the wrong way. Would anyone mind reviewing my code? https://github.com/d10n/prefixcli/blob/master/src/prefixcli.nim
17:06:31*yglukhov joined #nim
17:11:56*yglukhov_ joined #nim
17:12:27*yglukhov quit (Ping timeout: 240 seconds)
17:17:34*nsf joined #nim
17:18:34*Arrrr joined #nim
17:22:10FromGitter<zacharycarter> I think we need a "Used by these companies" section on the page for Nim
17:22:17FromGitter<zacharycarter> and then in about a month we can put carfax upthere :P
17:22:17*yglukhov joined #nim
17:22:27*Trustable quit (Remote host closed the connection)
17:22:57*yglukhov_ quit (Ping timeout: 240 seconds)
17:24:16*relax joined #nim
17:30:32*yglukhov_ joined #nim
17:31:27*yglukhov quit (Ping timeout: 240 seconds)
17:33:54*TjYoco joined #nim
17:36:28*yglukhov_ quit (Ping timeout: 240 seconds)
17:40:39*solitudesf quit (Remote host closed the connection)
17:43:40FromGitter<ephja> maybe nimsuggest is mostly failing for modules that are meant to be included
17:51:39spicaDoes anybody know why async sockets use Future instead of FlowVar?
17:52:39spicaor why "spawn" uses FlowVar instead of Future
17:53:30dom96due to some implementation details
17:53:41dom96Araq will know more as it was his decision
17:53:49dom96I did try to convince him to use Future of course :)
17:54:03dom96Eventually we will get a way to wrap the FlowVar in a future though
17:55:07FromGitter<Bennyelg> How do I read item like this with json parse? ⏎ "data": [ ⏎ ["2017-09-13 17:11:48.150 UTC"] ⏎ ] [https://gitter.im/nim-lang/Nim?at=59b970fbc101bc4e3ac1ff27]
17:55:15spicaright, because I was reading through your book, and at first glance they seem very similar
17:55:19FromGitter<Bennyelg> x["data"].str not work
17:56:09TjYocoBennyelg it looks like that value is an array, not a string
17:56:25FromGitter<Bennyelg> so I need to x["data"].array?
17:56:58TjYocodoes x["data"][0].getStr() work?
17:57:18FromGitter<Bennyelg> But I dont want only the place 0
17:57:21FromGitter<Bennyelg> I need anything
17:57:23FromGitter<Bennyelg> sec I check
17:57:49FromGitter<Bennyelg> Error: unhandled exception: str is not accessible [FieldError]
17:58:19TjYocoyou have to use getStr() I think
17:58:23FromGitter<Bennyelg> kind is JArray
17:59:04FromGitter<Yardanico> TjYoco: you can use both "str" and "getStr", but with getStr you will get better exception
17:59:10FromGitter<Yardanico> lol, sublime text 3.0 - https://www.sublimetext.com/blog/articles/sublime-text-3-point-0
18:00:05dom96If it's a JArray then you should grab the element you want: x["data"][0]
18:00:16dom96or .elems to get the actual sequence
18:00:54FromGitter<Bennyelg> and I need to create seq[string] ?
18:01:02FromGitter<Bennyelg> type mismatch: got (seq[JsonNode]) but expected seq[string]
18:02:12TjYocoBennyelg, x["data"] is a JArray with each element being a JsonNode also.
18:02:39FromGitter<Bennyelg> Oh so how Do I cover it? I want each value to be string
18:02:44FromGitter<Bennyelg> I dont care of anything inside
18:03:05FromGitter<Bennyelg> Done
18:03:12FromGitter<Bennyelg> Thanks.
18:03:19spicaguys, is this a bug? someFunction not someBoolean -> doesn't compile someFunction(not someBoolean) works
18:05:25FromGitter<zacharycarter> spica please post an example with gist or the playground or something
18:05:32FromGitter<zacharycarter> I don't understand what you're getting at
18:05:38*fraya left #nim ("Leaving")
18:06:59spicahttps://pastebin.com/Lr0EAUJh
18:07:29FromGitter<zacharycarter> that's not a bug
18:07:43spicahow come?
18:07:56FromGitter<zacharycarter> because you're calling doAssert with one argument - not - in the second example
18:08:09FromGitter<zacharycarter> this is valid probably
18:08:14FromGitter<zacharycarter> doAssert (not foo)
18:08:23FromGitter<Yardanico> yeah, @zacharycarter is right
18:08:34FromGitter<zacharycarter> but you'll get a warning about commands being deprecated or something
18:08:41spicawell, shouldn't 'not' have greater precedence than a function call?
18:09:04FromGitter<Yardanico> cc Araq_ he can explain everything :)
18:09:07FromGitter<zacharycarter> yeah
18:09:30spicaAraq ^
18:18:39FromGitter<adamrezich> is it possible to write macros that generate types? I'm just getting my toes wet with macros, and I put a type block in dumpTree() and it doesn't work :p
18:18:47*yglukhov joined #nim
18:19:23TjYocoadamrezich, https://nim-lang.org/docs/macros.html#statements-type-section
18:20:00Arrrrwhy not? https://play.nim-lang.org/?gist=c8ccf67ac1f9d582262e2953b14e550f
18:20:06FromGitter<Yardanico> @adamrezich easy
18:20:39FromGitter<Yardanico> You can generate (in macros) any code which is valid Nim code
18:20:48Arrrrfor some reason a random() call introduces side effects
18:20:48FromGitter<Yardanico> there's no restrictions IIRC
18:21:12FromGitter<adamrezich> awesome, I forgot dumpTree was a macro you call with a colon and not a function :v
18:21:27FromGitter<Yardanico> Arrrr: probably because it changes global variable?
18:21:54FromGitter<Yardanico> https://github.com/nim-lang/Nim/blob/master/lib/pure/random.nim#L39
18:21:56ArrrrYes, probably
18:22:21Arrrrprobably ...
18:23:56*edubart_ joined #nim
18:25:25*haha_ quit (Quit: haha_)
18:26:54*edubart quit (Ping timeout: 260 seconds)
18:27:10TjYocowhat are the advantages of using object of RootObj instead of just object
18:27:29Araq_if in doubt, do not write 'of RootObj'
18:27:46TjYocoIs it for inheritance stuff
18:27:46spicaif you don't use RootObj, your type can't be subtype afaik
18:27:59spicasubtyped*
18:28:09FromGitter<ephja> a new root can be introduced with the 'inheritable' pragma
18:28:18FromGitter<ephja> it shouldn't be necessary that often I guess
18:28:48Araq_do not use .inheritable unless you really need it for C interop
18:29:06*edubart_ quit (Quit: Page closed)
18:29:20TjYocothanks
18:35:49*yglukhov quit (Remote host closed the connection)
18:36:11*claudiuinberlin joined #nim
18:41:34FromGitter<ephja> I guess providing suggestions for an included module won't pose any problems as long as it's only included once
18:43:05dom96Araq_: Any ideas about this? https://github.com/nim-lang/nimble/issues/406
18:46:30Araq_dom96: maybe it's caused by my osproc changes, https://github.com/nim-lang/Nim/pull/6364 seems to improve upon it
18:49:45spicadayum. Does anybody know if this is a bug? https://pastebin.com/yrnafWML
18:50:34Araq_no, it's not
18:50:47Araq_the 'await' strips away the Future
18:50:50Araq_that's its point
18:50:57spicaomg, sorry
18:51:16Araq_the compiler's error message is also super useful :P
18:53:32spicaAraq_ what about this? https://pastebin.com/Lr0EAUJh
18:54:09Araq_that's also not a bug
18:54:27Araq_though maybe we should change 'not' to be unary-only
18:55:30Araq_but then 'if x not y' would not compile anymore for some definition like proc `not`(a, b: int): int = a != b
18:56:10Araq_(not saying that's good code, but perhaps it help in understanding :P )
18:57:27spicahow about tuning up the precedence of not?
19:02:57*scriptum quit (Ping timeout: 240 seconds)
19:09:00*yglukhov joined #nim
19:11:36*scriptum joined #nim
19:13:54*sz0 joined #nim
19:20:00*Jesin quit (Quit: Leaving)
19:21:16*couven92 joined #nim
19:23:19ArrrrWhy do i get a SYGSEGV here? https://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim#L534
19:23:26ArrrrWhat could be the reason?
19:23:49*Jesin joined #nim
19:24:14FromGitter<Yardanico> GC bug
19:24:26FromGitter<Yardanico> maybe not GC bug, but something with memory :)
19:24:30FromGitter<Yardanico> make a bug report with a traceback
19:24:45Arrrrhappens in growObj
19:24:45FromGitter<adamrezich> so I'm trying to make a macro that generates types for me—how do you build idents from strings in a macro? do I need to use genSym?
19:25:51FromGitter<Yardanico> @adamrezich !"yourstring" for example
19:26:02FromGitter<Yardanico> oh no
19:26:06FromGitter<Yardanico> maybe ident"mystring"
19:26:07FromGitter<Yardanico> or https://nim-lang.org/docs/macros.html#newIdentNode,string
19:28:02FromGitter<adamrezich> so my macro has a string `name` parameter, and I want to generate types and stuff based on that string. yet, when I do `newIdentNode(name & "Event")`, I get "type mismatch: got (NimNode, string)" ...?
19:28:45TjYocoadamrezich post a code snippet
19:30:00Arrrr$name
19:30:34FromGitter<Bennyelg> ok , so I have set of rows with undefined number of columns
19:30:37FromGitter<Yardanico> @adamrezich every argument received by macro is converted to NimNode (it doesn't matter if you've specified that it's a string)
19:30:46FromGitter<adamrezich> aha, that's what I was missing
19:30:58FromGitter<Yardanico> but yeah, if you specify that it's a string, compiler will check that your macro is called with string
19:30:59FromGitter<Bennyelg> this is how I take from each row the value at the position zero ⏎ var dataset = data["data"].elems.mapIt(it[0].getStr) ⏎ how do i take all the values from row
19:31:31FromGitter<Yardanico> @Bennyelg for row in data: for elem in row: yourDataset.add(elem)
19:31:34*yglukhov quit (Ping timeout: 264 seconds)
19:31:54FromGitter<Yardanico> but it wouldn't be very efficient since the number of columns is unknown
19:32:41FromGitter<Yardanico> and yeah, it would be 3 lines
19:32:43FromGitter<Yardanico> not 1 line
19:33:22FromGitter<Yardanico> and you'll need to have "getStr" or "str"
19:36:21dom96I know I say this a lot, but IMO the error message for https://pastebin.com/Lr0EAUJh can be improved
19:36:27dom96Please report it spica
19:37:12*miran joined #nim
19:38:13spicaI'll do it tomorrow
19:38:49spicaquestion guys. Is ctrl_c supposed to always make the program throw exceptions?
19:39:22spicactrl_c-ing when an async socket accepts gives me this: SIGINT: Interrupted by Ctrl-C.
19:39:47FromGitter<Yardanico> yes, unless you overwrite exit proc
19:40:14FromGitter<Yardanico> setControlCHook(yourExitProc)
19:40:21FromGitter<Yardanico> and yourExitProc should have {.noconv.} pragma
19:41:06spicaI was actually asking if that's a bug. " SIGINT: Interrupted by Ctrl-C.", doesn't seem to be an exception
19:41:31FromGitter<Yardanico> it's not a bug
19:41:41FromGitter<Yardanico> SIGINT is signal interrupted
19:41:48FromGitter<Yardanico> so ctrl+c interrupts your application
19:42:02FromGitter<Yardanico> what do you want it to do?
19:42:37FromGitter<Yardanico> Ctrl-C (in older Unixes, DEL) sends an INT signal ("interrupt", SIGINT); by default, this causes the process to terminate.
19:42:43spicaI want it to be consistent
19:42:47FromGitter<Yardanico> it is consistent
19:42:51FromGitter<Yardanico> why it's not?
19:44:08spicactrl_c-ing when doing spawn stdin.readLine() gives an actual exception with trace: https://pastebin.com/bdt2TLnc
19:44:46FromGitter<Yardanico> yes
19:44:49spicaso?
19:44:54spicais that normal
19:44:54spica?
19:45:33FromGitter<Yardanico> because you're reading from console, yes
19:46:26FromGitter<Yardanico> well I don't see any issues there, but I *might* be wrong
19:46:37FromGitter<Yardanico> it's ok for me, since I don't usually read from console
19:46:43spicalets ask Araq_
19:46:44FromGitter<Yardanico> and I do catch ctrl+c
19:47:05spicawell, how do you catch this? SIGINT: Interrupted by Ctrl-C
19:47:11spicaI don't think you can
19:47:23FromGitter<Yardanico> as I said
19:47:26FromGitter<Yardanico> add ctrl+c hook
19:47:46FromGitter<Yardanico> setControlCHook(yourExitProc) and yourExitProc is a proc with {.noconv.} pragma
19:47:48spicayep, workaround.
19:47:51FromGitter<Yardanico> it's not
19:47:55FromGitter<Yardanico> it's the default way to do it
19:48:03FromGitter<Yardanico> even in C you would define a function like sigint()
19:48:23FromGitter<Yardanico> https://stackoverflow.com/questions/4217037/catch-ctrl-c-in-c
19:49:18*skrylar joined #nim
19:49:39FromGitter<Yardanico> I don't know about windows though
19:49:49FromGitter<Yardanico> but at least it's consistent on all platforms in nim
19:50:37FromGitter<Yardanico> https://github.com/nim-lang/Nim/blob/000b8afd26fa16684a116d9afe798ea94df9c270/lib/system/excpt.nim#L409
19:51:31spicaI'll look into it. Thanks
19:51:35FromGitter<Yardanico> it was added in 2012 :P
19:55:34FromGitter<Bennyelg> how to cast seq[seq[string]] to an iterator
19:56:28FromGitter<Yardanico> What?
19:56:52FromGitter<Bennyelg> I want to iterate over seq[seq[string]] value by value
19:56:54FromGitter<Bennyelg> like an iterator
19:57:08FromGitter<Yardanico> You nested loop
19:57:14FromGitter<Yardanico> Use
19:57:28FromGitter<Yardanico> Or create an iterator which will have nested loop :)
19:58:18FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b98ddabac826f054b3d2c5]
19:58:19FromGitter<Bennyelg> ?
19:59:12FromGitter<Yardanico> No
19:59:24FromGitter<Yardanico> You say that you have seq of seqs
19:59:37FromGitter<Yardanico> You should add another loop here like
20:00:06FromGitter<Yardanico> for data in this.data: for elem in data: yield elem
20:00:09spicabennyelg: https://pastebin.com/cwKHMAhg
20:00:11spicatry that
20:00:15FromGitter<Yardanico> But not in one line
20:00:16spicaI haven't tested it doe
20:00:36FromGitter<Yardanico> Yeah it will work
20:01:49skrylarhmm. thinking i should bin the use of tuples for vectors
20:02:10skrylarmostly because tuple constructors are behaving weird, and if they are arrays with proc above them you can use gcc's simd generation types
20:05:42FromGitter<adamrezich> ok so I'm getting the hang of macros at a very basic level, but I'm still unsure why the last test at the bottom of this doesn't work: https://play.nim-lang.org/?gist=b839e751c5b638b3fd339ac87fc9b16a
20:08:54*loc8_ joined #nim
20:10:18FromGitter<ephja> Araq: how do I get the ordinal value of an skEnumField node?
20:11:21*loc8 quit (Ping timeout: 240 seconds)
20:11:47FromGitter<mratsim> @Bennyelg I already wrote a FlatIterator for my library: it works for any depth seq - https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/utils/nested_containers.nim#L28-L39
20:12:10FromGitter<mratsim> There is a special case to catch strings and not yield chars
20:13:38FromGitter<Yardanico> Btw, you can also make it work with any iterable via concept? And add array as a special case
20:14:03FromGitter<Yardanico> Because sadly you can't match array to a concept yet
20:15:27FromGitter<Yardanico> But it may still not work, but very good iterator anyway :)
20:19:06FromGitter<Bennyelg> Finally I am almost done to create prestodb connector
20:19:07FromGitter<mratsim> It took me several tries to get it right >_>, it was a pain to type check and accept both arrays and seq. ⏎ ⏎ Mmm I didn’t try with concepts yet.
20:20:17FromGitter<mratsim> btw while doing that iterator I was wondering if there is any “yield from” coroutine like in Python
20:23:00Araq_both arrays and a seq? that's directly supported via openArray
20:23:01FromGitter<Yardanico> There's not, but it's just a shortcut AFAIK
20:24:01*miran quit (Ping timeout: 248 seconds)
20:25:20FromGitter<Yardanico> Well, not exactly a shortcut
20:25:22FromGitter<Yardanico> https://docs.python.org/3/whatsnew/3.3.html#pep-380
20:27:10FromGitter<ephja> let e = semTypeNode(c, ...)
20:27:19FromGitter<mratsim> @Araq, iirc I had “Cannot capture foo” trouble in many tries
20:27:35FromGitter<mratsim> or Illegal capture something
20:28:17relaxWhat does the {.noRewrite.} pragma do? More specifically, I'm curious how this function works: https://github.com/nanoant/nim-orm/blob/master/orm.nim#L148 (namely, what magic it's using to assign to each field in an instance of T)
20:29:18*Arrrr quit (Read error: Connection reset by peer)
20:29:23*PMunch joined #nim
20:30:48*Demos joined #nim
20:31:20*limon__ joined #nim
20:32:26limon__Anybody know why "var x: int8 = 255" gives "type mismatch"?
20:33:10obadz$ ~/.nimble/bin/aporia
20:33:13obadzcould not load: libglib-2.0.so(|.0)
20:33:25obadzdoes it use dlopen()? I don't see glib in ldd..
20:33:36spicalimon__ because int8 is signed
20:33:39spicaup to 127
20:33:46spica-128 -> 127 afaik
20:33:53limon__Oh yeah. That was dumb. Thanks!
20:33:54spicauint8 should work
20:34:29spicanp
20:35:29*spica left #nim ("Leaving")
20:36:49*limon__ quit (Quit: Page closed)
20:37:29*solitudesf joined #nim
20:37:38*miran joined #nim
20:38:10FromGitter<Yardanico> obadz: yeah, probabl
20:41:07obadzthx
20:42:11obadzis there any reason to use async/Future/await rather than spawn/FlowVar/sync? ?
20:42:25obadz(I'm sure there are, just don't know what they are)
20:42:50ehmrybecause you want to stay single threaded?
20:43:03obadzwhat if I don't?
20:44:13ehmrythen you'd have to use spawn, its not really reasonable to pass futures between threads
20:44:43FromGitter<ephja> didn't someone ask this not long ask?
20:45:01FromGitter<ephja> not long ago*
20:51:36obadzof nimedit/aporia, which one is the recommanded option at this juncture?
20:51:46obadz(or any other option)
20:52:01dom96neither
20:52:04dom96Use VS Code.
20:52:46obadzit's a bit flimsy on nixos
20:53:22ehmrynixos has acme in plan9ports
20:53:31ehmrysyntax highlighting is for suckers
20:54:36FromGitter<Bennyelg> What do you think ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b99b0cbac826f054b41d46]
20:56:33TjYocoIf I'm making a nimble package that has to be compiled with -d:sll, where do I set that?
20:57:51ehmryTjYoco: your_package.nim.cfg
20:58:04TjYocoehmry thanks
20:58:33*endragor joined #nim
20:58:41FromGitter<Bennyelg> How Do I create nimble :)
20:58:57TjYoconimble init
21:00:05ehmryI'm thinking there is a no-copy way for the compiler to construct C++ heap objects in place by overriding ``new`` operator
21:00:17TjYococd into your package directory and call nimble init, the just hit yes for everything basically
21:01:06dom96My book has a whole chapter on Nimble ;)
21:02:35*miran quit (Ping timeout: 246 seconds)
21:02:57*endragor quit (Ping timeout: 248 seconds)
21:03:49FromGitter<Bennyelg> what after I have the x.nimble
21:03:51FromGitter<Bennyelg> nimble push?
21:03:59FromGitter<Bennyelg> publish * ?
21:04:01*Demos quit (Ping timeout: 240 seconds)
21:04:06dom96yes
21:04:40TjYocoJust to be clear though, there's no way to import compiler flags from modules though right?
21:05:17dom96Not sure actually
21:05:22*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:05:31dom96If you're importing a package that has its own .nim.cfg then its options should be applied
21:05:48TjYocoI put -d:ssl into a package.nim.cfg file, but importing it elsewhere tells me I need to use that flag still
21:06:59TjYocooh wait, my mistake. An exported function is using SSL, so the new script still has to be compiled with it
21:07:34TjYocoI'm guessing. Unless I did it wrong
21:07:56dom96yeah, I think that makes sense.
21:07:56*skrylar quit (Remote host closed the connection)
21:10:22*xet7 joined #nim
21:13:15FromGitter<Bennyelg> @dom96 ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59b99f6b210ac269202a2cef]
21:13:16FromGitter<Bennyelg> Info: Using GitHub API Token in file: /Users/benny/.nimble/github_api_token ⏎ Success: Verified as Bennyelg ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=59b99f6c319100804e302292]
21:13:21FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b99f71177fb9fe7eb946dc]
21:14:20dom96Yeah, known bug sadly
21:14:32FromGitter<Bennyelg> how do I fix it
21:14:33dom96You'll need to create a PR on the packages repo manually
21:14:52FromGitter<Bennyelg> oh
21:15:22FromGitter<Bennyelg> the one is forked on my git?
21:16:16FromGitter<Bennyelg> https://github.com/nim-lang/packages/pulls
21:20:50dom96How did this happen? https://github.com/nim-lang/packages/pull/578/files#diff-3cd1c746ca940713759badf789478307R7171
21:21:03dom96yeah, publish needs improvement heh
21:21:31FromGitter<Bennyelg> lol what is that
21:21:36FromGitter<Bennyelg> Its not mine
21:21:42FromGitter<Bennyelg> I close the pull requests and run it again
21:22:41FromGitter<zacharycarter> I need to improve my cave gen stuff
21:22:55FromGitter<zacharycarter> https://imgur.com/a/BSj3S
21:23:30*sz0 quit (Quit: Connection closed for inactivity)
21:23:44FromGitter<Bennyelg> https://github.com/nim-lang/packages/pull/579/commits/6875cd3f2a81f1db6d539327a38d6d0f814db815
21:24:10*TjYoco quit (Quit: Leaving)
21:24:19FromGitter<Bennyelg> Approve It when you can :) thanks.
21:28:18*PMunch quit (Quit: leaving)
21:28:40*def-pri-pub joined #nim
21:28:40*def-pri-pub quit (Changing host)
21:28:40*def-pri-pub joined #nim
21:31:35*solitudesf quit (Ping timeout: 240 seconds)
21:33:52*relax quit (Ping timeout: 248 seconds)
21:37:30*d10n-work quit (Quit: Connection closed for inactivity)
21:37:55dom96Bennyelg: nice!
21:39:07dom96Left you some suggestions: https://github.com/nim-lang/packages/pull/579#issuecomment-329304664
21:41:24FromGitter<adamrezich> is there a way to make an array of [T, bool], where T is an enum with holes? or, is there a better way to have a collection of bools mapped to an enum with holes?
21:42:03def-pri-pubzacharycarter: You here right now? I submitted a patch to add a ZObject and Entity3D type
21:44:51FromGitter<zacharycarter> def-pri-pub: yup! I'll approve
21:45:58FromGitter<zacharycarter> def-pri-pub: merged
21:49:30*loc8_ quit (Quit: WeeChat 1.9)
21:56:05*Kingsquee joined #nim
22:00:01*Kingsquee quit (Excess Flood)
22:00:28*Kingsquee joined #nim
22:01:01subsetparkAdamrezich - by definition, enums with holes can't be used to index arrays. I would use either a table or a case expression
22:04:42*def-pri-pub quit (Ping timeout: 260 seconds)
22:06:35FromGitter<zacharycarter> yay fully connected caves!
22:07:19FromGitter<zacharycarter> https://imgur.com/a/ibbNa
22:10:01FromGitter<zacharycarter> grr getting stack overflow errors on larger maps
22:10:15FromGitter<zacharycarter> no bueno
22:11:39dom96nice code btw :)
22:11:48FromGitter<zacharycarter> thanks :)
22:12:11FromGitter<adamrezich> is there a way to hide stuff on export? I'd love it if my main engine file could import sdl2 and export it, but not export sdl2's KeyState, such that my own KeyState is the only thing that gets exported
22:16:04dom96`export sdl2 except KeyState` might work
22:16:19*nsf quit (Quit: WeeChat 1.9)
22:20:26*libman joined #nim
22:25:32FromGitter<edubart> how do I to create a compile time bool argument in a proc function? something like proc func(mybool: static[bool] = false): int = when mybool: result=1 else: result=0 ?
22:25:42FromGitter<zacharycarter> alright I got rid of the recursion now I can generate huge maps
22:26:01FromGitter<edubart> (my example doesn't work)
22:29:30*couven92 quit (Quit: Client Disconnecting)
22:32:47FromGitter<zacharycarter> not sure @edubart I know you can declare a static inside of a function with the {.global.} pragma but not sure about passing one into the method signature
22:32:56FromGitter<zacharycarter> hrm what dungeon gen algo to work on next?
22:38:28*vendethiel- joined #nim
22:39:59*Ven`` quit (Ping timeout: 248 seconds)
22:42:19*libman left #nim (#nim)
22:56:18FromGitter<mratsim> @edubart, it should work on 0.17.2
22:57:43FromGitter<mratsim> I have lots of static args with when condition in the body there: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/init_deprecated.nim#L15
23:00:45*def-pri-pub joined #nim
23:29:28*def-pri-pub quit (Ping timeout: 240 seconds)
23:32:08*renarc joined #nim
23:33:09*renarc quit (Remote host closed the connection)
23:33:27*renarc joined #nim
23:35:56*renarc quit (Client Quit)
23:36:10*renarc joined #nim
23:36:57*renarcii joined #nim
23:37:01*renarc quit (Remote host closed the connection)
23:37:07*renarcii quit (Remote host closed the connection)
23:37:47*renarc joined #nim
23:40:20*renarc quit (Client Quit)
23:41:00*jsgrant joined #nim
23:41:34*renarc joined #nim
23:42:14*renarc quit (Remote host closed the connection)
23:42:57*renarc joined #nim
23:43:45*renarc quit (Remote host closed the connection)
23:46:40*def-pri-pub joined #nim
23:46:40*def-pri-pub quit (Changing host)
23:46:40*def-pri-pub joined #nim
23:49:52FromGitter<zacharycarter> is there any stack implementation in Nim?
23:56:32def-pri-pubThere is the faststack that's in the zengine source IIRC
23:56:57def-pri-pubAnd I think it also follows the python philosophy of push-pop on the end.
23:58:53FromGitter<zacharycarter> I forgot I copied that over :P
23:59:15FromGitter<zacharycarter> thanks