00:04:39 | FromGitter | <mratsim> going to sleep, thank you all. See you tomorrow |
00:12:49 | * | Nobabs27 quit (Quit: Leaving) |
00:16:19 | ldlework | is andreaferretti someone here? |
00:18:05 | FromGitter | <mratsim> He is the author of linalg, patty, and a couple other libraries, and also andrea in the forum |
00:18:13 | FromGitter | <mratsim> (really going now) |
00:20:09 | ldlework | I'm trying out their interface library |
00:20:26 | ldlework | when you try to use a type as an interface but it doesn't implement it you get an infinite recursion until the stack breaks |
00:20:28 | ldlework | :( |
00:26:59 | * | ftsf joined #nim |
00:27:17 | libman | For the top meta table on https://en.wikipedia.org/wiki/Nim_(programming_language) - are there any langs we can list that Nim has "Influenced"? |
00:34:39 | libman | Or, for a different conversation starter, DSLs - https://www.reddit.com/r/nim/comments/64knh7/new_to_nim_any_advice_for_making_a_simple_game/ |
00:45:18 | * | Ven joined #nim |
00:45:41 | * | Ven is now known as Guest48040 |
00:49:20 | ftsf | ahoyhoy |
00:49:30 | ldlework | hi ftsf |
00:49:36 | ftsf | hey ldlework |
00:49:49 | ldlework | ftsf: did you see my bsp |
00:50:03 | ftsf | noo, link? |
00:50:23 | ldlework | ftsf: https://zippy.gfycat.com/CompleteIdleCur.webm |
00:50:36 | * | Guest48040 quit (Ping timeout: 252 seconds) |
00:50:39 | ftsf | very cool |
00:50:57 | ftsf | storing in a binary tree? |
00:51:03 | ldlework | ya |
00:51:20 | ftsf | nice |
00:51:58 | ftsf | what kind of data do you store per node? |
00:52:01 | ldlework | ftsf: I'm hoping that you will add a license to nimsynth, I'd like to cannibalize some math and other functions you got |
00:52:42 | ftsf | math is unlicensable ;) but yeah i should add a licence |
00:53:00 | ldlework | ftsf: here is my implementation, https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim |
00:53:12 | ldlework | feel free to use it for your windowing |
00:53:56 | ftsf | thanks |
00:54:15 | ldlework | I'm still working on making the regions resizable in my example |
00:54:25 | ldlework | I stopped to study inversion-of-control principles |
00:54:37 | ftsf | hmm should it be a binary tree... you might want to split a region into say 3 sub regions rather than 2 |
00:55:04 | ldlework | you can get whatever effect you want with binary splits |
00:55:12 | ldlework | if you think for a moment in your head, you'll realize it |
00:55:36 | ftsf | you can |
00:55:42 | ldlework | especially if you can resize the regions |
00:55:54 | ftsf | but it's not a nice workflow for non 2 way splits |
00:56:22 | ldlework | well I'll definitely take a look at what you come up with |
00:56:33 | ftsf | have you used i3wm? i think it must work as a non-binary tree for the structure |
00:56:55 | ldlework | I use qtile with my own hand-rolled layout that simulates the original xmonad Tall layout |
00:57:53 | ldlework | https://www.youtube.com/watch?v=NE6IQdwjzso |
00:58:21 | ftsf | i think the way i3 does it is hsplit and vsplit can have any number of children. but not all are bspnodes perhaps. |
00:59:08 | ldlework | I think you'd have to decide on an orientation for stacks though |
00:59:14 | ldlework | it'd be too much to have the user manage that |
00:59:20 | ldlework | for example you might say that |
00:59:34 | ldlework | the children of a vsplit stack their own children horizontally |
00:59:47 | ldlework | and vice versa |
00:59:57 | ftsf | it think it defaults based on the aspect ratio of the node |
01:00:01 | ftsf | but you can override it |
01:00:21 | ldlework | so if the ratio changes |
01:00:27 | ldlework | does it change the way they are oriented? |
01:00:42 | ftsf | no, set at creation time |
01:01:05 | ldlework | that seems strange |
01:01:13 | ldlework | maybe you just didn't have the window fullscreened at the time |
01:01:21 | ldlework | now the window you just created is oriented wrong |
01:01:38 | ftsf | hmm not sure what you mean |
01:01:54 | ldlework | I use a tiling window manager, so lets say I had nimsynth tiled to the size |
01:02:00 | ldlework | so it was taller than it was skinny |
01:02:05 | ldlework | while I looked at some documentation |
01:02:08 | ftsf | yep |
01:02:08 | ldlework | and I create a window |
01:02:10 | ldlework | then full screen it |
01:02:32 | ldlework | now my pane that would be more useful wide than tall is the other way |
01:03:08 | ftsf | sorry... lost me. |
01:03:14 | ldlework | no worries |
01:03:23 | ftsf | but i should do some work ;) |
01:03:25 | ftsf | 2 days left |
01:03:34 | ldlework | ftsf: say hello to k-hos in #nimsynth |
01:03:42 | ldlework | they described waht they want to use nim for |
01:03:55 | ldlework | and I was like oh yeah I know a guy working that exact list of things |
01:04:10 | ftsf | cool |
01:04:14 | ldlework | (pico port, simulated hardware, pixel drawing, live module loading) |
01:13:30 | ldlework | General question: are simple base classes with empty methods a fine "poor man's" interface? |
01:13:41 | ldlework | It seems like you can use them for all the same uses. |
01:14:03 | FromGitter | <Varriount> ldlework: I think that's for you to judge. |
01:14:12 | ldlework | lol what |
01:14:35 | ldlework | I'm quite literally asking if they have objectively consequential differences |
01:14:50 | FromGitter | <Varriount> Well, compared to what? |
01:15:00 | ldlework | interfaces! |
01:15:03 | FromGitter | <Varriount> There are multiple ways to make interfaces |
01:15:18 | ldlework | golang-like or C#-like interfaces |
01:15:19 | FromGitter | <Varriount> Look at the streams module - that uses members of procedures |
01:15:43 | ldlework | Sure that's what I mean |
01:15:43 | FromGitter | <Varriount> There's also the new vtref stuff, though I don't know if that's implemented yet. |
01:16:04 | ldlework | I'm kind of asking, isn't method-dispatch basically the same thing as interfaces? |
01:16:21 | ldlework | Or in other words, if not what really functionally distinguishes them? |
01:16:34 | ldlework | I can cede that it might be a tough question. |
01:16:52 | ldlework | (or that I'm deeply confused) |
01:17:10 | FromGitter | <Varriount> Well, an interface asserts that an object fulfills some sort of functionality. |
01:17:27 | FromGitter | <Varriount> (object in the general, abstract sense) |
01:17:30 | ldlework | ah so inheriting a type doesn't enforce that you overrode all its methods |
01:17:32 | ldlework | I see. |
01:17:45 | FromGitter | <Varriount> generally, objects can fulfill multiple interfaces (see java) |
01:17:53 | ldlework | That's pretty much where abstract classes and abstract methods come in right? |
01:17:58 | ldlework | Ah right. |
01:18:05 | ldlework | OK getting more clear now |
01:18:11 | FromGitter | <Varriount> And fulfilling an interface doesn't necessarily imply inheriting from it. |
01:18:26 | ldlework | My brain was getting mushy from all the enterprisy .NET stuff I've been reading |
01:18:41 | ldlework | everything you just observed makes perfect sense |
01:18:49 | ldlework | especially the ability to implement multiple interfaces |
01:20:06 | ldlework | So even if you had abstract classes/methods interfaces would still be distinct that way |
01:21:25 | ldlework | I can't yet whether I would really need my types to be valid for multiple interfaces |
01:21:42 | ldlework | So I'm slightly inclined to say I wish we had such abstract types/methods in Nim |
01:22:06 | ldlework | But I leave open the possiblity that wanting the same type to work in different situations is probably useful |
01:22:19 | ldlework | And that leaves me wishing that interface library was a bit more mature |
01:22:37 | ldlework | And this all leaves me worried that one day I might like golang |
01:23:10 | ldlework | Though having -only- interfaces is annoying. |
01:24:11 | FromGitter | <Varriount> As far as I'm concerned, abstract classes are a language-specific feature designed to overcome single-inheritance limitations |
01:25:17 | ldlework | I mean didn't we just discover at least one other utility? |
01:26:17 | ldlework | Ensuring that types passed to polymorphic implementations have supplied their own complete implementations of the expected baseclass "interface" |
01:26:26 | ldlework | I think this is called the Template Pattern |
01:27:11 | ldlework | Like abstract classes get you from raising an exception in unimplemented base class method saying "Override me!" |
01:27:14 | ldlework | to compile time errors |
01:27:28 | ldlework | Varriount, agree? |
01:27:52 | FromGitter | <Varriount> I guess. |
01:28:17 | FromGitter | <Varriount> Sorry, I'm trying to participate in discussion, write code, and cook dinner at the same time. |
01:28:30 | ldlework | heh seems like you're doing fine to me |
01:39:10 | ldlework | Araq: would there ever be hope for abstract methods in Nim? |
01:39:23 | ldlework | Simple compiler mechanism to force sub-types to implement a method of the base one? |
01:40:05 | * | brson quit (Quit: leaving) |
01:45:03 | ldlework | ah I see the previous discussion :( |
01:46:05 | ldlework | https://github.com/nim-lang/Nim/issues/463 |
01:58:49 | * | chemist69 quit (Ping timeout: 240 seconds) |
02:04:31 | FromGitter | <Varriount> ldlework: Araq doesn't have a high opinion of heavy abstractions |
02:05:11 | FromGitter | <Varriount> ldlework: I believe abstract classes clould be implemented with concepts and generics though. |
02:07:00 | ldlework | Varriount, that's no good because you can't keep a list of arbitrary types that satisfy a concept |
02:07:54 | ldlework | proc Add[T](self: Foo, obj: T): self.objs.add(obj) |
02:07:56 | ldlework | will never work |
02:08:15 | ldlework | proc Add(self: Foo, obj: SomeBase): self.objs.add(obj) |
02:08:17 | ldlework | works fine |
02:08:50 | FromGitter | <Varriount> I mean, use a generic procedure to create the non-abstract portions of an abstract class |
02:09:14 | ldlework | dunno what you mean |
02:10:32 | * | mwbrown joined #nim |
02:11:02 | ldlework | Varriount, imagine an object that takes a Strategy. this object is implemented in a library |
02:11:06 | ldlework | how do you implement it with generics? |
02:11:28 | ldlework | OK find `strategy: T` |
02:11:34 | ldlework | but what about a list of differing strategies? |
02:11:56 | ldlework | Or like a State in a StateMachine |
02:13:05 | * | chemist69 joined #nim |
02:14:16 | FromGitter | <Varriount> Make strategy a concept? |
02:15:06 | ldlework | that doesn't help you store a list of them |
02:15:36 | ldlework | (you must still be cooking ;) |
02:16:19 | FromGitter | <Varriount> Cleaning up, yeah. |
02:16:31 | ldlework | Replying with your toes, etc |
02:16:37 | ldlework | I can see it now |
02:16:41 | FromGitter | <Varriount> Well, the vtref feature should help store concepts |
02:17:03 | ldlework | Can you introduce me to this idea? You have mentioned it a few times in the last week but I've ignored it. |
02:36:06 | ldlework | nothing in the issues list |
02:42:09 | FromGitter | <vegansk> @ldlework, https://github.com/nim-lang/Nim/blob/c11d7c35dd0dbe54cef108988955c48f4e1fab48/doc/manual/generics.txt#L577 |
02:44:40 | ldlework | vegansk is this available today |
02:46:53 | ldlework | the syntax looks a bit funky |
02:49:41 | ldlework | its too bad there is no pragma-macro syntax for tyeps |
02:49:43 | ldlework | types |
02:56:02 | FromGitter | <Varriount> ldlework: There isn't? |
02:57:32 | ldlework | FromGitter: not matching "vtref" |
02:57:33 | FromGitter | ldlework, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
02:58:53 | ldlework | Varriount is this feature hypothetical? |
02:58:59 | ldlework | It sounds like exactly what I want |
03:02:50 | FromGitter | <Varriount> ldlework: It's in the development version of the manual. Whether it's actually been implemented, I don't know. |
03:05:54 | ldlework | "most popular c# ecs" first result is entitas ECS |
03:05:59 | ldlework | I've been reading about it... |
03:06:08 | ldlework | they have this code generation system |
03:06:14 | ldlework | so that the end API is super clean... |
03:06:28 | ldlework | ...it seems SUPER FAMILILAR |
03:08:52 | FromGitter | <Varriount> ldlework: Familiar to a certain language that we all know and love? |
03:10:23 | ldlework | Varriount, Dadren's ECS literally does this |
03:10:37 | ldlework | you call aggregate(Entity, [C1, C2, C3...]) |
03:10:46 | ldlework | and boom you get all the classes and method and so on |
03:11:15 | FromGitter | <Varriount> ldlework: Convergent design, or did they see dadren and like the concepts there? |
03:11:22 | ldlework | I wont lie that I feel a little proud that I converged on a similar approach to the #1 google result |
03:11:27 | ldlework | Varriount, the former I'm sure |
03:12:07 | libman | Did Nim have UFCS before D? Was Nim the first? |
03:12:21 | ldlework | Varriount, Nim is better in that it has macros and you don't need generation |
03:12:36 | FromGitter | <Varriount> Nim has had UFCS since the beginning. When did D get them? |
03:12:43 | ldlework | Varriount, however I was wondering, could Nim ever support IDE integration that could complete the results of macro expansion? |
03:13:02 | FromGitter | <Varriount> ldlework: You mean, run a macro in the editor and paste the results in? |
03:13:20 | ldlework | Varriount, no I mean get completion and so on for generated types and procs |
03:14:15 | ldlework | that would make Dadren way more useful |
03:14:25 | ldlework | I should also get Dadren away from using tables |
03:15:29 | ldlework | Oh a thing I wonder if Entitas has is JSON support :D |
03:17:40 | ldlework | They have some really nice features though I can see why its popular |
03:20:04 | ldlework | Interesting their components are immutable. So you have to replace a component in order to change it. |
03:20:15 | ldlework | This allows them have reactive caching and event propoagation |
03:20:17 | ldlework | Very cool |
03:23:00 | libman | Varriount: Can't quite figure out, but probably 2012 - http://forum.dlang.org/thread/[email protected] |
03:27:06 | libman | Non-specific use of the phrase "uniform function call syntax" appears in a BS paper from 2003 - http://www.stroustrup.com/N1522-concept-criteria.pdf |
03:29:34 | libman | If Nim invented ideas that got picked up by other languages, we should write about that. Wikipedia would be a great place. |
03:32:45 | libman | Confirmed - http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394 |
03:33:15 | libman | ^ "New to version 2.059 of D [...]. It's been around in D since the beginning in a nascent form for arrays, but it's now available for all classes and structs. " |
03:37:30 | FromGitter | <Varriount> Nim probably didn't invent UFCS, but it has had it since the start |
03:37:44 | FromGitter | <Varriount> For everything |
03:41:40 | libman | That version of Dlang was 2012 (dlang.org/changelog/2.059.html), but the suggestion was around since before 2009 / "the first D conference" (issues.dlang.org/show_bug.cgi?id=3382)... |
03:47:54 | FromGitter | <Varriount> Nimwas first started in 2008 |
04:00:56 | * | chemist69 quit (Ping timeout: 255 seconds) |
04:01:18 | ldlework | Is there a way to run multiple commands with config.nims |
04:01:50 | ldlework | like if I wanted to compile and run several things |
04:03:54 | libman | Surprises keep on coming on both sides. "The first D conference was actually held in 2007!" "Pascal version of Nim started in 2005!" "Walter Bright is a killer robot sent from the future!" ... |
04:05:45 | libman | ... "This universe is a simulation written in Nim 13.8 billion years ago!" "The operating system running the simulation was written in Dlang 13.801 billion years ago!" |
04:08:21 | ldlework | I wonder if I will ever understand the contents of this module again, https://github.com/dustinlacewell/dadren/blob/master/dadren/meta.nim |
04:18:46 | * | devted quit (Quit: Sleeping.) |
04:21:14 | ldlework | For small data types like points and sizes and rects and vectors and stuff |
04:21:23 | ldlework | Is there any argument for tuples over objects? |
04:21:27 | ldlework | Or vice versa? |
04:21:31 | ldlework | I'm really confused about this choice |
04:21:57 | ldlework | Varriount can you help me think about it |
04:23:53 | * | devted joined #nim |
04:24:31 | * | devted quit (Client Quit) |
04:26:54 | ldlework | I guess using object types ensures that you never pass a Size as a Point |
04:28:00 | * | chemist69 joined #nim |
04:32:40 | ldlework | ah cool! https://github.com/oderwat/nim-screeps |
04:34:52 | FromGitter | <Varriount> ldlework: Tuples can't be inherited from |
04:35:09 | FromGitter | <Varriount> It's much harder to "customize" them |
04:35:24 | ldlework | Varriount but usually you don't need to do that for basic data types like points and rects |
04:35:51 | ldlework | but I think the fact that they can't be used interchangably is the reason I'll go with objects |
04:36:24 | FromGitter | <Varriount> Tuples are good for returning multiple values, and for ad-hoc data structures. |
04:37:33 | ldlework | dang it doesn't seem like nims will allow you to actually run a command multiple times |
04:56:12 | ldlework | Error: parallel 'fields' iterator does not work for 'case' objects |
04:56:15 | ldlework | whatever that means |
04:59:45 | * | gangstacat quit (Ping timeout: 252 seconds) |
05:14:51 | * | gangstacat joined #nim |
05:19:08 | * | shashlick quit (Ping timeout: 240 seconds) |
05:20:24 | * | shashlick joined #nim |
05:33:43 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:36:41 | ldlework | hmm Error: request to generate code for .compileTime proc: newIdentifier |
05:57:59 | ldlework | how do you unit test macros |
05:58:12 | ldlework | I guess call them and then test the result |
06:00:56 | * | enthus1a1t joined #nim |
06:04:06 | * | enthus1ast quit (Ping timeout: 260 seconds) |
06:08:15 | ldlework | Hmm I can't seem to unittest compile-time procs |
06:08:23 | ldlework | Araq: halp |
06:10:28 | ldlework | Varriount any idea? |
06:20:37 | * | Vladar joined #nim |
06:27:49 | * | yglukhov joined #nim |
06:33:57 | * | rokups joined #nim |
06:35:17 | * | nsf joined #nim |
06:36:34 | * | yglukhov quit (Remote host closed the connection) |
06:47:18 | * | bozaloshtsh quit (Ping timeout: 260 seconds) |
06:56:15 | * | dexterk_ENKCJ joined #nim |
06:56:15 | * | dexterk quit (Disconnected by services) |
06:56:16 | * | dexterk_ENKCJ is now known as dexterk |
07:12:55 | ldlework | I just thought of something that would be pretty useful; some form of template that actually returned AST |
07:33:05 | FromGitter | <gour> @dom96 morning. any news when your book might be printed? |
07:38:51 | * | gokr joined #nim |
07:44:35 | FromGitter | <dom96> @gour hopefully by the end of the month, but I can't guarantee that :) |
07:45:16 | FromGitter | <dom96> It's mostly in Manning's hands so it's really up to them. |
07:46:21 | * | yglukhov joined #nim |
07:46:21 | * | yglukhov quit (Remote host closed the connection) |
07:46:36 | * | yglukhov joined #nim |
07:51:05 | * | libman quit (Quit: Connection closed for inactivity) |
07:55:09 | * | couven92 joined #nim |
08:07:40 | FromGitter | <gour> @dom96 ok. thank you |
08:11:26 | * | ftsf quit (Quit: :q!) |
08:16:23 | * | willprice joined #nim |
08:21:42 | ldlework | zachcarter: you around? |
08:28:45 | * | couven92 quit (Read error: Connection reset by peer) |
08:29:07 | * | couven92 joined #nim |
08:30:24 | FromGitter | <gour> btw, is there any ETA for Nim's 1.0 release? |
08:36:00 | FromGitter | <Varriount> @gour No |
08:36:46 | * | couven92 quit (Ping timeout: 268 seconds) |
08:50:48 | ldlework | Varriount, I've decided to "port" Entitas to Nim |
08:52:46 | FromGitter | <Varriount> ldlework: Neat! |
08:54:03 | ldlework | Its a very interesting system |
08:54:51 | * | bjz joined #nim |
08:54:54 | ldlework | I also convinced the lady-friend to let me afford Dependency Injection in .NET |
08:58:59 | * | couven92 joined #nim |
09:10:34 | * | couven92 quit (Ping timeout: 245 seconds) |
09:17:30 | * | Arrrr joined #nim |
09:17:30 | * | Arrrr quit (Changing host) |
09:17:30 | * | Arrrr joined #nim |
09:31:56 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:34:40 | * | bjz joined #nim |
09:34:51 | * | couven92 joined #nim |
09:39:33 | FromGitter | <Varriount> :3 |
09:48:19 | * | couven92 quit (Quit: Bye) |
09:52:34 | ldlework | Varriount, do you bite your thumb at me, sir? |
09:54:18 | * | Sembei joined #nim |
10:35:15 | * | zahary quit (Quit: Connection closed for inactivity) |
10:39:29 | zachcarter | Idlework: sorry am now |
10:53:39 | FromGitter | <Varriount> ldlework: I'd much rather but a book describing internals of an operating system or machine |
10:55:32 | * | Tiberium joined #nim |
10:55:33 | zachcarter | Varriount: how about this weather :P |
10:55:38 | zachcarter | makes going into the office difficult |
10:56:19 | FromGitter | <Varriount> Hm? It's foggy here |
10:56:37 | zachcarter | oh I just meant how it’s so nice in the day time |
10:56:46 | zachcarter | at least it was yesterday |
10:57:01 | FromGitter | <Varriount> Ah, yes. |
10:57:11 | FromGitter | <Varriount> My dogs keep sunbathing outside |
10:57:19 | zachcarter | I take mine to doggy day care :P |
10:57:58 | zachcarter | I’m sure if he’s allowed to sunbathe outside there he’s doing it too haha |
10:58:08 | zachcarter | what kind of dogs? |
10:58:37 | FromGitter | <Varriount> Small, furry ones. Havenese |
10:58:58 | FromGitter | <Varriount> Very affectionate, but not all that bright |
10:59:34 | zachcarter | had to google, I recognize the breed though, cute |
11:00:34 | zachcarter | I made a lot of progress on my ship map generator |
11:01:05 | FromGitter | <Varriount> ? |
11:01:05 | zachcarter | but I’m trying to optimize a section of code atm that was taking 12 seconds to run on a 512x512 map |
11:01:24 | zachcarter | not having much success |
11:02:21 | * | Snircle joined #nim |
11:02:53 | * | arnetheduck joined #nim |
11:04:59 | zachcarter | Varriount: what’s the ? for? |
11:05:06 | zachcarter | I told you about the map generator previously didn’t I? |
11:06:17 | Arrrr | why does it take so much time to run? what is it doing? |
11:06:36 | zachcarter | I think I can substitute it with a BFS |
11:06:45 | zachcarter | it was trimming non contiguous regions of my map |
11:07:14 | zachcarter | it was iterating over all 256k cells |
11:07:38 | Arrrr | I see, why does it need to do that? |
11:07:39 | zachcarter | and each iteration then looping over 2^18 cells |
11:07:50 | zachcarter | basically it moves through the map |
11:08:04 | zachcarter | and checks each cells neighbors to see if they have a certain type of tile occupying the cell |
11:08:19 | zachcarter | here I have a gist of the code |
11:08:35 | zachcarter | https://gist.github.com/zacharycarter/9660046cfc250abf589d2647ec00c91b#file-trim_non_contiguous-nim-L7-L20 |
11:08:37 | zachcarter | this is the inefficient part |
11:08:45 | zachcarter | which I think I can replace with a BFS implementation |
11:09:07 | zachcarter | I mean it just looks inefficient lol - a while loop with a 2d for loop inside |
11:10:28 | Arrrr | But what's the point, what is 'part of ship' doing? |
11:11:01 | zachcarter | so part of ship is an array of bools |
11:11:11 | zachcarter | basically saying - yes this tile is a part of the ship or no it’s not |
11:11:21 | zachcarter | isPartOfShip does 2 things |
11:11:33 | zachcarter | 1) it checks to make sure the x, y value is actually in the range of th emap |
11:12:08 | zachcarter | since I’m iterating over the map, and checking x + 1 and y + 1 etc, I will eventually encounter border cells and extend beyond the bounds of the map |
11:12:28 | zachcarter | 2) It checks the partOfShip array to see if the cell has already been marked as being part of the ship or not |
11:12:52 | zachcarter | the point of the function is to fill out the partOfShip array with tiles that are marked as ShipInternals |
11:13:05 | zachcarter | any other tile should be set to false in the partOfShip array |
11:13:22 | zachcarter | I hope that makes sense |
11:13:30 | Arrrr | So, if i understand correctly, it is a way to check which tiles in the ship overlaps with map tiles |
11:13:45 | zachcarter | kind of the map is essentially a procedurally generated ship |
11:13:49 | zachcarter | floating in space |
11:13:53 | zachcarter | space ship* |
11:14:01 | Arrrr | Ah, like FTL |
11:14:07 | zachcarter | sort of |
11:14:18 | zachcarter | but yeah think of FTL’s in game screen with the ship view |
11:14:48 | zachcarter | so when I’m procedurally generating the map I’m just trying to determine what cells on the map are ship cells and which aren't |
11:15:09 | zachcarter | I initialize the array isPartOfShip all to false, so everything is considered non-part of ship to start |
11:15:14 | zachcarter | this function rectifies that |
11:15:29 | Sentreen | Is there are any particular reason that the nim website is a part of the `nim` repo, instead of being a standalone repo under `nim-lang`? |
11:15:57 | zachcarter | Sentreen: The nim website is in the processing of being rewritten, I believe the new website is a standalone repo |
11:17:02 | zachcarter | as to the existing one - I have no idea |
11:17:03 | * | couven92 joined #nim |
11:17:21 | zachcarter | Arrrr: I’ve built this in Java previously |
11:17:25 | zachcarter | if you’d like to see the results : |
11:17:39 | Arrrr | Ah ok, show us |
11:17:59 | zachcarter | https://pbs.twimg.com/media/CwypuCgWgAAhHsk.png |
11:18:13 | zachcarter | I also generate lock and key puzzles |
11:18:15 | zachcarter | for the maps |
11:19:00 | zachcarter | https://pbs.twimg.com/media/ChfPq0PWkAIFFbq.png |
11:19:16 | zachcarter | second one was a very early SS |
11:19:34 | zachcarter | https://pbs.twimg.com/media/CyEKGR5VQAI1hcM.png |
11:21:10 | Arrrr | That's interesting, and how do you determine which cells are part or not of the ship? |
11:21:18 | * | Tiberium quit (Remote host closed the connection) |
11:21:33 | * | Tiberium joined #nim |
11:21:53 | zachcarter | well to start all the cells are turned off - so non ship |
11:22:11 | zachcarter | I start by generating what I refer to as a ship blueprint and I do this with cellular automata |
11:22:32 | zachcarter | that produces an image like : https://camo.githubusercontent.com/9b3d61b7553eb3f746e0f63976a2cce89fb6c2e1/687474703a2f2f692e696d6775722e636f6d2f34513370596c782e706e67 |
11:22:52 | zachcarter | or something similar, depending on the seed used |
11:23:08 | zachcarter | the point is it represents the shape of a (very organic) looking spaceship |
11:23:38 | zachcarter | I can then sample the pixels of this image and figure out where the border of the ship is |
11:24:46 | zachcarter | IE anything black represents space, anything white is part of the ships border |
11:24:58 | Arrrr | I see, so you have to mark the cells that belongs to the ship but you only know the border |
11:25:04 | zachcarter | then it is just a matter of trimming the non contiguous regions |
11:25:11 | zachcarter | pretty much |
11:25:52 | Arrrr | I would do this: For each row, if i encounter a white border, fill the rest with white until i find again a white border, and so on |
11:26:03 | Arrrr | Then just iterate throught the image and set the map |
11:29:07 | zachcarter | yeah I’m trying to figure out why my current code is more complex than that because that would be the logical / naive way to do it I think |
11:29:13 | zachcarter | there must be some other complication I’m not explaining |
11:29:42 | zachcarter | I haven’t looked at this code since November though and my memory isn’t the greatest |
11:31:58 | Arrrr | lots of mispredictions |
11:32:40 | zachcarter | it’s definitely complex code |
11:32:46 | zachcarter | in terms of what it’s doing |
11:33:08 | Arrrr | how does it take with -d:release? |
11:33:13 | Arrrr | *how much |
11:33:17 | zachcarter | good question |
11:34:24 | zachcarter | hrm with -d:release it fails to run / compile not sure why |
11:35:43 | Arrrr | Sometimes it is because some code runs inside `assert` which is not even compiled in release |
11:36:39 | zachcarter | that may be it |
11:49:44 | zachcarter | http://imgur.com/a/OVg0s |
11:49:53 | zachcarter | anything smaller than that is significantly faster |
11:50:17 | zachcarter | but at least it’s working ish :P |
11:50:19 | Tiberium | zachcarter, try with lto :D |
11:50:35 | Tiberium | I doubt it can help, but ~maybe~ some speed |
11:50:43 | zachcarter | Tiberium: there’s a horrible inefficiency in my code atm |
11:50:45 | zachcarter | I need to address |
11:51:02 | Tiberium | there was a nim-benchmark library somewhere |
11:51:10 | zachcarter | room layout looks good |
11:51:59 | zachcarter | Tiberium the one proc I’m referring to with the bad code in it took 16s to execute alone :P |
11:52:00 | Tiberium | zachcarter, https://github.com/ivankoster/nimbench this can help you maybe |
11:52:06 | Tiberium | zachcarter, ah :) |
11:52:27 | zachcarter | it’s a while loop with a nested for loop in it for iterating over a 2d array |
11:52:34 | zachcarter | with a 512x512 map it crawls |
11:54:37 | zachcarter | oh btw, I’m building a rougelike library so if anyone has any requests for map generators / algos / data structures let me know |
11:54:41 | zachcarter | and I will implement them |
11:55:06 | zachcarter | at the very least I’ll be doing spaceship map gen and world map gen |
11:55:19 | zachcarter | but I doubt there’s much of a clamor for the spaceship map gen :P |
12:08:03 | * | krux02 joined #nim |
12:27:33 | * | chemist69 quit (Ping timeout: 255 seconds) |
12:30:13 | * | chemist69 joined #nim |
12:45:28 | demi- | dom96: are there any long-term plans for how to handle the nimble package index? |
12:48:36 | * | zachcarter quit (Quit: zachcarter) |
12:56:24 | Tiberium | honestly I would like some official Nimble website like npmjs/pypi/crates.io |
12:58:19 | FromGitter | <Varriount> Is there a ".le" site suffix? |
12:59:50 | Tiberium | no it seems |
12:59:51 | euantor | Tiberium: That is coming. See https://nimble.directory/ |
13:00:00 | * | yglukhov quit (Read error: Connection reset by peer) |
13:00:00 | euantor | It's a work in progress from federico3 |
13:00:17 | euantor | https://github.com/FedericoCeratto/nim-package-directory |
13:00:25 | Tiberium | also nimble.com is taken |
13:00:34 | * | yglukhov joined #nim |
13:01:01 | euantor | Eventually the plan is that packages won't be stored in a large JSON file, but instead in a database accessed via a web service (though the lsit will be locally cached as a JSON file like it is now) |
13:01:07 | FromGitter | <Varriount> zachcarter: I mentioned this before, so you may have read it already, but a dungeon that's on a ship should have things like engine rooms, medical bays, crew quarters, etc. |
13:01:50 | FromGitter | <Varriount> Engines would be near the back of the ship, control rooms in the center, crew quarters to the sides, etc |
13:02:06 | Tiberium | nimble.cc :D |
13:02:21 | federico3 | Tiberium: feel free to ping me if you have questions or feature requests |
13:06:11 | demi- | euantor: is there any reason to keep it as json, that doesn't seem like it will scale very well |
13:09:59 | gokr | Well, given the size of the current json file - some quick math seems to indicate that it will be around 3Mb when we hit 10000 packages. I wouldn't worry just yet :) |
13:10:11 | euantor | None really, except readability. The web API will handle searching for packages and such. The local cache would be used should the package directory be offline |
13:11:03 | * | Tiberium quit (Remote host closed the connection) |
13:11:41 | * | dmi0 joined #nim |
13:15:46 | krux02 | euantor: do package installations from github repositories still work, when the package directory is offline? |
13:16:36 | demi- | krux02: i don't see why they wouldn't if you have the repo path cached locally |
13:16:42 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
13:16:58 | * | zachcarter joined #nim |
13:17:27 | krux02 | ok that's fair |
13:17:59 | krux02 | and by the way, I would not worry to search through a 3Mb file of json |
13:18:23 | demi- | locally, no, but server-side i would |
13:18:28 | krux02 | as long as the json is not deserialized when parsed, it can be processed very quickly |
13:19:08 | krux02 | well I would go with the requirement |
13:19:21 | krux02 | I don't see a massive boom of popularity all of a sudden with Nim |
13:19:39 | krux02 | programming languages don't haved this explosive popularity |
13:19:46 | krux02 | so when needed, keep improving |
13:20:05 | krux02 | and keep things nice for a small community |
13:22:17 | krux02 | Araq: how do I not break compiler bootstrapping, when I add magics to the compiler? |
13:28:53 | euantor | And yes, installations from GiHub would still work |
13:29:27 | euantor | Nimble would only hit the API to find out what packages are available and where to get them from. It would still contact GitHub/Bitbucket/whatever to do the actual download |
13:30:06 | euantor | (ideally I'd like to see it support other types of version control like mercurial too, but that's up to dom96 since he'll likely write the code to handle msot of this :P) |
13:31:31 | demi- | that shouldn't be too difficult if we aren't using git specific code |
13:33:12 | euantor | If I remember correctly it currently shells out to the git exe |
13:35:02 | demi- | well i would expect it to do that regardless the vcs |
13:35:25 | euantor | Yeah, that's what makes it easy to handle other Git providers and other VCS |
13:42:26 | * | yglukhov quit (Remote host closed the connection) |
13:44:11 | demi- | ca |
13:45:59 | * | gokr quit (Quit: Leaving.) |
13:50:01 | * | yglukhov joined #nim |
13:50:33 | krux02 | I am writing on the compiler and I have the error message: expression '8' has no type (or is ambiguous) |
13:50:40 | * | yglukhov quit (Read error: Connection reset by peer) |
13:51:10 | * | yglukhov joined #nim |
13:52:13 | krux02 | in proc magicsAfterOverloadResolution I addad created a handling of mSizeOf |
13:53:32 | krux02 | I returned my result in form of an integer literal: result = newIntNode(nkIntLit, n.typ.getSize) |
13:53:50 | krux02 | but that is how I get the error message. |
14:01:09 | * | dmi0 quit (Ping timeout: 255 seconds) |
14:02:06 | * | couven92 quit (Quit: Disconnecting) |
14:02:32 | * | couven92 joined #nim |
14:26:02 | * | rauss joined #nim |
14:29:47 | * | devted joined #nim |
14:41:04 | * | Snircle joined #nim |
14:42:20 | krux02 | well, implementing a magic seems harder than I thought |
14:46:19 | * | libman joined #nim |
14:47:51 | zachcarter | sweet! got my bfs working |
14:47:59 | zachcarter | 12 seconds to 0.5556449999999999 |
14:48:00 | zachcarter | :P |
14:56:55 | Araq | krux02: [Warning] unkown magic 'foo' might crash the compiler |
14:57:07 | Araq | in other words, it just works (tm) |
15:00:43 | krux02 | Araq: I have a new question, I just posted all information on the forum: https://forum.nim-lang.org/t/2905/1#18245 |
15:01:54 | krux02 | zachcarter: bfs? |
15:01:58 | Araq | result = newIntNode(nkIntLit, align) |
15:01:58 | Araq | result.info = n.info |
15:02:10 | zachcarter | breadth first search |
15:02:13 | Araq | result.typ = n.typ |
15:02:19 | Araq | ^ that's missing from your code |
15:02:32 | Araq | apart from that it seems perfectly fine |
15:02:35 | krux02 | ok |
15:02:38 | krux02 | thanks |
15:03:40 | Araq | you can also do defineSymbol "nimhasalignof" |
15:03:46 | Araq | when defined(nimhasalignof): |
15:03:55 | Araq | proc alignOf ... # in system.nim |
15:04:10 | Araq | and then no warnings are produced in the bootstrapping process |
15:04:27 | Araq | condsyms.nim is full of these already ;-) |
15:04:45 | Araq | if you know why it works this way, you have understood bootstrapping. |
15:05:00 | krux02 | Araq: thanks a lot, now it works as I expected |
15:05:51 | krux02 | where should i put the defineSymbol? |
15:06:31 | krux02 | well I know why I should use it, because I already once broke boottrapping |
15:07:12 | Araq | condsyms.nim? |
15:07:29 | Araq | or whereever the other nim* symbols are defined |
15:08:45 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:11:16 | krux02 | well I think at one point, when the bootstrapping C code knows the symbols, those when defined branches can be removed. |
15:11:32 | krux02 | But thank you, I now put the when defined in system.nim |
15:20:04 | Araq | I wouldn't have done it :-) |
15:20:30 | Araq | should work without and the code is less messy, but I will accept either way |
15:21:43 | Araq | Conversion error: Jekyll::Converters::Scss encountered an error while converting 'jekyll_prototype/assets/css/main.scss': |
15:21:43 | Araq | File to import not found or unreadable: variables. on line 1 |
15:21:43 | Araq | jekyll 3.4.3 | Error: File to import not found or unreadable: variables. on line 1 |
15:23:41 | euantor | is that for the new website? |
15:24:19 | Araq | yup |
15:24:23 | Araq | cannot build it |
15:24:39 | Araq | even though I'm on Ruby's chosen OS (TM) |
15:25:26 | euantor | I don't even know how Jekyll works out the path to look for variables.scss |
15:25:55 | euantor | _variables.scss is at ../../_sass/_variables.scss but I can't see anywhere where it configures that path |
15:27:13 | * | Matthias247 joined #nim |
15:31:31 | euantor | Ah, looks like that's pre-defined in Jekyll, seems strange |
15:36:54 | FromGitter | <Bennyelg> No 'nim' binary could be found in PATH: |
15:37:03 | FromGitter | <Bennyelg> any help with VS code configuration ? |
15:37:17 | Araq | have a nim binary in PATH? |
15:38:06 | FromGitter | <Varriount> @Bennyelg Do you know what the PATH variable is? |
15:38:29 | FromGitter | <Bennyelg> My bad I Had /usr/local/bin/nim :D instead of /usr/local/bin |
15:39:18 | FromGitter | <Bennyelg> nah still not working :/ |
15:39:30 | euantor | I forgot how much of a pain Ruby is |
15:39:48 | euantor | Just did a fresh install on my Windows machine, and their package manager didn't work out of the box |
15:39:51 | FromGitter | <Varriount> Every language has its pain points |
15:39:55 | euantor | Turns out I have to follow this: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages |
15:40:17 | * | Trustable joined #nim |
15:41:18 | * | brson joined #nim |
15:42:47 | * | bjz joined #nim |
15:46:10 | * | willprice quit (Remote host closed the connection) |
15:47:09 | Araq | bennyelg: you need to restart vs code so that it gets the environment changes |
15:47:39 | FromGitter | <Bennyelg> I did, But it not changed the PATH :D |
15:47:56 | euantor | Araq: When building the jekyll site, are you in the `jekyll_prototype` directory? |
15:48:22 | euantor | I got the same error if I did it from the `website/` root but running `jekyll serve` from `website/jekyll_prototype` works |
15:49:25 | Araq | ah ok, thanks |
15:49:59 | FromGitter | <Bennyelg> Anyone can managed to GO- TO DIFINITION with ATOM or vs code?~ |
15:50:01 | libman | Speaking of Ruby, WTF is up with https://github.com/nim-lang/website |
15:50:01 | FromGitter | <Bennyelg> :( |
15:50:54 | libman | When I saw that, I abandoned my download section revamp draft (for binary packages). |
15:51:06 | demi- | dom96: i'm seeing a new problem as of the last couple of days, my jester instance seems to die unexpectedly and i don't think it is from memory usage? |
15:52:19 | euantor | libman: What do you mean "WTF is up" with it? |
15:52:44 | libman | Why we no eat our own dogfood? |
15:53:33 | FromGitter | <Bennyelg> Anyonee? |
15:54:19 | euantor | Because using an existing tool in this case is much much faster |
15:54:36 | libman | Bennyelg: F12 in vscode? |
15:55:04 | euantor | Using your own tools makes sense, but reinventing the weel because of NIH syndrome is a waste of effort |
15:55:22 | libman | bah, humbug. I'm not touching that Ruby foo. It would give me cooties. |
15:55:53 | libman | NIH syndrome is how we get good coherent design without dependency bloat. |
15:56:41 | euantor | It's also how we waste time when people are already busy as is |
16:01:41 | dom96 | demi-: stack trace? |
16:02:35 | demi- | don't have one, else i'd be debugging that |
16:02:55 | demi- | i switched back to regular GC, because it was a bit better over a longer period of time |
16:03:51 | * | gokr joined #nim |
16:06:06 | FromGitter | <Bennyelg> Any site for exercise coding nim? |
16:06:13 | FromGitter | <TiberiumPY> sadly no :( |
16:07:29 | FromGitter | <TiberiumPY> https://www.codingame.com/start ⏎ they emailed to dom96, he answered, and they haven't answered back |
16:08:06 | FromGitter | <TiberiumPY> and probably they will use release compiler, not devel one |
16:08:07 | FromGitter | <Bennyelg> :/ |
16:09:40 | dom96 | yeah, maybe I should email them again |
16:11:12 | dom96 | done |
16:11:53 | FromGitter | <Bennyelg> could not get nimSuggest in path? |
16:12:43 | * | vivus joined #nim |
16:13:07 | FromGitter | <TiberiumPY> you know you can win any programming olympiad (even if it has very serious time/memory limits for running code) using Nim |
16:13:21 | FromGitter | <TiberiumPY> but you can't choose Nim :( |
16:13:34 | * | zachcarter quit (Quit: zachcarter) |
16:14:46 | * | zachcarter joined #nim |
16:16:04 | zachcarter | http://www.exercism.io/languages/nim/launch |
16:16:17 | zachcarter | FYI! |
16:16:38 | FromGitter | <TiberiumPY> https://github.com/exercism/xnim/issues/13 |
16:17:33 | dom96 | yeah, that would be nice. |
16:17:49 | dom96 | Please help out with this if you've got time :) |
16:17:50 | FromGitter | <TiberiumPY> wow!!! |
16:17:52 | FromGitter | <TiberiumPY> someone is doing work |
16:17:53 | FromGitter | <TiberiumPY> https://github.com/Codewars/codewars-runner-cli/pull/330 |
16:18:41 | dom96 | cool |
16:18:48 | krux02 | Now when I try to call offsetOf(MyType, member) the nim compiler complains about member to be unknown, even though in the types system I declared the second argument as ``untyped`` |
16:19:46 | krux02 | dom96: maybe you know it, I implement a procedure in the compiler |
16:20:02 | krux02 | I have done the magics and the function is now called in the compiler |
16:20:08 | * | Sembei quit (Ping timeout: 240 seconds) |
16:20:12 | * | nsf quit (Quit: WeeChat 1.7) |
16:20:16 | dom96 | procedure's can't use 'untyped' |
16:21:18 | krux02 | well when I declare it as a macro, then the compiler complains like this: #debug typ |
16:21:28 | krux02 | Error: system module needs 'PNimrodNode' |
16:21:57 | dom96 | how is sizeof defined? |
16:22:19 | zachcarter | so weird just had a photographer taking a bunch of pictures at me at work |
16:22:29 | dom96 | Although I guess offsetof is more complicated |
16:22:39 | krux02 | well sizeof is not a problem, because it only has one argument, and that can easily be typechecked |
16:23:03 | dom96 | Why does it need to be implemented in the compiler? I recall a simple implementation as a template |
16:23:04 | krux02 | the problem is thet the typechecker can impossibly know about the member |
16:23:37 | krux02 | Well Araq explicitly suggested, that I should implement this in the compiler |
16:24:30 | krux02 | https://github.com/nim-lang/Nim/issues/5493 |
16:28:24 | krux02 | sorry I have to leave |
16:28:28 | * | krux02 quit (Remote host closed the connection) |
16:29:16 | FromGitter | <Bennyelg> how to run nim tests? |
16:29:17 | * | chemist69 quit (Ping timeout: 255 seconds) |
16:29:23 | * | Trustable quit (Remote host closed the connection) |
16:32:22 | * | cspar joined #nim |
16:33:55 | * | chemist69 joined #nim |
16:36:39 | FromGitter | <TiberiumPY> you're calling some proc |
16:36:42 | FromGitter | <TiberiumPY> it returns a string |
16:36:49 | FromGitter | <TiberiumPY> if you don't need it, do "discard foo()" |
16:37:01 | FromGitter | <Bennyelg> I need this string |
16:37:08 | FromGitter | <Bennyelg> I know it's returning string |
16:37:10 | FromGitter | <TiberiumPY> let data = foo() |
16:37:31 | FromGitter | <Bennyelg> Oh i got the idea, thanks |
16:40:14 | FromGitter | <Bennyelg> proc helloworld(name: string): string = ⏎ if name != "": ⏎ ⏎ ```return "Hello,", name, "!"``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=58ed06f0a0e4856242f43d4b] |
16:40:32 | FromGitter | <Bennyelg> invalid indentition |
16:40:38 | FromGitter | <TiberiumPY> two retunrs? |
16:40:42 | FromGitter | <TiberiumPY> ah |
16:40:46 | FromGitter | <Bennyelg> no |
16:40:48 | FromGitter | <Bennyelg> its 1 |
16:41:03 | FromGitter | <TiberiumPY> yep, my gitter client doesn't show indentation, will check it in browser |
16:41:41 | FromGitter | <TiberiumPY> wait |
16:41:54 | FromGitter | <TiberiumPY> you actually have no indentation in your code |
16:42:00 | FromGitter | <TiberiumPY> or you've pasted in like that? |
16:42:03 | FromGitter | <Bennyelg> I do have :/ |
16:42:06 | FromGitter | <TiberiumPY> use ``` |
16:42:30 | FromGitter | <TiberiumPY> `````` [https://gitter.im/nim-lang/Nim?at=58ed077968bee3091f313d27] |
16:42:36 | FromGitter | <TiberiumPY> ```this code ⏎ can be ⏎ indented``` [https://gitter.im/nim-lang/Nim?at=58ed077ebdf4acc1124ca0ad] |
16:42:50 | FromGitter | <TiberiumPY> simple markdown |
16:43:04 | FromGitter | <TiberiumPY> ah, maybe you use tabs? |
16:43:38 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58ed07bcf22385553d2f1ed0] |
16:44:50 | FromGitter | <TiberiumPY> well, you can't concat strings like that |
16:45:01 | FromGitter | <TiberiumPY> (you can only for echo) |
16:45:14 | FromGitter | <Bennyelg> so How I can concate strings ? |
16:45:21 | FromGitter | <TiberiumPY> using & |
16:45:22 | FromGitter | <Bennyelg> like name + name2 + name3 |
16:45:31 | FromGitter | <TiberiumPY> return "Hello, " & name & "!" |
16:45:38 | FromGitter | <Bennyelg> fantastic thanks. |
16:47:03 | FromGitter | <Bennyelg> great now if the compile version is in my path I can import it from another file? |
16:47:24 | FromGitter | <TiberiumPY> what? |
16:47:26 | mwbrown | Man that looks weird when everything is coming from the gitter bridge |
16:47:39 | FromGitter | <TiberiumPY> yeah :( code snippets are |
16:47:56 | FromGitter | <Bennyelg> I just created new file |
16:48:00 | FromGitter | <Bennyelg> and import helloworld |
16:48:05 | FromGitter | <Bennyelg> but I can reach it :| |
16:48:09 | FromGitter | <TiberiumPY> ah, you can, but you need to export your proc |
16:48:17 | FromGitter | <TiberiumPY> proc helloworld*(something): something = |
16:48:26 | FromGitter | <Bennyelg> thanks |
16:48:55 | FromGitter | <TiberiumPY> and you don't need to write "helloworld.helloworld" in another file |
16:48:59 | FromGitter | <TiberiumPY> just "helloworld()" |
16:49:04 | FromGitter | <TiberiumPY> well, you can do it |
16:50:01 | FromGitter | <TiberiumPY> yeah, it's hard to start for a few days (there's no as many articles as for python, for example) |
16:50:05 | FromGitter | <TiberiumPY> but after that it's easier |
16:53:32 | FromGitter | <Bennyelg> Great, thanks. I am just following the http://exercism.io/exercises/nim/ |
16:53:39 | FromGitter | <Bennyelg> nice Idea for practice |
16:54:00 | FromGitter | <TiberiumPY> ehm |
16:54:04 | FromGitter | <TiberiumPY> it shows 404 for me |
16:54:15 | FromGitter | <Bennyelg> http://exercism.io/ |
16:55:16 | FromGitter | <TiberiumPY> maybe you're following http://exercism.io/languages/nim/launch ? |
16:55:29 | FromGitter | <TiberiumPY> it really shows http://exercism.io/exercises/nim/ 404 for me |
16:55:48 | FromGitter | <TiberiumPY> ah |
16:55:52 | FromGitter | <TiberiumPY> I undestand now |
16:56:14 | FromGitter | <TiberiumPY> go to http://exercism.io/languages/nim/launch, and then choose "Available Exercises" on left |
16:59:24 | * | zachcarter quit (Quit: zachcarter) |
17:00:23 | * | zachcarter joined #nim |
17:04:06 | * | gokr quit (Ping timeout: 252 seconds) |
17:15:45 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
17:18:08 | * | brson quit (Ping timeout: 240 seconds) |
17:28:27 | * | brson joined #nim |
17:32:10 | FromGitter | <Bennyelg> Any nim repl ? |
17:32:17 | FromGitter | <Bennyelg> to test on the fly? |
17:33:07 | dom96 | There is but it's very unstable, best thing to do is have a temporary file that you recompile and run to test things |
17:41:25 | Arrrr | This is what you use for testing https://glot.io/new/nim |
17:41:33 | * | yglukhov quit (Remote host closed the connection) |
17:41:43 | Arrrr | However it is using 0.14 |
17:43:13 | * | krux02 joined #nim |
17:44:06 | * | kafke joined #nim |
17:45:38 | * | zachcarter quit (Ping timeout: 240 seconds) |
17:45:38 | * | gokr joined #nim |
17:47:08 | arnetheduck | does anyone understand the test failure in https://ci.appveyor.com/project/Araq/nim/build/748? I changed some code which is clearly not windows-related at all, and yet a windows test fails in an odd way |
17:48:31 | * | bozaloshtsh joined #nim |
17:48:32 | * | bozaloshtsh quit (Changing host) |
17:48:32 | * | bozaloshtsh joined #nim |
17:51:30 | FromGitter | <Bennyelg> isUpperAscii(message) not working |
17:53:54 | * | gokr quit (Ping timeout: 240 seconds) |
17:55:12 | * | gangstacat quit (Quit: Ĝis!) |
18:01:50 | FromGitter | <TiberiumPY> it does |
18:01:55 | FromGitter | <TiberiumPY> it doesn't work for unicode messages |
18:02:06 | FromGitter | <Bennyelg> well I dont see it working :/ for example |
18:02:12 | FromGitter | <Bennyelg> "HELLO" return false |
18:03:30 | FromGitter | <TiberiumPY> Arrrr: ideone uses 0.16.0 |
18:05:44 | FromGitter | <Bennyelg> I use 0.16.0 |
18:05:51 | FromGitter | <TiberiumPY> ah |
18:05:52 | FromGitter | <Bennyelg> never mind I wrote a proc |
18:05:54 | FromGitter | <TiberiumPY> always use latest |
18:06:05 | FromGitter | <Bennyelg> its not the latest? |
18:06:08 | FromGitter | <TiberiumPY> no |
18:06:11 | FromGitter | <TiberiumPY> latest is from git :) |
18:06:17 | FromGitter | <Bennyelg> lol :) |
18:06:24 | FromGitter | <TiberiumPY> because there are a lot of fixes going |
18:07:01 | FromGitter | <TiberiumPY> https://nim-lang.org/news/e029_version_0_16_0.html ⏎ almost four months old |
18:07:10 | dom96 | Bennyelg: works for me (on devel though) |
18:08:07 | FromGitter | <TiberiumPY> yeah, because tests will fail otherwise |
18:12:56 | FromGitter | <Bennyelg> trim string on NIM? |
18:15:23 | FromGitter | <TiberiumPY> strip you mean? |
18:16:07 | FromGitter | <Bennyelg> yea |
18:17:27 | FromGitter | <TiberiumPY> then use strip |
18:17:30 | FromGitter | <TiberiumPY> :D |
18:17:45 | FromGitter | <TiberiumPY> it's in strutils too |
18:17:56 | FromGitter | <Bennyelg> Thanks. |
18:18:06 | FromGitter | <TiberiumPY> you can use it like that: ⏎ let result = " asd ".strip() ⏎ or ⏎ let result = strip(" asd ") [https://gitter.im/nim-lang/Nim?at=58ed1de0bdf4acc1124d1b8a] |
18:18:13 | FromGitter | <TiberiumPY> you can use any proc like that |
18:18:20 | FromGitter | <TiberiumPY> UFCS |
18:22:47 | * | yglukhov joined #nim |
18:26:24 | * | kafke quit (Read error: Connection reset by peer) |
18:26:49 | * | yglukhov quit (Ping timeout: 245 seconds) |
18:29:02 | * | kafke joined #nim |
18:32:15 | Arrrr | Nice, last time i cheked ideone was using a really old build |
18:38:01 | * | kafke quit (Ping timeout: 268 seconds) |
18:38:04 | * | chemist69 quit (Ping timeout: 245 seconds) |
18:42:43 | * | chemist69 joined #nim |
18:44:36 | * | yglukhov joined #nim |
18:44:58 | * | gangstacat joined #nim |
18:45:44 | * | gangstacat quit (Client Quit) |
18:46:44 | * | kafke joined #nim |
18:51:10 | * | kafke quit (Ping timeout: 240 seconds) |
18:52:05 | * | vivus quit (Quit: Leaving) |
18:52:08 | * | gangstacat joined #nim |
18:57:22 | dom96 | I wish someone would write an ideone/glot.io for Nim ... in Nim :) |
18:57:23 | * | kafke joined #nim |
19:02:26 | FromGitter | <Varriount> dom96: Using Jester? |
19:02:38 | dom96 | sure? |
19:02:39 | * | kafke quit (Ping timeout: 245 seconds) |
19:06:54 | ldlework | Hello |
19:07:45 | * | Vladar quit (Quit: Leaving) |
19:10:26 | FromGitter | <TiberiumPY> the main thing - technology for containers |
19:10:55 | FromGitter | <TiberiumPY> you wouldn't execute any code on your server, because it can be malicious |
19:11:23 | FromGitter | <TiberiumPY> or you can make this website invite-only, or with manual moderator check |
19:14:27 | * | krux02 quit (Remote host closed the connection) |
19:14:42 | * | krux02 joined #nim |
19:20:40 | dom96 | Use playpen |
19:20:43 | dom96 | everyone's using it |
19:21:18 | dom96 | I'll even give you access to a shiny Nim server to host it on :) |
19:22:14 | * | Sembei joined #nim |
19:25:20 | ldlework | Docker would probably be enough |
19:25:29 | ldlework | If the server gets pwned you just churn it |
19:25:40 | ldlework | You can even use ASG to just cycle the server every day |
19:26:30 | * | brson quit (Ping timeout: 255 seconds) |
19:27:38 | * | brson joined #nim |
19:29:28 | dom96 | yeah, i'd rather not |
19:30:35 | Xe | webassembly backend when? |
19:30:58 | krux02 | Xe, as soon as you wrote it :P |
19:31:00 | ldlework | dom96: yeah you'd rather not what? |
19:31:18 | dom96 | Xe: already here via gcc/llvm |
19:31:22 | krux02 | last time I tried to do webassembly, it had too much friction for my preference |
19:31:24 | dom96 | ldlework: use docker for this |
19:31:28 | ldlework | dom96: ...why? |
19:31:46 | * | Sembei quit (Quit: WeeChat 1.8-dev) |
19:31:50 | dom96 | because I don't want to churn my server |
19:32:10 | Xe | dom96: would you be okay if the server was churned for you? |
19:32:19 | ldlework | yeah that's what I was implying |
19:32:30 | * | arnetheduck quit (Ping timeout: 240 seconds) |
19:32:39 | krux02 | I tried of official tutorial for a hello world, and it did not work |
19:33:00 | dom96 | *shrug* playpen was designed for this |
19:33:08 | FromGitter | <TiberiumPY> playpen? |
19:33:54 | ldlework | It looks like Playpen uses namespaces, cgroups and seccomp |
19:33:58 | FromGitter | <TiberiumPY> ah I see now |
19:33:58 | FromGitter | <TiberiumPY> https://github.com/thestinger/playpen |
19:33:58 | ldlework | Huh, just like Docker. |
19:34:30 | FromGitter | <TiberiumPY> bbbut |
19:34:34 | FromGitter | <TiberiumPY> last update was 2 years ago |
19:34:44 | FromGitter | <TiberiumPY> 1) 5 years ago :) |
19:34:51 | ldlework | It looks like it relies on exactly the same kernel services as Docker does, but yeah I'm sure playpen is a lot easier to use compared to docker (not) |
19:35:19 | ldlework | Not everything the Rust people do is the ideal case. |
19:35:35 | * | Nobabs27 joined #nim |
19:36:44 | dom96 | why would the server get pwnd under docker? |
19:37:07 | * | Arrrr quit (Quit: Leaving.) |
19:37:08 | ldlework | Same reason anything can get pwned? |
19:37:12 | FromGitter | <TiberiumPY> yeah, I'm wondering too |
19:37:18 | ldlework | Because there's no such thing as real security, even for virtualization. |
19:37:28 | ldlework | Only costs to the attacker. |
19:38:00 | FromGitter | <TiberiumPY> yeah, you wouldn't want to hack an online coding game if you've found a 0day exploit |
19:38:01 | ldlework | Looks like Playpen and Docker are on even ground. Docker might even be better at this point. It has lots of seccomp support and has everything listed on the Playpen README for sure. |
19:38:16 | FromGitter | <TiberiumPY> and it's updated a lot |
19:38:37 | ldlework | And obviously easier to deploy especially in a multi-user spin-me-up-an-environment scenario |
19:40:22 | ldlework | Though Docker does not have the little feature where you can turn on and off specific syscalls from the commandline |
19:40:26 | ldlework | Which is admittedly pretty cool |
19:40:32 | ldlework | But all that's doing is automating seccomp profiles |
19:41:04 | FromGitter | <TiberiumPY> or, for example |
19:41:07 | FromGitter | <TiberiumPY> codewars uses docker |
19:41:08 | FromGitter | <TiberiumPY> https://github.com/Codewars/codewars-runner-cli |
19:41:50 | * | gangstacat quit (Quit: Ĝis!) |
19:42:15 | * | rokups quit (Quit: Connection closed for inactivity) |
19:44:13 | * | gokr joined #nim |
19:46:24 | * | gangstacat joined #nim |
19:48:13 | dom96 | ldlework: maybe you'd be willing to write the online Nim compiler? :) |
19:48:55 | * | nsf joined #nim |
19:51:20 | * | kafke joined #nim |
19:55:14 | * | yglukhov quit (Remote host closed the connection) |
19:55:50 | * | yglukhov joined #nim |
20:00:18 | * | yglukhov quit (Ping timeout: 240 seconds) |
20:00:19 | dom96 | guess not |
20:01:55 | ldlework | dom96: I was pooping |
20:02:17 | ldlework | I don't think I'd be willing to write the actual tool, but I would definitely be willing to help deploy it and integrate with Docker |
20:02:28 | ldlework | dom96: I want to port Entitas to Nim |
20:02:57 | ldlework | I suppose the tool would be a good level challenge for TiberiumPY if they were interested |
20:03:03 | ldlework | Take some text, run the compiler, show the output |
20:03:42 | FromGitter | <Varriount> ldlework: TMI |
20:05:15 | * | Trustable joined #nim |
20:06:24 | dom96 | Alright. Hopefully somebody else will volunteer |
20:06:37 | dom96 | It's a pretty fun project in my opinion. |
20:07:27 | ldlework | TiberiumPY what do you think |
20:08:04 | * | shashlick quit (Ping timeout: 245 seconds) |
20:10:14 | * | shashlick joined #nim |
20:14:30 | FromGitter | <TiberiumPY> you're about https://github.com/sschmid/Entitas-CSharp ? |
20:14:39 | ldlework | ya |
20:14:50 | ldlework | But I was asking more about you writing the web compiler thingie |
20:19:59 | FromGitter | <TiberiumPY> well, I'm not good at anything in Nim right now :) ⏎ also (shame) I don't know HTML nor CSS nor JS |
20:20:19 | ldlework | TiberiumPY sure but this is such low scope that it shouldn't matter |
20:20:41 | ldlework | also HTML/CSS/JS are quite simple comparatively speaking |
20:23:21 | * | yglukhov joined #nim |
20:43:11 | * | Trustable quit (Remote host closed the connection) |
20:44:30 | * | chemist69 quit (Ping timeout: 240 seconds) |
20:46:17 | * | bjz joined #nim |
20:47:25 | * | chemist69 joined #nim |
20:47:42 | * | rauss quit (Quit: WeeChat 1.7) |
20:48:46 | * | vlad1777d joined #nim |
20:50:06 | * | yglukhov quit (Remote host closed the connection) |
20:55:37 | ldlework | Varriount, I'm getting object constructor needs object type for |
20:55:47 | ldlework | drawRect(sdl2.Rect(x: 10, y: 10, w: 10, h: 10)) |
20:55:50 | ldlework | err |
20:55:58 | ldlework | self.app.display.drawRect(sdl2.Rect(x: 10, y: 10, w: 10, h: 10)) |
20:56:21 | ldlework | display is a RendererPtr |
20:56:33 | ldlework | the call right above it works, self.app.display.setDrawColor(255, 0, 0, 255) |
20:56:45 | ldlework | oh maybe it wants a ref |
20:57:10 | ldlework | mm nope |
20:58:31 | ldlework | I'm confounded |
21:00:09 | ldlework | ah there we go |
21:00:11 | ldlework | it wanted cints |
21:00:17 | ldlework | jesus chrst that error is bad |
21:00:34 | ldlework | I'm gonna start saying "object constructor needs object type" in my sleep |
21:02:02 | ldlework | Any why when I write a converter from int to cint it doesn't automatically work without the .cint conversations |
21:02:06 | ldlework | conversions* |
21:11:43 | * | vivus joined #nim |
21:21:05 | * | libman quit (Quit: Connection closed for inactivity) |
21:25:22 | FromGitter | <Bennyelg> how do I add char to seq[char] |
21:26:00 | ldlework | Bennyelg, https://glot.io/snippets/eoumid845z |
21:26:26 | FromGitter | <Bennyelg> Thanks. |
21:27:04 | ldlework | Can someone remind me what is the thing that offers SDL2 / Web Canvas compatibility layer/ |
21:28:28 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:29:31 | dom96 | emscripten? |
21:29:43 | ldlework | That's not really what I mean |
21:29:53 | ldlework | I mean for nim based on the compilation target |
21:30:00 | ldlework | s/target/backend |
21:31:09 | FromGitter | <Bennyelg> CAST FROM CHARs to String? |
21:31:47 | ldlework | https://glot.io/snippets/eoumo68otz |
21:32:11 | * | bjz joined #nim |
21:32:48 | FromGitter | <Bennyelg> CHARS SET to string. |
21:33:11 | ldlework | dunno why you're speaking in all caps |
21:33:22 | ldlework | but access a single character in the string with array access |
21:33:42 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:35:39 | FromGitter | <Bennyelg> i want to convert char set to string |
21:36:18 | couven92 | I am discussing fork over at #csharp... And it got me thinking: How comfortable is Nim with doing fork()? Are there any caveats? |
21:40:00 | demi- | there is the posix module, as well as some functionality in the osproc module |
21:41:27 | couven92 | so it generally works well? Anyone ever tried to fork sth that communicates with a socket? |
21:41:47 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:45:18 | demi- | it should work the same way it does in C? |
21:47:16 | couven92 | ok, thx! :) |
21:49:24 | * | bjz joined #nim |
21:56:55 | * | krux02 quit (Remote host closed the connection) |
21:57:10 | * | krux02 joined #nim |
22:04:03 | * | nsf quit (Quit: WeeChat 1.7) |
22:08:33 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:10:23 | * | bjz joined #nim |
22:10:38 | * | Jesin quit (Quit: Leaving) |
22:28:31 | * | devted quit (Quit: Sleeping.) |
22:28:59 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:30:20 | FromGitter | <Varriount> ldlework: You have a converter from int to cint? |
22:31:26 | * | zachcarter joined #nim |
22:32:17 | FromGitter | <Varriount> couven92: Just be aware that fork() isn't in any way cross-platform |
22:33:52 | couven92 | @Varriount, yeah I know... As I said, I am actually thinking about doing fork in C# in order to implement user impersonation on POSIX systems. On Windows you'd just call the ImpersonateUser function and you'd be done... :P |
22:34:23 | couven92 | (Actually I cannot remember what the function is actually called in Win API, but it's something like that) |
22:36:07 | couven92 | The actual problem being: POSIX has the user access token at the process level, not at thread level like Windows... So for impersonation you either have to switch the user context for the entire process, or you have to fork |
22:36:17 | FromGitter | <Varriount> couven92: Does Mono even have fork()? |
22:37:09 | couven92 | @Varriount I do it using .NET Core! We don't do Mono anymore!!! (Ugh!) But no, you'll have to P/Invoke the fork call |
22:39:48 | ldlework | Varriount yes |
22:42:55 | * | bjz joined #nim |
22:46:25 | FromGitter | <Varriount> ldlework: And under what conditions is it not working? |
22:51:21 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:54:43 | vivus | how do I store an array of regexes ? |
22:56:07 | * | Jesin joined #nim |
23:06:45 | FromGitter | <Varriount> vivus: As an array of strings? |
23:07:10 | FromGitter | <Varriount> Or I guess as the Regex type in the nre module |
23:07:11 | vivus | @Varriount shouldn't the type be regex and not string ? |
23:13:42 | * | devted joined #nim |
23:17:49 | * | gokr quit (Ping timeout: 240 seconds) |
23:22:00 | zachcarter | Idlework: you around? sorry I missed you last night |
23:22:06 | zachcarter | / this morning |
23:23:23 | * | kafke quit () |
23:23:44 | * | vlad1777d quit (Remote host closed the connection) |
23:28:06 | zachcarter | man I’ve been missing the local history VS code extension all this time |
23:28:07 | zachcarter | ugh |
23:29:09 | FromGitter | <Varriount> *cough* https://josephg.com/blog/electron-is-flash-for-the-desktop/ *cough* |
23:29:46 | FromGitter | <Varriount> Though, I admit I don't know if VSCode and Atom use Electron or React Native |
23:30:06 | zachcarter | they use Electron |
23:30:11 | zachcarter | I’m pretty sure |
23:30:44 | zachcarter | Varriount, what do you use? |
23:30:52 | zachcarter | sublime text? |
23:30:55 | FromGitter | <Varriount> Yes. |
23:31:03 | zachcarter | does it work well with nim? |
23:31:17 | FromGitter | <Varriount> Unfortunately, not as well as VSCode |
23:31:25 | FromGitter | <Varriount> It doesn't have IDETools integration. |
23:31:39 | zachcarter | so it’s a trade off I guess |
23:31:47 | zachcarter | not being chrome vs being more feature rich |
23:31:52 | FromGitter | <Varriount> Though, it does have heuristic autocomplete, so I don't feel the lack quite as much. |
23:32:03 | * | Jesin quit (Quit: Leaving) |
23:32:46 | zachcarter | one of these days I’m going to spend time and get http://kakoune.org/ working well |
23:33:53 | * | couven92 quit (Quit: Leaving) |
23:35:34 | * | Jesin joined #nim |
23:36:30 | FromGitter | <Varriount> One day I'm actually going to learn a keyboard-driven editor. |
23:37:02 | zachcarter | I have a decent grasp on vim but kak looks nice |
23:37:17 | ldlework | zachcarter: I was going to propose that we collaborate to port Entitas to Nim |
23:37:54 | zachcarter | I don’t have any / much experience working with Entitas, it’s an ECS right? |
23:38:17 | zachcarter | going to read up on it real quick |
23:40:27 | zachcarter | wow, already a lot of various ports |
23:40:39 | ldlework | zachcarter: it has a really nice design |
23:40:54 | ldlework | it uses code generation to emit the exact classes and methods for a very natural api and cached implementation |
23:41:02 | ldlework | zachcarter: which is exactly what my ECS does |
23:41:08 | ldlework | but entitas has some nice features |
23:41:34 | ldlework | Though in Nim we don't need code generation we have macros |
23:41:53 | zachcarter | right |
23:43:03 | zachcarter | I’m looking at for instance the go port |
23:43:11 | zachcarter | doesn’t look like it has any of the code generation stuff ported |
23:46:49 | ldlework | nope |
23:47:07 | ldlework | I'm guessing most of the ports dont |
23:48:20 | zachcarter | I wouldn’t be opposed to helping with it, another ECS I saw that I thought was interesting was specs |
23:48:35 | zachcarter | https://github.com/slide-rs/specs |
23:50:27 | ldlework | god rust is so ugly |
23:50:54 | ldlework | I have no idea what its doing zachcarter |
23:51:01 | ldlework | w.register::<Position>(); |
23:51:11 | ldlework | Is this registering component types at runtime..? |
23:51:51 | zachcarter | I believe so |
23:54:13 | zachcarter | I have no experience working with it, I’ve just heard / read good things and its parallelism impressed me |
23:54:19 | * | devted quit (Quit: Sleeping.) |