00:15:52 | * | Elronnd quit (Ping timeout: 276 seconds) |
00:16:17 | FromGitter | <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:20 | shodan45 | hm, anyone seen this? http://langserver.org/ |
01:15:40 | shodan45 | might 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:41 | jsgrant | shodan45: Was talked about/brought up by dom96 awhile ago on issue-tracker, but to my (very limited) knowledge hasn't been pursued. |
01:59:46 | jsgrant | Would be glad to see, |
01:59:56 | jsgrant | https://github.com/nim-lang/nimsuggest/issues/59 |
02:00:39 | jsgrant | Btw, 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:47 | jsgrant | Really, 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:54 | def-pri-pub | Araq, 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:07 | def-pri-pub | Are there any other existing presentations I could take a look at? |
02:03:17 | def-pri-pub | Or is there anything that I should definatley mention about Nim? |
02:03:55 | jsgrant | def-pri-pub: Going to be recorded? |
02:04:02 | def-pri-pub | No |
02:04:08 | jsgrant | :^( |
02:04:14 | def-pri-pub | Unless I want it to. I'm only given 5-8 minutes |
02:04:21 | * | ipjk quit (Ping timeout: 240 seconds) |
02:04:44 | jsgrant | def-pri-pub: You can mention the nim-godot bindings. |
02:05:49 | def-pri-pub | Yeah, I'm goint to talk about zengine (what zacharycarter and I have been working on) |
02:06:10 | jsgrant | Oh neat. One of the things on my list. :^) |
02:06:11 | def-pri-pub | I'm going to try to give a general overview, so I'm only looking to talk about what's avaialable |
02:06:21 | def-pri-pub | (We could use more help on zengine BTW) |
02:06:59 | jsgrant | Too "noob" at this point; Maybe in a good year. |
02:07:09 | jsgrant | End of 18, plan on doing gamejams again. |
02:07:26 | jsgrant | Maybe actually submit them publicly for once. :^) |
02:08:12 | jsgrant | The 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:48 | jsgrant | Was talking about this the other day, not exactly sure why, but there does to seem like a strong focus here. |
02:08:48 | def-pri-pub | Nim is still kind of bare-bones when it comes to game dev. |
02:09:27 | def-pri-pub | It'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:29 | jsgrant | def-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:34 | def-pri-pub | I also wouldn't recommend Nim for gamejams just yet |
03:07:13 | def-pri-pub | I 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:34 | jsgrant | Well, at the earliest it'd be the tail-end of 18 -- but I get ya. |
04:45:49 | jsgrant | I'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:22 | jsgrant | I have a solid half-year prior to my dipping into Nim generally, anyways, to somewhat refactor my brain away from Lisp. :^) |
04:47:55 | jsgrant | So 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:44 | shodan45 | wait, there's already a nim-godot? |
05:09:00 | shodan45 | that 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:17 | SusWombat | shodan45, https://github.com/pragmagic/godot-nim |
06:03:42 | FromGitter | <Grabli66> But it requires godot 3.0, that is not ready :) |
06:04:26 | shodan45 | oh, 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:39 | FromGitter | <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:07 | FromGitter | <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:17 | FromGitter | <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:33 | FromGitter | <Grabli66> Why do you need metaprogramming for game development? :) |
06:25:15 | FromGitter | <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:21 | FromGitter | <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:45 | SusWombat | gdscript is slow af |
06:48:45 | SusWombat | Its fast enough for most stuff. But good luck if you need tons of looping in your code |
06:50:05 | FromGitter | <Grabli66> Do you have a benchmark between gdscript and nim-godot? |
06:50:32 | SusWombat | no 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:02 | Arrrr | http://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:22 | FromGitter | <Grabli66> Yeah, haxe is good. :) |
07:52:52 | * | yglukhov joined #nim |
07:53:00 | * | endragor joined #nim |
07:54:46 | Arrrr | I'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:59 | FromGitter | <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:21 | Araq_ | --cc:vcc |
09:30:09 | * | mpc___ quit (Remote host closed the connection) |
09:32:06 | FromGitter | <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:26 | Araq_ | in theory, yes |
09:32:37 | Araq_ | --vcc.options.speed="stuff here" |
09:32:49 | Araq_ | in practice I never tested it :-) |
09:34:03 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:50:01 | FromGitter | <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:11 | FromGitter | <mratsim> Mmmh Haxe pattern matching is not that impressive compared to Haskell’s and Rust’s. |
10:34:44 | FromGitter | <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:22 | Arrrr | I thought it was quite complete. |
10:53:54 | Arrrr | Nim type security: `uint16(random(int(high(uint16))))` |
10:54:34 | * | p0nce joined #nim |
10:57:51 | Araq_ | ever used unsigned floats? |
10:58:05 | * | claudiuinberlin joined #nim |
10:58:25 | Araq_ | if not, why is so uint16 so important? I never use unsigned and I'm a happy man. |
10:58:46 | Araq_ | programming languages work better when you do not fight them constantly. |
10:59:28 | p0nce | unished is a tragedy in C family, Java did the right thing |
10:59:34 | p0nce | unsigned* |
11:00:08 | * | claudiuinberlin quit (Client Quit) |
11:00:49 | * | libman quit (Quit: Connection closed for inactivity) |
11:01:59 | Arrrr | Yes 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:02 | FromGitter | <zacharycarter> o/ |
11:11:28 | FromGitter | <zacharycarter> gdscript is horrible btw |
11:11:38 | FromGitter | <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:32 | FromGitter | <Grabli66> @zacharycarter , normal language, like python |
11:26:53 | FromGitter | <Yardanico> @Grabli66 well gdscript will be slower than any compiled language, I think you don't need benchmarks to understand this |
11:32:53 | Yardanico | Grabli66: well it's not general-purpose language |
11:33:05 | Yardanico | it's for games only, and for godot :) |
11:33:23 | Yardanico | and godot team may have used C# if microsoft would buy xamarin (mono) eariler |
11:33:34 | Yardanico | because microsoft changed mono license to MIT |
11:43:11 | Araq_ | Arrrr: that doesn't follow at all. and I said, there is no "unsigned float" and the world is a better place |
11:44:43 | Arrrr | We don't know that. |
11:45:56 | Araq_ | yes we do. a plethora of primitive types causes serious interop problems everywhere, JSON doesn't support uint64, for example |
11:48:02 | Arrrr | Anything 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:40 | PMunch | Unsigned 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:05 | FromGitter | <Grabli66> @Yardanico , there is facts? :) |
12:07:16 | Yardanico | about what? speed? |
12:07:33 | Yardanico | https://godotengine.org/qa/3857/gdscript-vs-c-which-one-is-faster |
12:07:41 | FromGitter | <Grabli66> Speed |
12:08:12 | Yardanico | if you really think that interpreted language can be faster than compiled language without VM - eh, I have nothing to say... |
12:08:16 | FromGitter | <Grabli66> It's vs C, not Nim and C# |
12:08:28 | Yardanico | vs c++ |
12:08:33 | Yardanico | and nim is compiled to c/c++ |
12:08:34 | FromGitter | <krux02> unsigned is really overrated |
12:08:50 | Araq_ | http://jakegoulding.com/blog/2011/02/06/sqlite-64-bit-integers/ |
12:09:01 | Yardanico | so you may expect that gdscript is ~70-100 times slower than Nim |
12:09:04 | FromGitter | <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:12 | FromGitter | <krux02> a mistake everybody has to live with now |
12:09:33 | FromGitter | <krux02> unsigned is really not that important and should be avoided |
12:09:36 | Araq_ | PMunch: you don't lose "precious" bytes, you lose a single bit |
12:09:45 | FromGitter | <Grabli66> Yardanico, again, no facts |
12:09:48 | Yardanico | lol |
12:09:53 | Yardanico | really LOL |
12:10:04 | Yardanico | This is the fact - https://godotengine.org/qa/3857/gdscript-vs-c-which-one-is-faster |
12:10:14 | Yardanico | and nim is compiled to C/C++, so |
12:10:27 | * | claudiuinberlin joined #nim |
12:10:42 | FromGitter | <krux02> just because nim is compiled to C doesn't make iit by definition as fast as C |
12:10:46 | FromGitter | <Grabli66> so. No facts :). There is benchmarks? |
12:10:46 | PMunch | Araq_, there's only 8 bits to a byte, they go by pretty fast. |
12:10:47 | Yardanico | yeah I know |
12:10:56 | FromGitter | <krux02> it makes it at best as fast as C |
12:10:58 | Yardanico | but it doesn't make it as slow as an interpreted language |
12:11:21 | Yardanico | Grabli66: do it yourself, it's pretty easy |
12:11:28 | Yardanico | but there are facts - nim speed vs other languages speed |
12:11:33 | FromGitter | <krux02> well not really |
12:11:47 | FromGitter | <krux02> yes nim is faster that interpreted languages, but not just because it is compiled to C |
12:12:23 | FromGitter | <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:46 | PMunch | krux02, Cython? |
12:13:00 | PMunch | It is faster than Python, but only a subset of the language |
12:13:10 | Yardanico | Grabli66 I don't say that nim is exactly 100 or 70 times faster , but it's definitely FASTER than gdscript |
12:14:26 | FromGitter | <krux02> how about changing the subject |
12:14:34 | Yardanico | yeah, sorry |
12:16:07 | Arrrr | "What does SQLite do for a value outside of this range? As we saw earlier, it switches over into floating point" Bravo |
12:17:34 | Arrrr | What happens when your ass doesn't fit a chair? you split yourself in half. |
12:18:26 | FromGitter | <Bennyelg> @Arrrr no, you just start to eat less burgers |
12:18:36 | Yardanico | so create smaller numbers ? :) |
12:19:08 | Arrrr | Well 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:02 | FromGitter | <krux02> we live in a non euclidean space. |
12:31:48 | PMunch | Does that mean that we are web-technology? *shudders* |
12:32:36 | FromGitter | <zacharycarter> @Grabli66 just try godot out with gdscript and see how slow it is for yourself |
12:32:49 | FromGitter | <zacharycarter> there's a reason they advise you to write performance sensitive code in C++ and not GDscript |
12:33:05 | FromGitter | <krux02> well there are people who say that for game development the speed of the scripting engine in not important |
12:33:11 | FromGitter | <zacharycarter> but it is |
12:33:24 | FromGitter | <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:43 | FromGitter | <krux02> when you want to develop the new Zack McKracken, then speed might be secondary |
12:33:48 | Yardanico | because big games are all mostly made with C/C++/ even asm sometimes :) |
12:34:02 | FromGitter | <krux02> well that is not true anymore |
12:34:10 | FromGitter | <krux02> most games today are made in Unity |
12:34:19 | Yardanico | well ok, game engines are made in C/C++ :) |
12:34:37 | Yardanico | because if you write some c# in unity, it calls C++ code in the game engines |
12:34:40 | Yardanico | *in uniyu |
12:34:42 | Yardanico | unity |
12:34:51 | FromGitter | <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:08 | FromGitter | <zacharycarter> Unity would not be popular if it didn't offer C# as a scripting language |
12:35:14 | FromGitter | <zacharycarter> and you had to write gameplay code in C++ |
12:35:25 | FromGitter | <krux02> if you call a function in python it calls some C code |
12:35:30 | FromGitter | <krux02> that is not really an argument |
12:35:44 | FromGitter | <zacharycarter> GD script is a shitty version of Python though |
12:35:48 | FromGitter | <krux02> the logic you implement in the scripting engine is limited by the speed of the language |
12:35:58 | FromGitter | <zacharycarter> they would have been much better off adopting python or some other language as the scripting languge |
12:36:00 | FromGitter | <zacharycarter> instead of writing their own |
12:36:16 | FromGitter | <krux02> eventually gd script might die |
12:36:20 | PMunch | I think a simple game engine/editor in Nim could become pretty popular |
12:36:24 | Yardanico | +1 |
12:36:28 | FromGitter | <zacharycarter> zengine |
12:36:29 | FromGitter | <zacharycarter> ... |
12:36:34 | FromGitter | <zacharycarter> just needs an editor! |
12:36:45 | FromGitter | <zacharycarter> it's already stupid simple |
12:36:45 | Yardanico | well if you compare how easy is unity or godot |
12:37:00 | FromGitter | <krux02> or github.com/krux02/opengl-sandbox |
12:37:00 | FromGitter | <zacharycarter> yeah unity or godot have thousands of hours of multiple developers behind them |
12:37:16 | FromGitter | <zacharycarter> opengl-sadbox and zengine are like 4 people combined :P |
12:37:23 | FromGitter | <zacharycarter> sandbox |
12:37:25 | FromGitter | <zacharycarter> sorry not sadbox lol |
12:37:34 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:37:53 | FromGitter | <zacharycarter> if the community wants these things they need to help contribute to the projects |
12:38:02 | FromGitter | <zacharycarter> no one is going to swoop in and decide to build the next big game engine in Nim |
12:38:03 | FromGitter | <zacharycarter> it's too risky |
12:38:05 | PMunch | TBH, writing it in pure Nim + SDL + gamelib for the gamejam was pretty nice. |
12:38:38 | PMunch | Sure, 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:47 | FromGitter | <krux02> PMunch that is opengl-sandbox |
12:39:14 | PMunch | Huh? |
12:40:02 | FromGitter | <krux02> it is SDL2 + Opengl + glm + nim-macros for easy renderer development |
12:40:28 | FromGitter | <krux02> it does not create new abstractions on top of things that already exist |
12:40:45 | PMunch | I was talking about this: https://github.com/PMunch/TromsoGameJam2017 |
12:40:53 | PMunch | The game I made this weekend for a Game Jam |
12:42:02 | FromGitter | <krux02> does anybody of you know how to change the framerate of a gif? |
12:42:46 | FromGitter | <krux02> PMunch: sorry, what I meant is that opengl-sandbox is designed to be useful in a gamejam |
12:43:17 | PMunch | Oh right, yeah I would imagine :) |
12:43:19 | FromGitter | <krux02> just to give you an example |
12:43:40 | PMunch | https://ezgif.com/speed |
12:43:44 | FromGitter | <krux02> two days ago I implemented an octree and I wanted to draw the octree with AABB (axis aligned bounding boxes) |
12:43:51 | PMunch | That should probably work for changing your gif speed by the way |
12:44:05 | FromGitter | <krux02> I wrote an exporter that exported the AABB as pairs of Vec3 |
12:44:14 | FromGitter | <krux02> (min, max: Vec3f) |
12:44:55 | FromGitter | <krux02> and then to render them I simply wrote a renderer that used instancing to draw all cubes at the same time |
12:45:45 | FromGitter | <krux02> I could use the values from ``seq[tuple[min,max: Vec3f]]`` instantly without conversion |
12:46:14 | FromGitter | <Grabli66> @zacharycarter I wrote a small game on godot with gdscript. Normal performance. |
12:47:23 | Yardanico | well yeah, it wouldn't be noticeable for a small game |
12:47:42 | Yardanico | zacharycarter said: " there's a reason they advise you to write performance sensitive code in C++ and not GDscript" |
12:48:45 | PMunch | Try do something silly like implement an A* algorithm in gdscript and run a couple thousand instances of it simultaneously |
12:49:06 | FromGitter | <zacharycarter> exactly |
12:49:10 | * | claudiuinberlin joined #nim |
12:50:34 | PMunch | Something which wouldn't be completely unthinkable in an RTS game |
12:50:38 | FromGitter | <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:22 | PMunch | Ah, 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:39 | FromGitter | <Grabli66> For that there is a profiler, and possibility to write in C++ if need a performance |
12:55:36 | PMunch | Yeah, 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:45 | PMunch | And 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:17 | PMunch | And compiled > interpreted for speed, always |
12:58:11 | * | spica joined #nim |
12:58:39 | spica | Hi guys. Is it possible to remove data from simple sets? var xxx = {'a' .. 'z'} |
12:59:11 | PMunch | https://nim-lang.org/docs/sets.html#excl,HashSet[A],A |
12:59:21 | FromGitter | <Grabli66> You can write your "compiled" program that it will be slower than interpreted. |
12:59:29 | PMunch | Oh wait, that was for hash sets |
12:59:58 | spica | yeah, so I guess they are immutable |
13:00:07 | PMunch | The operation is still called excl for the built in set though |
13:00:14 | PMunch | https://nim-lang.org/docs/manual.html#types-set-type |
13:01:45 | PMunch | Grabli66, well it would take some work, but I guess you would be able to get worse performance |
13:03:15 | FromGitter | <krux02> https://camo.githubusercontent.com/bbec54f58f9f10beb07a20d5fe0465586d888763/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f6c314a3973363553576a486979614a656f2f67697068792e676966 |
13:03:18 | spica | does anybody know if it's possible to get some ids for 'objects' like arrays, sets? |
13:03:36 | spica | repr only works on seqs |
13:03:41 | spica | which are on the heap |
13:04:14 | * | renarc quit (Remote host closed the connection) |
13:04:29 | FromGitter | <krux02> what do you mean by id? |
13:04:59 | FromGitter | <krux02> you can call ``addr`` |
13:05:01 | spica | in python there's the id method |
13:05:05 | spica | oh |
13:05:10 | spica | let me check that |
13:05:17 | FromGitter | <krux02> well it is usique |
13:05:26 | FromGitter | <krux02> but probably not what you want |
13:05:50 | PMunch | Yeah, what are you trying to do spica? |
13:06:24 | spica | I was trying to see the 'id' or a set b4 and after incl |
13:06:29 | spica | to see if it changes |
13:07:56 | PMunch | It 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:58 | spica | krux02: addr doesn't seem to work |
13:08:17 | spica | PMunch, I was talking about the location of the set |
13:08:20 | spica | not about the content |
13:08:22 | PMunch | addr is the memory location of the object, which doesn't change if you add data to it :P |
13:08:26 | spica | the memory loc |
13:08:34 | PMunch | Oh, that's addr |
13:09:03 | spica | how can I use it? not working on sets it seems, not even on seqs |
13:09:18 | FromGitter | <krux02> it does not work on let values |
13:09:24 | FromGitter | <krux02> only on var |
13:09:26 | spica | trying on var |
13:09:28 | spica | but not working |
13:09:31 | Araq_ | unsafeAddr ftw |
13:10:29 | PMunch | What do you mean it doesn't work? |
13:10:34 | Araq_ | but it's rather pointless for your purpose, it can change or not depending on mostly implementation details |
13:10:57 | Araq_ | (It can be an object that refs a seq that grows, the object stays the same) |
13:11:03 | spica | PMunch, my bad. I was trying to echo, it was complaining about the fact that $ is not defined... with repr it works |
13:11:13 | PMunch | Oh yeah :P |
13:11:27 | PMunch | $ is not implemented for ptr set |
13:11:43 | PMunch | But I still don't see what you would want to use this for |
13:12:17 | PMunch | As Araq_ pointed out it's not really something that should be compared, since it can change or not just depending on implementation |
13:12:50 | spica | yeah |
13:13:04 | spica | sets seem to hve the same ref even after incl |
13:13:08 | spica | okay |
13:13:23 | PMunch | But it might not |
13:13:28 | spica | I understand |
13:13:36 | PMunch | It's not a rule, it's not something you can depend on |
13:13:41 | spica | got it |
13:14:56 | spica | for 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:11 | PMunch | Uhm, 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:50 | spica | that'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:59 | spica | but it's copied |
13:17:12 | PMunch | Ah, you should create a ref seq in that case |
13:17:13 | spica | the seq is a copy |
13:17:18 | spica | how |
13:17:22 | PMunch | Then you can pass around the ref and not the seq |
13:17:30 | spica | oh, ref in proc? |
13:18:01 | * | xet7 quit (Remote host closed the connection) |
13:18:14 | * | claudiuinberlin joined #nim |
13:20:13 | PMunch | var x = new seq[int] |
13:20:18 | PMunch | That gives you a ref seq[int] |
13:20:29 | spica | didn'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:36 | spica | yeah but .add(1) fails to work. How do I populate? @[1] also fails |
13:23:00 | spica | got (seq[int]) but expected 'ref seq[int]' |
13:23:05 | spica | when 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:01 | def- | spica: probably have to dereference with [] |
13:27:10 | def- | xs[].add(1) |
13:27:26 | def- | you might also want to look into shallow and shallowCopy |
13:27:44 | FromGitter | <Bennyelg> if I want to "Inharitance" DbConn to a new connection I am build |
13:27:51 | FromGitter | <Bennyelg> what is the best way |
13:28:58 | spica | def-: illegal storage access |
13:29:03 | spica | var p = new seq[int] |
13:29:03 | spica | p[].add(12) |
13:29:48 | def- | you didn't call newSeq on it yet |
13:30:19 | FromGitter | <krux02> I just used git lfs (large file storage) and it was surprisingly simple |
13:30:22 | spica | well, it worked with @[12] |
13:30:41 | spica | and now add works |
13:31:27 | FromGitter | <krux02> spice: something tells me that you want to do something overly complicated that can be done much simpler |
13:32:03 | FromGitter | <krux02> I am not in your head, so I don't know want your goal is. |
13:32:05 | spica | krux02, I'm actually not trying to do anything. I'm just curious (reading through Nim in action) |
13:32:15 | FromGitter | <krux02> ah |
13:32:16 | FromGitter | <krux02> ok |
13:32:25 | FromGitter | <krux02> I have the book as well |
13:32:50 | Arrrr | "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:57 | FromGitter | <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:47 | spica | let 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:25 | loc8 | Hey is there something like `super` for Nim types? |
13:45:43 | loc8 | type 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:41 | Araq_ | proccall |
13:47:41 | Arrrr | spica: newSeq[int]() |
13:49:36 | spica | Arrr: yeah, I forgot it. take a look at this to see what I'm talking aobut: https://pastebin.com/yvUm8zpe |
13:50:06 | spica | Should't y be immutable as well? x is |
13:50:23 | * | relax joined #nim |
13:50:56 | TjYoco | are you modifying a reference to y since you called new? |
13:51:35 | spica | it's not about the reference. It's about the content of the seq |
13:51:40 | FromGitter | <ephja> the immutability is not transitive |
13:51:55 | spica | ephja, what does that mean? |
13:54:01 | Arrrr | in 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:08 | FromGitter | <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:06 | FromGitter | <Bennyelg> Can i do something like this? ⏎ "$1=$2" & prop.split("=") |
13:55:07 | FromGitter | <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:00 | Arrrr | Have a look at `strutils` module |
13:56:19 | Arrrr | There is a proc that do what you need, but i don't remember the name right now. |
13:57:08 | spica | Arrr: ok |
13:57:16 | spica | guys. what editors do you use for nim? |
13:57:31 | * | endragor quit (Remote host closed the connection) |
13:57:39 | spica | vscode is okay, but the completion also suggest stuff that's not relevant |
13:58:11 | Arrrr | notepad++ |
13:58:49 | loc8 | type B = object of A, inside the `newB` you call `super(self, arguments)` and it runs `newA` "using it" as the result |
13:58:53 | loc8 | Sry bug |
13:59:11 | loc8 | (I mean that I sent the message as an accident) |
14:00:01 | * | endragor joined #nim |
14:00:26 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b939fa614889d475f250ea] |
14:00:39 | FromGitter | <Bennyelg> additionalProperties is a seq[string] |
14:00:56 | FromGitter | <Bennyelg> I want to take all the properties from the even position |
14:01:38 | FromGitter | <ephja> proc(...): ReturnType = ... |
14:01:54 | FromGitter | <Bennyelg> Oo? |
14:03:08 | FromGitter | <ephja> try this: `proc(i: int, x: string): bool = i mod 2 == 0` |
14:04:01 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b93ad0bac826f054b1c8c2] |
14:04:20 | * | endragor quit (Ping timeout: 246 seconds) |
14:06:27 | FromGitter | <ephja> oh. I dunno if it's possible to retrieve the index that way |
14:10:02 | FromGitter | <ephja> these interfaces don't take iterators. if they did then you could pass a "stride" iterator for example |
14:12:17 | FromGitter | <Bennyelg> can I create range(5) for example? |
14:12:20 | FromGitter | <Bennyelg> like python |
14:12:30 | FromGitter | <Bennyelg> any equivalent? |
14:12:37 | FromGitter | <krux02> 1) .<5 |
14:13:06 | FromGitter | <Bennyelg> yea but Iwant actually create a seq |
14:13:16 | FromGitter | <krux02> well you can write one |
14:13:18 | FromGitter | <Bennyelg> seq[0..someOtherseq.len] |
14:14:05 | spica | Bennyelg, that doesn't work. seq expects a type not a range |
14:14:17 | FromGitter | <krux02> def range(arg: Int): seq[Int] = result.newSeq(arg); for i,v in arg.mpairs: v = i |
14:14:33 | spica | this fails as well: var x: seq[int] = @[1 .. 10] |
14:14:47 | spica | the range seem to work on SETs though |
14:15:29 | FromGitter | <ephja> import sequtils ⏎ let s = toSeq(0..5) |
14:15:38 | FromGitter | <ephja> I mean 4, or <5 ;) |
14:16:16 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b93db0b59d55b823efa423] |
14:16:17 | FromGitter | <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:19 | FromGitter | <Bennyelg> I managed |
14:17:03 | FromGitter | <Bennyelg> the range is something like @krux02 |
14:17:29 | TjYoco | I think at that point a simple for loop is more legible, no? |
14:17:45 | FromGitter | <Bennyelg> maybe |
14:17:49 | FromGitter | <krux02> a for loop is not an expression |
14:18:36 | TjYoco | krux02, i meant replace the whole thing |
14:19:24 | FromGitter | <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:18 | TjYoco | Bennelg, would this not be suitable for you https://www.hastebin.com/owixokosog.nim |
14:25:32 | loc8 | (I mean that I sent the message as an accident) |
14:25:36 | TjYoco | Bennyelg ** |
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:10 | FromGitter | <krux02> @Bennyelg but you can write your own zip iterator |
15:03:45 | FromGitter | <krux02> so that you can write for pop, val in zipItems(evens,odds): |
15:08:17 | * | loc8 joined #nim |
15:08:35 | loc8 | Hey, can you get a type property via key? |
15:09:25 | FromGitter | <krux02> what do you mean via key? |
15:10:27 | loc8 | Say the property is called `name` |
15:10:35 | loc8 | Something like `object["name"]` |
15:10:40 | loc8 | Where I can access the property using a string |
15:11:23 | FromGitter | <krux02> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b94a9b319100804e2e2b5f] |
15:11:32 | * | Sentreen quit (Ping timeout: 246 seconds) |
15:12:00 | FromGitter | <krux02> this is not accessing via string, but via identifier |
15:12:30 | FromGitter | <krux02> might be exactly what you want |
15:13:10 | FromGitter | <krux02> you get a compilation failure when the type does not have the property |
15:14:35 | loc8 | That'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:51 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b953db210ac26920288029] |
15:50:58 | FromGitter | <Bennyelg> any one can explain me the problem? |
15:51:36 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b95408319100804e2e6863] |
15:52:43 | Trustable | New tests for strutils.countLines(): https://github.com/nim-lang/Nim/pull/6371/commits/83697135497f2b7a00fde91c0907e6bfba7e7eb7 |
15:55:14 | FromGitter | <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:53 | FromGitter | <Yardanico> and btw, you can avoid doing stuff like creating a type, eheaders variable |
16:03:46 | FromGitter | <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:30 | FromGitter | <Bennyelg> I tried to pass it but it failed. |
16:15:27 | FromGitter | <Bennyelg> @Yardanico But I have an argument which I pass after i build it |
16:15:38 | FromGitter | <Yardanico> what do you mean? |
16:16:04 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b959c3bc464729742c718b] |
16:16:07 | FromGitter | <Yardanico> You can do this as well |
16:16:43 | FromGitter | <Yardanico> @Bennyelg and you can pass it, just rename "value" to "val" in your "keyval" tuple type |
16:16:55 | FromGitter | <Yardanico> and you'll be able to pass eheaders variable directly |
16:17:03 | * | Sentreen quit (Ping timeout: 248 seconds) |
16:19:34 | FromGitter | <Bennyelg> how do you add value to ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b95a96cfeed2eb65052731] |
16:20:42 | FromGitter | <Yardanico> you can't add it, but you didn't specify that you need to modify it |
16:20:46 | FromGitter | <Yardanico> create a table, yes |
16:21:11 | FromGitter | <Yardanico> well I mean no |
16:21:16 | FromGitter | <Bennyelg> but lol when I create table I can assign it back to this shitty newhttpheader |
16:21:19 | FromGitter | <Bennyelg> this is so funny |
16:21:25 | FromGitter | <Bennyelg> like the egg and the chicken issue |
16:21:30 | FromGitter | <Bennyelg> who come first |
16:21:31 | FromGitter | <Yardanico> ok, don't create the table at all |
16:21:41 | FromGitter | <Yardanico> just create newHttpHeaders(), and add values to it, ok ? |
16:21:46 | FromGitter | <Bennyelg> how |
16:21:48 | FromGitter | <Yardanico> like myheaders["key"] = val |
16:22:14 | FromGitter | <Yardanico> you can create empty newHttpHeaders() variable |
16:22:21 | FromGitter | <Bennyelg> finally |
16:22:27 | FromGitter | <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:54 | FromGitter | <Bennyelg> how to assign json list of string to seq[string] |
16:55:59 | FromGitter | <Bennyelg> this.resultSet.columns = data["columns"].elems |
16:56:07 | FromGitter | <Bennyelg> not good enouge because its jsonNode |
16:56:15 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
16:56:31 | FromGitter | <Yardanico> data["columns"].mapIt(it.str) |
16:56:42 | FromGitter | <Yardanico> like this, you should have "sequtils" imported |
16:56:56 | FromGitter | <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:46 | d10n-work | It 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:10 | FromGitter | <zacharycarter> I think we need a "Used by these companies" section on the page for Nim |
17:22:17 | FromGitter | <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:40 | FromGitter | <ephja> maybe nimsuggest is mostly failing for modules that are meant to be included |
17:51:39 | spica | Does anybody know why async sockets use Future instead of FlowVar? |
17:52:39 | spica | or why "spawn" uses FlowVar instead of Future |
17:53:30 | dom96 | due to some implementation details |
17:53:41 | dom96 | Araq will know more as it was his decision |
17:53:49 | dom96 | I did try to convince him to use Future of course :) |
17:54:03 | dom96 | Eventually we will get a way to wrap the FlowVar in a future though |
17:55:07 | FromGitter | <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:15 | spica | right, because I was reading through your book, and at first glance they seem very similar |
17:55:19 | FromGitter | <Bennyelg> x["data"].str not work |
17:56:09 | TjYoco | Bennyelg it looks like that value is an array, not a string |
17:56:25 | FromGitter | <Bennyelg> so I need to x["data"].array? |
17:56:58 | TjYoco | does x["data"][0].getStr() work? |
17:57:18 | FromGitter | <Bennyelg> But I dont want only the place 0 |
17:57:21 | FromGitter | <Bennyelg> I need anything |
17:57:23 | FromGitter | <Bennyelg> sec I check |
17:57:49 | FromGitter | <Bennyelg> Error: unhandled exception: str is not accessible [FieldError] |
17:58:19 | TjYoco | you have to use getStr() I think |
17:58:23 | FromGitter | <Bennyelg> kind is JArray |
17:59:04 | FromGitter | <Yardanico> TjYoco: you can use both "str" and "getStr", but with getStr you will get better exception |
17:59:10 | FromGitter | <Yardanico> lol, sublime text 3.0 - https://www.sublimetext.com/blog/articles/sublime-text-3-point-0 |
18:00:05 | dom96 | If it's a JArray then you should grab the element you want: x["data"][0] |
18:00:16 | dom96 | or .elems to get the actual sequence |
18:00:54 | FromGitter | <Bennyelg> and I need to create seq[string] ? |
18:01:02 | FromGitter | <Bennyelg> type mismatch: got (seq[JsonNode]) but expected seq[string] |
18:02:12 | TjYoco | Bennyelg, x["data"] is a JArray with each element being a JsonNode also. |
18:02:39 | FromGitter | <Bennyelg> Oh so how Do I cover it? I want each value to be string |
18:02:44 | FromGitter | <Bennyelg> I dont care of anything inside |
18:03:05 | FromGitter | <Bennyelg> Done |
18:03:12 | FromGitter | <Bennyelg> Thanks. |
18:03:19 | spica | guys, is this a bug? someFunction not someBoolean -> doesn't compile someFunction(not someBoolean) works |
18:05:25 | FromGitter | <zacharycarter> spica please post an example with gist or the playground or something |
18:05:32 | FromGitter | <zacharycarter> I don't understand what you're getting at |
18:05:38 | * | fraya left #nim ("Leaving") |
18:06:59 | spica | https://pastebin.com/Lr0EAUJh |
18:07:29 | FromGitter | <zacharycarter> that's not a bug |
18:07:43 | spica | how come? |
18:07:56 | FromGitter | <zacharycarter> because you're calling doAssert with one argument - not - in the second example |
18:08:09 | FromGitter | <zacharycarter> this is valid probably |
18:08:14 | FromGitter | <zacharycarter> doAssert (not foo) |
18:08:23 | FromGitter | <Yardanico> yeah, @zacharycarter is right |
18:08:34 | FromGitter | <zacharycarter> but you'll get a warning about commands being deprecated or something |
18:08:41 | spica | well, shouldn't 'not' have greater precedence than a function call? |
18:09:04 | FromGitter | <Yardanico> cc Araq_ he can explain everything :) |
18:09:07 | FromGitter | <zacharycarter> yeah |
18:09:30 | spica | Araq ^ |
18:18:39 | FromGitter | <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:23 | TjYoco | adamrezich, https://nim-lang.org/docs/macros.html#statements-type-section |
18:20:00 | Arrrr | why not? https://play.nim-lang.org/?gist=c8ccf67ac1f9d582262e2953b14e550f |
18:20:06 | FromGitter | <Yardanico> @adamrezich easy |
18:20:39 | FromGitter | <Yardanico> You can generate (in macros) any code which is valid Nim code |
18:20:48 | Arrrr | for some reason a random() call introduces side effects |
18:20:48 | FromGitter | <Yardanico> there's no restrictions IIRC |
18:21:12 | FromGitter | <adamrezich> awesome, I forgot dumpTree was a macro you call with a colon and not a function :v |
18:21:27 | FromGitter | <Yardanico> Arrrr: probably because it changes global variable? |
18:21:54 | FromGitter | <Yardanico> https://github.com/nim-lang/Nim/blob/master/lib/pure/random.nim#L39 |
18:21:56 | Arrrr | Yes, probably |
18:22:21 | Arrrr | probably ... |
18:23:56 | * | edubart_ joined #nim |
18:25:25 | * | haha_ quit (Quit: haha_) |
18:26:54 | * | edubart quit (Ping timeout: 260 seconds) |
18:27:10 | TjYoco | what are the advantages of using object of RootObj instead of just object |
18:27:29 | Araq_ | if in doubt, do not write 'of RootObj' |
18:27:46 | TjYoco | Is it for inheritance stuff |
18:27:46 | spica | if you don't use RootObj, your type can't be subtype afaik |
18:27:59 | spica | subtyped* |
18:28:09 | FromGitter | <ephja> a new root can be introduced with the 'inheritable' pragma |
18:28:18 | FromGitter | <ephja> it shouldn't be necessary that often I guess |
18:28:48 | Araq_ | do not use .inheritable unless you really need it for C interop |
18:29:06 | * | edubart_ quit (Quit: Page closed) |
18:29:20 | TjYoco | thanks |
18:35:49 | * | yglukhov quit (Remote host closed the connection) |
18:36:11 | * | claudiuinberlin joined #nim |
18:41:34 | FromGitter | <ephja> I guess providing suggestions for an included module won't pose any problems as long as it's only included once |
18:43:05 | dom96 | Araq_: Any ideas about this? https://github.com/nim-lang/nimble/issues/406 |
18:46:30 | Araq_ | dom96: maybe it's caused by my osproc changes, https://github.com/nim-lang/Nim/pull/6364 seems to improve upon it |
18:49:45 | spica | dayum. Does anybody know if this is a bug? https://pastebin.com/yrnafWML |
18:50:34 | Araq_ | no, it's not |
18:50:47 | Araq_ | the 'await' strips away the Future |
18:50:50 | Araq_ | that's its point |
18:50:57 | spica | omg, sorry |
18:51:16 | Araq_ | the compiler's error message is also super useful :P |
18:53:32 | spica | Araq_ what about this? https://pastebin.com/Lr0EAUJh |
18:54:09 | Araq_ | that's also not a bug |
18:54:27 | Araq_ | though maybe we should change 'not' to be unary-only |
18:55:30 | Araq_ | but then 'if x not y' would not compile anymore for some definition like proc `not`(a, b: int): int = a != b |
18:56:10 | Araq_ | (not saying that's good code, but perhaps it help in understanding :P ) |
18:57:27 | spica | how 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:19 | Arrrr | Why do i get a SYGSEGV here? https://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim#L534 |
19:23:26 | Arrrr | What could be the reason? |
19:23:49 | * | Jesin joined #nim |
19:24:14 | FromGitter | <Yardanico> GC bug |
19:24:26 | FromGitter | <Yardanico> maybe not GC bug, but something with memory :) |
19:24:30 | FromGitter | <Yardanico> make a bug report with a traceback |
19:24:45 | Arrrr | happens in growObj |
19:24:45 | FromGitter | <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:51 | FromGitter | <Yardanico> @adamrezich !"yourstring" for example |
19:26:02 | FromGitter | <Yardanico> oh no |
19:26:06 | FromGitter | <Yardanico> maybe ident"mystring" |
19:26:07 | FromGitter | <Yardanico> or https://nim-lang.org/docs/macros.html#newIdentNode,string |
19:28:02 | FromGitter | <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:45 | TjYoco | adamrezich post a code snippet |
19:30:00 | Arrrr | $name |
19:30:34 | FromGitter | <Bennyelg> ok , so I have set of rows with undefined number of columns |
19:30:37 | FromGitter | <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:46 | FromGitter | <adamrezich> aha, that's what I was missing |
19:30:58 | FromGitter | <Yardanico> but yeah, if you specify that it's a string, compiler will check that your macro is called with string |
19:30:59 | FromGitter | <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:31 | FromGitter | <Yardanico> @Bennyelg for row in data: for elem in row: yourDataset.add(elem) |
19:31:34 | * | yglukhov quit (Ping timeout: 264 seconds) |
19:31:54 | FromGitter | <Yardanico> but it wouldn't be very efficient since the number of columns is unknown |
19:32:41 | FromGitter | <Yardanico> and yeah, it would be 3 lines |
19:32:43 | FromGitter | <Yardanico> not 1 line |
19:33:22 | FromGitter | <Yardanico> and you'll need to have "getStr" or "str" |
19:36:21 | dom96 | I know I say this a lot, but IMO the error message for https://pastebin.com/Lr0EAUJh can be improved |
19:36:27 | dom96 | Please report it spica |
19:37:12 | * | miran joined #nim |
19:38:13 | spica | I'll do it tomorrow |
19:38:49 | spica | question guys. Is ctrl_c supposed to always make the program throw exceptions? |
19:39:22 | spica | ctrl_c-ing when an async socket accepts gives me this: SIGINT: Interrupted by Ctrl-C. |
19:39:47 | FromGitter | <Yardanico> yes, unless you overwrite exit proc |
19:40:14 | FromGitter | <Yardanico> setControlCHook(yourExitProc) |
19:40:21 | FromGitter | <Yardanico> and yourExitProc should have {.noconv.} pragma |
19:41:06 | spica | I was actually asking if that's a bug. " SIGINT: Interrupted by Ctrl-C.", doesn't seem to be an exception |
19:41:31 | FromGitter | <Yardanico> it's not a bug |
19:41:41 | FromGitter | <Yardanico> SIGINT is signal interrupted |
19:41:48 | FromGitter | <Yardanico> so ctrl+c interrupts your application |
19:42:02 | FromGitter | <Yardanico> what do you want it to do? |
19:42:37 | FromGitter | <Yardanico> Ctrl-C (in older Unixes, DEL) sends an INT signal ("interrupt", SIGINT); by default, this causes the process to terminate. |
19:42:43 | spica | I want it to be consistent |
19:42:47 | FromGitter | <Yardanico> it is consistent |
19:42:51 | FromGitter | <Yardanico> why it's not? |
19:44:08 | spica | ctrl_c-ing when doing spawn stdin.readLine() gives an actual exception with trace: https://pastebin.com/bdt2TLnc |
19:44:46 | FromGitter | <Yardanico> yes |
19:44:49 | spica | so? |
19:44:54 | spica | is that normal |
19:44:54 | spica | ? |
19:45:33 | FromGitter | <Yardanico> because you're reading from console, yes |
19:46:26 | FromGitter | <Yardanico> well I don't see any issues there, but I *might* be wrong |
19:46:37 | FromGitter | <Yardanico> it's ok for me, since I don't usually read from console |
19:46:43 | spica | lets ask Araq_ |
19:46:44 | FromGitter | <Yardanico> and I do catch ctrl+c |
19:47:05 | spica | well, how do you catch this? SIGINT: Interrupted by Ctrl-C |
19:47:11 | spica | I don't think you can |
19:47:23 | FromGitter | <Yardanico> as I said |
19:47:26 | FromGitter | <Yardanico> add ctrl+c hook |
19:47:46 | FromGitter | <Yardanico> setControlCHook(yourExitProc) and yourExitProc is a proc with {.noconv.} pragma |
19:47:48 | spica | yep, workaround. |
19:47:51 | FromGitter | <Yardanico> it's not |
19:47:55 | FromGitter | <Yardanico> it's the default way to do it |
19:48:03 | FromGitter | <Yardanico> even in C you would define a function like sigint() |
19:48:23 | FromGitter | <Yardanico> https://stackoverflow.com/questions/4217037/catch-ctrl-c-in-c |
19:49:18 | * | skrylar joined #nim |
19:49:39 | FromGitter | <Yardanico> I don't know about windows though |
19:49:49 | FromGitter | <Yardanico> but at least it's consistent on all platforms in nim |
19:50:37 | FromGitter | <Yardanico> https://github.com/nim-lang/Nim/blob/000b8afd26fa16684a116d9afe798ea94df9c270/lib/system/excpt.nim#L409 |
19:51:31 | spica | I'll look into it. Thanks |
19:51:35 | FromGitter | <Yardanico> it was added in 2012 :P |
19:55:34 | FromGitter | <Bennyelg> how to cast seq[seq[string]] to an iterator |
19:56:28 | FromGitter | <Yardanico> What? |
19:56:52 | FromGitter | <Bennyelg> I want to iterate over seq[seq[string]] value by value |
19:56:54 | FromGitter | <Bennyelg> like an iterator |
19:57:08 | FromGitter | <Yardanico> You nested loop |
19:57:14 | FromGitter | <Yardanico> Use |
19:57:28 | FromGitter | <Yardanico> Or create an iterator which will have nested loop :) |
19:58:18 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b98ddabac826f054b3d2c5] |
19:58:19 | FromGitter | <Bennyelg> ? |
19:59:12 | FromGitter | <Yardanico> No |
19:59:24 | FromGitter | <Yardanico> You say that you have seq of seqs |
19:59:37 | FromGitter | <Yardanico> You should add another loop here like |
20:00:06 | FromGitter | <Yardanico> for data in this.data: for elem in data: yield elem |
20:00:09 | spica | bennyelg: https://pastebin.com/cwKHMAhg |
20:00:11 | spica | try that |
20:00:15 | FromGitter | <Yardanico> But not in one line |
20:00:16 | spica | I haven't tested it doe |
20:00:36 | FromGitter | <Yardanico> Yeah it will work |
20:01:49 | skrylar | hmm. thinking i should bin the use of tuples for vectors |
20:02:10 | skrylar | mostly 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:42 | FromGitter | <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:18 | FromGitter | <ephja> Araq: how do I get the ordinal value of an skEnumField node? |
20:11:21 | * | loc8 quit (Ping timeout: 240 seconds) |
20:11:47 | FromGitter | <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:10 | FromGitter | <mratsim> There is a special case to catch strings and not yield chars |
20:13:38 | FromGitter | <Yardanico> Btw, you can also make it work with any iterable via concept? And add array as a special case |
20:14:03 | FromGitter | <Yardanico> Because sadly you can't match array to a concept yet |
20:15:27 | FromGitter | <Yardanico> But it may still not work, but very good iterator anyway :) |
20:19:06 | FromGitter | <Bennyelg> Finally I am almost done to create prestodb connector |
20:19:07 | FromGitter | <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:17 | FromGitter | <mratsim> btw while doing that iterator I was wondering if there is any “yield from” coroutine like in Python |
20:23:00 | Araq_ | both arrays and a seq? that's directly supported via openArray |
20:23:01 | FromGitter | <Yardanico> There's not, but it's just a shortcut AFAIK |
20:24:01 | * | miran quit (Ping timeout: 248 seconds) |
20:25:20 | FromGitter | <Yardanico> Well, not exactly a shortcut |
20:25:22 | FromGitter | <Yardanico> https://docs.python.org/3/whatsnew/3.3.html#pep-380 |
20:27:10 | FromGitter | <ephja> let e = semTypeNode(c, ...) |
20:27:19 | FromGitter | <mratsim> @Araq, iirc I had “Cannot capture foo” trouble in many tries |
20:27:35 | FromGitter | <mratsim> or Illegal capture something |
20:28:17 | relax | What 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:26 | limon__ | Anybody know why "var x: int8 = 255" gives "type mismatch"? |
20:33:10 | obadz | $ ~/.nimble/bin/aporia |
20:33:13 | obadz | could not load: libglib-2.0.so(|.0) |
20:33:25 | obadz | does it use dlopen()? I don't see glib in ldd.. |
20:33:36 | spica | limon__ because int8 is signed |
20:33:39 | spica | up to 127 |
20:33:46 | spica | -128 -> 127 afaik |
20:33:53 | limon__ | Oh yeah. That was dumb. Thanks! |
20:33:54 | spica | uint8 should work |
20:34:29 | spica | np |
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:10 | FromGitter | <Yardanico> obadz: yeah, probabl |
20:41:07 | obadz | thx |
20:42:11 | obadz | is there any reason to use async/Future/await rather than spawn/FlowVar/sync? ? |
20:42:25 | obadz | (I'm sure there are, just don't know what they are) |
20:42:50 | ehmry | because you want to stay single threaded? |
20:43:03 | obadz | what if I don't? |
20:44:13 | ehmry | then you'd have to use spawn, its not really reasonable to pass futures between threads |
20:44:43 | FromGitter | <ephja> didn't someone ask this not long ask? |
20:45:01 | FromGitter | <ephja> not long ago* |
20:51:36 | obadz | of nimedit/aporia, which one is the recommanded option at this juncture? |
20:51:46 | obadz | (or any other option) |
20:52:01 | dom96 | neither |
20:52:04 | dom96 | Use VS Code. |
20:52:46 | obadz | it's a bit flimsy on nixos |
20:53:22 | ehmry | nixos has acme in plan9ports |
20:53:31 | ehmry | syntax highlighting is for suckers |
20:54:36 | FromGitter | <Bennyelg> What do you think ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b99b0cbac826f054b41d46] |
20:56:33 | TjYoco | If I'm making a nimble package that has to be compiled with -d:sll, where do I set that? |
20:57:51 | ehmry | TjYoco: your_package.nim.cfg |
20:58:04 | TjYoco | ehmry thanks |
20:58:33 | * | endragor joined #nim |
20:58:41 | FromGitter | <Bennyelg> How Do I create nimble :) |
20:58:57 | TjYoco | nimble init |
21:00:05 | ehmry | I'm thinking there is a no-copy way for the compiler to construct C++ heap objects in place by overriding ``new`` operator |
21:00:17 | TjYoco | cd into your package directory and call nimble init, the just hit yes for everything basically |
21:01:06 | dom96 | My 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:49 | FromGitter | <Bennyelg> what after I have the x.nimble |
21:03:51 | FromGitter | <Bennyelg> nimble push? |
21:03:59 | FromGitter | <Bennyelg> publish * ? |
21:04:01 | * | Demos quit (Ping timeout: 240 seconds) |
21:04:06 | dom96 | yes |
21:04:40 | TjYoco | Just to be clear though, there's no way to import compiler flags from modules though right? |
21:05:17 | dom96 | Not sure actually |
21:05:22 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
21:05:31 | dom96 | If you're importing a package that has its own .nim.cfg then its options should be applied |
21:05:48 | TjYoco | I put -d:ssl into a package.nim.cfg file, but importing it elsewhere tells me I need to use that flag still |
21:06:59 | TjYoco | oh wait, my mistake. An exported function is using SSL, so the new script still has to be compiled with it |
21:07:34 | TjYoco | I'm guessing. Unless I did it wrong |
21:07:56 | dom96 | yeah, I think that makes sense. |
21:07:56 | * | skrylar quit (Remote host closed the connection) |
21:10:22 | * | xet7 joined #nim |
21:13:15 | FromGitter | <Bennyelg> @dom96 ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59b99f6b210ac269202a2cef] |
21:13:16 | FromGitter | <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:21 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b99f71177fb9fe7eb946dc] |
21:14:20 | dom96 | Yeah, known bug sadly |
21:14:32 | FromGitter | <Bennyelg> how do I fix it |
21:14:33 | dom96 | You'll need to create a PR on the packages repo manually |
21:14:52 | FromGitter | <Bennyelg> oh |
21:15:22 | FromGitter | <Bennyelg> the one is forked on my git? |
21:16:16 | FromGitter | <Bennyelg> https://github.com/nim-lang/packages/pulls |
21:20:50 | dom96 | How did this happen? https://github.com/nim-lang/packages/pull/578/files#diff-3cd1c746ca940713759badf789478307R7171 |
21:21:03 | dom96 | yeah, publish needs improvement heh |
21:21:31 | FromGitter | <Bennyelg> lol what is that |
21:21:36 | FromGitter | <Bennyelg> Its not mine |
21:21:42 | FromGitter | <Bennyelg> I close the pull requests and run it again |
21:22:41 | FromGitter | <zacharycarter> I need to improve my cave gen stuff |
21:22:55 | FromGitter | <zacharycarter> https://imgur.com/a/BSj3S |
21:23:30 | * | sz0 quit (Quit: Connection closed for inactivity) |
21:23:44 | FromGitter | <Bennyelg> https://github.com/nim-lang/packages/pull/579/commits/6875cd3f2a81f1db6d539327a38d6d0f814db815 |
21:24:10 | * | TjYoco quit (Quit: Leaving) |
21:24:19 | FromGitter | <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:55 | dom96 | Bennyelg: nice! |
21:39:07 | dom96 | Left you some suggestions: https://github.com/nim-lang/packages/pull/579#issuecomment-329304664 |
21:41:24 | FromGitter | <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:03 | def-pri-pub | zacharycarter: You here right now? I submitted a patch to add a ZObject and Entity3D type |
21:44:51 | FromGitter | <zacharycarter> def-pri-pub: yup! I'll approve |
21:45:58 | FromGitter | <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:01 | subsetpark | Adamrezich - 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:35 | FromGitter | <zacharycarter> yay fully connected caves! |
22:07:19 | FromGitter | <zacharycarter> https://imgur.com/a/ibbNa |
22:10:01 | FromGitter | <zacharycarter> grr getting stack overflow errors on larger maps |
22:10:15 | FromGitter | <zacharycarter> no bueno |
22:11:39 | dom96 | nice code btw :) |
22:11:48 | FromGitter | <zacharycarter> thanks :) |
22:12:11 | FromGitter | <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:04 | dom96 | `export sdl2 except KeyState` might work |
22:16:19 | * | nsf quit (Quit: WeeChat 1.9) |
22:20:26 | * | libman joined #nim |
22:25:32 | FromGitter | <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:42 | FromGitter | <zacharycarter> alright I got rid of the recursion now I can generate huge maps |
22:26:01 | FromGitter | <edubart> (my example doesn't work) |
22:29:30 | * | couven92 quit (Quit: Client Disconnecting) |
22:32:47 | FromGitter | <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:56 | FromGitter | <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:18 | FromGitter | <mratsim> @edubart, it should work on 0.17.2 |
22:57:43 | FromGitter | <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:52 | FromGitter | <zacharycarter> is there any stack implementation in Nim? |
23:56:32 | def-pri-pub | There is the faststack that's in the zengine source IIRC |
23:56:57 | def-pri-pub | And I think it also follows the python philosophy of push-pop on the end. |
23:58:53 | FromGitter | <zacharycarter> I forgot I copied that over :P |
23:59:15 | FromGitter | <zacharycarter> thanks |